@docusaurus/theme-classic 2.0.0-beta.21 → 2.0.0-beta.22
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 +5 -5
- package/lib/index.js +4 -2
- package/lib/theme/Admonition/index.d.ts +1 -1
- package/lib/theme/Admonition/index.js +139 -57
- package/lib/{admonitions.css → theme/Admonition/styles.module.css} +14 -15
- package/lib/theme/AnnouncementBar/index.js +3 -2
- package/lib/theme/BackToTopButton/index.js +2 -1
- package/lib/theme/BlogListPage/index.js +2 -11
- package/lib/theme/BlogPostItem/Container/index.d.ts +9 -0
- package/lib/theme/BlogPostItem/Container/index.js +26 -0
- package/lib/theme/BlogPostItem/Content/index.d.ts +9 -0
- package/lib/theme/BlogPostItem/Content/index.js +23 -0
- package/lib/theme/BlogPostItem/Footer/ReadMoreLink/index.d.ts +9 -0
- package/lib/theme/BlogPostItem/Footer/ReadMoreLink/index.js +38 -0
- package/lib/theme/BlogPostItem/Footer/index.d.ts +8 -0
- package/lib/theme/BlogPostItem/Footer/index.js +52 -0
- package/lib/theme/BlogPostItem/Footer/styles.module.css +10 -0
- package/lib/theme/BlogPostItem/Header/Author/index.d.ts +9 -0
- package/lib/theme/{BlogPostAuthor → BlogPostItem/Header/Author}/index.js +3 -2
- package/lib/theme/BlogPostItem/Header/Authors/index.d.ts +9 -0
- package/{src/theme/BlogPostAuthors/index.tsx → lib/theme/BlogPostItem/Header/Authors/index.js} +9 -10
- package/lib/theme/{BlogPostAuthors → BlogPostItem/Header/Authors}/styles.module.css +0 -0
- package/lib/theme/{BlogPostAuthors → BlogPostItem/Header/Info}/index.d.ts +2 -2
- package/lib/theme/BlogPostItem/Header/Info/index.js +60 -0
- package/lib/theme/BlogPostItem/Header/Info/styles.module.css +10 -0
- package/lib/theme/BlogPostItem/Header/Title/index.d.ts +9 -0
- package/lib/theme/BlogPostItem/Header/Title/index.js +27 -0
- package/{src/theme/BlogPostItem → lib/theme/BlogPostItem/Header/Title}/styles.module.css +2 -10
- package/lib/theme/BlogPostItem/Header/index.d.ts +8 -0
- package/lib/theme/BlogPostItem/Header/index.js +19 -0
- package/lib/theme/BlogPostItem/index.d.ts +1 -1
- package/lib/theme/BlogPostItem/index.js +16 -142
- package/lib/theme/BlogPostItems/index.d.ts +9 -0
- package/lib/theme/BlogPostItems/index.js +27 -0
- package/lib/theme/BlogPostPage/Metadata/index.d.ts +8 -0
- package/lib/theme/BlogPostPage/Metadata/index.js +41 -0
- package/lib/theme/BlogPostPage/index.js +21 -60
- package/lib/theme/BlogTagsListPage/index.js +1 -1
- package/lib/theme/BlogTagsPostsPage/index.d.ts +1 -1
- package/lib/theme/BlogTagsPostsPage/index.js +36 -30
- package/lib/theme/CodeBlock/Container/index.js +2 -5
- package/lib/theme/CodeBlock/Content/String.js +2 -3
- package/lib/theme/CodeBlock/CopyButton/index.js +1 -0
- package/lib/theme/CodeBlock/Line/styles.module.css +7 -7
- package/lib/theme/ColorModeToggle/index.js +2 -2
- package/lib/theme/DocBreadcrumbs/index.js +3 -3
- package/lib/theme/DocCard/index.js +4 -1
- package/lib/theme/DocCardList/index.js +2 -2
- package/lib/theme/DocItem/Content/index.d.ts +9 -0
- package/lib/theme/DocItem/Content/index.js +44 -0
- package/lib/theme/DocItem/Footer/index.d.ts +8 -0
- package/lib/theme/{DocItemFooter → DocItem/Footer}/index.js +3 -3
- package/lib/theme/{DocItemFooter → DocItem/Footer}/styles.module.css +0 -0
- package/lib/theme/{BlogPostAuthor → DocItem/Layout}/index.d.ts +2 -2
- package/lib/theme/DocItem/Layout/index.js +59 -0
- package/lib/theme/DocItem/Layout/styles.module.css +17 -0
- package/lib/theme/DocItem/Metadata/index.d.ts +8 -0
- package/lib/theme/DocItem/Metadata/index.js +20 -0
- package/lib/theme/{DocItemFooter → DocItem/Paginator}/index.d.ts +5 -3
- package/lib/theme/DocItem/Paginator/index.js +17 -0
- package/lib/theme/DocItem/TOC/Desktop/index.d.ts +8 -0
- package/lib/theme/DocItem/TOC/Desktop/index.js +21 -0
- package/lib/theme/DocItem/TOC/Mobile/index.d.ts +8 -0
- package/lib/theme/DocItem/TOC/Mobile/index.js +23 -0
- package/lib/theme/DocItem/{styles.module.css → TOC/Mobile/styles.module.css} +0 -9
- package/lib/theme/DocItem/index.js +13 -106
- package/lib/theme/DocPage/Layout/Main/index.js +1 -1
- package/lib/theme/DocPage/Layout/Sidebar/ExpandButton/index.js +1 -1
- package/lib/theme/DocPage/Layout/Sidebar/index.js +2 -1
- package/lib/theme/DocPage/Layout/index.js +1 -1
- package/lib/theme/DocPage/index.js +2 -3
- package/lib/theme/DocSidebar/Desktop/CollapseButton/index.js +1 -1
- package/lib/theme/DocSidebar/Desktop/Content/index.js +2 -2
- package/lib/theme/DocSidebar/Mobile/index.js +1 -1
- package/lib/theme/DocSidebarItem/Category/index.js +6 -4
- package/lib/theme/DocSidebarItem/Link/index.js +3 -2
- package/lib/theme/DocSidebarItems/index.js +1 -1
- package/lib/theme/DocVersionBadge/index.js +2 -1
- package/lib/theme/DocVersionBanner/index.js +2 -2
- package/lib/theme/EditThisPage/index.js +1 -1
- package/lib/theme/Footer/LinkItem/index.js +1 -1
- package/lib/theme/Footer/Logo/index.js +7 -2
- package/lib/theme/{IconArrow → Icon/Arrow}/index.d.ts +1 -1
- package/lib/theme/{IconArrow → Icon/Arrow}/index.js +0 -0
- package/lib/theme/{IconClose → Icon/Close}/index.d.ts +1 -1
- package/lib/theme/{IconClose → Icon/Close}/index.js +0 -0
- package/lib/theme/{IconDarkMode → Icon/DarkMode}/index.d.ts +1 -1
- package/lib/theme/{IconDarkMode → Icon/DarkMode}/index.js +0 -0
- package/lib/theme/{IconEdit → Icon/Edit}/index.d.ts +1 -1
- package/lib/theme/{IconEdit → Icon/Edit}/index.js +0 -0
- package/lib/theme/{IconEdit → Icon/Edit}/styles.module.css +0 -0
- package/lib/theme/{IconExternalLink → Icon/ExternalLink}/index.d.ts +1 -1
- package/lib/theme/{IconExternalLink → Icon/ExternalLink}/index.js +0 -0
- package/lib/theme/{IconExternalLink → Icon/ExternalLink}/styles.module.css +0 -0
- package/lib/theme/{IconHome → Icon/Home}/index.d.ts +1 -1
- package/lib/theme/{IconHome → Icon/Home}/index.js +0 -0
- package/lib/theme/{IconLanguage → Icon/Language}/index.d.ts +1 -1
- package/lib/theme/{IconLanguage → Icon/Language}/index.js +0 -0
- package/lib/theme/{IconLightMode → Icon/LightMode}/index.d.ts +1 -1
- package/lib/theme/{IconLightMode → Icon/LightMode}/index.js +0 -0
- package/lib/theme/{IconMenu → Icon/Menu}/index.d.ts +1 -1
- package/lib/theme/{IconMenu → Icon/Menu}/index.js +0 -0
- package/lib/theme/Layout/Provider/index.d.ts +9 -0
- package/lib/theme/Layout/Provider/index.js +29 -0
- package/lib/theme/Layout/index.d.ts +0 -1
- package/lib/theme/Layout/index.js +12 -10
- package/{src/theme/Layout/styles.css → lib/theme/Layout/styles.module.css} +10 -12
- package/lib/theme/Logo/index.js +35 -17
- package/lib/theme/MDXComponents/Code.js +1 -1
- package/lib/theme/MDXComponents/index.js +2 -0
- package/lib/theme/MDXPage/index.js +6 -4
- package/lib/theme/Navbar/Content/index.js +2 -2
- package/lib/theme/Navbar/Layout/index.js +2 -2
- package/lib/theme/Navbar/MobileSidebar/Header/index.js +2 -2
- package/lib/theme/Navbar/MobileSidebar/Layout/index.js +1 -1
- package/lib/theme/Navbar/MobileSidebar/PrimaryMenu/index.js +2 -1
- package/lib/theme/Navbar/MobileSidebar/SecondaryMenu/index.js +2 -1
- package/lib/theme/Navbar/MobileSidebar/Toggle/index.js +2 -2
- package/lib/theme/Navbar/MobileSidebar/index.js +1 -1
- package/lib/theme/NavbarItem/DocNavbarItem.js +1 -1
- package/lib/theme/NavbarItem/DocSidebarNavbarItem.js +1 -1
- package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +2 -4
- package/lib/theme/NavbarItem/DocsVersionNavbarItem.js +1 -1
- package/lib/theme/NavbarItem/DropdownNavbarItem.js +2 -3
- package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.js +2 -2
- package/lib/theme/NavbarItem/NavbarNavLink.js +1 -1
- package/lib/theme/SiteMetadata/index.js +2 -3
- package/lib/theme/SkipToContent/index.js +1 -1
- package/lib/theme/TOCItems/index.js +2 -2
- package/lib/theme/Tabs/index.js +2 -2
- package/lib/validateThemeConfig.js +13 -18
- package/package.json +19 -15
- package/src/getSwizzleConfig.ts +5 -5
- package/src/index.ts +4 -2
- package/src/theme/Admonition/index.tsx +161 -58
- package/src/{admonitions.css → theme/Admonition/styles.module.css} +14 -15
- package/src/theme/AnnouncementBar/index.tsx +3 -2
- package/src/theme/BackToTopButton/index.tsx +2 -1
- package/src/theme/BlogListPage/index.tsx +2 -11
- package/src/theme/BlogPostItem/Container/index.tsx +32 -0
- package/src/theme/BlogPostItem/Content/index.tsx +29 -0
- package/src/theme/BlogPostItem/Footer/ReadMoreLink/index.tsx +44 -0
- package/src/theme/BlogPostItem/Footer/index.tsx +60 -0
- package/src/theme/BlogPostItem/Footer/styles.module.css +10 -0
- package/src/theme/{BlogPostAuthor → BlogPostItem/Header/Author}/index.tsx +8 -3
- package/{lib/theme/BlogPostAuthors/index.js → src/theme/BlogPostItem/Header/Authors/index.tsx} +14 -3
- package/src/theme/{BlogPostAuthors → BlogPostItem/Header/Authors}/styles.module.css +0 -0
- package/src/theme/BlogPostItem/Header/Info/index.tsx +71 -0
- package/src/theme/BlogPostItem/Header/Info/styles.module.css +10 -0
- package/src/theme/BlogPostItem/Header/Title/index.tsx +33 -0
- package/{lib/theme/BlogPostItem → src/theme/BlogPostItem/Header/Title}/styles.module.css +2 -10
- package/src/theme/BlogPostItem/Header/index.tsx +21 -0
- package/src/theme/BlogPostItem/index.tsx +19 -145
- package/src/theme/BlogPostItems/index.tsx +30 -0
- package/src/theme/BlogPostPage/Metadata/index.tsx +44 -0
- package/src/theme/BlogPostPage/index.tsx +29 -62
- package/src/theme/BlogTagsListPage/index.tsx +1 -1
- package/src/theme/BlogTagsPostsPage/index.tsx +42 -35
- package/src/theme/CodeBlock/Container/index.tsx +3 -6
- package/src/theme/CodeBlock/Content/String.tsx +2 -3
- package/src/theme/CodeBlock/CopyButton/index.tsx +1 -0
- package/src/theme/CodeBlock/Line/styles.module.css +7 -7
- package/src/theme/ColorModeToggle/index.tsx +2 -2
- package/src/theme/DocBreadcrumbs/index.tsx +3 -3
- package/src/theme/DocCard/index.tsx +4 -1
- package/src/theme/DocCardList/index.tsx +2 -2
- package/src/theme/DocItem/Content/index.tsx +48 -0
- package/src/theme/{DocItemFooter → DocItem/Footer}/index.tsx +4 -5
- package/src/theme/{DocItemFooter → DocItem/Footer}/styles.module.css +0 -0
- package/src/theme/DocItem/Layout/index.tsx +68 -0
- package/src/theme/DocItem/Layout/styles.module.css +17 -0
- package/src/theme/DocItem/Metadata/index.tsx +22 -0
- package/src/theme/DocItem/Paginator/index.tsx +19 -0
- package/src/theme/DocItem/TOC/Desktop/index.tsx +24 -0
- package/src/theme/DocItem/TOC/Mobile/index.tsx +27 -0
- package/src/theme/DocItem/{styles.module.css → TOC/Mobile/styles.module.css} +0 -9
- package/src/theme/DocItem/index.tsx +13 -115
- package/src/theme/DocPage/Layout/Main/index.tsx +1 -1
- package/src/theme/DocPage/Layout/Sidebar/ExpandButton/index.tsx +1 -1
- package/src/theme/DocPage/Layout/Sidebar/index.tsx +2 -1
- package/src/theme/DocPage/Layout/index.tsx +1 -1
- package/src/theme/DocPage/index.tsx +2 -3
- package/src/theme/DocPaginator/index.tsx +0 -1
- package/src/theme/DocSidebar/Desktop/CollapseButton/index.tsx +1 -1
- package/src/theme/DocSidebar/Desktop/Content/index.tsx +2 -2
- package/src/theme/DocSidebar/Mobile/index.tsx +1 -1
- package/src/theme/DocSidebarItem/Category/index.tsx +6 -4
- package/src/theme/DocSidebarItem/Link/index.tsx +3 -2
- package/src/theme/DocSidebarItems/index.tsx +1 -1
- package/src/theme/DocVersionBadge/index.tsx +2 -1
- package/src/theme/DocVersionBanner/index.tsx +2 -3
- package/src/theme/EditThisPage/index.tsx +1 -1
- package/src/theme/Footer/LinkItem/index.tsx +1 -1
- package/src/theme/Footer/Logo/index.tsx +7 -2
- package/src/theme/{IconArrow → Icon/Arrow}/index.tsx +1 -1
- package/src/theme/{IconClose → Icon/Close}/index.tsx +1 -1
- package/src/theme/{IconDarkMode → Icon/DarkMode}/index.tsx +1 -1
- package/src/theme/{IconEdit → Icon/Edit}/index.tsx +1 -1
- package/src/theme/{IconEdit → Icon/Edit}/styles.module.css +0 -0
- package/src/theme/{IconExternalLink → Icon/ExternalLink}/index.tsx +1 -1
- package/src/theme/{IconExternalLink → Icon/ExternalLink}/styles.module.css +0 -0
- package/src/theme/{IconHome → Icon/Home}/index.tsx +1 -1
- package/src/theme/{IconLanguage → Icon/Language}/index.tsx +1 -1
- package/src/theme/{IconLightMode → Icon/LightMode}/index.tsx +1 -1
- package/src/theme/{IconMenu → Icon/Menu}/index.tsx +1 -1
- package/src/theme/Layout/Provider/index.tsx +33 -0
- package/src/theme/Layout/index.tsx +12 -10
- package/{lib/theme/Layout/styles.css → src/theme/Layout/styles.module.css} +10 -12
- package/src/theme/Logo/index.tsx +49 -19
- package/src/theme/MDXComponents/Code.tsx +5 -2
- package/src/theme/MDXComponents/Details.tsx +2 -1
- package/src/theme/MDXComponents/Head.tsx +3 -5
- package/src/theme/MDXComponents/Pre.tsx +2 -1
- package/src/theme/MDXComponents/index.tsx +2 -0
- package/src/theme/MDXPage/index.tsx +6 -4
- package/src/theme/Navbar/Content/index.tsx +2 -2
- package/src/theme/Navbar/Layout/index.tsx +2 -2
- package/src/theme/Navbar/MobileSidebar/Header/index.tsx +2 -2
- package/src/theme/Navbar/MobileSidebar/Layout/index.tsx +1 -1
- package/src/theme/Navbar/MobileSidebar/PrimaryMenu/index.tsx +2 -1
- package/src/theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx +2 -1
- package/src/theme/Navbar/MobileSidebar/Toggle/index.tsx +2 -2
- package/src/theme/Navbar/MobileSidebar/index.tsx +1 -1
- package/src/theme/NavbarItem/DocNavbarItem.tsx +1 -1
- package/src/theme/NavbarItem/DocSidebarNavbarItem.tsx +1 -1
- package/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +2 -4
- package/src/theme/NavbarItem/DocsVersionNavbarItem.tsx +1 -1
- package/src/theme/NavbarItem/DropdownNavbarItem.tsx +2 -3
- package/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx +2 -2
- package/src/theme/NavbarItem/NavbarNavLink.tsx +1 -1
- package/src/theme/NavbarItem/index.tsx +1 -1
- package/src/theme/SiteMetadata/index.tsx +2 -3
- package/src/theme/SkipToContent/index.tsx +1 -1
- package/src/theme/TOCItems/index.tsx +3 -3
- package/src/theme/Tabs/index.tsx +2 -2
- package/src/theme-classic.d.ts +128 -36
- package/src/validateThemeConfig.ts +14 -18
- package/lib/theme/LayoutProviders/index.d.ts +0 -9
- package/lib/theme/LayoutProviders/index.js +0 -33
- package/src/theme/LayoutProviders/index.tsx +0 -36
|
@@ -5,114 +5,21 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
ThemeClassNames,
|
|
13
|
-
useWindowSize,
|
|
14
|
-
} from '@docusaurus/theme-common';
|
|
15
|
-
import DocPaginator from '@theme/DocPaginator';
|
|
16
|
-
import DocVersionBanner from '@theme/DocVersionBanner';
|
|
17
|
-
import DocVersionBadge from '@theme/DocVersionBadge';
|
|
18
|
-
import DocItemFooter from '@theme/DocItemFooter';
|
|
19
|
-
import TOC from '@theme/TOC';
|
|
20
|
-
import TOCCollapsible from '@theme/TOCCollapsible';
|
|
21
|
-
import Heading from '@theme/Heading';
|
|
22
|
-
import DocBreadcrumbs from '@theme/DocBreadcrumbs';
|
|
23
|
-
import MDXContent from '@theme/MDXContent';
|
|
24
|
-
import styles from './styles.module.css';
|
|
25
|
-
function DocItemMetadata(props) {
|
|
26
|
-
const {content: DocContent} = props;
|
|
27
|
-
const {metadata, frontMatter, assets} = DocContent;
|
|
28
|
-
const {keywords} = frontMatter;
|
|
29
|
-
const {description, title} = metadata;
|
|
30
|
-
const image = assets.image ?? frontMatter.image;
|
|
31
|
-
return <PageMetadata {...{title, description, keywords, image}} />;
|
|
32
|
-
}
|
|
33
|
-
function DocItemContent(props) {
|
|
34
|
-
const {content: DocContent} = props;
|
|
35
|
-
const {metadata, frontMatter} = DocContent;
|
|
36
|
-
const {
|
|
37
|
-
hide_title: hideTitle,
|
|
38
|
-
hide_table_of_contents: hideTableOfContents,
|
|
39
|
-
toc_min_heading_level: tocMinHeadingLevel,
|
|
40
|
-
toc_max_heading_level: tocMaxHeadingLevel,
|
|
41
|
-
} = frontMatter;
|
|
42
|
-
const {title} = metadata;
|
|
43
|
-
// We only add a title if:
|
|
44
|
-
// - user doesn't ask to hide it with front matter
|
|
45
|
-
// - the markdown content does not already contain a top-level h1 heading
|
|
46
|
-
const shouldAddTitle =
|
|
47
|
-
!hideTitle && typeof DocContent.contentTitle === 'undefined';
|
|
48
|
-
const windowSize = useWindowSize();
|
|
49
|
-
const canRenderTOC =
|
|
50
|
-
!hideTableOfContents && DocContent.toc && DocContent.toc.length > 0;
|
|
51
|
-
const renderTocDesktop =
|
|
52
|
-
canRenderTOC && (windowSize === 'desktop' || windowSize === 'ssr');
|
|
53
|
-
return (
|
|
54
|
-
<div className="row">
|
|
55
|
-
<div className={clsx('col', !hideTableOfContents && styles.docItemCol)}>
|
|
56
|
-
<DocVersionBanner />
|
|
57
|
-
<div className={styles.docItemContainer}>
|
|
58
|
-
<article>
|
|
59
|
-
<DocBreadcrumbs />
|
|
60
|
-
<DocVersionBadge />
|
|
61
|
-
|
|
62
|
-
{canRenderTOC && (
|
|
63
|
-
<TOCCollapsible
|
|
64
|
-
toc={DocContent.toc}
|
|
65
|
-
minHeadingLevel={tocMinHeadingLevel}
|
|
66
|
-
maxHeadingLevel={tocMaxHeadingLevel}
|
|
67
|
-
className={clsx(
|
|
68
|
-
ThemeClassNames.docs.docTocMobile,
|
|
69
|
-
styles.tocMobile,
|
|
70
|
-
)}
|
|
71
|
-
/>
|
|
72
|
-
)}
|
|
73
|
-
|
|
74
|
-
<div className={clsx(ThemeClassNames.docs.docMarkdown, 'markdown')}>
|
|
75
|
-
{/*
|
|
76
|
-
Title can be declared inside md content or declared through
|
|
77
|
-
front matter and added manually. To make both cases consistent,
|
|
78
|
-
the added title is added under the same div.markdown block
|
|
79
|
-
See https://github.com/facebook/docusaurus/pull/4882#issuecomment-853021120
|
|
80
|
-
*/}
|
|
81
|
-
{shouldAddTitle && (
|
|
82
|
-
<header>
|
|
83
|
-
<Heading as="h1">{title}</Heading>
|
|
84
|
-
</header>
|
|
85
|
-
)}
|
|
86
|
-
<MDXContent>
|
|
87
|
-
<DocContent />
|
|
88
|
-
</MDXContent>
|
|
89
|
-
</div>
|
|
90
|
-
|
|
91
|
-
<DocItemFooter {...props} />
|
|
92
|
-
</article>
|
|
93
|
-
|
|
94
|
-
<DocPaginator previous={metadata.previous} next={metadata.next} />
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
{renderTocDesktop && (
|
|
98
|
-
<div className="col col--3">
|
|
99
|
-
<TOC
|
|
100
|
-
toc={DocContent.toc}
|
|
101
|
-
minHeadingLevel={tocMinHeadingLevel}
|
|
102
|
-
maxHeadingLevel={tocMaxHeadingLevel}
|
|
103
|
-
className={ThemeClassNames.docs.docTocDesktop}
|
|
104
|
-
/>
|
|
105
|
-
</div>
|
|
106
|
-
)}
|
|
107
|
-
</div>
|
|
108
|
-
);
|
|
109
|
-
}
|
|
8
|
+
import {HtmlClassNameProvider} from '@docusaurus/theme-common';
|
|
9
|
+
import {DocProvider} from '@docusaurus/theme-common/internal';
|
|
10
|
+
import DocItemMetadata from '@theme/DocItem/Metadata';
|
|
11
|
+
import DocItemLayout from '@theme/DocItem/Layout';
|
|
110
12
|
export default function DocItem(props) {
|
|
111
13
|
const docHtmlClassName = `docs-doc-id-${props.content.metadata.unversionedId}`;
|
|
14
|
+
const MDXComponent = props.content;
|
|
112
15
|
return (
|
|
113
|
-
<
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
|
|
16
|
+
<DocProvider content={props.content}>
|
|
17
|
+
<HtmlClassNameProvider className={docHtmlClassName}>
|
|
18
|
+
<DocItemMetadata />
|
|
19
|
+
<DocItemLayout>
|
|
20
|
+
<MDXComponent />
|
|
21
|
+
</DocItemLayout>
|
|
22
|
+
</HtmlClassNameProvider>
|
|
23
|
+
</DocProvider>
|
|
117
24
|
);
|
|
118
25
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
-
import {useDocsSidebar} from '@docusaurus/theme-common';
|
|
9
|
+
import {useDocsSidebar} from '@docusaurus/theme-common/internal';
|
|
10
10
|
import styles from './styles.module.css';
|
|
11
11
|
export default function DocPageLayoutMain({hiddenSidebarContainer, children}) {
|
|
12
12
|
const sidebar = useDocsSidebar();
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import {translate} from '@docusaurus/Translate';
|
|
9
|
-
import IconArrow from '@theme/
|
|
9
|
+
import IconArrow from '@theme/Icon/Arrow';
|
|
10
10
|
import styles from './styles.module.css';
|
|
11
11
|
export default function DocPageLayoutSidebarExpandButton({toggleSidebar}) {
|
|
12
12
|
return (
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React, {useState, useCallback} from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
-
import {ThemeClassNames
|
|
9
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
10
|
+
import {useDocsSidebar} from '@docusaurus/theme-common/internal';
|
|
10
11
|
import {useLocation} from '@docusaurus/router';
|
|
11
12
|
import DocSidebar from '@theme/DocSidebar';
|
|
12
13
|
import ExpandButton from '@theme/DocPage/Layout/Sidebar/ExpandButton';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React, {useState} from 'react';
|
|
8
|
-
import {useDocsSidebar} from '@docusaurus/theme-common';
|
|
8
|
+
import {useDocsSidebar} from '@docusaurus/theme-common/internal';
|
|
9
9
|
import Layout from '@theme/Layout';
|
|
10
10
|
import BackToTopButton from '@theme/BackToTopButton';
|
|
11
11
|
import DocPageLayoutSidebar from '@theme/DocPage/Layout/Sidebar';
|
|
@@ -6,14 +6,13 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
+
import {HtmlClassNameProvider, ThemeClassNames} from '@docusaurus/theme-common';
|
|
9
10
|
import {
|
|
10
|
-
HtmlClassNameProvider,
|
|
11
|
-
ThemeClassNames,
|
|
12
11
|
docVersionSearchTag,
|
|
13
12
|
DocsSidebarProvider,
|
|
14
13
|
DocsVersionProvider,
|
|
15
14
|
useDocRouteMetadata,
|
|
16
|
-
} from '@docusaurus/theme-common';
|
|
15
|
+
} from '@docusaurus/theme-common/internal';
|
|
17
16
|
import DocPageLayout from '@theme/DocPage/Layout';
|
|
18
17
|
import NotFound from '@theme/NotFound';
|
|
19
18
|
import SearchMetadata from '@theme/SearchMetadata';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import {translate} from '@docusaurus/Translate';
|
|
10
|
-
import IconArrow from '@theme/
|
|
10
|
+
import IconArrow from '@theme/Icon/Arrow';
|
|
11
11
|
import styles from './styles.module.css';
|
|
12
12
|
export default function CollapseButton({onClick}) {
|
|
13
13
|
return (
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React, {useState} from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
9
10
|
import {
|
|
10
|
-
ThemeClassNames,
|
|
11
11
|
useAnnouncementBar,
|
|
12
12
|
useScrollPosition,
|
|
13
|
-
} from '@docusaurus/theme-common';
|
|
13
|
+
} from '@docusaurus/theme-common/internal';
|
|
14
14
|
import DocSidebarItems from '@theme/DocSidebarItems';
|
|
15
15
|
import styles from './styles.module.css';
|
|
16
16
|
function useShowAnnouncementBar() {
|
|
@@ -9,8 +9,8 @@ import clsx from 'clsx';
|
|
|
9
9
|
import {
|
|
10
10
|
NavbarSecondaryMenuFiller,
|
|
11
11
|
ThemeClassNames,
|
|
12
|
-
useNavbarMobileSidebar,
|
|
13
12
|
} from '@docusaurus/theme-common';
|
|
13
|
+
import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal';
|
|
14
14
|
import DocSidebarItems from '@theme/DocSidebarItems';
|
|
15
15
|
// eslint-disable-next-line react/function-component-definition
|
|
16
16
|
const DocSidebarMobileSecondaryMenu = ({sidebar, path}) => {
|
|
@@ -7,16 +7,18 @@
|
|
|
7
7
|
import React, {useEffect, useMemo} from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import {
|
|
10
|
-
|
|
10
|
+
ThemeClassNames,
|
|
11
|
+
useThemeConfig,
|
|
11
12
|
usePrevious,
|
|
12
13
|
Collapsible,
|
|
13
14
|
useCollapsible,
|
|
15
|
+
} from '@docusaurus/theme-common';
|
|
16
|
+
import {
|
|
17
|
+
isActiveSidebarItem,
|
|
14
18
|
findFirstCategoryLink,
|
|
15
|
-
ThemeClassNames,
|
|
16
|
-
useThemeConfig,
|
|
17
19
|
useDocSidebarItemsExpandedState,
|
|
18
20
|
isSamePath,
|
|
19
|
-
} from '@docusaurus/theme-common';
|
|
21
|
+
} from '@docusaurus/theme-common/internal';
|
|
20
22
|
import Link from '@docusaurus/Link';
|
|
21
23
|
import {translate} from '@docusaurus/Translate';
|
|
22
24
|
import useIsBrowser from '@docusaurus/useIsBrowser';
|
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
-
import {
|
|
9
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
10
|
+
import {isActiveSidebarItem} from '@docusaurus/theme-common/internal';
|
|
10
11
|
import Link from '@docusaurus/Link';
|
|
11
12
|
import isInternalUrl from '@docusaurus/isInternalUrl';
|
|
12
|
-
import IconExternalLink from '@theme/
|
|
13
|
+
import IconExternalLink from '@theme/Icon/ExternalLink';
|
|
13
14
|
import styles from './styles.module.css';
|
|
14
15
|
export default function DocSidebarItemLink({
|
|
15
16
|
item,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React, {memo} from 'react';
|
|
8
|
-
import {DocSidebarItemsExpandedStateProvider} from '@docusaurus/theme-common';
|
|
8
|
+
import {DocSidebarItemsExpandedStateProvider} from '@docusaurus/theme-common/internal';
|
|
9
9
|
import DocSidebarItem from '@theme/DocSidebarItem';
|
|
10
10
|
// TODO this item should probably not receive the "activePath" props
|
|
11
11
|
// TODO this triggers whole sidebar re-renders on navigation
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import Translate from '@docusaurus/Translate';
|
|
10
|
-
import {ThemeClassNames
|
|
10
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
11
|
+
import {useDocsVersion} from '@docusaurus/theme-common/internal';
|
|
11
12
|
export default function DocVersionBadge({className}) {
|
|
12
13
|
const versionMetadata = useDocsVersion();
|
|
13
14
|
if (versionMetadata.badge) {
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
useActivePlugin,
|
|
14
14
|
useDocVersionSuggestions,
|
|
15
15
|
} from '@docusaurus/plugin-content-docs/client';
|
|
16
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
16
17
|
import {
|
|
17
|
-
ThemeClassNames,
|
|
18
18
|
useDocsPreferredVersion,
|
|
19
19
|
useDocsVersion,
|
|
20
|
-
} from '@docusaurus/theme-common';
|
|
20
|
+
} from '@docusaurus/theme-common/internal';
|
|
21
21
|
function UnreleasedVersionLabel({siteTitle, versionMetadata}) {
|
|
22
22
|
return (
|
|
23
23
|
<Translate
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import Translate from '@docusaurus/Translate';
|
|
9
9
|
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
10
|
-
import IconEdit from '@theme/
|
|
10
|
+
import IconEdit from '@theme/Icon/Edit';
|
|
11
11
|
export default function EditThisPage({editUrl}) {
|
|
12
12
|
return (
|
|
13
13
|
<a
|
|
@@ -8,7 +8,7 @@ import React from 'react';
|
|
|
8
8
|
import Link from '@docusaurus/Link';
|
|
9
9
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
10
10
|
import isInternalUrl from '@docusaurus/isInternalUrl';
|
|
11
|
-
import IconExternalLink from '@theme/
|
|
11
|
+
import IconExternalLink from '@theme/Icon/ExternalLink';
|
|
12
12
|
export default function FooterLinkItem({item}) {
|
|
13
13
|
const {to, href, label, prependBaseUrlToHref, ...props} = item;
|
|
14
14
|
const toUrl = useBaseUrl(to);
|
|
@@ -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
|
+
import clsx from 'clsx';
|
|
8
9
|
import Link from '@docusaurus/Link';
|
|
9
10
|
import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
|
|
10
11
|
import ThemedImage from '@theme/ThemedImage';
|
|
@@ -17,17 +18,21 @@ function LogoImage({logo}) {
|
|
|
17
18
|
};
|
|
18
19
|
return (
|
|
19
20
|
<ThemedImage
|
|
20
|
-
className=
|
|
21
|
+
className={clsx('footer__logo', logo.className)}
|
|
21
22
|
alt={logo.alt}
|
|
22
23
|
sources={sources}
|
|
23
24
|
width={logo.width}
|
|
24
25
|
height={logo.height}
|
|
26
|
+
style={logo.style}
|
|
25
27
|
/>
|
|
26
28
|
);
|
|
27
29
|
}
|
|
28
30
|
export default function FooterLogo({logo}) {
|
|
29
31
|
return logo.href ? (
|
|
30
|
-
<Link
|
|
32
|
+
<Link
|
|
33
|
+
href={logo.href}
|
|
34
|
+
className={styles.footerLogoLink}
|
|
35
|
+
target={logo.target}>
|
|
31
36
|
<LogoImage logo={logo} />
|
|
32
37
|
</Link>
|
|
33
38
|
) : (
|
|
File without changes
|
|
@@ -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/
|
|
8
|
+
import type { Props } from '@theme/Icon/Close';
|
|
9
9
|
export default function IconClose({ width, height, color, strokeWidth, className, ...restProps }: Props): JSX.Element;
|
|
File without changes
|
|
File without changes
|
|
@@ -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/
|
|
8
|
+
import type { Props } from '@theme/Icon/Edit';
|
|
9
9
|
export default function IconEdit({ className, ...restProps }: Props): JSX.Element;
|
|
File without changes
|
|
File without changes
|
|
@@ -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/
|
|
8
|
+
import type { Props } from '@theme/Icon/ExternalLink';
|
|
9
9
|
export default function IconExternalLink({ width, height, }: Props): JSX.Element;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -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/
|
|
8
|
+
import type { Props } from '@theme/Icon/Language';
|
|
9
9
|
export default function IconLanguage({ width, height, ...props }: Props): JSX.Element;
|
|
File without changes
|
|
@@ -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/
|
|
8
|
+
import type { Props } from '@theme/Icon/LightMode';
|
|
9
9
|
export default function IconLightMode(props: Props): JSX.Element;
|
|
File without changes
|
|
@@ -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/
|
|
8
|
+
import type { Props } from '@theme/Icon/Menu';
|
|
9
9
|
export default function IconMenu({ width, height, className, ...restProps }: Props): JSX.Element;
|
|
File without changes
|
|
@@ -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/Layout/Provider';
|
|
9
|
+
export default function LayoutProvider({ children }: Props): JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
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 {composeProviders} from '@docusaurus/theme-common';
|
|
9
|
+
import {
|
|
10
|
+
ColorModeProvider,
|
|
11
|
+
TabGroupChoiceProvider,
|
|
12
|
+
AnnouncementBarProvider,
|
|
13
|
+
DocsPreferredVersionContextProvider,
|
|
14
|
+
ScrollControllerProvider,
|
|
15
|
+
NavbarProvider,
|
|
16
|
+
PluginHtmlClassNameProvider,
|
|
17
|
+
} from '@docusaurus/theme-common/internal';
|
|
18
|
+
const Provider = composeProviders([
|
|
19
|
+
ColorModeProvider,
|
|
20
|
+
AnnouncementBarProvider,
|
|
21
|
+
TabGroupChoiceProvider,
|
|
22
|
+
ScrollControllerProvider,
|
|
23
|
+
DocsPreferredVersionContextProvider,
|
|
24
|
+
PluginHtmlClassNameProvider,
|
|
25
|
+
NavbarProvider,
|
|
26
|
+
]);
|
|
27
|
+
export default function LayoutProvider({children}) {
|
|
28
|
+
return <Provider>{children}</Provider>;
|
|
29
|
+
}
|
|
@@ -7,18 +7,15 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import ErrorBoundary from '@docusaurus/ErrorBoundary';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
ThemeClassNames,
|
|
13
|
-
useKeyboardNavigation,
|
|
14
|
-
} from '@docusaurus/theme-common';
|
|
10
|
+
import {PageMetadata, ThemeClassNames} from '@docusaurus/theme-common';
|
|
11
|
+
import {useKeyboardNavigation} from '@docusaurus/theme-common/internal';
|
|
15
12
|
import SkipToContent from '@theme/SkipToContent';
|
|
16
13
|
import AnnouncementBar from '@theme/AnnouncementBar';
|
|
17
14
|
import Navbar from '@theme/Navbar';
|
|
18
15
|
import Footer from '@theme/Footer';
|
|
19
|
-
import
|
|
16
|
+
import LayoutProvider from '@theme/Layout/Provider';
|
|
20
17
|
import ErrorPageContent from '@theme/ErrorPageContent';
|
|
21
|
-
import './styles.css';
|
|
18
|
+
import styles from './styles.module.css';
|
|
22
19
|
export default function Layout(props) {
|
|
23
20
|
const {
|
|
24
21
|
children,
|
|
@@ -30,7 +27,7 @@ export default function Layout(props) {
|
|
|
30
27
|
} = props;
|
|
31
28
|
useKeyboardNavigation();
|
|
32
29
|
return (
|
|
33
|
-
<
|
|
30
|
+
<LayoutProvider>
|
|
34
31
|
<PageMetadata title={title} description={description} />
|
|
35
32
|
|
|
36
33
|
<SkipToContent />
|
|
@@ -39,13 +36,18 @@ export default function Layout(props) {
|
|
|
39
36
|
|
|
40
37
|
<Navbar />
|
|
41
38
|
|
|
42
|
-
<div
|
|
39
|
+
<div
|
|
40
|
+
className={clsx(
|
|
41
|
+
ThemeClassNames.wrapper.main,
|
|
42
|
+
styles.mainWrapper,
|
|
43
|
+
wrapperClassName,
|
|
44
|
+
)}>
|
|
43
45
|
<ErrorBoundary fallback={(params) => <ErrorPageContent {...params} />}>
|
|
44
46
|
{children}
|
|
45
47
|
</ErrorBoundary>
|
|
46
48
|
</div>
|
|
47
49
|
|
|
48
50
|
{!noFooter && <Footer />}
|
|
49
|
-
</
|
|
51
|
+
</LayoutProvider>
|
|
50
52
|
);
|
|
51
53
|
}
|
|
@@ -5,23 +5,21 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
html,
|
|
9
|
-
body {
|
|
8
|
+
:global(html, body) {
|
|
10
9
|
height: 100%;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
min-height: 100%;
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.main-wrapper {
|
|
12
|
+
.mainWrapper {
|
|
20
13
|
flex: 1 0 auto;
|
|
21
14
|
}
|
|
22
15
|
|
|
23
|
-
/* Docusaurus-specific utility
|
|
24
|
-
|
|
25
|
-
.docusaurus-mt-lg {
|
|
16
|
+
/* Docusaurus-specific utility class */
|
|
17
|
+
:global(.docusaurus-mt-lg) {
|
|
26
18
|
margin-top: 3rem;
|
|
27
19
|
}
|
|
20
|
+
|
|
21
|
+
:global(#__docusaurus) {
|
|
22
|
+
min-height: 100%;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
}
|