@docusaurus/theme-classic 2.0.0-beta.1ec2c95e3 → 2.0.0-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (675) hide show
  1. package/README.md +2 -2
  2. package/lib/admonitions.css +39 -0
  3. package/lib/getSwizzleConfig.d.ts +8 -0
  4. package/lib/getSwizzleConfig.js +228 -0
  5. package/lib/index.d.ts +12 -0
  6. package/lib/index.js +106 -170
  7. package/lib/nprogress.css +41 -0
  8. package/lib/nprogress.d.ts +10 -0
  9. package/lib/nprogress.js +25 -0
  10. package/lib/prism-include-languages.d.ts +7 -0
  11. package/lib/prism-include-languages.js +0 -2
  12. package/lib/theme/Admonition/index.d.ts +9 -0
  13. package/lib/theme/Admonition/index.js +101 -0
  14. package/lib/theme/AnnouncementBar/index.d.ts +8 -0
  15. package/lib/theme/AnnouncementBar/index.js +38 -63
  16. package/lib/theme/AnnouncementBar/styles.module.css +23 -32
  17. package/lib/theme/BackToTopButton/index.d.ts +8 -0
  18. package/lib/theme/BackToTopButton/index.js +31 -0
  19. package/lib/theme/BackToTopButton/styles.module.css +44 -0
  20. package/lib/theme/BlogArchivePage/index.d.ts +10 -0
  21. package/lib/theme/BlogArchivePage/index.js +80 -0
  22. package/lib/theme/BlogLayout/index.d.ts +9 -0
  23. package/lib/theme/BlogLayout/index.js +33 -0
  24. package/lib/theme/BlogListPage/index.d.ts +10 -0
  25. package/lib/theme/BlogListPage/index.js +53 -61
  26. package/lib/theme/BlogListPaginator/index.d.ts +9 -0
  27. package/lib/theme/BlogListPaginator/index.js +41 -56
  28. package/lib/theme/BlogPostAuthor/index.d.ts +9 -0
  29. package/lib/theme/BlogPostAuthor/index.js +46 -0
  30. package/lib/theme/BlogPostAuthors/index.d.ts +9 -0
  31. package/lib/theme/BlogPostAuthors/index.js +42 -0
  32. package/{src/theme/Toggle → lib/theme/BlogPostAuthors}/styles.module.css +11 -7
  33. package/lib/theme/BlogPostItem/index.d.ts +9 -0
  34. package/lib/theme/BlogPostItem/index.js +120 -127
  35. package/lib/theme/BlogPostItem/styles.module.css +9 -0
  36. package/lib/theme/BlogPostPage/index.d.ts +10 -0
  37. package/lib/theme/BlogPostPage/index.js +90 -60
  38. package/lib/theme/BlogPostPaginator/index.d.ts +9 -0
  39. package/lib/theme/BlogPostPaginator/index.js +40 -57
  40. package/lib/theme/BlogSidebar/Desktop/index.d.ts +9 -0
  41. package/{lib-next/theme/BlogSidebar → lib/theme/BlogSidebar/Desktop}/index.js +19 -23
  42. package/{lib-next/theme/BlogSidebar → lib/theme/BlogSidebar/Desktop}/styles.module.css +5 -4
  43. package/lib/theme/BlogSidebar/Mobile/index.d.ts +9 -0
  44. package/lib/theme/BlogSidebar/Mobile/index.js +34 -0
  45. package/lib/theme/BlogSidebar/index.d.ts +9 -0
  46. package/lib/theme/BlogSidebar/index.js +13 -43
  47. package/lib/theme/BlogTagsListPage/index.d.ts +10 -0
  48. package/lib/theme/BlogTagsListPage/index.js +27 -69
  49. package/lib/theme/BlogTagsPostsPage/index.d.ts +10 -0
  50. package/lib/theme/BlogTagsPostsPage/index.js +72 -89
  51. package/lib/theme/CodeBlock/Container/index.d.ts +10 -0
  52. package/lib/theme/CodeBlock/Container/index.js +30 -0
  53. package/lib/theme/CodeBlock/Container/styles.module.css +14 -0
  54. package/lib/theme/CodeBlock/Content/Element.d.ts +9 -0
  55. package/lib/theme/CodeBlock/Content/Element.js +23 -0
  56. package/lib/theme/CodeBlock/Content/String.d.ts +9 -0
  57. package/lib/theme/CodeBlock/Content/String.js +104 -0
  58. package/{lib-next/theme/CodeBlock → lib/theme/CodeBlock/Content}/styles.module.css +45 -27
  59. package/lib/theme/CodeBlock/CopyButton/index.d.ts +9 -0
  60. package/lib/theme/CodeBlock/CopyButton/index.js +61 -0
  61. package/lib/theme/CodeBlock/CopyButton/styles.module.css +47 -0
  62. package/lib/theme/CodeBlock/Line/index.d.ts +9 -0
  63. package/lib/theme/CodeBlock/Line/index.js +42 -0
  64. package/lib/theme/CodeBlock/Line/styles.module.css +51 -0
  65. package/lib/theme/CodeBlock/WordWrapButton/index.d.ts +9 -0
  66. package/lib/theme/CodeBlock/WordWrapButton/index.js +40 -0
  67. package/lib/theme/CodeBlock/WordWrapButton/styles.module.css +15 -0
  68. package/lib/theme/CodeBlock/index.d.ts +9 -0
  69. package/lib/theme/CodeBlock/index.js +31 -246
  70. package/lib/theme/ColorModeToggle/index.d.ts +11 -0
  71. package/lib/theme/ColorModeToggle/index.js +60 -0
  72. package/lib/theme/ColorModeToggle/styles.module.css +35 -0
  73. package/lib/theme/Details/index.d.ts +9 -0
  74. package/lib/theme/Details/index.js +21 -0
  75. package/lib/theme/Details/styles.module.css +13 -0
  76. package/lib/theme/DocBreadcrumbs/index.d.ts +8 -0
  77. package/lib/theme/DocBreadcrumbs/index.js +115 -0
  78. package/lib/theme/{Heading/styles.css → DocBreadcrumbs/styles.module.css} +9 -13
  79. package/lib/theme/DocCard/index.d.ts +9 -0
  80. package/lib/theme/DocCard/index.js +83 -0
  81. package/lib/theme/DocCard/styles.module.css +34 -0
  82. package/lib/theme/DocCardList/index.d.ts +9 -0
  83. package/lib/theme/DocCardList/index.js +30 -0
  84. package/lib/theme/DocCategoryGeneratedIndexPage/index.d.ts +10 -0
  85. package/lib/theme/DocCategoryGeneratedIndexPage/index.js +74 -0
  86. package/lib/theme/DocCategoryGeneratedIndexPage/styles.module.css +26 -0
  87. package/lib/theme/DocItem/index.d.ts +10 -0
  88. package/lib/theme/DocItem/index.js +102 -113
  89. package/lib/theme/DocItem/styles.module.css +12 -10
  90. package/lib/theme/DocItemFooter/index.d.ts +10 -0
  91. package/lib/theme/DocItemFooter/index.js +74 -0
  92. package/{lib-next/theme/DocItem → lib/theme/DocItemFooter}/styles.module.css +1 -9
  93. package/lib/theme/DocPage/Layout/Main/index.d.ts +9 -0
  94. package/lib/theme/DocPage/Layout/Main/index.js +29 -0
  95. package/lib/theme/DocPage/Layout/Main/styles.module.css +28 -0
  96. package/lib/theme/DocPage/Layout/Sidebar/ExpandButton/index.d.ts +9 -0
  97. package/lib/theme/DocPage/Layout/Sidebar/ExpandButton/index.js +34 -0
  98. package/lib/theme/DocPage/Layout/Sidebar/ExpandButton/styles.module.css +33 -0
  99. package/lib/theme/DocPage/Layout/Sidebar/index.d.ts +9 -0
  100. package/lib/theme/DocPage/Layout/Sidebar/index.js +65 -0
  101. package/lib/theme/DocPage/Layout/Sidebar/styles.module.css +32 -0
  102. package/lib/theme/DocPage/Layout/index.d.ts +9 -0
  103. package/lib/theme/DocPage/Layout/index.js +34 -0
  104. package/{lib-next/theme/IconExternalLink → lib/theme/DocPage/Layout}/styles.module.css +7 -4
  105. package/lib/theme/DocPage/index.d.ts +10 -0
  106. package/lib/theme/DocPage/index.js +43 -165
  107. package/lib/theme/DocPaginator/index.d.ts +9 -0
  108. package/lib/theme/DocPaginator/index.js +40 -56
  109. package/lib/theme/DocSidebar/Desktop/CollapseButton/index.d.ts +9 -0
  110. package/lib/theme/DocSidebar/Desktop/CollapseButton/index.js +34 -0
  111. package/lib/theme/DocSidebar/Desktop/CollapseButton/styles.module.css +46 -0
  112. package/lib/theme/DocSidebar/Desktop/Content/index.d.ts +9 -0
  113. package/lib/theme/DocSidebar/Desktop/Content/index.js +44 -0
  114. package/lib/theme/DocSidebar/Desktop/Content/styles.module.css +23 -0
  115. package/lib/theme/DocSidebar/Desktop/index.d.ts +11 -0
  116. package/lib/theme/DocSidebar/Desktop/index.js +34 -0
  117. package/lib/theme/DocSidebar/Desktop/styles.module.css +50 -0
  118. package/lib/theme/DocSidebar/Mobile/index.d.ts +11 -0
  119. package/lib/theme/DocSidebar/Mobile/index.js +45 -0
  120. package/lib/theme/DocSidebar/index.d.ts +9 -0
  121. package/lib/theme/DocSidebar/index.js +17 -302
  122. package/lib/theme/DocSidebarItem/Category/index.d.ts +9 -0
  123. package/lib/theme/DocSidebarItem/Category/index.js +183 -0
  124. package/lib/theme/DocSidebarItem/Html/index.d.ts +9 -0
  125. package/lib/theme/DocSidebarItem/Html/index.js +26 -0
  126. package/lib/theme/DocSidebarItem/Html/styles.module.css +13 -0
  127. package/lib/theme/DocSidebarItem/Link/index.d.ts +9 -0
  128. package/lib/theme/DocSidebarItem/Link/index.js +53 -0
  129. package/{lib-next/theme/MDXPage → lib/theme/DocSidebarItem/Link}/styles.module.css +2 -2
  130. package/lib/theme/DocSidebarItem/index.d.ts +9 -0
  131. package/lib/theme/DocSidebarItem/index.js +21 -0
  132. package/lib/theme/DocSidebarItems/index.d.ts +11 -0
  133. package/lib/theme/DocSidebarItems/index.js +22 -0
  134. package/lib/theme/DocTagDocListPage/index.d.ts +10 -0
  135. package/lib/theme/DocTagDocListPage/index.js +89 -0
  136. package/lib/theme/DocTagsListPage/index.d.ts +10 -0
  137. package/lib/theme/DocTagsListPage/index.js +40 -0
  138. package/lib/theme/DocVersionBadge/index.d.ts +9 -0
  139. package/lib/theme/DocVersionBadge/index.js +30 -0
  140. package/lib/theme/DocVersionBanner/index.d.ts +9 -0
  141. package/lib/theme/DocVersionBanner/index.js +105 -102
  142. package/lib/theme/EditThisPage/index.d.ts +9 -0
  143. package/lib/theme/EditThisPage/index.js +19 -24
  144. package/{src/theme/hooks/useLockBodyScroll.ts → lib/theme/ErrorPageContent.d.ts} +4 -14
  145. package/lib/theme/ErrorPageContent.js +35 -0
  146. package/lib/theme/Footer/Copyright/index.d.ts +9 -0
  147. package/lib/theme/Footer/Copyright/index.js +17 -0
  148. package/lib/theme/Footer/Layout/index.d.ts +9 -0
  149. package/lib/theme/Footer/Layout/index.js +26 -0
  150. package/lib/theme/Footer/LinkItem/index.d.ts +9 -0
  151. package/lib/theme/Footer/LinkItem/index.js +31 -0
  152. package/lib/theme/Footer/Links/MultiColumn/index.d.ts +9 -0
  153. package/lib/theme/Footer/Links/MultiColumn/index.js +43 -0
  154. package/lib/theme/Footer/Links/Simple/index.d.ts +9 -0
  155. package/lib/theme/Footer/Links/Simple/index.js +37 -0
  156. package/lib/theme/Footer/Links/index.d.ts +9 -0
  157. package/lib/theme/Footer/Links/index.js +17 -0
  158. package/lib/theme/Footer/Logo/index.d.ts +9 -0
  159. package/lib/theme/Footer/Logo/index.js +36 -0
  160. package/lib/theme/Footer/{styles.module.css → Logo/styles.module.css} +2 -1
  161. package/{lib-next/theme/Footer/styles.module.css → lib/theme/Footer/index.d.ts} +4 -9
  162. package/lib/theme/Footer/index.js +17 -104
  163. package/lib/theme/Heading/index.d.ts +9 -0
  164. package/lib/theme/Heading/index.js +35 -68
  165. package/lib/theme/Heading/styles.module.css +25 -5
  166. package/lib/theme/IconArrow/index.d.ts +9 -0
  167. package/lib/theme/IconArrow/index.js +7 -18
  168. package/lib/theme/IconClose/index.d.ts +9 -0
  169. package/lib/theme/IconClose/index.js +23 -0
  170. package/lib/theme/IconDarkMode/index.d.ts +9 -0
  171. package/lib/theme/IconDarkMode/index.js +17 -0
  172. package/lib/theme/IconEdit/index.d.ts +9 -0
  173. package/lib/theme/IconEdit/index.js +16 -25
  174. package/lib/theme/IconExternalLink/index.d.ts +9 -0
  175. package/lib/theme/IconExternalLink/index.js +17 -24
  176. package/lib/theme/IconExternalLink/styles.module.css +0 -2
  177. package/lib/theme/IconHome/index.d.ts +9 -0
  178. package/lib/theme/IconHome/index.js +17 -0
  179. package/lib/theme/IconLanguage/index.d.ts +9 -0
  180. package/lib/theme/IconLanguage/index.js +16 -23
  181. package/lib/theme/IconLightMode/index.d.ts +9 -0
  182. package/lib/theme/IconLightMode/index.js +17 -0
  183. package/lib/theme/IconMenu/index.d.ts +9 -0
  184. package/lib/theme/IconMenu/index.js +21 -20
  185. package/lib/theme/LastUpdated/index.d.ts +9 -0
  186. package/lib/theme/LastUpdated/index.js +57 -42
  187. package/lib/theme/Layout/index.d.ts +10 -0
  188. package/lib/theme/Layout/index.js +33 -46
  189. package/lib/theme/LayoutProviders/index.d.ts +9 -0
  190. package/lib/theme/LayoutProviders/index.js +27 -30
  191. package/{lib-next/theme/BlogPostItem/styles.module.css → lib/theme/Logo/index.d.ts} +3 -12
  192. package/lib/theme/Logo/index.js +37 -49
  193. package/lib/theme/MDXComponents/A.d.ts +9 -0
  194. package/{lib-next/theme/ThemeContext.js → lib/theme/MDXComponents/A.js} +4 -2
  195. package/lib/theme/MDXComponents/Code.d.ts +9 -0
  196. package/lib/theme/MDXComponents/Code.js +28 -0
  197. package/lib/theme/MDXComponents/Details.d.ts +9 -0
  198. package/lib/theme/MDXComponents/Details.js +22 -0
  199. package/lib/theme/MDXComponents/Head.d.ts +9 -0
  200. package/lib/theme/MDXComponents/Head.js +23 -0
  201. package/lib/theme/MDXComponents/Heading.d.ts +9 -0
  202. package/{lib-next/theme/NavbarItem/SearchNavbarItem.js → lib/theme/MDXComponents/Heading.js} +3 -7
  203. package/lib/theme/MDXComponents/Img/index.d.ts +9 -0
  204. package/lib/theme/MDXComponents/Img/index.js +22 -0
  205. package/{lib-next/theme/IconEdit → lib/theme/MDXComponents/Img}/styles.module.css +2 -3
  206. package/lib/theme/MDXComponents/Pre.d.ts +9 -0
  207. package/lib/theme/MDXComponents/Pre.js +19 -0
  208. package/lib/theme/MDXComponents/Ul/index.d.ts +9 -0
  209. package/lib/theme/MDXComponents/Ul/index.js +21 -0
  210. package/lib/theme/MDXComponents/Ul/styles.module.css +14 -0
  211. package/lib/theme/MDXComponents/index.d.ts +9 -0
  212. package/lib/theme/MDXComponents/index.js +23 -57
  213. package/lib/theme/MDXContent/index.d.ts +9 -0
  214. package/lib/theme/MDXContent/index.js +12 -0
  215. package/lib/theme/MDXPage/index.d.ts +10 -0
  216. package/lib/theme/MDXPage/index.js +44 -56
  217. package/{lib-next/theme/Heading/styles.module.css → lib/theme/Navbar/ColorModeToggle/index.d.ts} +3 -9
  218. package/lib/theme/Navbar/ColorModeToggle/index.js +23 -0
  219. package/lib/theme/Navbar/Content/index.d.ts +8 -0
  220. package/lib/theme/Navbar/Content/index.js +71 -0
  221. package/lib/theme/Navbar/Content/styles.module.css +15 -0
  222. package/lib/theme/Navbar/Layout/index.d.ts +9 -0
  223. package/lib/theme/Navbar/Layout/index.js +52 -0
  224. package/{lib-next/theme/Navbar → lib/theme/Navbar/Layout}/styles.module.css +0 -6
  225. package/lib/theme/Navbar/Logo/index.d.ts +8 -0
  226. package/{lib-next/theme/TabItem → lib/theme/Navbar/Logo}/index.js +7 -12
  227. package/lib/theme/Navbar/MobileSidebar/Header/index.d.ts +8 -0
  228. package/lib/theme/Navbar/MobileSidebar/Header/index.js +31 -0
  229. package/lib/theme/Navbar/MobileSidebar/Layout/index.d.ts +9 -0
  230. package/lib/theme/Navbar/MobileSidebar/Layout/index.js +28 -0
  231. package/{lib-next/theme/TOCInline/styles.module.css → lib/theme/Navbar/MobileSidebar/PrimaryMenu/index.d.ts} +2 -6
  232. package/lib/theme/Navbar/MobileSidebar/PrimaryMenu/index.js +32 -0
  233. package/lib/theme/Navbar/MobileSidebar/SecondaryMenu/index.d.ts +8 -0
  234. package/lib/theme/Navbar/MobileSidebar/SecondaryMenu/index.js +35 -0
  235. package/lib/theme/Navbar/MobileSidebar/Toggle/index.d.ts +8 -0
  236. package/lib/theme/Navbar/MobileSidebar/Toggle/index.js +23 -0
  237. package/lib/theme/Navbar/MobileSidebar/index.d.ts +8 -0
  238. package/lib/theme/Navbar/MobileSidebar/index.js +29 -0
  239. package/lib/theme/Navbar/Search/index.d.ts +9 -0
  240. package/lib/theme/Navbar/Search/index.js +12 -0
  241. package/lib/theme/Navbar/Search/styles.module.css +20 -0
  242. package/lib/theme/Navbar/index.d.ts +8 -0
  243. package/lib/theme/Navbar/index.js +9 -140
  244. package/lib/theme/NavbarItem/ComponentTypes.d.ts +9 -0
  245. package/lib/theme/NavbarItem/ComponentTypes.js +27 -0
  246. package/lib/theme/NavbarItem/DefaultNavbarItem.d.ts +10 -0
  247. package/lib/theme/NavbarItem/DefaultNavbarItem.js +36 -193
  248. package/lib/theme/NavbarItem/DocNavbarItem.d.ts +9 -0
  249. package/lib/theme/NavbarItem/DocNavbarItem.js +24 -52
  250. package/lib/theme/NavbarItem/DocSidebarNavbarItem.d.ts +9 -0
  251. package/lib/theme/NavbarItem/DocSidebarNavbarItem.js +33 -0
  252. package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.d.ts +9 -0
  253. package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +75 -62
  254. package/lib/theme/NavbarItem/DocsVersionNavbarItem.d.ts +9 -0
  255. package/lib/theme/NavbarItem/DocsVersionNavbarItem.js +11 -32
  256. package/lib/theme/NavbarItem/DropdownNavbarItem.d.ts +9 -0
  257. package/lib/theme/NavbarItem/DropdownNavbarItem.js +162 -0
  258. package/lib/theme/NavbarItem/HtmlNavbarItem.d.ts +9 -0
  259. package/lib/theme/NavbarItem/HtmlNavbarItem.js +28 -0
  260. package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.d.ts +9 -0
  261. package/{src/theme/NavbarItem/LocaleDropdownNavbarItem.tsx → lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.js} +28 -27
  262. package/{lib-next/theme/hooks/styles.css → lib/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css} +3 -2
  263. package/lib/theme/NavbarItem/NavbarNavLink.d.ts +9 -0
  264. package/lib/theme/NavbarItem/NavbarNavLink.js +68 -0
  265. package/lib/theme/NavbarItem/SearchNavbarItem.d.ts +9 -0
  266. package/lib/theme/NavbarItem/SearchNavbarItem.js +10 -19
  267. package/lib/theme/NavbarItem/index.d.ts +9 -0
  268. package/lib/theme/NavbarItem/index.js +15 -45
  269. package/lib/theme/NotFound.d.ts +8 -0
  270. package/lib/theme/NotFound.js +44 -49
  271. package/lib/theme/PaginatorNavLink/index.d.ts +9 -0
  272. package/lib/theme/PaginatorNavLink/index.js +23 -0
  273. package/lib/theme/SearchBar.d.ts +7 -0
  274. package/lib/theme/SearchBar.js +11 -15
  275. package/lib/theme/SearchMetadata/index.d.ts +9 -0
  276. package/lib/theme/SearchMetadata/index.js +34 -0
  277. package/lib/theme/SiteMetadata/index.d.ts +8 -0
  278. package/lib/theme/SiteMetadata/index.js +117 -0
  279. package/lib/theme/SkipToContent/index.d.ts +8 -0
  280. package/lib/theme/SkipToContent/index.js +16 -62
  281. package/lib/theme/SkipToContent/styles.module.css +7 -0
  282. package/lib/theme/TOC/index.d.ts +9 -0
  283. package/lib/theme/TOC/index.js +18 -52
  284. package/lib/theme/TOC/styles.module.css +1 -1
  285. package/lib/theme/TOCCollapsible/CollapseButton/index.d.ts +9 -0
  286. package/lib/theme/TOCCollapsible/CollapseButton/index.js +29 -0
  287. package/lib/theme/TOCCollapsible/CollapseButton/styles.module.css +29 -0
  288. package/lib/theme/TOCCollapsible/index.d.ts +9 -0
  289. package/lib/theme/TOCCollapsible/index.js +42 -0
  290. package/lib/theme/TOCCollapsible/styles.module.css +31 -0
  291. package/lib/theme/TOCInline/index.d.ts +9 -0
  292. package/lib/theme/TOCInline/index.js +15 -46
  293. package/lib/theme/TOCItems/Tree.d.ts +11 -0
  294. package/lib/theme/TOCItems/Tree.js +37 -0
  295. package/lib/theme/TOCItems/index.d.ts +9 -0
  296. package/lib/theme/TOCItems/index.js +53 -0
  297. package/lib/theme/TabItem/index.d.ts +9 -0
  298. package/lib/theme/TabItem/index.js +11 -24
  299. package/lib/theme/{hooks/styles.css → TabItem/styles.module.css} +2 -2
  300. package/lib/theme/Tabs/index.d.ts +9 -0
  301. package/lib/theme/Tabs/index.js +159 -123
  302. package/lib/theme/Tabs/styles.module.css +4 -13
  303. package/lib/theme/Tag/index.d.ts +9 -0
  304. package/lib/theme/Tag/index.js +23 -0
  305. package/lib/theme/Tag/styles.module.css +70 -0
  306. package/lib/theme/TagsListByLetter/index.d.ts +9 -0
  307. package/lib/theme/TagsListByLetter/index.js +38 -0
  308. package/lib/theme/TagsListByLetter/styles.module.css +11 -0
  309. package/lib/theme/TagsListInline/index.d.ts +9 -0
  310. package/lib/theme/TagsListInline/index.js +31 -0
  311. package/lib/theme/TagsListInline/styles.module.css +15 -0
  312. package/lib/theme/ThemedImage/index.d.ts +9 -0
  313. package/lib/theme/ThemedImage/index.js +33 -43
  314. package/lib/theme/ThemedImage/styles.module.css +2 -2
  315. package/lib/theme/prism-include-languages.d.ts +8 -0
  316. package/lib/theme/prism-include-languages.js +19 -33
  317. package/lib/translations.d.ts +15 -0
  318. package/lib/translations.js +122 -122
  319. package/lib/validateThemeConfig.d.ts +12 -0
  320. package/lib/validateThemeConfig.js +367 -284
  321. package/package.json +36 -35
  322. package/src/admonitions.css +39 -0
  323. package/src/deps.d.ts +13 -0
  324. package/src/getSwizzleConfig.ts +245 -0
  325. package/src/index.ts +55 -76
  326. package/src/nprogress.css +41 -0
  327. package/src/nprogress.ts +31 -0
  328. package/{lib-next/prism-include-languages.js → src/prism-include-languages.ts} +0 -0
  329. package/src/theme/Admonition/index.tsx +106 -0
  330. package/src/theme/AnnouncementBar/index.tsx +9 -15
  331. package/src/theme/AnnouncementBar/styles.module.css +23 -32
  332. package/src/theme/BackToTopButton/index.tsx +34 -0
  333. package/src/theme/BackToTopButton/styles.module.css +44 -0
  334. package/src/theme/BlogArchivePage/index.tsx +92 -0
  335. package/src/theme/BlogLayout/index.tsx +38 -0
  336. package/src/theme/BlogListPage/index.tsx +45 -35
  337. package/src/theme/BlogListPaginator/index.tsx +27 -32
  338. package/src/theme/BlogPostAuthor/index.tsx +50 -0
  339. package/src/theme/BlogPostAuthors/index.tsx +49 -0
  340. package/{lib/theme/Toggle → src/theme/BlogPostAuthors}/styles.module.css +11 -7
  341. package/src/theme/BlogPostItem/index.tsx +86 -92
  342. package/src/theme/BlogPostItem/styles.module.css +9 -0
  343. package/src/theme/BlogPostPage/index.tsx +85 -39
  344. package/src/theme/BlogPostPaginator/index.tsx +27 -36
  345. package/src/theme/BlogSidebar/Desktop/index.tsx +45 -0
  346. package/src/theme/BlogSidebar/{styles.module.css → Desktop/styles.module.css} +5 -4
  347. package/src/theme/BlogSidebar/Mobile/index.tsx +38 -0
  348. package/src/theme/BlogSidebar/index.tsx +10 -33
  349. package/src/theme/BlogTagsListPage/index.tsx +24 -67
  350. package/src/theme/BlogTagsPostsPage/index.tsx +50 -49
  351. package/src/theme/CodeBlock/Container/index.tsx +35 -0
  352. package/src/theme/CodeBlock/Container/styles.module.css +14 -0
  353. package/src/theme/CodeBlock/Content/Element.tsx +30 -0
  354. package/src/theme/CodeBlock/Content/String.tsx +111 -0
  355. package/src/theme/CodeBlock/{styles.module.css → Content/styles.module.css} +45 -27
  356. package/src/theme/CodeBlock/CopyButton/index.tsx +67 -0
  357. package/src/theme/CodeBlock/CopyButton/styles.module.css +47 -0
  358. package/src/theme/CodeBlock/Line/index.tsx +49 -0
  359. package/src/theme/CodeBlock/Line/styles.module.css +51 -0
  360. package/src/theme/CodeBlock/WordWrapButton/index.tsx +49 -0
  361. package/src/theme/CodeBlock/WordWrapButton/styles.module.css +15 -0
  362. package/src/theme/CodeBlock/index.tsx +29 -253
  363. package/src/theme/ColorModeToggle/index.tsx +67 -0
  364. package/src/theme/ColorModeToggle/styles.module.css +35 -0
  365. package/src/theme/Details/index.tsx +26 -0
  366. package/src/theme/Details/styles.module.css +13 -0
  367. package/src/theme/DocBreadcrumbs/index.tsx +141 -0
  368. package/{lib-next/theme/Heading/styles.css → src/theme/DocBreadcrumbs/styles.module.css} +9 -13
  369. package/src/theme/DocCard/index.tsx +117 -0
  370. package/src/theme/DocCard/styles.module.css +34 -0
  371. package/src/theme/DocCardList/index.tsx +35 -0
  372. package/src/theme/DocCategoryGeneratedIndexPage/index.tsx +86 -0
  373. package/src/theme/DocCategoryGeneratedIndexPage/styles.module.css +26 -0
  374. package/src/theme/DocItem/index.tsx +92 -77
  375. package/src/theme/DocItem/styles.module.css +12 -10
  376. package/src/theme/DocItemFooter/index.tsx +90 -0
  377. package/{lib-next/theme/Toggle → src/theme/DocItemFooter}/styles.module.css +9 -8
  378. package/src/theme/DocPage/Layout/Main/index.tsx +36 -0
  379. package/src/theme/DocPage/Layout/Main/styles.module.css +28 -0
  380. package/src/theme/DocPage/Layout/Sidebar/ExpandButton/index.tsx +40 -0
  381. package/src/theme/DocPage/Layout/Sidebar/ExpandButton/styles.module.css +33 -0
  382. package/src/theme/DocPage/Layout/Sidebar/index.tsx +73 -0
  383. package/src/theme/DocPage/Layout/Sidebar/styles.module.css +32 -0
  384. package/src/theme/DocPage/Layout/index.tsx +38 -0
  385. package/src/theme/DocPage/Layout/styles.module.css +15 -0
  386. package/src/theme/DocPage/index.tsx +39 -167
  387. package/src/theme/DocPaginator/index.tsx +28 -39
  388. package/src/theme/DocSidebar/Desktop/CollapseButton/index.tsx +38 -0
  389. package/src/theme/DocSidebar/Desktop/CollapseButton/styles.module.css +46 -0
  390. package/src/theme/DocSidebar/Desktop/Content/index.tsx +55 -0
  391. package/src/theme/DocSidebar/Desktop/Content/styles.module.css +23 -0
  392. package/src/theme/DocSidebar/Desktop/index.tsx +40 -0
  393. package/src/theme/DocSidebar/Desktop/styles.module.css +50 -0
  394. package/src/theme/DocSidebar/Mobile/index.tsx +54 -0
  395. package/src/theme/DocSidebar/index.tsx +14 -351
  396. package/src/theme/DocSidebarItem/Category/index.tsx +209 -0
  397. package/src/theme/DocSidebarItem/Html/index.tsx +34 -0
  398. package/src/theme/DocSidebarItem/Html/styles.module.css +13 -0
  399. package/src/theme/DocSidebarItem/Link/index.tsx +57 -0
  400. package/src/theme/DocSidebarItem/Link/styles.module.css +10 -0
  401. package/src/theme/DocSidebarItem/index.tsx +27 -0
  402. package/src/theme/DocSidebarItems/index.tsx +27 -0
  403. package/src/theme/DocTagDocListPage/index.tsx +95 -0
  404. package/src/theme/DocTagsListPage/index.tsx +43 -0
  405. package/src/theme/DocVersionBadge/index.tsx +35 -0
  406. package/src/theme/DocVersionBanner/index.tsx +53 -27
  407. package/src/theme/EditThisPage/index.tsx +7 -3
  408. package/src/theme/ErrorPageContent.tsx +41 -0
  409. package/src/theme/Footer/Copyright/index.tsx +20 -0
  410. package/src/theme/Footer/Layout/index.tsx +34 -0
  411. package/src/theme/Footer/LinkItem/index.tsx +36 -0
  412. package/src/theme/Footer/Links/MultiColumn/index.tsx +51 -0
  413. package/src/theme/Footer/Links/Simple/index.tsx +42 -0
  414. package/src/theme/Footer/Links/index.tsx +21 -0
  415. package/src/theme/Footer/Logo/index.tsx +41 -0
  416. package/src/theme/Footer/{styles.module.css → Logo/styles.module.css} +2 -1
  417. package/src/theme/Footer/index.tsx +13 -122
  418. package/src/theme/Heading/index.tsx +31 -58
  419. package/src/theme/Heading/styles.module.css +25 -5
  420. package/src/theme/IconArrow/index.tsx +2 -4
  421. package/src/theme/IconClose/index.tsx +26 -0
  422. package/src/theme/IconDarkMode/index.tsx +20 -0
  423. package/src/theme/IconEdit/index.tsx +5 -5
  424. package/src/theme/IconExternalLink/index.tsx +3 -5
  425. package/src/theme/IconExternalLink/styles.module.css +0 -2
  426. package/src/theme/IconHome/index.tsx +20 -0
  427. package/src/theme/IconLanguage/index.tsx +6 -8
  428. package/src/theme/IconLightMode/index.tsx +20 -0
  429. package/src/theme/IconMenu/index.tsx +3 -5
  430. package/src/theme/LastUpdated/index.tsx +4 -2
  431. package/src/theme/Layout/index.tsx +22 -16
  432. package/src/theme/LayoutProviders/index.tsx +16 -9
  433. package/src/theme/Logo/index.tsx +23 -22
  434. package/src/theme/{ThemeContext.ts → MDXComponents/A.tsx} +5 -6
  435. package/src/theme/MDXComponents/Code.tsx +37 -0
  436. package/src/theme/MDXComponents/Details.tsx +27 -0
  437. package/src/theme/MDXComponents/Head.tsx +31 -0
  438. package/src/theme/MDXComponents/Heading.tsx +14 -0
  439. package/src/theme/MDXComponents/Img/index.tsx +27 -0
  440. package/src/theme/MDXComponents/Img/styles.module.css +10 -0
  441. package/src/theme/MDXComponents/Pre.tsx +22 -0
  442. package/src/theme/MDXComponents/Ul/index.tsx +26 -0
  443. package/src/theme/MDXComponents/Ul/styles.module.css +14 -0
  444. package/src/theme/MDXComponents/index.tsx +23 -42
  445. package/src/theme/MDXContent/index.tsx +15 -0
  446. package/src/theme/MDXPage/index.tsx +38 -35
  447. package/src/theme/Navbar/ColorModeToggle/index.tsx +30 -0
  448. package/src/theme/Navbar/Content/index.tsx +86 -0
  449. package/src/theme/Navbar/Content/styles.module.css +15 -0
  450. package/src/theme/Navbar/Layout/index.tsx +57 -0
  451. package/{lib/theme/Navbar → src/theme/Navbar/Layout}/styles.module.css +0 -6
  452. package/src/theme/Navbar/Logo/index.tsx +19 -0
  453. package/src/theme/Navbar/MobileSidebar/Header/index.tsx +34 -0
  454. package/src/theme/Navbar/MobileSidebar/Layout/index.tsx +31 -0
  455. package/src/theme/Navbar/MobileSidebar/PrimaryMenu/index.tsx +37 -0
  456. package/src/theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx +38 -0
  457. package/src/theme/Navbar/MobileSidebar/Toggle/index.tsx +25 -0
  458. package/src/theme/Navbar/MobileSidebar/index.tsx +33 -0
  459. package/src/theme/Navbar/Search/index.tsx +19 -0
  460. package/src/theme/Navbar/Search/styles.module.css +20 -0
  461. package/src/theme/Navbar/index.tsx +7 -147
  462. package/src/theme/NavbarItem/ComponentTypes.tsx +32 -0
  463. package/src/theme/NavbarItem/DefaultNavbarItem.tsx +36 -208
  464. package/src/theme/NavbarItem/DocNavbarItem.tsx +13 -41
  465. package/src/theme/NavbarItem/DocSidebarNavbarItem.tsx +36 -0
  466. package/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +59 -52
  467. package/src/theme/NavbarItem/DocsVersionNavbarItem.tsx +5 -8
  468. package/src/theme/NavbarItem/DropdownNavbarItem.tsx +191 -0
  469. package/src/theme/NavbarItem/HtmlNavbarItem.tsx +32 -0
  470. package/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx +77 -0
  471. package/src/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css +11 -0
  472. package/src/theme/NavbarItem/NavbarNavLink.tsx +74 -0
  473. package/src/theme/NavbarItem/SearchNavbarItem.tsx +11 -3
  474. package/src/theme/NavbarItem/index.tsx +15 -32
  475. package/src/theme/NotFound.tsx +40 -37
  476. package/src/theme/PaginatorNavLink/index.tsx +26 -0
  477. package/src/theme/SearchBar.tsx +2 -1
  478. package/src/theme/SearchMetadata/index.tsx +43 -0
  479. package/src/theme/{LayoutHead → SiteMetadata}/index.tsx +31 -44
  480. package/src/theme/SkipToContent/index.tsx +5 -33
  481. package/src/theme/SkipToContent/styles.module.css +7 -0
  482. package/src/theme/TOC/index.tsx +14 -44
  483. package/src/theme/TOC/styles.module.css +1 -1
  484. package/src/theme/TOCCollapsible/CollapseButton/index.tsx +36 -0
  485. package/src/theme/TOCCollapsible/CollapseButton/styles.module.css +29 -0
  486. package/src/theme/TOCCollapsible/index.tsx +46 -0
  487. package/src/theme/TOCCollapsible/styles.module.css +31 -0
  488. package/src/theme/TOCInline/index.tsx +15 -35
  489. package/src/theme/TOCItems/Tree.tsx +46 -0
  490. package/src/theme/TOCItems/index.tsx +61 -0
  491. package/src/theme/TabItem/index.tsx +12 -4
  492. package/src/theme/TabItem/styles.module.css +10 -0
  493. package/src/theme/Tabs/index.tsx +121 -62
  494. package/src/theme/Tabs/styles.module.css +4 -13
  495. package/src/theme/Tag/index.tsx +27 -0
  496. package/src/theme/Tag/styles.module.css +70 -0
  497. package/src/theme/TagsListByLetter/index.tsx +43 -0
  498. package/src/theme/TagsListByLetter/styles.module.css +11 -0
  499. package/src/theme/TagsListInline/index.tsx +35 -0
  500. package/src/theme/TagsListInline/styles.module.css +15 -0
  501. package/src/theme/ThemedImage/index.tsx +10 -12
  502. package/src/theme/ThemedImage/styles.module.css +2 -2
  503. package/src/theme/prism-include-languages.ts +20 -15
  504. package/src/theme-classic.d.ts +1272 -0
  505. package/src/translations.ts +85 -60
  506. package/src/validateThemeConfig.ts +448 -0
  507. package/babel.config.js +0 -35
  508. package/codeTranslations/README.md +0 -20
  509. package/codeTranslations/ar.json +0 -57
  510. package/codeTranslations/base.json +0 -112
  511. package/codeTranslations/bn.json +0 -56
  512. package/codeTranslations/da.json +0 -57
  513. package/codeTranslations/de.json +0 -57
  514. package/codeTranslations/es.json +0 -57
  515. package/codeTranslations/fa.json +0 -57
  516. package/codeTranslations/fil.json +0 -57
  517. package/codeTranslations/fr.json +0 -57
  518. package/codeTranslations/he.json +0 -57
  519. package/codeTranslations/hi.json +0 -57
  520. package/codeTranslations/ja.json +0 -57
  521. package/codeTranslations/ko.json +0 -57
  522. package/codeTranslations/pl.json +0 -57
  523. package/codeTranslations/pt-BR.json +0 -57
  524. package/codeTranslations/pt-PT.json +0 -57
  525. package/codeTranslations/ru.json +0 -57
  526. package/codeTranslations/tr.json +0 -57
  527. package/codeTranslations/vi.json +0 -57
  528. package/codeTranslations/zh-Hans.json +0 -57
  529. package/codeTranslations/zh-Hant.json +0 -57
  530. package/lib/__tests__/__snapshots__/translations.test.ts.snap +0 -116
  531. package/lib/__tests__/translations.test.js +0 -112
  532. package/lib/__tests__/validateThemeConfig.test.js +0 -333
  533. package/lib/theme/BlogSidebar/styles.module.css +0 -44
  534. package/lib/theme/CodeBlock/styles.module.css +0 -68
  535. package/lib/theme/DocPage/styles.module.css +0 -80
  536. package/lib/theme/DocSidebar/styles.module.css +0 -124
  537. package/lib/theme/LayoutHead/index.js +0 -144
  538. package/lib/theme/NavbarItem/LocaleDropdownNavbarItem.js +0 -72
  539. package/lib/theme/SearchMetadatas/index.js +0 -33
  540. package/lib/theme/Seo/index.js +0 -49
  541. package/lib/theme/ThemeContext.js +0 -21
  542. package/lib/theme/ThemeProvider/index.js +0 -38
  543. package/lib/theme/Toggle/index.js +0 -94
  544. package/lib/theme/Toggle/styles.css +0 -103
  545. package/lib/theme/UserPreferencesContext.js +0 -18
  546. package/lib/theme/UserPreferencesProvider/index.js +0 -36
  547. package/lib/theme/hooks/useContextualSearchFilters.js +0 -47
  548. package/lib/theme/hooks/useDocs.js +0 -18
  549. package/lib/theme/hooks/useHideableNavbar.js +0 -92
  550. package/lib/theme/hooks/useKeyboardNavigation.js +0 -45
  551. package/lib/theme/hooks/useLocationHash.js +0 -28
  552. package/lib/theme/hooks/useLockBodyScroll.js +0 -26
  553. package/lib/theme/hooks/usePrismTheme.js +0 -36
  554. package/lib/theme/hooks/useScrollPosition.js +0 -49
  555. package/lib/theme/hooks/useTOCHighlight.js +0 -87
  556. package/lib/theme/hooks/useTabGroupChoice.js +0 -51
  557. package/lib/theme/hooks/useTheme.js +0 -99
  558. package/lib/theme/hooks/useThemeContext.js +0 -31
  559. package/lib/theme/hooks/useUserPreferencesContext.js +0 -31
  560. package/lib/theme/hooks/useWindowSize.js +0 -55
  561. package/lib/types.d.ts +0 -598
  562. package/lib-next/__tests__/__snapshots__/translations.test.ts.snap +0 -116
  563. package/lib-next/__tests__/translations.test.js +0 -128
  564. package/lib-next/__tests__/validateThemeConfig.test.js +0 -333
  565. package/lib-next/index.js +0 -221
  566. package/lib-next/theme/AnnouncementBar/index.js +0 -61
  567. package/lib-next/theme/AnnouncementBar/styles.module.css +0 -72
  568. package/lib-next/theme/BlogListPage/index.js +0 -56
  569. package/lib-next/theme/BlogListPaginator/index.js +0 -54
  570. package/lib-next/theme/BlogPostItem/index.js +0 -168
  571. package/lib-next/theme/BlogPostPage/index.js +0 -55
  572. package/lib-next/theme/BlogPostPaginator/index.js +0 -57
  573. package/lib-next/theme/BlogTagsListPage/index.js +0 -75
  574. package/lib-next/theme/BlogTagsPostsPage/index.js +0 -92
  575. package/lib-next/theme/CodeBlock/index.js +0 -268
  576. package/lib-next/theme/DocItem/index.js +0 -117
  577. package/lib-next/theme/DocPage/index.js +0 -173
  578. package/lib-next/theme/DocPage/styles.module.css +0 -80
  579. package/lib-next/theme/DocPaginator/index.js +0 -59
  580. package/lib-next/theme/DocSidebar/index.js +0 -352
  581. package/lib-next/theme/DocSidebar/styles.module.css +0 -124
  582. package/lib-next/theme/DocVersionBanner/index.js +0 -127
  583. package/lib-next/theme/EditThisPage/index.js +0 -21
  584. package/lib-next/theme/Footer/index.js +0 -129
  585. package/lib-next/theme/Heading/index.js +0 -67
  586. package/lib-next/theme/IconArrow/index.js +0 -20
  587. package/lib-next/theme/IconEdit/index.js +0 -28
  588. package/lib-next/theme/IconExternalLink/index.js +0 -26
  589. package/lib-next/theme/IconLanguage/index.js +0 -25
  590. package/lib-next/theme/IconMenu/index.js +0 -29
  591. package/lib-next/theme/LastUpdated/index.js +0 -77
  592. package/lib-next/theme/Layout/index.js +0 -46
  593. package/lib-next/theme/Layout/styles.css +0 -27
  594. package/lib-next/theme/LayoutHead/index.js +0 -137
  595. package/lib-next/theme/LayoutProviders/index.js +0 -26
  596. package/lib-next/theme/Logo/index.js +0 -54
  597. package/lib-next/theme/MDXComponents/index.js +0 -51
  598. package/lib-next/theme/MDXPage/index.js +0 -51
  599. package/lib-next/theme/Navbar/index.js +0 -146
  600. package/lib-next/theme/NavbarItem/DefaultNavbarItem.js +0 -227
  601. package/lib-next/theme/NavbarItem/DocNavbarItem.js +0 -57
  602. package/lib-next/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +0 -83
  603. package/lib-next/theme/NavbarItem/DocsVersionNavbarItem.js +0 -28
  604. package/lib-next/theme/NavbarItem/LocaleDropdownNavbarItem.js +0 -66
  605. package/lib-next/theme/NavbarItem/index.js +0 -41
  606. package/lib-next/theme/NotFound.js +0 -50
  607. package/lib-next/theme/SearchBar.js +0 -11
  608. package/lib-next/theme/SearchMetadatas/index.js +0 -20
  609. package/lib-next/theme/Seo/index.js +0 -36
  610. package/lib-next/theme/SkipToContent/index.js +0 -53
  611. package/lib-next/theme/SkipToContent/styles.module.css +0 -14
  612. package/lib-next/theme/TOC/index.js +0 -52
  613. package/lib-next/theme/TOC/styles.module.css +0 -23
  614. package/lib-next/theme/TOCInline/index.js +0 -43
  615. package/lib-next/theme/Tabs/index.js +0 -144
  616. package/lib-next/theme/Tabs/styles.module.css +0 -23
  617. package/lib-next/theme/ThemeProvider/index.js +0 -25
  618. package/lib-next/theme/ThemedImage/index.js +0 -41
  619. package/lib-next/theme/ThemedImage/styles.module.css +0 -18
  620. package/lib-next/theme/Toggle/index.js +0 -80
  621. package/lib-next/theme/Toggle/styles.css +0 -103
  622. package/lib-next/theme/UserPreferencesContext.js +0 -9
  623. package/lib-next/theme/UserPreferencesProvider/index.js +0 -24
  624. package/lib-next/theme/hooks/useContextualSearchFilters.js +0 -41
  625. package/lib-next/theme/hooks/useDocs.js +0 -10
  626. package/lib-next/theme/hooks/useHideableNavbar.js +0 -79
  627. package/lib-next/theme/hooks/useKeyboardNavigation.js +0 -35
  628. package/lib-next/theme/hooks/useLocationHash.js +0 -20
  629. package/lib-next/theme/hooks/useLockBodyScroll.js +0 -18
  630. package/lib-next/theme/hooks/usePrismTheme.js +0 -20
  631. package/lib-next/theme/hooks/useScrollPosition.js +0 -38
  632. package/lib-next/theme/hooks/useTOCHighlight.js +0 -84
  633. package/lib-next/theme/hooks/useTabGroupChoice.js +0 -39
  634. package/lib-next/theme/hooks/useTheme.js +0 -82
  635. package/lib-next/theme/hooks/useThemeContext.js +0 -22
  636. package/lib-next/theme/hooks/useUserPreferencesContext.js +0 -22
  637. package/lib-next/theme/hooks/useWindowSize.js +0 -45
  638. package/lib-next/theme/prism-include-languages.js +0 -23
  639. package/lib-next/translations.js +0 -145
  640. package/lib-next/types.d.ts +0 -598
  641. package/lib-next/validateThemeConfig.js +0 -317
  642. package/src/__tests__/__snapshots__/translations.test.ts.snap +0 -116
  643. package/src/__tests__/translations.test.ts +0 -116
  644. package/src/__tests__/validateThemeConfig.test.js +0 -333
  645. package/src/prism-include-languages.js +0 -11
  646. package/src/theme/DocPage/styles.module.css +0 -80
  647. package/src/theme/DocSidebar/styles.module.css +0 -124
  648. package/src/theme/Heading/styles.css +0 -23
  649. package/src/theme/Navbar/styles.module.css +0 -20
  650. package/src/theme/SearchMetadatas/index.tsx +0 -28
  651. package/src/theme/Seo/index.tsx +0 -46
  652. package/src/theme/ThemeProvider/index.tsx +0 -24
  653. package/src/theme/Toggle/index.tsx +0 -100
  654. package/src/theme/Toggle/styles.css +0 -103
  655. package/src/theme/UserPreferencesContext.ts +0 -12
  656. package/src/theme/UserPreferencesProvider/index.tsx +0 -27
  657. package/src/theme/hooks/styles.css +0 -10
  658. package/src/theme/hooks/useContextualSearchFilters.ts +0 -52
  659. package/src/theme/hooks/useDocs.ts +0 -11
  660. package/src/theme/hooks/useHideableNavbar.ts +0 -85
  661. package/src/theme/hooks/useKeyboardNavigation.ts +0 -39
  662. package/src/theme/hooks/useLocationHash.ts +0 -25
  663. package/src/theme/hooks/usePrismTheme.ts +0 -22
  664. package/src/theme/hooks/useScrollPosition.ts +0 -45
  665. package/src/theme/hooks/useTOCHighlight.ts +0 -98
  666. package/src/theme/hooks/useTabGroupChoice.ts +0 -46
  667. package/src/theme/hooks/useTheme.ts +0 -92
  668. package/src/theme/hooks/useThemeContext.ts +0 -23
  669. package/src/theme/hooks/useUserPreferencesContext.ts +0 -25
  670. package/src/theme/hooks/useWindowSize.ts +0 -51
  671. package/src/types.d.ts +0 -598
  672. package/src/validateThemeConfig.js +0 -317
  673. package/tsconfig.json +0 -12
  674. package/update-code-translations.js +0 -240
  675. package/update-code-translations.test.js +0 -33
@@ -1,317 +1,400 @@
1
+ "use strict";
1
2
  /**
2
3
  * Copyright (c) Facebook, Inc. and its affiliates.
3
4
  *
4
5
  * This source code is licensed under the MIT license found in the
5
6
  * LICENSE file in the root directory of this source tree.
6
7
  */
7
-
8
- const {Joi, URISchema} = require('@docusaurus/utils-validation');
9
-
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.validateThemeConfig = exports.ThemeConfigSchema = exports.DEFAULT_CONFIG = void 0;
10
+ const tslib_1 = require("tslib");
11
+ const palenight_1 = tslib_1.__importDefault(require("prism-react-renderer/themes/palenight"));
12
+ const utils_validation_1 = require("@docusaurus/utils-validation");
10
13
  const DEFAULT_DOCS_CONFIG = {
11
- versionPersistence: 'localStorage',
14
+ versionPersistence: 'localStorage',
15
+ sidebar: {
16
+ hideable: false,
17
+ autoCollapseCategories: false,
18
+ },
12
19
  };
13
- const DocsSchema = Joi.object({
14
- versionPersistence: Joi.string()
15
- .equal('localStorage', 'none')
16
- .default(DEFAULT_DOCS_CONFIG.versionPersistence),
20
+ const DocsSchema = utils_validation_1.Joi.object({
21
+ versionPersistence: utils_validation_1.Joi.string()
22
+ .equal('localStorage', 'none')
23
+ .default(DEFAULT_DOCS_CONFIG.versionPersistence),
24
+ sidebar: utils_validation_1.Joi.object({
25
+ hideable: utils_validation_1.Joi.bool().default(DEFAULT_DOCS_CONFIG.sidebar.hideable),
26
+ autoCollapseCategories: utils_validation_1.Joi.bool().default(DEFAULT_DOCS_CONFIG.sidebar.autoCollapseCategories),
27
+ }).default(DEFAULT_DOCS_CONFIG.sidebar),
17
28
  }).default(DEFAULT_DOCS_CONFIG);
18
-
19
29
  const DEFAULT_COLOR_MODE_CONFIG = {
20
- defaultMode: 'light',
21
- disableSwitch: false,
22
- respectPrefersColorScheme: false,
23
- switchConfig: {
24
- darkIcon: '🌜',
25
- darkIconStyle: {},
26
- lightIcon: '🌞',
27
- lightIconStyle: {},
28
- },
30
+ defaultMode: 'light',
31
+ disableSwitch: false,
32
+ respectPrefersColorScheme: false,
29
33
  };
30
-
31
- const DEFAULT_CONFIG = {
32
- colorMode: DEFAULT_COLOR_MODE_CONFIG,
33
- docs: DEFAULT_DOCS_CONFIG,
34
- metadatas: [],
35
- prism: {
36
- additionalLanguages: [],
37
- },
38
- navbar: {
39
- hideOnScroll: false,
40
- items: [],
41
- },
42
- hideableSidebar: false,
34
+ exports.DEFAULT_CONFIG = {
35
+ colorMode: DEFAULT_COLOR_MODE_CONFIG,
36
+ docs: DEFAULT_DOCS_CONFIG,
37
+ metadata: [],
38
+ prism: {
39
+ additionalLanguages: [],
40
+ theme: palenight_1.default,
41
+ magicComments: [
42
+ {
43
+ className: 'theme-code-block-highlighted-line',
44
+ line: 'highlight-next-line',
45
+ block: { start: 'highlight-start', end: 'highlight-end' },
46
+ },
47
+ ],
48
+ },
49
+ navbar: {
50
+ hideOnScroll: false,
51
+ items: [],
52
+ },
53
+ tableOfContents: {
54
+ minHeadingLevel: 2,
55
+ maxHeadingLevel: 3,
56
+ },
43
57
  };
44
- exports.DEFAULT_CONFIG = DEFAULT_CONFIG;
45
-
46
- const NavbarItemPosition = Joi.string().equal('left', 'right').default('left');
47
-
48
- const BaseNavbarItemSchema = Joi.object({
49
- to: Joi.string(),
50
- href: URISchema,
51
- label: Joi.string(),
52
- className: Joi.string(),
53
- prependBaseUrlToHref: Joi.bool(),
58
+ const NavbarItemPosition = utils_validation_1.Joi.string().equal('left', 'right').default('left');
59
+ const NavbarItemBaseSchema = utils_validation_1.Joi.object({
60
+ label: utils_validation_1.Joi.string(),
61
+ html: utils_validation_1.Joi.string(),
62
+ className: utils_validation_1.Joi.string(),
54
63
  })
55
- // We allow any unknown attributes on the links
56
- // (users may need additional attributes like target, aria-role, data-customAttribute...)
57
- .unknown();
58
-
59
- // TODO we should probably create a custom navbar item type "dropdown"
60
- // having this recursive structure is bad because we only support 2 levels
61
- // + parent/child don't have exactly the same props
62
- const DefaultNavbarItemSchema = BaseNavbarItemSchema.append({
63
- items: Joi.array().optional().items(BaseNavbarItemSchema),
64
- position: NavbarItemPosition,
65
- activeBasePath: Joi.string(),
66
- activeBaseRegex: Joi.string(),
67
- });
68
- // TODO the dropdown parent item can have no href/to
69
- // should check should not apply to dropdown parent item
70
- // .xor('href', 'to');
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(),
64
+ .nand('html', 'label')
65
+ // We allow any unknown attributes on the links (users may need additional
66
+ // attributes like target, aria-role, data-customAttribute...)
67
+ .unknown();
68
+ const DefaultNavbarItemSchema = NavbarItemBaseSchema.append({
69
+ to: utils_validation_1.Joi.string(),
70
+ href: utils_validation_1.URISchema,
71
+ activeBasePath: utils_validation_1.Joi.string(),
72
+ activeBaseRegex: utils_validation_1.Joi.string(),
73
+ prependBaseUrlToHref: utils_validation_1.Joi.bool(),
74
+ // This is only triggered in case of a nested dropdown
75
+ items: utils_validation_1.Joi.forbidden().messages({
76
+ 'any.unknown': 'Nested dropdowns are not allowed',
77
+ }),
78
+ })
79
+ .xor('href', 'to')
80
+ .messages({
81
+ 'object.xor': 'One and only one between "to" and "href" should be provided',
79
82
  });
80
-
81
- const DocsVersionDropdownNavbarItemSchema = Joi.object({
82
- type: Joi.string().equal('docsVersionDropdown').required(),
83
- position: NavbarItemPosition,
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(),
83
+ const DocsVersionNavbarItemSchema = NavbarItemBaseSchema.append({
84
+ type: utils_validation_1.Joi.string().equal('docsVersion').required(),
85
+ to: utils_validation_1.Joi.string(),
86
+ docsPluginId: utils_validation_1.Joi.string(),
89
87
  });
90
-
91
- const DocItemSchema = Joi.object({
92
- type: Joi.string().equal('doc').required(),
93
- position: NavbarItemPosition,
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(),
88
+ const DocItemSchema = NavbarItemBaseSchema.append({
89
+ type: utils_validation_1.Joi.string().equal('doc').required(),
90
+ docId: utils_validation_1.Joi.string().required(),
91
+ docsPluginId: utils_validation_1.Joi.string(),
99
92
  });
100
-
101
- const LocaleDropdownNavbarItemSchema = Joi.object({
102
- type: Joi.string().equal('localeDropdown').required(),
103
- position: NavbarItemPosition,
104
- dropdownItemsBefore: Joi.array().items(BaseNavbarItemSchema).default([]),
105
- dropdownItemsAfter: Joi.array().items(BaseNavbarItemSchema).default([]),
106
- className: Joi.string(),
93
+ const DocSidebarItemSchema = NavbarItemBaseSchema.append({
94
+ type: utils_validation_1.Joi.string().equal('docSidebar').required(),
95
+ sidebarId: utils_validation_1.Joi.string().required(),
96
+ docsPluginId: utils_validation_1.Joi.string(),
107
97
  });
108
-
109
- const SearchItemSchema = Joi.object({
110
- type: Joi.string().equal('search').required(),
111
- position: NavbarItemPosition,
98
+ const HtmlNavbarItemSchema = utils_validation_1.Joi.object({
99
+ className: utils_validation_1.Joi.string(),
100
+ type: utils_validation_1.Joi.string().equal('html').required(),
101
+ value: utils_validation_1.Joi.string().required(),
112
102
  });
113
-
114
- // Can this be made easier? :/
115
- const isOfType = (type) => {
116
- let typeSchema = Joi.string().required();
117
- // because equal(undefined) is not supported :/
118
- if (type) {
119
- typeSchema = typeSchema.equal(type);
120
- }
121
- return Joi.object({
122
- type: typeSchema,
123
- })
124
- .unknown()
125
- .required();
103
+ // A temporary workaround to allow users to add custom navbar items
104
+ // See https://github.com/facebook/docusaurus/issues/7227
105
+ const CustomNavbarItemRegexp = /custom-.*/;
106
+ const CustomNavbarItemSchema = utils_validation_1.Joi.object({
107
+ type: utils_validation_1.Joi.string().regex(CustomNavbarItemRegexp).required(),
108
+ }).unknown();
109
+ const itemWithType = (type) => {
110
+ // Because equal(undefined) is not supported :/
111
+ const typeSchema =
112
+ // eslint-disable-next-line no-nested-ternary
113
+ type instanceof RegExp
114
+ ? utils_validation_1.Joi.string().required().regex(type)
115
+ : type
116
+ ? utils_validation_1.Joi.string().required().equal(type)
117
+ : utils_validation_1.Joi.string().forbidden();
118
+ return utils_validation_1.Joi.object({
119
+ type: typeSchema,
120
+ })
121
+ .unknown()
122
+ .required();
126
123
  };
127
-
128
- const NavbarItemSchema = Joi.object().when({
129
- switch: [
130
- {
131
- is: isOfType('docsVersion'),
132
- then: DocsVersionNavbarItemSchema,
133
- },
134
- {
135
- is: isOfType('docsVersionDropdown'),
136
- then: DocsVersionDropdownNavbarItemSchema,
137
- },
138
- {
139
- is: isOfType('doc'),
140
- then: DocItemSchema,
141
- },
142
- {
143
- is: isOfType('localeDropdown'),
144
- then: LocaleDropdownNavbarItemSchema,
145
- },
146
- {
147
- is: isOfType('search'),
148
- then: SearchItemSchema,
149
- },
150
- {
151
- is: isOfType(undefined),
152
- then: Joi.forbidden().messages({
124
+ const DropdownSubitemSchema = utils_validation_1.Joi.object({
125
+ position: utils_validation_1.Joi.forbidden(),
126
+ }).when('.', {
127
+ switch: [
128
+ {
129
+ is: itemWithType('docsVersion'),
130
+ then: DocsVersionNavbarItemSchema,
131
+ },
132
+ {
133
+ is: itemWithType('doc'),
134
+ then: DocItemSchema,
135
+ },
136
+ {
137
+ is: itemWithType('docSidebar'),
138
+ then: DocSidebarItemSchema,
139
+ },
140
+ {
141
+ is: itemWithType(undefined),
142
+ then: DefaultNavbarItemSchema,
143
+ },
144
+ {
145
+ is: itemWithType('html'),
146
+ then: HtmlNavbarItemSchema,
147
+ },
148
+ {
149
+ is: itemWithType(CustomNavbarItemRegexp),
150
+ then: CustomNavbarItemSchema,
151
+ },
152
+ {
153
+ is: utils_validation_1.Joi.alternatives().try(itemWithType('dropdown'), itemWithType('docsVersionDropdown'), itemWithType('localeDropdown'), itemWithType('search')),
154
+ then: utils_validation_1.Joi.forbidden().messages({
155
+ 'any.unknown': 'Nested dropdowns are not allowed',
156
+ }),
157
+ },
158
+ ],
159
+ otherwise: utils_validation_1.Joi.forbidden().messages({
153
160
  'any.unknown': 'Bad navbar item type {.type}',
154
- }),
155
- },
156
- ],
157
- otherwise: DefaultNavbarItemSchema,
161
+ }),
158
162
  });
159
-
160
- /*
161
- const NavbarItemSchema = Joi.object({
162
- type: Joi.string().only(['docsVersion'])
163
- })
164
- .when(Joi.object({ type: 'docsVersion' }).unknown(), {
165
- then: Joi.object({ pepperoni: Joi.boolean() })
166
- })
167
- .when(Joi.object().unknown(), {
168
- then: Joi.object({ croutons: Joi.boolean() })
169
- })
170
-
171
- */
172
-
173
- /*
174
- const NavbarItemSchema = Joi.object().when('type', {
175
- is: Joi.valid('docsVersion'),
176
- then: DocsVersionNavbarItemSchema,
177
- otherwise: DefaultNavbarItemSchema,
163
+ const DropdownNavbarItemSchema = NavbarItemBaseSchema.append({
164
+ items: utils_validation_1.Joi.array().items(DropdownSubitemSchema).required(),
178
165
  });
179
- */
180
-
181
- const ColorModeSchema = Joi.object({
182
- defaultMode: Joi.string()
183
- .equal('dark', 'light')
184
- .default(DEFAULT_COLOR_MODE_CONFIG.defaultMode),
185
- disableSwitch: Joi.bool().default(DEFAULT_COLOR_MODE_CONFIG.disableSwitch),
186
- respectPrefersColorScheme: Joi.bool().default(
187
- DEFAULT_COLOR_MODE_CONFIG.respectPrefersColorScheme,
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),
166
+ const DocsVersionDropdownNavbarItemSchema = NavbarItemBaseSchema.append({
167
+ type: utils_validation_1.Joi.string().equal('docsVersionDropdown').required(),
168
+ docsPluginId: utils_validation_1.Joi.string(),
169
+ dropdownActiveClassDisabled: utils_validation_1.Joi.boolean(),
170
+ dropdownItemsBefore: utils_validation_1.Joi.array().items(DropdownSubitemSchema).default([]),
171
+ dropdownItemsAfter: utils_validation_1.Joi.array().items(DropdownSubitemSchema).default([]),
172
+ });
173
+ const LocaleDropdownNavbarItemSchema = NavbarItemBaseSchema.append({
174
+ type: utils_validation_1.Joi.string().equal('localeDropdown').required(),
175
+ dropdownItemsBefore: utils_validation_1.Joi.array().items(DropdownSubitemSchema).default([]),
176
+ dropdownItemsAfter: utils_validation_1.Joi.array().items(DropdownSubitemSchema).default([]),
177
+ });
178
+ const SearchItemSchema = utils_validation_1.Joi.object({
179
+ type: utils_validation_1.Joi.string().equal('search').required(),
180
+ className: utils_validation_1.Joi.string(),
181
+ });
182
+ const NavbarItemSchema = utils_validation_1.Joi.object({
183
+ position: NavbarItemPosition,
184
+ }).when('.', {
185
+ switch: [
186
+ {
187
+ is: itemWithType('docsVersion'),
188
+ then: DocsVersionNavbarItemSchema,
189
+ },
190
+ {
191
+ is: itemWithType('dropdown'),
192
+ then: DropdownNavbarItemSchema,
193
+ },
194
+ {
195
+ is: itemWithType('docsVersionDropdown'),
196
+ then: DocsVersionDropdownNavbarItemSchema,
197
+ },
198
+ {
199
+ is: itemWithType('doc'),
200
+ then: DocItemSchema,
201
+ },
202
+ {
203
+ is: itemWithType('docSidebar'),
204
+ then: DocSidebarItemSchema,
205
+ },
206
+ {
207
+ is: itemWithType('localeDropdown'),
208
+ then: LocaleDropdownNavbarItemSchema,
209
+ },
210
+ {
211
+ is: itemWithType('search'),
212
+ then: SearchItemSchema,
213
+ },
214
+ {
215
+ is: itemWithType('html'),
216
+ then: HtmlNavbarItemSchema,
217
+ },
218
+ {
219
+ is: itemWithType(CustomNavbarItemRegexp),
220
+ then: CustomNavbarItemSchema,
221
+ },
222
+ {
223
+ is: itemWithType(undefined),
224
+ then: utils_validation_1.Joi.object().when('.', {
225
+ // Dropdown item can be specified without type field
226
+ is: utils_validation_1.Joi.object({
227
+ items: utils_validation_1.Joi.array().required(),
228
+ }).unknown(),
229
+ then: DropdownNavbarItemSchema,
230
+ otherwise: DefaultNavbarItemSchema,
231
+ }),
232
+ },
233
+ ],
234
+ otherwise: utils_validation_1.Joi.forbidden().messages({
235
+ 'any.unknown': 'Bad navbar item type {.type}',
236
+ }),
237
+ });
238
+ const ColorModeSchema = utils_validation_1.Joi.object({
239
+ defaultMode: utils_validation_1.Joi.string()
240
+ .equal('dark', 'light')
241
+ .default(DEFAULT_COLOR_MODE_CONFIG.defaultMode),
242
+ disableSwitch: utils_validation_1.Joi.bool().default(DEFAULT_COLOR_MODE_CONFIG.disableSwitch),
243
+ respectPrefersColorScheme: utils_validation_1.Joi.bool().default(DEFAULT_COLOR_MODE_CONFIG.respectPrefersColorScheme),
244
+ switchConfig: utils_validation_1.Joi.any().forbidden().messages({
245
+ 'any.unknown': 'colorMode.switchConfig is deprecated. If you want to customize the icons for light and dark mode, swizzle IconLightMode, IconDarkMode, or ColorModeToggle instead.',
246
+ }),
203
247
  }).default(DEFAULT_COLOR_MODE_CONFIG);
204
-
205
- // schema can probably be improved
206
- const HtmlMetadataSchema = Joi.object({
207
- id: Joi.string(),
208
- name: Joi.string(),
209
- property: Joi.string(),
210
- content: Joi.string(),
211
- itemprop: Joi.string(),
248
+ const HtmlMetadataSchema = utils_validation_1.Joi.object({
249
+ id: utils_validation_1.Joi.string(),
250
+ name: utils_validation_1.Joi.string(),
251
+ property: utils_validation_1.Joi.string(),
252
+ content: utils_validation_1.Joi.string(),
253
+ itemprop: utils_validation_1.Joi.string(),
212
254
  }).unknown();
213
-
214
- const FooterLinkItemSchema = Joi.object({
215
- to: Joi.string(),
216
- href: URISchema,
217
- html: Joi.string(),
218
- label: Joi.string(),
255
+ const FooterLinkItemSchema = utils_validation_1.Joi.object({
256
+ to: utils_validation_1.Joi.string(),
257
+ href: utils_validation_1.URISchema,
258
+ html: utils_validation_1.Joi.string(),
259
+ label: utils_validation_1.Joi.string(),
219
260
  })
220
- .xor('to', 'href', 'html')
221
- .with('to', 'label')
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();
227
-
228
- const CustomCssSchema = Joi.alternatives()
229
- .try(Joi.array().items(Joi.string().required()), Joi.string().required())
230
- .optional();
231
-
232
- const ThemeConfigSchema = Joi.object({
233
- // TODO temporary (@alpha-58)
234
- disableDarkMode: Joi.any().forbidden(false).messages({
235
- 'any.unknown':
236
- 'disableDarkMode theme config is deprecated. Please use the new colorMode attribute. You likely want: config.themeConfig.colorMode.disableSwitch = true',
237
- }),
238
- // TODO temporary (@alpha-58)
239
- defaultDarkMode: Joi.any().forbidden(false).messages({
240
- 'any.unknown':
241
- 'defaultDarkMode theme config is deprecated. Please use the new colorMode attribute. You likely want: config.themeConfig.colorMode.defaultMode = "dark"',
242
- }),
243
- customCss: CustomCssSchema,
244
- colorMode: ColorModeSchema,
245
- image: Joi.string(),
246
- docs: DocsSchema,
247
- metadatas: Joi.array()
248
- .items(HtmlMetadataSchema)
249
- .default(DEFAULT_CONFIG.metadatas),
250
- announcementBar: Joi.object({
251
- id: Joi.string().default('announcement-bar'),
252
- content: Joi.string(),
253
- backgroundColor: Joi.string(),
254
- textColor: Joi.string(),
255
- isCloseable: Joi.bool().default(true),
256
- }).optional(),
257
- navbar: Joi.object({
258
- style: Joi.string().equal('dark', 'primary'),
259
- hideOnScroll: Joi.bool().default(DEFAULT_CONFIG.navbar.hideOnScroll),
261
+ .xor('to', 'href', 'html')
262
+ .with('to', 'label')
263
+ .with('href', 'label')
264
+ .nand('html', 'label')
265
+ // We allow any unknown attributes on the links (users may need additional
266
+ // attributes like target, aria-role, data-customAttribute...)
267
+ .unknown();
268
+ const CustomCssSchema = utils_validation_1.Joi.alternatives()
269
+ .try(utils_validation_1.Joi.array().items(utils_validation_1.Joi.string().required()), utils_validation_1.Joi.string().required())
270
+ .optional();
271
+ exports.ThemeConfigSchema = utils_validation_1.Joi.object({
260
272
  // TODO temporary (@alpha-58)
261
- links: Joi.any().forbidden().messages({
262
- 'any.unknown':
263
- 'themeConfig.navbar.links has been renamed as themeConfig.navbar.items',
273
+ // @ts-expect-error: forbidden
274
+ disableDarkMode: utils_validation_1.Joi.any().forbidden().messages({
275
+ 'any.unknown': 'disableDarkMode theme config is deprecated. Please use the new colorMode attribute. You likely want: config.themeConfig.colorMode.disableSwitch = true',
264
276
  }),
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(),
277
+ // TODO temporary (@alpha-58)
278
+ defaultDarkMode: utils_validation_1.Joi.any().forbidden().messages({
279
+ 'any.unknown': 'defaultDarkMode theme config is deprecated. Please use the new colorMode attribute. You likely want: config.themeConfig.colorMode.defaultMode = "dark"',
275
280
  }),
276
- }).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
- href: Joi.string(),
281
+ customCss: CustomCssSchema,
282
+ colorMode: ColorModeSchema,
283
+ image: utils_validation_1.Joi.string(),
284
+ docs: DocsSchema,
285
+ metadata: utils_validation_1.Joi.array()
286
+ .items(HtmlMetadataSchema)
287
+ .default(exports.DEFAULT_CONFIG.metadata),
288
+ // cSpell:ignore metadatas
289
+ metadatas: utils_validation_1.Joi.any().forbidden().messages({
290
+ 'any.unknown':
291
+ // cSpell:ignore metadatas
292
+ 'themeConfig.metadatas has been renamed as themeConfig.metadata. See https://github.com/facebook/docusaurus/pull/5871',
284
293
  }),
285
- copyright: Joi.string(),
286
- links: Joi.array()
287
- .items(
288
- Joi.object({
289
- title: Joi.string().allow(null),
290
- items: Joi.array().items(FooterLinkItemSchema).default([]),
294
+ announcementBar: utils_validation_1.Joi.object({
295
+ id: utils_validation_1.Joi.string().default('announcement-bar'),
296
+ content: utils_validation_1.Joi.string().required(),
297
+ backgroundColor: utils_validation_1.Joi.string(),
298
+ textColor: utils_validation_1.Joi.string(),
299
+ isCloseable: utils_validation_1.Joi.bool().default(true),
300
+ }).optional(),
301
+ navbar: utils_validation_1.Joi.object({
302
+ style: utils_validation_1.Joi.string().equal('dark', 'primary'),
303
+ hideOnScroll: utils_validation_1.Joi.bool().default(exports.DEFAULT_CONFIG.navbar.hideOnScroll),
304
+ // TODO temporary (@alpha-58)
305
+ links: utils_validation_1.Joi.any().forbidden().messages({
306
+ 'any.unknown': 'themeConfig.navbar.links has been renamed as themeConfig.navbar.items',
307
+ }),
308
+ items: utils_validation_1.Joi.array()
309
+ .items(NavbarItemSchema)
310
+ .default(exports.DEFAULT_CONFIG.navbar.items),
311
+ title: utils_validation_1.Joi.string().allow('', null),
312
+ logo: utils_validation_1.Joi.object({
313
+ alt: utils_validation_1.Joi.string().allow(''),
314
+ src: utils_validation_1.Joi.string().required(),
315
+ srcDark: utils_validation_1.Joi.string(),
316
+ width: utils_validation_1.Joi.alternatives().try(utils_validation_1.Joi.string(), utils_validation_1.Joi.number()),
317
+ height: utils_validation_1.Joi.alternatives().try(utils_validation_1.Joi.string(), utils_validation_1.Joi.number()),
318
+ href: utils_validation_1.Joi.string(),
319
+ target: utils_validation_1.Joi.string(),
320
+ }),
321
+ }).default(exports.DEFAULT_CONFIG.navbar),
322
+ footer: utils_validation_1.Joi.object({
323
+ style: utils_validation_1.Joi.string().equal('dark', 'light').default('light'),
324
+ logo: utils_validation_1.Joi.object({
325
+ alt: utils_validation_1.Joi.string().allow(''),
326
+ src: utils_validation_1.Joi.string().required(),
327
+ srcDark: utils_validation_1.Joi.string(),
328
+ // TODO infer this from reading the image
329
+ width: utils_validation_1.Joi.alternatives().try(utils_validation_1.Joi.string(), utils_validation_1.Joi.number()),
330
+ height: utils_validation_1.Joi.alternatives().try(utils_validation_1.Joi.string(), utils_validation_1.Joi.number()),
331
+ href: utils_validation_1.Joi.string(),
291
332
  }),
292
- )
293
- .default([]),
294
- }).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(),
333
+ copyright: utils_validation_1.Joi.string(),
334
+ links: utils_validation_1.Joi.alternatives(utils_validation_1.Joi.array().items(utils_validation_1.Joi.object({
335
+ title: utils_validation_1.Joi.string().allow(null).default(null),
336
+ items: utils_validation_1.Joi.array().items(FooterLinkItemSchema).default([]),
337
+ })), utils_validation_1.Joi.array().items(FooterLinkItemSchema))
338
+ .messages({
339
+ '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`,
340
+ })
341
+ .default([]),
342
+ }).optional(),
343
+ prism: utils_validation_1.Joi.object({
344
+ theme: utils_validation_1.Joi.object({
345
+ plain: utils_validation_1.Joi.alternatives().try(utils_validation_1.Joi.array(), utils_validation_1.Joi.object()).required(),
346
+ styles: utils_validation_1.Joi.alternatives().try(utils_validation_1.Joi.array(), utils_validation_1.Joi.object()).required(),
347
+ }).default(exports.DEFAULT_CONFIG.prism.theme),
348
+ darkTheme: utils_validation_1.Joi.object({
349
+ plain: utils_validation_1.Joi.alternatives().try(utils_validation_1.Joi.array(), utils_validation_1.Joi.object()).required(),
350
+ styles: utils_validation_1.Joi.alternatives().try(utils_validation_1.Joi.array(), utils_validation_1.Joi.object()).required(),
351
+ }),
352
+ defaultLanguage: utils_validation_1.Joi.string(),
353
+ additionalLanguages: utils_validation_1.Joi.array()
354
+ .items(utils_validation_1.Joi.string())
355
+ .default(exports.DEFAULT_CONFIG.prism.additionalLanguages),
356
+ magicComments: utils_validation_1.Joi.array()
357
+ .items(utils_validation_1.Joi.object({
358
+ className: utils_validation_1.Joi.string().required(),
359
+ line: utils_validation_1.Joi.string(),
360
+ block: utils_validation_1.Joi.object({
361
+ start: utils_validation_1.Joi.string().required(),
362
+ end: utils_validation_1.Joi.string().required(),
363
+ }),
364
+ }).or('line', 'block'))
365
+ .default(exports.DEFAULT_CONFIG.prism.magicComments),
366
+ })
367
+ .default(exports.DEFAULT_CONFIG.prism)
368
+ .unknown(),
369
+ hideableSidebar: utils_validation_1.Joi.forbidden().messages({
370
+ 'any.unknown': 'themeConfig.hideableSidebar has been moved to themeConfig.docs.sidebar.hideable.',
371
+ }),
372
+ autoCollapseSidebarCategories: utils_validation_1.Joi.forbidden().messages({
373
+ 'any.unknown': 'themeConfig.autoCollapseSidebarCategories has been moved to themeConfig.docs.sidebar.autoCollapseCategories.',
299
374
  }),
300
- darkTheme: Joi.object({
301
- plain: Joi.alternatives().try(Joi.array(), Joi.object()).required(),
302
- styles: Joi.alternatives().try(Joi.array(), Joi.object()).required(),
375
+ sidebarCollapsible: utils_validation_1.Joi.forbidden().messages({
376
+ 'any.unknown': 'The themeConfig.sidebarCollapsible has been moved to docs plugin options. See: https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs',
303
377
  }),
304
- defaultLanguage: Joi.string(),
305
- additionalLanguages: Joi.array()
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),
378
+ tableOfContents: utils_validation_1.Joi.object({
379
+ minHeadingLevel: utils_validation_1.Joi.number()
380
+ .default(exports.DEFAULT_CONFIG.tableOfContents.minHeadingLevel)
381
+ .when('maxHeadingLevel', {
382
+ is: utils_validation_1.Joi.exist(),
383
+ then: utils_validation_1.Joi.number()
384
+ .integer()
385
+ .min(2)
386
+ .max(6)
387
+ .max(utils_validation_1.Joi.ref('maxHeadingLevel')),
388
+ otherwise: utils_validation_1.Joi.number().integer().min(2).max(6),
389
+ }),
390
+ maxHeadingLevel: utils_validation_1.Joi.number()
391
+ .integer()
392
+ .min(2)
393
+ .max(6)
394
+ .default(exports.DEFAULT_CONFIG.tableOfContents.maxHeadingLevel),
395
+ }).default(exports.DEFAULT_CONFIG.tableOfContents),
312
396
  });
313
- exports.ThemeConfigSchema = ThemeConfigSchema;
314
-
315
- exports.validateThemeConfig = ({validate, themeConfig}) => {
316
- return validate(ThemeConfigSchema, themeConfig);
317
- };
397
+ function validateThemeConfig({ validate, themeConfig, }) {
398
+ return validate(exports.ThemeConfigSchema, themeConfig);
399
+ }
400
+ exports.validateThemeConfig = validateThemeConfig;