@vuepress/theme-default 2.0.0-rc.9 → 2.0.0-rc.90

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 (145) hide show
  1. package/lib/client/components/VPAutoLink.vue +32 -0
  2. package/lib/client/components/VPDarkIcon.vue +8 -0
  3. package/lib/client/components/VPDropdownTransition.vue +43 -0
  4. package/lib/client/components/VPEditIcon.vue +12 -0
  5. package/lib/client/components/VPFadeSlideYTransition.vue +43 -0
  6. package/lib/client/components/VPHome.vue +37 -0
  7. package/lib/client/components/VPHomeFeatures.vue +65 -0
  8. package/lib/client/components/{HomeFooter.vue → VPHomeFooter.vue} +16 -3
  9. package/lib/client/components/VPHomeHero.vue +185 -0
  10. package/lib/client/components/VPLightIcon.vue +28 -0
  11. package/lib/client/components/VPNavbar.vue +134 -0
  12. package/lib/client/components/{NavbarBrand.vue → VPNavbarBrand.vue} +41 -16
  13. package/lib/client/components/VPNavbarDropdown.vue +328 -0
  14. package/lib/client/components/VPNavbarItems.vue +111 -0
  15. package/lib/client/components/VPPage.vue +69 -0
  16. package/lib/client/components/VPPageMeta.vue +139 -0
  17. package/lib/client/components/VPPageNav.vue +123 -0
  18. package/lib/client/components/VPSidebar.vue +120 -0
  19. package/lib/client/components/VPSidebarItem.vue +189 -0
  20. package/lib/client/components/{SidebarItems.vue → VPSidebarItems.vue} +27 -7
  21. package/lib/client/components/VPToggleColorModeButton.vue +55 -0
  22. package/lib/client/components/VPToggleSidebarButton.vue +92 -0
  23. package/lib/client/components/global/Badge.vue +84 -18
  24. package/lib/client/components/global/index.d.ts +1 -3
  25. package/lib/client/components/global/index.js +1 -3
  26. package/lib/client/composables/index.d.ts +7 -1
  27. package/lib/client/composables/index.js +7 -1
  28. package/lib/client/composables/useDarkMode.d.ts +0 -1
  29. package/lib/client/composables/useDarkMode.js +19 -16
  30. package/lib/client/composables/useData.d.ts +13 -0
  31. package/lib/client/composables/useData.js +15 -0
  32. package/lib/client/composables/useEditLink.d.ts +3 -0
  33. package/lib/client/composables/useEditLink.js +28 -0
  34. package/lib/client/composables/useHeaders.d.ts +9 -0
  35. package/lib/client/composables/useHeaders.js +38 -0
  36. package/lib/client/composables/useNavbarConfig.d.ts +3 -0
  37. package/lib/client/composables/useNavbarConfig.js +29 -0
  38. package/lib/client/composables/useNavbarRepo.d.ts +6 -0
  39. package/lib/client/composables/useNavbarRepo.js +38 -0
  40. package/lib/client/composables/useNavbarSelectLanguage.d.ts +6 -0
  41. package/lib/client/composables/useNavbarSelectLanguage.js +55 -0
  42. package/lib/client/composables/useNavigate.d.ts +1 -0
  43. package/lib/client/composables/useNavigate.js +22 -0
  44. package/lib/client/composables/useRelatedLinks.d.ts +8 -0
  45. package/lib/client/composables/useRelatedLinks.js +90 -0
  46. package/lib/client/composables/useScrollPromise.js +3 -1
  47. package/lib/client/composables/useSidebarItems.d.ts +21 -21
  48. package/lib/client/composables/useSidebarItems.js +96 -86
  49. package/lib/client/composables/useUpdateDeviceStatus.d.ts +1 -1
  50. package/lib/client/composables/useUpdateDeviceStatus.js +10 -5
  51. package/lib/client/config.d.ts +3 -2
  52. package/lib/client/config.js +8 -23
  53. package/lib/client/index.d.ts +2 -1
  54. package/lib/client/index.js +0 -1
  55. package/lib/client/layouts/Layout.vue +128 -56
  56. package/lib/client/layouts/NotFound.vue +25 -11
  57. package/lib/client/shim.d.ts +6 -5
  58. package/lib/client/styles/_mixins.scss +4 -4
  59. package/lib/client/styles/_variables.module.scss +1 -1
  60. package/lib/client/styles/_variables.scss +2 -1
  61. package/lib/client/styles/arrow.scss +24 -22
  62. package/lib/client/styles/code-group.scss +34 -30
  63. package/lib/client/styles/content/code.scss +23 -0
  64. package/lib/client/styles/content/index.scss +3 -0
  65. package/lib/client/styles/content/normalize.scss +39 -0
  66. package/lib/client/styles/{toc.scss → content/toc.scss} +1 -1
  67. package/lib/client/styles/external-link-icon.scss +36 -0
  68. package/lib/client/styles/index.scss +3 -13
  69. package/lib/client/styles/layout.scss +5 -197
  70. package/lib/client/styles/normalize.scss +1 -194
  71. package/lib/client/styles/plugins.scss +28 -0
  72. package/lib/client/styles/vars-dark.scss +20 -58
  73. package/lib/client/styles/vars.scss +54 -130
  74. package/lib/client/typings.d.ts +13 -0
  75. package/lib/client/typings.js +1 -0
  76. package/lib/client/utils/index.d.ts +2 -2
  77. package/lib/client/utils/index.js +2 -2
  78. package/lib/client/utils/isActiveSidebarItem.d.ts +3 -3
  79. package/lib/client/utils/isActiveSidebarItem.js +1 -1
  80. package/lib/client/utils/resolveAutoLink.d.ts +9 -0
  81. package/lib/client/utils/resolveAutoLink.js +17 -0
  82. package/lib/client/utils/resolveEditLink.d.ts +3 -3
  83. package/lib/client/utils/resolveEditLink.js +3 -3
  84. package/lib/client/utils/resolvePrefix.d.ts +1 -0
  85. package/lib/client/utils/resolvePrefix.js +4 -0
  86. package/lib/client/utils/resolveRepoType.d.ts +1 -1
  87. package/lib/client/utils/resolveRepoType.js +4 -4
  88. package/lib/node/defaultTheme.d.ts +2 -1
  89. package/lib/node/defaultTheme.js +57 -64
  90. package/lib/node/index.d.ts +2 -3
  91. package/lib/node/index.js +0 -3
  92. package/lib/node/typings.d.ts +59 -0
  93. package/lib/node/typings.js +1 -0
  94. package/lib/node/utils/assignDefaultLocaleOptions.js +3 -8
  95. package/lib/node/utils/index.d.ts +1 -1
  96. package/lib/node/utils/index.js +1 -1
  97. package/lib/node/utils/resolveMarkdownHintLocales.d.ts +9 -0
  98. package/lib/node/utils/resolveMarkdownHintLocales.js +19 -0
  99. package/lib/shared/index.d.ts +5 -3
  100. package/lib/shared/index.js +1 -3
  101. package/lib/shared/nav.d.ts +19 -30
  102. package/lib/shared/navbar.d.ts +21 -0
  103. package/lib/shared/navbar.js +1 -0
  104. package/lib/shared/options.d.ts +36 -66
  105. package/lib/shared/page.d.ts +9 -6
  106. package/lib/shared/sidebar.d.ts +26 -0
  107. package/lib/shared/sidebar.js +1 -0
  108. package/package.json +29 -27
  109. package/templates/build.html +16 -10
  110. package/lib/client/components/AutoLink.vue +0 -113
  111. package/lib/client/components/DropdownTransition.vue +0 -25
  112. package/lib/client/components/Home.vue +0 -15
  113. package/lib/client/components/HomeContent.vue +0 -5
  114. package/lib/client/components/HomeFeatures.vue +0 -22
  115. package/lib/client/components/HomeHero.vue +0 -97
  116. package/lib/client/components/Navbar.vue +0 -79
  117. package/lib/client/components/NavbarDropdown.vue +0 -126
  118. package/lib/client/components/NavbarItems.vue +0 -199
  119. package/lib/client/components/Page.vue +0 -31
  120. package/lib/client/components/PageMeta.vue +0 -124
  121. package/lib/client/components/PageNav.vue +0 -122
  122. package/lib/client/components/Sidebar.vue +0 -18
  123. package/lib/client/components/SidebarItem.vue +0 -87
  124. package/lib/client/components/ToggleColorModeButton.vue +0 -57
  125. package/lib/client/components/ToggleSidebarButton.vue +0 -24
  126. package/lib/client/components/global/CodeGroup.d.ts +0 -6
  127. package/lib/client/components/global/CodeGroup.js +0 -120
  128. package/lib/client/components/global/CodeGroupItem.vue +0 -27
  129. package/lib/client/composables/useThemeData.d.ts +0 -4
  130. package/lib/client/composables/useThemeData.js +0 -3
  131. package/lib/client/styles/badge.scss +0 -36
  132. package/lib/client/styles/code.scss +0 -263
  133. package/lib/client/styles/custom-container.scss +0 -142
  134. package/lib/client/styles/home.scss +0 -168
  135. package/lib/client/styles/navbar-dropdown.scss +0 -183
  136. package/lib/client/styles/navbar.scss +0 -197
  137. package/lib/client/styles/page.scss +0 -87
  138. package/lib/client/styles/sidebar.scss +0 -134
  139. package/lib/client/styles/transitions.scss +0 -22
  140. package/lib/client/utils/getNavLink.d.ts +0 -15
  141. package/lib/client/utils/getNavLink.js +0 -18
  142. package/lib/client/utils/getResolveRouteWithRedirect.d.ts +0 -5
  143. package/lib/client/utils/getResolveRouteWithRedirect.js +0 -22
  144. package/lib/node/utils/resolveContainerPluginOptions.d.ts +0 -8
  145. package/lib/node/utils/resolveContainerPluginOptions.js +0 -17
@@ -1,122 +0,0 @@
1
- <script setup lang="ts">
2
- import AutoLink from '@theme/AutoLink.vue'
3
- import { computed } from 'vue'
4
- import type { Router } from 'vue-router'
5
- import { useRoute, useRouter } from 'vue-router'
6
- import { usePageFrontmatter } from 'vuepress/client'
7
- import { isPlainObject, isString } from 'vuepress/shared'
8
- import type {
9
- DefaultThemeNormalPageFrontmatter,
10
- NavLink,
11
- ResolvedSidebarItem,
12
- } from '../../shared/index.js'
13
- import { useSidebarItems, useThemeLocaleData } from '../composables/index.js'
14
- import { getNavLink } from '../utils/index.js'
15
-
16
- /**
17
- * Resolve `prev` or `next` config from frontmatter
18
- */
19
- const resolveFromFrontmatterConfig = (
20
- router: Router,
21
- conf: unknown,
22
- ): null | false | NavLink => {
23
- if (conf === false) {
24
- return null
25
- }
26
-
27
- if (isString(conf)) {
28
- return getNavLink(router, conf)
29
- }
30
-
31
- if (isPlainObject<NavLink>(conf)) {
32
- return conf
33
- }
34
-
35
- return false
36
- }
37
-
38
- /**
39
- * Resolve `prev` or `next` config from sidebar items
40
- */
41
- const resolveFromSidebarItems = (
42
- sidebarItems: ResolvedSidebarItem[],
43
- currentPath: string,
44
- offset: number,
45
- ): null | NavLink => {
46
- const index = sidebarItems.findIndex((item) => item.link === currentPath)
47
- if (index !== -1) {
48
- const targetItem = sidebarItems[index + offset]
49
- if (!targetItem?.link) {
50
- return null
51
- }
52
- return targetItem as NavLink
53
- }
54
-
55
- for (const item of sidebarItems) {
56
- if (item.children) {
57
- const childResult = resolveFromSidebarItems(
58
- item.children,
59
- currentPath,
60
- offset,
61
- )
62
- if (childResult) {
63
- return childResult
64
- }
65
- }
66
- }
67
-
68
- return null
69
- }
70
-
71
- const frontmatter = usePageFrontmatter<DefaultThemeNormalPageFrontmatter>()
72
- const sidebarItems = useSidebarItems()
73
- const route = useRoute()
74
- const router = useRouter()
75
-
76
- const prevNavLink = computed(() => {
77
- const prevConfig = resolveFromFrontmatterConfig(
78
- router,
79
- frontmatter.value.prev,
80
- )
81
- if (prevConfig !== false) {
82
- return prevConfig
83
- }
84
-
85
- return resolveFromSidebarItems(sidebarItems.value, route.path, -1)
86
- })
87
-
88
- const nextNavLink = computed(() => {
89
- const nextConfig = resolveFromFrontmatterConfig(
90
- router,
91
- frontmatter.value.next,
92
- )
93
- if (nextConfig !== false) {
94
- return nextConfig
95
- }
96
-
97
- return resolveFromSidebarItems(sidebarItems.value, route.path, 1)
98
- })
99
-
100
- const navbarLabel = computed(() => {
101
- const themeLocale = useThemeLocaleData()
102
- return themeLocale.value.pageNavbarLabel ?? 'page navigation'
103
- })
104
- </script>
105
-
106
- <template>
107
- <nav
108
- v-if="prevNavLink || nextNavLink"
109
- class="page-nav"
110
- :aria-label="navbarLabel"
111
- >
112
- <p class="inner">
113
- <span v-if="prevNavLink" class="prev">
114
- <AutoLink :item="prevNavLink" />
115
- </span>
116
-
117
- <span v-if="nextNavLink" class="next">
118
- <AutoLink :item="nextNavLink" />
119
- </span>
120
- </p>
121
- </nav>
122
- </template>
@@ -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,87 +0,0 @@
1
- <script setup lang="ts">
2
- import AutoLink from '@theme/AutoLink.vue'
3
- import DropdownTransition from '@theme/DropdownTransition.vue'
4
- import { useToggle } from '@vueuse/core'
5
- import { computed, nextTick, onBeforeUnmount, toRefs } from 'vue'
6
- import type { PropType } from 'vue'
7
- import { useRoute, useRouter } from 'vue-router'
8
- import type { ResolvedSidebarItem } from '../../shared/index.js'
9
- import { isActiveSidebarItem } from '../utils/index.js'
10
-
11
- const props = defineProps({
12
- item: {
13
- type: Object as PropType<ResolvedSidebarItem>,
14
- required: true,
15
- },
16
- depth: {
17
- type: Number,
18
- required: false,
19
- default: 0,
20
- },
21
- })
22
-
23
- const { item, depth } = toRefs(props)
24
- const route = useRoute()
25
- const router = useRouter()
26
-
27
- const isActive = computed(() => isActiveSidebarItem(item.value, route))
28
- const itemClass = computed(() => ({
29
- 'sidebar-item': true,
30
- 'sidebar-heading': depth.value === 0,
31
- 'active': isActive.value,
32
- 'collapsible': item.value.collapsible,
33
- }))
34
-
35
- const isOpenDefault = computed(() =>
36
- item.value.collapsible ? isActive.value : true,
37
- )
38
- const [isOpen, toggleIsOpen] = useToggle(isOpenDefault.value)
39
- const onClick = (e: Event): void => {
40
- if (item.value.collapsible) {
41
- e.preventDefault()
42
- // toggle open status on click
43
- toggleIsOpen()
44
- }
45
- }
46
-
47
- // reset open status after navigation
48
- const unregisterRouterHook = router.afterEach((to) => {
49
- nextTick(() => {
50
- isOpen.value = isOpenDefault.value
51
- })
52
- })
53
- onBeforeUnmount(() => {
54
- unregisterRouterHook()
55
- })
56
- </script>
57
-
58
- <template>
59
- <li>
60
- <AutoLink v-if="item.link" :class="itemClass" :item="item" />
61
- <p
62
- v-else
63
- tabindex="0"
64
- :class="itemClass"
65
- @click="onClick"
66
- @keydown.enter="onClick"
67
- >
68
- {{ item.text }}
69
- <span
70
- v-if="item.collapsible"
71
- class="arrow"
72
- :class="isOpen ? 'down' : 'right'"
73
- />
74
- </p>
75
-
76
- <DropdownTransition v-if="item.children?.length">
77
- <ul v-show="isOpen" class="sidebar-item-children">
78
- <SidebarItem
79
- v-for="child in item.children"
80
- :key="`${depth}${child.text}${child.link}`"
81
- :item="child"
82
- :depth="depth + 1"
83
- />
84
- </ul>
85
- </DropdownTransition>
86
- </li>
87
- </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,6 +0,0 @@
1
- import type { SlotsType, VNode } from 'vue';
2
- export declare const CodeGroup: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
3
- [key: string]: any;
4
- }> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, SlotsType<{
5
- default: () => VNode[];
6
- }>>;
@@ -1,120 +0,0 @@
1
- import { useStorage } from '@vueuse/core';
2
- import { computed, defineComponent, h, onBeforeUpdate, onMounted, ref, watch, } from 'vue';
3
- export const CodeGroup = defineComponent({
4
- name: 'CodeGroup',
5
- slots: Object,
6
- setup(_, { slots }) {
7
- // refs of the tab buttons
8
- const tabRefs = ref([]);
9
- if (__VUEPRESS_DEV__) {
10
- // in dev mode, we need to clear the tabs ref to avoid HMR issues
11
- // after removing a code-group-item
12
- onBeforeUpdate(() => {
13
- tabRefs.value = [];
14
- });
15
- }
16
- // index of current active item
17
- const activeIndex = ref(-1);
18
- const codeGroupStorage = useStorage('vuepress-code-group', {});
19
- const codeGroupKey = computed(() => tabRefs.value.map((tab) => tab.innerText).join(','));
20
- onMounted(() => {
21
- watch(() => codeGroupStorage.value[codeGroupKey.value], (val = -1) => {
22
- if (activeIndex.value !== val) {
23
- activeIndex.value = val;
24
- }
25
- }, { immediate: true });
26
- watch(activeIndex, (val) => {
27
- if (codeGroupStorage.value[codeGroupKey.value] !== val) {
28
- codeGroupStorage.value[codeGroupKey.value] = val;
29
- }
30
- });
31
- });
32
- // activate next tab
33
- const activateNext = (i = activeIndex.value) => {
34
- if (i < tabRefs.value.length - 1) {
35
- activeIndex.value = i + 1;
36
- }
37
- else {
38
- activeIndex.value = 0;
39
- }
40
- tabRefs.value[activeIndex.value].focus();
41
- };
42
- // activate previous tab
43
- const activatePrev = (i = activeIndex.value) => {
44
- if (i > 0) {
45
- activeIndex.value = i - 1;
46
- }
47
- else {
48
- activeIndex.value = tabRefs.value.length - 1;
49
- }
50
- tabRefs.value[activeIndex.value].focus();
51
- };
52
- // handle keyboard event
53
- const keyboardHandler = (event, i) => {
54
- if (event.key === ' ' || event.key === 'Enter') {
55
- event.preventDefault();
56
- activeIndex.value = i;
57
- }
58
- else if (event.key === 'ArrowRight') {
59
- event.preventDefault();
60
- activateNext(i);
61
- }
62
- else if (event.key === 'ArrowLeft') {
63
- event.preventDefault();
64
- activatePrev(i);
65
- }
66
- };
67
- return () => {
68
- // get children code-group-item from default slots
69
- const items = (slots.default?.() || [])
70
- .filter((vnode) => vnode.type.name === 'CodeGroupItem')
71
- .map((vnode) => {
72
- if (vnode.props === null) {
73
- vnode.props = {};
74
- }
75
- return vnode;
76
- });
77
- // do not render anything if there is no code-group-item
78
- if (items.length === 0) {
79
- return null;
80
- }
81
- // if activeIndex is invalid
82
- if (activeIndex.value < 0 || activeIndex.value > items.length - 1) {
83
- // find the index of the code-group-item with `active` props
84
- activeIndex.value = items.findIndex((vnode) => vnode.props.active === '' || vnode.props.active === true);
85
- // if there is no `active` props on code-group-item, set the first item active
86
- if (activeIndex.value === -1) {
87
- activeIndex.value = 0;
88
- }
89
- }
90
- // if activeIndex is valid
91
- else {
92
- // set the active item
93
- items.forEach((vnode, i) => {
94
- vnode.props.active = i === activeIndex.value;
95
- });
96
- }
97
- return h('div', { class: 'code-group' }, [
98
- h('div', { class: 'code-group__nav', role: 'tablist' }, items.map((vnode, i) => {
99
- const isActive = i === activeIndex.value;
100
- return h('button', {
101
- ref: (element) => {
102
- if (element) {
103
- tabRefs.value[i] = element;
104
- }
105
- },
106
- class: {
107
- 'code-group__nav-tab': true,
108
- 'code-group__nav-tab-active': isActive,
109
- },
110
- role: 'tab',
111
- ariaSelected: isActive,
112
- onClick: () => (activeIndex.value = i),
113
- onKeydown: (e) => keyboardHandler(e, i),
114
- }, vnode.props.title);
115
- })),
116
- items,
117
- ]);
118
- };
119
- },
120
- });
@@ -1,27 +0,0 @@
1
- <script setup lang="ts">
2
- defineOptions({
3
- name: 'CodeGroupItem',
4
- })
5
-
6
- defineProps({
7
- title: {
8
- type: String,
9
- required: true,
10
- },
11
- active: {
12
- type: Boolean,
13
- required: false,
14
- default: false,
15
- },
16
- })
17
- </script>
18
-
19
- <template>
20
- <div
21
- class="code-group-item"
22
- :class="{ 'code-group-item__active': active }"
23
- role="tabpanel"
24
- >
25
- <slot />
26
- </div>
27
- </template>
@@ -1,4 +0,0 @@
1
- import type { ThemeDataRef, ThemeLocaleDataRef } from '@vuepress/plugin-theme-data/client';
2
- import type { DefaultThemeData } from '../../shared/index.js';
3
- export declare const useThemeData: () => ThemeDataRef<DefaultThemeData>;
4
- export declare const useThemeLocaleData: () => ThemeLocaleDataRef<DefaultThemeData>;
@@ -1,3 +0,0 @@
1
- import { useThemeData as _useThemeData, useThemeLocaleData as _useThemeLocaleData, } from '@vuepress/plugin-theme-data/client';
2
- export const useThemeData = () => _useThemeData();
3
- export const useThemeLocaleData = () => _useThemeLocaleData();
@@ -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
- }