@vuepress/theme-default 2.0.0-rc.33 → 2.0.0-rc.35

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 (107) hide show
  1. package/lib/client/components/VPDarkIcon.vue +8 -0
  2. package/lib/client/components/{DropdownTransition.vue → VPDropdownTransition.vue} +10 -1
  3. package/lib/client/components/VPEditIcon.vue +12 -0
  4. package/lib/client/components/VPHome.vue +38 -0
  5. package/lib/client/components/VPHomeFeatures.vue +68 -0
  6. package/lib/client/components/{HomeFooter.vue → VPHomeFooter.vue} +16 -2
  7. package/lib/client/components/{HomeHero.vue → VPHomeHero.vue} +107 -5
  8. package/lib/client/components/VPLightIcon.vue +28 -0
  9. package/lib/client/components/VPNavbar.vue +127 -0
  10. package/lib/client/components/{NavbarBrand.vue → VPNavbarBrand.vue} +36 -4
  11. package/lib/client/components/VPNavbarDropdown.vue +319 -0
  12. package/lib/client/components/VPNavbarItems.vue +110 -0
  13. package/lib/client/components/VPPage.vue +66 -0
  14. package/lib/client/components/VPPageMeta.vue +132 -0
  15. package/lib/client/components/VPPageNav.vue +118 -0
  16. package/lib/client/components/VPSidebar.vue +112 -0
  17. package/lib/client/components/VPSidebarItem.vue +169 -0
  18. package/lib/client/components/{SidebarItems.vue → VPSidebarItems.vue} +30 -6
  19. package/lib/client/components/VPToggleColorModeButton.vue +54 -0
  20. package/lib/client/components/VPToggleSidebarButton.vue +92 -0
  21. package/lib/client/components/global/Badge.vue +60 -18
  22. package/lib/client/components/global/CodeGroup.d.ts +1 -0
  23. package/lib/client/components/global/CodeGroup.js +4 -3
  24. package/lib/client/components/global/CodeGroupItem.vue +5 -16
  25. package/lib/client/composables/index.d.ts +4 -0
  26. package/lib/client/composables/index.js +4 -0
  27. package/lib/client/composables/useContributors.d.ts +3 -0
  28. package/lib/client/composables/useContributors.js +14 -0
  29. package/lib/client/composables/useDarkMode.js +1 -1
  30. package/lib/client/composables/useEditLink.d.ts +3 -0
  31. package/lib/client/composables/useEditLink.js +31 -0
  32. package/lib/client/composables/useLastUpdated.d.ts +2 -0
  33. package/lib/client/composables/useLastUpdated.js +17 -0
  34. package/lib/client/composables/useNavbarConfig.d.ts +2 -2
  35. package/lib/client/composables/useNavbarConfig.js +1 -1
  36. package/lib/client/composables/useNavbarRepo.d.ts +2 -2
  37. package/lib/client/composables/useNavbarRepo.js +1 -1
  38. package/lib/client/composables/useNavbarSelectLanguage.d.ts +2 -2
  39. package/lib/client/composables/useNavbarSelectLanguage.js +2 -2
  40. package/lib/client/composables/useNavigate.js +4 -7
  41. package/lib/client/composables/useRelatedLinks.d.ts +8 -0
  42. package/lib/client/composables/useRelatedLinks.js +91 -0
  43. package/lib/client/composables/useSidebarItems.d.ts +10 -9
  44. package/lib/client/composables/useSidebarItems.js +14 -14
  45. package/lib/client/config.js +4 -2
  46. package/lib/client/index.d.ts +1 -0
  47. package/lib/client/index.js +1 -0
  48. package/lib/client/layouts/Layout.vue +111 -18
  49. package/lib/client/layouts/NotFound.vue +1 -1
  50. package/lib/client/styles/_mixins.scss +4 -4
  51. package/lib/client/styles/_variables.module.scss +1 -1
  52. package/lib/client/styles/_variables.scss +1 -0
  53. package/lib/client/styles/code-group.scss +32 -29
  54. package/lib/client/styles/{code.scss → content/code.scss} +55 -31
  55. package/lib/client/styles/{custom-container.scss → content/custom-container.scss} +9 -5
  56. package/lib/client/styles/content/index.scss +4 -0
  57. package/lib/client/styles/content/normalize.scss +39 -0
  58. package/lib/client/styles/{toc.scss → content/toc.scss} +1 -1
  59. package/lib/client/styles/external-link-icon.scss +7 -3
  60. package/lib/client/styles/index.scss +2 -13
  61. package/lib/client/styles/layout.scss +3 -203
  62. package/lib/client/styles/normalize.scss +4 -3
  63. package/lib/client/styles/plugins.scss +20 -0
  64. package/lib/client/styles/vars-dark.scss +17 -16
  65. package/lib/client/styles/vars.scss +19 -23
  66. package/lib/client/typings.d.ts +13 -0
  67. package/lib/client/typings.js +1 -0
  68. package/lib/client/utils/getAutoLink.d.ts +9 -0
  69. package/lib/client/utils/{getNavLink.js → getAutoLink.js} +2 -2
  70. package/lib/client/utils/index.d.ts +1 -1
  71. package/lib/client/utils/index.js +1 -1
  72. package/lib/client/utils/isActiveSidebarItem.d.ts +2 -2
  73. package/lib/client/utils/isActiveSidebarItem.js +3 -3
  74. package/lib/node/defaultTheme.js +9 -1
  75. package/lib/node/utils/assignDefaultLocaleOptions.js +1 -1
  76. package/lib/shared/index.d.ts +2 -0
  77. package/lib/shared/index.js +2 -0
  78. package/lib/shared/nav.d.ts +21 -30
  79. package/lib/shared/navbar.d.ts +21 -0
  80. package/lib/shared/navbar.js +1 -0
  81. package/lib/shared/options.d.ts +6 -5
  82. package/lib/shared/page.d.ts +2 -2
  83. package/lib/shared/sidebar.d.ts +26 -0
  84. package/lib/shared/sidebar.js +1 -0
  85. package/package.json +18 -18
  86. package/templates/build.html +2 -0
  87. package/lib/client/components/Home.vue +0 -15
  88. package/lib/client/components/HomeContent.vue +0 -5
  89. package/lib/client/components/HomeFeatures.vue +0 -22
  90. package/lib/client/components/Navbar.vue +0 -80
  91. package/lib/client/components/NavbarDropdown.vue +0 -125
  92. package/lib/client/components/NavbarItems.vue +0 -51
  93. package/lib/client/components/Page.vue +0 -31
  94. package/lib/client/components/PageMeta.vue +0 -220
  95. package/lib/client/components/PageNav.vue +0 -228
  96. package/lib/client/components/Sidebar.vue +0 -18
  97. package/lib/client/components/SidebarItem.vue +0 -86
  98. package/lib/client/components/ToggleColorModeButton.vue +0 -57
  99. package/lib/client/components/ToggleSidebarButton.vue +0 -24
  100. package/lib/client/styles/badge.scss +0 -36
  101. package/lib/client/styles/home.scss +0 -168
  102. package/lib/client/styles/navbar-dropdown.scss +0 -177
  103. package/lib/client/styles/navbar.scss +0 -197
  104. package/lib/client/styles/page.scss +0 -11
  105. package/lib/client/styles/sidebar.scss +0 -128
  106. package/lib/client/styles/transitions.scss +0 -22
  107. package/lib/client/utils/getNavLink.d.ts +0 -9
@@ -1,220 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
3
- import type { ComputedRef } from 'vue'
4
- import { AutoLink, usePageData, usePageFrontmatter } from 'vuepress/client'
5
- import type { AutoLinkConfig } from 'vuepress/client'
6
- import type {
7
- DefaultThemeNormalPageFrontmatter,
8
- DefaultThemePageData,
9
- } from '../../shared/index.js'
10
- import { useThemeLocaleData } from '../composables/index.js'
11
- import { resolveEditLink } from '../utils/index.js'
12
-
13
- const useEditNavLink = (): ComputedRef<null | AutoLinkConfig> => {
14
- const themeLocale = useThemeLocaleData()
15
- const page = usePageData<DefaultThemePageData>()
16
- const frontmatter = usePageFrontmatter<DefaultThemeNormalPageFrontmatter>()
17
-
18
- return computed(() => {
19
- const showEditLink =
20
- frontmatter.value.editLink ?? themeLocale.value.editLink ?? true
21
- if (!showEditLink) {
22
- return null
23
- }
24
-
25
- const {
26
- repo,
27
- docsRepo = repo,
28
- docsBranch = 'main',
29
- docsDir = '',
30
- editLinkText,
31
- } = themeLocale.value
32
-
33
- if (!docsRepo) return null
34
-
35
- const editLink = resolveEditLink({
36
- docsRepo,
37
- docsBranch,
38
- docsDir,
39
- filePathRelative: page.value.filePathRelative,
40
- editLinkPattern:
41
- frontmatter.value.editLinkPattern ?? themeLocale.value.editLinkPattern,
42
- })
43
-
44
- if (!editLink) return null
45
-
46
- return {
47
- text: editLinkText ?? 'Edit this page',
48
- link: editLink,
49
- }
50
- })
51
- }
52
-
53
- const useLastUpdated = (): ComputedRef<null | string> => {
54
- const themeLocale = useThemeLocaleData()
55
- const page = usePageData<DefaultThemePageData>()
56
- const frontmatter = usePageFrontmatter<DefaultThemeNormalPageFrontmatter>()
57
-
58
- return computed(() => {
59
- const showLastUpdated =
60
- frontmatter.value.lastUpdated ?? themeLocale.value.lastUpdated ?? true
61
-
62
- if (!showLastUpdated) return null
63
-
64
- if (!page.value.git?.updatedTime) return null
65
-
66
- const updatedDate = new Date(page.value.git?.updatedTime)
67
-
68
- return updatedDate.toLocaleString()
69
- })
70
- }
71
-
72
- const useContributors = (): ComputedRef<
73
- null | Required<DefaultThemePageData['git']>['contributors']
74
- > => {
75
- const themeLocale = useThemeLocaleData()
76
- const page = usePageData<DefaultThemePageData>()
77
- const frontmatter = usePageFrontmatter<DefaultThemeNormalPageFrontmatter>()
78
-
79
- return computed(() => {
80
- const showContributors =
81
- frontmatter.value.contributors ?? themeLocale.value.contributors ?? true
82
-
83
- if (!showContributors) return null
84
-
85
- return page.value.git?.contributors ?? null
86
- })
87
- }
88
-
89
- const themeLocale = useThemeLocaleData()
90
- const editNavLink = useEditNavLink()
91
- const lastUpdated = useLastUpdated()
92
- const contributors = useContributors()
93
- </script>
94
-
95
- <template>
96
- <footer class="vp-page-meta">
97
- <div v-if="editNavLink" class="vp-meta-item edit-link">
98
- <AutoLink class="label" :config="editNavLink">
99
- <template #before>
100
- <svg class="icon" viewBox="0 0 1024 1024">
101
- <g fill="currentColor">
102
- <path
103
- d="M430.818 653.65a60.46 60.46 0 0 1-50.96-93.281l71.69-114.012 7.773-10.365L816.038 80.138A60.46 60.46 0 0 1 859.225 62a60.46 60.46 0 0 1 43.186 18.138l43.186 43.186a60.46 60.46 0 0 1 0 86.373L588.879 565.55l-8.637 8.637-117.466 68.234a60.46 60.46 0 0 1-31.958 11.229z"
104
- />
105
- <path
106
- d="M728.802 962H252.891A190.883 190.883 0 0 1 62.008 771.98V296.934a190.883 190.883 0 0 1 190.883-192.61h267.754a60.46 60.46 0 0 1 0 120.92H252.891a69.962 69.962 0 0 0-69.098 69.099V771.98a69.962 69.962 0 0 0 69.098 69.098h475.911A69.962 69.962 0 0 0 797.9 771.98V503.363a60.46 60.46 0 1 1 120.922 0V771.98A190.883 190.883 0 0 1 728.802 962z"
107
- />
108
- </g>
109
- </svg>
110
- </template>
111
- </AutoLink>
112
- </div>
113
-
114
- <div class="vp-meta-item git-info">
115
- <div v-if="lastUpdated" class="vp-meta-item last-updated">
116
- <span class="meta-item-label">{{ themeLocale.lastUpdatedText }}: </span>
117
- <ClientOnly>
118
- <span class="meta-item-info">{{ lastUpdated }}</span>
119
- </ClientOnly>
120
- </div>
121
-
122
- <div
123
- v-if="contributors && contributors.length"
124
- class="vp-meta-item contributors"
125
- >
126
- <span class="meta-item-label"
127
- >{{ themeLocale.contributorsText }}:
128
- </span>
129
- <span class="meta-item-info">
130
- <template v-for="(contributor, index) in contributors" :key="index">
131
- <span class="contributor" :title="`email: ${contributor.email}`">
132
- {{ contributor.name }}
133
- </span>
134
- <template v-if="index !== contributors.length - 1">, </template>
135
- </template>
136
- </span>
137
- </div>
138
- </div>
139
- </footer>
140
- </template>
141
-
142
- <style lang="scss">
143
- @use '../styles/mixins';
144
- @import '../styles/_variables';
145
-
146
- .vp-page-meta {
147
- @include mixins.content_wrapper;
148
-
149
- display: flex;
150
- flex-wrap: wrap;
151
- justify-content: space-between;
152
-
153
- overflow: auto;
154
-
155
- padding-top: 0.75rem;
156
- padding-bottom: 0.75rem;
157
-
158
- @media print {
159
- margin: 0 !important;
160
- padding-inline: 0 !important;
161
- }
162
-
163
- @media (max-width: $MQMobile) {
164
- display: block;
165
- }
166
-
167
- .vp-meta-item {
168
- flex-grow: 1;
169
-
170
- .vp-meta-label {
171
- font-weight: 500;
172
-
173
- &:not(a) {
174
- color: var(--c-text-lighter);
175
- }
176
- }
177
-
178
- .vp-meta-info {
179
- color: var(--c-text-quote);
180
- font-weight: 400;
181
- }
182
- }
183
-
184
- .git-info {
185
- text-align: end;
186
- }
187
-
188
- .edit-link {
189
- margin-top: 0.25rem;
190
- margin-bottom: 0.25rem;
191
- margin-inline-end: 0.5rem;
192
- font-size: 14px;
193
-
194
- @media print {
195
- display: none;
196
- }
197
-
198
- .icon {
199
- position: relative;
200
- bottom: -0.125em;
201
-
202
- width: 1em;
203
- height: 1em;
204
- margin-inline-end: 0.25em;
205
- }
206
- }
207
-
208
- .last-updated,
209
- .contributors {
210
- margin-top: 0.25rem;
211
- margin-bottom: 0.25rem;
212
- font-size: 14px;
213
-
214
- @media (max-width: $MQMobile) {
215
- font-size: 13px;
216
- text-align: start;
217
- }
218
- }
219
- }
220
- </style>
@@ -1,228 +0,0 @@
1
- <script setup lang="ts">
2
- import { useEventListener } from '@vueuse/core'
3
- import { computed } from 'vue'
4
- import {
5
- AutoLink,
6
- resolveRoute,
7
- usePageFrontmatter,
8
- useRoute,
9
- } from 'vuepress/client'
10
- import type { AutoLinkConfig } from 'vuepress/client'
11
- import { isPlainObject, isString } from 'vuepress/shared'
12
- import type {
13
- DefaultThemeNormalPageFrontmatter,
14
- ResolvedSidebarItem,
15
- } from '../../shared/index.js'
16
- import {
17
- useNavigate,
18
- useSidebarItems,
19
- useThemeLocaleData,
20
- } from '../composables/index.js'
21
-
22
- /**
23
- * Resolve `prev` or `next` config from frontmatter
24
- */
25
- const resolveFromFrontmatterConfig = (
26
- conf: unknown,
27
- current: string,
28
- ): null | false | AutoLinkConfig => {
29
- if (conf === false) {
30
- return null
31
- }
32
-
33
- if (isString(conf)) {
34
- const { notFound, meta, path } = resolveRoute<{
35
- title?: string
36
- }>(conf, current)
37
-
38
- return notFound
39
- ? { text: path, link: path }
40
- : {
41
- text: meta.title || path,
42
- link: path,
43
- }
44
- }
45
-
46
- if (isPlainObject<AutoLinkConfig>(conf)) {
47
- return {
48
- ...conf,
49
- link: resolveRoute(conf.link, current).path,
50
- }
51
- }
52
-
53
- return false
54
- }
55
-
56
- /**
57
- * Resolve `prev` or `next` config from sidebar items
58
- */
59
- const resolveFromSidebarItems = (
60
- sidebarItems: ResolvedSidebarItem[],
61
- currentPath: string,
62
- offset: number,
63
- ): null | AutoLinkConfig => {
64
- const index = sidebarItems.findIndex((item) => item.link === currentPath)
65
- if (index !== -1) {
66
- const targetItem = sidebarItems[index + offset]
67
- if (!targetItem?.link) {
68
- return null
69
- }
70
- return targetItem as AutoLinkConfig
71
- }
72
-
73
- for (const item of sidebarItems) {
74
- if (item.children) {
75
- const childResult = resolveFromSidebarItems(
76
- item.children,
77
- currentPath,
78
- offset,
79
- )
80
- if (childResult) {
81
- return childResult
82
- }
83
- }
84
- }
85
-
86
- return null
87
- }
88
-
89
- const frontmatter = usePageFrontmatter<DefaultThemeNormalPageFrontmatter>()
90
- const sidebarItems = useSidebarItems()
91
- const themeLocale = useThemeLocaleData()
92
- const route = useRoute()
93
- const navigate = useNavigate()
94
-
95
- const prevNavLink = computed(() => {
96
- const prevConfig = resolveFromFrontmatterConfig(
97
- frontmatter.value.prev,
98
- route.path,
99
- )
100
- if (prevConfig !== false) {
101
- return prevConfig
102
- }
103
-
104
- return resolveFromSidebarItems(sidebarItems.value, route.path, -1)
105
- })
106
-
107
- const nextNavLink = computed(() => {
108
- const nextConfig = resolveFromFrontmatterConfig(
109
- frontmatter.value.next,
110
- route.path,
111
- )
112
- if (nextConfig !== false) {
113
- return nextConfig
114
- }
115
-
116
- return resolveFromSidebarItems(sidebarItems.value, route.path, 1)
117
- })
118
-
119
- const navbarLabel = computed(() => {
120
- const themeLocale = useThemeLocaleData()
121
- return themeLocale.value.pageNavbarLabel ?? 'page navigation'
122
- })
123
-
124
- useEventListener('keydown', (event): void => {
125
- if (event.altKey)
126
- if (event.key === 'ArrowRight') {
127
- if (nextNavLink.value) {
128
- navigate(nextNavLink.value.link)
129
- event.preventDefault()
130
- }
131
- } else if (event.key === 'ArrowLeft') {
132
- if (prevNavLink.value) {
133
- navigate(prevNavLink.value.link)
134
- event.preventDefault()
135
- }
136
- }
137
- })
138
- </script>
139
-
140
- <template>
141
- <nav
142
- v-if="prevNavLink || nextNavLink"
143
- class="vp-page-nav"
144
- :aria-label="navbarLabel"
145
- >
146
- <AutoLink v-if="prevNavLink" class="prev" :config="prevNavLink">
147
- <div class="hint">
148
- <span class="arrow left" />
149
- {{ themeLocale.prev ?? 'Prev' }}
150
- </div>
151
- <div class="link">
152
- <span>{{ prevNavLink.text }}</span>
153
- </div>
154
- </AutoLink>
155
-
156
- <AutoLink v-if="nextNavLink" class="next" :config="nextNavLink">
157
- <div class="hint">
158
- {{ themeLocale.next ?? 'Next' }}
159
- <span class="arrow right" />
160
- </div>
161
- <div class="link">
162
- <span>{{ nextNavLink.text }}</span>
163
- </div>
164
- </AutoLink>
165
- </nav>
166
- </template>
167
-
168
- <style lang="scss">
169
- @import '../styles/variables';
170
-
171
- .vp-page-nav {
172
- display: flex;
173
- flex-wrap: wrap;
174
-
175
- max-width: var(--content-width, 740px);
176
- min-height: 2rem;
177
- margin-inline: auto;
178
- margin-top: 0;
179
- padding-block: 0.5rem;
180
- padding-inline: 2rem;
181
- border-top: 1px solid var(--c-border);
182
-
183
- transition: border-top var(--t-color);
184
-
185
- @media (max-width: $MQNarrow) {
186
- padding-inline: 1rem;
187
- }
188
-
189
- @media print {
190
- display: none;
191
- }
192
-
193
- padding-top: 1rem;
194
- padding-bottom: 0;
195
-
196
- @media print {
197
- display: none;
198
- }
199
-
200
- .route-link {
201
- display: inline-block;
202
- flex-grow: 1;
203
-
204
- margin: 0.25rem;
205
- padding: 0.25rem 0.5rem;
206
- border: 1px solid var(--c-border);
207
- border-radius: 0.25rem;
208
-
209
- &:hover {
210
- background: var(--c-bg-light);
211
- }
212
-
213
- .hint {
214
- color: var(--c-text-quote);
215
- font-size: 0.875rem;
216
- line-height: 2;
217
- }
218
- }
219
-
220
- .prev {
221
- text-align: start;
222
- }
223
-
224
- .next {
225
- text-align: end;
226
- }
227
- }
228
- </style>
@@ -1,18 +0,0 @@
1
- <script setup lang="ts">
2
- import NavbarItems from '@theme/NavbarItems.vue'
3
- import SidebarItems from '@theme/SidebarItems.vue'
4
-
5
- defineSlots<{
6
- top?: (props: Record<never, never>) => any
7
- bottom?: (props: Record<never, never>) => any
8
- }>()
9
- </script>
10
-
11
- <template>
12
- <aside class="sidebar">
13
- <NavbarItems />
14
- <slot name="top" />
15
- <SidebarItems />
16
- <slot name="bottom" />
17
- </aside>
18
- </template>
@@ -1,86 +0,0 @@
1
- <script setup lang="ts">
2
- import DropdownTransition from '@theme/DropdownTransition.vue'
3
- import { useToggle } from '@vueuse/core'
4
- import { computed, nextTick, onBeforeUnmount, toRefs } from 'vue'
5
- import type { PropType } from 'vue'
6
- import { AutoLink, useRoute, useRouter } from 'vuepress/client'
7
- import type { ResolvedSidebarItem } from '../../shared/index.js'
8
- import { isActiveSidebarItem } from '../utils/index.js'
9
-
10
- const props = defineProps({
11
- item: {
12
- type: Object as PropType<ResolvedSidebarItem>,
13
- required: true,
14
- },
15
- depth: {
16
- type: Number,
17
- required: false,
18
- default: 0,
19
- },
20
- })
21
-
22
- const { item, depth } = toRefs(props)
23
- const route = useRoute()
24
- const router = useRouter()
25
-
26
- const isActive = computed(() => isActiveSidebarItem(item.value, route))
27
- const itemClass = computed(() => ({
28
- 'sidebar-item': true,
29
- 'sidebar-heading': depth.value === 0,
30
- 'active': isActive.value,
31
- 'collapsible': item.value.collapsible,
32
- }))
33
-
34
- const isOpenDefault = computed(() =>
35
- item.value.collapsible ? isActive.value : true,
36
- )
37
- const [isOpen, toggleIsOpen] = useToggle(isOpenDefault.value)
38
- const onClick = (e: Event): void => {
39
- if (item.value.collapsible) {
40
- e.preventDefault()
41
- // toggle open status on click
42
- toggleIsOpen()
43
- }
44
- }
45
-
46
- // reset open status after navigation
47
- const unregisterRouterHook = router.afterEach((to) => {
48
- nextTick(() => {
49
- isOpen.value = isOpenDefault.value
50
- })
51
- })
52
- onBeforeUnmount(() => {
53
- unregisterRouterHook()
54
- })
55
- </script>
56
-
57
- <template>
58
- <li>
59
- <AutoLink v-if="item.link" :class="itemClass" :config="item" />
60
- <p
61
- v-else
62
- tabindex="0"
63
- :class="itemClass"
64
- @click="onClick"
65
- @keydown.enter="onClick"
66
- >
67
- {{ item.text }}
68
- <span
69
- v-if="item.collapsible"
70
- class="arrow"
71
- :class="isOpen ? 'down' : 'right'"
72
- />
73
- </p>
74
-
75
- <DropdownTransition v-if="item.children?.length">
76
- <ul v-show="isOpen" class="sidebar-item-children">
77
- <SidebarItem
78
- v-for="child in item.children"
79
- :key="`${depth}${child.text}${child.link}`"
80
- :item="child"
81
- :depth="depth + 1"
82
- />
83
- </ul>
84
- </DropdownTransition>
85
- </li>
86
- </template>
@@ -1,57 +0,0 @@
1
- <script setup lang="ts">
2
- import { useDarkMode, useThemeLocaleData } from '../composables/index.js'
3
-
4
- const themeLocale = useThemeLocaleData()
5
- const isDarkMode = useDarkMode()
6
-
7
- const toggleColorMode = (): void => {
8
- isDarkMode.value = !isDarkMode.value
9
- }
10
- </script>
11
-
12
- <template>
13
- <button
14
- class="toggle-color-mode-button"
15
- :title="themeLocale.toggleColorMode"
16
- @click="toggleColorMode"
17
- >
18
- <svg
19
- v-show="!isDarkMode"
20
- class="icon"
21
- focusable="false"
22
- viewBox="0 0 32 32"
23
- >
24
- <path
25
- d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z"
26
- fill="currentColor"
27
- />
28
- <path
29
- d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z"
30
- fill="currentColor"
31
- />
32
- <path d="M2 15.005h5v2H2z" fill="currentColor" />
33
- <path
34
- d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z"
35
- fill="currentColor"
36
- />
37
- <path d="M15 25.005h2v5h-2z" fill="currentColor" />
38
- <path
39
- d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z"
40
- fill="currentColor"
41
- />
42
- <path d="M25 15.005h5v2h-5z" fill="currentColor" />
43
- <path
44
- d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z"
45
- fill="currentColor"
46
- />
47
- <path d="M15 2.005h2v5h-2z" fill="currentColor" />
48
- </svg>
49
-
50
- <svg v-show="isDarkMode" class="icon" focusable="false" viewBox="0 0 32 32">
51
- <path
52
- d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z"
53
- fill="currentColor"
54
- />
55
- </svg>
56
- </button>
57
- </template>
@@ -1,24 +0,0 @@
1
- <script setup lang="ts">
2
- import { useThemeLocaleData } from '../composables/index.js'
3
-
4
- defineEmits<(e: 'toggle') => void>()
5
-
6
- const themeLocale = useThemeLocaleData()
7
- </script>
8
-
9
- <template>
10
- <div
11
- class="toggle-sidebar-button"
12
- :title="themeLocale.toggleSidebar"
13
- aria-expanded="false"
14
- role="button"
15
- tabindex="0"
16
- @click="$emit('toggle')"
17
- >
18
- <div class="icon" aria-hidden="true">
19
- <span></span>
20
- <span></span>
21
- <span></span>
22
- </div>
23
- </div>
24
- </template>
@@ -1,36 +0,0 @@
1
- .badge {
2
- display: inline-block;
3
- font-size: 14px;
4
- font-weight: 600;
5
- height: 18px;
6
- line-height: 18px;
7
- border-radius: 3px;
8
- padding: 0 6px;
9
- color: var(--c-bg);
10
- vertical-align: top;
11
- transition:
12
- color var(--t-color),
13
- background-color var(--t-color);
14
-
15
- &.tip {
16
- background-color: var(--c-badge-tip);
17
- }
18
-
19
- &.warning {
20
- background-color: var(--c-badge-warning);
21
- color: var(--c-badge-warning-text);
22
- }
23
-
24
- &.danger {
25
- background-color: var(--c-badge-danger);
26
- color: var(--c-badge-danger-text);
27
- }
28
-
29
- .table-of-contents & {
30
- vertical-align: middle;
31
- }
32
-
33
- & + & {
34
- margin-left: 5px;
35
- }
36
- }