@docusaurus/theme-classic 2.0.0-beta.2 → 2.0.0-beta.20
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/deps.d.ts +13 -0
- package/lib/getSwizzleConfig.js +243 -0
- package/lib/index.js +42 -52
- package/lib/nprogress.css +41 -0
- package/lib/nprogress.js +46 -0
- package/lib/prism-include-languages.js +9 -5
- package/lib/theme-classic.d.ts +1279 -0
- package/lib/translations.js +52 -36
- package/lib/validateThemeConfig.js +298 -248
- package/lib-next/theme/Admonition/index.js +101 -0
- package/lib-next/theme/AnnouncementBar/index.js +8 -16
- package/lib-next/theme/AnnouncementBar/styles.module.css +23 -32
- package/lib-next/theme/BackToTopButton/index.js +33 -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 +33 -0
- package/lib-next/theme/BlogListPage/index.js +45 -35
- package/lib-next/theme/BlogListPaginator/index.js +27 -33
- package/lib-next/theme/BlogPostAuthor/index.js +49 -0
- package/lib-next/theme/BlogPostAuthors/index.js +44 -0
- package/{lib/theme/Toggle → lib-next/theme/BlogPostAuthors}/styles.module.css +11 -7
- package/lib-next/theme/BlogPostItem/index.js +96 -98
- package/lib-next/theme/BlogPostItem/styles.module.css +9 -0
- package/lib-next/theme/BlogPostPage/index.js +84 -37
- package/lib-next/theme/BlogPostPaginator/index.js +27 -37
- package/lib-next/theme/BlogSidebar/Desktop/index.js +41 -0
- package/{lib/theme/BlogSidebar → lib-next/theme/BlogSidebar/Desktop}/styles.module.css +5 -4
- package/lib-next/theme/BlogSidebar/Mobile/index.js +36 -0
- package/lib-next/theme/BlogSidebar/index.js +11 -33
- package/lib-next/theme/BlogTagsListPage/index.js +24 -65
- package/lib-next/theme/BlogTagsPostsPage/index.js +45 -48
- package/lib-next/theme/CodeBlock/Container/index.js +29 -0
- package/lib-next/theme/CodeBlock/Container/styles.module.css +14 -0
- package/lib-next/theme/CodeBlock/Content/Element.js +23 -0
- package/lib-next/theme/CodeBlock/Content/String.js +104 -0
- package/{lib/theme/CodeBlock → lib-next/theme/CodeBlock/Content}/styles.module.css +45 -27
- package/lib-next/theme/CodeBlock/CopyButton/index.js +61 -0
- package/lib-next/theme/CodeBlock/CopyButton/styles.module.css +47 -0
- package/lib-next/theme/CodeBlock/Line/index.js +49 -0
- package/lib-next/theme/CodeBlock/Line/styles.module.css +51 -0
- package/lib-next/theme/CodeBlock/WordWrapButton/index.js +40 -0
- package/{lib/theme/BlogPostItem → lib-next/theme/CodeBlock/WordWrapButton}/styles.module.css +5 -8
- package/lib-next/theme/CodeBlock/index.js +28 -256
- 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 +120 -0
- package/{lib/theme/Heading/styles.css → lib-next/theme/DocBreadcrumbs/styles.module.css} +9 -13
- 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 +33 -0
- package/lib-next/theme/DocCategoryGeneratedIndexPage/index.js +75 -0
- package/lib-next/theme/DocCategoryGeneratedIndexPage/styles.module.css +26 -0
- package/lib-next/theme/DocItem/index.js +98 -85
- package/lib-next/theme/DocItem/styles.module.css +12 -10
- package/lib-next/theme/DocItemFooter/index.js +79 -0
- package/{lib/theme/DocItem → lib-next/theme/DocItemFooter}/styles.module.css +1 -9
- package/lib-next/theme/DocPage/Layout/Main/index.js +29 -0
- package/lib-next/theme/DocPage/Layout/Main/styles.module.css +28 -0
- package/lib-next/theme/DocPage/Layout/Sidebar/ExpandButton/index.js +34 -0
- package/lib-next/theme/DocPage/Layout/Sidebar/ExpandButton/styles.module.css +33 -0
- package/lib-next/theme/DocPage/Layout/Sidebar/index.js +68 -0
- package/lib-next/theme/DocPage/Layout/Sidebar/index.module.css +32 -0
- package/lib-next/theme/DocPage/Layout/index.js +34 -0
- package/{lib/theme/IconExternalLink/styles.module.css → lib-next/theme/DocPage/Layout/index.module.css} +7 -4
- package/lib-next/theme/DocPage/index.js +39 -159
- package/lib-next/theme/DocPaginator/index.js +28 -40
- package/lib-next/theme/DocSidebar/Desktop/CollapseButton/index.js +34 -0
- package/lib-next/theme/DocSidebar/Desktop/CollapseButton/styles.module.css +46 -0
- package/lib-next/theme/DocSidebar/Desktop/Content/index.js +46 -0
- package/lib-next/theme/DocSidebar/Desktop/Content/styles.module.css +23 -0
- package/lib-next/theme/DocSidebar/Desktop/index.js +36 -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 -340
- package/lib-next/theme/DocSidebarItem/Category.js +197 -0
- package/lib-next/theme/DocSidebarItem/Html.js +27 -0
- package/lib-next/theme/DocSidebarItem/Html.module.css +13 -0
- package/lib-next/theme/DocSidebarItem/Link.js +53 -0
- package/{lib/theme/MDXPage/styles.module.css → lib-next/theme/DocSidebarItem/Link.module.css} +2 -2
- package/lib-next/theme/DocSidebarItem/index.js +23 -0
- package/lib-next/theme/DocSidebarItems/index.js +23 -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/DocVersionBanner/index.js +33 -16
- 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/lib-next/theme/Footer/{styles.module.css → Logo/styles.module.css} +2 -1
- package/lib-next/theme/Footer/index.js +12 -100
- package/lib-next/theme/Heading/index.js +31 -54
- package/lib-next/theme/Heading/styles.module.css +25 -5
- package/lib-next/theme/IconArrow/index.js +2 -5
- 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 +2 -5
- package/lib-next/theme/IconExternalLink/index.js +2 -5
- package/lib-next/theme/IconExternalLink/styles.module.css +0 -2
- package/lib-next/theme/IconHome/index.js +17 -0
- 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 +7 -5
- package/lib-next/theme/LastUpdated/index.js +4 -2
- package/lib-next/theme/Layout/index.js +19 -16
- package/lib-next/theme/LayoutProviders/index.js +16 -9
- package/lib-next/theme/Logo/index.js +25 -24
- 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/MDXComponents/Heading.js +11 -0
- package/lib-next/theme/MDXComponents/Img.js +24 -0
- package/{lib/theme/hooks/styles.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 +21 -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 +37 -34
- package/lib-next/theme/Navbar/ColorModeToggle/index.js +25 -0
- package/lib-next/theme/Navbar/Content/index.js +75 -0
- package/{lib/theme/TOCInline → lib-next/theme/Navbar/Content}/styles.module.css +7 -4
- package/lib-next/theme/Navbar/Layout/index.js +54 -0
- package/{lib/theme/Navbar → lib-next/theme/Navbar/Layout}/styles.module.css +0 -6
- 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/Search/index.js +11 -0
- package/lib-next/theme/Navbar/Search/styles.module.css +20 -0
- package/lib-next/theme/Navbar/index.js +7 -137
- package/lib-next/theme/NavbarItem/ComponentTypes.js +27 -0
- package/lib-next/theme/NavbarItem/DefaultNavbarItem.js +32 -202
- package/lib-next/theme/NavbarItem/DocNavbarItem.js +16 -30
- package/lib-next/theme/NavbarItem/DocSidebarNavbarItem.js +41 -0
- package/lib-next/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +54 -44
- package/lib-next/theme/NavbarItem/DocsVersionNavbarItem.js +2 -6
- package/lib-next/theme/NavbarItem/DropdownNavbarItem.js +167 -0
- package/lib-next/theme/NavbarItem/HtmlNavbarItem.js +30 -0
- package/lib-next/theme/NavbarItem/{LocaleDropdownNavbarItem.js → LocaleDropdownNavbarItem/index.js} +16 -22
- package/lib-next/theme/{hooks/styles.css → NavbarItem/LocaleDropdownNavbarItem/styles.module.css} +3 -2
- package/lib-next/theme/NavbarItem/NavbarNavLink.js +84 -0
- package/lib-next/theme/NavbarItem/SearchNavbarItem.js +6 -1
- package/lib-next/theme/NavbarItem/index.js +17 -24
- package/lib-next/{prism-include-languages.js → theme/NavbarItem/utils.js} +3 -4
- package/lib-next/theme/NotFound.js +39 -37
- package/lib-next/theme/PaginatorNavLink/index.js +23 -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 +31 -50
- package/lib-next/theme/SkipToContent/index.js +7 -32
- package/lib-next/theme/SkipToContent/styles.module.css +7 -0
- package/lib-next/theme/TOC/index.js +12 -39
- package/lib-next/theme/TOC/styles.module.css +1 -1
- package/lib-next/theme/TOCCollapsible/CollapseButton.js +29 -0
- package/lib-next/theme/TOCCollapsible/CollapseButton.module.css +29 -0
- package/lib-next/theme/TOCCollapsible/index.js +42 -0
- package/lib-next/theme/TOCCollapsible/index.module.css +31 -0
- package/lib-next/theme/TOCInline/index.js +10 -31
- package/lib-next/theme/TOCItems/Tree.js +40 -0
- package/lib-next/theme/TOCItems/index.js +54 -0
- package/lib-next/theme/TabItem/index.js +4 -5
- package/{lib/theme/IconEdit → lib-next/theme/TabItem}/styles.module.css +2 -3
- package/lib-next/theme/Tabs/__tests__/index.test.js +146 -0
- package/lib-next/theme/Tabs/index.js +111 -53
- package/lib-next/theme/Tabs/styles.module.css +4 -13
- package/lib-next/theme/Tag/index.js +23 -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-next/theme/TagsListInline/styles.module.css +15 -0
- package/lib-next/theme/ThemedImage/index.js +9 -12
- package/lib-next/theme/ThemedImage/styles.module.css +2 -2
- package/lib-next/theme/prism-include-languages.js +17 -15
- package/package.json +37 -32
- package/src/admonitions.css +39 -0
- package/src/deps.d.ts +13 -0
- package/src/getSwizzleConfig.ts +252 -0
- package/src/index.ts +48 -71
- package/src/nprogress.css +41 -0
- package/src/nprogress.ts +31 -0
- package/src/{prism-include-languages.js → 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/src/theme/{Toggle → 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 +84 -38
- package/src/theme/BlogPostPaginator/index.tsx +27 -36
- package/src/theme/BlogSidebar/Desktop/index.tsx +45 -0
- package/{lib-next/theme/BlogSidebar → src/theme/BlogSidebar/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 -66
- package/src/theme/BlogTagsPostsPage/index.tsx +49 -47
- 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/{lib-next/theme/CodeBlock → src/theme/CodeBlock/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 +48 -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 +25 -0
- package/src/theme/Details/styles.module.css +13 -0
- package/src/theme/DocBreadcrumbs/index.tsx +140 -0
- package/src/theme/{Heading/styles.css → DocBreadcrumbs/styles.module.css} +9 -13
- package/src/theme/DocCard/index.tsx +116 -0
- package/src/theme/DocCard/styles.module.css +34 -0
- package/src/theme/DocCardList/index.tsx +36 -0
- package/src/theme/DocCategoryGeneratedIndexPage/index.tsx +86 -0
- package/src/theme/DocCategoryGeneratedIndexPage/styles.module.css +26 -0
- package/src/theme/DocItem/index.tsx +91 -77
- package/src/theme/DocItem/styles.module.css +12 -10
- package/src/theme/DocItemFooter/index.tsx +91 -0
- package/{lib-next/theme/Toggle → src/theme/DocItemFooter}/styles.module.css +9 -8
- package/src/theme/DocPage/Layout/Main/index.tsx +37 -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.module.css +32 -0
- package/src/theme/DocPage/Layout/Sidebar/index.tsx +74 -0
- package/src/theme/DocPage/Layout/index.module.css +15 -0
- package/src/theme/DocPage/Layout/index.tsx +39 -0
- package/src/theme/DocPage/index.tsx +39 -165
- 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 -350
- package/src/theme/DocSidebarItem/Category.tsx +210 -0
- package/src/theme/DocSidebarItem/Html.module.css +13 -0
- package/src/theme/DocSidebarItem/Html.tsx +34 -0
- package/src/theme/DocSidebarItem/Link.module.css +10 -0
- package/src/theme/DocSidebarItem/Link.tsx +58 -0
- package/src/theme/DocSidebarItem/index.tsx +27 -0
- package/src/theme/DocSidebarItems/index.tsx +27 -0
- package/src/theme/DocTagDocListPage/index.tsx +96 -0
- package/src/theme/DocTagsListPage/index.tsx +44 -0
- package/src/theme/DocVersionBadge/index.tsx +35 -0
- package/src/theme/DocVersionBanner/index.tsx +53 -27
- 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/src/theme/Footer/{styles.module.css → Logo/styles.module.css} +2 -1
- package/src/theme/Footer/index.tsx +13 -113
- 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 -4
- 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 +19 -15
- package/src/theme/LayoutProviders/index.tsx +16 -9
- package/src/theme/Logo/index.tsx +21 -19
- package/src/theme/{ThemeContext.ts → MDXComponents/A.tsx} +5 -6
- package/src/theme/MDXComponents/Code.tsx +37 -0
- package/src/theme/MDXComponents/Details.tsx +25 -0
- package/src/theme/MDXComponents/Head.tsx +29 -0
- package/src/theme/MDXComponents/Heading.tsx +14 -0
- package/src/theme/MDXComponents/Img.module.css +10 -0
- package/src/theme/MDXComponents/Img.tsx +26 -0
- package/src/theme/MDXComponents/Pre.tsx +22 -0
- package/src/theme/MDXComponents/Ul.tsx +24 -0
- package/src/theme/MDXComponents/index.tsx +23 -42
- package/src/theme/MDXContent/index.tsx +15 -0
- package/src/theme/MDXPage/index.tsx +37 -34
- 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/src/theme/Navbar/{styles.module.css → 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 +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/Search/index.tsx +15 -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 +37 -207
- package/src/theme/NavbarItem/DocNavbarItem.tsx +18 -38
- package/src/theme/NavbarItem/DocSidebarNavbarItem.tsx +44 -0
- package/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +59 -51
- package/src/theme/NavbarItem/DocsVersionNavbarItem.tsx +5 -8
- package/src/theme/NavbarItem/DropdownNavbarItem.tsx +193 -0
- package/src/theme/NavbarItem/HtmlNavbarItem.tsx +32 -0
- package/src/theme/NavbarItem/{LocaleDropdownNavbarItem.tsx → LocaleDropdownNavbarItem/index.tsx} +19 -17
- package/src/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css +11 -0
- package/src/theme/NavbarItem/NavbarNavLink.tsx +80 -0
- package/src/theme/NavbarItem/SearchNavbarItem.tsx +6 -1
- package/src/theme/NavbarItem/index.tsx +22 -29
- package/src/theme/NavbarItem/utils.ts +13 -0
- package/src/theme/NotFound.tsx +39 -36
- 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 +7 -32
- package/src/theme/SkipToContent/styles.module.css +7 -0
- package/src/theme/TOC/index.tsx +13 -44
- package/src/theme/TOC/styles.module.css +1 -1
- package/src/theme/TOCCollapsible/CollapseButton.module.css +29 -0
- package/src/theme/TOCCollapsible/CollapseButton.tsx +35 -0
- package/src/theme/TOCCollapsible/index.module.css +31 -0
- package/src/theme/TOCCollapsible/index.tsx +45 -0
- package/src/theme/TOCInline/index.tsx +14 -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 +120 -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 -11
- package/src/theme/ThemedImage/styles.module.css +2 -2
- package/src/theme/prism-include-languages.ts +20 -15
- package/src/theme-classic.d.ts +1279 -0
- package/src/translations.ts +84 -58
- 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/AnnouncementBar/index.js +0 -72
- 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 -161
- package/lib/theme/BlogPostPage/index.js +0 -69
- package/lib/theme/BlogPostPaginator/index.js +0 -64
- package/lib/theme/BlogSidebar/index.js +0 -51
- package/lib/theme/BlogTagsListPage/index.js +0 -76
- package/lib/theme/BlogTagsPostsPage/index.js +0 -100
- package/lib/theme/CodeBlock/index.js +0 -253
- package/lib/theme/DocItem/index.js +0 -129
- package/lib/theme/DocPage/index.js +0 -173
- package/lib/theme/DocPage/styles.module.css +0 -86
- package/lib/theme/DocPaginator/index.js +0 -63
- package/lib/theme/DocSidebar/index.js +0 -306
- package/lib/theme/DocSidebar/styles.module.css +0 -124
- package/lib/theme/DocVersionBanner/index.js +0 -128
- 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/Footer/styles.module.css +0 -15
- package/lib/theme/Heading/index.js +0 -76
- package/lib/theme/Heading/styles.module.css +0 -15
- package/lib/theme/IconArrow/index.js +0 -28
- package/lib/theme/IconEdit/index.js +0 -34
- package/lib/theme/IconExternalLink/index.js +0 -30
- package/lib/theme/IconLanguage/index.js +0 -29
- package/lib/theme/IconMenu/index.js +0 -30
- package/lib/theme/LastUpdated/index.js +0 -61
- package/lib/theme/Layout/index.js +0 -64
- package/lib/theme/Layout/styles.css +0 -27
- package/lib/theme/LayoutHead/index.js +0 -144
- package/lib/theme/LayoutProviders/index.js +0 -36
- package/lib/theme/Logo/index.js +0 -60
- package/lib/theme/MDXComponents/index.js +0 -65
- package/lib/theme/MDXPage/index.js +0 -66
- package/lib/theme/Navbar/index.js +0 -147
- package/lib/theme/NavbarItem/DefaultNavbarItem.js +0 -209
- package/lib/theme/NavbarItem/DocNavbarItem.js +0 -63
- package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +0 -76
- 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 -57
- 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 -63
- package/lib/theme/SkipToContent/styles.module.css +0 -14
- 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/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 -49
- package/lib/theme/ThemedImage/styles.module.css +0 -18
- 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/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 -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/theme/prism-include-languages.js +0 -39
- 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/DocPage/styles.module.css +0 -86
- package/lib-next/theme/DocSidebar/styles.module.css +0 -124
- package/lib-next/theme/DocVersionSuggestions/index.js +0 -126
- 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 -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/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 -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/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/theme/BlogSidebar/styles.module.css +0 -44
- package/src/theme/CodeBlock/styles.module.css +0 -68
- package/src/theme/DocPage/styles.module.css +0 -86
- package/src/theme/DocSidebar/styles.module.css +0 -124
- 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/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/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
|
@@ -1,317 +1,367 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ThemeConfigSchema = exports.DEFAULT_CONFIG = void 0;
|
|
7
|
+
exports.validateThemeConfig = validateThemeConfig;
|
|
8
|
+
|
|
9
|
+
var _palenight = _interopRequireDefault(require("prism-react-renderer/themes/palenight"));
|
|
10
|
+
|
|
11
|
+
var _utilsValidation = require("@docusaurus/utils-validation");
|
|
12
|
+
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
|
|
1
15
|
/**
|
|
2
16
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
17
|
*
|
|
4
18
|
* This source code is licensed under the MIT license found in the
|
|
5
19
|
* LICENSE file in the root directory of this source tree.
|
|
6
20
|
*/
|
|
7
|
-
|
|
8
|
-
const {Joi, URISchema} = require('@docusaurus/utils-validation');
|
|
9
|
-
|
|
10
21
|
const DEFAULT_DOCS_CONFIG = {
|
|
11
22
|
versionPersistence: 'localStorage',
|
|
23
|
+
sidebar: {
|
|
24
|
+
hideable: false,
|
|
25
|
+
autoCollapseCategories: false
|
|
26
|
+
}
|
|
12
27
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
28
|
+
|
|
29
|
+
const DocsSchema = _utilsValidation.Joi.object({
|
|
30
|
+
versionPersistence: _utilsValidation.Joi.string().equal('localStorage', 'none').default(DEFAULT_DOCS_CONFIG.versionPersistence),
|
|
31
|
+
sidebar: _utilsValidation.Joi.object({
|
|
32
|
+
hideable: _utilsValidation.Joi.bool().default(DEFAULT_DOCS_CONFIG.sidebar.hideable),
|
|
33
|
+
autoCollapseCategories: _utilsValidation.Joi.bool().default(DEFAULT_DOCS_CONFIG.sidebar.autoCollapseCategories)
|
|
34
|
+
}).default(DEFAULT_DOCS_CONFIG.sidebar)
|
|
17
35
|
}).default(DEFAULT_DOCS_CONFIG);
|
|
18
36
|
|
|
19
37
|
const DEFAULT_COLOR_MODE_CONFIG = {
|
|
20
38
|
defaultMode: 'light',
|
|
21
39
|
disableSwitch: false,
|
|
22
|
-
respectPrefersColorScheme: false
|
|
23
|
-
switchConfig: {
|
|
24
|
-
darkIcon: '🌜',
|
|
25
|
-
darkIconStyle: {},
|
|
26
|
-
lightIcon: '🌞',
|
|
27
|
-
lightIconStyle: {},
|
|
28
|
-
},
|
|
40
|
+
respectPrefersColorScheme: false
|
|
29
41
|
};
|
|
30
|
-
|
|
31
42
|
const DEFAULT_CONFIG = {
|
|
32
43
|
colorMode: DEFAULT_COLOR_MODE_CONFIG,
|
|
33
44
|
docs: DEFAULT_DOCS_CONFIG,
|
|
34
|
-
|
|
45
|
+
metadata: [],
|
|
35
46
|
prism: {
|
|
36
47
|
additionalLanguages: [],
|
|
48
|
+
theme: _palenight.default,
|
|
49
|
+
magicComments: [{
|
|
50
|
+
className: 'theme-code-block-highlighted-line',
|
|
51
|
+
line: 'highlight-next-line',
|
|
52
|
+
block: {
|
|
53
|
+
start: 'highlight-start',
|
|
54
|
+
end: 'highlight-end'
|
|
55
|
+
}
|
|
56
|
+
}]
|
|
37
57
|
},
|
|
38
58
|
navbar: {
|
|
39
59
|
hideOnScroll: false,
|
|
40
|
-
items: []
|
|
60
|
+
items: []
|
|
41
61
|
},
|
|
42
|
-
|
|
62
|
+
tableOfContents: {
|
|
63
|
+
minHeadingLevel: 2,
|
|
64
|
+
maxHeadingLevel: 3
|
|
65
|
+
}
|
|
43
66
|
};
|
|
44
67
|
exports.DEFAULT_CONFIG = DEFAULT_CONFIG;
|
|
45
68
|
|
|
46
|
-
const NavbarItemPosition = Joi.string().equal('left', 'right').default('left');
|
|
69
|
+
const NavbarItemPosition = _utilsValidation.Joi.string().equal('left', 'right').default('left');
|
|
47
70
|
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// We allow any unknown attributes on the links
|
|
56
|
-
// (users may need additional attributes like target, aria-role, data-customAttribute...)
|
|
57
|
-
.unknown();
|
|
71
|
+
const NavbarItemBaseSchema = _utilsValidation.Joi.object({
|
|
72
|
+
label: _utilsValidation.Joi.string(),
|
|
73
|
+
html: _utilsValidation.Joi.string(),
|
|
74
|
+
className: _utilsValidation.Joi.string()
|
|
75
|
+
}).nand('html', 'label') // We allow any unknown attributes on the links (users may need additional
|
|
76
|
+
// attributes like target, aria-role, data-customAttribute...)
|
|
77
|
+
.unknown();
|
|
58
78
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
79
|
+
const DefaultNavbarItemSchema = NavbarItemBaseSchema.append({
|
|
80
|
+
to: _utilsValidation.Joi.string(),
|
|
81
|
+
href: _utilsValidation.URISchema,
|
|
82
|
+
activeBasePath: _utilsValidation.Joi.string(),
|
|
83
|
+
activeBaseRegex: _utilsValidation.Joi.string(),
|
|
84
|
+
prependBaseUrlToHref: _utilsValidation.Joi.bool(),
|
|
85
|
+
// This is only triggered in case of a nested dropdown
|
|
86
|
+
items: _utilsValidation.Joi.forbidden().messages({
|
|
87
|
+
'any.unknown': 'Nested dropdowns are not allowed'
|
|
88
|
+
})
|
|
89
|
+
}).xor('href', 'to').messages({
|
|
90
|
+
'object.xor': 'One and only one between "to" and "href" should be provided'
|
|
67
91
|
});
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const DocsVersionNavbarItemSchema = Joi.object({
|
|
73
|
-
type: Joi.string().equal('docsVersion').required(),
|
|
74
|
-
position: NavbarItemPosition,
|
|
75
|
-
label: Joi.string(),
|
|
76
|
-
to: Joi.string(),
|
|
77
|
-
docsPluginId: Joi.string(),
|
|
78
|
-
className: Joi.string(),
|
|
92
|
+
const DocsVersionNavbarItemSchema = NavbarItemBaseSchema.append({
|
|
93
|
+
type: _utilsValidation.Joi.string().equal('docsVersion').required(),
|
|
94
|
+
to: _utilsValidation.Joi.string(),
|
|
95
|
+
docsPluginId: _utilsValidation.Joi.string()
|
|
79
96
|
});
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
docsPluginId: Joi.string(),
|
|
85
|
-
dropdownActiveClassDisabled: Joi.boolean(),
|
|
86
|
-
dropdownItemsBefore: Joi.array().items(BaseNavbarItemSchema).default([]),
|
|
87
|
-
dropdownItemsAfter: Joi.array().items(BaseNavbarItemSchema).default([]),
|
|
88
|
-
className: Joi.string(),
|
|
97
|
+
const DocItemSchema = NavbarItemBaseSchema.append({
|
|
98
|
+
type: _utilsValidation.Joi.string().equal('doc').required(),
|
|
99
|
+
docId: _utilsValidation.Joi.string().required(),
|
|
100
|
+
docsPluginId: _utilsValidation.Joi.string()
|
|
89
101
|
});
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
docId: Joi.string().required(),
|
|
95
|
-
label: Joi.string(),
|
|
96
|
-
docsPluginId: Joi.string(),
|
|
97
|
-
activeSidebarClassName: Joi.string().default('navbar__link--active'),
|
|
98
|
-
className: Joi.string(),
|
|
102
|
+
const DocSidebarItemSchema = NavbarItemBaseSchema.append({
|
|
103
|
+
type: _utilsValidation.Joi.string().equal('docSidebar').required(),
|
|
104
|
+
sidebarId: _utilsValidation.Joi.string().required(),
|
|
105
|
+
docsPluginId: _utilsValidation.Joi.string()
|
|
99
106
|
});
|
|
100
107
|
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
});
|
|
108
|
+
const HtmlNavbarItemSchema = _utilsValidation.Joi.object({
|
|
109
|
+
className: _utilsValidation.Joi.string(),
|
|
110
|
+
type: _utilsValidation.Joi.string().equal('html').required(),
|
|
111
|
+
value: _utilsValidation.Joi.string().required()
|
|
112
|
+
}); // A temporary workaround to allow users to add custom navbar items
|
|
113
|
+
// See https://github.com/facebook/docusaurus/issues/7227
|
|
108
114
|
|
|
109
|
-
const SearchItemSchema = Joi.object({
|
|
110
|
-
type: Joi.string().equal('search').required(),
|
|
111
|
-
position: NavbarItemPosition,
|
|
112
|
-
});
|
|
113
115
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
116
|
+
const CustomNavbarItemRegexp = /custom-.*/;
|
|
117
|
+
|
|
118
|
+
const CustomNavbarItemSchema = _utilsValidation.Joi.object({
|
|
119
|
+
type: _utilsValidation.Joi.string().regex(CustomNavbarItemRegexp).required()
|
|
120
|
+
}).unknown();
|
|
121
|
+
|
|
122
|
+
const itemWithType = type => {
|
|
123
|
+
// Because equal(undefined) is not supported :/
|
|
124
|
+
const typeSchema = // eslint-disable-next-line no-nested-ternary
|
|
125
|
+
type instanceof RegExp ? _utilsValidation.Joi.string().required().regex(type) : type ? _utilsValidation.Joi.string().required().equal(type) : _utilsValidation.Joi.string().forbidden();
|
|
126
|
+
return _utilsValidation.Joi.object({
|
|
127
|
+
type: typeSchema
|
|
128
|
+
}).unknown().required();
|
|
126
129
|
};
|
|
127
130
|
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
131
|
+
const DropdownSubitemSchema = _utilsValidation.Joi.object({
|
|
132
|
+
position: _utilsValidation.Joi.forbidden()
|
|
133
|
+
}).when('.', {
|
|
134
|
+
switch: [{
|
|
135
|
+
is: itemWithType('docsVersion'),
|
|
136
|
+
then: DocsVersionNavbarItemSchema
|
|
137
|
+
}, {
|
|
138
|
+
is: itemWithType('doc'),
|
|
139
|
+
then: DocItemSchema
|
|
140
|
+
}, {
|
|
141
|
+
is: itemWithType('docSidebar'),
|
|
142
|
+
then: DocSidebarItemSchema
|
|
143
|
+
}, {
|
|
144
|
+
is: itemWithType(undefined),
|
|
145
|
+
then: DefaultNavbarItemSchema
|
|
146
|
+
}, {
|
|
147
|
+
is: itemWithType('html'),
|
|
148
|
+
then: HtmlNavbarItemSchema
|
|
149
|
+
}, {
|
|
150
|
+
is: itemWithType(CustomNavbarItemRegexp),
|
|
151
|
+
then: CustomNavbarItemSchema
|
|
152
|
+
}, {
|
|
153
|
+
is: _utilsValidation.Joi.alternatives().try(itemWithType('dropdown'), itemWithType('docsVersionDropdown'), itemWithType('localeDropdown'), itemWithType('search')),
|
|
154
|
+
then: _utilsValidation.Joi.forbidden().messages({
|
|
155
|
+
'any.unknown': 'Nested dropdowns are not allowed'
|
|
156
|
+
})
|
|
157
|
+
}],
|
|
158
|
+
otherwise: _utilsValidation.Joi.forbidden().messages({
|
|
159
|
+
'any.unknown': 'Bad navbar item type {.type}'
|
|
160
|
+
})
|
|
158
161
|
});
|
|
159
162
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
.
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
.
|
|
168
|
-
|
|
169
|
-
|
|
163
|
+
const DropdownNavbarItemSchema = NavbarItemBaseSchema.append({
|
|
164
|
+
items: _utilsValidation.Joi.array().items(DropdownSubitemSchema).required()
|
|
165
|
+
});
|
|
166
|
+
const DocsVersionDropdownNavbarItemSchema = NavbarItemBaseSchema.append({
|
|
167
|
+
type: _utilsValidation.Joi.string().equal('docsVersionDropdown').required(),
|
|
168
|
+
docsPluginId: _utilsValidation.Joi.string(),
|
|
169
|
+
dropdownActiveClassDisabled: _utilsValidation.Joi.boolean(),
|
|
170
|
+
dropdownItemsBefore: _utilsValidation.Joi.array().items(DropdownSubitemSchema).default([]),
|
|
171
|
+
dropdownItemsAfter: _utilsValidation.Joi.array().items(DropdownSubitemSchema).default([])
|
|
172
|
+
});
|
|
173
|
+
const LocaleDropdownNavbarItemSchema = NavbarItemBaseSchema.append({
|
|
174
|
+
type: _utilsValidation.Joi.string().equal('localeDropdown').required(),
|
|
175
|
+
dropdownItemsBefore: _utilsValidation.Joi.array().items(DropdownSubitemSchema).default([]),
|
|
176
|
+
dropdownItemsAfter: _utilsValidation.Joi.array().items(DropdownSubitemSchema).default([])
|
|
177
|
+
});
|
|
170
178
|
|
|
171
|
-
|
|
179
|
+
const SearchItemSchema = _utilsValidation.Joi.object({
|
|
180
|
+
type: _utilsValidation.Joi.string().equal('search').required()
|
|
181
|
+
});
|
|
172
182
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
183
|
+
const NavbarItemSchema = _utilsValidation.Joi.object({
|
|
184
|
+
position: NavbarItemPosition
|
|
185
|
+
}).when('.', {
|
|
186
|
+
switch: [{
|
|
187
|
+
is: itemWithType('docsVersion'),
|
|
188
|
+
then: DocsVersionNavbarItemSchema
|
|
189
|
+
}, {
|
|
190
|
+
is: itemWithType('dropdown'),
|
|
191
|
+
then: DropdownNavbarItemSchema
|
|
192
|
+
}, {
|
|
193
|
+
is: itemWithType('docsVersionDropdown'),
|
|
194
|
+
then: DocsVersionDropdownNavbarItemSchema
|
|
195
|
+
}, {
|
|
196
|
+
is: itemWithType('doc'),
|
|
197
|
+
then: DocItemSchema
|
|
198
|
+
}, {
|
|
199
|
+
is: itemWithType('docSidebar'),
|
|
200
|
+
then: DocSidebarItemSchema
|
|
201
|
+
}, {
|
|
202
|
+
is: itemWithType('localeDropdown'),
|
|
203
|
+
then: LocaleDropdownNavbarItemSchema
|
|
204
|
+
}, {
|
|
205
|
+
is: itemWithType('search'),
|
|
206
|
+
then: SearchItemSchema
|
|
207
|
+
}, {
|
|
208
|
+
is: itemWithType('html'),
|
|
209
|
+
then: HtmlNavbarItemSchema
|
|
210
|
+
}, {
|
|
211
|
+
is: itemWithType(CustomNavbarItemRegexp),
|
|
212
|
+
then: CustomNavbarItemSchema
|
|
213
|
+
}, {
|
|
214
|
+
is: itemWithType(undefined),
|
|
215
|
+
then: _utilsValidation.Joi.object().when('.', {
|
|
216
|
+
// Dropdown item can be specified without type field
|
|
217
|
+
is: _utilsValidation.Joi.object({
|
|
218
|
+
items: _utilsValidation.Joi.array().required()
|
|
219
|
+
}).unknown(),
|
|
220
|
+
then: DropdownNavbarItemSchema,
|
|
221
|
+
otherwise: DefaultNavbarItemSchema
|
|
222
|
+
})
|
|
223
|
+
}],
|
|
224
|
+
otherwise: _utilsValidation.Joi.forbidden().messages({
|
|
225
|
+
'any.unknown': 'Bad navbar item type {.type}'
|
|
226
|
+
})
|
|
178
227
|
});
|
|
179
|
-
*/
|
|
180
228
|
|
|
181
|
-
const ColorModeSchema = Joi.object({
|
|
182
|
-
defaultMode: Joi.string()
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
),
|
|
189
|
-
switchConfig: Joi.object({
|
|
190
|
-
darkIcon: Joi.string().default(
|
|
191
|
-
DEFAULT_COLOR_MODE_CONFIG.switchConfig.darkIcon,
|
|
192
|
-
),
|
|
193
|
-
darkIconStyle: Joi.object().default(
|
|
194
|
-
DEFAULT_COLOR_MODE_CONFIG.switchConfig.darkIconStyle,
|
|
195
|
-
),
|
|
196
|
-
lightIcon: Joi.string().default(
|
|
197
|
-
DEFAULT_COLOR_MODE_CONFIG.switchConfig.lightIcon,
|
|
198
|
-
),
|
|
199
|
-
lightIconStyle: Joi.object().default(
|
|
200
|
-
DEFAULT_COLOR_MODE_CONFIG.switchConfig.lightIconStyle,
|
|
201
|
-
),
|
|
202
|
-
}).default(DEFAULT_COLOR_MODE_CONFIG.switchConfig),
|
|
229
|
+
const ColorModeSchema = _utilsValidation.Joi.object({
|
|
230
|
+
defaultMode: _utilsValidation.Joi.string().equal('dark', 'light').default(DEFAULT_COLOR_MODE_CONFIG.defaultMode),
|
|
231
|
+
disableSwitch: _utilsValidation.Joi.bool().default(DEFAULT_COLOR_MODE_CONFIG.disableSwitch),
|
|
232
|
+
respectPrefersColorScheme: _utilsValidation.Joi.bool().default(DEFAULT_COLOR_MODE_CONFIG.respectPrefersColorScheme),
|
|
233
|
+
switchConfig: _utilsValidation.Joi.any().forbidden().messages({
|
|
234
|
+
'any.unknown': 'colorMode.switchConfig is deprecated. If you want to customize the icons for light and dark mode, swizzle IconLightMode, IconDarkMode, or ColorModeToggle instead.'
|
|
235
|
+
})
|
|
203
236
|
}).default(DEFAULT_COLOR_MODE_CONFIG);
|
|
204
237
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
itemprop: Joi.string(),
|
|
238
|
+
const HtmlMetadataSchema = _utilsValidation.Joi.object({
|
|
239
|
+
id: _utilsValidation.Joi.string(),
|
|
240
|
+
name: _utilsValidation.Joi.string(),
|
|
241
|
+
property: _utilsValidation.Joi.string(),
|
|
242
|
+
content: _utilsValidation.Joi.string(),
|
|
243
|
+
itemprop: _utilsValidation.Joi.string()
|
|
212
244
|
}).unknown();
|
|
213
245
|
|
|
214
|
-
const FooterLinkItemSchema = Joi.object({
|
|
215
|
-
to: Joi.string(),
|
|
216
|
-
href: URISchema,
|
|
217
|
-
html: Joi.string(),
|
|
218
|
-
label: Joi.string()
|
|
219
|
-
})
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
.with('href', 'label')
|
|
223
|
-
.nand('html', 'label')
|
|
224
|
-
// We allow any unknown attributes on the links
|
|
225
|
-
// (users may need additional attributes like target, aria-role, data-customAttribute...)
|
|
226
|
-
.unknown();
|
|
246
|
+
const FooterLinkItemSchema = _utilsValidation.Joi.object({
|
|
247
|
+
to: _utilsValidation.Joi.string(),
|
|
248
|
+
href: _utilsValidation.URISchema,
|
|
249
|
+
html: _utilsValidation.Joi.string(),
|
|
250
|
+
label: _utilsValidation.Joi.string()
|
|
251
|
+
}).xor('to', 'href', 'html').with('to', 'label').with('href', 'label').nand('html', 'label') // We allow any unknown attributes on the links (users may need additional
|
|
252
|
+
// attributes like target, aria-role, data-customAttribute...)
|
|
253
|
+
.unknown();
|
|
227
254
|
|
|
228
|
-
const CustomCssSchema = Joi.alternatives()
|
|
229
|
-
.try(Joi.array().items(Joi.string().required()), Joi.string().required())
|
|
230
|
-
.optional();
|
|
255
|
+
const CustomCssSchema = _utilsValidation.Joi.alternatives().try(_utilsValidation.Joi.array().items(_utilsValidation.Joi.string().required()), _utilsValidation.Joi.string().required()).optional();
|
|
231
256
|
|
|
232
|
-
const ThemeConfigSchema = Joi.object({
|
|
257
|
+
const ThemeConfigSchema = _utilsValidation.Joi.object({
|
|
233
258
|
// TODO temporary (@alpha-58)
|
|
234
|
-
disableDarkMode: Joi.any().forbidden(
|
|
235
|
-
'any.unknown':
|
|
236
|
-
'disableDarkMode theme config is deprecated. Please use the new colorMode attribute. You likely want: config.themeConfig.colorMode.disableSwitch = true',
|
|
259
|
+
disableDarkMode: _utilsValidation.Joi.any().forbidden().messages({
|
|
260
|
+
'any.unknown': 'disableDarkMode theme config is deprecated. Please use the new colorMode attribute. You likely want: config.themeConfig.colorMode.disableSwitch = true'
|
|
237
261
|
}),
|
|
238
262
|
// TODO temporary (@alpha-58)
|
|
239
|
-
defaultDarkMode: Joi.any().forbidden(
|
|
240
|
-
'any.unknown':
|
|
241
|
-
'defaultDarkMode theme config is deprecated. Please use the new colorMode attribute. You likely want: config.themeConfig.colorMode.defaultMode = "dark"',
|
|
263
|
+
defaultDarkMode: _utilsValidation.Joi.any().forbidden().messages({
|
|
264
|
+
'any.unknown': 'defaultDarkMode theme config is deprecated. Please use the new colorMode attribute. You likely want: config.themeConfig.colorMode.defaultMode = "dark"'
|
|
242
265
|
}),
|
|
243
266
|
customCss: CustomCssSchema,
|
|
244
267
|
colorMode: ColorModeSchema,
|
|
245
|
-
image: Joi.string(),
|
|
268
|
+
image: _utilsValidation.Joi.string(),
|
|
246
269
|
docs: DocsSchema,
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
270
|
+
metadata: _utilsValidation.Joi.array().items(HtmlMetadataSchema).default(DEFAULT_CONFIG.metadata),
|
|
271
|
+
// cSpell:ignore metadatas
|
|
272
|
+
metadatas: _utilsValidation.Joi.any().forbidden().messages({
|
|
273
|
+
'any.unknown': // cSpell:ignore metadatas
|
|
274
|
+
'themeConfig.metadatas has been renamed as themeConfig.metadata. See https://github.com/facebook/docusaurus/pull/5871'
|
|
275
|
+
}),
|
|
276
|
+
announcementBar: _utilsValidation.Joi.object({
|
|
277
|
+
id: _utilsValidation.Joi.string().default('announcement-bar'),
|
|
278
|
+
content: _utilsValidation.Joi.string().required(),
|
|
279
|
+
backgroundColor: _utilsValidation.Joi.string(),
|
|
280
|
+
textColor: _utilsValidation.Joi.string(),
|
|
281
|
+
isCloseable: _utilsValidation.Joi.bool().default(true)
|
|
256
282
|
}).optional(),
|
|
257
|
-
navbar: Joi.object({
|
|
258
|
-
style: Joi.string().equal('dark', 'primary'),
|
|
259
|
-
hideOnScroll: Joi.bool().default(DEFAULT_CONFIG.navbar.hideOnScroll),
|
|
283
|
+
navbar: _utilsValidation.Joi.object({
|
|
284
|
+
style: _utilsValidation.Joi.string().equal('dark', 'primary'),
|
|
285
|
+
hideOnScroll: _utilsValidation.Joi.bool().default(DEFAULT_CONFIG.navbar.hideOnScroll),
|
|
260
286
|
// TODO temporary (@alpha-58)
|
|
261
|
-
links: Joi.any().forbidden().messages({
|
|
262
|
-
'any.unknown':
|
|
263
|
-
'themeConfig.navbar.links has been renamed as themeConfig.navbar.items',
|
|
264
|
-
}),
|
|
265
|
-
items: Joi.array()
|
|
266
|
-
.items(NavbarItemSchema)
|
|
267
|
-
.default(DEFAULT_CONFIG.navbar.items),
|
|
268
|
-
title: Joi.string().allow('', null),
|
|
269
|
-
logo: Joi.object({
|
|
270
|
-
alt: Joi.string().allow(''),
|
|
271
|
-
src: Joi.string().required(),
|
|
272
|
-
srcDark: Joi.string(),
|
|
273
|
-
href: Joi.string(),
|
|
274
|
-
target: Joi.string(),
|
|
287
|
+
links: _utilsValidation.Joi.any().forbidden().messages({
|
|
288
|
+
'any.unknown': 'themeConfig.navbar.links has been renamed as themeConfig.navbar.items'
|
|
275
289
|
}),
|
|
290
|
+
items: _utilsValidation.Joi.array().items(NavbarItemSchema).default(DEFAULT_CONFIG.navbar.items),
|
|
291
|
+
title: _utilsValidation.Joi.string().allow('', null),
|
|
292
|
+
logo: _utilsValidation.Joi.object({
|
|
293
|
+
alt: _utilsValidation.Joi.string().allow(''),
|
|
294
|
+
src: _utilsValidation.Joi.string().required(),
|
|
295
|
+
srcDark: _utilsValidation.Joi.string(),
|
|
296
|
+
width: _utilsValidation.Joi.alternatives().try(_utilsValidation.Joi.string(), _utilsValidation.Joi.number()),
|
|
297
|
+
height: _utilsValidation.Joi.alternatives().try(_utilsValidation.Joi.string(), _utilsValidation.Joi.number()),
|
|
298
|
+
href: _utilsValidation.Joi.string(),
|
|
299
|
+
target: _utilsValidation.Joi.string()
|
|
300
|
+
})
|
|
276
301
|
}).default(DEFAULT_CONFIG.navbar),
|
|
277
|
-
footer: Joi.object({
|
|
278
|
-
style: Joi.string().equal('dark', 'light').default('light'),
|
|
279
|
-
logo: Joi.object({
|
|
280
|
-
alt: Joi.string().allow(''),
|
|
281
|
-
src: Joi.string(),
|
|
282
|
-
srcDark: Joi.string(),
|
|
283
|
-
|
|
302
|
+
footer: _utilsValidation.Joi.object({
|
|
303
|
+
style: _utilsValidation.Joi.string().equal('dark', 'light').default('light'),
|
|
304
|
+
logo: _utilsValidation.Joi.object({
|
|
305
|
+
alt: _utilsValidation.Joi.string().allow(''),
|
|
306
|
+
src: _utilsValidation.Joi.string().required(),
|
|
307
|
+
srcDark: _utilsValidation.Joi.string(),
|
|
308
|
+
// TODO infer this from reading the image
|
|
309
|
+
width: _utilsValidation.Joi.alternatives().try(_utilsValidation.Joi.string(), _utilsValidation.Joi.number()),
|
|
310
|
+
height: _utilsValidation.Joi.alternatives().try(_utilsValidation.Joi.string(), _utilsValidation.Joi.number()),
|
|
311
|
+
href: _utilsValidation.Joi.string()
|
|
284
312
|
}),
|
|
285
|
-
copyright: Joi.string(),
|
|
286
|
-
links: Joi.array()
|
|
287
|
-
.
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
)
|
|
293
|
-
.default([]),
|
|
313
|
+
copyright: _utilsValidation.Joi.string(),
|
|
314
|
+
links: _utilsValidation.Joi.alternatives(_utilsValidation.Joi.array().items(_utilsValidation.Joi.object({
|
|
315
|
+
title: _utilsValidation.Joi.string().allow(null).default(null),
|
|
316
|
+
items: _utilsValidation.Joi.array().items(FooterLinkItemSchema).default([])
|
|
317
|
+
})), _utilsValidation.Joi.array().items(FooterLinkItemSchema)).messages({
|
|
318
|
+
'alternatives.match': `The footer must be either simple or multi-column, and not a mix of the two. See: https://docusaurus.io/docs/api/themes/configuration#footer-links`
|
|
319
|
+
}).default([])
|
|
294
320
|
}).optional(),
|
|
295
|
-
prism: Joi.object({
|
|
296
|
-
theme: Joi.object({
|
|
297
|
-
plain: Joi.alternatives().try(Joi.array(), Joi.object()).required(),
|
|
298
|
-
styles: Joi.alternatives().try(Joi.array(), Joi.object()).required()
|
|
321
|
+
prism: _utilsValidation.Joi.object({
|
|
322
|
+
theme: _utilsValidation.Joi.object({
|
|
323
|
+
plain: _utilsValidation.Joi.alternatives().try(_utilsValidation.Joi.array(), _utilsValidation.Joi.object()).required(),
|
|
324
|
+
styles: _utilsValidation.Joi.alternatives().try(_utilsValidation.Joi.array(), _utilsValidation.Joi.object()).required()
|
|
325
|
+
}).default(DEFAULT_CONFIG.prism.theme),
|
|
326
|
+
darkTheme: _utilsValidation.Joi.object({
|
|
327
|
+
plain: _utilsValidation.Joi.alternatives().try(_utilsValidation.Joi.array(), _utilsValidation.Joi.object()).required(),
|
|
328
|
+
styles: _utilsValidation.Joi.alternatives().try(_utilsValidation.Joi.array(), _utilsValidation.Joi.object()).required()
|
|
299
329
|
}),
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
330
|
+
defaultLanguage: _utilsValidation.Joi.string(),
|
|
331
|
+
additionalLanguages: _utilsValidation.Joi.array().items(_utilsValidation.Joi.string()).default(DEFAULT_CONFIG.prism.additionalLanguages),
|
|
332
|
+
magicComments: _utilsValidation.Joi.array().items(_utilsValidation.Joi.object({
|
|
333
|
+
className: _utilsValidation.Joi.string().required(),
|
|
334
|
+
line: _utilsValidation.Joi.string(),
|
|
335
|
+
block: _utilsValidation.Joi.object({
|
|
336
|
+
start: _utilsValidation.Joi.string().required(),
|
|
337
|
+
end: _utilsValidation.Joi.string().required()
|
|
338
|
+
})
|
|
339
|
+
}).or('line', 'block')).default(DEFAULT_CONFIG.prism.magicComments)
|
|
340
|
+
}).default(DEFAULT_CONFIG.prism).unknown(),
|
|
341
|
+
hideableSidebar: _utilsValidation.Joi.forbidden().messages({
|
|
342
|
+
'any.unknown': 'themeConfig.hideableSidebar has been moved to themeConfig.docs.sidebar.hideable.'
|
|
343
|
+
}),
|
|
344
|
+
autoCollapseSidebarCategories: _utilsValidation.Joi.forbidden().messages({
|
|
345
|
+
'any.unknown': 'themeConfig.autoCollapseSidebarCategories has been moved to themeConfig.docs.sidebar.autoCollapseCategories.'
|
|
346
|
+
}),
|
|
347
|
+
sidebarCollapsible: _utilsValidation.Joi.forbidden().messages({
|
|
348
|
+
'any.unknown': 'The themeConfig.sidebarCollapsible has been moved to docs plugin options. See: https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs'
|
|
349
|
+
}),
|
|
350
|
+
tableOfContents: _utilsValidation.Joi.object({
|
|
351
|
+
minHeadingLevel: _utilsValidation.Joi.number().default(DEFAULT_CONFIG.tableOfContents.minHeadingLevel).when('maxHeadingLevel', {
|
|
352
|
+
is: _utilsValidation.Joi.exist(),
|
|
353
|
+
then: _utilsValidation.Joi.number().integer().min(2).max(6).max(_utilsValidation.Joi.ref('maxHeadingLevel')),
|
|
354
|
+
otherwise: _utilsValidation.Joi.number().integer().min(2).max(6)
|
|
303
355
|
}),
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
.items(Joi.string())
|
|
307
|
-
.default(DEFAULT_CONFIG.prism.additionalLanguages),
|
|
308
|
-
})
|
|
309
|
-
.default(DEFAULT_CONFIG.prism)
|
|
310
|
-
.unknown(),
|
|
311
|
-
hideableSidebar: Joi.bool().default(DEFAULT_CONFIG.hideableSidebar),
|
|
356
|
+
maxHeadingLevel: _utilsValidation.Joi.number().integer().min(2).max(6).default(DEFAULT_CONFIG.tableOfContents.maxHeadingLevel)
|
|
357
|
+
}).default(DEFAULT_CONFIG.tableOfContents)
|
|
312
358
|
});
|
|
359
|
+
|
|
313
360
|
exports.ThemeConfigSchema = ThemeConfigSchema;
|
|
314
361
|
|
|
315
|
-
|
|
362
|
+
function validateThemeConfig({
|
|
363
|
+
validate,
|
|
364
|
+
themeConfig
|
|
365
|
+
}) {
|
|
316
366
|
return validate(ThemeConfigSchema, themeConfig);
|
|
317
|
-
}
|
|
367
|
+
}
|