@docusaurus/theme-classic 0.0.0-4305 → 0.0.0-4314
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-classic.d.ts +13 -4
- package/lib-next/theme/DocPaginator/index.js +4 -28
- package/lib-next/theme/DocPaginatorNavLink/index.js +36 -0
- package/package.json +13 -13
- package/src/theme/DocPaginator/index.tsx +6 -30
- package/src/theme/DocPaginatorNavLink/index.tsx +38 -0
- package/src/theme-classic.d.ts +13 -4
package/lib/theme-classic.d.ts
CHANGED
|
@@ -123,13 +123,22 @@ declare module '@theme/CodeBlock' {
|
|
|
123
123
|
declare module '@theme/DocPaginator' {
|
|
124
124
|
import type {PropNavigation} from '@docusaurus/plugin-content-docs';
|
|
125
125
|
|
|
126
|
-
type PageInfo = {readonly permalink: string; readonly title: string};
|
|
127
|
-
|
|
128
126
|
// May be simpler to provide a {navigation: PropNavigation} prop?
|
|
129
127
|
export interface Props extends PropNavigation {}
|
|
130
128
|
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
export default function DocPaginator(props: Props): JSX.Element;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
declare module '@theme/DocPaginatorNavLink' {
|
|
133
|
+
import type {PropNavigationLink} from '@docusaurus/plugin-content-docs';
|
|
134
|
+
|
|
135
|
+
// May be simpler to provide a {navigation: PropNavigation} prop?
|
|
136
|
+
export interface Props {
|
|
137
|
+
navLink: PropNavigationLink;
|
|
138
|
+
next?: boolean;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export default function DocPaginatorNavLink(props: Props): JSX.Element;
|
|
133
142
|
}
|
|
134
143
|
|
|
135
144
|
declare module '@theme/DocSidebar' {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import {translate} from '@docusaurus/Translate';
|
|
9
|
+
import DocPaginatorNavLink from '@theme/DocPaginatorNavLink';
|
|
10
10
|
|
|
11
11
|
function DocPaginator(props) {
|
|
12
12
|
const {previous, next} = props;
|
|
@@ -19,34 +19,10 @@ function DocPaginator(props) {
|
|
|
19
19
|
description: 'The ARIA label for the docs pagination',
|
|
20
20
|
})}>
|
|
21
21
|
<div className="pagination-nav__item">
|
|
22
|
-
{previous &&
|
|
23
|
-
<Link className="pagination-nav__link" to={previous.permalink}>
|
|
24
|
-
<div className="pagination-nav__sublabel">
|
|
25
|
-
<Translate
|
|
26
|
-
id="theme.docs.paginator.previous"
|
|
27
|
-
description="The label used to navigate to the previous doc">
|
|
28
|
-
Previous
|
|
29
|
-
</Translate>
|
|
30
|
-
</div>
|
|
31
|
-
<div className="pagination-nav__label">
|
|
32
|
-
« {previous.title}
|
|
33
|
-
</div>
|
|
34
|
-
</Link>
|
|
35
|
-
)}
|
|
22
|
+
{previous && <DocPaginatorNavLink navLink={previous} />}
|
|
36
23
|
</div>
|
|
37
24
|
<div className="pagination-nav__item pagination-nav__item--next">
|
|
38
|
-
{next &&
|
|
39
|
-
<Link className="pagination-nav__link" to={next.permalink}>
|
|
40
|
-
<div className="pagination-nav__sublabel">
|
|
41
|
-
<Translate
|
|
42
|
-
id="theme.docs.paginator.next"
|
|
43
|
-
description="The label used to navigate to the next doc">
|
|
44
|
-
Next
|
|
45
|
-
</Translate>
|
|
46
|
-
</div>
|
|
47
|
-
<div className="pagination-nav__label">{next.title} »</div>
|
|
48
|
-
</Link>
|
|
49
|
-
)}
|
|
25
|
+
{next && <DocPaginatorNavLink navLink={next} next />}
|
|
50
26
|
</div>
|
|
51
27
|
</nav>
|
|
52
28
|
);
|
|
@@ -0,0 +1,36 @@
|
|
|
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 clsx from 'clsx';
|
|
9
|
+
import Link from '@docusaurus/Link';
|
|
10
|
+
import Translate from '@docusaurus/Translate';
|
|
11
|
+
|
|
12
|
+
function DocPaginatorNavLink(props) {
|
|
13
|
+
const {navLink, next} = props;
|
|
14
|
+
return (
|
|
15
|
+
<Link className={clsx('pagination-nav__link')} to={navLink.permalink}>
|
|
16
|
+
<div className="pagination-nav__sublabel">
|
|
17
|
+
{next ? (
|
|
18
|
+
<Translate
|
|
19
|
+
id="theme.docs.paginator.next"
|
|
20
|
+
description="The label used to navigate to the next doc">
|
|
21
|
+
Next
|
|
22
|
+
</Translate>
|
|
23
|
+
) : (
|
|
24
|
+
<Translate
|
|
25
|
+
id="theme.docs.paginator.previous"
|
|
26
|
+
description="The label used to navigate to the previous doc">
|
|
27
|
+
Previous
|
|
28
|
+
</Translate>
|
|
29
|
+
)}
|
|
30
|
+
</div>
|
|
31
|
+
<div className="pagination-nav__label">{navLink.title}</div>
|
|
32
|
+
</Link>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default DocPaginatorNavLink;
|
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-4314",
|
|
4
4
|
"description": "Classic theme for Docusaurus",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/theme-classic.d.ts",
|
|
@@ -23,20 +23,20 @@
|
|
|
23
23
|
"update-code-translations": "node -e 'require(\"./update-code-translations.js\").run()'"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@docusaurus/core": "0.0.0-
|
|
27
|
-
"@docusaurus/plugin-content-blog": "0.0.0-
|
|
28
|
-
"@docusaurus/plugin-content-docs": "0.0.0-
|
|
29
|
-
"@docusaurus/plugin-content-pages": "0.0.0-
|
|
30
|
-
"@docusaurus/theme-common": "0.0.0-
|
|
31
|
-
"@docusaurus/theme-translations": "0.0.0-
|
|
32
|
-
"@docusaurus/utils": "0.0.0-
|
|
33
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
26
|
+
"@docusaurus/core": "0.0.0-4314",
|
|
27
|
+
"@docusaurus/plugin-content-blog": "0.0.0-4314",
|
|
28
|
+
"@docusaurus/plugin-content-docs": "0.0.0-4314",
|
|
29
|
+
"@docusaurus/plugin-content-pages": "0.0.0-4314",
|
|
30
|
+
"@docusaurus/theme-common": "0.0.0-4314",
|
|
31
|
+
"@docusaurus/theme-translations": "0.0.0-4314",
|
|
32
|
+
"@docusaurus/utils": "0.0.0-4314",
|
|
33
|
+
"@docusaurus/utils-validation": "0.0.0-4314",
|
|
34
34
|
"@mdx-js/mdx": "^1.6.21",
|
|
35
35
|
"@mdx-js/react": "^1.6.21",
|
|
36
36
|
"clsx": "^1.1.1",
|
|
37
37
|
"copy-text-to-clipboard": "^3.0.1",
|
|
38
38
|
"globby": "^11.0.2",
|
|
39
|
-
"infima": "0.2.0-alpha.
|
|
39
|
+
"infima": "0.2.0-alpha.37",
|
|
40
40
|
"lodash": "^4.17.20",
|
|
41
41
|
"postcss": "^8.3.7",
|
|
42
42
|
"prism-react-renderer": "^1.2.1",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"rtlcss": "^3.3.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
49
|
-
"@docusaurus/types": "0.0.0-
|
|
48
|
+
"@docusaurus/module-type-aliases": "0.0.0-4314",
|
|
49
|
+
"@docusaurus/types": "0.0.0-4314",
|
|
50
50
|
"@types/mdx-js__react": "^1.5.4",
|
|
51
51
|
"@types/parse-numeric-range": "^0.0.1",
|
|
52
52
|
"@types/rtlcss": "^3.1.1",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=14"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "a3babffc6d8e2fb9d4f11482911cadb39eaa5f42"
|
|
65
65
|
}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import type {
|
|
9
|
+
import {translate} from '@docusaurus/Translate';
|
|
10
|
+
import DocPaginatorNavLink from '@theme/DocPaginatorNavLink';
|
|
11
|
+
import type {Props} from '@theme/DocPaginator';
|
|
12
12
|
|
|
13
|
-
function DocPaginator(props:
|
|
13
|
+
function DocPaginator(props: Props): JSX.Element {
|
|
14
14
|
const {previous, next} = props;
|
|
15
15
|
|
|
16
16
|
return (
|
|
@@ -22,34 +22,10 @@ function DocPaginator(props: PropNavigation): JSX.Element {
|
|
|
22
22
|
description: 'The ARIA label for the docs pagination',
|
|
23
23
|
})}>
|
|
24
24
|
<div className="pagination-nav__item">
|
|
25
|
-
{previous &&
|
|
26
|
-
<Link className="pagination-nav__link" to={previous.permalink}>
|
|
27
|
-
<div className="pagination-nav__sublabel">
|
|
28
|
-
<Translate
|
|
29
|
-
id="theme.docs.paginator.previous"
|
|
30
|
-
description="The label used to navigate to the previous doc">
|
|
31
|
-
Previous
|
|
32
|
-
</Translate>
|
|
33
|
-
</div>
|
|
34
|
-
<div className="pagination-nav__label">
|
|
35
|
-
« {previous.title}
|
|
36
|
-
</div>
|
|
37
|
-
</Link>
|
|
38
|
-
)}
|
|
25
|
+
{previous && <DocPaginatorNavLink navLink={previous} />}
|
|
39
26
|
</div>
|
|
40
27
|
<div className="pagination-nav__item pagination-nav__item--next">
|
|
41
|
-
{next &&
|
|
42
|
-
<Link className="pagination-nav__link" to={next.permalink}>
|
|
43
|
-
<div className="pagination-nav__sublabel">
|
|
44
|
-
<Translate
|
|
45
|
-
id="theme.docs.paginator.next"
|
|
46
|
-
description="The label used to navigate to the next doc">
|
|
47
|
-
Next
|
|
48
|
-
</Translate>
|
|
49
|
-
</div>
|
|
50
|
-
<div className="pagination-nav__label">{next.title} »</div>
|
|
51
|
-
</Link>
|
|
52
|
-
)}
|
|
28
|
+
{next && <DocPaginatorNavLink navLink={next} next />}
|
|
53
29
|
</div>
|
|
54
30
|
</nav>
|
|
55
31
|
);
|
|
@@ -0,0 +1,38 @@
|
|
|
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 from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
import Link from '@docusaurus/Link';
|
|
11
|
+
import Translate from '@docusaurus/Translate';
|
|
12
|
+
import type {Props} from '@theme/DocPaginatorNavLink';
|
|
13
|
+
|
|
14
|
+
function DocPaginatorNavLink(props: Props): JSX.Element {
|
|
15
|
+
const {navLink, next} = props;
|
|
16
|
+
return (
|
|
17
|
+
<Link className={clsx('pagination-nav__link')} to={navLink.permalink}>
|
|
18
|
+
<div className="pagination-nav__sublabel">
|
|
19
|
+
{next ? (
|
|
20
|
+
<Translate
|
|
21
|
+
id="theme.docs.paginator.next"
|
|
22
|
+
description="The label used to navigate to the next doc">
|
|
23
|
+
Next
|
|
24
|
+
</Translate>
|
|
25
|
+
) : (
|
|
26
|
+
<Translate
|
|
27
|
+
id="theme.docs.paginator.previous"
|
|
28
|
+
description="The label used to navigate to the previous doc">
|
|
29
|
+
Previous
|
|
30
|
+
</Translate>
|
|
31
|
+
)}
|
|
32
|
+
</div>
|
|
33
|
+
<div className="pagination-nav__label">{navLink.title}</div>
|
|
34
|
+
</Link>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default DocPaginatorNavLink;
|
package/src/theme-classic.d.ts
CHANGED
|
@@ -123,13 +123,22 @@ declare module '@theme/CodeBlock' {
|
|
|
123
123
|
declare module '@theme/DocPaginator' {
|
|
124
124
|
import type {PropNavigation} from '@docusaurus/plugin-content-docs';
|
|
125
125
|
|
|
126
|
-
type PageInfo = {readonly permalink: string; readonly title: string};
|
|
127
|
-
|
|
128
126
|
// May be simpler to provide a {navigation: PropNavigation} prop?
|
|
129
127
|
export interface Props extends PropNavigation {}
|
|
130
128
|
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
export default function DocPaginator(props: Props): JSX.Element;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
declare module '@theme/DocPaginatorNavLink' {
|
|
133
|
+
import type {PropNavigationLink} from '@docusaurus/plugin-content-docs';
|
|
134
|
+
|
|
135
|
+
// May be simpler to provide a {navigation: PropNavigation} prop?
|
|
136
|
+
export interface Props {
|
|
137
|
+
navLink: PropNavigationLink;
|
|
138
|
+
next?: boolean;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export default function DocPaginatorNavLink(props: Props): JSX.Element;
|
|
133
142
|
}
|
|
134
143
|
|
|
135
144
|
declare module '@theme/DocSidebar' {
|