@docusaurus/theme-classic 3.1.0 → 3.1.1

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.
@@ -14,6 +14,7 @@ export default function MDXImg(props) {
14
14
  return (
15
15
  // eslint-disable-next-line jsx-a11y/alt-text
16
16
  <img
17
+ decoding="async"
17
18
  loading="lazy"
18
19
  {...props}
19
20
  className={transformImgClassName(props.className)}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { type ReactNode } from 'react';
8
+ import type { Props } from '@theme/MDXComponents/Li';
9
+ export default function MDXLi(props: Props): ReactNode | undefined;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React from 'react';
8
+ import useBrokenLinks from '@docusaurus/useBrokenLinks';
9
+ export default function MDXLi(props) {
10
+ // MDX Footnotes have ids such as <li id="user-content-fn-1-953011">
11
+ useBrokenLinks().collectAnchor(props.id);
12
+ return <li {...props} />;
13
+ }
@@ -12,6 +12,7 @@ import MDXPre from '@theme/MDXComponents/Pre';
12
12
  import MDXDetails from '@theme/MDXComponents/Details';
13
13
  import MDXHeading from '@theme/MDXComponents/Heading';
14
14
  import MDXUl from '@theme/MDXComponents/Ul';
15
+ import MDXLi from '@theme/MDXComponents/Li';
15
16
  import MDXImg from '@theme/MDXComponents/Img';
16
17
  import Admonition from '@theme/Admonition';
17
18
  import Mermaid from '@theme/Mermaid';
@@ -23,6 +24,7 @@ const MDXComponents = {
23
24
  a: MDXA,
24
25
  pre: MDXPre,
25
26
  ul: MDXUl,
27
+ li: MDXLi,
26
28
  img: MDXImg,
27
29
  h1: (props) => <MDXHeading as="h1" {...props} />,
28
30
  h2: (props) => <MDXHeading as="h2" {...props} />,
@@ -66,6 +66,9 @@ function DropdownNavbarItemDesktop({
66
66
  aria-haspopup="true"
67
67
  aria-expanded={showDropdown}
68
68
  role="button"
69
+ // # hash permits to make the <a> tag focusable in case no link target
70
+ // See https://github.com/facebook/docusaurus/pull/6003
71
+ // There's probably a better solution though...
69
72
  href={props.to ? undefined : '#'}
70
73
  className={clsx('navbar__link', className)}
71
74
  {...props}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "Classic theme for Docusaurus",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/theme-classic.d.ts",
@@ -20,18 +20,18 @@
20
20
  "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
21
21
  },
22
22
  "dependencies": {
23
- "@docusaurus/core": "3.1.0",
24
- "@docusaurus/mdx-loader": "3.1.0",
25
- "@docusaurus/module-type-aliases": "3.1.0",
26
- "@docusaurus/plugin-content-blog": "3.1.0",
27
- "@docusaurus/plugin-content-docs": "3.1.0",
28
- "@docusaurus/plugin-content-pages": "3.1.0",
29
- "@docusaurus/theme-common": "3.1.0",
30
- "@docusaurus/theme-translations": "3.1.0",
31
- "@docusaurus/types": "3.1.0",
32
- "@docusaurus/utils": "3.1.0",
33
- "@docusaurus/utils-common": "3.1.0",
34
- "@docusaurus/utils-validation": "3.1.0",
23
+ "@docusaurus/core": "3.1.1",
24
+ "@docusaurus/mdx-loader": "3.1.1",
25
+ "@docusaurus/module-type-aliases": "3.1.1",
26
+ "@docusaurus/plugin-content-blog": "3.1.1",
27
+ "@docusaurus/plugin-content-docs": "3.1.1",
28
+ "@docusaurus/plugin-content-pages": "3.1.1",
29
+ "@docusaurus/theme-common": "3.1.1",
30
+ "@docusaurus/theme-translations": "3.1.1",
31
+ "@docusaurus/types": "3.1.1",
32
+ "@docusaurus/utils": "3.1.1",
33
+ "@docusaurus/utils-common": "3.1.1",
34
+ "@docusaurus/utils-validation": "3.1.1",
35
35
  "@mdx-js/react": "^3.0.0",
36
36
  "clsx": "^2.0.0",
37
37
  "copy-text-to-clipboard": "^3.2.0",
@@ -47,7 +47,6 @@
47
47
  "utility-types": "^3.10.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@types/mdx-js__react": "^1.5.5",
51
50
  "@types/nprogress": "^0.2.0",
52
51
  "@types/prismjs": "^1.26.0",
53
52
  "@types/rtlcss": "^3.5.1",
@@ -62,5 +61,5 @@
62
61
  "engines": {
63
62
  "node": ">=18.0"
64
63
  },
65
- "gitHead": "a5e675821f0e8b70b591fcebf19fd60a70d55548"
64
+ "gitHead": "8017f6a6776ba1bd7065e630a52fe2c2654e2f1b"
66
65
  }
@@ -19,6 +19,7 @@ export default function MDXImg(props: Props): JSX.Element {
19
19
  return (
20
20
  // eslint-disable-next-line jsx-a11y/alt-text
21
21
  <img
22
+ decoding="async"
22
23
  loading="lazy"
23
24
  {...props}
24
25
  className={transformImgClassName(props.className)}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import React, {type ReactNode} from 'react';
9
+ import useBrokenLinks from '@docusaurus/useBrokenLinks';
10
+ import type {Props} from '@theme/MDXComponents/Li';
11
+
12
+ export default function MDXLi(props: Props): ReactNode | undefined {
13
+ // MDX Footnotes have ids such as <li id="user-content-fn-1-953011">
14
+ useBrokenLinks().collectAnchor(props.id);
15
+
16
+ return <li {...props} />;
17
+ }
@@ -13,6 +13,7 @@ import MDXPre from '@theme/MDXComponents/Pre';
13
13
  import MDXDetails from '@theme/MDXComponents/Details';
14
14
  import MDXHeading from '@theme/MDXComponents/Heading';
15
15
  import MDXUl from '@theme/MDXComponents/Ul';
16
+ import MDXLi from '@theme/MDXComponents/Li';
16
17
  import MDXImg from '@theme/MDXComponents/Img';
17
18
  import Admonition from '@theme/Admonition';
18
19
  import Mermaid from '@theme/Mermaid';
@@ -27,6 +28,7 @@ const MDXComponents: MDXComponentsObject = {
27
28
  a: MDXA,
28
29
  pre: MDXPre,
29
30
  ul: MDXUl,
31
+ li: MDXLi,
30
32
  img: MDXImg,
31
33
  h1: (props: ComponentProps<'h1'>) => <MDXHeading as="h1" {...props} />,
32
34
  h2: (props: ComponentProps<'h2'>) => <MDXHeading as="h2" {...props} />,
@@ -89,6 +89,9 @@ function DropdownNavbarItemDesktop({
89
89
  aria-haspopup="true"
90
90
  aria-expanded={showDropdown}
91
91
  role="button"
92
+ // # hash permits to make the <a> tag focusable in case no link target
93
+ // See https://github.com/facebook/docusaurus/pull/6003
94
+ // There's probably a better solution though...
92
95
  href={props.to ? undefined : '#'}
93
96
  className={clsx('navbar__link', className)}
94
97
  {...props}
@@ -867,6 +867,14 @@ declare module '@theme/MDXComponents/Ul' {
867
867
  export default function MDXUl(props: Props): JSX.Element;
868
868
  }
869
869
 
870
+ declare module '@theme/MDXComponents/Li' {
871
+ import type {ComponentProps} from 'react';
872
+
873
+ export interface Props extends ComponentProps<'li'> {}
874
+
875
+ export default function MDXLi(props: Props): JSX.Element;
876
+ }
877
+
870
878
  declare module '@theme/MDXComponents/Img' {
871
879
  import type {ComponentProps} from 'react';
872
880