@docusaurus/theme-classic 2.0.0-beta.1ec2c95e3 → 2.0.0-beta.21
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 +2 -2
- package/lib/admonitions.css +39 -0
- package/lib/getSwizzleConfig.d.ts +8 -0
- package/lib/getSwizzleConfig.js +228 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.js +106 -170
- package/lib/nprogress.css +41 -0
- package/lib/nprogress.d.ts +10 -0
- package/lib/nprogress.js +25 -0
- package/lib/prism-include-languages.d.ts +7 -0
- package/lib/prism-include-languages.js +0 -2
- package/lib/theme/Admonition/index.d.ts +9 -0
- package/lib/theme/Admonition/index.js +101 -0
- package/lib/theme/AnnouncementBar/index.d.ts +8 -0
- package/lib/theme/AnnouncementBar/index.js +38 -63
- package/lib/theme/AnnouncementBar/styles.module.css +23 -32
- package/lib/theme/BackToTopButton/index.d.ts +8 -0
- package/lib/theme/BackToTopButton/index.js +31 -0
- package/lib/theme/BackToTopButton/styles.module.css +44 -0
- package/lib/theme/BlogArchivePage/index.d.ts +10 -0
- package/lib/theme/BlogArchivePage/index.js +80 -0
- package/lib/theme/BlogLayout/index.d.ts +9 -0
- package/lib/theme/BlogLayout/index.js +33 -0
- package/lib/theme/BlogListPage/index.d.ts +10 -0
- package/lib/theme/BlogListPage/index.js +53 -61
- package/lib/theme/BlogListPaginator/index.d.ts +9 -0
- package/lib/theme/BlogListPaginator/index.js +41 -56
- package/lib/theme/BlogPostAuthor/index.d.ts +9 -0
- package/lib/theme/BlogPostAuthor/index.js +46 -0
- package/lib/theme/BlogPostAuthors/index.d.ts +9 -0
- package/lib/theme/BlogPostAuthors/index.js +42 -0
- package/{src/theme/Toggle → lib/theme/BlogPostAuthors}/styles.module.css +11 -7
- package/lib/theme/BlogPostItem/index.d.ts +9 -0
- package/lib/theme/BlogPostItem/index.js +120 -127
- package/lib/theme/BlogPostItem/styles.module.css +9 -0
- package/lib/theme/BlogPostPage/index.d.ts +10 -0
- package/lib/theme/BlogPostPage/index.js +90 -60
- package/lib/theme/BlogPostPaginator/index.d.ts +9 -0
- package/lib/theme/BlogPostPaginator/index.js +40 -57
- package/lib/theme/BlogSidebar/Desktop/index.d.ts +9 -0
- package/{lib-next/theme/BlogSidebar → lib/theme/BlogSidebar/Desktop}/index.js +19 -23
- package/{lib-next/theme/BlogSidebar → lib/theme/BlogSidebar/Desktop}/styles.module.css +5 -4
- package/lib/theme/BlogSidebar/Mobile/index.d.ts +9 -0
- package/lib/theme/BlogSidebar/Mobile/index.js +34 -0
- package/lib/theme/BlogSidebar/index.d.ts +9 -0
- package/lib/theme/BlogSidebar/index.js +13 -43
- package/lib/theme/BlogTagsListPage/index.d.ts +10 -0
- package/lib/theme/BlogTagsListPage/index.js +27 -69
- package/lib/theme/BlogTagsPostsPage/index.d.ts +10 -0
- package/lib/theme/BlogTagsPostsPage/index.js +72 -89
- package/lib/theme/CodeBlock/Container/index.d.ts +10 -0
- package/lib/theme/CodeBlock/Container/index.js +30 -0
- package/lib/theme/CodeBlock/Container/styles.module.css +14 -0
- package/lib/theme/CodeBlock/Content/Element.d.ts +9 -0
- package/lib/theme/CodeBlock/Content/Element.js +23 -0
- package/lib/theme/CodeBlock/Content/String.d.ts +9 -0
- package/lib/theme/CodeBlock/Content/String.js +104 -0
- package/{lib-next/theme/CodeBlock → lib/theme/CodeBlock/Content}/styles.module.css +45 -27
- package/lib/theme/CodeBlock/CopyButton/index.d.ts +9 -0
- package/lib/theme/CodeBlock/CopyButton/index.js +61 -0
- package/lib/theme/CodeBlock/CopyButton/styles.module.css +47 -0
- package/lib/theme/CodeBlock/Line/index.d.ts +9 -0
- package/lib/theme/CodeBlock/Line/index.js +42 -0
- package/lib/theme/CodeBlock/Line/styles.module.css +51 -0
- package/lib/theme/CodeBlock/WordWrapButton/index.d.ts +9 -0
- package/lib/theme/CodeBlock/WordWrapButton/index.js +40 -0
- package/lib/theme/CodeBlock/WordWrapButton/styles.module.css +15 -0
- package/lib/theme/CodeBlock/index.d.ts +9 -0
- package/lib/theme/CodeBlock/index.js +31 -246
- package/lib/theme/ColorModeToggle/index.d.ts +11 -0
- package/lib/theme/ColorModeToggle/index.js +60 -0
- package/lib/theme/ColorModeToggle/styles.module.css +35 -0
- package/lib/theme/Details/index.d.ts +9 -0
- package/lib/theme/Details/index.js +21 -0
- package/lib/theme/Details/styles.module.css +13 -0
- package/lib/theme/DocBreadcrumbs/index.d.ts +8 -0
- package/lib/theme/DocBreadcrumbs/index.js +115 -0
- package/lib/theme/{Heading/styles.css → DocBreadcrumbs/styles.module.css} +9 -13
- package/lib/theme/DocCard/index.d.ts +9 -0
- package/lib/theme/DocCard/index.js +83 -0
- package/lib/theme/DocCard/styles.module.css +34 -0
- package/lib/theme/DocCardList/index.d.ts +9 -0
- package/lib/theme/DocCardList/index.js +30 -0
- package/lib/theme/DocCategoryGeneratedIndexPage/index.d.ts +10 -0
- package/lib/theme/DocCategoryGeneratedIndexPage/index.js +74 -0
- package/lib/theme/DocCategoryGeneratedIndexPage/styles.module.css +26 -0
- package/lib/theme/DocItem/index.d.ts +10 -0
- package/lib/theme/DocItem/index.js +102 -113
- package/lib/theme/DocItem/styles.module.css +12 -10
- package/lib/theme/DocItemFooter/index.d.ts +10 -0
- package/lib/theme/DocItemFooter/index.js +74 -0
- package/{lib-next/theme/DocItem → lib/theme/DocItemFooter}/styles.module.css +1 -9
- package/lib/theme/DocPage/Layout/Main/index.d.ts +9 -0
- package/lib/theme/DocPage/Layout/Main/index.js +29 -0
- package/lib/theme/DocPage/Layout/Main/styles.module.css +28 -0
- package/lib/theme/DocPage/Layout/Sidebar/ExpandButton/index.d.ts +9 -0
- package/lib/theme/DocPage/Layout/Sidebar/ExpandButton/index.js +34 -0
- package/lib/theme/DocPage/Layout/Sidebar/ExpandButton/styles.module.css +33 -0
- package/lib/theme/DocPage/Layout/Sidebar/index.d.ts +9 -0
- package/lib/theme/DocPage/Layout/Sidebar/index.js +65 -0
- package/lib/theme/DocPage/Layout/Sidebar/styles.module.css +32 -0
- package/lib/theme/DocPage/Layout/index.d.ts +9 -0
- package/lib/theme/DocPage/Layout/index.js +34 -0
- package/{lib-next/theme/IconExternalLink → lib/theme/DocPage/Layout}/styles.module.css +7 -4
- package/lib/theme/DocPage/index.d.ts +10 -0
- package/lib/theme/DocPage/index.js +43 -165
- package/lib/theme/DocPaginator/index.d.ts +9 -0
- package/lib/theme/DocPaginator/index.js +40 -56
- package/lib/theme/DocSidebar/Desktop/CollapseButton/index.d.ts +9 -0
- package/lib/theme/DocSidebar/Desktop/CollapseButton/index.js +34 -0
- package/lib/theme/DocSidebar/Desktop/CollapseButton/styles.module.css +46 -0
- package/lib/theme/DocSidebar/Desktop/Content/index.d.ts +9 -0
- package/lib/theme/DocSidebar/Desktop/Content/index.js +44 -0
- package/lib/theme/DocSidebar/Desktop/Content/styles.module.css +23 -0
- package/lib/theme/DocSidebar/Desktop/index.d.ts +11 -0
- package/lib/theme/DocSidebar/Desktop/index.js +34 -0
- package/lib/theme/DocSidebar/Desktop/styles.module.css +50 -0
- package/lib/theme/DocSidebar/Mobile/index.d.ts +11 -0
- package/lib/theme/DocSidebar/Mobile/index.js +45 -0
- package/lib/theme/DocSidebar/index.d.ts +9 -0
- package/lib/theme/DocSidebar/index.js +17 -302
- package/lib/theme/DocSidebarItem/Category/index.d.ts +9 -0
- package/lib/theme/DocSidebarItem/Category/index.js +183 -0
- package/lib/theme/DocSidebarItem/Html/index.d.ts +9 -0
- package/lib/theme/DocSidebarItem/Html/index.js +26 -0
- package/lib/theme/DocSidebarItem/Html/styles.module.css +13 -0
- package/lib/theme/DocSidebarItem/Link/index.d.ts +9 -0
- package/lib/theme/DocSidebarItem/Link/index.js +53 -0
- package/{lib-next/theme/MDXPage → lib/theme/DocSidebarItem/Link}/styles.module.css +2 -2
- package/lib/theme/DocSidebarItem/index.d.ts +9 -0
- package/lib/theme/DocSidebarItem/index.js +21 -0
- package/lib/theme/DocSidebarItems/index.d.ts +11 -0
- package/lib/theme/DocSidebarItems/index.js +22 -0
- package/lib/theme/DocTagDocListPage/index.d.ts +10 -0
- package/lib/theme/DocTagDocListPage/index.js +89 -0
- package/lib/theme/DocTagsListPage/index.d.ts +10 -0
- package/lib/theme/DocTagsListPage/index.js +40 -0
- package/lib/theme/DocVersionBadge/index.d.ts +9 -0
- package/lib/theme/DocVersionBadge/index.js +30 -0
- package/lib/theme/DocVersionBanner/index.d.ts +9 -0
- package/lib/theme/DocVersionBanner/index.js +105 -102
- package/lib/theme/EditThisPage/index.d.ts +9 -0
- package/lib/theme/EditThisPage/index.js +19 -24
- package/{src/theme/hooks/useLockBodyScroll.ts → lib/theme/ErrorPageContent.d.ts} +4 -14
- package/lib/theme/ErrorPageContent.js +35 -0
- package/lib/theme/Footer/Copyright/index.d.ts +9 -0
- package/lib/theme/Footer/Copyright/index.js +17 -0
- package/lib/theme/Footer/Layout/index.d.ts +9 -0
- package/lib/theme/Footer/Layout/index.js +26 -0
- package/lib/theme/Footer/LinkItem/index.d.ts +9 -0
- package/lib/theme/Footer/LinkItem/index.js +31 -0
- package/lib/theme/Footer/Links/MultiColumn/index.d.ts +9 -0
- package/lib/theme/Footer/Links/MultiColumn/index.js +43 -0
- package/lib/theme/Footer/Links/Simple/index.d.ts +9 -0
- package/lib/theme/Footer/Links/Simple/index.js +37 -0
- package/lib/theme/Footer/Links/index.d.ts +9 -0
- package/lib/theme/Footer/Links/index.js +17 -0
- package/lib/theme/Footer/Logo/index.d.ts +9 -0
- package/lib/theme/Footer/Logo/index.js +36 -0
- package/lib/theme/Footer/{styles.module.css → Logo/styles.module.css} +2 -1
- package/{lib-next/theme/Footer/styles.module.css → lib/theme/Footer/index.d.ts} +4 -9
- package/lib/theme/Footer/index.js +17 -104
- package/lib/theme/Heading/index.d.ts +9 -0
- package/lib/theme/Heading/index.js +35 -68
- package/lib/theme/Heading/styles.module.css +25 -5
- package/lib/theme/IconArrow/index.d.ts +9 -0
- package/lib/theme/IconArrow/index.js +7 -18
- package/lib/theme/IconClose/index.d.ts +9 -0
- package/lib/theme/IconClose/index.js +23 -0
- package/lib/theme/IconDarkMode/index.d.ts +9 -0
- package/lib/theme/IconDarkMode/index.js +17 -0
- package/lib/theme/IconEdit/index.d.ts +9 -0
- package/lib/theme/IconEdit/index.js +16 -25
- package/lib/theme/IconExternalLink/index.d.ts +9 -0
- package/lib/theme/IconExternalLink/index.js +17 -24
- package/lib/theme/IconExternalLink/styles.module.css +0 -2
- package/lib/theme/IconHome/index.d.ts +9 -0
- package/lib/theme/IconHome/index.js +17 -0
- package/lib/theme/IconLanguage/index.d.ts +9 -0
- package/lib/theme/IconLanguage/index.js +16 -23
- package/lib/theme/IconLightMode/index.d.ts +9 -0
- package/lib/theme/IconLightMode/index.js +17 -0
- package/lib/theme/IconMenu/index.d.ts +9 -0
- package/lib/theme/IconMenu/index.js +21 -20
- package/lib/theme/LastUpdated/index.d.ts +9 -0
- package/lib/theme/LastUpdated/index.js +57 -42
- package/lib/theme/Layout/index.d.ts +10 -0
- package/lib/theme/Layout/index.js +33 -46
- package/lib/theme/LayoutProviders/index.d.ts +9 -0
- package/lib/theme/LayoutProviders/index.js +27 -30
- package/{lib-next/theme/BlogPostItem/styles.module.css → lib/theme/Logo/index.d.ts} +3 -12
- package/lib/theme/Logo/index.js +37 -49
- package/lib/theme/MDXComponents/A.d.ts +9 -0
- package/{lib-next/theme/ThemeContext.js → lib/theme/MDXComponents/A.js} +4 -2
- package/lib/theme/MDXComponents/Code.d.ts +9 -0
- package/lib/theme/MDXComponents/Code.js +28 -0
- package/lib/theme/MDXComponents/Details.d.ts +9 -0
- package/lib/theme/MDXComponents/Details.js +22 -0
- package/lib/theme/MDXComponents/Head.d.ts +9 -0
- package/lib/theme/MDXComponents/Head.js +23 -0
- package/lib/theme/MDXComponents/Heading.d.ts +9 -0
- package/{lib-next/theme/NavbarItem/SearchNavbarItem.js → lib/theme/MDXComponents/Heading.js} +3 -7
- package/lib/theme/MDXComponents/Img/index.d.ts +9 -0
- package/lib/theme/MDXComponents/Img/index.js +22 -0
- package/{lib-next/theme/IconEdit → lib/theme/MDXComponents/Img}/styles.module.css +2 -3
- package/lib/theme/MDXComponents/Pre.d.ts +9 -0
- package/lib/theme/MDXComponents/Pre.js +19 -0
- package/lib/theme/MDXComponents/Ul/index.d.ts +9 -0
- package/lib/theme/MDXComponents/Ul/index.js +21 -0
- package/lib/theme/MDXComponents/Ul/styles.module.css +14 -0
- package/lib/theme/MDXComponents/index.d.ts +9 -0
- package/lib/theme/MDXComponents/index.js +23 -57
- package/lib/theme/MDXContent/index.d.ts +9 -0
- package/lib/theme/MDXContent/index.js +12 -0
- package/lib/theme/MDXPage/index.d.ts +10 -0
- package/lib/theme/MDXPage/index.js +44 -56
- package/{lib-next/theme/Heading/styles.module.css → lib/theme/Navbar/ColorModeToggle/index.d.ts} +3 -9
- package/lib/theme/Navbar/ColorModeToggle/index.js +23 -0
- package/lib/theme/Navbar/Content/index.d.ts +8 -0
- package/lib/theme/Navbar/Content/index.js +71 -0
- package/lib/theme/Navbar/Content/styles.module.css +15 -0
- package/lib/theme/Navbar/Layout/index.d.ts +9 -0
- package/lib/theme/Navbar/Layout/index.js +52 -0
- package/{lib-next/theme/Navbar → lib/theme/Navbar/Layout}/styles.module.css +0 -6
- package/lib/theme/Navbar/Logo/index.d.ts +8 -0
- package/{lib-next/theme/TabItem → lib/theme/Navbar/Logo}/index.js +7 -12
- package/lib/theme/Navbar/MobileSidebar/Header/index.d.ts +8 -0
- package/lib/theme/Navbar/MobileSidebar/Header/index.js +31 -0
- package/lib/theme/Navbar/MobileSidebar/Layout/index.d.ts +9 -0
- package/lib/theme/Navbar/MobileSidebar/Layout/index.js +28 -0
- package/{lib-next/theme/TOCInline/styles.module.css → lib/theme/Navbar/MobileSidebar/PrimaryMenu/index.d.ts} +2 -6
- package/lib/theme/Navbar/MobileSidebar/PrimaryMenu/index.js +32 -0
- package/lib/theme/Navbar/MobileSidebar/SecondaryMenu/index.d.ts +8 -0
- package/lib/theme/Navbar/MobileSidebar/SecondaryMenu/index.js +35 -0
- package/lib/theme/Navbar/MobileSidebar/Toggle/index.d.ts +8 -0
- package/lib/theme/Navbar/MobileSidebar/Toggle/index.js +23 -0
- package/lib/theme/Navbar/MobileSidebar/index.d.ts +8 -0
- package/lib/theme/Navbar/MobileSidebar/index.js +29 -0
- package/lib/theme/Navbar/Search/index.d.ts +9 -0
- package/lib/theme/Navbar/Search/index.js +12 -0
- package/lib/theme/Navbar/Search/styles.module.css +20 -0
- package/lib/theme/Navbar/index.d.ts +8 -0
- package/lib/theme/Navbar/index.js +9 -140
- package/lib/theme/NavbarItem/ComponentTypes.d.ts +9 -0
- package/lib/theme/NavbarItem/ComponentTypes.js +27 -0
- package/lib/theme/NavbarItem/DefaultNavbarItem.d.ts +10 -0
- package/lib/theme/NavbarItem/DefaultNavbarItem.js +36 -193
- package/lib/theme/NavbarItem/DocNavbarItem.d.ts +9 -0
- package/lib/theme/NavbarItem/DocNavbarItem.js +24 -52
- package/lib/theme/NavbarItem/DocSidebarNavbarItem.d.ts +9 -0
- package/lib/theme/NavbarItem/DocSidebarNavbarItem.js +33 -0
- package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.d.ts +9 -0
- package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +75 -62
- package/lib/theme/NavbarItem/DocsVersionNavbarItem.d.ts +9 -0
- package/lib/theme/NavbarItem/DocsVersionNavbarItem.js +11 -32
- package/lib/theme/NavbarItem/DropdownNavbarItem.d.ts +9 -0
- package/lib/theme/NavbarItem/DropdownNavbarItem.js +162 -0
- package/lib/theme/NavbarItem/HtmlNavbarItem.d.ts +9 -0
- package/lib/theme/NavbarItem/HtmlNavbarItem.js +28 -0
- package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.d.ts +9 -0
- package/{src/theme/NavbarItem/LocaleDropdownNavbarItem.tsx → lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.js} +28 -27
- package/{lib-next/theme/hooks/styles.css → lib/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css} +3 -2
- package/lib/theme/NavbarItem/NavbarNavLink.d.ts +9 -0
- package/lib/theme/NavbarItem/NavbarNavLink.js +68 -0
- package/lib/theme/NavbarItem/SearchNavbarItem.d.ts +9 -0
- package/lib/theme/NavbarItem/SearchNavbarItem.js +10 -19
- package/lib/theme/NavbarItem/index.d.ts +9 -0
- package/lib/theme/NavbarItem/index.js +15 -45
- package/lib/theme/NotFound.d.ts +8 -0
- package/lib/theme/NotFound.js +44 -49
- package/lib/theme/PaginatorNavLink/index.d.ts +9 -0
- package/lib/theme/PaginatorNavLink/index.js +23 -0
- package/lib/theme/SearchBar.d.ts +7 -0
- package/lib/theme/SearchBar.js +11 -15
- package/lib/theme/SearchMetadata/index.d.ts +9 -0
- package/lib/theme/SearchMetadata/index.js +34 -0
- package/lib/theme/SiteMetadata/index.d.ts +8 -0
- package/lib/theme/SiteMetadata/index.js +117 -0
- package/lib/theme/SkipToContent/index.d.ts +8 -0
- package/lib/theme/SkipToContent/index.js +16 -62
- package/lib/theme/SkipToContent/styles.module.css +7 -0
- package/lib/theme/TOC/index.d.ts +9 -0
- package/lib/theme/TOC/index.js +18 -52
- package/lib/theme/TOC/styles.module.css +1 -1
- package/lib/theme/TOCCollapsible/CollapseButton/index.d.ts +9 -0
- package/lib/theme/TOCCollapsible/CollapseButton/index.js +29 -0
- package/lib/theme/TOCCollapsible/CollapseButton/styles.module.css +29 -0
- package/lib/theme/TOCCollapsible/index.d.ts +9 -0
- package/lib/theme/TOCCollapsible/index.js +42 -0
- package/lib/theme/TOCCollapsible/styles.module.css +31 -0
- package/lib/theme/TOCInline/index.d.ts +9 -0
- package/lib/theme/TOCInline/index.js +15 -46
- package/lib/theme/TOCItems/Tree.d.ts +11 -0
- package/lib/theme/TOCItems/Tree.js +37 -0
- package/lib/theme/TOCItems/index.d.ts +9 -0
- package/lib/theme/TOCItems/index.js +53 -0
- package/lib/theme/TabItem/index.d.ts +9 -0
- package/lib/theme/TabItem/index.js +11 -24
- package/lib/theme/{hooks/styles.css → TabItem/styles.module.css} +2 -2
- package/lib/theme/Tabs/index.d.ts +9 -0
- package/lib/theme/Tabs/index.js +159 -123
- package/lib/theme/Tabs/styles.module.css +4 -13
- package/lib/theme/Tag/index.d.ts +9 -0
- package/lib/theme/Tag/index.js +23 -0
- package/lib/theme/Tag/styles.module.css +70 -0
- package/lib/theme/TagsListByLetter/index.d.ts +9 -0
- package/lib/theme/TagsListByLetter/index.js +38 -0
- package/lib/theme/TagsListByLetter/styles.module.css +11 -0
- package/lib/theme/TagsListInline/index.d.ts +9 -0
- package/lib/theme/TagsListInline/index.js +31 -0
- package/lib/theme/TagsListInline/styles.module.css +15 -0
- package/lib/theme/ThemedImage/index.d.ts +9 -0
- package/lib/theme/ThemedImage/index.js +33 -43
- package/lib/theme/ThemedImage/styles.module.css +2 -2
- package/lib/theme/prism-include-languages.d.ts +8 -0
- package/lib/theme/prism-include-languages.js +19 -33
- package/lib/translations.d.ts +15 -0
- package/lib/translations.js +122 -122
- package/lib/validateThemeConfig.d.ts +12 -0
- package/lib/validateThemeConfig.js +367 -284
- package/package.json +36 -35
- package/src/admonitions.css +39 -0
- package/src/deps.d.ts +13 -0
- package/src/getSwizzleConfig.ts +245 -0
- package/src/index.ts +55 -76
- package/src/nprogress.css +41 -0
- package/src/nprogress.ts +31 -0
- package/{lib-next/prism-include-languages.js → src/prism-include-languages.ts} +0 -0
- package/src/theme/Admonition/index.tsx +106 -0
- package/src/theme/AnnouncementBar/index.tsx +9 -15
- package/src/theme/AnnouncementBar/styles.module.css +23 -32
- package/src/theme/BackToTopButton/index.tsx +34 -0
- package/src/theme/BackToTopButton/styles.module.css +44 -0
- package/src/theme/BlogArchivePage/index.tsx +92 -0
- package/src/theme/BlogLayout/index.tsx +38 -0
- package/src/theme/BlogListPage/index.tsx +45 -35
- package/src/theme/BlogListPaginator/index.tsx +27 -32
- package/src/theme/BlogPostAuthor/index.tsx +50 -0
- package/src/theme/BlogPostAuthors/index.tsx +49 -0
- package/{lib/theme/Toggle → src/theme/BlogPostAuthors}/styles.module.css +11 -7
- package/src/theme/BlogPostItem/index.tsx +86 -92
- package/src/theme/BlogPostItem/styles.module.css +9 -0
- package/src/theme/BlogPostPage/index.tsx +85 -39
- package/src/theme/BlogPostPaginator/index.tsx +27 -36
- package/src/theme/BlogSidebar/Desktop/index.tsx +45 -0
- package/src/theme/BlogSidebar/{styles.module.css → Desktop/styles.module.css} +5 -4
- package/src/theme/BlogSidebar/Mobile/index.tsx +38 -0
- package/src/theme/BlogSidebar/index.tsx +10 -33
- package/src/theme/BlogTagsListPage/index.tsx +24 -67
- package/src/theme/BlogTagsPostsPage/index.tsx +50 -49
- package/src/theme/CodeBlock/Container/index.tsx +35 -0
- package/src/theme/CodeBlock/Container/styles.module.css +14 -0
- package/src/theme/CodeBlock/Content/Element.tsx +30 -0
- package/src/theme/CodeBlock/Content/String.tsx +111 -0
- package/src/theme/CodeBlock/{styles.module.css → Content/styles.module.css} +45 -27
- package/src/theme/CodeBlock/CopyButton/index.tsx +67 -0
- package/src/theme/CodeBlock/CopyButton/styles.module.css +47 -0
- package/src/theme/CodeBlock/Line/index.tsx +49 -0
- package/src/theme/CodeBlock/Line/styles.module.css +51 -0
- package/src/theme/CodeBlock/WordWrapButton/index.tsx +49 -0
- package/src/theme/CodeBlock/WordWrapButton/styles.module.css +15 -0
- package/src/theme/CodeBlock/index.tsx +29 -253
- package/src/theme/ColorModeToggle/index.tsx +67 -0
- package/src/theme/ColorModeToggle/styles.module.css +35 -0
- package/src/theme/Details/index.tsx +26 -0
- package/src/theme/Details/styles.module.css +13 -0
- package/src/theme/DocBreadcrumbs/index.tsx +141 -0
- package/{lib-next/theme/Heading/styles.css → src/theme/DocBreadcrumbs/styles.module.css} +9 -13
- package/src/theme/DocCard/index.tsx +117 -0
- package/src/theme/DocCard/styles.module.css +34 -0
- package/src/theme/DocCardList/index.tsx +35 -0
- package/src/theme/DocCategoryGeneratedIndexPage/index.tsx +86 -0
- package/src/theme/DocCategoryGeneratedIndexPage/styles.module.css +26 -0
- package/src/theme/DocItem/index.tsx +92 -77
- package/src/theme/DocItem/styles.module.css +12 -10
- package/src/theme/DocItemFooter/index.tsx +90 -0
- package/{lib-next/theme/Toggle → src/theme/DocItemFooter}/styles.module.css +9 -8
- package/src/theme/DocPage/Layout/Main/index.tsx +36 -0
- package/src/theme/DocPage/Layout/Main/styles.module.css +28 -0
- package/src/theme/DocPage/Layout/Sidebar/ExpandButton/index.tsx +40 -0
- package/src/theme/DocPage/Layout/Sidebar/ExpandButton/styles.module.css +33 -0
- package/src/theme/DocPage/Layout/Sidebar/index.tsx +73 -0
- package/src/theme/DocPage/Layout/Sidebar/styles.module.css +32 -0
- package/src/theme/DocPage/Layout/index.tsx +38 -0
- package/src/theme/DocPage/Layout/styles.module.css +15 -0
- package/src/theme/DocPage/index.tsx +39 -167
- package/src/theme/DocPaginator/index.tsx +28 -39
- package/src/theme/DocSidebar/Desktop/CollapseButton/index.tsx +38 -0
- package/src/theme/DocSidebar/Desktop/CollapseButton/styles.module.css +46 -0
- package/src/theme/DocSidebar/Desktop/Content/index.tsx +55 -0
- package/src/theme/DocSidebar/Desktop/Content/styles.module.css +23 -0
- package/src/theme/DocSidebar/Desktop/index.tsx +40 -0
- package/src/theme/DocSidebar/Desktop/styles.module.css +50 -0
- package/src/theme/DocSidebar/Mobile/index.tsx +54 -0
- package/src/theme/DocSidebar/index.tsx +14 -351
- package/src/theme/DocSidebarItem/Category/index.tsx +209 -0
- package/src/theme/DocSidebarItem/Html/index.tsx +34 -0
- package/src/theme/DocSidebarItem/Html/styles.module.css +13 -0
- package/src/theme/DocSidebarItem/Link/index.tsx +57 -0
- package/src/theme/DocSidebarItem/Link/styles.module.css +10 -0
- package/src/theme/DocSidebarItem/index.tsx +27 -0
- package/src/theme/DocSidebarItems/index.tsx +27 -0
- package/src/theme/DocTagDocListPage/index.tsx +95 -0
- package/src/theme/DocTagsListPage/index.tsx +43 -0
- package/src/theme/DocVersionBadge/index.tsx +35 -0
- package/src/theme/DocVersionBanner/index.tsx +53 -27
- package/src/theme/EditThisPage/index.tsx +7 -3
- package/src/theme/ErrorPageContent.tsx +41 -0
- package/src/theme/Footer/Copyright/index.tsx +20 -0
- package/src/theme/Footer/Layout/index.tsx +34 -0
- package/src/theme/Footer/LinkItem/index.tsx +36 -0
- package/src/theme/Footer/Links/MultiColumn/index.tsx +51 -0
- package/src/theme/Footer/Links/Simple/index.tsx +42 -0
- package/src/theme/Footer/Links/index.tsx +21 -0
- package/src/theme/Footer/Logo/index.tsx +41 -0
- package/src/theme/Footer/{styles.module.css → Logo/styles.module.css} +2 -1
- package/src/theme/Footer/index.tsx +13 -122
- package/src/theme/Heading/index.tsx +31 -58
- package/src/theme/Heading/styles.module.css +25 -5
- package/src/theme/IconArrow/index.tsx +2 -4
- package/src/theme/IconClose/index.tsx +26 -0
- package/src/theme/IconDarkMode/index.tsx +20 -0
- package/src/theme/IconEdit/index.tsx +5 -5
- package/src/theme/IconExternalLink/index.tsx +3 -5
- package/src/theme/IconExternalLink/styles.module.css +0 -2
- package/src/theme/IconHome/index.tsx +20 -0
- package/src/theme/IconLanguage/index.tsx +6 -8
- package/src/theme/IconLightMode/index.tsx +20 -0
- package/src/theme/IconMenu/index.tsx +3 -5
- package/src/theme/LastUpdated/index.tsx +4 -2
- package/src/theme/Layout/index.tsx +22 -16
- package/src/theme/LayoutProviders/index.tsx +16 -9
- package/src/theme/Logo/index.tsx +23 -22
- package/src/theme/{ThemeContext.ts → MDXComponents/A.tsx} +5 -6
- package/src/theme/MDXComponents/Code.tsx +37 -0
- package/src/theme/MDXComponents/Details.tsx +27 -0
- package/src/theme/MDXComponents/Head.tsx +31 -0
- package/src/theme/MDXComponents/Heading.tsx +14 -0
- package/src/theme/MDXComponents/Img/index.tsx +27 -0
- package/src/theme/MDXComponents/Img/styles.module.css +10 -0
- package/src/theme/MDXComponents/Pre.tsx +22 -0
- package/src/theme/MDXComponents/Ul/index.tsx +26 -0
- package/src/theme/MDXComponents/Ul/styles.module.css +14 -0
- package/src/theme/MDXComponents/index.tsx +23 -42
- package/src/theme/MDXContent/index.tsx +15 -0
- package/src/theme/MDXPage/index.tsx +38 -35
- package/src/theme/Navbar/ColorModeToggle/index.tsx +30 -0
- package/src/theme/Navbar/Content/index.tsx +86 -0
- package/src/theme/Navbar/Content/styles.module.css +15 -0
- package/src/theme/Navbar/Layout/index.tsx +57 -0
- package/{lib/theme/Navbar → src/theme/Navbar/Layout}/styles.module.css +0 -6
- package/src/theme/Navbar/Logo/index.tsx +19 -0
- package/src/theme/Navbar/MobileSidebar/Header/index.tsx +34 -0
- package/src/theme/Navbar/MobileSidebar/Layout/index.tsx +31 -0
- package/src/theme/Navbar/MobileSidebar/PrimaryMenu/index.tsx +37 -0
- package/src/theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx +38 -0
- package/src/theme/Navbar/MobileSidebar/Toggle/index.tsx +25 -0
- package/src/theme/Navbar/MobileSidebar/index.tsx +33 -0
- package/src/theme/Navbar/Search/index.tsx +19 -0
- package/src/theme/Navbar/Search/styles.module.css +20 -0
- package/src/theme/Navbar/index.tsx +7 -147
- package/src/theme/NavbarItem/ComponentTypes.tsx +32 -0
- package/src/theme/NavbarItem/DefaultNavbarItem.tsx +36 -208
- package/src/theme/NavbarItem/DocNavbarItem.tsx +13 -41
- package/src/theme/NavbarItem/DocSidebarNavbarItem.tsx +36 -0
- package/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +59 -52
- package/src/theme/NavbarItem/DocsVersionNavbarItem.tsx +5 -8
- package/src/theme/NavbarItem/DropdownNavbarItem.tsx +191 -0
- package/src/theme/NavbarItem/HtmlNavbarItem.tsx +32 -0
- package/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx +77 -0
- package/src/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css +11 -0
- package/src/theme/NavbarItem/NavbarNavLink.tsx +74 -0
- package/src/theme/NavbarItem/SearchNavbarItem.tsx +11 -3
- package/src/theme/NavbarItem/index.tsx +15 -32
- package/src/theme/NotFound.tsx +40 -37
- package/src/theme/PaginatorNavLink/index.tsx +26 -0
- package/src/theme/SearchBar.tsx +2 -1
- package/src/theme/SearchMetadata/index.tsx +43 -0
- package/src/theme/{LayoutHead → SiteMetadata}/index.tsx +31 -44
- package/src/theme/SkipToContent/index.tsx +5 -33
- package/src/theme/SkipToContent/styles.module.css +7 -0
- package/src/theme/TOC/index.tsx +14 -44
- package/src/theme/TOC/styles.module.css +1 -1
- package/src/theme/TOCCollapsible/CollapseButton/index.tsx +36 -0
- package/src/theme/TOCCollapsible/CollapseButton/styles.module.css +29 -0
- package/src/theme/TOCCollapsible/index.tsx +46 -0
- package/src/theme/TOCCollapsible/styles.module.css +31 -0
- package/src/theme/TOCInline/index.tsx +15 -35
- package/src/theme/TOCItems/Tree.tsx +46 -0
- package/src/theme/TOCItems/index.tsx +61 -0
- package/src/theme/TabItem/index.tsx +12 -4
- package/src/theme/TabItem/styles.module.css +10 -0
- package/src/theme/Tabs/index.tsx +121 -62
- package/src/theme/Tabs/styles.module.css +4 -13
- package/src/theme/Tag/index.tsx +27 -0
- package/src/theme/Tag/styles.module.css +70 -0
- package/src/theme/TagsListByLetter/index.tsx +43 -0
- package/src/theme/TagsListByLetter/styles.module.css +11 -0
- package/src/theme/TagsListInline/index.tsx +35 -0
- package/src/theme/TagsListInline/styles.module.css +15 -0
- package/src/theme/ThemedImage/index.tsx +10 -12
- package/src/theme/ThemedImage/styles.module.css +2 -2
- package/src/theme/prism-include-languages.ts +20 -15
- package/src/theme-classic.d.ts +1272 -0
- package/src/translations.ts +85 -60
- package/src/validateThemeConfig.ts +448 -0
- package/babel.config.js +0 -35
- package/codeTranslations/README.md +0 -20
- package/codeTranslations/ar.json +0 -57
- package/codeTranslations/base.json +0 -112
- package/codeTranslations/bn.json +0 -56
- package/codeTranslations/da.json +0 -57
- package/codeTranslations/de.json +0 -57
- package/codeTranslations/es.json +0 -57
- package/codeTranslations/fa.json +0 -57
- package/codeTranslations/fil.json +0 -57
- package/codeTranslations/fr.json +0 -57
- package/codeTranslations/he.json +0 -57
- package/codeTranslations/hi.json +0 -57
- package/codeTranslations/ja.json +0 -57
- package/codeTranslations/ko.json +0 -57
- package/codeTranslations/pl.json +0 -57
- package/codeTranslations/pt-BR.json +0 -57
- package/codeTranslations/pt-PT.json +0 -57
- package/codeTranslations/ru.json +0 -57
- package/codeTranslations/tr.json +0 -57
- package/codeTranslations/vi.json +0 -57
- package/codeTranslations/zh-Hans.json +0 -57
- package/codeTranslations/zh-Hant.json +0 -57
- package/lib/__tests__/__snapshots__/translations.test.ts.snap +0 -116
- package/lib/__tests__/translations.test.js +0 -112
- package/lib/__tests__/validateThemeConfig.test.js +0 -333
- package/lib/theme/BlogSidebar/styles.module.css +0 -44
- package/lib/theme/CodeBlock/styles.module.css +0 -68
- package/lib/theme/DocPage/styles.module.css +0 -80
- package/lib/theme/DocSidebar/styles.module.css +0 -124
- package/lib/theme/LayoutHead/index.js +0 -144
- package/lib/theme/NavbarItem/LocaleDropdownNavbarItem.js +0 -72
- package/lib/theme/SearchMetadatas/index.js +0 -33
- package/lib/theme/Seo/index.js +0 -49
- package/lib/theme/ThemeContext.js +0 -21
- package/lib/theme/ThemeProvider/index.js +0 -38
- package/lib/theme/Toggle/index.js +0 -94
- package/lib/theme/Toggle/styles.css +0 -103
- package/lib/theme/UserPreferencesContext.js +0 -18
- package/lib/theme/UserPreferencesProvider/index.js +0 -36
- package/lib/theme/hooks/useContextualSearchFilters.js +0 -47
- package/lib/theme/hooks/useDocs.js +0 -18
- package/lib/theme/hooks/useHideableNavbar.js +0 -92
- package/lib/theme/hooks/useKeyboardNavigation.js +0 -45
- package/lib/theme/hooks/useLocationHash.js +0 -28
- package/lib/theme/hooks/useLockBodyScroll.js +0 -26
- package/lib/theme/hooks/usePrismTheme.js +0 -36
- package/lib/theme/hooks/useScrollPosition.js +0 -49
- package/lib/theme/hooks/useTOCHighlight.js +0 -87
- package/lib/theme/hooks/useTabGroupChoice.js +0 -51
- package/lib/theme/hooks/useTheme.js +0 -99
- package/lib/theme/hooks/useThemeContext.js +0 -31
- package/lib/theme/hooks/useUserPreferencesContext.js +0 -31
- package/lib/theme/hooks/useWindowSize.js +0 -55
- package/lib/types.d.ts +0 -598
- package/lib-next/__tests__/__snapshots__/translations.test.ts.snap +0 -116
- package/lib-next/__tests__/translations.test.js +0 -128
- package/lib-next/__tests__/validateThemeConfig.test.js +0 -333
- package/lib-next/index.js +0 -221
- package/lib-next/theme/AnnouncementBar/index.js +0 -61
- package/lib-next/theme/AnnouncementBar/styles.module.css +0 -72
- package/lib-next/theme/BlogListPage/index.js +0 -56
- package/lib-next/theme/BlogListPaginator/index.js +0 -54
- package/lib-next/theme/BlogPostItem/index.js +0 -168
- package/lib-next/theme/BlogPostPage/index.js +0 -55
- package/lib-next/theme/BlogPostPaginator/index.js +0 -57
- package/lib-next/theme/BlogTagsListPage/index.js +0 -75
- package/lib-next/theme/BlogTagsPostsPage/index.js +0 -92
- package/lib-next/theme/CodeBlock/index.js +0 -268
- package/lib-next/theme/DocItem/index.js +0 -117
- package/lib-next/theme/DocPage/index.js +0 -173
- package/lib-next/theme/DocPage/styles.module.css +0 -80
- package/lib-next/theme/DocPaginator/index.js +0 -59
- package/lib-next/theme/DocSidebar/index.js +0 -352
- package/lib-next/theme/DocSidebar/styles.module.css +0 -124
- package/lib-next/theme/DocVersionBanner/index.js +0 -127
- package/lib-next/theme/EditThisPage/index.js +0 -21
- package/lib-next/theme/Footer/index.js +0 -129
- package/lib-next/theme/Heading/index.js +0 -67
- package/lib-next/theme/IconArrow/index.js +0 -20
- package/lib-next/theme/IconEdit/index.js +0 -28
- package/lib-next/theme/IconExternalLink/index.js +0 -26
- package/lib-next/theme/IconLanguage/index.js +0 -25
- package/lib-next/theme/IconMenu/index.js +0 -29
- package/lib-next/theme/LastUpdated/index.js +0 -77
- package/lib-next/theme/Layout/index.js +0 -46
- package/lib-next/theme/Layout/styles.css +0 -27
- package/lib-next/theme/LayoutHead/index.js +0 -137
- package/lib-next/theme/LayoutProviders/index.js +0 -26
- package/lib-next/theme/Logo/index.js +0 -54
- package/lib-next/theme/MDXComponents/index.js +0 -51
- package/lib-next/theme/MDXPage/index.js +0 -51
- package/lib-next/theme/Navbar/index.js +0 -146
- package/lib-next/theme/NavbarItem/DefaultNavbarItem.js +0 -227
- package/lib-next/theme/NavbarItem/DocNavbarItem.js +0 -57
- package/lib-next/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +0 -83
- package/lib-next/theme/NavbarItem/DocsVersionNavbarItem.js +0 -28
- package/lib-next/theme/NavbarItem/LocaleDropdownNavbarItem.js +0 -66
- package/lib-next/theme/NavbarItem/index.js +0 -41
- package/lib-next/theme/NotFound.js +0 -50
- package/lib-next/theme/SearchBar.js +0 -11
- package/lib-next/theme/SearchMetadatas/index.js +0 -20
- package/lib-next/theme/Seo/index.js +0 -36
- package/lib-next/theme/SkipToContent/index.js +0 -53
- package/lib-next/theme/SkipToContent/styles.module.css +0 -14
- package/lib-next/theme/TOC/index.js +0 -52
- package/lib-next/theme/TOC/styles.module.css +0 -23
- package/lib-next/theme/TOCInline/index.js +0 -43
- package/lib-next/theme/Tabs/index.js +0 -144
- package/lib-next/theme/Tabs/styles.module.css +0 -23
- package/lib-next/theme/ThemeProvider/index.js +0 -25
- package/lib-next/theme/ThemedImage/index.js +0 -41
- package/lib-next/theme/ThemedImage/styles.module.css +0 -18
- package/lib-next/theme/Toggle/index.js +0 -80
- package/lib-next/theme/Toggle/styles.css +0 -103
- package/lib-next/theme/UserPreferencesContext.js +0 -9
- package/lib-next/theme/UserPreferencesProvider/index.js +0 -24
- package/lib-next/theme/hooks/useContextualSearchFilters.js +0 -41
- package/lib-next/theme/hooks/useDocs.js +0 -10
- package/lib-next/theme/hooks/useHideableNavbar.js +0 -79
- package/lib-next/theme/hooks/useKeyboardNavigation.js +0 -35
- package/lib-next/theme/hooks/useLocationHash.js +0 -20
- package/lib-next/theme/hooks/useLockBodyScroll.js +0 -18
- package/lib-next/theme/hooks/usePrismTheme.js +0 -20
- package/lib-next/theme/hooks/useScrollPosition.js +0 -38
- package/lib-next/theme/hooks/useTOCHighlight.js +0 -84
- package/lib-next/theme/hooks/useTabGroupChoice.js +0 -39
- package/lib-next/theme/hooks/useTheme.js +0 -82
- package/lib-next/theme/hooks/useThemeContext.js +0 -22
- package/lib-next/theme/hooks/useUserPreferencesContext.js +0 -22
- package/lib-next/theme/hooks/useWindowSize.js +0 -45
- package/lib-next/theme/prism-include-languages.js +0 -23
- package/lib-next/translations.js +0 -145
- package/lib-next/types.d.ts +0 -598
- package/lib-next/validateThemeConfig.js +0 -317
- package/src/__tests__/__snapshots__/translations.test.ts.snap +0 -116
- package/src/__tests__/translations.test.ts +0 -116
- package/src/__tests__/validateThemeConfig.test.js +0 -333
- package/src/prism-include-languages.js +0 -11
- package/src/theme/DocPage/styles.module.css +0 -80
- package/src/theme/DocSidebar/styles.module.css +0 -124
- package/src/theme/Heading/styles.css +0 -23
- package/src/theme/Navbar/styles.module.css +0 -20
- package/src/theme/SearchMetadatas/index.tsx +0 -28
- package/src/theme/Seo/index.tsx +0 -46
- package/src/theme/ThemeProvider/index.tsx +0 -24
- package/src/theme/Toggle/index.tsx +0 -100
- package/src/theme/Toggle/styles.css +0 -103
- package/src/theme/UserPreferencesContext.ts +0 -12
- package/src/theme/UserPreferencesProvider/index.tsx +0 -27
- package/src/theme/hooks/styles.css +0 -10
- package/src/theme/hooks/useContextualSearchFilters.ts +0 -52
- package/src/theme/hooks/useDocs.ts +0 -11
- package/src/theme/hooks/useHideableNavbar.ts +0 -85
- package/src/theme/hooks/useKeyboardNavigation.ts +0 -39
- package/src/theme/hooks/useLocationHash.ts +0 -25
- package/src/theme/hooks/usePrismTheme.ts +0 -22
- package/src/theme/hooks/useScrollPosition.ts +0 -45
- package/src/theme/hooks/useTOCHighlight.ts +0 -98
- package/src/theme/hooks/useTabGroupChoice.ts +0 -46
- package/src/theme/hooks/useTheme.ts +0 -92
- package/src/theme/hooks/useThemeContext.ts +0 -23
- package/src/theme/hooks/useUserPreferencesContext.ts +0 -25
- package/src/theme/hooks/useWindowSize.ts +0 -51
- package/src/types.d.ts +0 -598
- package/src/validateThemeConfig.js +0 -317
- package/tsconfig.json +0 -12
- package/update-code-translations.js +0 -240
- package/update-code-translations.test.js +0 -33
|
@@ -0,0 +1,27 @@
|
|
|
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 DocSidebarItemCategory from '@theme/DocSidebarItem/Category';
|
|
10
|
+
import DocSidebarItemLink from '@theme/DocSidebarItem/Link';
|
|
11
|
+
import DocSidebarItemHtml from '@theme/DocSidebarItem/Html';
|
|
12
|
+
import type {Props} from '@theme/DocSidebarItem';
|
|
13
|
+
|
|
14
|
+
export default function DocSidebarItem({
|
|
15
|
+
item,
|
|
16
|
+
...props
|
|
17
|
+
}: Props): JSX.Element | null {
|
|
18
|
+
switch (item.type) {
|
|
19
|
+
case 'category':
|
|
20
|
+
return <DocSidebarItemCategory item={item} {...props} />;
|
|
21
|
+
case 'html':
|
|
22
|
+
return <DocSidebarItemHtml item={item} {...props} />;
|
|
23
|
+
case 'link':
|
|
24
|
+
default:
|
|
25
|
+
return <DocSidebarItemLink item={item} {...props} />;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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, {memo} from 'react';
|
|
9
|
+
import {DocSidebarItemsExpandedStateProvider} from '@docusaurus/theme-common';
|
|
10
|
+
import DocSidebarItem from '@theme/DocSidebarItem';
|
|
11
|
+
|
|
12
|
+
import type {Props} from '@theme/DocSidebarItems';
|
|
13
|
+
|
|
14
|
+
// TODO this item should probably not receive the "activePath" props
|
|
15
|
+
// TODO this triggers whole sidebar re-renders on navigation
|
|
16
|
+
function DocSidebarItems({items, ...props}: Props): JSX.Element {
|
|
17
|
+
return (
|
|
18
|
+
<DocSidebarItemsExpandedStateProvider>
|
|
19
|
+
{items.map((item, index) => (
|
|
20
|
+
<DocSidebarItem key={index} item={item} index={index} {...props} />
|
|
21
|
+
))}
|
|
22
|
+
</DocSidebarItemsExpandedStateProvider>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Optimize sidebar at each "level"
|
|
27
|
+
export default memo(DocSidebarItems);
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
import Link from '@docusaurus/Link';
|
|
11
|
+
import {
|
|
12
|
+
PageMetadata,
|
|
13
|
+
HtmlClassNameProvider,
|
|
14
|
+
ThemeClassNames,
|
|
15
|
+
usePluralForm,
|
|
16
|
+
} from '@docusaurus/theme-common';
|
|
17
|
+
import Translate, {translate} from '@docusaurus/Translate';
|
|
18
|
+
import Layout from '@theme/Layout';
|
|
19
|
+
import SearchMetadata from '@theme/SearchMetadata';
|
|
20
|
+
import type {Props} from '@theme/DocTagDocListPage';
|
|
21
|
+
|
|
22
|
+
// Very simple pluralization: probably good enough for now
|
|
23
|
+
function useNDocsTaggedPlural() {
|
|
24
|
+
const {selectMessage} = usePluralForm();
|
|
25
|
+
return (count: number) =>
|
|
26
|
+
selectMessage(
|
|
27
|
+
count,
|
|
28
|
+
translate(
|
|
29
|
+
{
|
|
30
|
+
id: 'theme.docs.tagDocListPageTitle.nDocsTagged',
|
|
31
|
+
description:
|
|
32
|
+
'Pluralized label for "{count} docs tagged". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)',
|
|
33
|
+
message: 'One doc tagged|{count} docs tagged',
|
|
34
|
+
},
|
|
35
|
+
{count},
|
|
36
|
+
),
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function DocItem({doc}: {doc: Props['tag']['items'][number]}): JSX.Element {
|
|
41
|
+
return (
|
|
42
|
+
<article className="margin-vert--lg">
|
|
43
|
+
<Link to={doc.permalink}>
|
|
44
|
+
<h2>{doc.title}</h2>
|
|
45
|
+
</Link>
|
|
46
|
+
{doc.description && <p>{doc.description}</p>}
|
|
47
|
+
</article>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default function DocTagDocListPage({tag}: Props): JSX.Element {
|
|
52
|
+
const nDocsTaggedPlural = useNDocsTaggedPlural();
|
|
53
|
+
const title = translate(
|
|
54
|
+
{
|
|
55
|
+
id: 'theme.docs.tagDocListPageTitle',
|
|
56
|
+
description: 'The title of the page for a docs tag',
|
|
57
|
+
message: '{nDocsTagged} with "{tagName}"',
|
|
58
|
+
},
|
|
59
|
+
{nDocsTagged: nDocsTaggedPlural(tag.count), tagName: tag.label},
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<HtmlClassNameProvider
|
|
64
|
+
className={clsx(
|
|
65
|
+
ThemeClassNames.wrapper.docsPages,
|
|
66
|
+
ThemeClassNames.page.docsTagDocListPage,
|
|
67
|
+
)}>
|
|
68
|
+
<PageMetadata title={title} />
|
|
69
|
+
<SearchMetadata tag="doc_tag_doc_list" />
|
|
70
|
+
<Layout>
|
|
71
|
+
<div className="container margin-vert--lg">
|
|
72
|
+
<div className="row">
|
|
73
|
+
<main className="col col--8 col--offset-2">
|
|
74
|
+
<header className="margin-bottom--xl">
|
|
75
|
+
<h1>{title}</h1>
|
|
76
|
+
<Link href={tag.allTagsPath}>
|
|
77
|
+
<Translate
|
|
78
|
+
id="theme.tags.tagsPageLink"
|
|
79
|
+
description="The label of the link targeting the tag list page">
|
|
80
|
+
View All Tags
|
|
81
|
+
</Translate>
|
|
82
|
+
</Link>
|
|
83
|
+
</header>
|
|
84
|
+
<section className="margin-vert--lg">
|
|
85
|
+
{tag.items.map((doc) => (
|
|
86
|
+
<DocItem key={doc.id} doc={doc} />
|
|
87
|
+
))}
|
|
88
|
+
</section>
|
|
89
|
+
</main>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</Layout>
|
|
93
|
+
</HtmlClassNameProvider>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
import {
|
|
11
|
+
PageMetadata,
|
|
12
|
+
HtmlClassNameProvider,
|
|
13
|
+
ThemeClassNames,
|
|
14
|
+
translateTagsPageTitle,
|
|
15
|
+
} from '@docusaurus/theme-common';
|
|
16
|
+
import Layout from '@theme/Layout';
|
|
17
|
+
import TagsListByLetter from '@theme/TagsListByLetter';
|
|
18
|
+
import SearchMetadata from '@theme/SearchMetadata';
|
|
19
|
+
import type {Props} from '@theme/DocTagsListPage';
|
|
20
|
+
|
|
21
|
+
export default function DocTagsListPage({tags}: Props): JSX.Element {
|
|
22
|
+
const title = translateTagsPageTitle();
|
|
23
|
+
return (
|
|
24
|
+
<HtmlClassNameProvider
|
|
25
|
+
className={clsx(
|
|
26
|
+
ThemeClassNames.wrapper.docsPages,
|
|
27
|
+
ThemeClassNames.page.docsTagsListPage,
|
|
28
|
+
)}>
|
|
29
|
+
<PageMetadata title={title} />
|
|
30
|
+
<SearchMetadata tag="doc_tags_list" />
|
|
31
|
+
<Layout>
|
|
32
|
+
<div className="container margin-vert--lg">
|
|
33
|
+
<div className="row">
|
|
34
|
+
<main className="col col--8 col--offset-2">
|
|
35
|
+
<h1>{title}</h1>
|
|
36
|
+
<TagsListByLetter tags={tags} />
|
|
37
|
+
</main>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</Layout>
|
|
41
|
+
</HtmlClassNameProvider>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
import Translate from '@docusaurus/Translate';
|
|
11
|
+
import {ThemeClassNames, useDocsVersion} from '@docusaurus/theme-common';
|
|
12
|
+
import type {Props} from '@theme/DocVersionBadge';
|
|
13
|
+
|
|
14
|
+
export default function DocVersionBadge({
|
|
15
|
+
className,
|
|
16
|
+
}: Props): JSX.Element | null {
|
|
17
|
+
const versionMetadata = useDocsVersion();
|
|
18
|
+
if (versionMetadata.badge) {
|
|
19
|
+
return (
|
|
20
|
+
<span
|
|
21
|
+
className={clsx(
|
|
22
|
+
className,
|
|
23
|
+
ThemeClassNames.docs.docVersionBadge,
|
|
24
|
+
'badge badge--secondary',
|
|
25
|
+
)}>
|
|
26
|
+
<Translate
|
|
27
|
+
id="theme.docs.versionBadge.label"
|
|
28
|
+
values={{versionLabel: versionMetadata.label}}>
|
|
29
|
+
{'Version: {versionLabel}'}
|
|
30
|
+
</Translate>
|
|
31
|
+
</span>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
@@ -5,18 +5,31 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import React, {ComponentType} from 'react';
|
|
8
|
+
import React, {type ComponentType} from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
9
10
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
10
11
|
import Link from '@docusaurus/Link';
|
|
11
12
|
import Translate from '@docusaurus/Translate';
|
|
12
|
-
import {
|
|
13
|
-
|
|
13
|
+
import {
|
|
14
|
+
useActivePlugin,
|
|
15
|
+
useDocVersionSuggestions,
|
|
16
|
+
type GlobalVersion,
|
|
17
|
+
} from '@docusaurus/plugin-content-docs/client';
|
|
18
|
+
import {
|
|
19
|
+
ThemeClassNames,
|
|
20
|
+
useDocsPreferredVersion,
|
|
21
|
+
useDocsVersion,
|
|
22
|
+
} from '@docusaurus/theme-common';
|
|
14
23
|
|
|
15
24
|
import type {Props} from '@theme/DocVersionBanner';
|
|
25
|
+
import type {
|
|
26
|
+
VersionBanner,
|
|
27
|
+
PropVersionMetadata,
|
|
28
|
+
} from '@docusaurus/plugin-content-docs';
|
|
16
29
|
|
|
17
30
|
type BannerLabelComponentProps = {
|
|
18
31
|
siteTitle: string;
|
|
19
|
-
versionMetadata:
|
|
32
|
+
versionMetadata: PropVersionMetadata;
|
|
20
33
|
};
|
|
21
34
|
|
|
22
35
|
function UnreleasedVersionLabel({
|
|
@@ -57,17 +70,16 @@ function UnmaintainedVersionLabel({
|
|
|
57
70
|
);
|
|
58
71
|
}
|
|
59
72
|
|
|
60
|
-
const BannerLabelComponents:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
> = {
|
|
73
|
+
const BannerLabelComponents: {
|
|
74
|
+
[banner in VersionBanner]: ComponentType<BannerLabelComponentProps>;
|
|
75
|
+
} = {
|
|
64
76
|
unreleased: UnreleasedVersionLabel,
|
|
65
77
|
unmaintained: UnmaintainedVersionLabel,
|
|
66
78
|
};
|
|
67
79
|
|
|
68
80
|
function BannerLabel(props: BannerLabelComponentProps) {
|
|
69
81
|
const BannerLabelComponent =
|
|
70
|
-
BannerLabelComponents[props.versionMetadata.banner];
|
|
82
|
+
BannerLabelComponents[props.versionMetadata.banner!];
|
|
71
83
|
return <BannerLabelComponent {...props} />;
|
|
72
84
|
}
|
|
73
85
|
|
|
@@ -105,29 +117,38 @@ function LatestVersionSuggestionLabel({
|
|
|
105
117
|
);
|
|
106
118
|
}
|
|
107
119
|
|
|
108
|
-
function DocVersionBannerEnabled({
|
|
120
|
+
function DocVersionBannerEnabled({
|
|
121
|
+
className,
|
|
122
|
+
versionMetadata,
|
|
123
|
+
}: Props & {
|
|
124
|
+
versionMetadata: PropVersionMetadata;
|
|
125
|
+
}): JSX.Element {
|
|
109
126
|
const {
|
|
110
127
|
siteConfig: {title: siteTitle},
|
|
111
128
|
} = useDocusaurusContext();
|
|
112
|
-
const {pluginId} = useActivePlugin({failfast: true})
|
|
129
|
+
const {pluginId} = useActivePlugin({failfast: true})!;
|
|
113
130
|
|
|
114
|
-
const getVersionMainDoc = (version) =>
|
|
115
|
-
version.docs.find((doc) => doc.id === version.mainDocId)
|
|
131
|
+
const getVersionMainDoc = (version: GlobalVersion) =>
|
|
132
|
+
version.docs.find((doc) => doc.id === version.mainDocId)!;
|
|
116
133
|
|
|
117
134
|
const {savePreferredVersionName} = useDocsPreferredVersion(pluginId);
|
|
118
135
|
|
|
119
|
-
const {
|
|
120
|
-
|
|
121
|
-
latestVersionSuggestion,
|
|
122
|
-
} = useDocVersionSuggestions(pluginId);
|
|
136
|
+
const {latestDocSuggestion, latestVersionSuggestion} =
|
|
137
|
+
useDocVersionSuggestions(pluginId);
|
|
123
138
|
|
|
124
|
-
//
|
|
125
|
-
//
|
|
139
|
+
// Try to link to same doc in latest version (not always possible), falling
|
|
140
|
+
// back to main doc of latest version
|
|
126
141
|
const latestVersionSuggestedDoc =
|
|
127
142
|
latestDocSuggestion ?? getVersionMainDoc(latestVersionSuggestion);
|
|
128
143
|
|
|
129
144
|
return (
|
|
130
|
-
<div
|
|
145
|
+
<div
|
|
146
|
+
className={clsx(
|
|
147
|
+
className,
|
|
148
|
+
ThemeClassNames.docs.docVersionBanner,
|
|
149
|
+
'alert alert--warning margin-bottom--md',
|
|
150
|
+
)}
|
|
151
|
+
role="alert">
|
|
131
152
|
<div>
|
|
132
153
|
<BannerLabel siteTitle={siteTitle} versionMetadata={versionMetadata} />
|
|
133
154
|
</div>
|
|
@@ -142,12 +163,17 @@ function DocVersionBannerEnabled({versionMetadata}: Props): JSX.Element {
|
|
|
142
163
|
);
|
|
143
164
|
}
|
|
144
165
|
|
|
145
|
-
function DocVersionBanner({
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
166
|
+
export default function DocVersionBanner({
|
|
167
|
+
className,
|
|
168
|
+
}: Props): JSX.Element | null {
|
|
169
|
+
const versionMetadata = useDocsVersion();
|
|
170
|
+
if (versionMetadata.banner) {
|
|
171
|
+
return (
|
|
172
|
+
<DocVersionBannerEnabled
|
|
173
|
+
className={className}
|
|
174
|
+
versionMetadata={versionMetadata}
|
|
175
|
+
/>
|
|
176
|
+
);
|
|
150
177
|
}
|
|
178
|
+
return null;
|
|
151
179
|
}
|
|
152
|
-
|
|
153
|
-
export default DocVersionBanner;
|
|
@@ -7,13 +7,17 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import Translate from '@docusaurus/Translate';
|
|
10
|
-
|
|
11
|
-
import type {Props} from '@theme/EditThisPage';
|
|
10
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
12
11
|
import IconEdit from '@theme/IconEdit';
|
|
12
|
+
import type {Props} from '@theme/EditThisPage';
|
|
13
13
|
|
|
14
14
|
export default function EditThisPage({editUrl}: Props): JSX.Element {
|
|
15
15
|
return (
|
|
16
|
-
<a
|
|
16
|
+
<a
|
|
17
|
+
href={editUrl}
|
|
18
|
+
target="_blank"
|
|
19
|
+
rel="noreferrer noopener"
|
|
20
|
+
className={ThemeClassNames.common.editThisPage}>
|
|
17
21
|
<IconEdit />
|
|
18
22
|
<Translate
|
|
19
23
|
id="theme.common.editThisPage"
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import Translate from '@docusaurus/Translate';
|
|
10
|
+
import type {Props} from '@theme/Error';
|
|
11
|
+
|
|
12
|
+
export default function ErrorPageContent({
|
|
13
|
+
error,
|
|
14
|
+
tryAgain,
|
|
15
|
+
}: Props): JSX.Element {
|
|
16
|
+
return (
|
|
17
|
+
<main className="container margin-vert--xl">
|
|
18
|
+
<div className="row">
|
|
19
|
+
<div className="col col--6 col--offset-3">
|
|
20
|
+
<h1 className="hero__title">
|
|
21
|
+
<Translate
|
|
22
|
+
id="theme.ErrorPageContent.title"
|
|
23
|
+
description="The title of the fallback page when the page crashed">
|
|
24
|
+
This page crashed.
|
|
25
|
+
</Translate>
|
|
26
|
+
</h1>
|
|
27
|
+
<p>{error.message}</p>
|
|
28
|
+
<div>
|
|
29
|
+
<button type="button" onClick={tryAgain}>
|
|
30
|
+
<Translate
|
|
31
|
+
id="theme.ErrorPageContent.tryAgain"
|
|
32
|
+
description="The label of the button to try again when the page crashed">
|
|
33
|
+
Try again
|
|
34
|
+
</Translate>
|
|
35
|
+
</button>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</main>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 type {Props} from '@theme/Footer/Copyright';
|
|
10
|
+
|
|
11
|
+
export default function FooterCopyright({copyright}: Props): JSX.Element {
|
|
12
|
+
return (
|
|
13
|
+
<div
|
|
14
|
+
className="footer__copyright"
|
|
15
|
+
// Developer provided the HTML, so assume it's safe.
|
|
16
|
+
// eslint-disable-next-line react/no-danger
|
|
17
|
+
dangerouslySetInnerHTML={{__html: copyright}}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
import type {Props} from '@theme/Footer/Layout';
|
|
11
|
+
|
|
12
|
+
export default function FooterLayout({
|
|
13
|
+
style,
|
|
14
|
+
links,
|
|
15
|
+
logo,
|
|
16
|
+
copyright,
|
|
17
|
+
}: Props): JSX.Element {
|
|
18
|
+
return (
|
|
19
|
+
<footer
|
|
20
|
+
className={clsx('footer', {
|
|
21
|
+
'footer--dark': style === 'dark',
|
|
22
|
+
})}>
|
|
23
|
+
<div className="container container-fluid">
|
|
24
|
+
{links}
|
|
25
|
+
{(logo || copyright) && (
|
|
26
|
+
<div className="footer__bottom text--center">
|
|
27
|
+
{logo && <div className="margin-bottom--sm">{logo}</div>}
|
|
28
|
+
{copyright}
|
|
29
|
+
</div>
|
|
30
|
+
)}
|
|
31
|
+
</div>
|
|
32
|
+
</footer>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
|
|
10
|
+
import Link from '@docusaurus/Link';
|
|
11
|
+
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
12
|
+
import isInternalUrl from '@docusaurus/isInternalUrl';
|
|
13
|
+
import IconExternalLink from '@theme/IconExternalLink';
|
|
14
|
+
import type {Props} from '@theme/Footer/LinkItem';
|
|
15
|
+
|
|
16
|
+
export default function FooterLinkItem({item}: Props): JSX.Element {
|
|
17
|
+
const {to, href, label, prependBaseUrlToHref, ...props} = item;
|
|
18
|
+
const toUrl = useBaseUrl(to);
|
|
19
|
+
const normalizedHref = useBaseUrl(href, {forcePrependBaseUrl: true});
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Link
|
|
23
|
+
className="footer__link-item"
|
|
24
|
+
{...(href
|
|
25
|
+
? {
|
|
26
|
+
href: prependBaseUrlToHref ? normalizedHref : href,
|
|
27
|
+
}
|
|
28
|
+
: {
|
|
29
|
+
to: toUrl,
|
|
30
|
+
})}
|
|
31
|
+
{...props}>
|
|
32
|
+
{label}
|
|
33
|
+
{href && !isInternalUrl(href) && <IconExternalLink />}
|
|
34
|
+
</Link>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 LinkItem from '@theme/Footer/LinkItem';
|
|
10
|
+
import type {Props} from '@theme/Footer/Links/MultiColumn';
|
|
11
|
+
|
|
12
|
+
type ColumnType = Props['columns'][number];
|
|
13
|
+
type ColumnItemType = ColumnType['items'][number];
|
|
14
|
+
|
|
15
|
+
function ColumnLinkItem({item}: {item: ColumnItemType}) {
|
|
16
|
+
return item.html ? (
|
|
17
|
+
<li
|
|
18
|
+
className="footer__item"
|
|
19
|
+
// Developer provided the HTML, so assume it's safe.
|
|
20
|
+
// eslint-disable-next-line react/no-danger
|
|
21
|
+
dangerouslySetInnerHTML={{__html: item.html}}
|
|
22
|
+
/>
|
|
23
|
+
) : (
|
|
24
|
+
<li key={item.href ?? item.to} className="footer__item">
|
|
25
|
+
<LinkItem item={item} />
|
|
26
|
+
</li>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function Column({column}: {column: ColumnType}) {
|
|
31
|
+
return (
|
|
32
|
+
<div className="col footer__col">
|
|
33
|
+
<div className="footer__title">{column.title}</div>
|
|
34
|
+
<ul className="footer__items clean-list">
|
|
35
|
+
{column.items.map((item, i) => (
|
|
36
|
+
<ColumnLinkItem key={i} item={item} />
|
|
37
|
+
))}
|
|
38
|
+
</ul>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default function FooterLinksMultiColumn({columns}: Props): JSX.Element {
|
|
44
|
+
return (
|
|
45
|
+
<div className="row footer__links">
|
|
46
|
+
{columns.map((column, i) => (
|
|
47
|
+
<Column key={i} column={column} />
|
|
48
|
+
))}
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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 LinkItem from '@theme/Footer/LinkItem';
|
|
10
|
+
import type {Props} from '@theme/Footer/Links/Simple';
|
|
11
|
+
|
|
12
|
+
function Separator() {
|
|
13
|
+
return <span className="footer__link-separator">·</span>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function SimpleLinkItem({item}: {item: Props['links'][number]}) {
|
|
17
|
+
return item.html ? (
|
|
18
|
+
<span
|
|
19
|
+
className="footer__link-item"
|
|
20
|
+
// Developer provided the HTML, so assume it's safe.
|
|
21
|
+
// eslint-disable-next-line react/no-danger
|
|
22
|
+
dangerouslySetInnerHTML={{__html: item.html}}
|
|
23
|
+
/>
|
|
24
|
+
) : (
|
|
25
|
+
<LinkItem item={item} />
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default function FooterLinksSimple({links}: Props): JSX.Element {
|
|
30
|
+
return (
|
|
31
|
+
<div className="footer__links text--center">
|
|
32
|
+
<div className="footer__links">
|
|
33
|
+
{links.map((item, i) => (
|
|
34
|
+
<React.Fragment key={i}>
|
|
35
|
+
<SimpleLinkItem item={item} />
|
|
36
|
+
{links.length !== i + 1 && <Separator />}
|
|
37
|
+
</React.Fragment>
|
|
38
|
+
))}
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
|
|
10
|
+
import {isMultiColumnFooterLinks} from '@docusaurus/theme-common';
|
|
11
|
+
import FooterLinksMultiColumn from '@theme/Footer/Links/MultiColumn';
|
|
12
|
+
import FooterLinksSimple from '@theme/Footer/Links/Simple';
|
|
13
|
+
import type {Props} from '@theme/Footer/Links';
|
|
14
|
+
|
|
15
|
+
export default function FooterLinks({links}: Props): JSX.Element {
|
|
16
|
+
return isMultiColumnFooterLinks(links) ? (
|
|
17
|
+
<FooterLinksMultiColumn columns={links} />
|
|
18
|
+
) : (
|
|
19
|
+
<FooterLinksSimple links={links} />
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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 Link from '@docusaurus/Link';
|
|
10
|
+
import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
|
|
11
|
+
import ThemedImage from '@theme/ThemedImage';
|
|
12
|
+
import type {Props} from '@theme/Footer/Logo';
|
|
13
|
+
|
|
14
|
+
import styles from './styles.module.css';
|
|
15
|
+
|
|
16
|
+
function LogoImage({logo}: Props) {
|
|
17
|
+
const {withBaseUrl} = useBaseUrlUtils();
|
|
18
|
+
const sources = {
|
|
19
|
+
light: withBaseUrl(logo.src),
|
|
20
|
+
dark: withBaseUrl(logo.srcDark ?? logo.src),
|
|
21
|
+
};
|
|
22
|
+
return (
|
|
23
|
+
<ThemedImage
|
|
24
|
+
className="footer__logo"
|
|
25
|
+
alt={logo.alt}
|
|
26
|
+
sources={sources}
|
|
27
|
+
width={logo.width}
|
|
28
|
+
height={logo.height}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default function FooterLogo({logo}: Props): JSX.Element {
|
|
34
|
+
return logo.href ? (
|
|
35
|
+
<Link href={logo.href} className={styles.footerLogoLink}>
|
|
36
|
+
<LogoImage logo={logo} />
|
|
37
|
+
</Link>
|
|
38
|
+
) : (
|
|
39
|
+
<LogoImage logo={logo} />
|
|
40
|
+
);
|
|
41
|
+
}
|