@docusaurus/theme-classic 0.0.0-5415 → 0.0.0-5419
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.
- package/lib/theme/EditThisPage/index.js +3 -6
- package/lib/theme/Heading/index.js +4 -3
- package/lib/theme/TOCItems/Tree.js +3 -4
- package/package.json +14 -14
- package/src/theme/EditThisPage/index.tsx +3 -6
- package/src/theme/Heading/index.tsx +4 -3
- package/src/theme/SkipToContent/index.tsx +0 -1
- package/src/theme/TOCItems/Tree.tsx +3 -4
|
@@ -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
|
-
<
|
|
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
|
-
</
|
|
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
|
-
<
|
|
33
|
+
<Link
|
|
33
34
|
className="hash-link"
|
|
34
|
-
|
|
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
|
​
|
|
41
|
-
</
|
|
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
|
-
|
|
18
|
-
|
|
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-
|
|
3
|
+
"version": "0.0.0-5419",
|
|
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-
|
|
24
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
25
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
26
|
-
"@docusaurus/plugin-content-blog": "0.0.0-
|
|
27
|
-
"@docusaurus/plugin-content-docs": "0.0.0-
|
|
28
|
-
"@docusaurus/plugin-content-pages": "0.0.0-
|
|
29
|
-
"@docusaurus/theme-common": "0.0.0-
|
|
30
|
-
"@docusaurus/theme-translations": "0.0.0-
|
|
31
|
-
"@docusaurus/types": "0.0.0-
|
|
32
|
-
"@docusaurus/utils": "0.0.0-
|
|
33
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
34
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
23
|
+
"@docusaurus/core": "0.0.0-5419",
|
|
24
|
+
"@docusaurus/mdx-loader": "0.0.0-5419",
|
|
25
|
+
"@docusaurus/module-type-aliases": "0.0.0-5419",
|
|
26
|
+
"@docusaurus/plugin-content-blog": "0.0.0-5419",
|
|
27
|
+
"@docusaurus/plugin-content-docs": "0.0.0-5419",
|
|
28
|
+
"@docusaurus/plugin-content-pages": "0.0.0-5419",
|
|
29
|
+
"@docusaurus/theme-common": "0.0.0-5419",
|
|
30
|
+
"@docusaurus/theme-translations": "0.0.0-5419",
|
|
31
|
+
"@docusaurus/types": "0.0.0-5419",
|
|
32
|
+
"@docusaurus/utils": "0.0.0-5419",
|
|
33
|
+
"@docusaurus/utils-common": "0.0.0-5419",
|
|
34
|
+
"@docusaurus/utils-validation": "0.0.0-5419",
|
|
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": "
|
|
65
|
+
"gitHead": "18cbc502568964a167de9df3f77aa164bccd8188"
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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
|
-
<
|
|
38
|
+
<Link
|
|
38
39
|
className="hash-link"
|
|
39
|
-
|
|
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
|
​
|
|
46
|
-
</
|
|
47
|
+
</Link>
|
|
47
48
|
</As>
|
|
48
49
|
);
|
|
49
50
|
}
|
|
@@ -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
|
-
|
|
26
|
-
|
|
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
|