@docusaurus/theme-classic 2.0.0-beta.21 → 2.0.0-beta.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/lib/getSwizzleConfig.js +5 -5
  2. package/lib/index.js +4 -2
  3. package/lib/theme/Admonition/index.d.ts +1 -1
  4. package/lib/theme/Admonition/index.js +139 -57
  5. package/lib/{admonitions.css → theme/Admonition/styles.module.css} +14 -15
  6. package/lib/theme/AnnouncementBar/index.js +3 -2
  7. package/lib/theme/BackToTopButton/index.js +2 -1
  8. package/lib/theme/BlogListPage/index.js +2 -11
  9. package/lib/theme/BlogPostItem/Container/index.d.ts +9 -0
  10. package/lib/theme/BlogPostItem/Container/index.js +26 -0
  11. package/lib/theme/BlogPostItem/Content/index.d.ts +9 -0
  12. package/lib/theme/BlogPostItem/Content/index.js +23 -0
  13. package/lib/theme/BlogPostItem/Footer/ReadMoreLink/index.d.ts +9 -0
  14. package/lib/theme/BlogPostItem/Footer/ReadMoreLink/index.js +38 -0
  15. package/lib/theme/BlogPostItem/Footer/index.d.ts +8 -0
  16. package/lib/theme/BlogPostItem/Footer/index.js +52 -0
  17. package/lib/theme/BlogPostItem/Footer/styles.module.css +10 -0
  18. package/lib/theme/BlogPostItem/Header/Author/index.d.ts +9 -0
  19. package/lib/theme/{BlogPostAuthor → BlogPostItem/Header/Author}/index.js +3 -2
  20. package/lib/theme/BlogPostItem/Header/Authors/index.d.ts +9 -0
  21. package/{src/theme/BlogPostAuthors/index.tsx → lib/theme/BlogPostItem/Header/Authors/index.js} +9 -10
  22. package/lib/theme/{BlogPostAuthors → BlogPostItem/Header/Authors}/styles.module.css +0 -0
  23. package/lib/theme/{BlogPostAuthors → BlogPostItem/Header/Info}/index.d.ts +2 -2
  24. package/lib/theme/BlogPostItem/Header/Info/index.js +60 -0
  25. package/lib/theme/BlogPostItem/Header/Info/styles.module.css +10 -0
  26. package/lib/theme/BlogPostItem/Header/Title/index.d.ts +9 -0
  27. package/lib/theme/BlogPostItem/Header/Title/index.js +27 -0
  28. package/{src/theme/BlogPostItem → lib/theme/BlogPostItem/Header/Title}/styles.module.css +2 -10
  29. package/lib/theme/BlogPostItem/Header/index.d.ts +8 -0
  30. package/lib/theme/BlogPostItem/Header/index.js +19 -0
  31. package/lib/theme/BlogPostItem/index.d.ts +1 -1
  32. package/lib/theme/BlogPostItem/index.js +16 -142
  33. package/lib/theme/BlogPostItems/index.d.ts +9 -0
  34. package/lib/theme/BlogPostItems/index.js +27 -0
  35. package/lib/theme/BlogPostPage/Metadata/index.d.ts +8 -0
  36. package/lib/theme/BlogPostPage/Metadata/index.js +41 -0
  37. package/lib/theme/BlogPostPage/index.js +21 -60
  38. package/lib/theme/BlogTagsListPage/index.js +1 -1
  39. package/lib/theme/BlogTagsPostsPage/index.d.ts +1 -1
  40. package/lib/theme/BlogTagsPostsPage/index.js +36 -30
  41. package/lib/theme/CodeBlock/Container/index.js +2 -5
  42. package/lib/theme/CodeBlock/Content/String.js +2 -3
  43. package/lib/theme/CodeBlock/CopyButton/index.js +1 -0
  44. package/lib/theme/CodeBlock/Line/styles.module.css +7 -7
  45. package/lib/theme/ColorModeToggle/index.js +2 -2
  46. package/lib/theme/DocBreadcrumbs/index.js +3 -3
  47. package/lib/theme/DocCard/index.js +4 -1
  48. package/lib/theme/DocCardList/index.js +2 -2
  49. package/lib/theme/DocItem/Content/index.d.ts +9 -0
  50. package/lib/theme/DocItem/Content/index.js +44 -0
  51. package/lib/theme/DocItem/Footer/index.d.ts +8 -0
  52. package/lib/theme/{DocItemFooter → DocItem/Footer}/index.js +3 -3
  53. package/lib/theme/{DocItemFooter → DocItem/Footer}/styles.module.css +0 -0
  54. package/lib/theme/{BlogPostAuthor → DocItem/Layout}/index.d.ts +2 -2
  55. package/lib/theme/DocItem/Layout/index.js +59 -0
  56. package/lib/theme/DocItem/Layout/styles.module.css +17 -0
  57. package/lib/theme/DocItem/Metadata/index.d.ts +8 -0
  58. package/lib/theme/DocItem/Metadata/index.js +20 -0
  59. package/lib/theme/{DocItemFooter → DocItem/Paginator}/index.d.ts +5 -3
  60. package/lib/theme/DocItem/Paginator/index.js +17 -0
  61. package/lib/theme/DocItem/TOC/Desktop/index.d.ts +8 -0
  62. package/lib/theme/DocItem/TOC/Desktop/index.js +21 -0
  63. package/lib/theme/DocItem/TOC/Mobile/index.d.ts +8 -0
  64. package/lib/theme/DocItem/TOC/Mobile/index.js +23 -0
  65. package/lib/theme/DocItem/{styles.module.css → TOC/Mobile/styles.module.css} +0 -9
  66. package/lib/theme/DocItem/index.js +13 -106
  67. package/lib/theme/DocPage/Layout/Main/index.js +1 -1
  68. package/lib/theme/DocPage/Layout/Sidebar/ExpandButton/index.js +1 -1
  69. package/lib/theme/DocPage/Layout/Sidebar/index.js +2 -1
  70. package/lib/theme/DocPage/Layout/index.js +1 -1
  71. package/lib/theme/DocPage/index.js +2 -3
  72. package/lib/theme/DocSidebar/Desktop/CollapseButton/index.js +1 -1
  73. package/lib/theme/DocSidebar/Desktop/Content/index.js +2 -2
  74. package/lib/theme/DocSidebar/Mobile/index.js +1 -1
  75. package/lib/theme/DocSidebarItem/Category/index.js +6 -4
  76. package/lib/theme/DocSidebarItem/Link/index.js +3 -2
  77. package/lib/theme/DocSidebarItems/index.js +1 -1
  78. package/lib/theme/DocVersionBadge/index.js +2 -1
  79. package/lib/theme/DocVersionBanner/index.js +2 -2
  80. package/lib/theme/EditThisPage/index.js +1 -1
  81. package/lib/theme/Footer/LinkItem/index.js +1 -1
  82. package/lib/theme/Footer/Logo/index.js +7 -2
  83. package/lib/theme/{IconArrow → Icon/Arrow}/index.d.ts +1 -1
  84. package/lib/theme/{IconArrow → Icon/Arrow}/index.js +0 -0
  85. package/lib/theme/{IconClose → Icon/Close}/index.d.ts +1 -1
  86. package/lib/theme/{IconClose → Icon/Close}/index.js +0 -0
  87. package/lib/theme/{IconDarkMode → Icon/DarkMode}/index.d.ts +1 -1
  88. package/lib/theme/{IconDarkMode → Icon/DarkMode}/index.js +0 -0
  89. package/lib/theme/{IconEdit → Icon/Edit}/index.d.ts +1 -1
  90. package/lib/theme/{IconEdit → Icon/Edit}/index.js +0 -0
  91. package/lib/theme/{IconEdit → Icon/Edit}/styles.module.css +0 -0
  92. package/lib/theme/{IconExternalLink → Icon/ExternalLink}/index.d.ts +1 -1
  93. package/lib/theme/{IconExternalLink → Icon/ExternalLink}/index.js +0 -0
  94. package/lib/theme/{IconExternalLink → Icon/ExternalLink}/styles.module.css +0 -0
  95. package/lib/theme/{IconHome → Icon/Home}/index.d.ts +1 -1
  96. package/lib/theme/{IconHome → Icon/Home}/index.js +0 -0
  97. package/lib/theme/{IconLanguage → Icon/Language}/index.d.ts +1 -1
  98. package/lib/theme/{IconLanguage → Icon/Language}/index.js +0 -0
  99. package/lib/theme/{IconLightMode → Icon/LightMode}/index.d.ts +1 -1
  100. package/lib/theme/{IconLightMode → Icon/LightMode}/index.js +0 -0
  101. package/lib/theme/{IconMenu → Icon/Menu}/index.d.ts +1 -1
  102. package/lib/theme/{IconMenu → Icon/Menu}/index.js +0 -0
  103. package/lib/theme/Layout/Provider/index.d.ts +9 -0
  104. package/lib/theme/Layout/Provider/index.js +29 -0
  105. package/lib/theme/Layout/index.d.ts +0 -1
  106. package/lib/theme/Layout/index.js +12 -10
  107. package/{src/theme/Layout/styles.css → lib/theme/Layout/styles.module.css} +10 -12
  108. package/lib/theme/Logo/index.js +35 -17
  109. package/lib/theme/MDXComponents/Code.js +1 -1
  110. package/lib/theme/MDXComponents/index.js +2 -0
  111. package/lib/theme/MDXPage/index.js +6 -4
  112. package/lib/theme/Navbar/Content/index.js +2 -2
  113. package/lib/theme/Navbar/Layout/index.js +2 -2
  114. package/lib/theme/Navbar/MobileSidebar/Header/index.js +2 -2
  115. package/lib/theme/Navbar/MobileSidebar/Layout/index.js +1 -1
  116. package/lib/theme/Navbar/MobileSidebar/PrimaryMenu/index.js +2 -1
  117. package/lib/theme/Navbar/MobileSidebar/SecondaryMenu/index.js +2 -1
  118. package/lib/theme/Navbar/MobileSidebar/Toggle/index.js +2 -2
  119. package/lib/theme/Navbar/MobileSidebar/index.js +1 -1
  120. package/lib/theme/NavbarItem/DocNavbarItem.js +1 -1
  121. package/lib/theme/NavbarItem/DocSidebarNavbarItem.js +1 -1
  122. package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +2 -4
  123. package/lib/theme/NavbarItem/DocsVersionNavbarItem.js +1 -1
  124. package/lib/theme/NavbarItem/DropdownNavbarItem.js +2 -3
  125. package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.js +2 -2
  126. package/lib/theme/NavbarItem/NavbarNavLink.js +1 -1
  127. package/lib/theme/SiteMetadata/index.js +2 -3
  128. package/lib/theme/SkipToContent/index.js +1 -1
  129. package/lib/theme/TOCItems/index.js +2 -2
  130. package/lib/theme/Tabs/index.js +2 -2
  131. package/lib/validateThemeConfig.js +13 -18
  132. package/package.json +19 -15
  133. package/src/getSwizzleConfig.ts +5 -5
  134. package/src/index.ts +4 -2
  135. package/src/theme/Admonition/index.tsx +161 -58
  136. package/src/{admonitions.css → theme/Admonition/styles.module.css} +14 -15
  137. package/src/theme/AnnouncementBar/index.tsx +3 -2
  138. package/src/theme/BackToTopButton/index.tsx +2 -1
  139. package/src/theme/BlogListPage/index.tsx +2 -11
  140. package/src/theme/BlogPostItem/Container/index.tsx +32 -0
  141. package/src/theme/BlogPostItem/Content/index.tsx +29 -0
  142. package/src/theme/BlogPostItem/Footer/ReadMoreLink/index.tsx +44 -0
  143. package/src/theme/BlogPostItem/Footer/index.tsx +60 -0
  144. package/src/theme/BlogPostItem/Footer/styles.module.css +10 -0
  145. package/src/theme/{BlogPostAuthor → BlogPostItem/Header/Author}/index.tsx +8 -3
  146. package/{lib/theme/BlogPostAuthors/index.js → src/theme/BlogPostItem/Header/Authors/index.tsx} +14 -3
  147. package/src/theme/{BlogPostAuthors → BlogPostItem/Header/Authors}/styles.module.css +0 -0
  148. package/src/theme/BlogPostItem/Header/Info/index.tsx +71 -0
  149. package/src/theme/BlogPostItem/Header/Info/styles.module.css +10 -0
  150. package/src/theme/BlogPostItem/Header/Title/index.tsx +33 -0
  151. package/{lib/theme/BlogPostItem → src/theme/BlogPostItem/Header/Title}/styles.module.css +2 -10
  152. package/src/theme/BlogPostItem/Header/index.tsx +21 -0
  153. package/src/theme/BlogPostItem/index.tsx +19 -145
  154. package/src/theme/BlogPostItems/index.tsx +30 -0
  155. package/src/theme/BlogPostPage/Metadata/index.tsx +44 -0
  156. package/src/theme/BlogPostPage/index.tsx +29 -62
  157. package/src/theme/BlogTagsListPage/index.tsx +1 -1
  158. package/src/theme/BlogTagsPostsPage/index.tsx +42 -35
  159. package/src/theme/CodeBlock/Container/index.tsx +3 -6
  160. package/src/theme/CodeBlock/Content/String.tsx +2 -3
  161. package/src/theme/CodeBlock/CopyButton/index.tsx +1 -0
  162. package/src/theme/CodeBlock/Line/styles.module.css +7 -7
  163. package/src/theme/ColorModeToggle/index.tsx +2 -2
  164. package/src/theme/DocBreadcrumbs/index.tsx +3 -3
  165. package/src/theme/DocCard/index.tsx +4 -1
  166. package/src/theme/DocCardList/index.tsx +2 -2
  167. package/src/theme/DocItem/Content/index.tsx +48 -0
  168. package/src/theme/{DocItemFooter → DocItem/Footer}/index.tsx +4 -5
  169. package/src/theme/{DocItemFooter → DocItem/Footer}/styles.module.css +0 -0
  170. package/src/theme/DocItem/Layout/index.tsx +68 -0
  171. package/src/theme/DocItem/Layout/styles.module.css +17 -0
  172. package/src/theme/DocItem/Metadata/index.tsx +22 -0
  173. package/src/theme/DocItem/Paginator/index.tsx +19 -0
  174. package/src/theme/DocItem/TOC/Desktop/index.tsx +24 -0
  175. package/src/theme/DocItem/TOC/Mobile/index.tsx +27 -0
  176. package/src/theme/DocItem/{styles.module.css → TOC/Mobile/styles.module.css} +0 -9
  177. package/src/theme/DocItem/index.tsx +13 -115
  178. package/src/theme/DocPage/Layout/Main/index.tsx +1 -1
  179. package/src/theme/DocPage/Layout/Sidebar/ExpandButton/index.tsx +1 -1
  180. package/src/theme/DocPage/Layout/Sidebar/index.tsx +2 -1
  181. package/src/theme/DocPage/Layout/index.tsx +1 -1
  182. package/src/theme/DocPage/index.tsx +2 -3
  183. package/src/theme/DocPaginator/index.tsx +0 -1
  184. package/src/theme/DocSidebar/Desktop/CollapseButton/index.tsx +1 -1
  185. package/src/theme/DocSidebar/Desktop/Content/index.tsx +2 -2
  186. package/src/theme/DocSidebar/Mobile/index.tsx +1 -1
  187. package/src/theme/DocSidebarItem/Category/index.tsx +6 -4
  188. package/src/theme/DocSidebarItem/Link/index.tsx +3 -2
  189. package/src/theme/DocSidebarItems/index.tsx +1 -1
  190. package/src/theme/DocVersionBadge/index.tsx +2 -1
  191. package/src/theme/DocVersionBanner/index.tsx +2 -3
  192. package/src/theme/EditThisPage/index.tsx +1 -1
  193. package/src/theme/Footer/LinkItem/index.tsx +1 -1
  194. package/src/theme/Footer/Logo/index.tsx +7 -2
  195. package/src/theme/{IconArrow → Icon/Arrow}/index.tsx +1 -1
  196. package/src/theme/{IconClose → Icon/Close}/index.tsx +1 -1
  197. package/src/theme/{IconDarkMode → Icon/DarkMode}/index.tsx +1 -1
  198. package/src/theme/{IconEdit → Icon/Edit}/index.tsx +1 -1
  199. package/src/theme/{IconEdit → Icon/Edit}/styles.module.css +0 -0
  200. package/src/theme/{IconExternalLink → Icon/ExternalLink}/index.tsx +1 -1
  201. package/src/theme/{IconExternalLink → Icon/ExternalLink}/styles.module.css +0 -0
  202. package/src/theme/{IconHome → Icon/Home}/index.tsx +1 -1
  203. package/src/theme/{IconLanguage → Icon/Language}/index.tsx +1 -1
  204. package/src/theme/{IconLightMode → Icon/LightMode}/index.tsx +1 -1
  205. package/src/theme/{IconMenu → Icon/Menu}/index.tsx +1 -1
  206. package/src/theme/Layout/Provider/index.tsx +33 -0
  207. package/src/theme/Layout/index.tsx +12 -10
  208. package/{lib/theme/Layout/styles.css → src/theme/Layout/styles.module.css} +10 -12
  209. package/src/theme/Logo/index.tsx +49 -19
  210. package/src/theme/MDXComponents/Code.tsx +5 -2
  211. package/src/theme/MDXComponents/Details.tsx +2 -1
  212. package/src/theme/MDXComponents/Head.tsx +3 -5
  213. package/src/theme/MDXComponents/Pre.tsx +2 -1
  214. package/src/theme/MDXComponents/index.tsx +2 -0
  215. package/src/theme/MDXPage/index.tsx +6 -4
  216. package/src/theme/Navbar/Content/index.tsx +2 -2
  217. package/src/theme/Navbar/Layout/index.tsx +2 -2
  218. package/src/theme/Navbar/MobileSidebar/Header/index.tsx +2 -2
  219. package/src/theme/Navbar/MobileSidebar/Layout/index.tsx +1 -1
  220. package/src/theme/Navbar/MobileSidebar/PrimaryMenu/index.tsx +2 -1
  221. package/src/theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx +2 -1
  222. package/src/theme/Navbar/MobileSidebar/Toggle/index.tsx +2 -2
  223. package/src/theme/Navbar/MobileSidebar/index.tsx +1 -1
  224. package/src/theme/NavbarItem/DocNavbarItem.tsx +1 -1
  225. package/src/theme/NavbarItem/DocSidebarNavbarItem.tsx +1 -1
  226. package/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +2 -4
  227. package/src/theme/NavbarItem/DocsVersionNavbarItem.tsx +1 -1
  228. package/src/theme/NavbarItem/DropdownNavbarItem.tsx +2 -3
  229. package/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx +2 -2
  230. package/src/theme/NavbarItem/NavbarNavLink.tsx +1 -1
  231. package/src/theme/NavbarItem/index.tsx +1 -1
  232. package/src/theme/SiteMetadata/index.tsx +2 -3
  233. package/src/theme/SkipToContent/index.tsx +1 -1
  234. package/src/theme/TOCItems/index.tsx +3 -3
  235. package/src/theme/Tabs/index.tsx +2 -2
  236. package/src/theme-classic.d.ts +128 -36
  237. package/src/validateThemeConfig.ts +14 -18
  238. package/lib/theme/LayoutProviders/index.d.ts +0 -9
  239. package/lib/theme/LayoutProviders/index.js +0 -33
  240. package/src/theme/LayoutProviders/index.tsx +0 -36
@@ -8,16 +8,18 @@
8
8
  import React, {type ComponentProps, useEffect, useMemo} from 'react';
9
9
  import clsx from 'clsx';
10
10
  import {
11
- isActiveSidebarItem,
11
+ ThemeClassNames,
12
+ useThemeConfig,
12
13
  usePrevious,
13
14
  Collapsible,
14
15
  useCollapsible,
16
+ } from '@docusaurus/theme-common';
17
+ import {
18
+ isActiveSidebarItem,
15
19
  findFirstCategoryLink,
16
- ThemeClassNames,
17
- useThemeConfig,
18
20
  useDocSidebarItemsExpandedState,
19
21
  isSamePath,
20
- } from '@docusaurus/theme-common';
22
+ } from '@docusaurus/theme-common/internal';
21
23
  import Link from '@docusaurus/Link';
22
24
  import {translate} from '@docusaurus/Translate';
23
25
  import useIsBrowser from '@docusaurus/useIsBrowser';
@@ -7,10 +7,11 @@
7
7
 
8
8
  import React from 'react';
9
9
  import clsx from 'clsx';
10
- import {isActiveSidebarItem, ThemeClassNames} from '@docusaurus/theme-common';
10
+ import {ThemeClassNames} from '@docusaurus/theme-common';
11
+ import {isActiveSidebarItem} from '@docusaurus/theme-common/internal';
11
12
  import Link from '@docusaurus/Link';
12
13
  import isInternalUrl from '@docusaurus/isInternalUrl';
13
- import IconExternalLink from '@theme/IconExternalLink';
14
+ import IconExternalLink from '@theme/Icon/ExternalLink';
14
15
  import type {Props} from '@theme/DocSidebarItem/Link';
15
16
 
16
17
  import styles from './styles.module.css';
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import React, {memo} from 'react';
9
- import {DocSidebarItemsExpandedStateProvider} from '@docusaurus/theme-common';
9
+ import {DocSidebarItemsExpandedStateProvider} from '@docusaurus/theme-common/internal';
10
10
  import DocSidebarItem from '@theme/DocSidebarItem';
11
11
 
12
12
  import type {Props} from '@theme/DocSidebarItems';
@@ -8,7 +8,8 @@
8
8
  import React from 'react';
9
9
  import clsx from 'clsx';
10
10
  import Translate from '@docusaurus/Translate';
11
- import {ThemeClassNames, useDocsVersion} from '@docusaurus/theme-common';
11
+ import {ThemeClassNames} from '@docusaurus/theme-common';
12
+ import {useDocsVersion} from '@docusaurus/theme-common/internal';
12
13
  import type {Props} from '@theme/DocVersionBadge';
13
14
 
14
15
  export default function DocVersionBadge({
@@ -15,12 +15,11 @@ import {
15
15
  useDocVersionSuggestions,
16
16
  type GlobalVersion,
17
17
  } from '@docusaurus/plugin-content-docs/client';
18
+ import {ThemeClassNames} from '@docusaurus/theme-common';
18
19
  import {
19
- ThemeClassNames,
20
20
  useDocsPreferredVersion,
21
21
  useDocsVersion,
22
- } from '@docusaurus/theme-common';
23
-
22
+ } from '@docusaurus/theme-common/internal';
24
23
  import type {Props} from '@theme/DocVersionBanner';
25
24
  import type {
26
25
  VersionBanner,
@@ -8,7 +8,7 @@
8
8
  import React from 'react';
9
9
  import Translate from '@docusaurus/Translate';
10
10
  import {ThemeClassNames} from '@docusaurus/theme-common';
11
- import IconEdit from '@theme/IconEdit';
11
+ import IconEdit from '@theme/Icon/Edit';
12
12
  import type {Props} from '@theme/EditThisPage';
13
13
 
14
14
  export default function EditThisPage({editUrl}: Props): JSX.Element {
@@ -10,7 +10,7 @@ import React from 'react';
10
10
  import Link from '@docusaurus/Link';
11
11
  import useBaseUrl from '@docusaurus/useBaseUrl';
12
12
  import isInternalUrl from '@docusaurus/isInternalUrl';
13
- import IconExternalLink from '@theme/IconExternalLink';
13
+ import IconExternalLink from '@theme/Icon/ExternalLink';
14
14
  import type {Props} from '@theme/Footer/LinkItem';
15
15
 
16
16
  export default function FooterLinkItem({item}: Props): JSX.Element {
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
+ import clsx from 'clsx';
9
10
  import Link from '@docusaurus/Link';
10
11
  import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
11
12
  import ThemedImage from '@theme/ThemedImage';
@@ -21,18 +22,22 @@ function LogoImage({logo}: Props) {
21
22
  };
22
23
  return (
23
24
  <ThemedImage
24
- className="footer__logo"
25
+ className={clsx('footer__logo', logo.className)}
25
26
  alt={logo.alt}
26
27
  sources={sources}
27
28
  width={logo.width}
28
29
  height={logo.height}
30
+ style={logo.style}
29
31
  />
30
32
  );
31
33
  }
32
34
 
33
35
  export default function FooterLogo({logo}: Props): JSX.Element {
34
36
  return logo.href ? (
35
- <Link href={logo.href} className={styles.footerLogoLink}>
37
+ <Link
38
+ href={logo.href}
39
+ className={styles.footerLogoLink}
40
+ target={logo.target}>
36
41
  <LogoImage logo={logo} />
37
42
  </Link>
38
43
  ) : (
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import type {Props} from '@theme/IconArrow';
9
+ import type {Props} from '@theme/Icon/Arrow';
10
10
 
11
11
  export default function IconArrow(props: Props): JSX.Element {
12
12
  return (
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import type {Props} from '@theme/IconClose';
9
+ import type {Props} from '@theme/Icon/Close';
10
10
 
11
11
  export default function IconClose({
12
12
  width = 21,
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import type {Props} from '@theme/IconDarkMode';
9
+ import type {Props} from '@theme/Icon/DarkMode';
10
10
 
11
11
  export default function IconDarkMode(props: Props): JSX.Element {
12
12
  return (
@@ -7,7 +7,7 @@
7
7
 
8
8
  import React from 'react';
9
9
  import clsx from 'clsx';
10
- import type {Props} from '@theme/IconEdit';
10
+ import type {Props} from '@theme/Icon/Edit';
11
11
 
12
12
  import styles from './styles.module.css';
13
13
 
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import type {Props} from '@theme/IconExternalLink';
9
+ import type {Props} from '@theme/Icon/ExternalLink';
10
10
 
11
11
  import styles from './styles.module.css';
12
12
 
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import type {Props} from '@theme/IconHome';
9
+ import type {Props} from '@theme/Icon/Home';
10
10
 
11
11
  export default function IconHome(props: Props): JSX.Element {
12
12
  return (
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import type {Props} from '@theme/IconLanguage';
9
+ import type {Props} from '@theme/Icon/Language';
10
10
 
11
11
  export default function IconLanguage({
12
12
  width = 20,
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import type {Props} from '@theme/IconLightMode';
9
+ import type {Props} from '@theme/Icon/LightMode';
10
10
 
11
11
  export default function IconLightMode(props: Props): JSX.Element {
12
12
  return (
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import type {Props} from '@theme/IconMenu';
9
+ import type {Props} from '@theme/Icon/Menu';
10
10
 
11
11
  export default function IconMenu({
12
12
  width = 30,
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import React from 'react';
9
+ import {composeProviders} from '@docusaurus/theme-common';
10
+ import {
11
+ ColorModeProvider,
12
+ TabGroupChoiceProvider,
13
+ AnnouncementBarProvider,
14
+ DocsPreferredVersionContextProvider,
15
+ ScrollControllerProvider,
16
+ NavbarProvider,
17
+ PluginHtmlClassNameProvider,
18
+ } from '@docusaurus/theme-common/internal';
19
+ import type {Props} from '@theme/Layout/Provider';
20
+
21
+ const Provider = composeProviders([
22
+ ColorModeProvider,
23
+ AnnouncementBarProvider,
24
+ TabGroupChoiceProvider,
25
+ ScrollControllerProvider,
26
+ DocsPreferredVersionContextProvider,
27
+ PluginHtmlClassNameProvider,
28
+ NavbarProvider,
29
+ ]);
30
+
31
+ export default function LayoutProvider({children}: Props): JSX.Element {
32
+ return <Provider>{children}</Provider>;
33
+ }
@@ -8,19 +8,16 @@
8
8
  import React from 'react';
9
9
  import clsx from 'clsx';
10
10
  import ErrorBoundary from '@docusaurus/ErrorBoundary';
11
- import {
12
- PageMetadata,
13
- ThemeClassNames,
14
- useKeyboardNavigation,
15
- } from '@docusaurus/theme-common';
11
+ import {PageMetadata, ThemeClassNames} from '@docusaurus/theme-common';
12
+ import {useKeyboardNavigation} from '@docusaurus/theme-common/internal';
16
13
  import SkipToContent from '@theme/SkipToContent';
17
14
  import AnnouncementBar from '@theme/AnnouncementBar';
18
15
  import Navbar from '@theme/Navbar';
19
16
  import Footer from '@theme/Footer';
20
- import LayoutProviders from '@theme/LayoutProviders';
17
+ import LayoutProvider from '@theme/Layout/Provider';
21
18
  import ErrorPageContent from '@theme/ErrorPageContent';
22
- import './styles.css';
23
19
  import type {Props} from '@theme/Layout';
20
+ import styles from './styles.module.css';
24
21
 
25
22
  export default function Layout(props: Props): JSX.Element {
26
23
  const {
@@ -35,7 +32,7 @@ export default function Layout(props: Props): JSX.Element {
35
32
  useKeyboardNavigation();
36
33
 
37
34
  return (
38
- <LayoutProviders>
35
+ <LayoutProvider>
39
36
  <PageMetadata title={title} description={description} />
40
37
 
41
38
  <SkipToContent />
@@ -44,13 +41,18 @@ export default function Layout(props: Props): JSX.Element {
44
41
 
45
42
  <Navbar />
46
43
 
47
- <div className={clsx(ThemeClassNames.wrapper.main, wrapperClassName)}>
44
+ <div
45
+ className={clsx(
46
+ ThemeClassNames.wrapper.main,
47
+ styles.mainWrapper,
48
+ wrapperClassName,
49
+ )}>
48
50
  <ErrorBoundary fallback={(params) => <ErrorPageContent {...params} />}>
49
51
  {children}
50
52
  </ErrorBoundary>
51
53
  </div>
52
54
 
53
55
  {!noFooter && <Footer />}
54
- </LayoutProviders>
56
+ </LayoutProvider>
55
57
  );
56
58
  }
@@ -5,23 +5,21 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- html,
9
- body {
8
+ :global(html, body) {
10
9
  height: 100%;
11
10
  }
12
11
 
13
- #__docusaurus {
14
- min-height: 100%;
15
- display: flex;
16
- flex-direction: column;
17
- }
18
-
19
- .main-wrapper {
12
+ .mainWrapper {
20
13
  flex: 1 0 auto;
21
14
  }
22
15
 
23
- /* Docusaurus-specific utility classes */
24
-
25
- .docusaurus-mt-lg {
16
+ /* Docusaurus-specific utility class */
17
+ :global(.docusaurus-mt-lg) {
26
18
  margin-top: 3rem;
27
19
  }
20
+
21
+ :global(#__docusaurus) {
22
+ min-height: 100%;
23
+ display: flex;
24
+ flex-direction: column;
25
+ }
@@ -9,44 +9,74 @@ import React from 'react';
9
9
  import Link from '@docusaurus/Link';
10
10
  import useBaseUrl from '@docusaurus/useBaseUrl';
11
11
  import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
12
- import {useThemeConfig} from '@docusaurus/theme-common';
12
+ import {useThemeConfig, type NavbarLogo} from '@docusaurus/theme-common';
13
13
  import ThemedImage from '@theme/ThemedImage';
14
14
  import type {Props} from '@theme/Logo';
15
15
 
16
- export default function Logo(props: Props): JSX.Element {
17
- const {
18
- siteConfig: {title},
19
- } = useDocusaurusContext();
20
- const {
21
- navbar: {title: navbarTitle, logo = {src: ''}},
22
- } = useThemeConfig();
23
-
24
- const {imageClassName, titleClassName, ...propsRest} = props;
25
- const logoLink = useBaseUrl(logo.href || '/');
16
+ function LogoThemedImage({
17
+ logo,
18
+ alt,
19
+ imageClassName,
20
+ }: {
21
+ logo: NavbarLogo;
22
+ alt: string;
23
+ imageClassName?: string;
24
+ }) {
26
25
  const sources = {
27
26
  light: useBaseUrl(logo.src),
28
27
  dark: useBaseUrl(logo.srcDark || logo.src),
29
28
  };
30
29
  const themedImage = (
31
30
  <ThemedImage
31
+ className={logo.className}
32
32
  sources={sources}
33
33
  height={logo.height}
34
34
  width={logo.width}
35
- alt={logo.alt || navbarTitle || title}
35
+ alt={alt}
36
+ style={logo.style}
36
37
  />
37
38
  );
38
39
 
40
+ // Is this extra div really necessary?
41
+ // introduced in https://github.com/facebook/docusaurus/pull/5666
42
+ return imageClassName ? (
43
+ <div className={imageClassName}>{themedImage}</div>
44
+ ) : (
45
+ themedImage
46
+ );
47
+ }
48
+
49
+ export default function Logo(props: Props): JSX.Element {
50
+ const {
51
+ siteConfig: {title},
52
+ } = useDocusaurusContext();
53
+ const {
54
+ navbar: {title: navbarTitle, logo},
55
+ } = useThemeConfig();
56
+
57
+ const {imageClassName, titleClassName, ...propsRest} = props;
58
+ const logoLink = useBaseUrl(logo?.href || '/');
59
+
60
+ // If visible title is shown, fallback alt text should be
61
+ // an empty string to mark the logo as decorative.
62
+ const fallbackAlt = navbarTitle ? '' : title;
63
+
64
+ // Use logo alt text if provided (including empty string),
65
+ // and provide a sensible fallback otherwise.
66
+ const alt = logo?.alt ?? fallbackAlt;
67
+
39
68
  return (
40
69
  <Link
41
70
  to={logoLink}
42
71
  {...propsRest}
43
- {...(logo.target && {target: logo.target})}>
44
- {logo.src &&
45
- (imageClassName ? (
46
- <div className={imageClassName}>{themedImage}</div>
47
- ) : (
48
- themedImage
49
- ))}
72
+ {...(logo?.target && {target: logo.target})}>
73
+ {logo && (
74
+ <LogoThemedImage
75
+ logo={logo}
76
+ alt={alt}
77
+ imageClassName={imageClassName}
78
+ />
79
+ )}
50
80
  {navbarTitle != null && <b className={titleClassName}>{navbarTitle}</b>}
51
81
  </Link>
52
82
  );
@@ -11,7 +11,7 @@ import CodeBlock from '@theme/CodeBlock';
11
11
  import type {Props} from '@theme/MDXComponents/Code';
12
12
 
13
13
  export default function MDXCode(props: Props): JSX.Element {
14
- const inlineElements = [
14
+ const inlineElements: (string | undefined)[] = [
15
15
  'a',
16
16
  'b',
17
17
  'big',
@@ -26,7 +26,10 @@ export default function MDXCode(props: Props): JSX.Element {
26
26
  const shouldBeInline = React.Children.toArray(props.children).every(
27
27
  (el) =>
28
28
  (typeof el === 'string' && !el.includes('\n')) ||
29
- (isValidElement(el) && inlineElements.includes(el.props.mdxType)),
29
+ (isValidElement(el) &&
30
+ inlineElements.includes(
31
+ (el.props as {mdxType: string} | null)?.mdxType,
32
+ )),
30
33
  );
31
34
 
32
35
  return shouldBeInline ? (
@@ -15,7 +15,8 @@ export default function MDXDetails(props: Props): JSX.Element {
15
15
  // Details theme component
16
16
  const summary = items.find(
17
17
  (item): item is ReactElement<ComponentProps<'summary'>> =>
18
- React.isValidElement(item) && item.props?.mdxType === 'summary',
18
+ React.isValidElement(item) &&
19
+ (item.props as {mdxType: string} | null)?.mdxType === 'summary',
19
20
  );
20
21
  const children = <>{items.filter((item) => item !== summary)}</>;
21
22
 
@@ -5,8 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import React, {type ReactElement, type ComponentProps} from 'react';
9
- import Head from '@docusaurus/Head';
8
+ import React, {type ReactElement} from 'react';
9
+ import Head, {type Props as HeadProps} from '@docusaurus/Head';
10
10
  import type {Props} from '@theme/MDXComponents/Head';
11
11
 
12
12
  // MDX elements are wrapped through the MDX pragma. In some cases (notably usage
@@ -25,7 +25,5 @@ export default function MDXHead(props: Props): JSX.Element {
25
25
  const unwrappedChildren = React.Children.map(props.children, (child) =>
26
26
  React.isValidElement(child) ? unwrapMDXElement(child) : child,
27
27
  );
28
- return (
29
- <Head {...(props as ComponentProps<typeof Head>)}>{unwrappedChildren}</Head>
30
- );
28
+ return <Head {...(props as HeadProps)}>{unwrappedChildren}</Head>;
31
29
  }
@@ -14,7 +14,8 @@ export default function MDXPre(props: Props): JSX.Element {
14
14
  <CodeBlock
15
15
  // If this pre is created by a ``` fenced codeblock, unwrap the children
16
16
  {...(isValidElement(props.children) &&
17
- props.children.props?.originalType === 'code'
17
+ (props.children.props as {originalType: string} | null)?.originalType ===
18
+ 'code'
18
19
  ? props.children.props
19
20
  : {...props})}
20
21
  />
@@ -14,6 +14,7 @@ import MDXDetails from '@theme/MDXComponents/Details';
14
14
  import MDXHeading from '@theme/MDXComponents/Heading';
15
15
  import MDXUl from '@theme/MDXComponents/Ul';
16
16
  import MDXImg from '@theme/MDXComponents/Img';
17
+ import Admonition from '@theme/Admonition';
17
18
 
18
19
  import type {MDXComponentsObject} from '@theme/MDXComponents';
19
20
 
@@ -31,6 +32,7 @@ const MDXComponents: MDXComponentsObject = {
31
32
  h4: (props) => <MDXHeading as="h4" {...props} />,
32
33
  h5: (props) => <MDXHeading as="h5" {...props} />,
33
34
  h6: (props) => <MDXHeading as="h6" {...props} />,
35
+ admonition: Admonition,
34
36
  };
35
37
 
36
38
  export default MDXComponents;
@@ -38,11 +38,13 @@ export default function MDXPage(props: Props): JSX.Element {
38
38
  <main className="container container--fluid margin-vert--lg">
39
39
  <div className={clsx('row', styles.mdxPageWrapper)}>
40
40
  <div className={clsx('col', !hideTableOfContents && 'col--8')}>
41
- <MDXContent>
42
- <MDXPageContent />
43
- </MDXContent>
41
+ <article>
42
+ <MDXContent>
43
+ <MDXPageContent />
44
+ </MDXContent>
45
+ </article>
44
46
  </div>
45
- {!hideTableOfContents && MDXPageContent.toc && (
47
+ {!hideTableOfContents && MDXPageContent.toc.length > 0 && (
46
48
  <div className="col col--2">
47
49
  <TOC
48
50
  toc={MDXPageContent.toc}
@@ -6,11 +6,11 @@
6
6
  */
7
7
 
8
8
  import React, {type ReactNode} from 'react';
9
+ import {useThemeConfig} from '@docusaurus/theme-common';
9
10
  import {
10
11
  splitNavbarItems,
11
12
  useNavbarMobileSidebar,
12
- useThemeConfig,
13
- } from '@docusaurus/theme-common';
13
+ } from '@docusaurus/theme-common/internal';
14
14
  import NavbarItem, {type Props as NavbarItemConfig} from '@theme/NavbarItem';
15
15
  import NavbarColorModeToggle from '@theme/Navbar/ColorModeToggle';
16
16
  import SearchBar from '@theme/SearchBar';
@@ -7,11 +7,11 @@
7
7
 
8
8
  import React, {type ComponentProps} from 'react';
9
9
  import clsx from 'clsx';
10
+ import {useThemeConfig} from '@docusaurus/theme-common';
10
11
  import {
11
- useThemeConfig,
12
12
  useHideableNavbar,
13
13
  useNavbarMobileSidebar,
14
- } from '@docusaurus/theme-common';
14
+ } from '@docusaurus/theme-common/internal';
15
15
  import NavbarMobileSidebar from '@theme/Navbar/MobileSidebar';
16
16
  import type {Props} from '@theme/Navbar/Layout';
17
17
 
@@ -6,9 +6,9 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import {useNavbarMobileSidebar} from '@docusaurus/theme-common';
9
+ import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal';
10
10
  import NavbarColorModeToggle from '@theme/Navbar/ColorModeToggle';
11
- import IconClose from '@theme/IconClose';
11
+ import IconClose from '@theme/Icon/Close';
12
12
  import NavbarLogo from '@theme/Navbar/Logo';
13
13
 
14
14
  function CloseButton() {
@@ -7,7 +7,7 @@
7
7
 
8
8
  import React from 'react';
9
9
  import clsx from 'clsx';
10
- import {useNavbarSecondaryMenu} from '@docusaurus/theme-common';
10
+ import {useNavbarSecondaryMenu} from '@docusaurus/theme-common/internal';
11
11
  import type {Props} from '@theme/Navbar/MobileSidebar/Layout';
12
12
 
13
13
  export default function NavbarMobileSidebarLayout({
@@ -6,7 +6,8 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import {useNavbarMobileSidebar, useThemeConfig} from '@docusaurus/theme-common';
9
+ import {useThemeConfig} from '@docusaurus/theme-common';
10
+ import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal';
10
11
  import NavbarItem, {type Props as NavbarItemConfig} from '@theme/NavbarItem';
11
12
 
12
13
  function useNavbarItems() {
@@ -6,7 +6,8 @@
6
6
  */
7
7
 
8
8
  import React, {type ComponentProps} from 'react';
9
- import {useNavbarSecondaryMenu, useThemeConfig} from '@docusaurus/theme-common';
9
+ import {useThemeConfig} from '@docusaurus/theme-common';
10
+ import {useNavbarSecondaryMenu} from '@docusaurus/theme-common/internal';
10
11
  import Translate from '@docusaurus/Translate';
11
12
 
12
13
  function SecondaryMenuBackButton(props: ComponentProps<'button'>) {
@@ -6,8 +6,8 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import {useNavbarMobileSidebar} from '@docusaurus/theme-common';
10
- import IconMenu from '@theme/IconMenu';
9
+ import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal';
10
+ import IconMenu from '@theme/Icon/Menu';
11
11
 
12
12
  export default function MobileSidebarToggle(): JSX.Element {
13
13
  const mobileSidebar = useNavbarMobileSidebar();
@@ -9,7 +9,7 @@ import React from 'react';
9
9
  import {
10
10
  useLockBodyScroll,
11
11
  useNavbarMobileSidebar,
12
- } from '@docusaurus/theme-common';
12
+ } from '@docusaurus/theme-common/internal';
13
13
  import NavbarMobileSidebarLayout from '@theme/Navbar/MobileSidebar/Layout';
14
14
  import NavbarMobileSidebarHeader from '@theme/Navbar/MobileSidebar/Header';
15
15
  import NavbarMobileSidebarPrimaryMenu from '@theme/Navbar/MobileSidebar/PrimaryMenu';
@@ -7,7 +7,7 @@
7
7
 
8
8
  import React from 'react';
9
9
  import {useActiveDocContext} from '@docusaurus/plugin-content-docs/client';
10
- import {useLayoutDoc} from '@docusaurus/theme-common';
10
+ import {useLayoutDoc} from '@docusaurus/theme-common/internal';
11
11
  import DefaultNavbarItem from '@theme/NavbarItem/DefaultNavbarItem';
12
12
  import type {Props} from '@theme/NavbarItem/DocNavbarItem';
13
13