@vuepress/theme-default 2.0.0-rc.4 → 2.0.0-rc.40

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 (127) 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} +108 -7
  8. package/lib/client/components/VPLightIcon.vue +28 -0
  9. package/lib/client/components/VPNavbar.vue +125 -0
  10. package/lib/client/components/{NavbarBrand.vue → VPNavbarBrand.vue} +39 -6
  11. package/lib/client/components/VPNavbarDropdown.vue +320 -0
  12. package/lib/client/components/VPNavbarItems.vue +110 -0
  13. package/lib/client/components/VPPage.vue +69 -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 +167 -0
  18. package/lib/client/components/{SidebarItems.vue → VPSidebarItems.vue} +31 -7
  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 +8 -0
  26. package/lib/client/composables/index.js +8 -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.d.ts +0 -1
  30. package/lib/client/composables/useDarkMode.js +14 -13
  31. package/lib/client/composables/useEditLink.d.ts +3 -0
  32. package/lib/client/composables/useEditLink.js +31 -0
  33. package/lib/client/composables/useLastUpdated.d.ts +2 -0
  34. package/lib/client/composables/useLastUpdated.js +17 -0
  35. package/lib/client/composables/useNavbarConfig.d.ts +3 -0
  36. package/lib/client/composables/useNavbarConfig.js +25 -0
  37. package/lib/client/composables/useNavbarRepo.d.ts +6 -0
  38. package/lib/client/composables/useNavbarRepo.js +38 -0
  39. package/lib/client/composables/useNavbarSelectLanguage.d.ts +6 -0
  40. package/lib/client/composables/useNavbarSelectLanguage.js +58 -0
  41. package/lib/client/composables/useNavigate.d.ts +1 -0
  42. package/lib/client/composables/useNavigate.js +22 -0
  43. package/lib/client/composables/useRelatedLinks.d.ts +8 -0
  44. package/lib/client/composables/useRelatedLinks.js +91 -0
  45. package/lib/client/composables/useSidebarItems.d.ts +17 -12
  46. package/lib/client/composables/useSidebarItems.js +87 -52
  47. package/lib/client/composables/useUpdateDeviceStatus.js +5 -4
  48. package/lib/client/config.d.ts +2 -2
  49. package/lib/client/config.js +12 -13
  50. package/lib/client/index.d.ts +2 -1
  51. package/lib/client/index.js +1 -1
  52. package/lib/client/layouts/Layout.vue +121 -20
  53. package/lib/client/layouts/NotFound.vue +18 -4
  54. package/lib/client/shim.d.ts +3 -3
  55. package/lib/client/styles/_mixins.scss +4 -4
  56. package/lib/client/styles/_variables.module.scss +1 -1
  57. package/lib/client/styles/_variables.scss +1 -0
  58. package/lib/client/styles/arrow.scss +18 -24
  59. package/lib/client/styles/code-group.scss +32 -29
  60. package/lib/client/styles/content/code.scss +23 -0
  61. package/lib/client/styles/{custom-container.scss → content/custom-container.scss} +13 -13
  62. package/lib/client/styles/content/index.scss +4 -0
  63. package/lib/client/styles/content/normalize.scss +39 -0
  64. package/lib/client/styles/{toc.scss → content/toc.scss} +1 -1
  65. package/lib/client/styles/external-link-icon.scss +37 -0
  66. package/lib/client/styles/index.scss +3 -13
  67. package/lib/client/styles/layout.scss +3 -199
  68. package/lib/client/styles/normalize.scss +20 -148
  69. package/lib/client/styles/plugins.scss +20 -0
  70. package/lib/client/styles/vars-dark.scss +17 -12
  71. package/lib/client/styles/vars.scss +71 -33
  72. package/lib/client/typings.d.ts +13 -0
  73. package/lib/client/typings.js +1 -0
  74. package/lib/client/utils/getAutoLink.d.ts +9 -0
  75. package/lib/client/utils/getAutoLink.js +17 -0
  76. package/lib/client/utils/index.d.ts +3 -2
  77. package/lib/client/utils/index.js +3 -2
  78. package/lib/client/utils/isActiveSidebarItem.d.ts +3 -3
  79. package/lib/client/utils/isActiveSidebarItem.js +3 -3
  80. package/lib/client/utils/isLinkInternal.d.ts +1 -0
  81. package/lib/client/utils/isLinkInternal.js +2 -0
  82. package/lib/client/utils/resolveEditLink.d.ts +1 -1
  83. package/lib/client/utils/resolvePrefix.d.ts +1 -0
  84. package/lib/client/utils/resolvePrefix.js +4 -0
  85. package/lib/node/defaultTheme.js +83 -24
  86. package/lib/node/index.d.ts +2 -1
  87. package/lib/node/index.js +1 -1
  88. package/lib/node/utils/assignDefaultLocaleOptions.js +1 -1
  89. package/lib/node/utils/resolveContainerPluginOptions.d.ts +3 -3
  90. package/lib/node/utils/resolveContainerPluginOptions.js +2 -2
  91. package/lib/shared/index.d.ts +2 -0
  92. package/lib/shared/index.js +2 -0
  93. package/lib/shared/nav.d.ts +19 -30
  94. package/lib/shared/navbar.d.ts +21 -0
  95. package/lib/shared/navbar.js +1 -0
  96. package/lib/shared/options.d.ts +31 -8
  97. package/lib/shared/page.d.ts +6 -4
  98. package/lib/shared/sidebar.d.ts +26 -0
  99. package/lib/shared/sidebar.js +1 -0
  100. package/package.json +22 -26
  101. package/templates/build.html +19 -10
  102. package/lib/client/components/AutoLink.vue +0 -113
  103. package/lib/client/components/Home.vue +0 -15
  104. package/lib/client/components/HomeContent.vue +0 -5
  105. package/lib/client/components/HomeFeatures.vue +0 -22
  106. package/lib/client/components/Navbar.vue +0 -79
  107. package/lib/client/components/NavbarDropdown.vue +0 -126
  108. package/lib/client/components/NavbarItems.vue +0 -199
  109. package/lib/client/components/Page.vue +0 -31
  110. package/lib/client/components/PageMeta.vue +0 -124
  111. package/lib/client/components/PageNav.vue +0 -122
  112. package/lib/client/components/Sidebar.vue +0 -18
  113. package/lib/client/components/SidebarItem.vue +0 -87
  114. package/lib/client/components/ToggleColorModeButton.vue +0 -57
  115. package/lib/client/components/ToggleSidebarButton.vue +0 -24
  116. package/lib/client/styles/badge.scss +0 -36
  117. package/lib/client/styles/code.scss +0 -263
  118. package/lib/client/styles/home.scss +0 -168
  119. package/lib/client/styles/navbar-dropdown.scss +0 -183
  120. package/lib/client/styles/navbar.scss +0 -197
  121. package/lib/client/styles/page.scss +0 -87
  122. package/lib/client/styles/sidebar.scss +0 -134
  123. package/lib/client/styles/transitions.scss +0 -22
  124. package/lib/client/utils/getNavLink.d.ts +0 -15
  125. package/lib/client/utils/getNavLink.js +0 -18
  126. package/lib/client/utils/getResolveRouteWithRedirect.d.ts +0 -5
  127. package/lib/client/utils/getResolveRouteWithRedirect.js +0 -22
@@ -1,7 +1,5 @@
1
1
  html,
2
2
  body {
3
- padding: 0;
4
- margin: 0;
5
3
  background-color: var(--c-bg);
6
4
  transition: background-color var(--t-color);
7
5
  }
@@ -10,179 +8,54 @@ html.dark {
10
8
  color-scheme: dark;
11
9
  }
12
10
 
13
- html {
14
- font-size: 16px;
15
- }
16
-
17
11
  body {
18
- font-family: var(--font-family);
19
- -webkit-font-smoothing: antialiased;
20
- -moz-osx-font-smoothing: grayscale;
21
- font-size: 1rem;
22
12
  color: var(--c-text);
13
+ font-size: 1rem;
14
+ font-family: var(--font-family);
23
15
  }
24
16
 
25
- a {
26
- font-weight: 500;
27
- color: var(--c-text-accent);
28
- text-decoration: none;
29
- overflow-wrap: break-word;
17
+ h2 {
18
+ border-color: var(--c-border);
19
+ transition: border-color var(--t-color);
30
20
  }
31
21
 
32
- p a code {
33
- font-weight: 400;
22
+ a {
34
23
  color: var(--c-text-accent);
35
24
  }
36
25
 
37
- kbd {
38
- font-family: var(--font-family-code);
39
- color: var(--c-text);
40
- background: var(--c-bg-lighter);
41
- border: solid 0.15rem var(--c-border-dark);
42
- border-bottom: solid 0.25rem var(--c-border-dark);
43
- border-radius: 0.15rem;
44
- padding: 0 0.15em;
45
- }
46
-
47
26
  code {
48
- font-family: var(--font-family-code);
49
- color: var(--c-text-lighter);
50
- padding: 0.25rem 0.5rem;
51
- margin: 0;
52
- font-size: 0.85em;
53
27
  background-color: var(--c-bg-light);
54
- border-radius: 3px;
55
- overflow-wrap: break-word;
28
+ color: var(--c-text-lighter);
29
+ font-family: var(--code-font-family);
56
30
  transition: background-color var(--t-color);
57
- }
58
-
59
- blockquote {
60
- font-size: 1rem;
61
- color: var(--c-text-quote);
62
- border-left: 0.2rem solid var(--c-border-dark);
63
- margin: 1rem 0;
64
- padding: 0.25rem 0 0.25rem 1rem;
65
- overflow-wrap: break-word;
66
31
 
67
- & > p {
68
- margin: 0;
32
+ p a & {
33
+ color: var(--c-text-accent);
69
34
  }
70
35
  }
71
36
 
72
- ul,
73
- ol {
74
- padding-left: 1.2em;
75
- }
76
-
77
- strong {
78
- font-weight: 600;
79
- }
80
-
81
- h1,
82
- h2,
83
- h3,
84
- h4,
85
- h5,
86
- h6 {
87
- font-weight: 600;
88
- line-height: 1.25;
89
- overflow-wrap: break-word;
90
-
91
- &:focus-visible {
92
- outline: none;
93
- }
94
-
95
- .header-anchor {
96
- color: inherit;
97
- text-decoration: none;
98
- position: relative;
99
-
100
- &:hover::before {
101
- font-size: 0.8em;
102
- content: '¶';
103
- position: absolute;
104
- left: -0.75em;
105
- color: var(--c-brand);
106
- }
107
-
108
- &:focus-visible {
109
- outline: none;
110
-
111
- &::before {
112
- content: '¶';
113
- position: absolute;
114
- left: -0.75em;
115
- color: var(--c-brand);
116
- outline: auto;
117
- }
118
- }
119
- }
120
- }
121
-
122
- h1 {
123
- font-size: 2.2rem;
124
- }
125
-
126
- h2 {
127
- font-size: 1.65rem;
128
- padding-bottom: 0.3rem;
129
- border-bottom: 1px solid var(--c-border);
37
+ kbd {
38
+ border-color: var(--c-border-dark);
130
39
  transition: border-color var(--t-color);
131
40
  }
132
41
 
133
- h3 {
134
- font-size: 1.35rem;
135
- }
136
-
137
- h4 {
138
- font-size: 1.15rem;
139
- }
140
-
141
- h5 {
142
- font-size: 1.05rem;
143
- }
144
-
145
- h6 {
146
- font-size: 1rem;
147
- }
148
-
149
- a {
150
- @media print {
151
- &[href^="http://"],
152
- &[href^="https://"]
153
- {
154
- &::after {
155
- content: ' (' attr(href) ') ';
156
- }
157
- }
158
- }
159
- }
160
-
161
- p,
162
- ul,
163
- ol {
164
- line-height: 1.7;
165
- overflow-wrap: break-word;
42
+ blockquote {
43
+ border-color: var(--c-border-dark);
44
+ color: var(--c-text-quote);
45
+ transition: border-color var(--t-color);
166
46
  }
167
47
 
168
48
  hr {
169
- border: 0;
170
- border-top: 1px solid var(--c-border);
49
+ border-color: var(--c-border);
50
+ transition: border-color var(--t-color);
171
51
  }
172
52
 
173
53
  table {
174
- border-collapse: collapse;
175
- margin: 1rem 0;
176
- display: block;
177
- overflow-x: auto;
178
54
  transition: border-color var(--t-color);
179
55
  }
180
56
 
181
57
  tr {
182
- border-top: 1px solid var(--c-border-dark);
183
- transition: border-color var(--t-color);
184
-
185
- &:nth-child(2n) {
58
+ &:nth-child(odd) {
186
59
  background-color: var(--c-bg-light);
187
60
  transition: background-color var(--t-color);
188
61
 
@@ -194,7 +67,6 @@ tr {
194
67
 
195
68
  th,
196
69
  td {
197
- padding: 0.6em 1em;
198
- border: 1px solid var(--c-border-dark);
70
+ border-color: var(--c-border-dark);
199
71
  transition: border-color var(--t-color);
200
72
  }
@@ -0,0 +1,20 @@
1
+ @use 'mixins';
2
+
3
+ // plugin-comment
4
+ #vp-comment {
5
+ @include mixins.content-wrapper;
6
+ }
7
+
8
+ .vp-navbar {
9
+ // plugin-docsearch
10
+ /* stylelint-disable-next-line selector-class-pattern */
11
+ .DocSearch {
12
+ transition: background-color var(--t-color);
13
+ }
14
+
15
+ // plugin-search
16
+ .search-box {
17
+ vertical-align: top;
18
+ flex: 0 0 auto;
19
+ }
20
+ }
@@ -52,17 +52,22 @@ html.dark {
52
52
  --c-badge-danger: var(--c-danger);
53
53
  --c-badge-danger-text: #401416;
54
54
 
55
- // code blocks vars
56
- --code-hl-bg-color: #363b46;
57
- }
55
+ // plugin-docsearch
56
+ /* stylelint-disable-next-line selector-class-pattern */
57
+ .DocSearch {
58
+ --docsearch-logo-color: var(--c-text);
59
+ --docsearch-modal-shadow: inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309;
60
+ --docsearch-key-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d,
61
+ 0 2px 2px 0 rgb(3 4 9 / 30%);
62
+ --docsearch-key-gradient: linear-gradient(-225deg, #444950, #1c1e21);
63
+ --docsearch-footer-shadow: inset 0 1px 0 0 rgb(73 76 106 / 50%),
64
+ 0 -4px 8px 0 rgb(0 0 0 / 20%);
65
+ }
58
66
 
59
- // plugin-docsearch
60
- html.dark .DocSearch {
61
- --docsearch-logo-color: var(--c-text);
62
- --docsearch-modal-shadow: inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309;
63
- --docsearch-key-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d,
64
- 0 2px 2px 0 rgba(3, 4, 9, 0.3);
65
- --docsearch-key-gradient: linear-gradient(-225deg, #444950, #1c1e21);
66
- --docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5),
67
- 0 -4px 8px 0 rgba(0, 0, 0, 0.2);
67
+ // plugin-pwa
68
+ body {
69
+ --pwa-shadow-color: rgb(0 0 0 / 30%);
70
+ --pwa-content-color: #ccc;
71
+ --pwa-content-light-color: #999;
72
+ }
68
73
  }
@@ -4,14 +4,14 @@
4
4
  --c-brand-light: #4abf8a;
5
5
 
6
6
  // background colors
7
- --c-bg: #ffffff;
7
+ --c-bg: #fff;
8
8
  --c-bg-light: #f3f4f5;
9
- --c-bg-lighter: #eeeeee;
9
+ --c-bg-lighter: #eee;
10
10
  --c-bg-dark: #ebebec;
11
11
  --c-bg-darker: #e6e6e6;
12
12
  --c-bg-navbar: var(--c-bg);
13
13
  --c-bg-sidebar: var(--c-bg);
14
- --c-bg-arrow: #cccccc;
14
+ --c-bg-arrow: #ccc;
15
15
 
16
16
  // text colors
17
17
  --c-text: #2c3e50;
@@ -19,7 +19,7 @@
19
19
  --c-text-light: #3a5169;
20
20
  --c-text-lighter: #4e6e8e;
21
21
  --c-text-lightest: #6a8bad;
22
- --c-text-quote: #999999;
22
+ --c-text-quote: #999;
23
23
 
24
24
  // border colors
25
25
  --c-border: #eaecef;
@@ -49,11 +49,11 @@
49
49
  --c-danger-border-dark: #f1abab;
50
50
  --c-danger-details-bg: #ffd4d4;
51
51
  --c-danger-title: #ed1e2c;
52
- --c-danger-text: #660000;
52
+ --c-danger-text: #600;
53
53
  --c-danger-text-accent: #bd1a1a;
54
54
  --c-danger-text-light: #b5474d;
55
55
  --c-danger-text-quote: #c15b5b;
56
- --c-details-bg: #eeeeee;
56
+ --c-details-bg: #eee;
57
57
 
58
58
  // badge component colors
59
59
  --c-badge-tip: var(--c-tip);
@@ -63,7 +63,7 @@
63
63
  --c-badge-danger-text: var(--c-bg);
64
64
 
65
65
  // code group colors
66
- --c-code-group-tab-title: rgba(255, 255, 255, 0.9);
66
+ --c-code-group-tab-title: rgb(255 255 255 / 90%);
67
67
  --c-code-group-tab-bg: var(--code-bg-color);
68
68
  --c-code-group-tab-outline: var(var(--c-code-group-tab-title));
69
69
  --c-code-group-tab-active-border: var(--c-brand);
@@ -72,16 +72,9 @@
72
72
  --t-color: 0.3s ease;
73
73
  --t-transform: 0.3s ease;
74
74
 
75
- // code blocks vars
76
- --code-bg-color: #282c34;
77
- --code-hl-bg-color: rgba(0, 0, 0, 0.66);
78
- --code-ln-color: #9e9e9e;
79
- --code-ln-wrapper-width: 3.5rem;
80
-
81
75
  // font vars
82
- --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
83
- Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
84
- --font-family-code: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
76
+ --font-family: -apple-system, 'BlinkMacSystemFont', 'Segoe UI', roboto, oxygen,
77
+ ubuntu, cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
85
78
 
86
79
  // layout vars
87
80
  --navbar-height: 3.6rem;
@@ -91,21 +84,47 @@
91
84
  --sidebar-width-mobile: calc(var(--sidebar-width) * 0.82);
92
85
  --content-width: 740px;
93
86
  --homepage-width: 960px;
87
+
88
+ // external-link-icon
89
+ --external-link-icon: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' %3E%3Cpath d='M0 0h24v24H0V0z' fill='none' /%3E%3Cpath d='M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z' /%3E%3C/svg%3E");
90
+ --external-link-icon-color: var(--c-text-quote);
94
91
  }
95
92
 
96
93
  // plugin-back-to-top
97
- .back-to-top {
94
+ .vp-back-to-top-button {
98
95
  --back-to-top-color: var(--c-brand);
99
96
  --back-to-top-color-hover: var(--c-brand-light);
97
+ --back-to-top-bg-color: var(--c-bg);
98
+ }
99
+
100
+ // plugin-catalog
101
+ .vp-catalog-wrapper {
102
+ --catalog-bg-color: var(--c-bg);
103
+ --catalog-bg-secondary-color: var(--c-bg-dark);
104
+ --catalog-border-color: var(--c-border);
105
+ --catalog-active-color: var(--c-brand);
106
+ --catalog-hover-color: var(--c-brand-light);
107
+ }
108
+
109
+ // plugin-comment
110
+ .waline-wrapper {
111
+ --waline-bg-color: var(--c-bg);
112
+ --waline-bg-color-light: var(--c-bg-light);
113
+ --waline-text-color: var(--c-color);
114
+ --waline-border: 1px solid var(--c-border);
115
+ --waline-border-color: var(--c-border);
116
+ --waline-theme-color: var(--c-brand);
117
+ --waline-active-color: var(--c-brand-light);
100
118
  }
101
119
 
102
120
  // plugin-docsearch
121
+ /* stylelint-disable-next-line selector-class-pattern */
103
122
  .DocSearch {
104
123
  --docsearch-primary-color: var(--c-brand);
105
124
  --docsearch-text-color: var(--c-text);
106
125
  --docsearch-highlight-color: var(--c-brand);
107
126
  --docsearch-muted-color: var(--c-text-quote);
108
- --docsearch-container-background: rgba(9, 10, 17, 0.8);
127
+ --docsearch-container-background: rgb(9 10 17 / 80%);
109
128
  --docsearch-modal-background: var(--c-bg-light);
110
129
  --docsearch-searchbox-background: var(--c-bg-lighter);
111
130
  --docsearch-searchbox-focus-background: var(--c-bg);
@@ -117,30 +136,50 @@
117
136
  --docsearch-footer-background: var(--c-bg);
118
137
  }
119
138
 
120
- // plugin-external-link-icon
121
- .external-link-icon {
122
- --external-link-icon-color: var(--c-text-quote);
123
- }
124
-
125
139
  // plugin-medium-zoom
126
140
  .medium-zoom-overlay {
127
141
  --medium-zoom-bg-color: var(--c-bg);
128
142
  }
129
143
 
144
+ // plugin-notice
145
+ .vp-notice-wrapper {
146
+ --notice-color: var(--c-text);
147
+ --notice-bg-color: var(--c-bg);
148
+ --notice-primary-color: var(--c-brand);
149
+ --notice-primary-text-color: var(--c-bg);
150
+ --notice-primary-hover-color: var(--c-brand-light);
151
+ --notice-button-color: var(--c-bg-light);
152
+ --notice-button-hover-color: var(--c-bg-lighter);
153
+ }
154
+
130
155
  // plugin-nprogress
131
156
  #nprogress {
132
157
  --nprogress-color: var(--c-brand);
133
158
  }
134
159
 
135
- // plugin-pwa-popup
136
- .pwa-popup {
137
- --pwa-popup-text-color: var(--c-text);
138
- --pwa-popup-bg-color: var(--c-bg);
139
- --pwa-popup-border-color: var(--c-brand);
140
- --pwa-popup-shadow: 0 4px 16px var(--c-brand);
141
- --pwa-popup-btn-text-color: var(--c-bg);
142
- --pwa-popup-btn-bg-color: var(--c-brand);
143
- --pwa-popup-btn-hover-bg-color: var(--c-brand-light);
160
+ body {
161
+ // plugin-photo-swipe
162
+ --photo-swipe-bullet: var(--c-bg);
163
+ --photo-swipe-bullet-active: var(--c-brand);
164
+
165
+ // plugin-pwa-popup
166
+ --pwa-text-color: var(--c-text);
167
+ --pwa-bg-color: var(--c-bg);
168
+ --pwa-border-color: var(--c-brand);
169
+ --pwa-btn-text-color: var(--c-bg);
170
+ --pwa-btn-bg-color: var(--c-brand);
171
+ --pwa-btn-hover-bg-color: var(--c-brand-light);
172
+ }
173
+
174
+ // plugin-redirect
175
+ .redirect-modal-mask {
176
+ --redirect-bg-color: var(--c-bg);
177
+ --redirect-bg-color-light: var(--c-bg-light);
178
+ --redirect-bg-color-lighter: var(--c-bg-lighter);
179
+ --redirect-text-color: var(--c-text);
180
+ --redirect-primary-color: var(--c-brand);
181
+ --redirect-primary-hover-color: var(--c-brand-light);
182
+ --redirect-primary-text-color: var(--c-bg);
144
183
  }
145
184
 
146
185
  // plugin-search
@@ -149,7 +188,6 @@
149
188
  --search-accent-color: var(--c-brand);
150
189
  --search-text-color: var(--c-text);
151
190
  --search-border-color: var(--c-border);
152
-
153
191
  --search-item-text-color: var(--c-text-lighter);
154
192
  --search-item-focus-bg-color: var(--c-bg-light);
155
193
  }
@@ -0,0 +1,13 @@
1
+ import type { AutoLinkOptions, NavbarLinkOptions, NavGroup, SidebarGroupOptions, SidebarLinkOptions } from '../shared/index.js';
2
+ export type NavbarItem = NavbarLinkOptions | NavGroup<AutoLinkOptions | NavGroup<AutoLinkOptions>>;
3
+ export type SidebarLinkItem = SidebarLinkOptions;
4
+ export interface SidebarHeaderItem {
5
+ text: string;
6
+ link: string;
7
+ children?: SidebarHeaderItem[];
8
+ }
9
+ export interface SidebarGroupItem extends SidebarGroupOptions {
10
+ prefix?: string;
11
+ children: (SidebarItem | SidebarHeaderItem)[];
12
+ }
13
+ export type SidebarItem = SidebarLinkItem | SidebarGroupItem;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { AutoLinkOptions } from '../../shared';
2
+ /**
3
+ * Resolve AutoLink props from string
4
+ *
5
+ * @example
6
+ * - Input: '/README.md'
7
+ * - Output: { text: 'Home', link: '/' }
8
+ */
9
+ export declare const getAutoLink: (config: string, currentPath?: string) => AutoLinkOptions;
@@ -0,0 +1,17 @@
1
+ import { resolveRoute } from 'vuepress/client';
2
+ /**
3
+ * Resolve AutoLink props from string
4
+ *
5
+ * @example
6
+ * - Input: '/README.md'
7
+ * - Output: { text: 'Home', link: '/' }
8
+ */
9
+ export const getAutoLink = (config, currentPath) => {
10
+ const { notFound, meta, path } = resolveRoute(config, currentPath);
11
+ return notFound
12
+ ? { text: path, link: path }
13
+ : {
14
+ text: meta.title || path,
15
+ link: path,
16
+ };
17
+ };
@@ -1,5 +1,6 @@
1
- export * from './getNavLink.js';
2
- export * from './getResolveRouteWithRedirect.js';
1
+ export * from './getAutoLink.js';
3
2
  export * from './isActiveSidebarItem.js';
3
+ export * from './isLinkInternal.js';
4
4
  export * from './resolveEditLink.js';
5
+ export * from './resolvePrefix.js';
5
6
  export * from './resolveRepoType.js';
@@ -1,5 +1,6 @@
1
- export * from './getNavLink.js';
2
- export * from './getResolveRouteWithRedirect.js';
1
+ export * from './getAutoLink.js';
3
2
  export * from './isActiveSidebarItem.js';
3
+ export * from './isLinkInternal.js';
4
4
  export * from './resolveEditLink.js';
5
+ export * from './resolvePrefix.js';
5
6
  export * from './resolveRepoType.js';
@@ -1,3 +1,3 @@
1
- import type { RouteLocationNormalizedLoaded } from 'vue-router';
2
- import type { ResolvedSidebarItem } from '../../shared/index.js';
3
- export declare const isActiveSidebarItem: (item: ResolvedSidebarItem, route: RouteLocationNormalizedLoaded) => boolean;
1
+ import type { RouteLocationNormalizedLoaded } from 'vuepress/client';
2
+ import type { SidebarItem } from '../typings.js';
3
+ export declare const isActiveLinkItem: (item: SidebarItem, route: RouteLocationNormalizedLoaded) => boolean;
@@ -9,12 +9,12 @@ const isActiveLink = (link, route) => {
9
9
  const targetPath = normalizePath(link);
10
10
  return currentPath === targetPath;
11
11
  };
12
- export const isActiveSidebarItem = (item, route) => {
12
+ export const isActiveLinkItem = (item, route) => {
13
13
  if (item.link && isActiveLink(item.link, route)) {
14
14
  return true;
15
15
  }
16
- if (item.children) {
17
- return item.children.some((child) => isActiveSidebarItem(child, route));
16
+ if ('children' in item) {
17
+ return item.children.some((child) => isActiveLinkItem(child, route));
18
18
  }
19
19
  return false;
20
20
  };
@@ -0,0 +1 @@
1
+ export declare const isLinkInternal: (link: string) => boolean;
@@ -0,0 +1,2 @@
1
+ import { isLinkExternal, isLinkWithProtocol } from 'vuepress/shared';
2
+ export const isLinkInternal = (link) => !isLinkExternal(link) && !isLinkWithProtocol(link);
@@ -5,5 +5,5 @@ export declare const resolveEditLink: ({ docsRepo, docsBranch, docsDir, filePath
5
5
  docsBranch: string;
6
6
  docsDir: string;
7
7
  filePathRelative: string | null;
8
- editLinkPattern?: string | undefined;
8
+ editLinkPattern?: string;
9
9
  }) => string | null;
@@ -0,0 +1 @@
1
+ export declare const resolvePrefix: (prefix?: string, path?: string) => string;
@@ -0,0 +1,4 @@
1
+ import { ensureEndingSlash, isLinkAbsolute, isLinkWithProtocol, } from '@vuepress/helper/client';
2
+ export const resolvePrefix = (prefix = '', path = '') => isLinkAbsolute(path) || isLinkWithProtocol(path)
3
+ ? path
4
+ : `${ensureEndingSlash(prefix)}${path}`;