@docusaurus/theme-classic 3.9.1 → 3.9.2
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/EditMetaRow/index.js +3 -1
- package/lib/theme/EditMetaRow/styles.module.css +6 -0
- package/lib/theme/Heading/index.d.ts +1 -0
- package/lib/theme/Heading/index.js +4 -12
- package/lib/theme/Heading/styles.module.css +0 -13
- package/lib/theme/MDXComponents/A/index.js +5 -24
- package/lib/theme/MDXComponents/Li.js +6 -1
- package/package.json +15 -15
- package/src/theme/EditMetaRow/index.tsx +3 -1
- package/src/theme/EditMetaRow/styles.module.css +6 -0
- package/src/theme/Heading/index.tsx +5 -13
- package/src/theme/Heading/styles.module.css +0 -13
- package/src/theme/MDXComponents/A/index.tsx +5 -26
- package/src/theme/MDXComponents/Li.tsx +6 -1
- package/lib/theme/MDXComponents/A/styles.module.css +0 -20
- package/src/theme/MDXComponents/A/styles.module.css +0 -20
|
@@ -17,7 +17,9 @@ export default function EditMetaRow({
|
|
|
17
17
|
}) {
|
|
18
18
|
return (
|
|
19
19
|
<div className={clsx('row', className)}>
|
|
20
|
-
<div className=
|
|
20
|
+
<div className={clsx('col', styles.noPrint)}>
|
|
21
|
+
{editUrl && <EditThisPage editUrl={editUrl} />}
|
|
22
|
+
</div>
|
|
21
23
|
<div className={clsx('col', styles.lastUpdated)}>
|
|
22
24
|
{(lastUpdatedAt || lastUpdatedBy) && (
|
|
23
25
|
<LastUpdated
|
|
@@ -7,15 +7,13 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import {translate} from '@docusaurus/Translate';
|
|
10
|
-
import {
|
|
10
|
+
import {useAnchorTargetClassName} from '@docusaurus/theme-common';
|
|
11
11
|
import Link from '@docusaurus/Link';
|
|
12
12
|
import useBrokenLinks from '@docusaurus/useBrokenLinks';
|
|
13
|
-
import
|
|
13
|
+
import './styles.module.css';
|
|
14
14
|
export default function Heading({as: As, id, ...props}) {
|
|
15
15
|
const brokenLinks = useBrokenLinks();
|
|
16
|
-
const
|
|
17
|
-
navbar: {hideOnScroll},
|
|
18
|
-
} = useThemeConfig();
|
|
16
|
+
const anchorTargetClassName = useAnchorTargetClassName(id);
|
|
19
17
|
// H1 headings do not need an id because they don't appear in the TOC.
|
|
20
18
|
if (As === 'h1' || !id) {
|
|
21
19
|
return <As {...props} id={undefined} />;
|
|
@@ -34,13 +32,7 @@ export default function Heading({as: As, id, ...props}) {
|
|
|
34
32
|
return (
|
|
35
33
|
<As
|
|
36
34
|
{...props}
|
|
37
|
-
className={clsx(
|
|
38
|
-
'anchor',
|
|
39
|
-
hideOnScroll
|
|
40
|
-
? styles.anchorWithHideOnScrollNavbar
|
|
41
|
-
: styles.anchorWithStickyNavbar,
|
|
42
|
-
props.className,
|
|
43
|
-
)}
|
|
35
|
+
className={clsx('anchor', anchorTargetClassName, props.className)}
|
|
44
36
|
id={id}>
|
|
45
37
|
{props.children}
|
|
46
38
|
<Link
|
|
@@ -5,19 +5,6 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
/*
|
|
9
|
-
When the navbar is sticky, ensure that on anchor click,
|
|
10
|
-
the browser does not scroll that anchor behind the navbar
|
|
11
|
-
See https://x.com/JoshWComeau/status/1332015868725891076
|
|
12
|
-
*/
|
|
13
|
-
.anchorWithStickyNavbar {
|
|
14
|
-
scroll-margin-top: calc(var(--ifm-navbar-height) + 0.5rem);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.anchorWithHideOnScrollNavbar {
|
|
18
|
-
scroll-margin-top: 0.5rem;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
8
|
:global(.hash-link) {
|
|
22
9
|
opacity: 0;
|
|
23
10
|
padding-left: 0.5rem;
|
|
@@ -7,30 +7,11 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import Link from '@docusaurus/Link';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
function FootnoteRefLink(props) {
|
|
16
|
-
const {
|
|
17
|
-
navbar: {hideOnScroll},
|
|
18
|
-
} = useThemeConfig();
|
|
10
|
+
import {useAnchorTargetClassName} from '@docusaurus/theme-common';
|
|
11
|
+
export default function MDXA(props) {
|
|
12
|
+
// MDX Footnotes have ids such as <a id="user-content-fn-1-953011" ...>
|
|
13
|
+
const anchorTargetClassName = useAnchorTargetClassName(props.id);
|
|
19
14
|
return (
|
|
20
|
-
<Link
|
|
21
|
-
{...props}
|
|
22
|
-
className={clsx(
|
|
23
|
-
hideOnScroll
|
|
24
|
-
? styles.footnoteRefHideOnScrollNavbar
|
|
25
|
-
: styles.footnoteRefStickyNavbar,
|
|
26
|
-
props.className,
|
|
27
|
-
)}
|
|
28
|
-
/>
|
|
15
|
+
<Link {...props} className={clsx(anchorTargetClassName, props.className)} />
|
|
29
16
|
);
|
|
30
17
|
}
|
|
31
|
-
export default function MDXA(props) {
|
|
32
|
-
if (isFootnoteRef(props)) {
|
|
33
|
-
return <FootnoteRefLink {...props} />;
|
|
34
|
-
}
|
|
35
|
-
return <Link {...props} />;
|
|
36
|
-
}
|
|
@@ -5,9 +5,14 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import clsx from 'clsx';
|
|
8
9
|
import useBrokenLinks from '@docusaurus/useBrokenLinks';
|
|
10
|
+
import {useAnchorTargetClassName} from '@docusaurus/theme-common';
|
|
9
11
|
export default function MDXLi(props) {
|
|
10
12
|
// MDX Footnotes have ids such as <li id="user-content-fn-1-953011">
|
|
11
13
|
useBrokenLinks().collectAnchor(props.id);
|
|
12
|
-
|
|
14
|
+
const anchorTargetClassName = useAnchorTargetClassName(props.id);
|
|
15
|
+
return (
|
|
16
|
+
<li className={clsx(anchorTargetClassName, props.className)} {...props} />
|
|
17
|
+
);
|
|
13
18
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/theme-classic",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.2",
|
|
4
4
|
"description": "Classic theme for Docusaurus",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/theme-classic.d.ts",
|
|
@@ -20,19 +20,19 @@
|
|
|
20
20
|
"copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@docusaurus/core": "3.9.
|
|
24
|
-
"@docusaurus/logger": "3.9.
|
|
25
|
-
"@docusaurus/mdx-loader": "3.9.
|
|
26
|
-
"@docusaurus/module-type-aliases": "3.9.
|
|
27
|
-
"@docusaurus/plugin-content-blog": "3.9.
|
|
28
|
-
"@docusaurus/plugin-content-docs": "3.9.
|
|
29
|
-
"@docusaurus/plugin-content-pages": "3.9.
|
|
30
|
-
"@docusaurus/theme-common": "3.9.
|
|
31
|
-
"@docusaurus/theme-translations": "3.9.
|
|
32
|
-
"@docusaurus/types": "3.9.
|
|
33
|
-
"@docusaurus/utils": "3.9.
|
|
34
|
-
"@docusaurus/utils-common": "3.9.
|
|
35
|
-
"@docusaurus/utils-validation": "3.9.
|
|
23
|
+
"@docusaurus/core": "3.9.2",
|
|
24
|
+
"@docusaurus/logger": "3.9.2",
|
|
25
|
+
"@docusaurus/mdx-loader": "3.9.2",
|
|
26
|
+
"@docusaurus/module-type-aliases": "3.9.2",
|
|
27
|
+
"@docusaurus/plugin-content-blog": "3.9.2",
|
|
28
|
+
"@docusaurus/plugin-content-docs": "3.9.2",
|
|
29
|
+
"@docusaurus/plugin-content-pages": "3.9.2",
|
|
30
|
+
"@docusaurus/theme-common": "3.9.2",
|
|
31
|
+
"@docusaurus/theme-translations": "3.9.2",
|
|
32
|
+
"@docusaurus/types": "3.9.2",
|
|
33
|
+
"@docusaurus/utils": "3.9.2",
|
|
34
|
+
"@docusaurus/utils-common": "3.9.2",
|
|
35
|
+
"@docusaurus/utils-validation": "3.9.2",
|
|
36
36
|
"@mdx-js/react": "^3.0.0",
|
|
37
37
|
"clsx": "^2.0.0",
|
|
38
38
|
"infima": "0.2.0-alpha.45",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=20.0"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "abfbe5621b08407bc3dcbe6111ff118d4c22f7a1"
|
|
65
65
|
}
|
|
@@ -20,7 +20,9 @@ export default function EditMetaRow({
|
|
|
20
20
|
}: Props): ReactNode {
|
|
21
21
|
return (
|
|
22
22
|
<div className={clsx('row', className)}>
|
|
23
|
-
<div className=
|
|
23
|
+
<div className={clsx('col', styles.noPrint)}>
|
|
24
|
+
{editUrl && <EditThisPage editUrl={editUrl} />}
|
|
25
|
+
</div>
|
|
24
26
|
<div className={clsx('col', styles.lastUpdated)}>
|
|
25
27
|
{(lastUpdatedAt || lastUpdatedBy) && (
|
|
26
28
|
<LastUpdated
|
|
@@ -8,18 +8,16 @@
|
|
|
8
8
|
import React, {type ReactNode} from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import {translate} from '@docusaurus/Translate';
|
|
11
|
-
import {
|
|
11
|
+
import {useAnchorTargetClassName} from '@docusaurus/theme-common';
|
|
12
12
|
import Link from '@docusaurus/Link';
|
|
13
13
|
import useBrokenLinks from '@docusaurus/useBrokenLinks';
|
|
14
14
|
import type {Props} from '@theme/Heading';
|
|
15
|
-
|
|
16
|
-
import styles from './styles.module.css';
|
|
15
|
+
import './styles.module.css';
|
|
17
16
|
|
|
18
17
|
export default function Heading({as: As, id, ...props}: Props): ReactNode {
|
|
19
18
|
const brokenLinks = useBrokenLinks();
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
} = useThemeConfig();
|
|
19
|
+
const anchorTargetClassName = useAnchorTargetClassName(id);
|
|
20
|
+
|
|
23
21
|
// H1 headings do not need an id because they don't appear in the TOC.
|
|
24
22
|
if (As === 'h1' || !id) {
|
|
25
23
|
return <As {...props} id={undefined} />;
|
|
@@ -41,13 +39,7 @@ export default function Heading({as: As, id, ...props}: Props): ReactNode {
|
|
|
41
39
|
return (
|
|
42
40
|
<As
|
|
43
41
|
{...props}
|
|
44
|
-
className={clsx(
|
|
45
|
-
'anchor',
|
|
46
|
-
hideOnScroll
|
|
47
|
-
? styles.anchorWithHideOnScrollNavbar
|
|
48
|
-
: styles.anchorWithStickyNavbar,
|
|
49
|
-
props.className,
|
|
50
|
-
)}
|
|
42
|
+
className={clsx('anchor', anchorTargetClassName, props.className)}
|
|
51
43
|
id={id}>
|
|
52
44
|
{props.children}
|
|
53
45
|
<Link
|
|
@@ -5,19 +5,6 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
/*
|
|
9
|
-
When the navbar is sticky, ensure that on anchor click,
|
|
10
|
-
the browser does not scroll that anchor behind the navbar
|
|
11
|
-
See https://x.com/JoshWComeau/status/1332015868725891076
|
|
12
|
-
*/
|
|
13
|
-
.anchorWithStickyNavbar {
|
|
14
|
-
scroll-margin-top: calc(var(--ifm-navbar-height) + 0.5rem);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.anchorWithHideOnScrollNavbar {
|
|
18
|
-
scroll-margin-top: 0.5rem;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
8
|
:global(.hash-link) {
|
|
22
9
|
opacity: 0;
|
|
23
10
|
padding-left: 0.5rem;
|
|
@@ -8,35 +8,14 @@
|
|
|
8
8
|
import React, {type ReactNode} from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import Link from '@docusaurus/Link';
|
|
11
|
-
import {
|
|
11
|
+
import {useAnchorTargetClassName} from '@docusaurus/theme-common';
|
|
12
12
|
import type {Props} from '@theme/MDXComponents/A';
|
|
13
|
-
import styles from './styles.module.css';
|
|
14
13
|
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
export default function MDXA(props: Props): ReactNode {
|
|
15
|
+
// MDX Footnotes have ids such as <a id="user-content-fn-1-953011" ...>
|
|
16
|
+
const anchorTargetClassName = useAnchorTargetClassName(props.id);
|
|
18
17
|
|
|
19
|
-
function FootnoteRefLink(props: Props) {
|
|
20
|
-
const {
|
|
21
|
-
navbar: {hideOnScroll},
|
|
22
|
-
} = useThemeConfig();
|
|
23
18
|
return (
|
|
24
|
-
<Link
|
|
25
|
-
{...props}
|
|
26
|
-
className={clsx(
|
|
27
|
-
hideOnScroll
|
|
28
|
-
? styles.footnoteRefHideOnScrollNavbar
|
|
29
|
-
: styles.footnoteRefStickyNavbar,
|
|
30
|
-
|
|
31
|
-
props.className,
|
|
32
|
-
)}
|
|
33
|
-
/>
|
|
19
|
+
<Link {...props} className={clsx(anchorTargetClassName, props.className)} />
|
|
34
20
|
);
|
|
35
21
|
}
|
|
36
|
-
|
|
37
|
-
export default function MDXA(props: Props): ReactNode {
|
|
38
|
-
if (isFootnoteRef(props)) {
|
|
39
|
-
return <FootnoteRefLink {...props} />;
|
|
40
|
-
}
|
|
41
|
-
return <Link {...props} />;
|
|
42
|
-
}
|
|
@@ -6,12 +6,17 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React, {type ReactNode} from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
9
10
|
import useBrokenLinks from '@docusaurus/useBrokenLinks';
|
|
11
|
+
import {useAnchorTargetClassName} from '@docusaurus/theme-common';
|
|
10
12
|
import type {Props} from '@theme/MDXComponents/Li';
|
|
11
13
|
|
|
12
14
|
export default function MDXLi(props: Props): ReactNode | undefined {
|
|
13
15
|
// MDX Footnotes have ids such as <li id="user-content-fn-1-953011">
|
|
14
16
|
useBrokenLinks().collectAnchor(props.id);
|
|
17
|
+
const anchorTargetClassName = useAnchorTargetClassName(props.id);
|
|
15
18
|
|
|
16
|
-
return
|
|
19
|
+
return (
|
|
20
|
+
<li className={clsx(anchorTargetClassName, props.className)} {...props} />
|
|
21
|
+
);
|
|
17
22
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
/*
|
|
9
|
-
When the navbar is sticky, ensure that on footnote click,
|
|
10
|
-
the browser does not scroll to the ref behind the navbar
|
|
11
|
-
See https://github.com/facebook/docusaurus/issues/11232
|
|
12
|
-
See also headings case https://x.com/JoshWComeau/status/1332015868725891076
|
|
13
|
-
*/
|
|
14
|
-
.footnoteRefStickyNavbar {
|
|
15
|
-
scroll-margin-top: calc(var(--ifm-navbar-height) + 0.5rem);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.footnoteRefHideOnScrollNavbar {
|
|
19
|
-
scroll-margin-top: 0.5rem;
|
|
20
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
/*
|
|
9
|
-
When the navbar is sticky, ensure that on footnote click,
|
|
10
|
-
the browser does not scroll to the ref behind the navbar
|
|
11
|
-
See https://github.com/facebook/docusaurus/issues/11232
|
|
12
|
-
See also headings case https://x.com/JoshWComeau/status/1332015868725891076
|
|
13
|
-
*/
|
|
14
|
-
.footnoteRefStickyNavbar {
|
|
15
|
-
scroll-margin-top: calc(var(--ifm-navbar-height) + 0.5rem);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.footnoteRefHideOnScrollNavbar {
|
|
19
|
-
scroll-margin-top: 0.5rem;
|
|
20
|
-
}
|