@docusaurus/theme-classic 2.4.1 → 3.0.0-beta.0
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 +107 -8
- package/lib/index.js +20 -6
- package/lib/nprogress.d.ts +1 -1
- package/lib/options.js +6 -2
- package/lib/theme/Admonition/Icon/Danger.d.ts +9 -0
- package/lib/theme/Admonition/Icon/Danger.js +17 -0
- package/lib/theme/Admonition/Icon/Info.d.ts +9 -0
- package/lib/theme/Admonition/Icon/Info.js +17 -0
- package/lib/theme/Admonition/Icon/Note.d.ts +9 -0
- package/lib/theme/Admonition/Icon/Note.js +17 -0
- package/lib/theme/Admonition/Icon/Tip.d.ts +9 -0
- package/lib/theme/Admonition/Icon/Tip.js +17 -0
- package/lib/theme/Admonition/Icon/Warning.d.ts +9 -0
- package/lib/theme/Admonition/Icon/Warning.js +17 -0
- package/lib/theme/Admonition/Layout/index.d.ts +9 -0
- package/lib/theme/Admonition/Layout/index.js +45 -0
- package/lib/theme/Admonition/{styles.module.css → Layout/styles.module.css} +4 -0
- package/lib/theme/Admonition/Type/Caution.d.ts +9 -0
- package/lib/theme/Admonition/Type/Caution.js +34 -0
- package/lib/theme/Admonition/Type/Danger.d.ts +9 -0
- package/lib/theme/Admonition/Type/Danger.js +32 -0
- package/lib/theme/Admonition/Type/Info.d.ts +9 -0
- package/lib/theme/Admonition/Type/Info.js +32 -0
- package/lib/theme/Admonition/Type/Note.d.ts +9 -0
- package/lib/theme/Admonition/Type/Note.js +32 -0
- package/lib/theme/Admonition/Type/Tip.d.ts +9 -0
- package/lib/theme/Admonition/Type/Tip.js +32 -0
- package/lib/theme/Admonition/Type/Warning.d.ts +9 -0
- package/lib/theme/Admonition/Type/Warning.js +32 -0
- package/lib/theme/Admonition/Types.d.ts +12 -0
- package/lib/theme/Admonition/Types.js +33 -0
- package/lib/theme/Admonition/index.d.ts +1 -1
- package/lib/theme/Admonition/index.js +12 -171
- package/lib/theme/BlogArchivePage/index.js +7 -2
- package/lib/theme/BlogLayout/index.js +1 -1
- package/lib/theme/BlogPostItem/Container/index.js +12 -3
- package/lib/theme/BlogPostItem/Header/Author/index.js +6 -1
- package/lib/theme/BlogPostPage/index.js +3 -1
- package/lib/theme/BlogSidebar/Desktop/index.js +3 -1
- package/lib/theme/BlogSidebar/Mobile/index.js +3 -1
- package/lib/theme/BlogTagsListPage/index.js +2 -1
- package/lib/theme/BlogTagsPostsPage/index.js +4 -2
- package/lib/theme/CodeBlock/Content/String.js +9 -2
- package/lib/theme/CodeBlock/CopyButton/index.js +0 -1
- package/lib/theme/DocBreadcrumbs/index.js +6 -2
- package/lib/theme/DocCard/index.js +8 -4
- package/lib/theme/DocItem/Layout/index.js +5 -0
- package/lib/theme/DocItem/index.js +1 -1
- package/lib/theme/{DocPage → DocRoot}/Layout/Main/index.d.ts +2 -2
- package/lib/theme/{DocPage → DocRoot}/Layout/Main/index.js +1 -1
- package/lib/theme/{DocPage → DocRoot}/Layout/Sidebar/ExpandButton/index.d.ts +2 -2
- package/lib/theme/{DocPage → DocRoot}/Layout/Sidebar/ExpandButton/index.js +1 -1
- package/lib/theme/{DocPage → DocRoot}/Layout/Sidebar/index.d.ts +2 -2
- package/lib/theme/{DocPage → DocRoot}/Layout/Sidebar/index.js +2 -2
- package/lib/theme/{DocPage → DocRoot}/Layout/index.d.ts +2 -2
- package/lib/theme/{DocPage → DocRoot}/Layout/index.js +9 -10
- package/lib/theme/{DocPage → DocRoot}/Layout/styles.module.css +1 -2
- package/lib/theme/{DocPage → DocRoot}/index.d.ts +2 -2
- package/lib/theme/DocRoot/index.js +31 -0
- package/lib/theme/DocSidebar/Desktop/index.d.ts +1 -1
- package/lib/theme/DocSidebar/Mobile/index.d.ts +1 -1
- package/lib/theme/DocSidebarItem/Category/index.js +24 -13
- package/lib/theme/DocSidebarItems/index.js +6 -4
- package/lib/theme/DocTagDocListPage/index.d.ts +1 -1
- package/lib/theme/DocTagDocListPage/index.js +53 -39
- package/lib/theme/DocTagsListPage/index.d.ts +1 -1
- package/lib/theme/DocTagsListPage/index.js +26 -17
- package/lib/theme/DocVersionRoot/index.d.ts +10 -0
- package/lib/theme/DocVersionRoot/index.js +46 -0
- package/lib/theme/DocsRoot/index.d.ts +10 -0
- package/lib/theme/DocsRoot/index.js +18 -0
- package/lib/theme/EditThisPage/index.js +3 -6
- package/lib/theme/ErrorPageContent.js +3 -2
- package/lib/theme/MDXComponents/Code.js +2 -36
- package/lib/theme/MDXComponents/Details.js +1 -1
- package/lib/theme/MDXComponents/Pre.d.ts +2 -2
- package/lib/theme/MDXComponents/Pre.js +4 -11
- package/lib/theme/MDXComponents/Ul/index.js +4 -0
- package/lib/theme/MDXComponents/index.js +4 -3
- package/lib/theme/MDXPage/index.js +16 -4
- package/lib/theme/NavbarItem/DocNavbarItem.js +4 -3
- package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.d.ts +1 -1
- package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.js +2 -1
- package/lib/theme/NotFound/Content/index.d.ts +9 -0
- package/lib/theme/NotFound/Content/index.js +42 -0
- package/lib/theme/{NotFound.d.ts → NotFound/index.d.ts} +1 -1
- package/lib/theme/NotFound/index.js +25 -0
- package/lib/theme/SiteMetadata/index.js +30 -3
- package/lib/theme/TOCItems/Tree.js +3 -4
- package/lib/theme/Tabs/index.js +4 -2
- package/lib/theme/TagsListByLetter/index.js +4 -1
- package/lib/theme/ThemedImage/index.js +8 -24
- package/lib/theme/{MDXComponents/Head.d.ts → Unlisted/index.d.ts} +2 -2
- package/lib/theme/Unlisted/index.js +38 -0
- package/package.json +26 -26
- package/src/getSwizzleConfig.ts +116 -9
- package/src/index.ts +21 -6
- package/src/nprogress.ts +2 -1
- package/src/options.ts +7 -2
- package/src/theme/Admonition/Icon/Danger.tsx +20 -0
- package/src/theme/Admonition/Icon/Info.tsx +20 -0
- package/src/theme/Admonition/Icon/Note.tsx +20 -0
- package/src/theme/Admonition/Icon/Tip.tsx +20 -0
- package/src/theme/Admonition/Icon/Warning.tsx +20 -0
- package/src/theme/Admonition/Layout/index.tsx +57 -0
- package/src/theme/Admonition/{styles.module.css → Layout/styles.module.css} +4 -0
- package/src/theme/Admonition/Type/Caution.tsx +39 -0
- package/src/theme/Admonition/Type/Danger.tsx +37 -0
- package/src/theme/Admonition/Type/Info.tsx +37 -0
- package/src/theme/Admonition/Type/Note.tsx +37 -0
- package/src/theme/Admonition/Type/Tip.tsx +37 -0
- package/src/theme/Admonition/Type/Warning.tsx +37 -0
- package/src/theme/Admonition/Types.tsx +38 -0
- package/src/theme/Admonition/index.tsx +13 -194
- package/src/theme/BlogArchivePage/index.tsx +7 -2
- package/src/theme/BlogLayout/index.tsx +1 -1
- package/src/theme/BlogPostItem/Container/index.tsx +12 -3
- package/src/theme/BlogPostItem/Header/Author/index.tsx +6 -1
- package/src/theme/BlogPostPage/index.tsx +3 -1
- package/src/theme/BlogSidebar/Desktop/index.tsx +3 -1
- package/src/theme/BlogSidebar/Mobile/index.tsx +3 -1
- package/src/theme/BlogTagsListPage/index.tsx +2 -1
- package/src/theme/BlogTagsPostsPage/index.tsx +4 -2
- package/src/theme/CodeBlock/Content/String.tsx +11 -2
- package/src/theme/CodeBlock/CopyButton/index.tsx +0 -1
- package/src/theme/DocBreadcrumbs/index.tsx +6 -2
- package/src/theme/DocCard/index.tsx +11 -6
- package/src/theme/DocItem/Layout/index.tsx +5 -0
- package/src/theme/DocItem/index.tsx +1 -1
- package/src/theme/{DocPage → DocRoot}/Layout/Main/index.tsx +2 -2
- package/src/theme/{DocPage → DocRoot}/Layout/Sidebar/ExpandButton/index.tsx +2 -2
- package/src/theme/{DocPage → DocRoot}/Layout/Sidebar/index.tsx +3 -3
- package/src/theme/{DocPage → DocRoot}/Layout/index.tsx +10 -11
- package/src/theme/{DocPage → DocRoot}/Layout/styles.module.css +1 -2
- package/src/theme/DocRoot/index.tsx +34 -0
- package/src/theme/DocSidebarItem/Category/index.tsx +25 -12
- package/src/theme/DocSidebarItems/index.tsx +6 -4
- package/src/theme/DocTagDocListPage/index.tsx +60 -39
- package/src/theme/DocTagsListPage/index.tsx +33 -17
- package/src/theme/DocVersionRoot/index.tsx +51 -0
- package/src/theme/DocsRoot/index.tsx +22 -0
- package/src/theme/EditThisPage/index.tsx +3 -6
- package/src/theme/ErrorPageContent.tsx +3 -2
- package/src/theme/MDXComponents/Code.tsx +2 -39
- package/src/theme/MDXComponents/Details.tsx +1 -2
- package/src/theme/MDXComponents/Pre.tsx +5 -13
- package/src/theme/MDXComponents/Ul/index.tsx +5 -1
- package/src/theme/MDXComponents/index.tsx +11 -10
- package/src/theme/MDXPage/index.tsx +16 -4
- package/src/theme/NavbarItem/DocNavbarItem.tsx +4 -3
- package/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx +2 -1
- package/src/theme/NotFound/Content/index.tsx +45 -0
- package/src/theme/NotFound/index.tsx +27 -0
- package/src/theme/SiteMetadata/index.tsx +36 -3
- package/src/theme/SkipToContent/index.tsx +0 -1
- package/src/theme/TOCItems/Tree.tsx +3 -4
- package/src/theme/Tabs/index.tsx +4 -2
- package/src/theme/TagsListByLetter/index.tsx +4 -2
- package/src/theme/ThemedImage/index.tsx +8 -31
- package/src/theme/Unlisted/index.tsx +42 -0
- package/src/theme/prism-include-languages.ts +2 -1
- package/src/theme-classic.d.ts +146 -21
- package/lib/theme/DocPage/index.js +0 -67
- package/lib/theme/MDXComponents/Head.js +0 -23
- package/lib/theme/NotFound.js +0 -52
- package/src/theme/DocPage/index.tsx +0 -71
- package/src/theme/MDXComponents/Head.tsx +0 -29
- package/src/theme/NotFound.tsx +0 -54
- /package/lib/theme/{DocPage → DocRoot}/Layout/Main/styles.module.css +0 -0
- /package/lib/theme/{DocPage → DocRoot}/Layout/Sidebar/ExpandButton/styles.module.css +0 -0
- /package/lib/theme/{DocPage → DocRoot}/Layout/Sidebar/styles.module.css +0 -0
- /package/src/theme/{DocPage → DocRoot}/Layout/Main/styles.module.css +0 -0
- /package/src/theme/{DocPage → DocRoot}/Layout/Sidebar/ExpandButton/styles.module.css +0 -0
- /package/src/theme/{DocPage → DocRoot}/Layout/Sidebar/styles.module.css +0 -0
|
@@ -1,67 +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
|
-
import React from 'react';
|
|
8
|
-
import clsx from 'clsx';
|
|
9
|
-
import {
|
|
10
|
-
HtmlClassNameProvider,
|
|
11
|
-
ThemeClassNames,
|
|
12
|
-
PageMetadata,
|
|
13
|
-
} from '@docusaurus/theme-common';
|
|
14
|
-
import {
|
|
15
|
-
docVersionSearchTag,
|
|
16
|
-
DocsSidebarProvider,
|
|
17
|
-
DocsVersionProvider,
|
|
18
|
-
useDocRouteMetadata,
|
|
19
|
-
} from '@docusaurus/theme-common/internal';
|
|
20
|
-
import DocPageLayout from '@theme/DocPage/Layout';
|
|
21
|
-
import NotFound from '@theme/NotFound';
|
|
22
|
-
import SearchMetadata from '@theme/SearchMetadata';
|
|
23
|
-
function DocPageMetadata(props) {
|
|
24
|
-
const {versionMetadata} = props;
|
|
25
|
-
return (
|
|
26
|
-
<>
|
|
27
|
-
<SearchMetadata
|
|
28
|
-
version={versionMetadata.version}
|
|
29
|
-
tag={docVersionSearchTag(
|
|
30
|
-
versionMetadata.pluginId,
|
|
31
|
-
versionMetadata.version,
|
|
32
|
-
)}
|
|
33
|
-
/>
|
|
34
|
-
<PageMetadata>
|
|
35
|
-
{versionMetadata.noIndex && (
|
|
36
|
-
<meta name="robots" content="noindex, nofollow" />
|
|
37
|
-
)}
|
|
38
|
-
</PageMetadata>
|
|
39
|
-
</>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
export default function DocPage(props) {
|
|
43
|
-
const {versionMetadata} = props;
|
|
44
|
-
const currentDocRouteMetadata = useDocRouteMetadata(props);
|
|
45
|
-
if (!currentDocRouteMetadata) {
|
|
46
|
-
return <NotFound />;
|
|
47
|
-
}
|
|
48
|
-
const {docElement, sidebarName, sidebarItems} = currentDocRouteMetadata;
|
|
49
|
-
return (
|
|
50
|
-
<>
|
|
51
|
-
<DocPageMetadata {...props} />
|
|
52
|
-
<HtmlClassNameProvider
|
|
53
|
-
className={clsx(
|
|
54
|
-
// TODO: it should be removed from here
|
|
55
|
-
ThemeClassNames.wrapper.docsPages,
|
|
56
|
-
ThemeClassNames.page.docsDocPage,
|
|
57
|
-
props.versionMetadata.className,
|
|
58
|
-
)}>
|
|
59
|
-
<DocsVersionProvider version={versionMetadata}>
|
|
60
|
-
<DocsSidebarProvider name={sidebarName} items={sidebarItems}>
|
|
61
|
-
<DocPageLayout>{docElement}</DocPageLayout>
|
|
62
|
-
</DocsSidebarProvider>
|
|
63
|
-
</DocsVersionProvider>
|
|
64
|
-
</HtmlClassNameProvider>
|
|
65
|
-
</>
|
|
66
|
-
);
|
|
67
|
-
}
|
|
@@ -1,23 +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
|
-
import React from 'react';
|
|
8
|
-
import Head from '@docusaurus/Head';
|
|
9
|
-
// MDX elements are wrapped through the MDX pragma. In some cases (notably usage
|
|
10
|
-
// with Head/Helmet) we need to unwrap those elements.
|
|
11
|
-
function unwrapMDXElement(element) {
|
|
12
|
-
if (element.props?.mdxType && element.props.originalType) {
|
|
13
|
-
const {mdxType, originalType, ...newProps} = element.props;
|
|
14
|
-
return React.createElement(element.props.originalType, newProps);
|
|
15
|
-
}
|
|
16
|
-
return element;
|
|
17
|
-
}
|
|
18
|
-
export default function MDXHead(props) {
|
|
19
|
-
const unwrappedChildren = React.Children.map(props.children, (child) =>
|
|
20
|
-
React.isValidElement(child) ? unwrapMDXElement(child) : child,
|
|
21
|
-
);
|
|
22
|
-
return <Head {...props}>{unwrappedChildren}</Head>;
|
|
23
|
-
}
|
package/lib/theme/NotFound.js
DELETED
|
@@ -1,52 +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
|
-
import React from 'react';
|
|
8
|
-
import Translate, {translate} from '@docusaurus/Translate';
|
|
9
|
-
import {PageMetadata} from '@docusaurus/theme-common';
|
|
10
|
-
import Layout from '@theme/Layout';
|
|
11
|
-
export default function NotFound() {
|
|
12
|
-
return (
|
|
13
|
-
<>
|
|
14
|
-
<PageMetadata
|
|
15
|
-
title={translate({
|
|
16
|
-
id: 'theme.NotFound.title',
|
|
17
|
-
message: 'Page Not Found',
|
|
18
|
-
})}
|
|
19
|
-
/>
|
|
20
|
-
<Layout>
|
|
21
|
-
<main className="container margin-vert--xl">
|
|
22
|
-
<div className="row">
|
|
23
|
-
<div className="col col--6 col--offset-3">
|
|
24
|
-
<h1 className="hero__title">
|
|
25
|
-
<Translate
|
|
26
|
-
id="theme.NotFound.title"
|
|
27
|
-
description="The title of the 404 page">
|
|
28
|
-
Page Not Found
|
|
29
|
-
</Translate>
|
|
30
|
-
</h1>
|
|
31
|
-
<p>
|
|
32
|
-
<Translate
|
|
33
|
-
id="theme.NotFound.p1"
|
|
34
|
-
description="The first paragraph of the 404 page">
|
|
35
|
-
We could not find what you were looking for.
|
|
36
|
-
</Translate>
|
|
37
|
-
</p>
|
|
38
|
-
<p>
|
|
39
|
-
<Translate
|
|
40
|
-
id="theme.NotFound.p2"
|
|
41
|
-
description="The 2nd paragraph of the 404 page">
|
|
42
|
-
Please contact the owner of the site that linked you to the
|
|
43
|
-
original URL and let them know their link is broken.
|
|
44
|
-
</Translate>
|
|
45
|
-
</p>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
</main>
|
|
49
|
-
</Layout>
|
|
50
|
-
</>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
@@ -1,71 +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
|
-
import React from 'react';
|
|
9
|
-
import clsx from 'clsx';
|
|
10
|
-
import {
|
|
11
|
-
HtmlClassNameProvider,
|
|
12
|
-
ThemeClassNames,
|
|
13
|
-
PageMetadata,
|
|
14
|
-
} from '@docusaurus/theme-common';
|
|
15
|
-
import {
|
|
16
|
-
docVersionSearchTag,
|
|
17
|
-
DocsSidebarProvider,
|
|
18
|
-
DocsVersionProvider,
|
|
19
|
-
useDocRouteMetadata,
|
|
20
|
-
} from '@docusaurus/theme-common/internal';
|
|
21
|
-
import DocPageLayout from '@theme/DocPage/Layout';
|
|
22
|
-
import NotFound from '@theme/NotFound';
|
|
23
|
-
import SearchMetadata from '@theme/SearchMetadata';
|
|
24
|
-
import type {Props} from '@theme/DocPage';
|
|
25
|
-
|
|
26
|
-
function DocPageMetadata(props: Props): JSX.Element {
|
|
27
|
-
const {versionMetadata} = props;
|
|
28
|
-
return (
|
|
29
|
-
<>
|
|
30
|
-
<SearchMetadata
|
|
31
|
-
version={versionMetadata.version}
|
|
32
|
-
tag={docVersionSearchTag(
|
|
33
|
-
versionMetadata.pluginId,
|
|
34
|
-
versionMetadata.version,
|
|
35
|
-
)}
|
|
36
|
-
/>
|
|
37
|
-
<PageMetadata>
|
|
38
|
-
{versionMetadata.noIndex && (
|
|
39
|
-
<meta name="robots" content="noindex, nofollow" />
|
|
40
|
-
)}
|
|
41
|
-
</PageMetadata>
|
|
42
|
-
</>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export default function DocPage(props: Props): JSX.Element {
|
|
47
|
-
const {versionMetadata} = props;
|
|
48
|
-
const currentDocRouteMetadata = useDocRouteMetadata(props);
|
|
49
|
-
if (!currentDocRouteMetadata) {
|
|
50
|
-
return <NotFound />;
|
|
51
|
-
}
|
|
52
|
-
const {docElement, sidebarName, sidebarItems} = currentDocRouteMetadata;
|
|
53
|
-
return (
|
|
54
|
-
<>
|
|
55
|
-
<DocPageMetadata {...props} />
|
|
56
|
-
<HtmlClassNameProvider
|
|
57
|
-
className={clsx(
|
|
58
|
-
// TODO: it should be removed from here
|
|
59
|
-
ThemeClassNames.wrapper.docsPages,
|
|
60
|
-
ThemeClassNames.page.docsDocPage,
|
|
61
|
-
props.versionMetadata.className,
|
|
62
|
-
)}>
|
|
63
|
-
<DocsVersionProvider version={versionMetadata}>
|
|
64
|
-
<DocsSidebarProvider name={sidebarName} items={sidebarItems}>
|
|
65
|
-
<DocPageLayout>{docElement}</DocPageLayout>
|
|
66
|
-
</DocsSidebarProvider>
|
|
67
|
-
</DocsVersionProvider>
|
|
68
|
-
</HtmlClassNameProvider>
|
|
69
|
-
</>
|
|
70
|
-
);
|
|
71
|
-
}
|
|
@@ -1,29 +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
|
-
import React, {type ReactElement} from 'react';
|
|
9
|
-
import Head, {type Props as HeadProps} from '@docusaurus/Head';
|
|
10
|
-
import type {Props} from '@theme/MDXComponents/Head';
|
|
11
|
-
|
|
12
|
-
// MDX elements are wrapped through the MDX pragma. In some cases (notably usage
|
|
13
|
-
// with Head/Helmet) we need to unwrap those elements.
|
|
14
|
-
function unwrapMDXElement(
|
|
15
|
-
element: ReactElement<{mdxType?: string; originalType?: string} | undefined>,
|
|
16
|
-
) {
|
|
17
|
-
if (element.props?.mdxType && element.props.originalType) {
|
|
18
|
-
const {mdxType, originalType, ...newProps} = element.props;
|
|
19
|
-
return React.createElement(element.props.originalType, newProps);
|
|
20
|
-
}
|
|
21
|
-
return element;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default function MDXHead(props: Props): JSX.Element {
|
|
25
|
-
const unwrappedChildren = React.Children.map(props.children, (child) =>
|
|
26
|
-
React.isValidElement(child) ? unwrapMDXElement(child) : child,
|
|
27
|
-
);
|
|
28
|
-
return <Head {...(props as HeadProps)}>{unwrappedChildren}</Head>;
|
|
29
|
-
}
|
package/src/theme/NotFound.tsx
DELETED
|
@@ -1,54 +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
|
-
import React from 'react';
|
|
9
|
-
import Translate, {translate} from '@docusaurus/Translate';
|
|
10
|
-
import {PageMetadata} from '@docusaurus/theme-common';
|
|
11
|
-
import Layout from '@theme/Layout';
|
|
12
|
-
|
|
13
|
-
export default function NotFound(): JSX.Element {
|
|
14
|
-
return (
|
|
15
|
-
<>
|
|
16
|
-
<PageMetadata
|
|
17
|
-
title={translate({
|
|
18
|
-
id: 'theme.NotFound.title',
|
|
19
|
-
message: 'Page Not Found',
|
|
20
|
-
})}
|
|
21
|
-
/>
|
|
22
|
-
<Layout>
|
|
23
|
-
<main className="container margin-vert--xl">
|
|
24
|
-
<div className="row">
|
|
25
|
-
<div className="col col--6 col--offset-3">
|
|
26
|
-
<h1 className="hero__title">
|
|
27
|
-
<Translate
|
|
28
|
-
id="theme.NotFound.title"
|
|
29
|
-
description="The title of the 404 page">
|
|
30
|
-
Page Not Found
|
|
31
|
-
</Translate>
|
|
32
|
-
</h1>
|
|
33
|
-
<p>
|
|
34
|
-
<Translate
|
|
35
|
-
id="theme.NotFound.p1"
|
|
36
|
-
description="The first paragraph of the 404 page">
|
|
37
|
-
We could not find what you were looking for.
|
|
38
|
-
</Translate>
|
|
39
|
-
</p>
|
|
40
|
-
<p>
|
|
41
|
-
<Translate
|
|
42
|
-
id="theme.NotFound.p2"
|
|
43
|
-
description="The 2nd paragraph of the 404 page">
|
|
44
|
-
Please contact the owner of the site that linked you to the
|
|
45
|
-
original URL and let them know their link is broken.
|
|
46
|
-
</Translate>
|
|
47
|
-
</p>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
</main>
|
|
51
|
-
</Layout>
|
|
52
|
-
</>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|