@docusaurus/theme-classic 2.4.0 → 3.0.0-alpha.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 +99 -7
- package/lib/index.js +20 -6
- package/lib/nprogress.d.ts +1 -1
- package/lib/options.js +1 -0
- package/lib/theme/Admonition/Icon/Caution.d.ts +9 -0
- package/lib/theme/Admonition/Icon/Caution.js +17 -0
- 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/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 +32 -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/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/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/CopyButton/index.js +4 -6
- package/lib/theme/CodeBlock/WordWrapButton/index.js +2 -9
- 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/DocPaginator/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 +8 -3
- 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/DocSidebarItem/Category/index.js +3 -3
- 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/Head.d.ts → Icon/Copy/index.d.ts} +2 -2
- package/lib/theme/Icon/Copy/index.js +17 -0
- package/lib/theme/Icon/Success/index.d.ts +9 -0
- package/lib/theme/Icon/Success/index.js +17 -0
- package/lib/theme/Icon/WordWrap/index.d.ts +9 -0
- package/lib/theme/Icon/WordWrap/index.js +17 -0
- 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/index.js +3 -3
- package/lib/theme/MDXContent/index.js +1 -0
- 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/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/Unlisted/index.d.ts +9 -0
- package/lib/theme/Unlisted/index.js +38 -0
- package/package.json +24 -24
- package/src/getSwizzleConfig.ts +107 -8
- package/src/index.ts +21 -6
- package/src/nprogress.ts +2 -1
- package/src/options.ts +1 -0
- package/src/theme/Admonition/Icon/Caution.tsx +20 -0
- 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/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 +37 -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/Types.tsx +38 -0
- package/src/theme/Admonition/index.tsx +13 -194
- package/src/theme/BlogArchivePage/index.tsx +7 -2
- 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/CopyButton/index.tsx +4 -6
- package/src/theme/CodeBlock/WordWrapButton/index.tsx +2 -9
- 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/DocPaginator/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 +9 -4
- 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 +3 -3
- 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/Icon/Copy/index.tsx +20 -0
- package/src/theme/Icon/Success/index.tsx +20 -0
- package/src/theme/Icon/WordWrap/index.tsx +20 -0
- 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/index.tsx +3 -3
- package/src/theme/MDXContent/index.tsx +1 -0
- 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/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 +154 -20
- 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
|
@@ -0,0 +1,31 @@
|
|
|
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 {HtmlClassNameProvider, ThemeClassNames} from '@docusaurus/theme-common';
|
|
10
|
+
import {
|
|
11
|
+
DocsSidebarProvider,
|
|
12
|
+
useDocRootMetadata,
|
|
13
|
+
} from '@docusaurus/theme-common/internal';
|
|
14
|
+
import DocRootLayout from '@theme/DocRoot/Layout';
|
|
15
|
+
import NotFoundContent from '@theme/NotFound/Content';
|
|
16
|
+
export default function DocRoot(props) {
|
|
17
|
+
const currentDocRouteMetadata = useDocRootMetadata(props);
|
|
18
|
+
if (!currentDocRouteMetadata) {
|
|
19
|
+
// We only render the not found content to avoid a double layout
|
|
20
|
+
// see https://github.com/facebook/docusaurus/pull/7966#pullrequestreview-1077276692
|
|
21
|
+
return <NotFoundContent />;
|
|
22
|
+
}
|
|
23
|
+
const {docElement, sidebarName, sidebarItems} = currentDocRouteMetadata;
|
|
24
|
+
return (
|
|
25
|
+
<HtmlClassNameProvider className={clsx(ThemeClassNames.page.docsDocPage)}>
|
|
26
|
+
<DocsSidebarProvider name={sidebarName} items={sidebarItems}>
|
|
27
|
+
<DocRootLayout>{docElement}</DocRootLayout>
|
|
28
|
+
</DocsSidebarProvider>
|
|
29
|
+
</HtmlClassNameProvider>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from '@docusaurus/theme-common';
|
|
16
16
|
import {
|
|
17
17
|
isActiveSidebarItem,
|
|
18
|
-
|
|
18
|
+
findFirstSidebarItemLink,
|
|
19
19
|
useDocSidebarItemsExpandedState,
|
|
20
20
|
isSamePath,
|
|
21
21
|
} from '@docusaurus/theme-common/internal';
|
|
@@ -45,7 +45,7 @@ function useAutoExpandActiveCategory({isActive, collapsed, updateCollapsed}) {
|
|
|
45
45
|
function useCategoryHrefWithSSRFallback(item) {
|
|
46
46
|
const isBrowser = useIsBrowser();
|
|
47
47
|
return useMemo(() => {
|
|
48
|
-
if (item.href) {
|
|
48
|
+
if (item.href && !item.linkUnlisted) {
|
|
49
49
|
return item.href;
|
|
50
50
|
}
|
|
51
51
|
// In these cases, it's not necessary to render a fallback
|
|
@@ -53,7 +53,7 @@ function useCategoryHrefWithSSRFallback(item) {
|
|
|
53
53
|
if (isBrowser || !item.collapsible) {
|
|
54
54
|
return undefined;
|
|
55
55
|
}
|
|
56
|
-
return
|
|
56
|
+
return findFirstSidebarItemLink(item);
|
|
57
57
|
}, [item, isBrowser]);
|
|
58
58
|
}
|
|
59
59
|
function CollapseButton({categoryLabel, onClick}) {
|
|
@@ -5,14 +5,16 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React, {memo} from 'react';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
DocSidebarItemsExpandedStateProvider,
|
|
10
|
+
useVisibleSidebarItems,
|
|
11
|
+
} from '@docusaurus/theme-common/internal';
|
|
9
12
|
import DocSidebarItem from '@theme/DocSidebarItem';
|
|
10
|
-
// TODO this item should probably not receive the "activePath" props
|
|
11
|
-
// TODO this triggers whole sidebar re-renders on navigation
|
|
12
13
|
function DocSidebarItems({items, ...props}) {
|
|
14
|
+
const visibleItems = useVisibleSidebarItems(items, props.activePath);
|
|
13
15
|
return (
|
|
14
16
|
<DocSidebarItemsExpandedStateProvider>
|
|
15
|
-
{
|
|
17
|
+
{visibleItems.map((item, index) => (
|
|
16
18
|
<DocSidebarItem key={index} item={item} index={index} {...props} />
|
|
17
19
|
))}
|
|
18
20
|
</DocSidebarItemsExpandedStateProvider>
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
/// <reference types="@docusaurus/plugin-content-docs" />
|
|
8
8
|
/// <reference types="react" />
|
|
9
9
|
import type { Props } from '@theme/DocTagDocListPage';
|
|
10
|
-
export default function DocTagDocListPage(
|
|
10
|
+
export default function DocTagDocListPage(props: Props): JSX.Element;
|
|
@@ -14,8 +14,9 @@ import {
|
|
|
14
14
|
usePluralForm,
|
|
15
15
|
} from '@docusaurus/theme-common';
|
|
16
16
|
import Translate, {translate} from '@docusaurus/Translate';
|
|
17
|
-
import Layout from '@theme/Layout';
|
|
18
17
|
import SearchMetadata from '@theme/SearchMetadata';
|
|
18
|
+
import Unlisted from '@theme/Unlisted';
|
|
19
|
+
import Heading from '@theme/Heading';
|
|
19
20
|
// Very simple pluralization: probably good enough for now
|
|
20
21
|
function useNDocsTaggedPlural() {
|
|
21
22
|
const {selectMessage} = usePluralForm();
|
|
@@ -33,57 +34,70 @@ function useNDocsTaggedPlural() {
|
|
|
33
34
|
),
|
|
34
35
|
);
|
|
35
36
|
}
|
|
37
|
+
function usePageTitle(props) {
|
|
38
|
+
const nDocsTaggedPlural = useNDocsTaggedPlural();
|
|
39
|
+
return translate(
|
|
40
|
+
{
|
|
41
|
+
id: 'theme.docs.tagDocListPageTitle',
|
|
42
|
+
description: 'The title of the page for a docs tag',
|
|
43
|
+
message: '{nDocsTagged} with "{tagName}"',
|
|
44
|
+
},
|
|
45
|
+
{nDocsTagged: nDocsTaggedPlural(props.tag.count), tagName: props.tag.label},
|
|
46
|
+
);
|
|
47
|
+
}
|
|
36
48
|
function DocItem({doc}) {
|
|
37
49
|
return (
|
|
38
50
|
<article className="margin-vert--lg">
|
|
39
51
|
<Link to={doc.permalink}>
|
|
40
|
-
<h2>{doc.title}</
|
|
52
|
+
<Heading as="h2">{doc.title}</Heading>
|
|
41
53
|
</Link>
|
|
42
54
|
{doc.description && <p>{doc.description}</p>}
|
|
43
55
|
</article>
|
|
44
56
|
);
|
|
45
57
|
}
|
|
46
|
-
|
|
47
|
-
const nDocsTaggedPlural = useNDocsTaggedPlural();
|
|
48
|
-
const title = translate(
|
|
49
|
-
{
|
|
50
|
-
id: 'theme.docs.tagDocListPageTitle',
|
|
51
|
-
description: 'The title of the page for a docs tag',
|
|
52
|
-
message: '{nDocsTagged} with "{tagName}"',
|
|
53
|
-
},
|
|
54
|
-
{nDocsTagged: nDocsTaggedPlural(tag.count), tagName: tag.label},
|
|
55
|
-
);
|
|
58
|
+
function DocTagDocListPageMetadata({title}) {
|
|
56
59
|
return (
|
|
57
|
-
|
|
58
|
-
className={clsx(
|
|
59
|
-
ThemeClassNames.wrapper.docsPages,
|
|
60
|
-
ThemeClassNames.page.docsTagDocListPage,
|
|
61
|
-
)}>
|
|
60
|
+
<>
|
|
62
61
|
<PageMetadata title={title} />
|
|
63
62
|
<SearchMetadata tag="doc_tag_doc_list" />
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
63
|
+
</>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
function DocTagDocListPageContent({tag, title}) {
|
|
67
|
+
return (
|
|
68
|
+
<HtmlClassNameProvider
|
|
69
|
+
className={clsx(ThemeClassNames.page.docsTagDocListPage)}>
|
|
70
|
+
<div className="container margin-vert--lg">
|
|
71
|
+
<div className="row">
|
|
72
|
+
<main className="col col--8 col--offset-2">
|
|
73
|
+
{tag.unlisted && <Unlisted />}
|
|
74
|
+
<header className="margin-bottom--xl">
|
|
75
|
+
<Heading as="h1">{title}</Heading>
|
|
76
|
+
<Link href={tag.allTagsPath}>
|
|
77
|
+
<Translate
|
|
78
|
+
id="theme.tags.tagsPageLink"
|
|
79
|
+
description="The label of the link targeting the tag list page">
|
|
80
|
+
View All Tags
|
|
81
|
+
</Translate>
|
|
82
|
+
</Link>
|
|
83
|
+
</header>
|
|
84
|
+
<section className="margin-vert--lg">
|
|
85
|
+
{tag.items.map((doc) => (
|
|
86
|
+
<DocItem key={doc.id} doc={doc} />
|
|
87
|
+
))}
|
|
88
|
+
</section>
|
|
89
|
+
</main>
|
|
85
90
|
</div>
|
|
86
|
-
</
|
|
91
|
+
</div>
|
|
87
92
|
</HtmlClassNameProvider>
|
|
88
93
|
);
|
|
89
94
|
}
|
|
95
|
+
export default function DocTagDocListPage(props) {
|
|
96
|
+
const title = usePageTitle(props);
|
|
97
|
+
return (
|
|
98
|
+
<>
|
|
99
|
+
<DocTagDocListPageMetadata {...props} title={title} />
|
|
100
|
+
<DocTagDocListPageContent {...props} title={title} />
|
|
101
|
+
</>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
/// <reference types="@docusaurus/plugin-content-docs" />
|
|
8
8
|
/// <reference types="react" />
|
|
9
9
|
import type { Props } from '@theme/DocTagsListPage';
|
|
10
|
-
export default function DocTagsListPage(
|
|
10
|
+
export default function DocTagsListPage(props: Props): JSX.Element;
|
|
@@ -12,29 +12,38 @@ import {
|
|
|
12
12
|
ThemeClassNames,
|
|
13
13
|
translateTagsPageTitle,
|
|
14
14
|
} from '@docusaurus/theme-common';
|
|
15
|
-
import Layout from '@theme/Layout';
|
|
16
15
|
import TagsListByLetter from '@theme/TagsListByLetter';
|
|
17
16
|
import SearchMetadata from '@theme/SearchMetadata';
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
import Heading from '@theme/Heading';
|
|
18
|
+
function DocTagsListPageMetadata({title}) {
|
|
20
19
|
return (
|
|
21
|
-
|
|
22
|
-
className={clsx(
|
|
23
|
-
ThemeClassNames.wrapper.docsPages,
|
|
24
|
-
ThemeClassNames.page.docsTagsListPage,
|
|
25
|
-
)}>
|
|
20
|
+
<>
|
|
26
21
|
<PageMetadata title={title} />
|
|
27
22
|
<SearchMetadata tag="doc_tags_list" />
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
</>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
function DocTagsListPageContent({tags, title}) {
|
|
27
|
+
return (
|
|
28
|
+
<HtmlClassNameProvider
|
|
29
|
+
className={clsx(ThemeClassNames.page.docsTagsListPage)}>
|
|
30
|
+
<div className="container margin-vert--lg">
|
|
31
|
+
<div className="row">
|
|
32
|
+
<main className="col col--8 col--offset-2">
|
|
33
|
+
<Heading as="h1">{title}</Heading>
|
|
34
|
+
<TagsListByLetter tags={tags} />
|
|
35
|
+
</main>
|
|
36
36
|
</div>
|
|
37
|
-
</
|
|
37
|
+
</div>
|
|
38
38
|
</HtmlClassNameProvider>
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
|
+
export default function DocTagsListPage(props) {
|
|
42
|
+
const title = translateTagsPageTitle();
|
|
43
|
+
return (
|
|
44
|
+
<>
|
|
45
|
+
<DocTagsListPageMetadata {...props} title={title} />
|
|
46
|
+
<DocTagsListPageContent {...props} title={title} />
|
|
47
|
+
</>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
/// <reference types="@docusaurus/plugin-content-docs" />
|
|
8
|
+
/// <reference types="react" />
|
|
9
|
+
import type { Props } from '@theme/DocVersionRoot';
|
|
10
|
+
export default function DocVersionRoot(props: Props): JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
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 {HtmlClassNameProvider, PageMetadata} from '@docusaurus/theme-common';
|
|
9
|
+
import {
|
|
10
|
+
docVersionSearchTag,
|
|
11
|
+
DocsVersionProvider,
|
|
12
|
+
} from '@docusaurus/theme-common/internal';
|
|
13
|
+
import renderRoutes from '@docusaurus/renderRoutes';
|
|
14
|
+
import SearchMetadata from '@theme/SearchMetadata';
|
|
15
|
+
function DocVersionRootMetadata(props) {
|
|
16
|
+
const {version} = props;
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
<SearchMetadata
|
|
20
|
+
version={version.version}
|
|
21
|
+
tag={docVersionSearchTag(version.pluginId, version.version)}
|
|
22
|
+
/>
|
|
23
|
+
<PageMetadata>
|
|
24
|
+
{version.noIndex && <meta name="robots" content="noindex, nofollow" />}
|
|
25
|
+
</PageMetadata>
|
|
26
|
+
</>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
function DocVersionRootContent(props) {
|
|
30
|
+
const {version, route} = props;
|
|
31
|
+
return (
|
|
32
|
+
<HtmlClassNameProvider className={version.className}>
|
|
33
|
+
<DocsVersionProvider version={version}>
|
|
34
|
+
{renderRoutes(route.routes)}
|
|
35
|
+
</DocsVersionProvider>
|
|
36
|
+
</HtmlClassNameProvider>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
export default function DocVersionRoot(props) {
|
|
40
|
+
return (
|
|
41
|
+
<>
|
|
42
|
+
<DocVersionRootMetadata {...props} />
|
|
43
|
+
<DocVersionRootContent {...props} />
|
|
44
|
+
</>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
/// <reference types="@docusaurus/plugin-content-docs" />
|
|
8
|
+
/// <reference types="react" />
|
|
9
|
+
import type { Props } from '@theme/DocVersionRoot';
|
|
10
|
+
export default function DocsRoot(props: Props): JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 {ThemeClassNames, HtmlClassNameProvider} from '@docusaurus/theme-common';
|
|
10
|
+
import renderRoutes from '@docusaurus/renderRoutes';
|
|
11
|
+
import Layout from '@theme/Layout';
|
|
12
|
+
export default function DocsRoot(props) {
|
|
13
|
+
return (
|
|
14
|
+
<HtmlClassNameProvider className={clsx(ThemeClassNames.wrapper.docsPages)}>
|
|
15
|
+
<Layout>{renderRoutes(props.route.routes)}</Layout>
|
|
16
|
+
</HtmlClassNameProvider>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -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
|
}
|
|
@@ -10,18 +10,19 @@ import {
|
|
|
10
10
|
ErrorBoundaryError,
|
|
11
11
|
ErrorBoundaryTryAgainButton,
|
|
12
12
|
} from '@docusaurus/theme-common';
|
|
13
|
+
import Heading from '@theme/Heading';
|
|
13
14
|
export default function ErrorPageContent({error, tryAgain}) {
|
|
14
15
|
return (
|
|
15
16
|
<main className="container margin-vert--xl">
|
|
16
17
|
<div className="row">
|
|
17
18
|
<div className="col col--6 col--offset-3">
|
|
18
|
-
<h1 className="hero__title">
|
|
19
|
+
<Heading as="h1" className="hero__title">
|
|
19
20
|
<Translate
|
|
20
21
|
id="theme.ErrorPageContent.title"
|
|
21
22
|
description="The title of the fallback page when the page crashed">
|
|
22
23
|
This page crashed.
|
|
23
24
|
</Translate>
|
|
24
|
-
</
|
|
25
|
+
</Heading>
|
|
25
26
|
<div className="margin-vert--lg">
|
|
26
27
|
<ErrorBoundaryTryAgainButton
|
|
27
28
|
onClick={tryAgain}
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
/// <reference types="react" />
|
|
8
|
-
import type { Props } from '@theme/
|
|
9
|
-
export default function
|
|
8
|
+
import type { Props } from '@theme/Icon/Copy';
|
|
9
|
+
export default function IconCopy(props: Props): JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
export default function IconCopy(props) {
|
|
9
|
+
return (
|
|
10
|
+
<svg viewBox="0 0 24 24" {...props}>
|
|
11
|
+
<path
|
|
12
|
+
fill="currentColor"
|
|
13
|
+
d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
/// <reference types="react" />
|
|
8
|
+
import type { Props } from '@theme/Icon/Success';
|
|
9
|
+
export default function IconSuccess(props: Props): JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
export default function IconSuccess(props) {
|
|
9
|
+
return (
|
|
10
|
+
<svg viewBox="0 0 24 24" {...props}>
|
|
11
|
+
<path
|
|
12
|
+
fill="currentColor"
|
|
13
|
+
d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
/// <reference types="react" />
|
|
8
|
+
import type { Props } from '@theme/Icon/WordWrap';
|
|
9
|
+
export default function IconWordWrap(props: Props): JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
export default function IconWordWrap(props) {
|
|
9
|
+
return (
|
|
10
|
+
<svg viewBox="0 0 24 24" {...props}>
|
|
11
|
+
<path
|
|
12
|
+
fill="currentColor"
|
|
13
|
+
d="M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -4,45 +4,11 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React
|
|
7
|
+
import React from 'react';
|
|
8
8
|
import CodeBlock from '@theme/CodeBlock';
|
|
9
9
|
export default function MDXCode(props) {
|
|
10
|
-
const inlineElements = [
|
|
11
|
-
'a',
|
|
12
|
-
'abbr',
|
|
13
|
-
'b',
|
|
14
|
-
'br',
|
|
15
|
-
'button',
|
|
16
|
-
'cite',
|
|
17
|
-
'code',
|
|
18
|
-
'del',
|
|
19
|
-
'dfn',
|
|
20
|
-
'em',
|
|
21
|
-
'i',
|
|
22
|
-
'img',
|
|
23
|
-
'input',
|
|
24
|
-
'ins',
|
|
25
|
-
'kbd',
|
|
26
|
-
'label',
|
|
27
|
-
'object',
|
|
28
|
-
'output',
|
|
29
|
-
'q',
|
|
30
|
-
'ruby',
|
|
31
|
-
's',
|
|
32
|
-
'small',
|
|
33
|
-
'span',
|
|
34
|
-
'strong',
|
|
35
|
-
'sub',
|
|
36
|
-
'sup',
|
|
37
|
-
'time',
|
|
38
|
-
'u',
|
|
39
|
-
'var',
|
|
40
|
-
'wbr',
|
|
41
|
-
];
|
|
42
10
|
const shouldBeInline = React.Children.toArray(props.children).every(
|
|
43
|
-
(el) =>
|
|
44
|
-
(typeof el === 'string' && !el.includes('\n')) ||
|
|
45
|
-
(isValidElement(el) && inlineElements.includes(el.props?.mdxType)),
|
|
11
|
+
(el) => typeof el === 'string' && !el.includes('\n'),
|
|
46
12
|
);
|
|
47
13
|
return shouldBeInline ? <code {...props} /> : <CodeBlock {...props} />;
|
|
48
14
|
}
|
|
@@ -11,7 +11,7 @@ export default function MDXDetails(props) {
|
|
|
11
11
|
// Split summary item from the rest to pass it as a separate prop to the
|
|
12
12
|
// Details theme component
|
|
13
13
|
const summary = items.find(
|
|
14
|
-
(item) => React.isValidElement(item) && item.
|
|
14
|
+
(item) => React.isValidElement(item) && item.type === 'summary',
|
|
15
15
|
);
|
|
16
16
|
const children = <>{items.filter((item) => item !== summary)}</>;
|
|
17
17
|
return (
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
import { type ReactNode } from 'react';
|
|
8
8
|
import type { Props } from '@theme/MDXComponents/Pre';
|
|
9
|
-
export default function MDXPre(props: Props):
|
|
9
|
+
export default function MDXPre(props: Props): ReactNode | undefined;
|
|
@@ -4,16 +4,9 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React
|
|
8
|
-
import CodeBlock from '@theme/CodeBlock';
|
|
7
|
+
import React from 'react';
|
|
9
8
|
export default function MDXPre(props) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
{...(isValidElement(props.children) &&
|
|
14
|
-
props.children.props?.originalType === 'code'
|
|
15
|
-
? props.children.props
|
|
16
|
-
: {...props})}
|
|
17
|
-
/>
|
|
18
|
-
);
|
|
9
|
+
// With MDX 2, this element is only used for fenced code blocks
|
|
10
|
+
// It always receives a MDXComponents/Code as children
|
|
11
|
+
return <>{props.children}</>;
|
|
19
12
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import
|
|
8
|
+
import Head from '@docusaurus/Head';
|
|
9
9
|
import MDXCode from '@theme/MDXComponents/Code';
|
|
10
10
|
import MDXA from '@theme/MDXComponents/A';
|
|
11
11
|
import MDXPre from '@theme/MDXComponents/Pre';
|
|
@@ -16,11 +16,11 @@ import MDXImg from '@theme/MDXComponents/Img';
|
|
|
16
16
|
import Admonition from '@theme/Admonition';
|
|
17
17
|
import Mermaid from '@theme/Mermaid';
|
|
18
18
|
const MDXComponents = {
|
|
19
|
-
|
|
19
|
+
Head,
|
|
20
|
+
Details: MDXDetails,
|
|
20
21
|
code: MDXCode,
|
|
21
22
|
a: MDXA,
|
|
22
23
|
pre: MDXPre,
|
|
23
|
-
details: MDXDetails,
|
|
24
24
|
ul: MDXUl,
|
|
25
25
|
img: MDXImg,
|
|
26
26
|
h1: (props) => <MDXHeading as="h1" {...props} />,
|
|
@@ -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
|
+
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
|
8
9
|
import {MDXProvider} from '@mdx-js/react';
|
|
9
10
|
import MDXComponents from '@theme/MDXComponents';
|
|
10
11
|
export default function MDXContent({children}) {
|