@vuepress/theme-default 2.0.0-rc.5 → 2.0.0-rc.54

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 (141) hide show
  1. package/lib/client/components/VPDarkIcon.vue +8 -0
  2. package/lib/client/components/VPDropdownTransition.vue +36 -0
  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 +66 -0
  6. package/lib/client/components/{HomeFooter.vue → VPHomeFooter.vue} +17 -2
  7. package/lib/client/components/{HomeHero.vue → VPHomeHero.vue} +113 -19
  8. package/lib/client/components/VPLightIcon.vue +28 -0
  9. package/lib/client/components/VPNavbar.vue +134 -0
  10. package/lib/client/components/{NavbarBrand.vue → VPNavbarBrand.vue} +40 -7
  11. package/lib/client/components/VPNavbarDropdown.vue +320 -0
  12. package/lib/client/components/VPNavbarItems.vue +111 -0
  13. package/lib/client/components/VPPage.vue +70 -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 +113 -0
  17. package/lib/client/components/VPSidebarItem.vue +174 -0
  18. package/lib/client/components/{SidebarItems.vue → VPSidebarItems.vue} +32 -7
  19. package/lib/client/components/VPToggleColorModeButton.vue +55 -0
  20. package/lib/client/components/VPToggleSidebarButton.vue +92 -0
  21. package/lib/client/components/global/Badge.vue +84 -18
  22. package/lib/client/components/global/index.d.ts +1 -3
  23. package/lib/client/components/global/index.js +1 -3
  24. package/lib/client/composables/index.d.ts +8 -0
  25. package/lib/client/composables/index.js +8 -0
  26. package/lib/client/composables/useContributors.d.ts +3 -0
  27. package/lib/client/composables/useContributors.js +14 -0
  28. package/lib/client/composables/useDarkMode.d.ts +0 -1
  29. package/lib/client/composables/useDarkMode.js +16 -13
  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 +3 -0
  35. package/lib/client/composables/useNavbarConfig.js +27 -0
  36. package/lib/client/composables/useNavbarRepo.d.ts +6 -0
  37. package/lib/client/composables/useNavbarRepo.js +38 -0
  38. package/lib/client/composables/useNavbarSelectLanguage.d.ts +6 -0
  39. package/lib/client/composables/useNavbarSelectLanguage.js +59 -0
  40. package/lib/client/composables/useNavigate.d.ts +1 -0
  41. package/lib/client/composables/useNavigate.js +22 -0
  42. package/lib/client/composables/useRelatedLinks.d.ts +8 -0
  43. package/lib/client/composables/useRelatedLinks.js +91 -0
  44. package/lib/client/composables/useScrollPromise.js +3 -1
  45. package/lib/client/composables/useSidebarItems.d.ts +28 -23
  46. package/lib/client/composables/useSidebarItems.js +120 -84
  47. package/lib/client/composables/useUpdateDeviceStatus.d.ts +1 -1
  48. package/lib/client/composables/useUpdateDeviceStatus.js +10 -5
  49. package/lib/client/config.d.ts +3 -2
  50. package/lib/client/config.js +9 -22
  51. package/lib/client/index.d.ts +2 -1
  52. package/lib/client/index.js +0 -1
  53. package/lib/client/layouts/Layout.vue +139 -34
  54. package/lib/client/layouts/NotFound.vue +17 -5
  55. package/lib/client/shim.d.ts +12 -3
  56. package/lib/client/styles/_mixins.scss +4 -4
  57. package/lib/client/styles/_variables.module.scss +1 -1
  58. package/lib/client/styles/_variables.scss +1 -0
  59. package/lib/client/styles/arrow.scss +18 -24
  60. package/lib/client/styles/code-group.scss +35 -30
  61. package/lib/client/styles/content/code.scss +23 -0
  62. package/lib/client/styles/content/index.scss +3 -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 +1 -194
  69. package/lib/client/styles/plugins.scss +28 -0
  70. package/lib/client/styles/vars-dark.scss +20 -58
  71. package/lib/client/styles/vars.scss +53 -129
  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/client/utils/resolveRepoType.d.ts +1 -1
  86. package/lib/client/utils/resolveRepoType.js +4 -4
  87. package/lib/node/defaultTheme.d.ts +2 -1
  88. package/lib/node/defaultTheme.js +72 -46
  89. package/lib/node/index.d.ts +2 -3
  90. package/lib/node/index.js +0 -3
  91. package/lib/node/typings.d.ts +58 -0
  92. package/lib/node/typings.js +1 -0
  93. package/lib/node/utils/assignDefaultLocaleOptions.js +3 -7
  94. package/lib/node/utils/index.d.ts +1 -1
  95. package/lib/node/utils/index.js +1 -1
  96. package/lib/node/utils/resolveMarkdownHintLocales.d.ts +9 -0
  97. package/lib/node/utils/resolveMarkdownHintLocales.js +19 -0
  98. package/lib/shared/index.d.ts +5 -3
  99. package/lib/shared/index.js +1 -3
  100. package/lib/shared/nav.d.ts +19 -30
  101. package/lib/shared/navbar.d.ts +21 -0
  102. package/lib/shared/navbar.js +1 -0
  103. package/lib/shared/options.d.ts +36 -60
  104. package/lib/shared/page.d.ts +9 -6
  105. package/lib/shared/sidebar.d.ts +26 -0
  106. package/lib/shared/sidebar.js +1 -0
  107. package/package.json +30 -26
  108. package/templates/build.html +23 -14
  109. package/lib/client/components/AutoLink.vue +0 -113
  110. package/lib/client/components/DropdownTransition.vue +0 -25
  111. package/lib/client/components/Home.vue +0 -15
  112. package/lib/client/components/HomeContent.vue +0 -5
  113. package/lib/client/components/HomeFeatures.vue +0 -22
  114. package/lib/client/components/Navbar.vue +0 -79
  115. package/lib/client/components/NavbarDropdown.vue +0 -126
  116. package/lib/client/components/NavbarItems.vue +0 -199
  117. package/lib/client/components/Page.vue +0 -31
  118. package/lib/client/components/PageMeta.vue +0 -124
  119. package/lib/client/components/PageNav.vue +0 -122
  120. package/lib/client/components/Sidebar.vue +0 -18
  121. package/lib/client/components/SidebarItem.vue +0 -87
  122. package/lib/client/components/ToggleColorModeButton.vue +0 -57
  123. package/lib/client/components/ToggleSidebarButton.vue +0 -24
  124. package/lib/client/components/global/CodeGroup.d.ts +0 -6
  125. package/lib/client/components/global/CodeGroup.js +0 -120
  126. package/lib/client/components/global/CodeGroupItem.vue +0 -27
  127. package/lib/client/styles/badge.scss +0 -36
  128. package/lib/client/styles/code.scss +0 -263
  129. package/lib/client/styles/custom-container.scss +0 -142
  130. package/lib/client/styles/home.scss +0 -168
  131. package/lib/client/styles/navbar-dropdown.scss +0 -183
  132. package/lib/client/styles/navbar.scss +0 -197
  133. package/lib/client/styles/page.scss +0 -87
  134. package/lib/client/styles/sidebar.scss +0 -134
  135. package/lib/client/styles/transitions.scss +0 -22
  136. package/lib/client/utils/getNavLink.d.ts +0 -15
  137. package/lib/client/utils/getNavLink.js +0 -18
  138. package/lib/client/utils/getResolveRouteWithRedirect.d.ts +0 -5
  139. package/lib/client/utils/getResolveRouteWithRedirect.js +0 -22
  140. package/lib/node/utils/resolveContainerPluginOptions.d.ts +0 -8
  141. package/lib/node/utils/resolveContainerPluginOptions.js +0 -17
@@ -1,6 +1,6 @@
1
- @import '_variables';
1
+ @import 'variables';
2
2
 
3
- @mixin content_wrapper {
3
+ @mixin content-wrapper {
4
4
  max-width: var(--content-width);
5
5
  margin: 0 auto;
6
6
  padding: 2rem 2.5rem;
@@ -14,7 +14,7 @@
14
14
  }
15
15
  }
16
16
 
17
- @mixin dropdown_wrapper {
18
- transition: height 0.1s ease-out;
17
+ @mixin dropdown-wrapper {
19
18
  overflow: hidden;
19
+ transition: height 0.1s ease-out;
20
20
  }
@@ -1,4 +1,4 @@
1
- @import '_variables';
1
+ @import 'variables';
2
2
 
3
3
  :export {
4
4
  mobile: $MQMobile;
@@ -1,3 +1,4 @@
1
+ /* stylelint-disable scss/dollar-variable-pattern */
1
2
  @import '@vuepress/plugin-palette/palette';
2
3
 
3
4
  // responsive breakpoints
@@ -1,37 +1,31 @@
1
1
  .arrow {
2
2
  display: inline-block;
3
- width: 0;
4
- height: 0;
5
-
6
- &.up {
7
- border: {
8
- left: 4px solid transparent;
9
- right: 4px solid transparent;
10
- bottom: 6px solid var(--c-bg-arrow);
11
- }
3
+ vertical-align: middle;
4
+
5
+ width: 1em;
6
+ height: 1em;
7
+
8
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='rgba(0,0,0,0.5)' d='M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z'/%3E%3C/svg%3E");
9
+ background-position: center;
10
+ background-repeat: no-repeat;
11
+
12
+ line-height: normal;
13
+
14
+ transition: all 0.3s;
15
+
16
+ [data-theme='dark'] & {
17
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='rgba(255,255,255,0.5)' d='M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z'/%3E%3C/svg%3E");
12
18
  }
13
19
 
14
20
  &.down {
15
- border: {
16
- left: 4px solid transparent;
17
- right: 4px solid transparent;
18
- top: 6px solid var(--c-bg-arrow);
19
- }
21
+ transform: rotate(180deg);
20
22
  }
21
23
 
22
24
  &.right {
23
- border: {
24
- top: 4px solid transparent;
25
- bottom: 4px solid transparent;
26
- left: 6px solid var(--c-bg-arrow);
27
- }
25
+ transform: rotate(90deg);
28
26
  }
29
27
 
30
28
  &.left {
31
- border: {
32
- top: 4px solid transparent;
33
- bottom: 4px solid transparent;
34
- right: 6px solid var(--c-bg-arrow);
35
- }
29
+ transform: rotate(-90deg);
36
30
  }
37
31
  }
@@ -1,48 +1,53 @@
1
- @import '_variables';
1
+ @import 'variables';
2
2
 
3
3
  /**
4
4
  * code-group
5
5
  */
6
- .code-group__nav {
6
+ .code-group-nav {
7
7
  margin-top: 0.85rem;
8
+
8
9
  // 2 * margin + border-radius of <pre> tag
9
10
  margin-bottom: calc(-1.7rem - 6px);
11
+ padding-top: 10px;
10
12
  padding-bottom: calc(1.7rem - 6px);
11
13
  padding-left: 10px;
12
- padding-top: 10px;
13
14
  border-top-left-radius: 6px;
14
15
  border-top-right-radius: 6px;
15
- background-color: var(--c-code-group-tab-bg);
16
+
17
+ background-color: var(--vp-c-code-tab-bg);
18
+
19
+ transition: background-color var(--vp-t-color);
20
+
21
+ @media (max-width: $MQMobileNarrow) {
22
+ margin-right: -1.5rem;
23
+ margin-left: -1.5rem;
24
+ border-radius: 0;
25
+ }
16
26
  }
17
27
 
18
- .code-group__nav-tab {
19
- border: 0;
28
+ .code-group-nav-tab {
20
29
  padding: 5px;
21
- cursor: pointer;
30
+ border: 0;
31
+
22
32
  background-color: transparent;
33
+ color: var(--vp-c-code-tab-title);
34
+
35
+ font-weight: 600;
23
36
  font-size: 0.85em;
24
37
  line-height: 1.4;
25
- color: var(--c-code-group-tab-title);
26
- font-weight: 600;
27
- }
28
38
 
29
- .code-group__nav-tab:focus {
30
- outline: none;
31
- }
39
+ cursor: pointer;
32
40
 
33
- .code-group__nav-tab:focus-visible {
34
- outline: 1px solid var(--c-code-group-tab-outline);
35
- }
41
+ &:focus {
42
+ outline: none;
43
+ }
36
44
 
37
- .code-group__nav-tab-active {
38
- border-bottom: var(--c-code-group-tab-active-border) 1px solid;
39
- }
45
+ &:focus-visible {
46
+ outline: 1px solid;
47
+ }
40
48
 
41
- @media (max-width: $MQMobileNarrow) {
42
- .code-group__nav {
43
- margin-left: -1.5rem;
44
- margin-right: -1.5rem;
45
- border-radius: 0;
49
+ &.active {
50
+ border-bottom: var(--vp-c-code-tab-active) 1px solid;
46
51
  }
47
52
  }
48
53
 
@@ -51,12 +56,12 @@
51
56
  */
52
57
  .code-group-item {
53
58
  display: none;
54
- }
55
59
 
56
- .code-group-item__active {
57
- display: block;
58
- }
60
+ &.active {
61
+ display: block;
62
+ }
59
63
 
60
- .code-group-item > pre {
61
- background-color: orange;
64
+ > pre {
65
+ background-color: #ffa500;
66
+ }
62
67
  }
@@ -0,0 +1,23 @@
1
+ @import '../variables';
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
+
10
+ @media (max-width: $MQMobileNarrow) {
11
+ --code-border-radius: 0;
12
+
13
+ margin: 0.75rem -1.5rem;
14
+ }
15
+
16
+ // transitions for code notation highlighting
17
+ .line {
18
+ &.diff,
19
+ &.highlighted {
20
+ transition: background-color var(--vp-t-color);
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,3 @@
1
+ @use 'normalize';
2
+ @use 'code';
3
+ @use 'toc';
@@ -0,0 +1,39 @@
1
+ @import '../variables';
2
+
3
+ .theme-default-content {
4
+ h1,
5
+ h2,
6
+ h3,
7
+ h4,
8
+ h5,
9
+ h6 {
10
+ margin-top: calc(0.5rem - var(--header-offset));
11
+ margin-bottom: 0;
12
+ padding-top: calc(1rem + var(--header-offset));
13
+
14
+ &:first-child {
15
+ margin-bottom: 1rem;
16
+
17
+ + p,
18
+ + pre,
19
+ + .custom-container {
20
+ margin-top: 2rem;
21
+ }
22
+ }
23
+ }
24
+
25
+ h1 {
26
+ // narrow mobile
27
+ @media (max-width: $MQMobileNarrow) {
28
+ font-size: 1.9rem;
29
+ }
30
+ }
31
+
32
+ a:not(.header-anchor) {
33
+ text-decoration: underline;
34
+ }
35
+
36
+ img {
37
+ max-width: 100%;
38
+ }
39
+ }
@@ -1,5 +1,5 @@
1
1
  .table-of-contents {
2
- .badge {
2
+ .vp-badge {
3
3
  vertical-align: middle;
4
4
  }
5
5
  }
@@ -0,0 +1,37 @@
1
+ @mixin external-link-icon {
2
+ &::after {
3
+ content: '';
4
+
5
+ display: inline-block;
6
+ flex-shrink: 0;
7
+
8
+ width: 11px;
9
+ height: 11px;
10
+ margin-top: -1px;
11
+ margin-left: 4px;
12
+
13
+ background: var(--external-link-c-icon);
14
+
15
+ -webkit-mask-image: var(--external-link-icon);
16
+ mask-image: var(--external-link-icon);
17
+ }
18
+ }
19
+
20
+ .vp-external-link-icon {
21
+ @include external-link-icon;
22
+ }
23
+
24
+ .external-link-icon {
25
+ .external-link {
26
+ @include external-link-icon;
27
+ }
28
+
29
+ .theme-default-content {
30
+ a[href*="://"],
31
+ a[target=_blank] {
32
+ &:not(.no-external-link-icon) {
33
+ @include external-link-icon;
34
+ }
35
+ }
36
+ }
37
+ }
@@ -1,19 +1,9 @@
1
1
  @use 'vars';
2
2
  @use 'vars-dark';
3
3
  @use 'normalize';
4
-
4
+ @use 'content';
5
5
  @use 'arrow';
6
- @use 'badge';
7
- @use 'code';
8
- @use 'code-group';
9
- @use 'custom-container';
10
- @use 'home';
6
+ @use 'external-link-icon';
11
7
  @use 'layout';
12
- @use 'navbar';
13
- @use 'navbar-dropdown';
14
- @use 'page';
15
- @use 'sidebar';
16
- @use 'toc';
17
- @use 'transitions';
18
-
8
+ @use 'plugins';
19
9
  @use '@vuepress/plugin-palette/style';
@@ -1,203 +1,7 @@
1
- @import '_mixins';
2
- @import '_variables';
1
+ @import 'variables';
3
2
 
4
- .page {
5
- padding-top: var(--navbar-height);
6
- padding-left: var(--sidebar-width);
7
- }
8
-
9
- .navbar {
10
- position: fixed;
11
- z-index: 20;
12
- top: 0;
13
- left: 0;
14
- right: 0;
15
- height: var(--navbar-height);
16
- box-sizing: border-box;
17
- border-bottom: 1px solid var(--c-border);
18
- background-color: var(--c-bg-navbar);
19
- transition:
20
- background-color var(--t-color),
21
- border-color var(--t-color);
22
- }
23
-
24
- .sidebar {
25
- font-size: 16px;
26
- width: var(--sidebar-width);
27
- position: fixed;
28
- z-index: 10;
29
- margin: 0;
30
- top: var(--navbar-height);
31
- left: 0;
32
- bottom: 0;
33
- box-sizing: border-box;
34
- border-right: 1px solid var(--c-border);
35
- overflow-y: auto;
36
- scrollbar-width: thin;
37
- scrollbar-color: var(--c-brand) var(--c-border);
38
- background-color: var(--c-bg-sidebar);
39
- transition:
40
- transform var(--t-transform),
41
- background-color var(--t-color),
42
- border-color var(--t-color);
43
- &::-webkit-scrollbar {
44
- width: 7px;
45
- }
46
- &::-webkit-scrollbar-track {
47
- background-color: var(--c-border);
48
- }
49
- &::-webkit-scrollbar-thumb {
50
- background-color: var(--c-brand);
51
- }
52
- }
53
-
54
- .sidebar-mask {
55
- position: fixed;
56
- z-index: 9;
57
- top: 0;
58
- left: 0;
59
- width: 100vw;
60
- height: 100vh;
61
- display: none;
62
- }
63
-
64
- .theme-container {
65
- &.sidebar-open {
66
- .sidebar-mask {
67
- display: block;
68
- }
69
-
70
- .navbar > .toggle-sidebar-button .icon {
71
- span {
72
- &:nth-child(1) {
73
- transform: rotate(45deg) translate3d(5.5px, 5.5px, 0);
74
- }
75
-
76
- &:nth-child(2) {
77
- transform: scale3d(0, 1, 1);
78
- }
79
-
80
- &:nth-child(3) {
81
- transform: rotate(-45deg) translate3d(6px, -6px, 0);
82
- }
83
-
84
- &:nth-child(1),
85
- &:nth-child(3) {
86
- transform-origin: center;
87
- }
88
- }
89
- }
90
- }
91
-
92
- &.no-navbar {
93
- .theme-default-content {
94
- h1,
95
- h2,
96
- h3,
97
- h4,
98
- h5,
99
- h6 {
100
- margin-top: 1.5rem;
101
- padding-top: 0;
102
- }
103
- }
104
-
105
- .page {
106
- padding-top: 0;
107
- }
108
-
109
- .sidebar {
110
- top: 0;
111
- }
112
- }
113
- }
114
- .theme-container.no-sidebar {
115
- .sidebar {
3
+ .vp-hide-mobile {
4
+ @media screen and (max-width: $MQMobile) {
116
5
  display: none;
117
-
118
- @media (max-width: $MQMobile) {
119
- display: block;
120
- }
121
- }
122
-
123
- .page {
124
- padding-left: 0;
125
- }
126
- }
127
-
128
- .theme-default-content {
129
- a:not(.header-anchor):hover {
130
- text-decoration: underline;
131
- }
132
-
133
- img {
134
- max-width: 100%;
135
- }
136
-
137
- h1,
138
- h2,
139
- h3,
140
- h4,
141
- h5,
142
- h6 {
143
- margin-top: calc(0.5rem - var(--navbar-height));
144
- padding-top: calc(1rem + var(--navbar-height));
145
- margin-bottom: 0;
146
-
147
- &:first-child {
148
- margin-bottom: 1rem;
149
-
150
- + p,
151
- + pre,
152
- + .custom-container {
153
- margin-top: 2rem;
154
- }
155
- }
156
- }
157
- }
158
-
159
- // narrow desktop / iPad
160
- @media (max-width: $MQNarrow) {
161
- .sidebar {
162
- font-size: 15px;
163
- width: var(--sidebar-width-mobile);
164
- }
165
-
166
- .page {
167
- padding-left: var(--sidebar-width-mobile);
168
- }
169
- }
170
-
171
- // wide mobile
172
- @media (max-width: $MQMobile) {
173
- .sidebar {
174
- top: 0;
175
- padding-top: var(--navbar-height);
176
- transform: translateX(-100%);
177
- }
178
-
179
- .page {
180
- padding-left: 0;
181
- }
182
-
183
- .theme-container {
184
- &.sidebar-open {
185
- .sidebar {
186
- transform: translateX(0);
187
- }
188
- }
189
-
190
- &.no-navbar {
191
- .sidebar {
192
- padding-top: 0;
193
- }
194
- }
195
- }
196
- }
197
-
198
- // narrow mobile
199
- @media (max-width: $MQMobileNarrow) {
200
- h1 {
201
- font-size: 1.9rem;
202
6
  }
203
7
  }