@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
@@ -5,114 +5,21 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React from 'react';
8
- import clsx from 'clsx';
9
- import {
10
- PageMetadata,
11
- HtmlClassNameProvider,
12
- ThemeClassNames,
13
- useWindowSize,
14
- } from '@docusaurus/theme-common';
15
- import DocPaginator from '@theme/DocPaginator';
16
- import DocVersionBanner from '@theme/DocVersionBanner';
17
- import DocVersionBadge from '@theme/DocVersionBadge';
18
- import DocItemFooter from '@theme/DocItemFooter';
19
- import TOC from '@theme/TOC';
20
- import TOCCollapsible from '@theme/TOCCollapsible';
21
- import Heading from '@theme/Heading';
22
- import DocBreadcrumbs from '@theme/DocBreadcrumbs';
23
- import MDXContent from '@theme/MDXContent';
24
- import styles from './styles.module.css';
25
- function DocItemMetadata(props) {
26
- const {content: DocContent} = props;
27
- const {metadata, frontMatter, assets} = DocContent;
28
- const {keywords} = frontMatter;
29
- const {description, title} = metadata;
30
- const image = assets.image ?? frontMatter.image;
31
- return <PageMetadata {...{title, description, keywords, image}} />;
32
- }
33
- function DocItemContent(props) {
34
- const {content: DocContent} = props;
35
- const {metadata, frontMatter} = DocContent;
36
- const {
37
- hide_title: hideTitle,
38
- hide_table_of_contents: hideTableOfContents,
39
- toc_min_heading_level: tocMinHeadingLevel,
40
- toc_max_heading_level: tocMaxHeadingLevel,
41
- } = frontMatter;
42
- const {title} = metadata;
43
- // We only add a title if:
44
- // - user doesn't ask to hide it with front matter
45
- // - the markdown content does not already contain a top-level h1 heading
46
- const shouldAddTitle =
47
- !hideTitle && typeof DocContent.contentTitle === 'undefined';
48
- const windowSize = useWindowSize();
49
- const canRenderTOC =
50
- !hideTableOfContents && DocContent.toc && DocContent.toc.length > 0;
51
- const renderTocDesktop =
52
- canRenderTOC && (windowSize === 'desktop' || windowSize === 'ssr');
53
- return (
54
- <div className="row">
55
- <div className={clsx('col', !hideTableOfContents && styles.docItemCol)}>
56
- <DocVersionBanner />
57
- <div className={styles.docItemContainer}>
58
- <article>
59
- <DocBreadcrumbs />
60
- <DocVersionBadge />
61
-
62
- {canRenderTOC && (
63
- <TOCCollapsible
64
- toc={DocContent.toc}
65
- minHeadingLevel={tocMinHeadingLevel}
66
- maxHeadingLevel={tocMaxHeadingLevel}
67
- className={clsx(
68
- ThemeClassNames.docs.docTocMobile,
69
- styles.tocMobile,
70
- )}
71
- />
72
- )}
73
-
74
- <div className={clsx(ThemeClassNames.docs.docMarkdown, 'markdown')}>
75
- {/*
76
- Title can be declared inside md content or declared through
77
- front matter and added manually. To make both cases consistent,
78
- the added title is added under the same div.markdown block
79
- See https://github.com/facebook/docusaurus/pull/4882#issuecomment-853021120
80
- */}
81
- {shouldAddTitle && (
82
- <header>
83
- <Heading as="h1">{title}</Heading>
84
- </header>
85
- )}
86
- <MDXContent>
87
- <DocContent />
88
- </MDXContent>
89
- </div>
90
-
91
- <DocItemFooter {...props} />
92
- </article>
93
-
94
- <DocPaginator previous={metadata.previous} next={metadata.next} />
95
- </div>
96
- </div>
97
- {renderTocDesktop && (
98
- <div className="col col--3">
99
- <TOC
100
- toc={DocContent.toc}
101
- minHeadingLevel={tocMinHeadingLevel}
102
- maxHeadingLevel={tocMaxHeadingLevel}
103
- className={ThemeClassNames.docs.docTocDesktop}
104
- />
105
- </div>
106
- )}
107
- </div>
108
- );
109
- }
8
+ import {HtmlClassNameProvider} from '@docusaurus/theme-common';
9
+ import {DocProvider} from '@docusaurus/theme-common/internal';
10
+ import DocItemMetadata from '@theme/DocItem/Metadata';
11
+ import DocItemLayout from '@theme/DocItem/Layout';
110
12
  export default function DocItem(props) {
111
13
  const docHtmlClassName = `docs-doc-id-${props.content.metadata.unversionedId}`;
14
+ const MDXComponent = props.content;
112
15
  return (
113
- <HtmlClassNameProvider className={docHtmlClassName}>
114
- <DocItemMetadata {...props} />
115
- <DocItemContent {...props} />
116
- </HtmlClassNameProvider>
16
+ <DocProvider content={props.content}>
17
+ <HtmlClassNameProvider className={docHtmlClassName}>
18
+ <DocItemMetadata />
19
+ <DocItemLayout>
20
+ <MDXComponent />
21
+ </DocItemLayout>
22
+ </HtmlClassNameProvider>
23
+ </DocProvider>
117
24
  );
118
25
  }
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import React from 'react';
8
8
  import clsx from 'clsx';
9
- import {useDocsSidebar} from '@docusaurus/theme-common';
9
+ import {useDocsSidebar} from '@docusaurus/theme-common/internal';
10
10
  import styles from './styles.module.css';
11
11
  export default function DocPageLayoutMain({hiddenSidebarContainer, children}) {
12
12
  const sidebar = useDocsSidebar();
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import React from 'react';
8
8
  import {translate} from '@docusaurus/Translate';
9
- import IconArrow from '@theme/IconArrow';
9
+ import IconArrow from '@theme/Icon/Arrow';
10
10
  import styles from './styles.module.css';
11
11
  export default function DocPageLayoutSidebarExpandButton({toggleSidebar}) {
12
12
  return (
@@ -6,7 +6,8 @@
6
6
  */
7
7
  import React, {useState, useCallback} from 'react';
8
8
  import clsx from 'clsx';
9
- import {ThemeClassNames, useDocsSidebar} from '@docusaurus/theme-common';
9
+ import {ThemeClassNames} from '@docusaurus/theme-common';
10
+ import {useDocsSidebar} from '@docusaurus/theme-common/internal';
10
11
  import {useLocation} from '@docusaurus/router';
11
12
  import DocSidebar from '@theme/DocSidebar';
12
13
  import ExpandButton from '@theme/DocPage/Layout/Sidebar/ExpandButton';
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React, {useState} from 'react';
8
- import {useDocsSidebar} from '@docusaurus/theme-common';
8
+ import {useDocsSidebar} from '@docusaurus/theme-common/internal';
9
9
  import Layout from '@theme/Layout';
10
10
  import BackToTopButton from '@theme/BackToTopButton';
11
11
  import DocPageLayoutSidebar from '@theme/DocPage/Layout/Sidebar';
@@ -6,14 +6,13 @@
6
6
  */
7
7
  import React from 'react';
8
8
  import clsx from 'clsx';
9
+ import {HtmlClassNameProvider, ThemeClassNames} from '@docusaurus/theme-common';
9
10
  import {
10
- HtmlClassNameProvider,
11
- ThemeClassNames,
12
11
  docVersionSearchTag,
13
12
  DocsSidebarProvider,
14
13
  DocsVersionProvider,
15
14
  useDocRouteMetadata,
16
- } from '@docusaurus/theme-common';
15
+ } from '@docusaurus/theme-common/internal';
17
16
  import DocPageLayout from '@theme/DocPage/Layout';
18
17
  import NotFound from '@theme/NotFound';
19
18
  import SearchMetadata from '@theme/SearchMetadata';
@@ -7,7 +7,7 @@
7
7
  import React from 'react';
8
8
  import clsx from 'clsx';
9
9
  import {translate} from '@docusaurus/Translate';
10
- import IconArrow from '@theme/IconArrow';
10
+ import IconArrow from '@theme/Icon/Arrow';
11
11
  import styles from './styles.module.css';
12
12
  export default function CollapseButton({onClick}) {
13
13
  return (
@@ -6,11 +6,11 @@
6
6
  */
7
7
  import React, {useState} from 'react';
8
8
  import clsx from 'clsx';
9
+ import {ThemeClassNames} from '@docusaurus/theme-common';
9
10
  import {
10
- ThemeClassNames,
11
11
  useAnnouncementBar,
12
12
  useScrollPosition,
13
- } from '@docusaurus/theme-common';
13
+ } from '@docusaurus/theme-common/internal';
14
14
  import DocSidebarItems from '@theme/DocSidebarItems';
15
15
  import styles from './styles.module.css';
16
16
  function useShowAnnouncementBar() {
@@ -9,8 +9,8 @@ import clsx from 'clsx';
9
9
  import {
10
10
  NavbarSecondaryMenuFiller,
11
11
  ThemeClassNames,
12
- useNavbarMobileSidebar,
13
12
  } from '@docusaurus/theme-common';
13
+ import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal';
14
14
  import DocSidebarItems from '@theme/DocSidebarItems';
15
15
  // eslint-disable-next-line react/function-component-definition
16
16
  const DocSidebarMobileSecondaryMenu = ({sidebar, path}) => {
@@ -7,16 +7,18 @@
7
7
  import React, {useEffect, useMemo} from 'react';
8
8
  import clsx from 'clsx';
9
9
  import {
10
- isActiveSidebarItem,
10
+ ThemeClassNames,
11
+ useThemeConfig,
11
12
  usePrevious,
12
13
  Collapsible,
13
14
  useCollapsible,
15
+ } from '@docusaurus/theme-common';
16
+ import {
17
+ isActiveSidebarItem,
14
18
  findFirstCategoryLink,
15
- ThemeClassNames,
16
- useThemeConfig,
17
19
  useDocSidebarItemsExpandedState,
18
20
  isSamePath,
19
- } from '@docusaurus/theme-common';
21
+ } from '@docusaurus/theme-common/internal';
20
22
  import Link from '@docusaurus/Link';
21
23
  import {translate} from '@docusaurus/Translate';
22
24
  import useIsBrowser from '@docusaurus/useIsBrowser';
@@ -6,10 +6,11 @@
6
6
  */
7
7
  import React from 'react';
8
8
  import clsx from 'clsx';
9
- import {isActiveSidebarItem, ThemeClassNames} from '@docusaurus/theme-common';
9
+ import {ThemeClassNames} from '@docusaurus/theme-common';
10
+ import {isActiveSidebarItem} from '@docusaurus/theme-common/internal';
10
11
  import Link from '@docusaurus/Link';
11
12
  import isInternalUrl from '@docusaurus/isInternalUrl';
12
- import IconExternalLink from '@theme/IconExternalLink';
13
+ import IconExternalLink from '@theme/Icon/ExternalLink';
13
14
  import styles from './styles.module.css';
14
15
  export default function DocSidebarItemLink({
15
16
  item,
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React, {memo} from 'react';
8
- import {DocSidebarItemsExpandedStateProvider} from '@docusaurus/theme-common';
8
+ import {DocSidebarItemsExpandedStateProvider} from '@docusaurus/theme-common/internal';
9
9
  import DocSidebarItem from '@theme/DocSidebarItem';
10
10
  // TODO this item should probably not receive the "activePath" props
11
11
  // TODO this triggers whole sidebar re-renders on navigation
@@ -7,7 +7,8 @@
7
7
  import React from 'react';
8
8
  import clsx from 'clsx';
9
9
  import Translate from '@docusaurus/Translate';
10
- import {ThemeClassNames, useDocsVersion} from '@docusaurus/theme-common';
10
+ import {ThemeClassNames} from '@docusaurus/theme-common';
11
+ import {useDocsVersion} from '@docusaurus/theme-common/internal';
11
12
  export default function DocVersionBadge({className}) {
12
13
  const versionMetadata = useDocsVersion();
13
14
  if (versionMetadata.badge) {
@@ -13,11 +13,11 @@ import {
13
13
  useActivePlugin,
14
14
  useDocVersionSuggestions,
15
15
  } from '@docusaurus/plugin-content-docs/client';
16
+ import {ThemeClassNames} from '@docusaurus/theme-common';
16
17
  import {
17
- ThemeClassNames,
18
18
  useDocsPreferredVersion,
19
19
  useDocsVersion,
20
- } from '@docusaurus/theme-common';
20
+ } from '@docusaurus/theme-common/internal';
21
21
  function UnreleasedVersionLabel({siteTitle, versionMetadata}) {
22
22
  return (
23
23
  <Translate
@@ -7,7 +7,7 @@
7
7
  import React from 'react';
8
8
  import Translate from '@docusaurus/Translate';
9
9
  import {ThemeClassNames} from '@docusaurus/theme-common';
10
- import IconEdit from '@theme/IconEdit';
10
+ import IconEdit from '@theme/Icon/Edit';
11
11
  export default function EditThisPage({editUrl}) {
12
12
  return (
13
13
  <a
@@ -8,7 +8,7 @@ import React from 'react';
8
8
  import Link from '@docusaurus/Link';
9
9
  import useBaseUrl from '@docusaurus/useBaseUrl';
10
10
  import isInternalUrl from '@docusaurus/isInternalUrl';
11
- import IconExternalLink from '@theme/IconExternalLink';
11
+ import IconExternalLink from '@theme/Icon/ExternalLink';
12
12
  export default function FooterLinkItem({item}) {
13
13
  const {to, href, label, prependBaseUrlToHref, ...props} = item;
14
14
  const toUrl = useBaseUrl(to);
@@ -5,6 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React from 'react';
8
+ import clsx from 'clsx';
8
9
  import Link from '@docusaurus/Link';
9
10
  import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
10
11
  import ThemedImage from '@theme/ThemedImage';
@@ -17,17 +18,21 @@ function LogoImage({logo}) {
17
18
  };
18
19
  return (
19
20
  <ThemedImage
20
- className="footer__logo"
21
+ className={clsx('footer__logo', logo.className)}
21
22
  alt={logo.alt}
22
23
  sources={sources}
23
24
  width={logo.width}
24
25
  height={logo.height}
26
+ style={logo.style}
25
27
  />
26
28
  );
27
29
  }
28
30
  export default function FooterLogo({logo}) {
29
31
  return logo.href ? (
30
- <Link href={logo.href} className={styles.footerLogoLink}>
32
+ <Link
33
+ href={logo.href}
34
+ className={styles.footerLogoLink}
35
+ target={logo.target}>
31
36
  <LogoImage logo={logo} />
32
37
  </Link>
33
38
  ) : (
@@ -5,5 +5,5 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  /// <reference types="react" />
8
- import type { Props } from '@theme/IconArrow';
8
+ import type { Props } from '@theme/Icon/Arrow';
9
9
  export default function IconArrow(props: Props): JSX.Element;
File without changes
@@ -5,5 +5,5 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  /// <reference types="react" />
8
- import type { Props } from '@theme/IconClose';
8
+ import type { Props } from '@theme/Icon/Close';
9
9
  export default function IconClose({ width, height, color, strokeWidth, className, ...restProps }: Props): JSX.Element;
File without changes
@@ -5,5 +5,5 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  /// <reference types="react" />
8
- import type { Props } from '@theme/IconDarkMode';
8
+ import type { Props } from '@theme/Icon/DarkMode';
9
9
  export default function IconDarkMode(props: Props): JSX.Element;
@@ -5,5 +5,5 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  /// <reference types="react" />
8
- import type { Props } from '@theme/IconEdit';
8
+ import type { Props } from '@theme/Icon/Edit';
9
9
  export default function IconEdit({ className, ...restProps }: Props): JSX.Element;
File without changes
@@ -5,5 +5,5 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  /// <reference types="react" />
8
- import type { Props } from '@theme/IconExternalLink';
8
+ import type { Props } from '@theme/Icon/ExternalLink';
9
9
  export default function IconExternalLink({ width, height, }: Props): JSX.Element;
@@ -5,5 +5,5 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  /// <reference types="react" />
8
- import type { Props } from '@theme/IconHome';
8
+ import type { Props } from '@theme/Icon/Home';
9
9
  export default function IconHome(props: Props): JSX.Element;
File without changes
@@ -5,5 +5,5 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  /// <reference types="react" />
8
- import type { Props } from '@theme/IconLanguage';
8
+ import type { Props } from '@theme/Icon/Language';
9
9
  export default function IconLanguage({ width, height, ...props }: Props): JSX.Element;
@@ -5,5 +5,5 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  /// <reference types="react" />
8
- import type { Props } from '@theme/IconLightMode';
8
+ import type { Props } from '@theme/Icon/LightMode';
9
9
  export default function IconLightMode(props: Props): JSX.Element;
@@ -5,5 +5,5 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  /// <reference types="react" />
8
- import type { Props } from '@theme/IconMenu';
8
+ import type { Props } from '@theme/Icon/Menu';
9
9
  export default function IconMenu({ width, height, className, ...restProps }: Props): JSX.Element;
File without changes
@@ -0,0 +1,9 @@
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
+ /// <reference types="react" />
8
+ import type { Props } from '@theme/Layout/Provider';
9
+ export default function LayoutProvider({ children }: Props): JSX.Element;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React from 'react';
8
+ import {composeProviders} from '@docusaurus/theme-common';
9
+ import {
10
+ ColorModeProvider,
11
+ TabGroupChoiceProvider,
12
+ AnnouncementBarProvider,
13
+ DocsPreferredVersionContextProvider,
14
+ ScrollControllerProvider,
15
+ NavbarProvider,
16
+ PluginHtmlClassNameProvider,
17
+ } from '@docusaurus/theme-common/internal';
18
+ const Provider = composeProviders([
19
+ ColorModeProvider,
20
+ AnnouncementBarProvider,
21
+ TabGroupChoiceProvider,
22
+ ScrollControllerProvider,
23
+ DocsPreferredVersionContextProvider,
24
+ PluginHtmlClassNameProvider,
25
+ NavbarProvider,
26
+ ]);
27
+ export default function LayoutProvider({children}) {
28
+ return <Provider>{children}</Provider>;
29
+ }
@@ -5,6 +5,5 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  /// <reference types="react" />
8
- import './styles.css';
9
8
  import type { Props } from '@theme/Layout';
10
9
  export default function Layout(props: Props): JSX.Element;
@@ -7,18 +7,15 @@
7
7
  import React from 'react';
8
8
  import clsx from 'clsx';
9
9
  import ErrorBoundary from '@docusaurus/ErrorBoundary';
10
- import {
11
- PageMetadata,
12
- ThemeClassNames,
13
- useKeyboardNavigation,
14
- } from '@docusaurus/theme-common';
10
+ import {PageMetadata, ThemeClassNames} from '@docusaurus/theme-common';
11
+ import {useKeyboardNavigation} from '@docusaurus/theme-common/internal';
15
12
  import SkipToContent from '@theme/SkipToContent';
16
13
  import AnnouncementBar from '@theme/AnnouncementBar';
17
14
  import Navbar from '@theme/Navbar';
18
15
  import Footer from '@theme/Footer';
19
- import LayoutProviders from '@theme/LayoutProviders';
16
+ import LayoutProvider from '@theme/Layout/Provider';
20
17
  import ErrorPageContent from '@theme/ErrorPageContent';
21
- import './styles.css';
18
+ import styles from './styles.module.css';
22
19
  export default function Layout(props) {
23
20
  const {
24
21
  children,
@@ -30,7 +27,7 @@ export default function Layout(props) {
30
27
  } = props;
31
28
  useKeyboardNavigation();
32
29
  return (
33
- <LayoutProviders>
30
+ <LayoutProvider>
34
31
  <PageMetadata title={title} description={description} />
35
32
 
36
33
  <SkipToContent />
@@ -39,13 +36,18 @@ export default function Layout(props) {
39
36
 
40
37
  <Navbar />
41
38
 
42
- <div className={clsx(ThemeClassNames.wrapper.main, wrapperClassName)}>
39
+ <div
40
+ className={clsx(
41
+ ThemeClassNames.wrapper.main,
42
+ styles.mainWrapper,
43
+ wrapperClassName,
44
+ )}>
43
45
  <ErrorBoundary fallback={(params) => <ErrorPageContent {...params} />}>
44
46
  {children}
45
47
  </ErrorBoundary>
46
48
  </div>
47
49
 
48
50
  {!noFooter && <Footer />}
49
- </LayoutProviders>
51
+ </LayoutProvider>
50
52
  );
51
53
  }
@@ -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
+ }