@docusaurus/theme-classic 2.0.0-beta.15d451942 → 2.0.0-beta.18
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 +35 -0
- package/lib/deps.d.ts +13 -0
- package/lib/getSwizzleConfig.js +236 -0
- package/lib/index.js +63 -52
- package/lib/prism-include-languages.js +9 -5
- package/lib/theme-classic.d.ts +997 -0
- package/lib/translations.js +52 -36
- package/lib/types.d.ts +0 -589
- package/lib/validateThemeConfig.js +242 -250
- package/lib-next/theme/Admonition/index.js +101 -0
- package/lib-next/theme/AnnouncementBar/index.js +10 -22
- package/lib-next/theme/AnnouncementBar/styles.module.css +26 -35
- package/lib-next/theme/BackToTopButton/index.js +129 -0
- package/lib-next/theme/BackToTopButton/styles.module.css +44 -0
- package/lib-next/theme/BlogArchivePage/index.js +84 -0
- package/lib-next/theme/BlogLayout/index.js +37 -0
- package/lib-next/theme/BlogListPage/index.js +45 -35
- package/lib-next/theme/BlogListPaginator/index.js +13 -16
- package/lib-next/theme/BlogPostAuthor/index.js +52 -0
- package/lib-next/theme/BlogPostAuthor/styles.module.css +12 -0
- package/lib-next/theme/BlogPostAuthors/index.js +44 -0
- package/lib-next/theme/BlogPostAuthors/styles.module.css +21 -0
- package/lib-next/theme/BlogPostItem/index.js +112 -97
- package/lib-next/theme/BlogPostItem/styles.module.css +5 -1
- package/lib-next/theme/BlogPostPage/index.js +84 -41
- package/lib-next/theme/BlogPostPaginator/index.js +13 -20
- package/lib-next/theme/BlogSidebar/index.js +23 -16
- package/lib-next/theme/BlogSidebar/styles.module.css +8 -8
- package/lib-next/theme/BlogTagsListPage/index.js +24 -70
- package/lib-next/theme/BlogTagsPostsPage/index.js +57 -62
- package/lib-next/theme/CodeBlock/CopyButton/index.js +60 -0
- package/lib-next/theme/CodeBlock/CopyButton/styles.module.css +66 -0
- package/lib-next/theme/CodeBlock/index.js +74 -195
- package/lib-next/theme/CodeBlock/styles.module.css +13 -28
- package/lib-next/theme/ColorModeToggle/index.js +62 -0
- package/lib-next/theme/ColorModeToggle/styles.module.css +35 -0
- package/lib-next/theme/Details/index.js +21 -0
- package/lib-next/theme/Details/styles.module.css +13 -0
- package/lib-next/theme/DocBreadcrumbs/index.js +93 -0
- package/{lib/theme/Heading → lib-next/theme/DocBreadcrumbs}/styles.module.css +3 -2
- package/lib-next/theme/DocCard/index.js +93 -0
- package/lib-next/theme/DocCard/styles.module.css +34 -0
- package/lib-next/theme/DocCardList/index.js +31 -0
- package/lib-next/theme/DocCategoryGeneratedIndexPage/index.js +75 -0
- package/lib-next/theme/DocCategoryGeneratedIndexPage/styles.module.css +18 -0
- package/lib-next/theme/DocItem/index.js +99 -86
- package/lib-next/theme/DocItem/styles.module.css +7 -13
- package/lib-next/theme/DocItemFooter/index.js +79 -0
- package/{lib/theme/Layout/styles.css → lib-next/theme/DocItemFooter/styles.module.css} +8 -11
- package/lib-next/theme/DocPage/index.js +124 -99
- package/lib-next/theme/DocPage/styles.module.css +14 -30
- package/lib-next/theme/DocPaginator/index.js +16 -25
- package/lib-next/theme/DocSidebar/Desktop/CollapseButton/index.js +34 -0
- package/lib-next/theme/DocSidebar/Desktop/CollapseButton/styles.module.css +44 -0
- package/lib-next/theme/DocSidebar/Desktop/Content/index.js +46 -0
- package/{lib/theme/Footer → lib-next/theme/DocSidebar/Desktop/Content}/styles.module.css +8 -6
- package/lib-next/theme/DocSidebar/Desktop/index.js +34 -0
- package/lib-next/theme/DocSidebar/Desktop/styles.module.css +50 -0
- package/lib-next/theme/DocSidebar/Mobile/index.js +49 -0
- package/lib-next/theme/DocSidebar/index.js +13 -333
- package/lib-next/theme/DocSidebarItem/index.js +265 -0
- package/lib-next/theme/DocSidebarItem/styles.module.css +17 -0
- package/lib-next/theme/DocSidebarItems/index.js +28 -0
- package/lib-next/theme/DocTagDocListPage/index.js +96 -0
- package/lib-next/theme/DocTagsListPage/index.js +40 -0
- package/lib-next/theme/DocVersionBadge/index.js +34 -0
- package/lib-next/theme/{DocVersionSuggestions → DocVersionBanner}/index.js +54 -36
- package/lib-next/theme/EditThisPage/index.js +6 -1
- package/lib-next/theme/ErrorPageContent.js +35 -0
- package/lib-next/theme/Footer/Copyright/index.js +18 -0
- package/lib-next/theme/Footer/Layout/index.js +26 -0
- package/lib-next/theme/Footer/LinkItem/index.js +33 -0
- package/lib-next/theme/Footer/Links/MultiColumn/index.js +47 -0
- package/lib-next/theme/Footer/Links/Simple/index.js +41 -0
- package/lib-next/theme/Footer/Links/index.js +17 -0
- package/lib-next/theme/Footer/Logo/index.js +38 -0
- package/{src/theme/Footer → lib-next/theme/Footer/Logo}/styles.module.css +2 -1
- package/lib-next/theme/Footer/index.js +12 -100
- package/lib-next/theme/Heading/index.js +42 -33
- package/lib-next/theme/Heading/styles.module.css +27 -2
- package/lib-next/theme/IconArrow/index.js +3 -6
- package/lib-next/theme/IconClose/index.js +23 -0
- package/lib-next/theme/IconDarkMode/index.js +17 -0
- package/lib-next/theme/IconEdit/index.js +5 -10
- package/lib-next/theme/IconExternalLink/index.js +23 -0
- package/lib-next/theme/{LastUpdated → IconExternalLink}/styles.module.css +2 -2
- package/lib-next/theme/IconLanguage/index.js +5 -8
- package/lib-next/theme/IconLightMode/index.js +17 -0
- package/lib-next/theme/IconMenu/index.js +8 -9
- package/lib-next/theme/LastUpdated/index.js +35 -39
- package/lib-next/theme/Layout/index.js +19 -16
- package/lib-next/theme/Layout/styles.css +6 -0
- package/lib-next/theme/LayoutProviders/index.js +22 -10
- package/lib-next/theme/Logo/index.js +21 -16
- package/lib-next/theme/{ThemeContext.js → MDXComponents/A.js} +4 -2
- package/lib-next/theme/MDXComponents/Code.js +28 -0
- package/lib-next/theme/MDXComponents/Details.js +20 -0
- package/lib-next/theme/MDXComponents/Head.js +26 -0
- package/lib-next/theme/{hooks/styles.css → MDXComponents/Heading.js} +4 -3
- package/lib-next/theme/MDXComponents/Img.js +24 -0
- package/{lib/theme/LastUpdated/styles.module.css → lib-next/theme/MDXComponents/Img.module.css} +2 -2
- package/lib-next/theme/MDXComponents/Pre.js +18 -0
- package/lib-next/theme/MDXComponents/Ul.js +23 -0
- package/lib-next/theme/MDXComponents/Ul.module.css +11 -0
- package/lib-next/theme/MDXComponents/index.js +22 -42
- package/lib-next/theme/MDXContent/index.js +12 -0
- package/lib-next/theme/MDXPage/index.js +38 -39
- package/{lib/theme/IconEdit → lib-next/theme/MDXPage}/styles.module.css +2 -3
- package/lib-next/theme/Navbar/ColorModeToggle/index.js +25 -0
- package/lib-next/theme/Navbar/Content/index.js +70 -0
- package/lib-next/theme/Navbar/Content/styles.module.css +15 -0
- package/lib-next/theme/Navbar/Layout/index.js +54 -0
- package/{src/theme/Navbar → lib-next/theme/Navbar/Layout}/styles.module.css +1 -7
- package/lib-next/theme/Navbar/Logo/index.js +17 -0
- package/lib-next/theme/Navbar/MobileSidebar/Header/index.js +33 -0
- package/lib-next/theme/Navbar/MobileSidebar/Layout/index.js +28 -0
- package/lib-next/theme/Navbar/MobileSidebar/PrimaryMenu/index.js +33 -0
- package/lib-next/theme/Navbar/MobileSidebar/SecondaryMenu/index.js +36 -0
- package/lib-next/theme/Navbar/MobileSidebar/Toggle/index.js +23 -0
- package/lib-next/theme/Navbar/MobileSidebar/index.js +31 -0
- package/lib-next/theme/Navbar/index.js +7 -137
- package/lib-next/theme/NavbarItem/DefaultNavbarItem.js +33 -186
- package/lib-next/theme/NavbarItem/DocNavbarItem.js +31 -14
- package/lib-next/theme/NavbarItem/DocSidebarNavbarItem.js +73 -0
- package/lib-next/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +38 -24
- package/lib-next/theme/NavbarItem/DocsVersionNavbarItem.js +4 -1
- package/lib-next/theme/NavbarItem/DropdownNavbarItem.js +164 -0
- package/lib-next/theme/NavbarItem/{LocaleDropdownNavbarItem.js → LocaleDropdownNavbarItem/index.js} +12 -13
- package/lib-next/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css +11 -0
- package/lib-next/theme/NavbarItem/NavbarNavLink.js +66 -0
- package/lib-next/theme/NavbarItem/index.js +27 -15
- package/lib-next/theme/{UserPreferencesContext.js → NavbarItem/utils.js} +3 -3
- package/lib-next/theme/NotFound.js +40 -34
- package/lib-next/theme/PaginatorNavLink/index.js +17 -0
- package/lib-next/theme/SearchBar.js +1 -1
- package/lib-next/theme/SearchMetadata/index.js +34 -0
- package/lib-next/theme/{LayoutHead → SiteMetadata}/index.js +25 -45
- package/lib-next/theme/SkipToContent/index.js +9 -8
- package/lib-next/theme/SkipToContent/styles.module.css +8 -3
- package/lib-next/theme/TOC/index.js +12 -39
- package/lib-next/theme/TOC/styles.module.css +2 -2
- package/lib-next/theme/TOCCollapsible/index.js +52 -0
- package/lib-next/theme/TOCCollapsible/styles.module.css +50 -0
- package/lib-next/theme/TOCInline/index.js +10 -31
- package/lib-next/theme/TOCItems/index.js +85 -0
- package/lib-next/theme/TabItem/index.js +1 -4
- package/lib-next/theme/Tabs/__tests__/index.test.js +146 -0
- package/lib-next/theme/Tabs/index.js +108 -50
- package/lib-next/theme/Tabs/styles.module.css +0 -13
- package/lib-next/theme/Tag/index.js +24 -0
- package/lib-next/theme/Tag/styles.module.css +70 -0
- package/lib-next/theme/TagsListByLetter/index.js +40 -0
- package/lib-next/theme/TagsListByLetter/styles.module.css +11 -0
- package/lib-next/theme/TagsListInline/index.js +31 -0
- package/{lib/theme/BlogPostItem → lib-next/theme/TagsListInline}/styles.module.css +5 -4
- package/lib-next/theme/ThemedImage/index.js +10 -14
- package/lib-next/theme/ThemedImage/styles.module.css +9 -2
- package/lib-next/theme/prism-include-languages.js +17 -15
- package/package.json +32 -31
- package/src/admonitions.css +35 -0
- package/src/deps.d.ts +13 -0
- package/src/getSwizzleConfig.ts +244 -0
- package/src/index.ts +72 -72
- 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 +11 -20
- package/src/theme/AnnouncementBar/styles.module.css +26 -35
- package/src/theme/BackToTopButton/index.tsx +141 -0
- package/src/theme/BackToTopButton/styles.module.css +44 -0
- package/src/theme/BlogArchivePage/index.tsx +92 -0
- package/src/theme/BlogLayout/index.tsx +42 -0
- package/src/theme/BlogListPage/index.tsx +45 -35
- package/src/theme/BlogListPaginator/index.tsx +13 -15
- package/src/theme/BlogPostAuthor/index.tsx +54 -0
- package/src/theme/BlogPostAuthor/styles.module.css +12 -0
- package/src/theme/BlogPostAuthors/index.tsx +49 -0
- package/src/theme/BlogPostAuthors/styles.module.css +21 -0
- package/src/theme/BlogPostItem/index.tsx +103 -93
- package/src/theme/BlogPostItem/styles.module.css +5 -1
- package/src/theme/BlogPostPage/index.tsx +84 -42
- package/src/theme/BlogPostPaginator/index.tsx +13 -19
- package/src/theme/BlogSidebar/index.tsx +23 -16
- package/src/theme/BlogSidebar/styles.module.css +8 -8
- package/src/theme/BlogTagsListPage/index.tsx +24 -70
- package/src/theme/BlogTagsPostsPage/index.tsx +54 -65
- package/src/theme/CodeBlock/CopyButton/index.tsx +66 -0
- package/src/theme/CodeBlock/CopyButton/styles.module.css +66 -0
- package/src/theme/CodeBlock/index.tsx +77 -196
- package/src/theme/CodeBlock/styles.module.css +13 -28
- package/src/theme/ColorModeToggle/index.tsx +67 -0
- package/src/theme/ColorModeToggle/styles.module.css +35 -0
- package/src/theme/Details/index.tsx +25 -0
- package/src/theme/Details/styles.module.css +13 -0
- package/src/theme/DocBreadcrumbs/index.tsx +110 -0
- package/src/theme/DocBreadcrumbs/styles.module.css +11 -0
- package/src/theme/DocCard/index.tsx +116 -0
- package/src/theme/DocCard/styles.module.css +34 -0
- package/src/theme/DocCardList/index.tsx +38 -0
- package/src/theme/DocCategoryGeneratedIndexPage/index.tsx +86 -0
- package/src/theme/DocCategoryGeneratedIndexPage/styles.module.css +18 -0
- package/src/theme/DocItem/index.tsx +93 -79
- package/src/theme/DocItem/styles.module.css +7 -13
- package/src/theme/DocItemFooter/index.tsx +91 -0
- package/src/theme/DocItemFooter/styles.module.css +18 -0
- package/src/theme/DocPage/index.tsx +124 -101
- package/src/theme/DocPage/styles.module.css +14 -30
- package/src/theme/DocPaginator/index.tsx +16 -24
- package/src/theme/DocSidebar/Desktop/CollapseButton/index.tsx +38 -0
- package/src/theme/DocSidebar/Desktop/CollapseButton/styles.module.css +44 -0
- package/src/theme/DocSidebar/Desktop/Content/index.tsx +55 -0
- package/src/theme/DocSidebar/Desktop/Content/styles.module.css +17 -0
- package/src/theme/DocSidebar/Desktop/index.tsx +38 -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 -343
- package/src/theme/DocSidebarItem/index.tsx +282 -0
- package/src/theme/DocSidebarItem/styles.module.css +17 -0
- package/src/theme/DocSidebarItems/index.tsx +32 -0
- package/src/theme/DocTagDocListPage/index.tsx +97 -0
- package/src/theme/DocTagsListPage/index.tsx +44 -0
- package/src/theme/DocVersionBadge/index.tsx +35 -0
- package/src/theme/{DocVersionSuggestions → DocVersionBanner}/index.tsx +76 -47
- package/src/theme/EditThisPage/index.tsx +6 -1
- 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/{lib-next/theme/Footer → src/theme/Footer/Logo}/styles.module.css +2 -1
- package/src/theme/Footer/index.tsx +13 -113
- package/src/theme/Heading/index.tsx +43 -35
- package/src/theme/Heading/styles.module.css +27 -2
- package/src/theme/IconArrow/index.tsx +3 -5
- package/src/theme/IconClose/index.tsx +26 -0
- package/src/theme/IconDarkMode/index.tsx +20 -0
- package/src/theme/IconEdit/index.tsx +8 -9
- package/src/theme/IconExternalLink/index.tsx +30 -0
- package/src/theme/IconExternalLink/styles.module.css +10 -0
- package/src/theme/IconLanguage/index.tsx +6 -8
- package/src/theme/IconLightMode/index.tsx +20 -0
- package/src/theme/IconMenu/index.tsx +4 -9
- package/src/theme/LastUpdated/index.tsx +35 -39
- package/src/theme/Layout/index.tsx +19 -15
- package/src/theme/Layout/styles.css +6 -0
- package/src/theme/LayoutProviders/index.tsx +22 -10
- package/src/theme/Logo/index.tsx +21 -15
- package/src/theme/{ThemeContext.ts → MDXComponents/A.tsx} +5 -6
- package/src/theme/MDXComponents/Code.tsx +37 -0
- package/src/theme/MDXComponents/Details.tsx +26 -0
- package/src/theme/MDXComponents/Head.tsx +29 -0
- package/src/theme/MDXComponents/Heading.tsx +14 -0
- package/src/theme/{LastUpdated/styles.module.css → MDXComponents/Img.module.css} +2 -2
- package/src/theme/MDXComponents/Img.tsx +26 -0
- package/src/theme/MDXComponents/Pre.tsx +22 -0
- package/src/theme/MDXComponents/Ul.module.css +11 -0
- package/src/theme/MDXComponents/Ul.tsx +28 -0
- package/src/theme/MDXComponents/index.tsx +23 -42
- package/src/theme/MDXContent/index.tsx +15 -0
- package/src/theme/MDXPage/index.tsx +39 -39
- package/src/theme/MDXPage/styles.module.css +10 -0
- package/src/theme/Navbar/ColorModeToggle/index.tsx +30 -0
- package/src/theme/Navbar/Content/index.tsx +81 -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 +1 -7
- 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 +38 -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/index.tsx +7 -147
- package/src/theme/NavbarItem/DefaultNavbarItem.tsx +37 -194
- package/src/theme/NavbarItem/DocNavbarItem.tsx +33 -15
- package/src/theme/NavbarItem/DocSidebarNavbarItem.tsx +84 -0
- package/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +44 -28
- package/src/theme/NavbarItem/DocsVersionNavbarItem.tsx +7 -3
- package/src/theme/NavbarItem/DropdownNavbarItem.tsx +190 -0
- package/src/theme/NavbarItem/{LocaleDropdownNavbarItem.tsx → LocaleDropdownNavbarItem/index.tsx} +17 -11
- package/src/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css +11 -0
- package/src/theme/NavbarItem/NavbarNavLink.tsx +64 -0
- package/src/theme/NavbarItem/index.tsx +41 -19
- package/src/theme/NavbarItem/utils.ts +10 -0
- package/src/theme/NotFound.tsx +40 -33
- package/src/theme/PaginatorNavLink/index.tsx +20 -0
- package/src/theme/SearchBar.tsx +2 -1
- package/src/theme/SearchMetadata/index.tsx +43 -0
- package/src/theme/{LayoutHead → SiteMetadata}/index.tsx +25 -38
- package/src/theme/SkipToContent/index.tsx +9 -8
- package/src/theme/SkipToContent/styles.module.css +8 -3
- package/src/theme/TOC/index.tsx +13 -44
- package/src/theme/TOC/styles.module.css +2 -2
- package/src/theme/TOCCollapsible/index.tsx +56 -0
- package/src/theme/TOCCollapsible/styles.module.css +50 -0
- package/src/theme/TOCInline/index.tsx +14 -35
- package/src/theme/TOCItems/index.tsx +100 -0
- package/src/theme/TabItem/index.tsx +5 -3
- package/src/theme/Tabs/index.tsx +117 -59
- package/src/theme/Tabs/styles.module.css +0 -13
- package/src/theme/Tag/index.tsx +29 -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 +12 -13
- package/src/theme/ThemedImage/styles.module.css +9 -2
- package/src/theme/prism-include-languages.ts +20 -15
- package/src/theme-classic.d.ts +997 -0
- package/src/translations.ts +84 -58
- package/src/types.d.ts +0 -589
- package/src/validateThemeConfig.ts +381 -0
- package/babel.config.js +0 -35
- package/codeTranslations/README.md +0 -20
- package/codeTranslations/ar.json +0 -55
- package/codeTranslations/base.json +0 -108
- package/codeTranslations/da.json +0 -55
- package/codeTranslations/de.json +0 -55
- package/codeTranslations/es.json +0 -55
- package/codeTranslations/fa.json +0 -55
- package/codeTranslations/fil.json +0 -55
- package/codeTranslations/fr.json +0 -55
- package/codeTranslations/he.json +0 -55
- package/codeTranslations/hi.json +0 -55
- package/codeTranslations/ja.json +0 -55
- package/codeTranslations/ko.json +0 -55
- package/codeTranslations/pl.json +0 -55
- package/codeTranslations/pt-BR.json +0 -55
- package/codeTranslations/pt-PT.json +0 -55
- package/codeTranslations/ru.json +0 -55
- package/codeTranslations/tr.json +0 -55
- package/codeTranslations/vi.json +0 -55
- package/codeTranslations/zh-Hans.json +0 -55
- package/codeTranslations/zh-Hant.json +0 -55
- 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/AnnouncementBar/index.js +0 -74
- package/lib/theme/AnnouncementBar/styles.module.css +0 -72
- package/lib/theme/BlogListPage/index.js +0 -71
- package/lib/theme/BlogListPaginator/index.js +0 -63
- package/lib/theme/BlogPostItem/index.js +0 -152
- package/lib/theme/BlogPostPage/index.js +0 -75
- package/lib/theme/BlogPostPaginator/index.js +0 -64
- package/lib/theme/BlogSidebar/index.js +0 -43
- package/lib/theme/BlogSidebar/styles.module.css +0 -46
- package/lib/theme/BlogTagsListPage/index.js +0 -81
- package/lib/theme/BlogTagsPostsPage/index.js +0 -104
- package/lib/theme/CodeBlock/index.js +0 -253
- package/lib/theme/CodeBlock/styles.module.css +0 -71
- package/lib/theme/DocItem/index.js +0 -120
- package/lib/theme/DocItem/styles.module.css +0 -28
- package/lib/theme/DocPage/index.js +0 -141
- package/lib/theme/DocPage/styles.module.css +0 -98
- package/lib/theme/DocPaginator/index.js +0 -63
- package/lib/theme/DocSidebar/index.js +0 -307
- package/lib/theme/DocSidebar/styles.module.css +0 -138
- package/lib/theme/DocVersionSuggestions/index.js +0 -111
- package/lib/theme/EditThisPage/index.js +0 -31
- package/lib/theme/Footer/index.js +0 -108
- package/lib/theme/Heading/index.js +0 -60
- package/lib/theme/Heading/styles.css +0 -23
- package/lib/theme/IconArrow/index.js +0 -28
- package/lib/theme/IconEdit/index.js +0 -34
- package/lib/theme/IconLanguage/index.js +0 -29
- package/lib/theme/IconMenu/index.js +0 -31
- package/lib/theme/LastUpdated/index.js +0 -65
- package/lib/theme/Layout/index.js +0 -64
- package/lib/theme/LayoutHead/index.js +0 -144
- package/lib/theme/LayoutProviders/index.js +0 -34
- package/lib/theme/Logo/index.js +0 -59
- package/lib/theme/MDXComponents/index.js +0 -65
- package/lib/theme/MDXPage/index.js +0 -68
- package/lib/theme/Navbar/index.js +0 -147
- package/lib/theme/NavbarItem/DefaultNavbarItem.js +0 -195
- package/lib/theme/NavbarItem/DocNavbarItem.js +0 -55
- package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +0 -75
- package/lib/theme/NavbarItem/DocsVersionNavbarItem.js +0 -43
- package/lib/theme/NavbarItem/LocaleDropdownNavbarItem.js +0 -72
- package/lib/theme/NavbarItem/SearchNavbarItem.js +0 -28
- package/lib/theme/NavbarItem/index.js +0 -54
- package/lib/theme/NotFound.js +0 -50
- package/lib/theme/SearchBar.js +0 -15
- package/lib/theme/SearchMetadatas/index.js +0 -33
- package/lib/theme/Seo/index.js +0 -49
- package/lib/theme/SkipToContent/index.js +0 -61
- package/lib/theme/SkipToContent/styles.module.css +0 -16
- package/lib/theme/TOC/index.js +0 -59
- package/lib/theme/TOC/styles.module.css +0 -23
- package/lib/theme/TOCInline/index.js +0 -53
- package/lib/theme/TOCInline/styles.module.css +0 -12
- package/lib/theme/TabItem/index.js +0 -32
- package/lib/theme/Tabs/index.js +0 -150
- package/lib/theme/Tabs/styles.module.css +0 -23
- package/lib/theme/ThemeContext.js +0 -21
- package/lib/theme/ThemeProvider/index.js +0 -38
- package/lib/theme/ThemedImage/index.js +0 -48
- package/lib/theme/ThemedImage/styles.module.css +0 -11
- package/lib/theme/Toggle/index.js +0 -106
- package/lib/theme/Toggle/styles.module.css +0 -114
- package/lib/theme/UserPreferencesContext.js +0 -18
- package/lib/theme/UserPreferencesProvider/index.js +0 -44
- package/lib/theme/hooks/styles.css +0 -10
- package/lib/theme/hooks/useAnnouncementBar.js +0 -63
- 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 -53
- 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/theme/prism-include-languages.js +0 -39
- 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 -198
- package/lib-next/theme/DocSidebar/styles.module.css +0 -138
- package/lib-next/theme/Heading/styles.css +0 -23
- package/lib-next/theme/Navbar/styles.module.css +0 -20
- package/lib-next/theme/SearchMetadatas/index.js +0 -20
- package/lib-next/theme/Seo/index.js +0 -36
- package/lib-next/theme/ThemeProvider/index.js +0 -25
- package/lib-next/theme/Toggle/index.js +0 -95
- package/lib-next/theme/Toggle/styles.module.css +0 -114
- package/lib-next/theme/UserPreferencesProvider/index.js +0 -28
- package/lib-next/theme/hooks/useAnnouncementBar.js +0 -49
- 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 -41
- 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/translations.js +0 -145
- package/lib-next/types.d.ts +0 -600
- 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/DocSidebar/styles.module.css +0 -138
- package/src/theme/Heading/styles.css +0 -23
- 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 -113
- package/src/theme/Toggle/styles.module.css +0 -114
- package/src/theme/UserPreferencesContext.ts +0 -12
- package/src/theme/UserPreferencesProvider/index.tsx +0 -32
- package/src/theme/hooks/styles.css +0 -10
- package/src/theme/hooks/useAnnouncementBar.ts +0 -58
- 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/useLockBodyScroll.ts +0 -20
- 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/validateThemeConfig.js +0 -317
- package/tsconfig.json +0 -12
- package/update-code-translations.js +0 -239
- package/update-code-translations.test.js +0 -33
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React, {memo} from 'react';
|
|
8
|
+
import DocSidebarItem from '@theme/DocSidebarItem';
|
|
9
|
+
import {DocSidebarItemsExpandedStateProvider} from '@docusaurus/theme-common';
|
|
10
|
+
|
|
11
|
+
// TODO this item should probably not receive the "activePath" props
|
|
12
|
+
// TODO this triggers whole sidebar re-renders on navigation
|
|
13
|
+
function DocSidebarItems({items, ...props}) {
|
|
14
|
+
return (
|
|
15
|
+
<DocSidebarItemsExpandedStateProvider>
|
|
16
|
+
{items.map((item, index) => (
|
|
17
|
+
<DocSidebarItem
|
|
18
|
+
key={index} // sidebar is static, the index does not change
|
|
19
|
+
item={item}
|
|
20
|
+
index={index}
|
|
21
|
+
{...props}
|
|
22
|
+
/>
|
|
23
|
+
))}
|
|
24
|
+
</DocSidebarItemsExpandedStateProvider>
|
|
25
|
+
);
|
|
26
|
+
} // Optimize sidebar at each "level"
|
|
27
|
+
|
|
28
|
+
export default memo(DocSidebarItems);
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import Layout from '@theme/Layout';
|
|
9
|
+
import Link from '@docusaurus/Link';
|
|
10
|
+
import {
|
|
11
|
+
PageMetadata,
|
|
12
|
+
HtmlClassNameProvider,
|
|
13
|
+
ThemeClassNames,
|
|
14
|
+
usePluralForm,
|
|
15
|
+
} from '@docusaurus/theme-common';
|
|
16
|
+
import Translate, {translate} from '@docusaurus/Translate';
|
|
17
|
+
import SearchMetadata from '@theme/SearchMetadata';
|
|
18
|
+
import clsx from 'clsx'; // Very simple pluralization: probably good enough for now
|
|
19
|
+
|
|
20
|
+
function useNDocsTaggedPlural() {
|
|
21
|
+
const {selectMessage} = usePluralForm();
|
|
22
|
+
return (count) =>
|
|
23
|
+
selectMessage(
|
|
24
|
+
count,
|
|
25
|
+
translate(
|
|
26
|
+
{
|
|
27
|
+
id: 'theme.docs.tagDocListPageTitle.nDocsTagged',
|
|
28
|
+
description:
|
|
29
|
+
'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)',
|
|
30
|
+
message: 'One doc tagged|{count} docs tagged',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
count,
|
|
34
|
+
},
|
|
35
|
+
),
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function DocItem({doc}) {
|
|
40
|
+
return (
|
|
41
|
+
<article className="margin-vert--lg">
|
|
42
|
+
<Link to={doc.permalink}>
|
|
43
|
+
<h2>{doc.title}</h2>
|
|
44
|
+
</Link>
|
|
45
|
+
{doc.description && <p>{doc.description}</p>}
|
|
46
|
+
</article>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default function DocTagDocListPage({tag}) {
|
|
51
|
+
const nDocsTaggedPlural = useNDocsTaggedPlural();
|
|
52
|
+
const title = translate(
|
|
53
|
+
{
|
|
54
|
+
id: 'theme.docs.tagDocListPageTitle',
|
|
55
|
+
description: 'The title of the page for a docs tag',
|
|
56
|
+
message: '{nDocsTagged} with "{tagName}"',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
nDocsTagged: nDocsTaggedPlural(tag.docs.length),
|
|
60
|
+
tagName: tag.name,
|
|
61
|
+
},
|
|
62
|
+
);
|
|
63
|
+
return (
|
|
64
|
+
<HtmlClassNameProvider
|
|
65
|
+
className={clsx(
|
|
66
|
+
ThemeClassNames.wrapper.docsPages,
|
|
67
|
+
ThemeClassNames.page.docsTagDocListPage,
|
|
68
|
+
)}>
|
|
69
|
+
<PageMetadata title={title} />
|
|
70
|
+
<SearchMetadata tag="doc_tag_doc_list" />
|
|
71
|
+
<Layout>
|
|
72
|
+
<div className="container margin-vert--lg">
|
|
73
|
+
<div className="row">
|
|
74
|
+
<main className="col col--8 col--offset-2">
|
|
75
|
+
<header className="margin-bottom--xl">
|
|
76
|
+
<h1>{title}</h1>
|
|
77
|
+
<Link href={tag.allTagsPath}>
|
|
78
|
+
<Translate
|
|
79
|
+
id="theme.tags.tagsPageLink"
|
|
80
|
+
description="The label of the link targeting the tag list page">
|
|
81
|
+
View All Tags
|
|
82
|
+
</Translate>
|
|
83
|
+
</Link>
|
|
84
|
+
</header>
|
|
85
|
+
<section className="margin-vert--lg">
|
|
86
|
+
{tag.docs.map((doc) => (
|
|
87
|
+
<DocItem key={doc.id} doc={doc} />
|
|
88
|
+
))}
|
|
89
|
+
</section>
|
|
90
|
+
</main>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</Layout>
|
|
94
|
+
</HtmlClassNameProvider>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import Layout from '@theme/Layout';
|
|
9
|
+
import {
|
|
10
|
+
PageMetadata,
|
|
11
|
+
HtmlClassNameProvider,
|
|
12
|
+
ThemeClassNames,
|
|
13
|
+
translateTagsPageTitle,
|
|
14
|
+
} from '@docusaurus/theme-common';
|
|
15
|
+
import TagsListByLetter from '@theme/TagsListByLetter';
|
|
16
|
+
import SearchMetadata from '@theme/SearchMetadata';
|
|
17
|
+
import clsx from 'clsx';
|
|
18
|
+
export default function DocTagsListPage({tags}) {
|
|
19
|
+
const title = translateTagsPageTitle();
|
|
20
|
+
return (
|
|
21
|
+
<HtmlClassNameProvider
|
|
22
|
+
className={clsx(
|
|
23
|
+
ThemeClassNames.wrapper.docsPages,
|
|
24
|
+
ThemeClassNames.page.docsTagsListPage,
|
|
25
|
+
)}>
|
|
26
|
+
<PageMetadata title={title} />
|
|
27
|
+
<SearchMetadata tag="doc_tags_list" />
|
|
28
|
+
<Layout>
|
|
29
|
+
<div className="container margin-vert--lg">
|
|
30
|
+
<div className="row">
|
|
31
|
+
<main className="col col--8 col--offset-2">
|
|
32
|
+
<h1>{title}</h1>
|
|
33
|
+
<TagsListByLetter tags={tags} />
|
|
34
|
+
</main>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</Layout>
|
|
38
|
+
</HtmlClassNameProvider>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -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
|
+
import React from 'react';
|
|
8
|
+
import Translate from '@docusaurus/Translate';
|
|
9
|
+
import {ThemeClassNames, useDocsVersion} from '@docusaurus/theme-common';
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
export default function DocVersionBadge({className}) {
|
|
12
|
+
const versionMetadata = useDocsVersion();
|
|
13
|
+
|
|
14
|
+
if (versionMetadata.badge) {
|
|
15
|
+
return (
|
|
16
|
+
<span
|
|
17
|
+
className={clsx(
|
|
18
|
+
className,
|
|
19
|
+
ThemeClassNames.docs.docVersionBadge,
|
|
20
|
+
'badge badge--secondary',
|
|
21
|
+
)}>
|
|
22
|
+
<Translate
|
|
23
|
+
id="theme.docs.versionBadge.label"
|
|
24
|
+
values={{
|
|
25
|
+
versionLabel: versionMetadata.label,
|
|
26
|
+
}}>
|
|
27
|
+
{'Version: {versionLabel}'}
|
|
28
|
+
</Translate>
|
|
29
|
+
</span>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
@@ -10,19 +10,23 @@ import Link from '@docusaurus/Link';
|
|
|
10
10
|
import Translate from '@docusaurus/Translate';
|
|
11
11
|
import {
|
|
12
12
|
useActivePlugin,
|
|
13
|
-
useActiveVersion,
|
|
14
13
|
useDocVersionSuggestions,
|
|
15
|
-
} from '@
|
|
16
|
-
import {
|
|
14
|
+
} from '@docusaurus/plugin-content-docs/client';
|
|
15
|
+
import {
|
|
16
|
+
ThemeClassNames,
|
|
17
|
+
useDocsPreferredVersion,
|
|
18
|
+
useDocsVersion,
|
|
19
|
+
} from '@docusaurus/theme-common';
|
|
20
|
+
import clsx from 'clsx';
|
|
17
21
|
|
|
18
|
-
function UnreleasedVersionLabel({siteTitle,
|
|
22
|
+
function UnreleasedVersionLabel({siteTitle, versionMetadata}) {
|
|
19
23
|
return (
|
|
20
24
|
<Translate
|
|
21
25
|
id="theme.docs.versions.unreleasedVersionLabel"
|
|
22
26
|
description="The label used to tell the user that he's browsing an unreleased doc version"
|
|
23
27
|
values={{
|
|
24
28
|
siteTitle,
|
|
25
|
-
versionLabel: <
|
|
29
|
+
versionLabel: <b>{versionMetadata.label}</b>,
|
|
26
30
|
}}>
|
|
27
31
|
{
|
|
28
32
|
'This is unreleased documentation for {siteTitle} {versionLabel} version.'
|
|
@@ -31,14 +35,14 @@ function UnreleasedVersionLabel({siteTitle, versionLabel}) {
|
|
|
31
35
|
);
|
|
32
36
|
}
|
|
33
37
|
|
|
34
|
-
function UnmaintainedVersionLabel({siteTitle,
|
|
38
|
+
function UnmaintainedVersionLabel({siteTitle, versionMetadata}) {
|
|
35
39
|
return (
|
|
36
40
|
<Translate
|
|
37
41
|
id="theme.docs.versions.unmaintainedVersionLabel"
|
|
38
42
|
description="The label used to tell the user that he's browsing an unmaintained doc version"
|
|
39
43
|
values={{
|
|
40
44
|
siteTitle,
|
|
41
|
-
versionLabel: <
|
|
45
|
+
versionLabel: <b>{versionMetadata.label}</b>,
|
|
42
46
|
}}>
|
|
43
47
|
{
|
|
44
48
|
'This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.'
|
|
@@ -47,15 +51,26 @@ function UnmaintainedVersionLabel({siteTitle, versionLabel}) {
|
|
|
47
51
|
);
|
|
48
52
|
}
|
|
49
53
|
|
|
54
|
+
const BannerLabelComponents = {
|
|
55
|
+
unreleased: UnreleasedVersionLabel,
|
|
56
|
+
unmaintained: UnmaintainedVersionLabel,
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
function BannerLabel(props) {
|
|
60
|
+
const BannerLabelComponent =
|
|
61
|
+
BannerLabelComponents[props.versionMetadata.banner];
|
|
62
|
+
return <BannerLabelComponent {...props} />;
|
|
63
|
+
}
|
|
64
|
+
|
|
50
65
|
function LatestVersionSuggestionLabel({versionLabel, to, onClick}) {
|
|
51
66
|
return (
|
|
52
67
|
<Translate
|
|
53
68
|
id="theme.docs.versions.latestVersionSuggestionLabel"
|
|
54
|
-
description="The label
|
|
69
|
+
description="The label used to tell the user to check the latest version"
|
|
55
70
|
values={{
|
|
56
71
|
versionLabel,
|
|
57
72
|
latestVersionLink: (
|
|
58
|
-
<
|
|
73
|
+
<b>
|
|
59
74
|
<Link to={to} onClick={onClick}>
|
|
60
75
|
<Translate
|
|
61
76
|
id="theme.docs.versions.latestVersionLinkLabel"
|
|
@@ -63,7 +78,7 @@ function LatestVersionSuggestionLabel({versionLabel, to, onClick}) {
|
|
|
63
78
|
latest version
|
|
64
79
|
</Translate>
|
|
65
80
|
</Link>
|
|
66
|
-
</
|
|
81
|
+
</b>
|
|
67
82
|
),
|
|
68
83
|
}}>
|
|
69
84
|
{
|
|
@@ -73,44 +88,34 @@ function LatestVersionSuggestionLabel({versionLabel, to, onClick}) {
|
|
|
73
88
|
);
|
|
74
89
|
}
|
|
75
90
|
|
|
76
|
-
|
|
77
|
-
version.docs.find((doc) => doc.id === version.mainDocId);
|
|
78
|
-
|
|
79
|
-
function DocVersionSuggestions() {
|
|
91
|
+
function DocVersionBannerEnabled({className, versionMetadata}) {
|
|
80
92
|
const {
|
|
81
93
|
siteConfig: {title: siteTitle},
|
|
82
94
|
} = useDocusaurusContext();
|
|
83
95
|
const {pluginId} = useActivePlugin({
|
|
84
96
|
failfast: true,
|
|
85
97
|
});
|
|
86
|
-
const {savePreferredVersionName} = useDocsPreferredVersion(pluginId);
|
|
87
|
-
const activeVersion = useActiveVersion(pluginId);
|
|
88
|
-
const {
|
|
89
|
-
latestDocSuggestion,
|
|
90
|
-
latestVersionSuggestion,
|
|
91
|
-
} = useDocVersionSuggestions(pluginId); // No suggestion to be made
|
|
92
98
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
99
|
+
const getVersionMainDoc = (version) =>
|
|
100
|
+
version.docs.find((doc) => doc.id === version.mainDocId);
|
|
101
|
+
|
|
102
|
+
const {savePreferredVersionName} = useDocsPreferredVersion(pluginId);
|
|
103
|
+
const {latestDocSuggestion, latestVersionSuggestion} =
|
|
104
|
+
useDocVersionSuggestions(pluginId); // try to link to same doc in latest version (not always possible)
|
|
96
105
|
// fallback to main doc of latest version
|
|
97
106
|
|
|
98
107
|
const latestVersionSuggestedDoc =
|
|
99
108
|
latestDocSuggestion ?? getVersionMainDoc(latestVersionSuggestion);
|
|
100
109
|
return (
|
|
101
|
-
<div
|
|
110
|
+
<div
|
|
111
|
+
className={clsx(
|
|
112
|
+
className,
|
|
113
|
+
ThemeClassNames.docs.docVersionBanner,
|
|
114
|
+
'alert alert--warning margin-bottom--md',
|
|
115
|
+
)}
|
|
116
|
+
role="alert">
|
|
102
117
|
<div>
|
|
103
|
-
{
|
|
104
|
-
<UnreleasedVersionLabel
|
|
105
|
-
siteTitle={siteTitle}
|
|
106
|
-
versionLabel={activeVersion.label}
|
|
107
|
-
/>
|
|
108
|
-
) : (
|
|
109
|
-
<UnmaintainedVersionLabel
|
|
110
|
-
siteTitle={siteTitle}
|
|
111
|
-
versionLabel={activeVersion.label}
|
|
112
|
-
/>
|
|
113
|
-
)}
|
|
118
|
+
<BannerLabel siteTitle={siteTitle} versionMetadata={versionMetadata} />
|
|
114
119
|
</div>
|
|
115
120
|
<div className="margin-top--md">
|
|
116
121
|
<LatestVersionSuggestionLabel
|
|
@@ -123,4 +128,17 @@ function DocVersionSuggestions() {
|
|
|
123
128
|
);
|
|
124
129
|
}
|
|
125
130
|
|
|
126
|
-
export default
|
|
131
|
+
export default function DocVersionBanner({className}) {
|
|
132
|
+
const versionMetadata = useDocsVersion();
|
|
133
|
+
|
|
134
|
+
if (versionMetadata.banner) {
|
|
135
|
+
return (
|
|
136
|
+
<DocVersionBannerEnabled
|
|
137
|
+
className={className}
|
|
138
|
+
versionMetadata={versionMetadata}
|
|
139
|
+
/>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
@@ -7,9 +7,14 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import Translate from '@docusaurus/Translate';
|
|
9
9
|
import IconEdit from '@theme/IconEdit';
|
|
10
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
10
11
|
export default function EditThisPage({editUrl}) {
|
|
11
12
|
return (
|
|
12
|
-
<a
|
|
13
|
+
<a
|
|
14
|
+
href={editUrl}
|
|
15
|
+
target="_blank"
|
|
16
|
+
rel="noreferrer noopener"
|
|
17
|
+
className={ThemeClassNames.common.editThisPage}>
|
|
13
18
|
<IconEdit />
|
|
14
19
|
<Translate
|
|
15
20
|
id="theme.common.editThisPage"
|
|
@@ -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
|
+
import React from 'react';
|
|
8
|
+
import Translate from '@docusaurus/Translate';
|
|
9
|
+
export default function ErrorPageContent({error, tryAgain}) {
|
|
10
|
+
return (
|
|
11
|
+
<main className="container margin-vert--xl">
|
|
12
|
+
<div className="row">
|
|
13
|
+
<div className="col col--6 col--offset-3">
|
|
14
|
+
<h1 className="hero__title">
|
|
15
|
+
<Translate
|
|
16
|
+
id="theme.ErrorPageContent.title"
|
|
17
|
+
description="The title of the fallback page when the page crashed">
|
|
18
|
+
This page crashed.
|
|
19
|
+
</Translate>
|
|
20
|
+
</h1>
|
|
21
|
+
<p>{error.message}</p>
|
|
22
|
+
<div>
|
|
23
|
+
<button type="button" onClick={tryAgain}>
|
|
24
|
+
<Translate
|
|
25
|
+
id="theme.ErrorPageContent.tryAgain"
|
|
26
|
+
description="The label of the button to try again when the page crashed">
|
|
27
|
+
Try again
|
|
28
|
+
</Translate>
|
|
29
|
+
</button>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</main>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
export default function FooterCopyright({copyright}) {
|
|
9
|
+
return (
|
|
10
|
+
<div
|
|
11
|
+
className="footer__copyright" // Developer provided the HTML, so assume it's safe.
|
|
12
|
+
// eslint-disable-next-line react/no-danger
|
|
13
|
+
dangerouslySetInnerHTML={{
|
|
14
|
+
__html: copyright,
|
|
15
|
+
}}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import clsx from 'clsx';
|
|
9
|
+
export default function FooterLayout({style, links, logo, copyright}) {
|
|
10
|
+
return (
|
|
11
|
+
<footer
|
|
12
|
+
className={clsx('footer', {
|
|
13
|
+
'footer--dark': style === 'dark',
|
|
14
|
+
})}>
|
|
15
|
+
<div className="container container-fluid">
|
|
16
|
+
{links}
|
|
17
|
+
{(logo || copyright) && (
|
|
18
|
+
<div className="footer__bottom text--center">
|
|
19
|
+
{logo && <div className="margin-bottom--sm">{logo}</div>}
|
|
20
|
+
{copyright}
|
|
21
|
+
</div>
|
|
22
|
+
)}
|
|
23
|
+
</div>
|
|
24
|
+
</footer>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import Link from '@docusaurus/Link';
|
|
9
|
+
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
10
|
+
import isInternalUrl from '@docusaurus/isInternalUrl';
|
|
11
|
+
import IconExternalLink from '@theme/IconExternalLink';
|
|
12
|
+
export default function FooterLinkItem({item}) {
|
|
13
|
+
const {to, href, label, prependBaseUrlToHref, ...props} = item;
|
|
14
|
+
const toUrl = useBaseUrl(to);
|
|
15
|
+
const normalizedHref = useBaseUrl(href, {
|
|
16
|
+
forcePrependBaseUrl: true,
|
|
17
|
+
});
|
|
18
|
+
return (
|
|
19
|
+
<Link
|
|
20
|
+
className="footer__link-item"
|
|
21
|
+
{...(href
|
|
22
|
+
? {
|
|
23
|
+
href: prependBaseUrlToHref ? normalizedHref : href,
|
|
24
|
+
}
|
|
25
|
+
: {
|
|
26
|
+
to: toUrl,
|
|
27
|
+
})}
|
|
28
|
+
{...props}>
|
|
29
|
+
{label}
|
|
30
|
+
{href && !isInternalUrl(href) && <IconExternalLink />}
|
|
31
|
+
</Link>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import LinkItem from '@theme/Footer/LinkItem';
|
|
9
|
+
|
|
10
|
+
function ColumnLinkItem({item}) {
|
|
11
|
+
return item.html ? (
|
|
12
|
+
<li
|
|
13
|
+
className="footer__item" // Developer provided the HTML, so assume it's safe.
|
|
14
|
+
// eslint-disable-next-line react/no-danger
|
|
15
|
+
dangerouslySetInnerHTML={{
|
|
16
|
+
__html: item.html,
|
|
17
|
+
}}
|
|
18
|
+
/>
|
|
19
|
+
) : (
|
|
20
|
+
<li key={item.href || item.to} className="footer__item">
|
|
21
|
+
<LinkItem item={item} />
|
|
22
|
+
</li>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function Column({column}) {
|
|
27
|
+
return (
|
|
28
|
+
<div className="col footer__col">
|
|
29
|
+
<div className="footer__title">{column.title}</div>
|
|
30
|
+
<ul className="footer__items">
|
|
31
|
+
{column.items.map((item, i) => (
|
|
32
|
+
<ColumnLinkItem key={i} item={item} />
|
|
33
|
+
))}
|
|
34
|
+
</ul>
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default function FooterLinksMultiColumn({columns}) {
|
|
40
|
+
return (
|
|
41
|
+
<div className="row footer__links">
|
|
42
|
+
{columns.map((column, i) => (
|
|
43
|
+
<Column key={i} column={column} />
|
|
44
|
+
))}
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
@@ -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
|
+
import React from 'react';
|
|
8
|
+
import LinkItem from '@theme/Footer/LinkItem';
|
|
9
|
+
|
|
10
|
+
function Separator() {
|
|
11
|
+
return <span className="footer__link-separator">·</span>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function SimpleLinkItem({item}) {
|
|
15
|
+
return item.html ? (
|
|
16
|
+
<span
|
|
17
|
+
className="footer__link-item" // Developer provided the HTML, so assume it's safe.
|
|
18
|
+
// eslint-disable-next-line react/no-danger
|
|
19
|
+
dangerouslySetInnerHTML={{
|
|
20
|
+
__html: item.html,
|
|
21
|
+
}}
|
|
22
|
+
/>
|
|
23
|
+
) : (
|
|
24
|
+
<LinkItem item={item} />
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default function FooterLinksSimple({links}) {
|
|
29
|
+
return (
|
|
30
|
+
<div className="footer__links text--center">
|
|
31
|
+
<div className="footer__links">
|
|
32
|
+
{links.map((item, i) => (
|
|
33
|
+
<React.Fragment key={i}>
|
|
34
|
+
<SimpleLinkItem item={item} />
|
|
35
|
+
{links.length !== i + 1 && <Separator />}
|
|
36
|
+
</React.Fragment>
|
|
37
|
+
))}
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import {isMultiColumnFooterLinks} from '@docusaurus/theme-common';
|
|
9
|
+
import FooterLinksMultiColumn from '@theme/Footer/Links/MultiColumn';
|
|
10
|
+
import FooterLinksSimple from '@theme/Footer/Links/Simple';
|
|
11
|
+
export default function FooterLinks({links}) {
|
|
12
|
+
return isMultiColumnFooterLinks(links) ? (
|
|
13
|
+
<FooterLinksMultiColumn columns={links} />
|
|
14
|
+
) : (
|
|
15
|
+
<FooterLinksSimple links={links} />
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import Link from '@docusaurus/Link';
|
|
9
|
+
import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
|
|
10
|
+
import styles from './styles.module.css';
|
|
11
|
+
import ThemedImage from '@theme/ThemedImage';
|
|
12
|
+
|
|
13
|
+
function LogoImage({logo}) {
|
|
14
|
+
const {withBaseUrl} = useBaseUrlUtils();
|
|
15
|
+
const sources = {
|
|
16
|
+
light: withBaseUrl(logo.src),
|
|
17
|
+
dark: withBaseUrl(logo.srcDark ?? logo.src),
|
|
18
|
+
};
|
|
19
|
+
return (
|
|
20
|
+
<ThemedImage
|
|
21
|
+
className="footer__logo"
|
|
22
|
+
alt={logo.alt}
|
|
23
|
+
sources={sources}
|
|
24
|
+
width={logo.width}
|
|
25
|
+
height={logo.height}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default function FooterLogo({logo}) {
|
|
31
|
+
return logo.href ? (
|
|
32
|
+
<Link href={logo.href} className={styles.footerLogoLink}>
|
|
33
|
+
<LogoImage logo={logo} />
|
|
34
|
+
</Link>
|
|
35
|
+
) : (
|
|
36
|
+
<LogoImage logo={logo} />
|
|
37
|
+
);
|
|
38
|
+
}
|