@vuepress/theme-default 2.0.0-rc.101 → 2.0.0-rc.103

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.
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import type { VNode } from 'vue'
2
+ import type { RequiredSlot, Slot } from '@vuepress/helper/client'
3
3
  import type { AutoLinkConfig } from 'vuepress/client'
4
4
  import { AutoLink } from 'vuepress/client'
5
5
 
@@ -11,9 +11,9 @@ defineProps<{
11
11
  }>()
12
12
 
13
13
  defineSlots<{
14
- default?: (config: AutoLinkConfig) => VNode | VNode[]
15
- before?: (config: AutoLinkConfig) => VNode | VNode[] | null
16
- after?: (config: AutoLinkConfig) => VNode | VNode[] | null
14
+ default?: RequiredSlot<AutoLinkConfig>
15
+ before?: Slot<AutoLinkConfig>
16
+ after?: Slot<AutoLinkConfig>
17
17
  }>()
18
18
  </script>
19
19
 
@@ -1,8 +1,8 @@
1
1
  <script setup lang="ts">
2
- import type { VNode } from 'vue'
2
+ import type { Slot } from '@vuepress/helper/client'
3
3
 
4
4
  defineSlots<{
5
- default?: (props: Record<never, never>) => VNode | VNode[] | null
5
+ default?: Slot
6
6
  }>()
7
7
 
8
8
  const setHeight = (item: Element): void => {
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import type { VNode } from 'vue'
2
+ import type { SingleSlot } from '@vuepress/helper/client'
3
3
  import '@vuepress/helper/transition/fade-in-down.css'
4
4
 
5
5
  defineEmits<{
@@ -7,7 +7,7 @@ defineEmits<{
7
7
  beforeLeave: []
8
8
  }>()
9
9
  defineSlots<{
10
- default: () => VNode | string | null
10
+ default: SingleSlot
11
11
  }>()
12
12
  </script>
13
13
 
@@ -5,8 +5,8 @@ import VPToggleColorModeButton from '@theme/VPToggleColorModeButton.vue'
5
5
  import VPToggleSidebarButton from '@theme/VPToggleSidebarButton.vue'
6
6
  import { useData } from '@theme/useData'
7
7
  import { DeviceType, useUpdateDeviceStatus } from '@theme/useUpdateDeviceStatus'
8
+ import type { Slot } from '@vuepress/helper/client'
8
9
  import { hasGlobalComponent } from '@vuepress/helper/client'
9
- import type { VNode } from 'vue'
10
10
  import { computed, ref, resolveComponent, useTemplateRef } from 'vue'
11
11
 
12
12
  defineEmits<{
@@ -14,8 +14,8 @@ defineEmits<{
14
14
  }>()
15
15
 
16
16
  defineSlots<{
17
- before?: (props: Record<never, never>) => VNode | VNode[] | null
18
- after?: (props: Record<never, never>) => VNode | VNode[] | null
17
+ before?: Slot
18
+ after?: Slot
19
19
  }>()
20
20
 
21
21
  const SearchBox = hasGlobalComponent('SearchBox')
@@ -1,14 +1,14 @@
1
1
  <script setup lang="ts">
2
2
  import VPPageMeta from '@theme/VPPageMeta.vue'
3
3
  import VPPageNav from '@theme/VPPageNav.vue'
4
- import type { VNode } from 'vue'
4
+ import type { Slot } from '@vuepress/helper/client'
5
5
  import { Content } from 'vuepress/client'
6
6
 
7
7
  defineSlots<{
8
- 'top'?: (props: Record<never, never>) => VNode | VNode[] | null
9
- 'bottom'?: (props: Record<never, never>) => VNode | VNode[] | null
10
- 'content-top'?: (props: Record<never, never>) => VNode | VNode[] | null
11
- 'content-bottom'?: (props: Record<never, never>) => VNode | VNode[] | null
8
+ 'top'?: Slot
9
+ 'bottom'?: Slot
10
+ 'content-top'?: Slot
11
+ 'content-bottom'?: Slot
12
12
  }>()
13
13
  </script>
14
14
 
@@ -19,7 +19,7 @@ defineSlots<{
19
19
  <div vp-content>
20
20
  <slot name="content-top" />
21
21
 
22
- <Content />
22
+ <Content id="content" />
23
23
 
24
24
  <slot name="content-bottom" />
25
25
  </div>
@@ -1,11 +1,11 @@
1
1
  <script setup lang="ts">
2
2
  import VPNavbarItems from '@theme/VPNavbarItems.vue'
3
3
  import VPSidebarItems from '@theme/VPSidebarItems.vue'
4
- import type { VNode } from 'vue'
4
+ import type { Slot } from '@vuepress/helper/client'
5
5
 
6
6
  defineSlots<{
7
- top?: (props: Record<never, never>) => VNode | VNode[] | null
8
- bottom?: (props: Record<never, never>) => VNode | VNode[] | null
7
+ top?: Slot
8
+ bottom?: Slot
9
9
  }>()
10
10
  </script>
11
11
 
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import type { VNode } from 'vue'
2
+ import type { Slot } from '@vuepress/helper/client'
3
3
 
4
4
  withDefaults(
5
5
  defineProps<{
@@ -24,7 +24,7 @@ withDefaults(
24
24
  )
25
25
 
26
26
  defineSlots<{
27
- default?: () => VNode | VNode[] | string | null
27
+ default?: Slot
28
28
  }>()
29
29
  </script>
30
30
 
@@ -7,24 +7,22 @@ import VPSidebar from '@theme/VPSidebar.vue'
7
7
  import { useData } from '@theme/useData'
8
8
  import { useScrollPromise } from '@theme/useScrollPromise'
9
9
  import { useSidebarItems } from '@theme/useSidebarItems'
10
- import type { VNode } from 'vue'
10
+ import type { Slot } from '@vuepress/helper/client'
11
11
  import { computed, ref } from 'vue'
12
12
  import { onContentUpdated } from 'vuepress/client'
13
13
 
14
14
  defineSlots<{
15
- 'navbar'?: (props: Record<never, never>) => VNode | VNode[] | null
16
- 'navbar-before'?: (props: Record<never, never>) => VNode | VNode[] | null
17
- 'navbar-after'?: (props: Record<never, never>) => VNode | VNode[] | null
18
- 'sidebar'?: (props: Record<never, never>) => VNode | VNode[] | null
19
- 'sidebar-top'?: (props: Record<never, never>) => VNode | VNode[] | null
20
- 'sidebar-bottom'?: (props: Record<never, never>) => VNode | VNode[] | null
21
- 'page'?: (props: Record<never, never>) => VNode | VNode[] | null
22
- 'page-top'?: (props: Record<never, never>) => VNode | VNode[] | null
23
- 'page-bottom'?: (props: Record<never, never>) => VNode | VNode[] | null
24
- 'page-content-top'?: (props: Record<never, never>) => VNode | VNode[] | null
25
- 'page-content-bottom'?: (
26
- props: Record<never, never>,
27
- ) => VNode | VNode[] | null
15
+ 'navbar'?: Slot
16
+ 'navbar-before'?: Slot
17
+ 'navbar-after'?: Slot
18
+ 'sidebar'?: Slot
19
+ 'sidebar-top'?: Slot
20
+ 'sidebar-bottom'?: Slot
21
+ 'page'?: Slot
22
+ 'page-top'?: Slot
23
+ 'page-bottom'?: Slot
24
+ 'page-content-top'?: Slot
25
+ 'page-content-bottom'?: Slot
28
26
  }>()
29
27
 
30
28
  const { frontmatter, page, themeLocale } = useData()
@@ -1,23 +1,43 @@
1
1
  @use '../variables' as *;
2
2
 
3
- // code block additional styles
4
- div[class*='language-'] {
5
- margin: 0.75rem 0;
6
- transition:
7
- background-color var(--vp-t-color),
8
- color var(--vp-t-color);
9
-
3
+ #content {
10
4
  @media (max-width: $MQMobileNarrow) {
11
5
  --code-border-radius: 0;
6
+ --tab-border-radius: 0;
12
7
 
13
- margin: 0.75rem -1.5rem;
14
- }
8
+ // code block
9
+ > div[class*='language-'],
10
+ > .code-block-with-title > div[class*='language-'] {
11
+ margin-inline: -1.5rem;
12
+ }
13
+
14
+ // code block title bar
15
+ .code-block-title-bar {
16
+ margin-inline: -1.5rem;
17
+ }
18
+
19
+ // code tabs
20
+ > .vp-code-tabs {
21
+ .vp-code-tabs-nav {
22
+ margin-inline: -1.5rem;
23
+ border-radius: 0;
24
+ }
25
+
26
+ div[class*='language-'] {
27
+ margin-inline: -1.5rem;
28
+ }
29
+ }
30
+
31
+ // tabs
32
+ > .vp-tabs {
33
+ margin-inline: -1.5rem;
34
+ border-inline: none;
35
+ }
15
36
 
16
- // transitions for code notation highlighting
17
- .line {
18
- &.diff,
19
- &.highlighted {
20
- transition: background-color var(--vp-t-color);
37
+ // reveal.js
38
+ .vp-reveal {
39
+ width: calc(100% + 3rem);
40
+ margin: 0 -1.5rem;
21
41
  }
22
42
  }
23
43
  }
@@ -36,7 +36,7 @@ export const defaultTheme = ({ hostname, themePlugins = {}, ...localeOptions } =
36
36
  .readdirSync(path.resolve(__dirname, '../client/composables'))
37
37
  .filter((file) => file.endsWith('.js'))
38
38
  .map((file) => [
39
- `@theme/${file.substring(0, file.length - 3)}`,
39
+ `@theme/${file.slice(0, -3)}`,
40
40
  path.resolve(__dirname, '../client/composables', file),
41
41
  ])),
42
42
  // use alias to make all utils replaceable
@@ -44,7 +44,7 @@ export const defaultTheme = ({ hostname, themePlugins = {}, ...localeOptions } =
44
44
  .readdirSync(path.resolve(__dirname, '../client/utils'))
45
45
  .filter((file) => file.endsWith('.js'))
46
46
  .map((file) => [
47
- `@theme/${file.substring(0, file.length - 3)}`,
47
+ `@theme/${file.slice(0, -3)}`,
48
48
  path.resolve(__dirname, '../client/utils', file),
49
49
  ])),
50
50
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/theme-default",
3
- "version": "2.0.0-rc.101",
3
+ "version": "2.0.0-rc.103",
4
4
  "description": "Default theme of VuePress",
5
5
  "keywords": [
6
6
  "vuepress-theme",
@@ -19,6 +19,11 @@
19
19
  },
20
20
  "license": "MIT",
21
21
  "author": "meteorlxy",
22
+ "sideEffects": [
23
+ "./lib/client/components/**/*.vue",
24
+ "./lib/client/layouts/*.vue",
25
+ "./lib/client/styles/*.scss"
26
+ ],
22
27
  "type": "module",
23
28
  "exports": {
24
29
  ".": "./lib/node/index.js",
@@ -37,21 +42,21 @@
37
42
  "templates"
38
43
  ],
39
44
  "dependencies": {
40
- "@vuepress/helper": "2.0.0-rc.99",
41
- "@vuepress/plugin-active-header-links": "2.0.0-rc.98",
42
- "@vuepress/plugin-back-to-top": "2.0.0-rc.99",
43
- "@vuepress/plugin-copy-code": "2.0.0-rc.99",
44
- "@vuepress/plugin-git": "2.0.0-rc.99",
45
- "@vuepress/plugin-links-check": "2.0.0-rc.99",
46
- "@vuepress/plugin-markdown-hint": "2.0.0-rc.101",
47
- "@vuepress/plugin-markdown-tab": "2.0.0-rc.101",
48
- "@vuepress/plugin-medium-zoom": "2.0.0-rc.99",
49
- "@vuepress/plugin-nprogress": "2.0.0-rc.99",
50
- "@vuepress/plugin-palette": "2.0.0-rc.99",
51
- "@vuepress/plugin-prismjs": "2.0.0-rc.99",
52
- "@vuepress/plugin-seo": "2.0.0-rc.99",
53
- "@vuepress/plugin-sitemap": "2.0.0-rc.99",
54
- "@vuepress/plugin-theme-data": "2.0.0-rc.99",
45
+ "@vuepress/helper": "2.0.0-rc.103",
46
+ "@vuepress/plugin-active-header-links": "2.0.0-rc.103",
47
+ "@vuepress/plugin-back-to-top": "2.0.0-rc.103",
48
+ "@vuepress/plugin-copy-code": "2.0.0-rc.103",
49
+ "@vuepress/plugin-git": "2.0.0-rc.103",
50
+ "@vuepress/plugin-links-check": "2.0.0-rc.103",
51
+ "@vuepress/plugin-markdown-hint": "2.0.0-rc.103",
52
+ "@vuepress/plugin-markdown-tab": "2.0.0-rc.103",
53
+ "@vuepress/plugin-medium-zoom": "2.0.0-rc.103",
54
+ "@vuepress/plugin-nprogress": "2.0.0-rc.103",
55
+ "@vuepress/plugin-palette": "2.0.0-rc.103",
56
+ "@vuepress/plugin-prismjs": "2.0.0-rc.103",
57
+ "@vuepress/plugin-seo": "2.0.0-rc.103",
58
+ "@vuepress/plugin-sitemap": "2.0.0-rc.103",
59
+ "@vuepress/plugin-theme-data": "2.0.0-rc.103",
55
60
  "@vueuse/core": "^13.1.0",
56
61
  "vue": "^3.5.13"
57
62
  },
@@ -59,7 +64,7 @@
59
64
  "sass": "^1.86.3",
60
65
  "sass-embedded": "^1.86.3",
61
66
  "sass-loader": "^16.0.5",
62
- "vuepress": "2.0.0-rc.22"
67
+ "vuepress": "2.0.0-rc.23"
63
68
  },
64
69
  "peerDependenciesMeta": {
65
70
  "sass": {
@@ -75,5 +80,5 @@
75
80
  "publishConfig": {
76
81
  "access": "public"
77
82
  },
78
- "gitHead": "3c7d17254125d130de55b13f7dca6ff574a17a4a"
83
+ "gitHead": "b730bbcfea25d3b41390e137f086884149e2399e"
79
84
  }