@docusaurus/theme-classic 0.0.0-5410 → 0.0.0-5416

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.
@@ -7,20 +7,17 @@
7
7
  import React from 'react';
8
8
  import Translate from '@docusaurus/Translate';
9
9
  import {ThemeClassNames} from '@docusaurus/theme-common';
10
+ import Link from '@docusaurus/Link';
10
11
  import IconEdit from '@theme/Icon/Edit';
11
12
  export default function EditThisPage({editUrl}) {
12
13
  return (
13
- <a
14
- href={editUrl}
15
- target="_blank"
16
- rel="noreferrer noopener"
17
- className={ThemeClassNames.common.editThisPage}>
14
+ <Link to={editUrl} className={ThemeClassNames.common.editThisPage}>
18
15
  <IconEdit />
19
16
  <Translate
20
17
  id="theme.common.editThisPage"
21
18
  description="The link label to edit the current page">
22
19
  Edit this page
23
20
  </Translate>
24
- </a>
21
+ </Link>
25
22
  );
26
23
  }
@@ -8,6 +8,7 @@ import React from 'react';
8
8
  import clsx from 'clsx';
9
9
  import {translate} from '@docusaurus/Translate';
10
10
  import {useThemeConfig} from '@docusaurus/theme-common';
11
+ import Link from '@docusaurus/Link';
11
12
  import styles from './styles.module.css';
12
13
  export default function Heading({as: As, id, ...props}) {
13
14
  const {
@@ -29,16 +30,16 @@ export default function Heading({as: As, id, ...props}) {
29
30
  )}
30
31
  id={id}>
31
32
  {props.children}
32
- <a
33
+ <Link
33
34
  className="hash-link"
34
- href={`#${id}`}
35
+ to={`#${id}`}
35
36
  title={translate({
36
37
  id: 'theme.common.headingLinkTitle',
37
38
  message: 'Direct link to heading',
38
39
  description: 'Title for link to heading',
39
40
  })}>
40
41
  &#8203;
41
- </a>
42
+ </Link>
42
43
  </As>
43
44
  );
44
45
  }
@@ -5,6 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React from 'react';
8
+ import Link from '@docusaurus/Link';
8
9
  // Recursive component rendering the toc tree
9
10
  function TOCItemTree({toc, className, linkClassName, isChild}) {
10
11
  if (!toc.length) {
@@ -14,12 +15,10 @@ function TOCItemTree({toc, className, linkClassName, isChild}) {
14
15
  <ul className={isChild ? undefined : className}>
15
16
  {toc.map((heading) => (
16
17
  <li key={heading.id}>
17
- {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}
18
- <a
19
- href={`#${heading.id}`}
18
+ <Link
19
+ to={`#${heading.id}`}
20
20
  className={linkClassName ?? undefined}
21
21
  // Developer provided the HTML, so assume it's safe.
22
- // eslint-disable-next-line react/no-danger
23
22
  dangerouslySetInnerHTML={{__html: heading.value}}
24
23
  />
25
24
  <TOCItemTree
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "0.0.0-5410",
3
+ "version": "0.0.0-5416",
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": "0.0.0-5410",
24
- "@docusaurus/mdx-loader": "0.0.0-5410",
25
- "@docusaurus/module-type-aliases": "0.0.0-5410",
26
- "@docusaurus/plugin-content-blog": "0.0.0-5410",
27
- "@docusaurus/plugin-content-docs": "0.0.0-5410",
28
- "@docusaurus/plugin-content-pages": "0.0.0-5410",
29
- "@docusaurus/theme-common": "0.0.0-5410",
30
- "@docusaurus/theme-translations": "0.0.0-5410",
31
- "@docusaurus/types": "0.0.0-5410",
32
- "@docusaurus/utils": "0.0.0-5410",
33
- "@docusaurus/utils-common": "0.0.0-5410",
34
- "@docusaurus/utils-validation": "0.0.0-5410",
23
+ "@docusaurus/core": "0.0.0-5416",
24
+ "@docusaurus/mdx-loader": "0.0.0-5416",
25
+ "@docusaurus/module-type-aliases": "0.0.0-5416",
26
+ "@docusaurus/plugin-content-blog": "0.0.0-5416",
27
+ "@docusaurus/plugin-content-docs": "0.0.0-5416",
28
+ "@docusaurus/plugin-content-pages": "0.0.0-5416",
29
+ "@docusaurus/theme-common": "0.0.0-5416",
30
+ "@docusaurus/theme-translations": "0.0.0-5416",
31
+ "@docusaurus/types": "0.0.0-5416",
32
+ "@docusaurus/utils": "0.0.0-5416",
33
+ "@docusaurus/utils-common": "0.0.0-5416",
34
+ "@docusaurus/utils-validation": "0.0.0-5416",
35
35
  "@mdx-js/react": "^1.6.22",
36
36
  "clsx": "^1.2.1",
37
37
  "copy-text-to-clipboard": "^3.0.1",
@@ -62,5 +62,5 @@
62
62
  "engines": {
63
63
  "node": ">=16.14"
64
64
  },
65
- "gitHead": "1675018febfafecbd59e3124d1818cf0845424e9"
65
+ "gitHead": "58fa9168665fa4cb70b0eb722e0d56d6e26ac8c6"
66
66
  }
@@ -8,22 +8,19 @@
8
8
  import React from 'react';
9
9
  import Translate from '@docusaurus/Translate';
10
10
  import {ThemeClassNames} from '@docusaurus/theme-common';
11
+ import Link from '@docusaurus/Link';
11
12
  import IconEdit from '@theme/Icon/Edit';
12
13
  import type {Props} from '@theme/EditThisPage';
13
14
 
14
15
  export default function EditThisPage({editUrl}: Props): JSX.Element {
15
16
  return (
16
- <a
17
- href={editUrl}
18
- target="_blank"
19
- rel="noreferrer noopener"
20
- className={ThemeClassNames.common.editThisPage}>
17
+ <Link to={editUrl} className={ThemeClassNames.common.editThisPage}>
21
18
  <IconEdit />
22
19
  <Translate
23
20
  id="theme.common.editThisPage"
24
21
  description="The link label to edit the current page">
25
22
  Edit this page
26
23
  </Translate>
27
- </a>
24
+ </Link>
28
25
  );
29
26
  }
@@ -9,6 +9,7 @@ import React from 'react';
9
9
  import clsx from 'clsx';
10
10
  import {translate} from '@docusaurus/Translate';
11
11
  import {useThemeConfig} from '@docusaurus/theme-common';
12
+ import Link from '@docusaurus/Link';
12
13
  import type {Props} from '@theme/Heading';
13
14
 
14
15
  import styles from './styles.module.css';
@@ -34,16 +35,16 @@ export default function Heading({as: As, id, ...props}: Props): JSX.Element {
34
35
  )}
35
36
  id={id}>
36
37
  {props.children}
37
- <a
38
+ <Link
38
39
  className="hash-link"
39
- href={`#${id}`}
40
+ to={`#${id}`}
40
41
  title={translate({
41
42
  id: 'theme.common.headingLinkTitle',
42
43
  message: 'Direct link to heading',
43
44
  description: 'Title for link to heading',
44
45
  })}>
45
46
  &#8203;
46
- </a>
47
+ </Link>
47
48
  </As>
48
49
  );
49
50
  }
@@ -7,7 +7,6 @@
7
7
 
8
8
  import React from 'react';
9
9
  import {SkipToContentLink} from '@docusaurus/theme-common';
10
-
11
10
  import styles from './styles.module.css';
12
11
 
13
12
  export default function SkipToContent(): JSX.Element {
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
+ import Link from '@docusaurus/Link';
9
10
  import type {Props} from '@theme/TOCItems/Tree';
10
11
 
11
12
  // Recursive component rendering the toc tree
@@ -22,12 +23,10 @@ function TOCItemTree({
22
23
  <ul className={isChild ? undefined : className}>
23
24
  {toc.map((heading) => (
24
25
  <li key={heading.id}>
25
- {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}
26
- <a
27
- href={`#${heading.id}`}
26
+ <Link
27
+ to={`#${heading.id}`}
28
28
  className={linkClassName ?? undefined}
29
29
  // Developer provided the HTML, so assume it's safe.
30
- // eslint-disable-next-line react/no-danger
31
30
  dangerouslySetInnerHTML={{__html: heading.value}}
32
31
  />
33
32
  <TOCItemTree