@docusaurus/theme-classic 0.0.0-4860 → 0.0.0-4861

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.
@@ -796,7 +796,9 @@ declare module '@theme/NavbarItem/DocNavbarItem' {
796
796
  readonly docsPluginId?: string;
797
797
  }
798
798
 
799
- export default function DocsSidebarNavbarItem(props: Props): JSX.Element;
799
+ export default function DocsSidebarNavbarItem(
800
+ props: Props,
801
+ ): JSX.Element | null;
800
802
  }
801
803
 
802
804
  declare module '@theme/NavbarItem/DocSidebarNavbarItem' {
@@ -17,7 +17,12 @@ export default function DocNavbarItem({
17
17
  ...props
18
18
  }) {
19
19
  const {activeDoc} = useActiveDocContext(docsPluginId);
20
- const doc = useLayoutDoc(docId, docsPluginId);
20
+ const doc = useLayoutDoc(docId, docsPluginId); // Draft items are not displayed in the navbar.
21
+
22
+ if (doc === null) {
23
+ return null;
24
+ }
25
+
21
26
  const activeDocInfimaClassName = getInfimaActiveClassName(props.mobile);
22
27
  return (
23
28
  <DefaultNavbarItem
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "0.0.0-4860",
3
+ "version": "0.0.0-4861",
4
4
  "description": "Classic theme for Docusaurus",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/theme-classic.d.ts",
@@ -21,15 +21,15 @@
21
21
  "format:lib-next": "prettier --config ../../.prettierrc --write \"lib-next/**/*.{js,ts,jsx,tsc}\""
22
22
  },
23
23
  "dependencies": {
24
- "@docusaurus/core": "0.0.0-4860",
25
- "@docusaurus/plugin-content-blog": "0.0.0-4860",
26
- "@docusaurus/plugin-content-docs": "0.0.0-4860",
27
- "@docusaurus/plugin-content-pages": "0.0.0-4860",
28
- "@docusaurus/theme-common": "0.0.0-4860",
29
- "@docusaurus/theme-translations": "0.0.0-4860",
30
- "@docusaurus/utils": "0.0.0-4860",
31
- "@docusaurus/utils-common": "0.0.0-4860",
32
- "@docusaurus/utils-validation": "0.0.0-4860",
24
+ "@docusaurus/core": "0.0.0-4861",
25
+ "@docusaurus/plugin-content-blog": "0.0.0-4861",
26
+ "@docusaurus/plugin-content-docs": "0.0.0-4861",
27
+ "@docusaurus/plugin-content-pages": "0.0.0-4861",
28
+ "@docusaurus/theme-common": "0.0.0-4861",
29
+ "@docusaurus/theme-translations": "0.0.0-4861",
30
+ "@docusaurus/utils": "0.0.0-4861",
31
+ "@docusaurus/utils-common": "0.0.0-4861",
32
+ "@docusaurus/utils-validation": "0.0.0-4861",
33
33
  "@mdx-js/react": "^1.6.22",
34
34
  "clsx": "^1.1.1",
35
35
  "copy-text-to-clipboard": "^3.0.1",
@@ -45,8 +45,8 @@
45
45
  "@babel/cli": "^7.17.6",
46
46
  "@babel/core": "^7.17.9",
47
47
  "@babel/preset-typescript": "^7.16.7",
48
- "@docusaurus/module-type-aliases": "0.0.0-4860",
49
- "@docusaurus/types": "0.0.0-4860",
48
+ "@docusaurus/module-type-aliases": "0.0.0-4861",
49
+ "@docusaurus/types": "0.0.0-4861",
50
50
  "@types/mdx-js__react": "^1.5.5",
51
51
  "@types/prismjs": "^1.26.0",
52
52
  "@types/rtlcss": "^3.1.3",
@@ -62,5 +62,5 @@
62
62
  "engines": {
63
63
  "node": ">=14"
64
64
  },
65
- "gitHead": "dd89ce688ef649f835f2bf6be614c6997ba47165"
65
+ "gitHead": "98ec6aafe622a5101a4356e7ea9b30c441e3b977"
66
66
  }
@@ -18,9 +18,15 @@ export default function DocNavbarItem({
18
18
  label: staticLabel,
19
19
  docsPluginId,
20
20
  ...props
21
- }: Props): JSX.Element {
21
+ }: Props): JSX.Element | null {
22
22
  const {activeDoc} = useActiveDocContext(docsPluginId);
23
23
  const doc = useLayoutDoc(docId, docsPluginId);
24
+
25
+ // Draft items are not displayed in the navbar.
26
+ if (doc === null) {
27
+ return null;
28
+ }
29
+
24
30
  const activeDocInfimaClassName = getInfimaActiveClassName(props.mobile);
25
31
 
26
32
  return (
@@ -796,7 +796,9 @@ declare module '@theme/NavbarItem/DocNavbarItem' {
796
796
  readonly docsPluginId?: string;
797
797
  }
798
798
 
799
- export default function DocsSidebarNavbarItem(props: Props): JSX.Element;
799
+ export default function DocsSidebarNavbarItem(
800
+ props: Props,
801
+ ): JSX.Element | null;
800
802
  }
801
803
 
802
804
  declare module '@theme/NavbarItem/DocSidebarNavbarItem' {