@docusaurus/theme-classic 0.0.0-4698 → 0.0.0-4701
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/getSwizzleConfig.js +7 -0
- package/lib/theme-classic.d.ts +10 -0
- package/lib-next/theme/BlogPostItem/index.js +2 -3
- package/lib-next/theme/DocItem/index.js +4 -2
- package/lib-next/theme/DocPage/index.js +1 -3
- package/lib-next/theme/DocSidebarItem/index.js +4 -8
- package/lib-next/theme/Footer/index.js +4 -8
- package/lib-next/theme/MDXContent/index.js +12 -0
- package/lib-next/theme/MDXPage/index.js +3 -4
- package/lib-next/theme/NavbarItem/NavbarNavLink.js +5 -7
- package/package.json +13 -13
- package/src/getSwizzleConfig.ts +8 -0
- package/src/theme/BlogPostItem/index.tsx +2 -3
- package/src/theme/DocItem/index.tsx +4 -2
- package/src/theme/DocPage/index.tsx +1 -4
- package/src/theme/DocSidebarItem/index.tsx +4 -8
- package/src/theme/Footer/index.tsx +4 -8
- package/src/theme/MDXContent/index.tsx +15 -0
- package/src/theme/MDXPage/index.tsx +3 -4
- package/src/theme/NavbarItem/NavbarNavLink.tsx +5 -7
- package/src/theme-classic.d.ts +10 -0
package/lib/getSwizzleConfig.js
CHANGED
|
@@ -89,6 +89,13 @@ function getSwizzleConfig() {
|
|
|
89
89
|
},
|
|
90
90
|
description: 'The MDX components to use for rendering MDX files. Meant to be ejected.'
|
|
91
91
|
},
|
|
92
|
+
MDXContent: {
|
|
93
|
+
actions: {
|
|
94
|
+
eject: 'safe',
|
|
95
|
+
wrap: 'safe'
|
|
96
|
+
},
|
|
97
|
+
description: 'A component wrapping all MDX content and providing the MDXComponents to the MDX context'
|
|
98
|
+
},
|
|
92
99
|
// TODO should probably not even appear here
|
|
93
100
|
'NavbarItem/utils': {
|
|
94
101
|
actions: {
|
package/lib/theme-classic.d.ts
CHANGED
|
@@ -343,6 +343,16 @@ declare module '@theme/MDXComponents' {
|
|
|
343
343
|
export default MDXComponents;
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
+
declare module '@theme/MDXContent' {
|
|
347
|
+
import type {ReactNode} from 'react';
|
|
348
|
+
|
|
349
|
+
export interface Props {
|
|
350
|
+
readonly children: ReactNode;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export default function MDXContent(props: Props): JSX.Element;
|
|
354
|
+
}
|
|
355
|
+
|
|
346
356
|
declare module '@theme/Navbar' {
|
|
347
357
|
export default function Navbar(): JSX.Element;
|
|
348
358
|
}
|
|
@@ -6,13 +6,12 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
-
import {MDXProvider} from '@mdx-js/react';
|
|
10
9
|
import Translate, {translate} from '@docusaurus/Translate';
|
|
11
10
|
import Link from '@docusaurus/Link';
|
|
12
11
|
import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
|
|
13
12
|
import {usePluralForm} from '@docusaurus/theme-common';
|
|
14
13
|
import {blogPostContainerID} from '@docusaurus/utils-common';
|
|
15
|
-
import
|
|
14
|
+
import MDXContent from '@theme/MDXContent';
|
|
16
15
|
import EditThisPage from '@theme/EditThisPage';
|
|
17
16
|
import styles from './styles.module.css';
|
|
18
17
|
import TagsListInline from '@theme/TagsListInline';
|
|
@@ -108,7 +107,7 @@ export default function BlogPostItem(props) {
|
|
|
108
107
|
id={isBlogPostPage ? blogPostContainerID : undefined}
|
|
109
108
|
className="markdown"
|
|
110
109
|
itemProp="articleBody">
|
|
111
|
-
<
|
|
110
|
+
<MDXContent>{children}</MDXContent>
|
|
112
111
|
</div>
|
|
113
112
|
|
|
114
113
|
{(tagsExists || truncated) && (
|
|
@@ -17,6 +17,7 @@ import Heading from '@theme/Heading';
|
|
|
17
17
|
import styles from './styles.module.css';
|
|
18
18
|
import {ThemeClassNames, useWindowSize} from '@docusaurus/theme-common';
|
|
19
19
|
import DocBreadcrumbs from '@theme/DocBreadcrumbs';
|
|
20
|
+
import MDXContent from '@theme/MDXContent';
|
|
20
21
|
export default function DocItem(props) {
|
|
21
22
|
const {content: DocContent} = props;
|
|
22
23
|
const {metadata, frontMatter, assets} = DocContent;
|
|
@@ -86,8 +87,9 @@ export default function DocItem(props) {
|
|
|
86
87
|
<Heading as="h1">{title}</Heading>
|
|
87
88
|
</header>
|
|
88
89
|
)}
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
<MDXContent>
|
|
91
|
+
<DocContent />
|
|
92
|
+
</MDXContent>
|
|
91
93
|
</div>
|
|
92
94
|
|
|
93
95
|
<DocItemFooter {...props} />
|
|
@@ -5,11 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React, {useState, useCallback} from 'react';
|
|
8
|
-
import {MDXProvider} from '@mdx-js/react';
|
|
9
8
|
import renderRoutes from '@docusaurus/renderRoutes';
|
|
10
9
|
import Layout from '@theme/Layout';
|
|
11
10
|
import DocSidebar from '@theme/DocSidebar';
|
|
12
|
-
import MDXComponents from '@theme/MDXComponents';
|
|
13
11
|
import NotFound from '@theme/NotFound';
|
|
14
12
|
import IconArrow from '@theme/IconArrow';
|
|
15
13
|
import BackToTopButton from '@theme/BackToTopButton';
|
|
@@ -123,7 +121,7 @@ function DocPageContent({
|
|
|
123
121
|
[styles.docItemWrapperEnhanced]: hiddenSidebarContainer,
|
|
124
122
|
},
|
|
125
123
|
)}>
|
|
126
|
-
|
|
124
|
+
{children}
|
|
127
125
|
</div>
|
|
128
126
|
</main>
|
|
129
127
|
</div>
|
|
@@ -250,14 +250,10 @@ function DocSidebarItemLink({
|
|
|
250
250
|
onClick: onItemClick ? () => onItemClick(item) : undefined,
|
|
251
251
|
})}
|
|
252
252
|
{...props}>
|
|
253
|
-
|
|
254
|
-
label
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
{label}
|
|
258
|
-
<IconExternalLink />
|
|
259
|
-
</span>
|
|
260
|
-
)}
|
|
253
|
+
<span>
|
|
254
|
+
{label}
|
|
255
|
+
{!isInternalUrl(href) && <IconExternalLink />}
|
|
256
|
+
</span>
|
|
261
257
|
</Link>
|
|
262
258
|
</li>
|
|
263
259
|
);
|
|
@@ -30,14 +30,10 @@ function FooterLink({to, href, label, prependBaseUrlToHref, ...props}) {
|
|
|
30
30
|
to: toUrl,
|
|
31
31
|
})}
|
|
32
32
|
{...props}>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</span>
|
|
38
|
-
) : (
|
|
39
|
-
label
|
|
40
|
-
)}
|
|
33
|
+
<span>
|
|
34
|
+
{label}
|
|
35
|
+
{href && !isInternalUrl(href) && <IconExternalLink />}
|
|
36
|
+
</span>
|
|
41
37
|
</Link>
|
|
42
38
|
);
|
|
43
39
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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 {MDXProvider} from '@mdx-js/react';
|
|
9
|
+
import MDXComponents from '@theme/MDXComponents';
|
|
10
|
+
export default function MDXContent({children}) {
|
|
11
|
+
return <MDXProvider components={MDXComponents}>{children}</MDXProvider>;
|
|
12
|
+
}
|
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import Layout from '@theme/Layout';
|
|
10
|
-
import
|
|
11
|
-
import MDXComponents from '@theme/MDXComponents';
|
|
10
|
+
import MDXContent from '@theme/MDXContent';
|
|
12
11
|
import TOC from '@theme/TOC';
|
|
13
12
|
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
14
13
|
import styles from './styles.module.css';
|
|
@@ -29,9 +28,9 @@ export default function MDXPage(props) {
|
|
|
29
28
|
<main className="container container--fluid margin-vert--lg">
|
|
30
29
|
<div className={clsx('row', styles.mdxPageWrapper)}>
|
|
31
30
|
<div className={clsx('col', !hideTableOfContents && 'col--8')}>
|
|
32
|
-
<
|
|
31
|
+
<MDXContent>
|
|
33
32
|
<MDXPageContent />
|
|
34
|
-
</
|
|
33
|
+
</MDXContent>
|
|
35
34
|
</div>
|
|
36
35
|
{!hideTableOfContents && MDXPageContent.toc && (
|
|
37
36
|
<div className="col col--2">
|
|
@@ -52,19 +52,17 @@ export default function NavbarNavLink({
|
|
|
52
52
|
: null),
|
|
53
53
|
})}
|
|
54
54
|
{...props}>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
<span>
|
|
56
|
+
{label}
|
|
57
|
+
{isExternalLink && (
|
|
58
58
|
<IconExternalLink
|
|
59
59
|
{...(isDropdownLink && {
|
|
60
60
|
width: 12,
|
|
61
61
|
height: 12,
|
|
62
62
|
})}
|
|
63
63
|
/>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
label
|
|
67
|
-
)}
|
|
64
|
+
)}
|
|
65
|
+
</span>
|
|
68
66
|
</Link>
|
|
69
67
|
);
|
|
70
68
|
}
|
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-4701",
|
|
4
4
|
"description": "Classic theme for Docusaurus",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/theme-classic.d.ts",
|
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
"format:lib-next": "prettier --config ../../.prettierrc --write \"lib-next/**/*.{js,ts,jsx,tsc}\""
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@docusaurus/core": "0.0.0-
|
|
25
|
-
"@docusaurus/plugin-content-blog": "0.0.0-
|
|
26
|
-
"@docusaurus/plugin-content-docs": "0.0.0-
|
|
27
|
-
"@docusaurus/plugin-content-pages": "0.0.0-
|
|
28
|
-
"@docusaurus/theme-common": "0.0.0-
|
|
29
|
-
"@docusaurus/theme-translations": "0.0.0-
|
|
30
|
-
"@docusaurus/utils": "0.0.0-
|
|
31
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
32
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
24
|
+
"@docusaurus/core": "0.0.0-4701",
|
|
25
|
+
"@docusaurus/plugin-content-blog": "0.0.0-4701",
|
|
26
|
+
"@docusaurus/plugin-content-docs": "0.0.0-4701",
|
|
27
|
+
"@docusaurus/plugin-content-pages": "0.0.0-4701",
|
|
28
|
+
"@docusaurus/theme-common": "0.0.0-4701",
|
|
29
|
+
"@docusaurus/theme-translations": "0.0.0-4701",
|
|
30
|
+
"@docusaurus/utils": "0.0.0-4701",
|
|
31
|
+
"@docusaurus/utils-common": "0.0.0-4701",
|
|
32
|
+
"@docusaurus/utils-validation": "0.0.0-4701",
|
|
33
33
|
"@mdx-js/react": "^1.6.22",
|
|
34
34
|
"clsx": "^1.1.1",
|
|
35
35
|
"copy-text-to-clipboard": "^3.0.1",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"rtlcss": "^3.3.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
46
|
-
"@docusaurus/types": "0.0.0-
|
|
45
|
+
"@docusaurus/module-type-aliases": "0.0.0-4701",
|
|
46
|
+
"@docusaurus/types": "0.0.0-4701",
|
|
47
47
|
"@types/mdx-js__react": "^1.5.5",
|
|
48
48
|
"@types/prismjs": "^1.26.0",
|
|
49
49
|
"@types/rtlcss": "^3.1.2",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"engines": {
|
|
60
60
|
"node": ">=14"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "d61c50e6864073ecd948822e64d2f99a825f59fc"
|
|
63
63
|
}
|
package/src/getSwizzleConfig.ts
CHANGED
|
@@ -85,6 +85,14 @@ export default function getSwizzleConfig(): SwizzleConfig {
|
|
|
85
85
|
description:
|
|
86
86
|
'The MDX components to use for rendering MDX files. Meant to be ejected.',
|
|
87
87
|
},
|
|
88
|
+
MDXContent: {
|
|
89
|
+
actions: {
|
|
90
|
+
eject: 'safe',
|
|
91
|
+
wrap: 'safe',
|
|
92
|
+
},
|
|
93
|
+
description:
|
|
94
|
+
'A component wrapping all MDX content and providing the MDXComponents to the MDX context',
|
|
95
|
+
},
|
|
88
96
|
// TODO should probably not even appear here
|
|
89
97
|
'NavbarItem/utils': {
|
|
90
98
|
actions: {
|
|
@@ -7,13 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {MDXProvider} from '@mdx-js/react';
|
|
11
10
|
import Translate, {translate} from '@docusaurus/Translate';
|
|
12
11
|
import Link from '@docusaurus/Link';
|
|
13
12
|
import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
|
|
14
13
|
import {usePluralForm} from '@docusaurus/theme-common';
|
|
15
14
|
import {blogPostContainerID} from '@docusaurus/utils-common';
|
|
16
|
-
import
|
|
15
|
+
import MDXContent from '@theme/MDXContent';
|
|
17
16
|
import EditThisPage from '@theme/EditThisPage';
|
|
18
17
|
import type {Props} from '@theme/BlogPostItem';
|
|
19
18
|
|
|
@@ -108,7 +107,7 @@ export default function BlogPostItem(props: Props): JSX.Element {
|
|
|
108
107
|
id={isBlogPostPage ? blogPostContainerID : undefined}
|
|
109
108
|
className="markdown"
|
|
110
109
|
itemProp="articleBody">
|
|
111
|
-
<
|
|
110
|
+
<MDXContent>{children}</MDXContent>
|
|
112
111
|
</div>
|
|
113
112
|
|
|
114
113
|
{(tagsExists || truncated) && (
|
|
@@ -19,6 +19,7 @@ import Heading from '@theme/Heading';
|
|
|
19
19
|
import styles from './styles.module.css';
|
|
20
20
|
import {ThemeClassNames, useWindowSize} from '@docusaurus/theme-common';
|
|
21
21
|
import DocBreadcrumbs from '@theme/DocBreadcrumbs';
|
|
22
|
+
import MDXContent from '@theme/MDXContent';
|
|
22
23
|
|
|
23
24
|
export default function DocItem(props: Props): JSX.Element {
|
|
24
25
|
const {content: DocContent} = props;
|
|
@@ -87,8 +88,9 @@ export default function DocItem(props: Props): JSX.Element {
|
|
|
87
88
|
<Heading as="h1">{title}</Heading>
|
|
88
89
|
</header>
|
|
89
90
|
)}
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
<MDXContent>
|
|
92
|
+
<DocContent />
|
|
93
|
+
</MDXContent>
|
|
92
94
|
</div>
|
|
93
95
|
|
|
94
96
|
<DocItemFooter {...props} />
|
|
@@ -6,13 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React, {type ReactNode, useState, useCallback} from 'react';
|
|
9
|
-
import {MDXProvider} from '@mdx-js/react';
|
|
10
|
-
|
|
11
9
|
import renderRoutes from '@docusaurus/renderRoutes';
|
|
12
10
|
import type {PropVersionMetadata} from '@docusaurus/plugin-content-docs';
|
|
13
11
|
import Layout from '@theme/Layout';
|
|
14
12
|
import DocSidebar from '@theme/DocSidebar';
|
|
15
|
-
import MDXComponents from '@theme/MDXComponents';
|
|
16
13
|
import NotFound from '@theme/NotFound';
|
|
17
14
|
import type {DocumentRoute} from '@theme/DocItem';
|
|
18
15
|
import type {Props} from '@theme/DocPage';
|
|
@@ -137,7 +134,7 @@ function DocPageContent({
|
|
|
137
134
|
[styles.docItemWrapperEnhanced!]: hiddenSidebarContainer,
|
|
138
135
|
},
|
|
139
136
|
)}>
|
|
140
|
-
|
|
137
|
+
{children}
|
|
141
138
|
</div>
|
|
142
139
|
</main>
|
|
143
140
|
</div>
|
|
@@ -269,14 +269,10 @@ function DocSidebarItemLink({
|
|
|
269
269
|
onClick: onItemClick ? () => onItemClick(item) : undefined,
|
|
270
270
|
})}
|
|
271
271
|
{...props}>
|
|
272
|
-
|
|
273
|
-
label
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
{label}
|
|
277
|
-
<IconExternalLink />
|
|
278
|
-
</span>
|
|
279
|
-
)}
|
|
272
|
+
<span>
|
|
273
|
+
{label}
|
|
274
|
+
{!isInternalUrl(href) && <IconExternalLink />}
|
|
275
|
+
</span>
|
|
280
276
|
</Link>
|
|
281
277
|
</li>
|
|
282
278
|
);
|
|
@@ -42,14 +42,10 @@ function FooterLink({
|
|
|
42
42
|
to: toUrl,
|
|
43
43
|
})}
|
|
44
44
|
{...props}>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
</span>
|
|
50
|
-
) : (
|
|
51
|
-
label
|
|
52
|
-
)}
|
|
45
|
+
<span>
|
|
46
|
+
{label}
|
|
47
|
+
{href && !isInternalUrl(href) && <IconExternalLink />}
|
|
48
|
+
</span>
|
|
53
49
|
</Link>
|
|
54
50
|
);
|
|
55
51
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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 {MDXProvider} from '@mdx-js/react';
|
|
10
|
+
import MDXComponents from '@theme/MDXComponents';
|
|
11
|
+
import type {Props} from '@theme/MDXContent';
|
|
12
|
+
|
|
13
|
+
export default function MDXContent({children}: Props): JSX.Element {
|
|
14
|
+
return <MDXProvider components={MDXComponents}>{children}</MDXProvider>;
|
|
15
|
+
}
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import Layout from '@theme/Layout';
|
|
11
|
-
import
|
|
12
|
-
import MDXComponents from '@theme/MDXComponents';
|
|
11
|
+
import MDXContent from '@theme/MDXContent';
|
|
13
12
|
import type {Props} from '@theme/MDXPage';
|
|
14
13
|
import TOC from '@theme/TOC';
|
|
15
14
|
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
@@ -34,9 +33,9 @@ export default function MDXPage(props: Props): JSX.Element {
|
|
|
34
33
|
<main className="container container--fluid margin-vert--lg">
|
|
35
34
|
<div className={clsx('row', styles.mdxPageWrapper)}>
|
|
36
35
|
<div className={clsx('col', !hideTableOfContents && 'col--8')}>
|
|
37
|
-
<
|
|
36
|
+
<MDXContent>
|
|
38
37
|
<MDXPageContent />
|
|
39
|
-
</
|
|
38
|
+
</MDXContent>
|
|
40
39
|
</div>
|
|
41
40
|
{!hideTableOfContents && MDXPageContent.toc && (
|
|
42
41
|
<div className="col col--2">
|
|
@@ -55,14 +55,12 @@ export default function NavbarNavLink({
|
|
|
55
55
|
: null),
|
|
56
56
|
})}
|
|
57
57
|
{...props}>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
<span>
|
|
59
|
+
{label}
|
|
60
|
+
{isExternalLink && (
|
|
61
61
|
<IconExternalLink {...(isDropdownLink && {width: 12, height: 12})} />
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
label
|
|
65
|
-
)}
|
|
62
|
+
)}
|
|
63
|
+
</span>
|
|
66
64
|
</Link>
|
|
67
65
|
);
|
|
68
66
|
}
|
package/src/theme-classic.d.ts
CHANGED
|
@@ -343,6 +343,16 @@ declare module '@theme/MDXComponents' {
|
|
|
343
343
|
export default MDXComponents;
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
+
declare module '@theme/MDXContent' {
|
|
347
|
+
import type {ReactNode} from 'react';
|
|
348
|
+
|
|
349
|
+
export interface Props {
|
|
350
|
+
readonly children: ReactNode;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export default function MDXContent(props: Props): JSX.Element;
|
|
354
|
+
}
|
|
355
|
+
|
|
346
356
|
declare module '@theme/Navbar' {
|
|
347
357
|
export default function Navbar(): JSX.Element;
|
|
348
358
|
}
|