@seqera/docusaurus-theme-seqera 1.0.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/README.md +26 -0
- package/package.json +66 -0
- package/src/getSwizzleConfig.ts +433 -0
- package/src/index.ts +154 -0
- package/src/inlineScripts.ts +95 -0
- package/src/inlineSvgSprites.ts +7 -0
- package/src/main-styles.css +322 -0
- package/src/nprogress.css +36 -0
- package/src/nprogress.ts +27 -0
- package/src/options.ts +503 -0
- package/src/prism-include-languages.ts +6 -0
- package/src/styles/api.css +42 -0
- package/src/styles/typography.css +342 -0
- package/src/theme/Admonition/Icon/Danger.tsx +15 -0
- package/src/theme/Admonition/Icon/Info.tsx +15 -0
- package/src/theme/Admonition/Icon/Note.tsx +15 -0
- package/src/theme/Admonition/Icon/Tip.tsx +15 -0
- package/src/theme/Admonition/Icon/Warning.tsx +15 -0
- package/src/theme/Admonition/Layout/index.tsx +53 -0
- package/src/theme/Admonition/Layout/styles.module.css +39 -0
- package/src/theme/Admonition/Type/Caution.tsx +34 -0
- package/src/theme/Admonition/Type/Danger.tsx +32 -0
- package/src/theme/Admonition/Type/Info.tsx +32 -0
- package/src/theme/Admonition/Type/Note.tsx +32 -0
- package/src/theme/Admonition/Type/Tip.tsx +32 -0
- package/src/theme/Admonition/Type/Warning.tsx +32 -0
- package/src/theme/Admonition/Types.tsx +33 -0
- package/src/theme/Admonition/index.tsx +23 -0
- package/src/theme/AdmonitionVersioned/AddedInVersion.tsx +14 -0
- package/src/theme/AdmonitionVersioned/AdmonitionVersioned.tsx +66 -0
- package/src/theme/AdmonitionVersioned/ChangedInVersion.tsx +14 -0
- package/src/theme/AdmonitionVersioned/DeprecatedInVersion.tsx +15 -0
- package/src/theme/AdmonitionVersioned/getStableVersion.ts +30 -0
- package/src/theme/AdmonitionVersioned/index.ts +1 -0
- package/src/theme/AdmonitionVersioned/stableVersions.ts +119 -0
- package/src/theme/AnnouncementBar/CloseButton/index.tsx +24 -0
- package/src/theme/AnnouncementBar/CloseButton/styles.module.css +6 -0
- package/src/theme/AnnouncementBar/Content/index.tsx +21 -0
- package/src/theme/AnnouncementBar/Content/styles.module.css +12 -0
- package/src/theme/AnnouncementBar/index.tsx +37 -0
- package/src/theme/AnnouncementBar/styles.module.css +57 -0
- package/src/theme/BackToTopButton/index.tsx +30 -0
- package/src/theme/BackToTopButton/styles.module.css +39 -0
- package/src/theme/Blog/Components/Author/Socials/index.tsx +75 -0
- package/src/theme/Blog/Components/Author/Socials/styles.module.css +34 -0
- package/src/theme/Blog/Components/Author/index.tsx +98 -0
- package/src/theme/Blog/Components/Author/styles.module.css +69 -0
- package/src/theme/Blog/Pages/BlogAuthorsListPage/index.tsx +57 -0
- package/src/theme/Blog/Pages/BlogAuthorsListPage/styles.module.css +6 -0
- package/src/theme/Blog/Pages/BlogAuthorsPostsPage/index.tsx +77 -0
- package/src/theme/BlogArchivePage/index.tsx +102 -0
- package/src/theme/BlogLayout/index.tsx +31 -0
- package/src/theme/BlogListPage/StructuredData/index.tsx +17 -0
- package/src/theme/BlogListPage/index.tsx +57 -0
- package/src/theme/BlogListPaginator/index.tsx +47 -0
- package/src/theme/BlogPostItem/Container/index.tsx +11 -0
- package/src/theme/BlogPostItem/Content/index.tsx +23 -0
- package/src/theme/BlogPostItem/Footer/ReadMoreLink/index.tsx +39 -0
- package/src/theme/BlogPostItem/Footer/index.tsx +85 -0
- package/src/theme/BlogPostItem/Header/Authors/index.tsx +49 -0
- package/src/theme/BlogPostItem/Header/Authors/styles.module.css +15 -0
- package/src/theme/BlogPostItem/Header/Info/index.tsx +77 -0
- package/src/theme/BlogPostItem/Header/Info/styles.module.css +5 -0
- package/src/theme/BlogPostItem/Header/Title/index.tsx +20 -0
- package/src/theme/BlogPostItem/Header/Title/styles.module.css +14 -0
- package/src/theme/BlogPostItem/Header/index.tsx +16 -0
- package/src/theme/BlogPostItem/index.tsx +27 -0
- package/src/theme/BlogPostItems/index.tsx +25 -0
- package/src/theme/BlogPostPage/Metadata/index.tsx +39 -0
- package/src/theme/BlogPostPage/StructuredData/index.tsx +16 -0
- package/src/theme/BlogPostPage/index.tsx +74 -0
- package/src/theme/BlogPostPaginator/index.tsx +46 -0
- package/src/theme/BlogSidebar/Content/index.tsx +52 -0
- package/src/theme/BlogSidebar/Desktop/index.tsx +52 -0
- package/src/theme/BlogSidebar/Desktop/styles.module.css +46 -0
- package/src/theme/BlogSidebar/Mobile/index.tsx +47 -0
- package/src/theme/BlogSidebar/Mobile/styles.module.css +5 -0
- package/src/theme/BlogSidebar/index.tsx +19 -0
- package/src/theme/BlogTagsListPage/index.tsx +33 -0
- package/src/theme/BlogTagsPostsPage/index.tsx +68 -0
- package/src/theme/CodeBlock/Buttons/Button/index.tsx +14 -0
- package/src/theme/CodeBlock/Buttons/CopyButton/index.tsx +82 -0
- package/src/theme/CodeBlock/Buttons/CopyButton/styles.module.css +42 -0
- package/src/theme/CodeBlock/Buttons/WordWrapButton/index.tsx +40 -0
- package/src/theme/CodeBlock/Buttons/WordWrapButton/styles.module.css +10 -0
- package/src/theme/CodeBlock/Buttons/index.tsx +27 -0
- package/src/theme/CodeBlock/Buttons/styles.module.css +32 -0
- package/src/theme/CodeBlock/Container/index.tsx +27 -0
- package/src/theme/CodeBlock/Container/styles.module.css +9 -0
- package/src/theme/CodeBlock/Content/Element.tsx +24 -0
- package/src/theme/CodeBlock/Content/String.tsx +37 -0
- package/src/theme/CodeBlock/Content/index.tsx +79 -0
- package/src/theme/CodeBlock/Content/styles.module.css +30 -0
- package/src/theme/CodeBlock/Layout/index.tsx +29 -0
- package/src/theme/CodeBlock/Layout/styles.module.css +22 -0
- package/src/theme/CodeBlock/Line/Token/index.tsx +13 -0
- package/src/theme/CodeBlock/Line/index.tsx +61 -0
- package/src/theme/CodeBlock/Line/styles.module.css +47 -0
- package/src/theme/CodeBlock/Title/index.tsx +10 -0
- package/src/theme/CodeBlock/index.tsx +40 -0
- package/src/theme/CodeInline/index.tsx +11 -0
- package/src/theme/ColorModeToggle/index.tsx +140 -0
- package/src/theme/ColorModeToggle/styles.module.css +35 -0
- package/src/theme/ContentVisibility/Draft/index.tsx +22 -0
- package/src/theme/ContentVisibility/Unlisted/index.tsx +37 -0
- package/src/theme/ContentVisibility/index.tsx +20 -0
- package/src/theme/Details/index.tsx +21 -0
- package/src/theme/Details/styles.module.css +8 -0
- package/src/theme/DocBreadcrumbs/Items/Home/index.tsx +29 -0
- package/src/theme/DocBreadcrumbs/Items/Home/styles.module.css +9 -0
- package/src/theme/DocBreadcrumbs/StructuredData/index.tsx +19 -0
- package/src/theme/DocBreadcrumbs/index.tsx +98 -0
- package/src/theme/DocBreadcrumbs/styles.module.css +14 -0
- package/src/theme/DocCard/index.tsx +133 -0
- package/src/theme/DocCard/styles.module.css +29 -0
- package/src/theme/DocCardList/index.tsx +43 -0
- package/src/theme/DocCardList/styles.module.css +9 -0
- package/src/theme/DocCategoryGeneratedIndexPage/index.tsx +68 -0
- package/src/theme/DocCategoryGeneratedIndexPage/styles.module.css +13 -0
- package/src/theme/DocItem/Content/index.tsx +43 -0
- package/src/theme/DocItem/Footer/index.tsx +51 -0
- package/src/theme/DocItem/Layout/index.tsx +66 -0
- package/src/theme/DocItem/Layout/styles.module.css +12 -0
- package/src/theme/DocItem/Metadata/index.tsx +17 -0
- package/src/theme/DocItem/Paginator/index.tsx +20 -0
- package/src/theme/DocItem/TOC/Desktop/index.tsx +19 -0
- package/src/theme/DocItem/TOC/Mobile/index.tsx +22 -0
- package/src/theme/DocItem/TOC/Mobile/styles.module.css +26 -0
- package/src/theme/DocItem/index.tsx +23 -0
- package/src/theme/DocPaginator/index.tsx +46 -0
- package/src/theme/DocRoot/Layout/Main/index.tsx +31 -0
- package/src/theme/DocRoot/Layout/Main/styles.module.css +23 -0
- package/src/theme/DocRoot/Layout/Sidebar/ExpandButton/index.tsx +36 -0
- package/src/theme/DocRoot/Layout/Sidebar/ExpandButton/styles.module.css +29 -0
- package/src/theme/DocRoot/Layout/Sidebar/index.tsx +79 -0
- package/src/theme/DocRoot/Layout/Sidebar/styles.module.css +34 -0
- package/src/theme/DocRoot/Layout/index.tsx +32 -0
- package/src/theme/DocRoot/Layout/styles.module.css +11 -0
- package/src/theme/DocRoot/index.tsx +29 -0
- package/src/theme/DocSidebar/Desktop/CollapseButton/index.tsx +34 -0
- package/src/theme/DocSidebar/Desktop/CollapseButton/styles.module.css +42 -0
- package/src/theme/DocSidebar/Desktop/Content/index.tsx +56 -0
- package/src/theme/DocSidebar/Desktop/Content/styles.module.css +18 -0
- package/src/theme/DocSidebar/Desktop/index.tsx +36 -0
- package/src/theme/DocSidebar/Desktop/styles.module.css +39 -0
- package/src/theme/DocSidebar/Mobile/index.tsx +49 -0
- package/src/theme/DocSidebar/index.tsx +25 -0
- package/src/theme/DocSidebarItem/Category/index.tsx +309 -0
- package/src/theme/DocSidebarItem/Category/styles.module.css +35 -0
- package/src/theme/DocSidebarItem/Html/index.tsx +30 -0
- package/src/theme/DocSidebarItem/Html/styles.module.css +8 -0
- package/src/theme/DocSidebarItem/Link/index.tsx +62 -0
- package/src/theme/DocSidebarItem/Link/styles.module.css +13 -0
- package/src/theme/DocSidebarItem/index.tsx +19 -0
- package/src/theme/DocSidebarItems/index.tsx +24 -0
- package/src/theme/DocTagDocListPage/index.tsx +113 -0
- package/src/theme/DocTagsListPage/index.tsx +52 -0
- package/src/theme/DocVersionBadge/index.tsx +29 -0
- package/src/theme/DocVersionBanner/index.tsx +171 -0
- package/src/theme/DocVersionRoot/index.tsx +46 -0
- package/src/theme/DocsRoot/index.tsx +17 -0
- package/src/theme/EditMetaRow/index.tsx +31 -0
- package/src/theme/EditMetaRow/styles.module.css +19 -0
- package/src/theme/EditThisPage/index.tsx +21 -0
- package/src/theme/ErrorPageContent.tsx +38 -0
- package/src/theme/Footer/Copyright/index.tsx +15 -0
- package/src/theme/Footer/Layout/index.tsx +42 -0
- package/src/theme/Footer/LinkItem/index.tsx +31 -0
- package/src/theme/Footer/Links/MultiColumn/index.tsx +53 -0
- package/src/theme/Footer/Links/Simple/index.tsx +38 -0
- package/src/theme/Footer/Links/index.tsx +16 -0
- package/src/theme/Footer/Logo/index.tsx +41 -0
- package/src/theme/Footer/Logo/styles.module.css +11 -0
- package/src/theme/Footer/index.tsx +28 -0
- package/src/theme/Heading/index.tsx +50 -0
- package/src/theme/Heading/styles.module.css +17 -0
- package/src/theme/Homepage/index.tsx +178 -0
- package/src/theme/Icon/AI/index.tsx +21 -0
- package/src/theme/Icon/AWS/index.tsx +22 -0
- package/src/theme/Icon/Arrow/index.tsx +15 -0
- package/src/theme/Icon/Azure/index.tsx +28 -0
- package/src/theme/Icon/Changelog/index.tsx +26 -0
- package/src/theme/Icon/ChatBubble/index.tsx +29 -0
- package/src/theme/Icon/ChatBubbles/index.tsx +42 -0
- package/src/theme/Icon/Close/index.tsx +21 -0
- package/src/theme/Icon/Cog/index.tsx +45 -0
- package/src/theme/Icon/Copy/index.tsx +15 -0
- package/src/theme/Icon/DarkMode/index.tsx +15 -0
- package/src/theme/Icon/Edit/index.tsx +24 -0
- package/src/theme/Icon/Edit/styles.module.css +6 -0
- package/src/theme/Icon/Envelope/index.tsx +33 -0
- package/src/theme/Icon/ExternalLink/index.tsx +30 -0
- package/src/theme/Icon/ExternalLink/styles.module.css +5 -0
- package/src/theme/Icon/Fusion/index.tsx +32 -0
- package/src/theme/Icon/GoogleCloud/index.tsx +56 -0
- package/src/theme/Icon/Home/index.tsx +15 -0
- package/src/theme/Icon/Language/index.tsx +24 -0
- package/src/theme/Icon/LightMode/index.tsx +15 -0
- package/src/theme/Icon/MCP/index.tsx +84 -0
- package/src/theme/Icon/Menu/index.tsx +29 -0
- package/src/theme/Icon/MultiQC/index.tsx +25 -0
- package/src/theme/Icon/Nextflow/index.tsx +25 -0
- package/src/theme/Icon/QuestionMark/index.tsx +46 -0
- package/src/theme/Icon/SeqeraCloud/index.tsx +35 -0
- package/src/theme/Icon/SeqeraEnterprise/index.tsx +372 -0
- package/src/theme/Icon/SeqeraLogo/index.tsx +22 -0
- package/src/theme/Icon/ServiceStatus/index.tsx +101 -0
- package/src/theme/Icon/Sidebar/index.tsx +8 -0
- package/src/theme/Icon/Socials/Bluesky/index.tsx +23 -0
- package/src/theme/Icon/Socials/Bluesky/styles.module.css +9 -0
- package/src/theme/Icon/Socials/Default/index.tsx +28 -0
- package/src/theme/Icon/Socials/Email/index.tsx +23 -0
- package/src/theme/Icon/Socials/GitHub/index.tsx +24 -0
- package/src/theme/Icon/Socials/GitHub/styles.module.css +9 -0
- package/src/theme/Icon/Socials/Instagram/index.tsx +23 -0
- package/src/theme/Icon/Socials/Instagram/styles.module.css +9 -0
- package/src/theme/Icon/Socials/LinkedIn/index.tsx +23 -0
- package/src/theme/Icon/Socials/LinkedIn/styles.module.css +9 -0
- package/src/theme/Icon/Socials/Mastodon/index.tsx +40 -0
- package/src/theme/Icon/Socials/StackOverflow/index.tsx +25 -0
- package/src/theme/Icon/Socials/Threads/index.tsx +25 -0
- package/src/theme/Icon/Socials/Threads/styles.module.css +9 -0
- package/src/theme/Icon/Socials/Twitch/index.tsx +32 -0
- package/src/theme/Icon/Socials/Twitter/index.tsx +22 -0
- package/src/theme/Icon/Socials/X/index.tsx +24 -0
- package/src/theme/Icon/Socials/X/styles.module.css +9 -0
- package/src/theme/Icon/Socials/YouTube/index.tsx +22 -0
- package/src/theme/Icon/Success/index.tsx +15 -0
- package/src/theme/Icon/SystemColorMode/index.tsx +15 -0
- package/src/theme/Icon/Wave/index.tsx +32 -0
- package/src/theme/Icon/WordWrap/index.tsx +15 -0
- package/src/theme/LastUpdated/index.tsx +91 -0
- package/src/theme/Layout/Provider/index.tsx +26 -0
- package/src/theme/Layout/index.tsx +59 -0
- package/src/theme/Layout/styles.module.css +23 -0
- package/src/theme/Logo/index.tsx +78 -0
- package/src/theme/MDXComponents/A/index.tsx +16 -0
- package/src/theme/MDXComponents/Button/index.tsx +43 -0
- package/src/theme/MDXComponents/Code.tsx +26 -0
- package/src/theme/MDXComponents/Details.tsx +26 -0
- package/src/theme/MDXComponents/Heading.tsx +9 -0
- package/src/theme/MDXComponents/Img/index.tsx +23 -0
- package/src/theme/MDXComponents/Img/styles.module.css +5 -0
- package/src/theme/MDXComponents/Li.tsx +17 -0
- package/src/theme/MDXComponents/Pre.tsx +10 -0
- package/src/theme/MDXComponents/Ul/index.tsx +25 -0
- package/src/theme/MDXComponents/Ul/styles.module.css +9 -0
- package/src/theme/MDXComponents/index.tsx +47 -0
- package/src/theme/MDXContent/index.tsx +10 -0
- package/src/theme/MDXPage/index.tsx +87 -0
- package/src/theme/MDXPage/styles.module.css +5 -0
- package/src/theme/Mermaid.tsx +11 -0
- package/src/theme/Navbar/ColorModeToggle/index.tsx +29 -0
- package/src/theme/Navbar/ColorModeToggle/styles.module.css +5 -0
- package/src/theme/Navbar/Content/index.tsx +152 -0
- package/src/theme/Navbar/Content/styles.module.css +19 -0
- package/src/theme/Navbar/Layout/index.tsx +59 -0
- package/src/theme/Navbar/Layout/styles.module.css +9 -0
- package/src/theme/Navbar/Logo/index.tsx +14 -0
- package/src/theme/Navbar/MobileSidebar/Header/index.tsx +37 -0
- package/src/theme/Navbar/MobileSidebar/Layout/index.tsx +72 -0
- package/src/theme/Navbar/MobileSidebar/Layout/styles.module.css +11 -0
- package/src/theme/Navbar/MobileSidebar/PrimaryMenu/index.tsx +90 -0
- package/src/theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx +34 -0
- package/src/theme/Navbar/MobileSidebar/Toggle/index.tsx +25 -0
- package/src/theme/Navbar/MobileSidebar/index.tsx +28 -0
- package/src/theme/Navbar/Search/index.tsx +15 -0
- package/src/theme/Navbar/Search/styles.module.css +22 -0
- package/src/theme/Navbar/Submenu/SubmenuLinks.tsx +136 -0
- package/src/theme/Navbar/Submenu/index.tsx +84 -0
- package/src/theme/Navbar/Submenu/styles.module.css +82 -0
- package/src/theme/Navbar/index.tsx +13 -0
- package/src/theme/NavbarItem/ComponentTypes.tsx +27 -0
- package/src/theme/NavbarItem/DefaultNavbarItem/Desktop/index.tsx +29 -0
- package/src/theme/NavbarItem/DefaultNavbarItem/Mobile/index.tsx +18 -0
- package/src/theme/NavbarItem/DefaultNavbarItem/index.tsx +23 -0
- package/src/theme/NavbarItem/DocNavbarItem.tsx +38 -0
- package/src/theme/NavbarItem/DocSidebarNavbarItem.tsx +33 -0
- package/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +189 -0
- package/src/theme/NavbarItem/DocsVersionNavbarItem.tsx +22 -0
- package/src/theme/NavbarItem/DropdownNavbarItem/Desktop/index.tsx +81 -0
- package/src/theme/NavbarItem/DropdownNavbarItem/Mobile/index.tsx +161 -0
- package/src/theme/NavbarItem/DropdownNavbarItem/Mobile/styles.module.css +5 -0
- package/src/theme/NavbarItem/DropdownNavbarItem/index.tsx +14 -0
- package/src/theme/NavbarItem/HtmlNavbarItem.tsx +27 -0
- package/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx +128 -0
- package/src/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css +6 -0
- package/src/theme/NavbarItem/NavbarNavLink.tsx +69 -0
- package/src/theme/NavbarItem/SearchNavbarItem.tsx +21 -0
- package/src/theme/NavbarItem/index.tsx +23 -0
- package/src/theme/NotFound/Content/index.tsx +34 -0
- package/src/theme/NotFound/index.tsx +22 -0
- package/src/theme/PaginatorNavLink/index.tsx +21 -0
- package/src/theme/SearchBar.tsx +8 -0
- package/src/theme/SearchMetadata/index.tsx +38 -0
- package/src/theme/SiteMetadata/index.tsx +153 -0
- package/src/theme/SkipToContent/index.tsx +9 -0
- package/src/theme/SkipToContent/styles.module.css +16 -0
- package/src/theme/TOC/index.tsx +26 -0
- package/src/theme/TOC/styles.module.css +23 -0
- package/src/theme/TOCCollapsible/CollapseButton/index.tsx +30 -0
- package/src/theme/TOCCollapsible/CollapseButton/styles.module.css +27 -0
- package/src/theme/TOCCollapsible/index.tsx +42 -0
- package/src/theme/TOCCollapsible/styles.module.css +26 -0
- package/src/theme/TOCInline/index.tsx +25 -0
- package/src/theme/TOCInline/styles.module.css +7 -0
- package/src/theme/TOCItems/Tree.tsx +40 -0
- package/src/theme/TOCItems/index.tsx +56 -0
- package/src/theme/TabItem/index.tsx +22 -0
- package/src/theme/TabItem/styles.module.css +5 -0
- package/src/theme/Tabs/index.tsx +167 -0
- package/src/theme/Tabs/styles.module.css +9 -0
- package/src/theme/Tag/index.tsx +30 -0
- package/src/theme/Tag/styles.module.css +65 -0
- package/src/theme/TagsListByLetter/index.tsx +40 -0
- package/src/theme/TagsListByLetter/styles.module.css +6 -0
- package/src/theme/TagsListInline/index.tsx +30 -0
- package/src/theme/TagsListInline/styles.module.css +10 -0
- package/src/theme/ThemeProvider/TitleFormatter/index.tsx +22 -0
- package/src/theme/ThemeProvider/index.tsx +9 -0
- package/src/theme/ThemedImage/index.tsx +21 -0
- package/src/theme/ThemedImage/styles.module.css +13 -0
- package/src/theme/pages/Home/index.tsx +19 -0
- package/src/theme/prism-include-languages.ts +39 -0
- package/src/theme-seqera.d.ts +2277 -0
- package/src/translations.ts +240 -0
- package/tailwind.config.js +7 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
.docMainContainer {
|
|
4
|
+
display: flex;
|
|
5
|
+
width: 100%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@media (min-width: 997px) {
|
|
9
|
+
.docMainContainer {
|
|
10
|
+
flex-grow: 1;
|
|
11
|
+
max-width: calc(100% - var(--doc-sidebar-width));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.docMainContainerEnhanced {
|
|
15
|
+
max-width: calc(100% - var(--doc-sidebar-hidden-width));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.docItemWrapperEnhanced {
|
|
19
|
+
max-width: calc(
|
|
20
|
+
var(--ifm-container-width) + var(--doc-sidebar-width)
|
|
21
|
+
) !important;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode} from 'react';
|
|
4
|
+
import {translate} from '@docusaurus/Translate';
|
|
5
|
+
import IconArrow from '@theme/Icon/Arrow';
|
|
6
|
+
import IconSidebar from '@theme/Icon/Sidebar';
|
|
7
|
+
import type {Props} from '@theme/DocRoot/Layout/Sidebar/ExpandButton';
|
|
8
|
+
|
|
9
|
+
import styles from './styles.module.css';
|
|
10
|
+
|
|
11
|
+
export default function DocRootLayoutSidebarExpandButton({
|
|
12
|
+
toggleSidebar,
|
|
13
|
+
}: Props): ReactNode {
|
|
14
|
+
return (
|
|
15
|
+
<div
|
|
16
|
+
className={styles.expandButton}
|
|
17
|
+
title={translate({
|
|
18
|
+
id: 'theme.docs.sidebar.expandButtonTitle',
|
|
19
|
+
message: 'Expand sidebar',
|
|
20
|
+
description:
|
|
21
|
+
'The ARIA label and title attribute for expand button of doc sidebar',
|
|
22
|
+
})}
|
|
23
|
+
aria-label={translate({
|
|
24
|
+
id: 'theme.docs.sidebar.expandButtonAriaLabel',
|
|
25
|
+
message: 'Expand sidebar',
|
|
26
|
+
description:
|
|
27
|
+
'The ARIA label and title attribute for expand button of doc sidebar',
|
|
28
|
+
})}
|
|
29
|
+
tabIndex={0}
|
|
30
|
+
role="button"
|
|
31
|
+
onKeyDown={toggleSidebar}
|
|
32
|
+
onClick={toggleSidebar}>
|
|
33
|
+
<IconSidebar className={styles.expandButtonIcon} />
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
@media (min-width: 997px) {
|
|
4
|
+
.expandButton {
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: 4rem;
|
|
7
|
+
right: -3px;
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
display: flex;
|
|
11
|
+
/* align-items: center;
|
|
12
|
+
justify-content: center; */
|
|
13
|
+
transition: background-color var(--ifm-transition-fast) ease;
|
|
14
|
+
background-color: var(--docusaurus-collapse-button-bg);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* .expandButton:hover,
|
|
18
|
+
.expandButton:focus {
|
|
19
|
+
background-color: var(--docusaurus-collapse-button-bg-hover);
|
|
20
|
+
} */
|
|
21
|
+
|
|
22
|
+
.expandButtonIcon {
|
|
23
|
+
transform: rotate(180deg);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[dir='rtl'] .expandButtonIcon {
|
|
27
|
+
transform: rotate(180deg);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode, useState, useCallback} from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import {prefersReducedMotion, ThemeClassNames} from '@docusaurus/theme-common';
|
|
6
|
+
import {useDocsSidebar} from '@docusaurus/plugin-content-docs/client';
|
|
7
|
+
import {useLocation} from '@docusaurus/router';
|
|
8
|
+
import DocSidebar from '@theme/DocSidebar';
|
|
9
|
+
import ExpandButton from '@theme/DocRoot/Layout/Sidebar/ExpandButton';
|
|
10
|
+
import type {Props} from '@theme/DocRoot/Layout/Sidebar';
|
|
11
|
+
|
|
12
|
+
import styles from './styles.module.css';
|
|
13
|
+
|
|
14
|
+
// Reset sidebar state when sidebar changes
|
|
15
|
+
// Use React key to unmount/remount the children
|
|
16
|
+
// See https://github.com/facebook/docusaurus/issues/3414
|
|
17
|
+
function ResetOnSidebarChange({children}: {children: ReactNode}) {
|
|
18
|
+
const sidebar = useDocsSidebar();
|
|
19
|
+
return (
|
|
20
|
+
<React.Fragment key={sidebar?.name ?? 'noSidebar'}>
|
|
21
|
+
{children}
|
|
22
|
+
</React.Fragment>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default function DocRootLayoutSidebar({
|
|
27
|
+
sidebar,
|
|
28
|
+
hiddenSidebarContainer,
|
|
29
|
+
setHiddenSidebarContainer,
|
|
30
|
+
}: Props): ReactNode {
|
|
31
|
+
const {pathname} = useLocation();
|
|
32
|
+
|
|
33
|
+
const [hiddenSidebar, setHiddenSidebar] = useState(false);
|
|
34
|
+
const toggleSidebar = useCallback(() => {
|
|
35
|
+
if (hiddenSidebar) {
|
|
36
|
+
setHiddenSidebar(false);
|
|
37
|
+
}
|
|
38
|
+
// onTransitionEnd won't fire when sidebar animation is disabled
|
|
39
|
+
// fixes https://github.com/facebook/docusaurus/issues/8918
|
|
40
|
+
if (!hiddenSidebar && prefersReducedMotion()) {
|
|
41
|
+
setHiddenSidebar(true);
|
|
42
|
+
}
|
|
43
|
+
setHiddenSidebarContainer((value) => !value);
|
|
44
|
+
}, [setHiddenSidebarContainer, hiddenSidebar]);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<aside
|
|
48
|
+
className={clsx(
|
|
49
|
+
ThemeClassNames.docs.docSidebarContainer,
|
|
50
|
+
styles.docSidebarContainer,
|
|
51
|
+
hiddenSidebarContainer && styles.docSidebarContainerHidden,
|
|
52
|
+
)}
|
|
53
|
+
onTransitionEnd={(e) => {
|
|
54
|
+
if (!e.currentTarget.classList.contains(styles.docSidebarContainer!)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (hiddenSidebarContainer) {
|
|
59
|
+
setHiddenSidebar(true);
|
|
60
|
+
}
|
|
61
|
+
}}>
|
|
62
|
+
<ResetOnSidebarChange>
|
|
63
|
+
<div
|
|
64
|
+
className={clsx(
|
|
65
|
+
styles.sidebarViewport,
|
|
66
|
+
hiddenSidebar && styles.sidebarViewportHidden,
|
|
67
|
+
)}>
|
|
68
|
+
<DocSidebar
|
|
69
|
+
sidebar={sidebar}
|
|
70
|
+
path={pathname}
|
|
71
|
+
onCollapse={toggleSidebar}
|
|
72
|
+
isHidden={hiddenSidebar}
|
|
73
|
+
/>
|
|
74
|
+
{hiddenSidebar && <ExpandButton toggleSidebar={toggleSidebar} />}
|
|
75
|
+
</div>
|
|
76
|
+
</ResetOnSidebarChange>
|
|
77
|
+
</aside>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--doc-sidebar-width: 300px;
|
|
5
|
+
--doc-sidebar-hidden-width: 30px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.docSidebarContainer {
|
|
9
|
+
display: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@media (min-width: 997px) {
|
|
13
|
+
.docSidebarContainer {
|
|
14
|
+
display: block;
|
|
15
|
+
width: var(--doc-sidebar-width);
|
|
16
|
+
margin-top: calc(-1 * var(--ifm-navbar-height));
|
|
17
|
+
border-right: 1px solid var(--ifm-toc-border-color);
|
|
18
|
+
will-change: width;
|
|
19
|
+
transition: width var(--ifm-transition-fast) ease;
|
|
20
|
+
clip-path: inset(0);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.docSidebarContainerHidden {
|
|
24
|
+
width: var(--doc-sidebar-hidden-width);
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.sidebarViewport {
|
|
29
|
+
top: calc(var(--ifm-navbar-height) - 2rem);
|
|
30
|
+
position: sticky;
|
|
31
|
+
height: 100%;
|
|
32
|
+
max-height: 100vh;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode, useState} from 'react';
|
|
4
|
+
import {useDocsSidebar} from '@docusaurus/plugin-content-docs/client';
|
|
5
|
+
import BackToTopButton from '@theme/BackToTopButton';
|
|
6
|
+
import DocRootLayoutSidebar from '@theme/DocRoot/Layout/Sidebar';
|
|
7
|
+
import DocRootLayoutMain from '@theme/DocRoot/Layout/Main';
|
|
8
|
+
import type {Props} from '@theme/DocRoot/Layout';
|
|
9
|
+
|
|
10
|
+
import styles from './styles.module.css';
|
|
11
|
+
|
|
12
|
+
export default function DocRootLayout({children}: Props): ReactNode {
|
|
13
|
+
const sidebar = useDocsSidebar();
|
|
14
|
+
const [hiddenSidebarContainer, setHiddenSidebarContainer] = useState(false);
|
|
15
|
+
return (
|
|
16
|
+
<div className={styles.docsWrapper}>
|
|
17
|
+
<BackToTopButton />
|
|
18
|
+
<div className={styles.docRoot}>
|
|
19
|
+
{sidebar && (
|
|
20
|
+
<DocRootLayoutSidebar
|
|
21
|
+
sidebar={sidebar.items}
|
|
22
|
+
hiddenSidebarContainer={hiddenSidebarContainer}
|
|
23
|
+
setHiddenSidebarContainer={setHiddenSidebarContainer}
|
|
24
|
+
/>
|
|
25
|
+
)}
|
|
26
|
+
<DocRootLayoutMain hiddenSidebarContainer={hiddenSidebarContainer}>
|
|
27
|
+
{children}
|
|
28
|
+
</DocRootLayoutMain>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode} from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import {HtmlClassNameProvider, ThemeClassNames} from '@docusaurus/theme-common';
|
|
6
|
+
import {
|
|
7
|
+
DocsSidebarProvider,
|
|
8
|
+
useDocRootMetadata,
|
|
9
|
+
} from '@docusaurus/plugin-content-docs/client';
|
|
10
|
+
import DocRootLayout from '@theme/DocRoot/Layout';
|
|
11
|
+
import NotFoundContent from '@theme/NotFound/Content';
|
|
12
|
+
import type {Props} from '@theme/DocRoot';
|
|
13
|
+
|
|
14
|
+
export default function DocRoot(props: Props): ReactNode {
|
|
15
|
+
const currentDocRouteMetadata = useDocRootMetadata(props);
|
|
16
|
+
if (!currentDocRouteMetadata) {
|
|
17
|
+
// We only render the not found content to avoid a double layout
|
|
18
|
+
// see https://github.com/facebook/docusaurus/pull/7966#pullrequestreview-1077276692
|
|
19
|
+
return <NotFoundContent />;
|
|
20
|
+
}
|
|
21
|
+
const {docElement, sidebarName, sidebarItems} = currentDocRouteMetadata;
|
|
22
|
+
return (
|
|
23
|
+
<HtmlClassNameProvider className={clsx(ThemeClassNames.page.docsDocPage)}>
|
|
24
|
+
<DocsSidebarProvider name={sidebarName} items={sidebarItems}>
|
|
25
|
+
<DocRootLayout>{docElement}</DocRootLayout>
|
|
26
|
+
</DocsSidebarProvider>
|
|
27
|
+
</HtmlClassNameProvider>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode} from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import {translate} from '@docusaurus/Translate';
|
|
6
|
+
import IconArrow from '@theme/Icon/Arrow';
|
|
7
|
+
import IconSidebar from '@theme/Icon/Sidebar';
|
|
8
|
+
import type {Props} from '@theme/DocSidebar/Desktop/CollapseButton';
|
|
9
|
+
|
|
10
|
+
import styles from './styles.module.css';
|
|
11
|
+
|
|
12
|
+
export default function CollapseButton({onClick}: Props): ReactNode {
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
// type="button"
|
|
16
|
+
title={translate({
|
|
17
|
+
id: 'theme.docs.sidebar.collapseButtonTitle',
|
|
18
|
+
message: 'Collapse sidebar',
|
|
19
|
+
description: 'The title attribute for collapse button of doc sidebar',
|
|
20
|
+
})}
|
|
21
|
+
aria-label={translate({
|
|
22
|
+
id: 'theme.docs.sidebar.collapseButtonAriaLabel',
|
|
23
|
+
message: 'Collapse sidebar',
|
|
24
|
+
description: 'The title attribute for collapse button of doc sidebar',
|
|
25
|
+
})}
|
|
26
|
+
className={clsx(
|
|
27
|
+
'w-full h-full pr-2 cursor-pointer',
|
|
28
|
+
// styles.collapseSidebarButton,
|
|
29
|
+
)}
|
|
30
|
+
onClick={onClick}>
|
|
31
|
+
<IconSidebar className={styles.collapseSidebarButtonIcon} />
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--docusaurus-collapse-button-bg: transparent;
|
|
3
|
+
--docusaurus-collapse-button-bg-hover: rgb(0 0 0 / 10%);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
[data-theme='dark']:root {
|
|
7
|
+
--docusaurus-collapse-button-bg: rgb(255 255 255 / 5%);
|
|
8
|
+
--docusaurus-collapse-button-bg-hover: rgb(255 255 255 / 10%);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@media (min-width: 997px) {
|
|
12
|
+
.collapseSidebarButton {
|
|
13
|
+
display: block !important;
|
|
14
|
+
background-color: var(--docusaurus-collapse-button-bg);
|
|
15
|
+
height: 40px;
|
|
16
|
+
position: sticky;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
border-radius: 0;
|
|
19
|
+
border-top: 1px solid var(--ifm-toc-border-color);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.collapseSidebarButtonIcon {
|
|
23
|
+
/* transform: rotate(180deg); */
|
|
24
|
+
transform: rotate(0deg);
|
|
25
|
+
margin-top: 4px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
[dir='rtl'] .collapseSidebarButtonIcon {
|
|
29
|
+
/* transform: rotate(0); */
|
|
30
|
+
transform: rotate(180deg);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.collapseSidebarButton:hover,
|
|
34
|
+
.collapseSidebarButton:focus {
|
|
35
|
+
background-color: var(--docusaurus-collapse-button-bg-hover);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.collapseSidebarButton {
|
|
40
|
+
display: none;
|
|
41
|
+
margin: 0;
|
|
42
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode, useState} from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
6
|
+
import {
|
|
7
|
+
useAnnouncementBar,
|
|
8
|
+
useScrollPosition,
|
|
9
|
+
} from '@docusaurus/theme-common/internal';
|
|
10
|
+
import {translate} from '@docusaurus/Translate';
|
|
11
|
+
import DocSidebarItems from '@theme/DocSidebarItems';
|
|
12
|
+
import type {Props} from '@theme/DocSidebar/Desktop/Content';
|
|
13
|
+
|
|
14
|
+
import styles from './styles.module.css';
|
|
15
|
+
|
|
16
|
+
function useShowAnnouncementBar() {
|
|
17
|
+
const {isActive} = useAnnouncementBar();
|
|
18
|
+
const [showAnnouncementBar, setShowAnnouncementBar] = useState(isActive);
|
|
19
|
+
|
|
20
|
+
useScrollPosition(
|
|
21
|
+
({scrollY}) => {
|
|
22
|
+
if (isActive) {
|
|
23
|
+
setShowAnnouncementBar(scrollY === 0);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
[isActive],
|
|
27
|
+
);
|
|
28
|
+
return isActive && showAnnouncementBar;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default function DocSidebarDesktopContent({
|
|
32
|
+
path,
|
|
33
|
+
sidebar,
|
|
34
|
+
className,
|
|
35
|
+
}: Props): ReactNode {
|
|
36
|
+
const showAnnouncementBar = useShowAnnouncementBar();
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<nav
|
|
40
|
+
aria-label={translate({
|
|
41
|
+
id: 'theme.docs.sidebar.navAriaLabel',
|
|
42
|
+
message: 'Docs sidebar',
|
|
43
|
+
description: 'The ARIA label for the sidebar navigation',
|
|
44
|
+
})}
|
|
45
|
+
className={clsx(
|
|
46
|
+
'menu thin-scrollbar w-full block font-normal mt-2',
|
|
47
|
+
styles.menu,
|
|
48
|
+
showAnnouncementBar && styles.menuWithAnnouncementBar,
|
|
49
|
+
className,
|
|
50
|
+
)}>
|
|
51
|
+
<ul className={clsx(ThemeClassNames.docs.docSidebarMenu, 'menu__list')}>
|
|
52
|
+
<DocSidebarItems items={sidebar} activePath={path} level={1} />
|
|
53
|
+
</ul>
|
|
54
|
+
</nav>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
@media (min-width: 997px) {
|
|
4
|
+
.menu {
|
|
5
|
+
flex-grow: 1;
|
|
6
|
+
padding: 0.5rem;
|
|
7
|
+
}
|
|
8
|
+
@supports (scrollbar-gutter: stable) {
|
|
9
|
+
.menu {
|
|
10
|
+
padding: 0.5rem 0 0.5rem 0.5rem;
|
|
11
|
+
scrollbar-gutter: stable;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.menuWithAnnouncementBar {
|
|
16
|
+
margin-bottom: var(--docusaurus-announcement-bar-height);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import {useThemeConfig} from '@docusaurus/theme-common';
|
|
6
|
+
import Logo from '@theme/Logo';
|
|
7
|
+
import CollapseButton from '@theme/DocSidebar/Desktop/CollapseButton';
|
|
8
|
+
import Content from '@theme/DocSidebar/Desktop/Content';
|
|
9
|
+
import type {Props} from '@theme/DocSidebar/Desktop';
|
|
10
|
+
|
|
11
|
+
import styles from './styles.module.css';
|
|
12
|
+
|
|
13
|
+
function DocSidebarDesktop({path, sidebar, onCollapse, isHidden}: Props) {
|
|
14
|
+
const {
|
|
15
|
+
navbar: {hideOnScroll},
|
|
16
|
+
docs: {
|
|
17
|
+
sidebar: {hideable},
|
|
18
|
+
},
|
|
19
|
+
} = useThemeConfig();
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div
|
|
23
|
+
className={clsx(
|
|
24
|
+
styles.sidebar,
|
|
25
|
+
hideOnScroll && styles.sidebarWithHideableNavbar,
|
|
26
|
+
isHidden && styles.sidebarHidden,
|
|
27
|
+
'h-full relative w-full'
|
|
28
|
+
)}>
|
|
29
|
+
{hideOnScroll && <Logo tabIndex={-1} className={styles.sidebarLogo} />}
|
|
30
|
+
<Content path={path} sidebar={sidebar} />
|
|
31
|
+
{hideable && <div className="absolute right-0 top-[3.75rem]"><CollapseButton onClick={onCollapse} /></div>}
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default React.memo(DocSidebarDesktop);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
@media (min-width: 997px) {
|
|
4
|
+
.sidebar {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
height: 100%;
|
|
8
|
+
padding-top: var(--ifm-navbar-height);
|
|
9
|
+
width: var(--doc-sidebar-width);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.sidebarWithHideableNavbar {
|
|
13
|
+
padding-top: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.sidebarHidden {
|
|
17
|
+
opacity: 0;
|
|
18
|
+
visibility: hidden;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.sidebarLogo {
|
|
22
|
+
display: flex !important;
|
|
23
|
+
align-items: center;
|
|
24
|
+
margin: 0 var(--ifm-navbar-padding-horizontal);
|
|
25
|
+
min-height: var(--ifm-navbar-height);
|
|
26
|
+
max-height: var(--ifm-navbar-height);
|
|
27
|
+
color: inherit !important;
|
|
28
|
+
text-decoration: none !important;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.sidebarLogo img {
|
|
32
|
+
margin-right: 0.5rem;
|
|
33
|
+
height: 2rem;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.sidebarLogo {
|
|
38
|
+
display: none;
|
|
39
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import {
|
|
6
|
+
NavbarSecondaryMenuFiller,
|
|
7
|
+
type NavbarSecondaryMenuComponent,
|
|
8
|
+
ThemeClassNames,
|
|
9
|
+
} from '@docusaurus/theme-common';
|
|
10
|
+
import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal';
|
|
11
|
+
import DocSidebarItems from '@theme/DocSidebarItems';
|
|
12
|
+
import type {Props} from '@theme/DocSidebar/Mobile';
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line react/function-component-definition
|
|
15
|
+
const DocSidebarMobileSecondaryMenu: NavbarSecondaryMenuComponent<Props> = ({
|
|
16
|
+
sidebar,
|
|
17
|
+
path,
|
|
18
|
+
}) => {
|
|
19
|
+
const mobileSidebar = useNavbarMobileSidebar();
|
|
20
|
+
return (
|
|
21
|
+
<ul className={clsx(ThemeClassNames.docs.docSidebarMenu, 'menu__list')}>
|
|
22
|
+
<DocSidebarItems
|
|
23
|
+
items={sidebar}
|
|
24
|
+
activePath={path}
|
|
25
|
+
onItemClick={(item) => {
|
|
26
|
+
// Mobile sidebar should only be closed if the category has a link
|
|
27
|
+
if (item.type === 'category' && item.href) {
|
|
28
|
+
mobileSidebar.toggle();
|
|
29
|
+
}
|
|
30
|
+
if (item.type === 'link') {
|
|
31
|
+
mobileSidebar.toggle();
|
|
32
|
+
}
|
|
33
|
+
}}
|
|
34
|
+
level={1}
|
|
35
|
+
/>
|
|
36
|
+
</ul>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
function DocSidebarMobile(props: Props) {
|
|
41
|
+
return (
|
|
42
|
+
<NavbarSecondaryMenuFiller
|
|
43
|
+
component={DocSidebarMobileSecondaryMenu}
|
|
44
|
+
props={props}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default React.memo(DocSidebarMobile);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode} from 'react';
|
|
4
|
+
import {useWindowSize} from '@docusaurus/theme-common';
|
|
5
|
+
import DocSidebarDesktop from '@theme/DocSidebar/Desktop';
|
|
6
|
+
import DocSidebarMobile from '@theme/DocSidebar/Mobile';
|
|
7
|
+
import type {Props} from '@theme/DocSidebar';
|
|
8
|
+
|
|
9
|
+
export default function DocSidebar(props: Props): ReactNode {
|
|
10
|
+
const windowSize = useWindowSize();
|
|
11
|
+
|
|
12
|
+
// Desktop sidebar visible on hydration: need SSR rendering
|
|
13
|
+
const shouldRenderSidebarDesktop =
|
|
14
|
+
windowSize === 'desktop' || windowSize === 'ssr';
|
|
15
|
+
|
|
16
|
+
// Mobile sidebar not visible on hydration: can avoid SSR rendering
|
|
17
|
+
const shouldRenderSidebarMobile = windowSize === 'mobile';
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<>
|
|
21
|
+
{shouldRenderSidebarDesktop && <DocSidebarDesktop {...props} />}
|
|
22
|
+
{shouldRenderSidebarMobile && <DocSidebarMobile {...props} />}
|
|
23
|
+
</>
|
|
24
|
+
);
|
|
25
|
+
}
|