@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
|
@@ -8,16 +8,18 @@
|
|
|
8
8
|
import React, {type ComponentProps, useEffect, useMemo} from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import {
|
|
11
|
-
|
|
11
|
+
ThemeClassNames,
|
|
12
|
+
useThemeConfig,
|
|
12
13
|
usePrevious,
|
|
13
14
|
Collapsible,
|
|
14
15
|
useCollapsible,
|
|
16
|
+
} from '@docusaurus/theme-common';
|
|
17
|
+
import {
|
|
18
|
+
isActiveSidebarItem,
|
|
15
19
|
findFirstCategoryLink,
|
|
16
|
-
ThemeClassNames,
|
|
17
|
-
useThemeConfig,
|
|
18
20
|
useDocSidebarItemsExpandedState,
|
|
19
21
|
isSamePath,
|
|
20
|
-
} from '@docusaurus/theme-common';
|
|
22
|
+
} from '@docusaurus/theme-common/internal';
|
|
21
23
|
import Link from '@docusaurus/Link';
|
|
22
24
|
import {translate} from '@docusaurus/Translate';
|
|
23
25
|
import useIsBrowser from '@docusaurus/useIsBrowser';
|
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {
|
|
10
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
11
|
+
import {isActiveSidebarItem} from '@docusaurus/theme-common/internal';
|
|
11
12
|
import Link from '@docusaurus/Link';
|
|
12
13
|
import isInternalUrl from '@docusaurus/isInternalUrl';
|
|
13
|
-
import IconExternalLink from '@theme/
|
|
14
|
+
import IconExternalLink from '@theme/Icon/ExternalLink';
|
|
14
15
|
import type {Props} from '@theme/DocSidebarItem/Link';
|
|
15
16
|
|
|
16
17
|
import styles from './styles.module.css';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React, {memo} from 'react';
|
|
9
|
-
import {DocSidebarItemsExpandedStateProvider} from '@docusaurus/theme-common';
|
|
9
|
+
import {DocSidebarItemsExpandedStateProvider} from '@docusaurus/theme-common/internal';
|
|
10
10
|
import DocSidebarItem from '@theme/DocSidebarItem';
|
|
11
11
|
|
|
12
12
|
import type {Props} from '@theme/DocSidebarItems';
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import Translate from '@docusaurus/Translate';
|
|
11
|
-
import {ThemeClassNames
|
|
11
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
12
|
+
import {useDocsVersion} from '@docusaurus/theme-common/internal';
|
|
12
13
|
import type {Props} from '@theme/DocVersionBadge';
|
|
13
14
|
|
|
14
15
|
export default function DocVersionBadge({
|
|
@@ -15,12 +15,11 @@ import {
|
|
|
15
15
|
useDocVersionSuggestions,
|
|
16
16
|
type GlobalVersion,
|
|
17
17
|
} from '@docusaurus/plugin-content-docs/client';
|
|
18
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
18
19
|
import {
|
|
19
|
-
ThemeClassNames,
|
|
20
20
|
useDocsPreferredVersion,
|
|
21
21
|
useDocsVersion,
|
|
22
|
-
} from '@docusaurus/theme-common';
|
|
23
|
-
|
|
22
|
+
} from '@docusaurus/theme-common/internal';
|
|
24
23
|
import type {Props} from '@theme/DocVersionBanner';
|
|
25
24
|
import type {
|
|
26
25
|
VersionBanner,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import Translate from '@docusaurus/Translate';
|
|
10
10
|
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
11
|
-
import IconEdit from '@theme/
|
|
11
|
+
import IconEdit from '@theme/Icon/Edit';
|
|
12
12
|
import type {Props} from '@theme/EditThisPage';
|
|
13
13
|
|
|
14
14
|
export default function EditThisPage({editUrl}: Props): JSX.Element {
|
|
@@ -10,7 +10,7 @@ import React from 'react';
|
|
|
10
10
|
import Link from '@docusaurus/Link';
|
|
11
11
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
12
12
|
import isInternalUrl from '@docusaurus/isInternalUrl';
|
|
13
|
-
import IconExternalLink from '@theme/
|
|
13
|
+
import IconExternalLink from '@theme/Icon/ExternalLink';
|
|
14
14
|
import type {Props} from '@theme/Footer/LinkItem';
|
|
15
15
|
|
|
16
16
|
export default function FooterLinkItem({item}: Props): JSX.Element {
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
9
10
|
import Link from '@docusaurus/Link';
|
|
10
11
|
import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
|
|
11
12
|
import ThemedImage from '@theme/ThemedImage';
|
|
@@ -21,18 +22,22 @@ function LogoImage({logo}: Props) {
|
|
|
21
22
|
};
|
|
22
23
|
return (
|
|
23
24
|
<ThemedImage
|
|
24
|
-
className=
|
|
25
|
+
className={clsx('footer__logo', logo.className)}
|
|
25
26
|
alt={logo.alt}
|
|
26
27
|
sources={sources}
|
|
27
28
|
width={logo.width}
|
|
28
29
|
height={logo.height}
|
|
30
|
+
style={logo.style}
|
|
29
31
|
/>
|
|
30
32
|
);
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
export default function FooterLogo({logo}: Props): JSX.Element {
|
|
34
36
|
return logo.href ? (
|
|
35
|
-
<Link
|
|
37
|
+
<Link
|
|
38
|
+
href={logo.href}
|
|
39
|
+
className={styles.footerLogoLink}
|
|
40
|
+
target={logo.target}>
|
|
36
41
|
<LogoImage logo={logo} />
|
|
37
42
|
</Link>
|
|
38
43
|
) : (
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
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 {composeProviders} from '@docusaurus/theme-common';
|
|
10
|
+
import {
|
|
11
|
+
ColorModeProvider,
|
|
12
|
+
TabGroupChoiceProvider,
|
|
13
|
+
AnnouncementBarProvider,
|
|
14
|
+
DocsPreferredVersionContextProvider,
|
|
15
|
+
ScrollControllerProvider,
|
|
16
|
+
NavbarProvider,
|
|
17
|
+
PluginHtmlClassNameProvider,
|
|
18
|
+
} from '@docusaurus/theme-common/internal';
|
|
19
|
+
import type {Props} from '@theme/Layout/Provider';
|
|
20
|
+
|
|
21
|
+
const Provider = composeProviders([
|
|
22
|
+
ColorModeProvider,
|
|
23
|
+
AnnouncementBarProvider,
|
|
24
|
+
TabGroupChoiceProvider,
|
|
25
|
+
ScrollControllerProvider,
|
|
26
|
+
DocsPreferredVersionContextProvider,
|
|
27
|
+
PluginHtmlClassNameProvider,
|
|
28
|
+
NavbarProvider,
|
|
29
|
+
]);
|
|
30
|
+
|
|
31
|
+
export default function LayoutProvider({children}: Props): JSX.Element {
|
|
32
|
+
return <Provider>{children}</Provider>;
|
|
33
|
+
}
|
|
@@ -8,19 +8,16 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import ErrorBoundary from '@docusaurus/ErrorBoundary';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
ThemeClassNames,
|
|
14
|
-
useKeyboardNavigation,
|
|
15
|
-
} from '@docusaurus/theme-common';
|
|
11
|
+
import {PageMetadata, ThemeClassNames} from '@docusaurus/theme-common';
|
|
12
|
+
import {useKeyboardNavigation} from '@docusaurus/theme-common/internal';
|
|
16
13
|
import SkipToContent from '@theme/SkipToContent';
|
|
17
14
|
import AnnouncementBar from '@theme/AnnouncementBar';
|
|
18
15
|
import Navbar from '@theme/Navbar';
|
|
19
16
|
import Footer from '@theme/Footer';
|
|
20
|
-
import
|
|
17
|
+
import LayoutProvider from '@theme/Layout/Provider';
|
|
21
18
|
import ErrorPageContent from '@theme/ErrorPageContent';
|
|
22
|
-
import './styles.css';
|
|
23
19
|
import type {Props} from '@theme/Layout';
|
|
20
|
+
import styles from './styles.module.css';
|
|
24
21
|
|
|
25
22
|
export default function Layout(props: Props): JSX.Element {
|
|
26
23
|
const {
|
|
@@ -35,7 +32,7 @@ export default function Layout(props: Props): JSX.Element {
|
|
|
35
32
|
useKeyboardNavigation();
|
|
36
33
|
|
|
37
34
|
return (
|
|
38
|
-
<
|
|
35
|
+
<LayoutProvider>
|
|
39
36
|
<PageMetadata title={title} description={description} />
|
|
40
37
|
|
|
41
38
|
<SkipToContent />
|
|
@@ -44,13 +41,18 @@ export default function Layout(props: Props): JSX.Element {
|
|
|
44
41
|
|
|
45
42
|
<Navbar />
|
|
46
43
|
|
|
47
|
-
<div
|
|
44
|
+
<div
|
|
45
|
+
className={clsx(
|
|
46
|
+
ThemeClassNames.wrapper.main,
|
|
47
|
+
styles.mainWrapper,
|
|
48
|
+
wrapperClassName,
|
|
49
|
+
)}>
|
|
48
50
|
<ErrorBoundary fallback={(params) => <ErrorPageContent {...params} />}>
|
|
49
51
|
{children}
|
|
50
52
|
</ErrorBoundary>
|
|
51
53
|
</div>
|
|
52
54
|
|
|
53
55
|
{!noFooter && <Footer />}
|
|
54
|
-
</
|
|
56
|
+
</LayoutProvider>
|
|
55
57
|
);
|
|
56
58
|
}
|
|
@@ -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
|
+
}
|
package/src/theme/Logo/index.tsx
CHANGED
|
@@ -9,44 +9,74 @@ import React from 'react';
|
|
|
9
9
|
import Link from '@docusaurus/Link';
|
|
10
10
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
11
11
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
12
|
-
import {useThemeConfig} from '@docusaurus/theme-common';
|
|
12
|
+
import {useThemeConfig, type NavbarLogo} from '@docusaurus/theme-common';
|
|
13
13
|
import ThemedImage from '@theme/ThemedImage';
|
|
14
14
|
import type {Props} from '@theme/Logo';
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const logoLink = useBaseUrl(logo.href || '/');
|
|
16
|
+
function LogoThemedImage({
|
|
17
|
+
logo,
|
|
18
|
+
alt,
|
|
19
|
+
imageClassName,
|
|
20
|
+
}: {
|
|
21
|
+
logo: NavbarLogo;
|
|
22
|
+
alt: string;
|
|
23
|
+
imageClassName?: string;
|
|
24
|
+
}) {
|
|
26
25
|
const sources = {
|
|
27
26
|
light: useBaseUrl(logo.src),
|
|
28
27
|
dark: useBaseUrl(logo.srcDark || logo.src),
|
|
29
28
|
};
|
|
30
29
|
const themedImage = (
|
|
31
30
|
<ThemedImage
|
|
31
|
+
className={logo.className}
|
|
32
32
|
sources={sources}
|
|
33
33
|
height={logo.height}
|
|
34
34
|
width={logo.width}
|
|
35
|
-
alt={
|
|
35
|
+
alt={alt}
|
|
36
|
+
style={logo.style}
|
|
36
37
|
/>
|
|
37
38
|
);
|
|
38
39
|
|
|
40
|
+
// Is this extra div really necessary?
|
|
41
|
+
// introduced in https://github.com/facebook/docusaurus/pull/5666
|
|
42
|
+
return imageClassName ? (
|
|
43
|
+
<div className={imageClassName}>{themedImage}</div>
|
|
44
|
+
) : (
|
|
45
|
+
themedImage
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default function Logo(props: Props): JSX.Element {
|
|
50
|
+
const {
|
|
51
|
+
siteConfig: {title},
|
|
52
|
+
} = useDocusaurusContext();
|
|
53
|
+
const {
|
|
54
|
+
navbar: {title: navbarTitle, logo},
|
|
55
|
+
} = useThemeConfig();
|
|
56
|
+
|
|
57
|
+
const {imageClassName, titleClassName, ...propsRest} = props;
|
|
58
|
+
const logoLink = useBaseUrl(logo?.href || '/');
|
|
59
|
+
|
|
60
|
+
// If visible title is shown, fallback alt text should be
|
|
61
|
+
// an empty string to mark the logo as decorative.
|
|
62
|
+
const fallbackAlt = navbarTitle ? '' : title;
|
|
63
|
+
|
|
64
|
+
// Use logo alt text if provided (including empty string),
|
|
65
|
+
// and provide a sensible fallback otherwise.
|
|
66
|
+
const alt = logo?.alt ?? fallbackAlt;
|
|
67
|
+
|
|
39
68
|
return (
|
|
40
69
|
<Link
|
|
41
70
|
to={logoLink}
|
|
42
71
|
{...propsRest}
|
|
43
|
-
{...(logo
|
|
44
|
-
{logo
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
72
|
+
{...(logo?.target && {target: logo.target})}>
|
|
73
|
+
{logo && (
|
|
74
|
+
<LogoThemedImage
|
|
75
|
+
logo={logo}
|
|
76
|
+
alt={alt}
|
|
77
|
+
imageClassName={imageClassName}
|
|
78
|
+
/>
|
|
79
|
+
)}
|
|
50
80
|
{navbarTitle != null && <b className={titleClassName}>{navbarTitle}</b>}
|
|
51
81
|
</Link>
|
|
52
82
|
);
|
|
@@ -11,7 +11,7 @@ import CodeBlock from '@theme/CodeBlock';
|
|
|
11
11
|
import type {Props} from '@theme/MDXComponents/Code';
|
|
12
12
|
|
|
13
13
|
export default function MDXCode(props: Props): JSX.Element {
|
|
14
|
-
const inlineElements = [
|
|
14
|
+
const inlineElements: (string | undefined)[] = [
|
|
15
15
|
'a',
|
|
16
16
|
'b',
|
|
17
17
|
'big',
|
|
@@ -26,7 +26,10 @@ export default function MDXCode(props: Props): JSX.Element {
|
|
|
26
26
|
const shouldBeInline = React.Children.toArray(props.children).every(
|
|
27
27
|
(el) =>
|
|
28
28
|
(typeof el === 'string' && !el.includes('\n')) ||
|
|
29
|
-
(isValidElement(el) &&
|
|
29
|
+
(isValidElement(el) &&
|
|
30
|
+
inlineElements.includes(
|
|
31
|
+
(el.props as {mdxType: string} | null)?.mdxType,
|
|
32
|
+
)),
|
|
30
33
|
);
|
|
31
34
|
|
|
32
35
|
return shouldBeInline ? (
|
|
@@ -15,7 +15,8 @@ export default function MDXDetails(props: Props): JSX.Element {
|
|
|
15
15
|
// Details theme component
|
|
16
16
|
const summary = items.find(
|
|
17
17
|
(item): item is ReactElement<ComponentProps<'summary'>> =>
|
|
18
|
-
React.isValidElement(item) &&
|
|
18
|
+
React.isValidElement(item) &&
|
|
19
|
+
(item.props as {mdxType: string} | null)?.mdxType === 'summary',
|
|
19
20
|
);
|
|
20
21
|
const children = <>{items.filter((item) => item !== summary)}</>;
|
|
21
22
|
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import React, {type ReactElement
|
|
9
|
-
import Head from '@docusaurus/Head';
|
|
8
|
+
import React, {type ReactElement} from 'react';
|
|
9
|
+
import Head, {type Props as HeadProps} from '@docusaurus/Head';
|
|
10
10
|
import type {Props} from '@theme/MDXComponents/Head';
|
|
11
11
|
|
|
12
12
|
// MDX elements are wrapped through the MDX pragma. In some cases (notably usage
|
|
@@ -25,7 +25,5 @@ export default function MDXHead(props: Props): JSX.Element {
|
|
|
25
25
|
const unwrappedChildren = React.Children.map(props.children, (child) =>
|
|
26
26
|
React.isValidElement(child) ? unwrapMDXElement(child) : child,
|
|
27
27
|
);
|
|
28
|
-
return (
|
|
29
|
-
<Head {...(props as ComponentProps<typeof Head>)}>{unwrappedChildren}</Head>
|
|
30
|
-
);
|
|
28
|
+
return <Head {...(props as HeadProps)}>{unwrappedChildren}</Head>;
|
|
31
29
|
}
|
|
@@ -14,7 +14,8 @@ export default function MDXPre(props: Props): JSX.Element {
|
|
|
14
14
|
<CodeBlock
|
|
15
15
|
// If this pre is created by a ``` fenced codeblock, unwrap the children
|
|
16
16
|
{...(isValidElement(props.children) &&
|
|
17
|
-
props.children.props?.originalType ===
|
|
17
|
+
(props.children.props as {originalType: string} | null)?.originalType ===
|
|
18
|
+
'code'
|
|
18
19
|
? props.children.props
|
|
19
20
|
: {...props})}
|
|
20
21
|
/>
|
|
@@ -14,6 +14,7 @@ import MDXDetails from '@theme/MDXComponents/Details';
|
|
|
14
14
|
import MDXHeading from '@theme/MDXComponents/Heading';
|
|
15
15
|
import MDXUl from '@theme/MDXComponents/Ul';
|
|
16
16
|
import MDXImg from '@theme/MDXComponents/Img';
|
|
17
|
+
import Admonition from '@theme/Admonition';
|
|
17
18
|
|
|
18
19
|
import type {MDXComponentsObject} from '@theme/MDXComponents';
|
|
19
20
|
|
|
@@ -31,6 +32,7 @@ const MDXComponents: MDXComponentsObject = {
|
|
|
31
32
|
h4: (props) => <MDXHeading as="h4" {...props} />,
|
|
32
33
|
h5: (props) => <MDXHeading as="h5" {...props} />,
|
|
33
34
|
h6: (props) => <MDXHeading as="h6" {...props} />,
|
|
35
|
+
admonition: Admonition,
|
|
34
36
|
};
|
|
35
37
|
|
|
36
38
|
export default MDXComponents;
|
|
@@ -38,11 +38,13 @@ export default function MDXPage(props: Props): JSX.Element {
|
|
|
38
38
|
<main className="container container--fluid margin-vert--lg">
|
|
39
39
|
<div className={clsx('row', styles.mdxPageWrapper)}>
|
|
40
40
|
<div className={clsx('col', !hideTableOfContents && 'col--8')}>
|
|
41
|
-
<
|
|
42
|
-
<
|
|
43
|
-
|
|
41
|
+
<article>
|
|
42
|
+
<MDXContent>
|
|
43
|
+
<MDXPageContent />
|
|
44
|
+
</MDXContent>
|
|
45
|
+
</article>
|
|
44
46
|
</div>
|
|
45
|
-
{!hideTableOfContents && MDXPageContent.toc && (
|
|
47
|
+
{!hideTableOfContents && MDXPageContent.toc.length > 0 && (
|
|
46
48
|
<div className="col col--2">
|
|
47
49
|
<TOC
|
|
48
50
|
toc={MDXPageContent.toc}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React, {type ReactNode} from 'react';
|
|
9
|
+
import {useThemeConfig} from '@docusaurus/theme-common';
|
|
9
10
|
import {
|
|
10
11
|
splitNavbarItems,
|
|
11
12
|
useNavbarMobileSidebar,
|
|
12
|
-
|
|
13
|
-
} from '@docusaurus/theme-common';
|
|
13
|
+
} from '@docusaurus/theme-common/internal';
|
|
14
14
|
import NavbarItem, {type Props as NavbarItemConfig} from '@theme/NavbarItem';
|
|
15
15
|
import NavbarColorModeToggle from '@theme/Navbar/ColorModeToggle';
|
|
16
16
|
import SearchBar from '@theme/SearchBar';
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
import React, {type ComponentProps} from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
+
import {useThemeConfig} from '@docusaurus/theme-common';
|
|
10
11
|
import {
|
|
11
|
-
useThemeConfig,
|
|
12
12
|
useHideableNavbar,
|
|
13
13
|
useNavbarMobileSidebar,
|
|
14
|
-
} from '@docusaurus/theme-common';
|
|
14
|
+
} from '@docusaurus/theme-common/internal';
|
|
15
15
|
import NavbarMobileSidebar from '@theme/Navbar/MobileSidebar';
|
|
16
16
|
import type {Props} from '@theme/Navbar/Layout';
|
|
17
17
|
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import {useNavbarMobileSidebar} from '@docusaurus/theme-common';
|
|
9
|
+
import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal';
|
|
10
10
|
import NavbarColorModeToggle from '@theme/Navbar/ColorModeToggle';
|
|
11
|
-
import IconClose from '@theme/
|
|
11
|
+
import IconClose from '@theme/Icon/Close';
|
|
12
12
|
import NavbarLogo from '@theme/Navbar/Logo';
|
|
13
13
|
|
|
14
14
|
function CloseButton() {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {useNavbarSecondaryMenu} from '@docusaurus/theme-common';
|
|
10
|
+
import {useNavbarSecondaryMenu} from '@docusaurus/theme-common/internal';
|
|
11
11
|
import type {Props} from '@theme/Navbar/MobileSidebar/Layout';
|
|
12
12
|
|
|
13
13
|
export default function NavbarMobileSidebarLayout({
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import {
|
|
9
|
+
import {useThemeConfig} from '@docusaurus/theme-common';
|
|
10
|
+
import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal';
|
|
10
11
|
import NavbarItem, {type Props as NavbarItemConfig} from '@theme/NavbarItem';
|
|
11
12
|
|
|
12
13
|
function useNavbarItems() {
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React, {type ComponentProps} from 'react';
|
|
9
|
-
import {
|
|
9
|
+
import {useThemeConfig} from '@docusaurus/theme-common';
|
|
10
|
+
import {useNavbarSecondaryMenu} from '@docusaurus/theme-common/internal';
|
|
10
11
|
import Translate from '@docusaurus/Translate';
|
|
11
12
|
|
|
12
13
|
function SecondaryMenuBackButton(props: ComponentProps<'button'>) {
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import {useNavbarMobileSidebar} from '@docusaurus/theme-common';
|
|
10
|
-
import IconMenu from '@theme/
|
|
9
|
+
import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal';
|
|
10
|
+
import IconMenu from '@theme/Icon/Menu';
|
|
11
11
|
|
|
12
12
|
export default function MobileSidebarToggle(): JSX.Element {
|
|
13
13
|
const mobileSidebar = useNavbarMobileSidebar();
|
|
@@ -9,7 +9,7 @@ import React from 'react';
|
|
|
9
9
|
import {
|
|
10
10
|
useLockBodyScroll,
|
|
11
11
|
useNavbarMobileSidebar,
|
|
12
|
-
} from '@docusaurus/theme-common';
|
|
12
|
+
} from '@docusaurus/theme-common/internal';
|
|
13
13
|
import NavbarMobileSidebarLayout from '@theme/Navbar/MobileSidebar/Layout';
|
|
14
14
|
import NavbarMobileSidebarHeader from '@theme/Navbar/MobileSidebar/Header';
|
|
15
15
|
import NavbarMobileSidebarPrimaryMenu from '@theme/Navbar/MobileSidebar/PrimaryMenu';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import {useActiveDocContext} from '@docusaurus/plugin-content-docs/client';
|
|
10
|
-
import {useLayoutDoc} from '@docusaurus/theme-common';
|
|
10
|
+
import {useLayoutDoc} from '@docusaurus/theme-common/internal';
|
|
11
11
|
import DefaultNavbarItem from '@theme/NavbarItem/DefaultNavbarItem';
|
|
12
12
|
import type {Props} from '@theme/NavbarItem/DocNavbarItem';
|
|
13
13
|
|