@docusaurus/theme-classic 0.0.0-4384 → 0.0.0-4388
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.
|
@@ -57,7 +57,7 @@ export default function DocsVersionDropdownNavbarItem({
|
|
|
57
57
|
activeDocContext.activeVersion ?? preferredVersion ?? latestVersion; // Mobile dropdown is handled a bit differently
|
|
58
58
|
|
|
59
59
|
const dropdownLabel =
|
|
60
|
-
mobile && items
|
|
60
|
+
mobile && items.length > 1
|
|
61
61
|
? translate({
|
|
62
62
|
id: 'theme.navbar.mobileVersionsDropdown.label',
|
|
63
63
|
message: 'Versions',
|
|
@@ -66,7 +66,9 @@ export default function DocsVersionDropdownNavbarItem({
|
|
|
66
66
|
})
|
|
67
67
|
: dropdownVersion.label;
|
|
68
68
|
const dropdownTo =
|
|
69
|
-
mobile && items
|
|
69
|
+
mobile && items.length > 1
|
|
70
|
+
? undefined
|
|
71
|
+
: getVersionMainDoc(dropdownVersion).path; // We don't want to render a version dropdown with 0 or 1 item
|
|
70
72
|
// If we build the site with a single docs version (onlyIncludeVersions: ['1.0.0'])
|
|
71
73
|
// We'd rather render a button instead of a dropdown
|
|
72
74
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/theme-classic",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-4388",
|
|
4
4
|
"description": "Classic theme for Docusaurus",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/theme-classic.d.ts",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"update-code-translations": "node -e 'require(\"./update-code-translations.js\").run()'"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@docusaurus/core": "0.0.0-
|
|
27
|
-
"@docusaurus/plugin-content-blog": "0.0.0-
|
|
28
|
-
"@docusaurus/plugin-content-docs": "0.0.0-
|
|
29
|
-
"@docusaurus/plugin-content-pages": "0.0.0-
|
|
30
|
-
"@docusaurus/theme-common": "0.0.0-
|
|
31
|
-
"@docusaurus/theme-translations": "0.0.0-
|
|
32
|
-
"@docusaurus/utils": "0.0.0-
|
|
33
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
26
|
+
"@docusaurus/core": "0.0.0-4388",
|
|
27
|
+
"@docusaurus/plugin-content-blog": "0.0.0-4388",
|
|
28
|
+
"@docusaurus/plugin-content-docs": "0.0.0-4388",
|
|
29
|
+
"@docusaurus/plugin-content-pages": "0.0.0-4388",
|
|
30
|
+
"@docusaurus/theme-common": "0.0.0-4388",
|
|
31
|
+
"@docusaurus/theme-translations": "0.0.0-4388",
|
|
32
|
+
"@docusaurus/utils": "0.0.0-4388",
|
|
33
|
+
"@docusaurus/utils-validation": "0.0.0-4388",
|
|
34
34
|
"@mdx-js/mdx": "^1.6.21",
|
|
35
35
|
"@mdx-js/react": "^1.6.21",
|
|
36
36
|
"clsx": "^1.1.1",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"rtlcss": "^3.3.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
49
|
-
"@docusaurus/types": "0.0.0-
|
|
48
|
+
"@docusaurus/module-type-aliases": "0.0.0-4388",
|
|
49
|
+
"@docusaurus/types": "0.0.0-4388",
|
|
50
50
|
"@types/mdx-js__react": "^1.5.4",
|
|
51
51
|
"@types/parse-numeric-range": "^0.0.1",
|
|
52
52
|
"@types/rtlcss": "^3.1.1",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=14"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "73aaa086302e31cf9e6dd3c95b55ab91c1961f2f"
|
|
65
65
|
}
|
|
@@ -17,6 +17,7 @@ import type {Props} from '@theme/NavbarItem/DocsVersionDropdownNavbarItem';
|
|
|
17
17
|
import {useDocsPreferredVersion} from '@docusaurus/theme-common';
|
|
18
18
|
import {translate} from '@docusaurus/Translate';
|
|
19
19
|
import type {GlobalVersion} from '@docusaurus/plugin-content-docs/client';
|
|
20
|
+
import type {LinkLikeNavbarItemProps} from '@theme/NavbarItem';
|
|
20
21
|
|
|
21
22
|
const getVersionMainDoc = (version: GlobalVersion) =>
|
|
22
23
|
version.docs.find((doc) => doc.id === version.mainDocId)!;
|
|
@@ -36,7 +37,7 @@ export default function DocsVersionDropdownNavbarItem({
|
|
|
36
37
|
const {preferredVersion, savePreferredVersionName} =
|
|
37
38
|
useDocsPreferredVersion(docsPluginId);
|
|
38
39
|
|
|
39
|
-
function getItems() {
|
|
40
|
+
function getItems(): LinkLikeNavbarItemProps[] {
|
|
40
41
|
const versionLinks = versions.map((version) => {
|
|
41
42
|
// We try to link to the same doc, in another version
|
|
42
43
|
// When not possible, fallback to the "main doc" of the version
|
|
@@ -64,7 +65,7 @@ export default function DocsVersionDropdownNavbarItem({
|
|
|
64
65
|
|
|
65
66
|
// Mobile dropdown is handled a bit differently
|
|
66
67
|
const dropdownLabel =
|
|
67
|
-
mobile && items
|
|
68
|
+
mobile && items.length > 1
|
|
68
69
|
? translate({
|
|
69
70
|
id: 'theme.navbar.mobileVersionsDropdown.label',
|
|
70
71
|
message: 'Versions',
|
|
@@ -73,7 +74,9 @@ export default function DocsVersionDropdownNavbarItem({
|
|
|
73
74
|
})
|
|
74
75
|
: dropdownVersion.label;
|
|
75
76
|
const dropdownTo =
|
|
76
|
-
mobile && items
|
|
77
|
+
mobile && items.length > 1
|
|
78
|
+
? undefined
|
|
79
|
+
: getVersionMainDoc(dropdownVersion).path;
|
|
77
80
|
|
|
78
81
|
// We don't want to render a version dropdown with 0 or 1 item
|
|
79
82
|
// If we build the site with a single docs version (onlyIncludeVersions: ['1.0.0'])
|