@docusaurus/theme-common 2.0.0-beta.1decd6f80 → 2.0.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/Details.d.ts +14 -0
  2. package/lib/components/Collapsible/index.d.ts +64 -0
  3. package/lib/components/Collapsible/index.d.ts.map +1 -0
  4. package/lib/components/Collapsible/index.js +152 -0
  5. package/lib/components/Collapsible/index.js.map +1 -0
  6. package/lib/components/Details/index.d.ts +17 -0
  7. package/lib/components/Details/index.d.ts.map +1 -0
  8. package/lib/components/Details/index.js +71 -0
  9. package/lib/components/Details/index.js.map +1 -0
  10. package/lib/components/Details/styles.module.css +62 -0
  11. package/lib/contexts/announcementBar.d.ts +22 -0
  12. package/lib/contexts/announcementBar.d.ts.map +1 -0
  13. package/lib/contexts/announcementBar.js +72 -0
  14. package/lib/contexts/announcementBar.js.map +1 -0
  15. package/lib/contexts/colorMode.d.ts +27 -0
  16. package/lib/contexts/colorMode.d.ts.map +1 -0
  17. package/lib/contexts/colorMode.js +132 -0
  18. package/lib/contexts/colorMode.js.map +1 -0
  19. package/lib/contexts/docSidebarItemsExpandedState.d.ts +31 -0
  20. package/lib/contexts/docSidebarItemsExpandedState.d.ts.map +1 -0
  21. package/lib/contexts/docSidebarItemsExpandedState.js +28 -0
  22. package/lib/contexts/docSidebarItemsExpandedState.js.map +1 -0
  23. package/lib/contexts/docsPreferredVersion.d.ts +31 -0
  24. package/lib/contexts/docsPreferredVersion.d.ts.map +1 -0
  25. package/lib/contexts/docsPreferredVersion.js +128 -0
  26. package/lib/contexts/docsPreferredVersion.js.map +1 -0
  27. package/lib/contexts/docsSidebar.d.ts +26 -0
  28. package/lib/contexts/docsSidebar.d.ts.map +1 -0
  29. package/lib/contexts/docsSidebar.js +30 -0
  30. package/lib/contexts/docsSidebar.js.map +1 -0
  31. package/lib/contexts/docsVersion.d.ts +20 -0
  32. package/lib/contexts/docsVersion.d.ts.map +1 -0
  33. package/lib/contexts/docsVersion.js +26 -0
  34. package/lib/contexts/docsVersion.js.map +1 -0
  35. package/lib/contexts/navbarMobileSidebar.d.ts +31 -0
  36. package/lib/contexts/navbarMobileSidebar.d.ts.map +1 -0
  37. package/lib/contexts/navbarMobileSidebar.js +56 -0
  38. package/lib/contexts/navbarMobileSidebar.js.map +1 -0
  39. package/lib/contexts/navbarSecondaryMenu/content.d.ts +37 -0
  40. package/lib/contexts/navbarSecondaryMenu/content.d.ts.map +1 -0
  41. package/lib/contexts/navbarSecondaryMenu/content.js +56 -0
  42. package/lib/contexts/navbarSecondaryMenu/content.js.map +1 -0
  43. package/lib/contexts/navbarSecondaryMenu/display.d.ts +24 -0
  44. package/lib/contexts/navbarSecondaryMenu/display.d.ts.map +1 -0
  45. package/lib/contexts/navbarSecondaryMenu/display.js +62 -0
  46. package/lib/contexts/navbarSecondaryMenu/display.js.map +1 -0
  47. package/lib/contexts/tabGroupChoice.d.ts +21 -0
  48. package/lib/contexts/tabGroupChoice.d.ts.map +1 -0
  49. package/lib/contexts/tabGroupChoice.js +49 -0
  50. package/lib/contexts/tabGroupChoice.js.map +1 -0
  51. package/lib/{utils/useChangeRoute.d.ts → hooks/styles.css} +4 -1
  52. package/lib/hooks/useBackToTopButton.d.ts +27 -0
  53. package/lib/hooks/useBackToTopButton.d.ts.map +1 -0
  54. package/lib/hooks/useBackToTopButton.js +50 -0
  55. package/lib/hooks/useBackToTopButton.js.map +1 -0
  56. package/lib/hooks/useCodeWordWrap.d.ts +14 -0
  57. package/lib/hooks/useCodeWordWrap.d.ts.map +1 -0
  58. package/lib/hooks/useCodeWordWrap.js +41 -0
  59. package/lib/hooks/useCodeWordWrap.js.map +1 -0
  60. package/lib/hooks/useHideableNavbar.d.ts +17 -0
  61. package/lib/hooks/useHideableNavbar.d.ts.map +1 -0
  62. package/lib/hooks/useHideableNavbar.js +60 -0
  63. package/lib/hooks/useHideableNavbar.js.map +1 -0
  64. package/lib/hooks/useKeyboardNavigation.d.ts +20 -0
  65. package/lib/hooks/useKeyboardNavigation.d.ts.map +1 -0
  66. package/lib/hooks/useKeyboardNavigation.js +39 -0
  67. package/lib/hooks/useKeyboardNavigation.js.map +1 -0
  68. package/lib/hooks/useLockBodyScroll.d.ts +12 -0
  69. package/lib/hooks/useLockBodyScroll.d.ts.map +1 -0
  70. package/lib/hooks/useLockBodyScroll.js +20 -0
  71. package/lib/hooks/useLockBodyScroll.js.map +1 -0
  72. package/lib/hooks/usePrismTheme.d.ts +13 -0
  73. package/lib/hooks/usePrismTheme.d.ts.map +1 -0
  74. package/lib/hooks/usePrismTheme.js +21 -0
  75. package/lib/hooks/usePrismTheme.js.map +1 -0
  76. package/lib/hooks/useSearchPage.d.ts +25 -0
  77. package/lib/hooks/useSearchPage.d.ts.map +1 -0
  78. package/lib/hooks/useSearchPage.js +43 -0
  79. package/lib/hooks/useSearchPage.js.map +1 -0
  80. package/lib/hooks/useSkipToContent.d.ts +25 -0
  81. package/lib/hooks/useSkipToContent.d.ts.map +1 -0
  82. package/lib/hooks/useSkipToContent.js +35 -0
  83. package/lib/hooks/useSkipToContent.js.map +1 -0
  84. package/lib/hooks/useTOCHighlight.d.ts +25 -0
  85. package/lib/hooks/useTOCHighlight.d.ts.map +1 -0
  86. package/lib/hooks/useTOCHighlight.js +130 -0
  87. package/lib/hooks/useTOCHighlight.js.map +1 -0
  88. package/lib/hooks/useWindowSize.d.ts +28 -0
  89. package/lib/hooks/useWindowSize.d.ts.map +1 -0
  90. package/lib/hooks/useWindowSize.js +59 -0
  91. package/lib/hooks/useWindowSize.js.map +1 -0
  92. package/lib/index.d.ts +39 -9
  93. package/lib/index.d.ts.map +1 -0
  94. package/lib/index.js +39 -8
  95. package/lib/index.js.map +1 -0
  96. package/lib/utils/ThemeClassNames.d.ts +47 -12
  97. package/lib/utils/ThemeClassNames.d.ts.map +1 -0
  98. package/lib/utils/ThemeClassNames.js +45 -4
  99. package/lib/utils/ThemeClassNames.js.map +1 -0
  100. package/lib/utils/codeBlockUtils.d.ts +63 -0
  101. package/lib/utils/codeBlockUtils.d.ts.map +1 -0
  102. package/lib/utils/codeBlockUtils.js +157 -3
  103. package/lib/utils/codeBlockUtils.js.map +1 -0
  104. package/lib/utils/docsUtils.d.ts +91 -0
  105. package/lib/utils/docsUtils.d.ts.map +1 -0
  106. package/lib/utils/docsUtils.js +217 -1
  107. package/lib/utils/docsUtils.js.map +1 -0
  108. package/lib/utils/footerUtils.d.ts +13 -0
  109. package/lib/utils/footerUtils.d.ts.map +1 -0
  110. package/lib/utils/footerUtils.js +14 -0
  111. package/lib/utils/footerUtils.js.map +1 -0
  112. package/lib/utils/generalUtils.d.ts +11 -1
  113. package/lib/utils/generalUtils.d.ts.map +1 -0
  114. package/lib/utils/generalUtils.js +9 -5
  115. package/lib/utils/generalUtils.js.map +1 -0
  116. package/lib/utils/historyUtils.d.ts +17 -0
  117. package/lib/utils/historyUtils.d.ts.map +1 -0
  118. package/lib/utils/historyUtils.js +38 -0
  119. package/lib/utils/historyUtils.js.map +1 -0
  120. package/lib/utils/jsUtils.d.ts +23 -0
  121. package/lib/utils/jsUtils.d.ts.map +1 -0
  122. package/lib/utils/jsUtils.js +29 -0
  123. package/lib/utils/jsUtils.js.map +1 -0
  124. package/lib/utils/metadataUtils.d.ts +38 -0
  125. package/lib/utils/metadataUtils.d.ts.map +1 -0
  126. package/lib/utils/metadataUtils.js +61 -0
  127. package/lib/utils/metadataUtils.js.map +1 -0
  128. package/lib/utils/navbarUtils.d.ts +21 -0
  129. package/lib/utils/navbarUtils.d.ts.map +1 -0
  130. package/lib/utils/navbarUtils.js +32 -0
  131. package/lib/utils/navbarUtils.js.map +1 -0
  132. package/lib/utils/reactUtils.d.ts +42 -0
  133. package/lib/utils/reactUtils.d.ts.map +1 -0
  134. package/lib/utils/reactUtils.js +64 -0
  135. package/lib/utils/reactUtils.js.map +1 -0
  136. package/lib/utils/regexpUtils.d.ts +12 -0
  137. package/lib/utils/regexpUtils.d.ts.map +1 -0
  138. package/lib/utils/regexpUtils.js +18 -0
  139. package/lib/utils/regexpUtils.js.map +1 -0
  140. package/lib/utils/routesUtils.d.ts +26 -0
  141. package/lib/utils/routesUtils.d.ts.map +1 -0
  142. package/lib/utils/routesUtils.js +54 -0
  143. package/lib/utils/routesUtils.js.map +1 -0
  144. package/lib/utils/scrollUtils.d.ts +83 -0
  145. package/lib/utils/scrollUtils.d.ts.map +1 -0
  146. package/lib/utils/scrollUtils.js +200 -0
  147. package/lib/utils/scrollUtils.js.map +1 -0
  148. package/lib/utils/searchUtils.d.ts +13 -0
  149. package/lib/utils/searchUtils.d.ts.map +1 -0
  150. package/lib/utils/searchUtils.js +37 -0
  151. package/lib/utils/searchUtils.js.map +1 -0
  152. package/lib/utils/storageUtils.d.ts +15 -7
  153. package/lib/utils/storageUtils.d.ts.map +1 -0
  154. package/lib/utils/storageUtils.js +58 -25
  155. package/lib/utils/storageUtils.js.map +1 -0
  156. package/lib/utils/tagsUtils.d.ts +18 -0
  157. package/lib/utils/tagsUtils.d.ts.map +1 -0
  158. package/lib/utils/tagsUtils.js +36 -0
  159. package/lib/utils/tagsUtils.js.map +1 -0
  160. package/lib/utils/tocUtils.d.ts +36 -0
  161. package/lib/utils/tocUtils.d.ts.map +1 -0
  162. package/lib/utils/tocUtils.js +84 -0
  163. package/lib/utils/tocUtils.js.map +1 -0
  164. package/lib/utils/useAlternatePageUtils.d.ts +21 -1
  165. package/lib/utils/useAlternatePageUtils.d.ts.map +1 -0
  166. package/lib/utils/useAlternatePageUtils.js +9 -4
  167. package/lib/utils/useAlternatePageUtils.js.map +1 -0
  168. package/lib/utils/useLocalPathname.d.ts +13 -0
  169. package/lib/utils/useLocalPathname.d.ts.map +1 -0
  170. package/lib/utils/useLocalPathname.js +19 -0
  171. package/lib/utils/useLocalPathname.js.map +1 -0
  172. package/lib/utils/useLocationChange.d.ts +17 -0
  173. package/lib/utils/useLocationChange.d.ts.map +1 -0
  174. package/lib/utils/useLocationChange.js +31 -0
  175. package/lib/utils/useLocationChange.js.map +1 -0
  176. package/lib/utils/usePluralForm.d.ts +12 -0
  177. package/lib/utils/usePluralForm.d.ts.map +1 -0
  178. package/lib/utils/usePluralForm.js +36 -37
  179. package/lib/utils/usePluralForm.js.map +1 -0
  180. package/lib/utils/useThemeConfig.d.ts +55 -23
  181. package/lib/utils/useThemeConfig.d.ts.map +1 -0
  182. package/lib/utils/useThemeConfig.js +4 -0
  183. package/lib/utils/useThemeConfig.js.map +1 -0
  184. package/package.json +26 -13
  185. package/src/components/Collapsible/index.tsx +265 -0
  186. package/src/components/Details/index.tsx +109 -0
  187. package/src/components/Details/styles.module.css +62 -0
  188. package/src/contexts/announcementBar.tsx +119 -0
  189. package/src/contexts/colorMode.tsx +199 -0
  190. package/src/contexts/docSidebarItemsExpandedState.tsx +55 -0
  191. package/src/contexts/docsPreferredVersion.tsx +253 -0
  192. package/src/contexts/docsSidebar.tsx +50 -0
  193. package/src/contexts/docsVersion.tsx +36 -0
  194. package/src/contexts/navbarMobileSidebar.tsx +99 -0
  195. package/src/contexts/navbarSecondaryMenu/content.tsx +110 -0
  196. package/src/contexts/navbarSecondaryMenu/display.tsx +102 -0
  197. package/src/contexts/tabGroupChoice.tsx +85 -0
  198. package/{lib/utils/pathUtils.d.ts → src/hooks/styles.css} +4 -1
  199. package/src/hooks/useBackToTopButton.ts +73 -0
  200. package/src/hooks/useCodeWordWrap.ts +56 -0
  201. package/src/hooks/useHideableNavbar.ts +75 -0
  202. package/src/hooks/useKeyboardNavigation.ts +45 -0
  203. package/src/hooks/useLockBodyScroll.ts +21 -0
  204. package/src/hooks/usePrismTheme.ts +24 -0
  205. package/src/hooks/useSearchPage.ts +79 -0
  206. package/src/hooks/useSkipToContent.ts +58 -0
  207. package/src/hooks/useTOCHighlight.ts +192 -0
  208. package/src/hooks/useWindowSize.ts +72 -0
  209. package/src/index.ts +136 -18
  210. package/src/types.d.ts +0 -2
  211. package/src/utils/ThemeClassNames.ts +51 -5
  212. package/src/utils/codeBlockUtils.ts +239 -2
  213. package/src/utils/docsUtils.tsx +334 -0
  214. package/src/utils/footerUtils.ts +18 -0
  215. package/src/utils/generalUtils.ts +9 -5
  216. package/src/utils/historyUtils.ts +45 -0
  217. package/src/utils/jsUtils.ts +36 -0
  218. package/src/utils/metadataUtils.tsx +115 -0
  219. package/src/utils/navbarUtils.tsx +45 -0
  220. package/src/utils/reactUtils.tsx +76 -0
  221. package/src/utils/regexpUtils.ts +24 -0
  222. package/src/utils/routesUtils.ts +75 -0
  223. package/src/utils/scrollUtils.tsx +308 -0
  224. package/src/utils/searchUtils.ts +51 -0
  225. package/src/utils/storageUtils.ts +59 -26
  226. package/src/utils/tagsUtils.ts +50 -0
  227. package/src/utils/tocUtils.ts +119 -0
  228. package/src/utils/useAlternatePageUtils.ts +28 -7
  229. package/src/utils/useLocalPathname.ts +22 -0
  230. package/src/utils/useLocationChange.ts +41 -0
  231. package/src/utils/usePluralForm.ts +49 -39
  232. package/src/utils/useThemeConfig.ts +54 -25
  233. package/lib/.tsbuildinfo +0 -4115
  234. package/lib/utils/docsPreferredVersion/DocsPreferredVersionProvider.d.ts +0 -21
  235. package/lib/utils/docsPreferredVersion/DocsPreferredVersionProvider.js +0 -94
  236. package/lib/utils/docsPreferredVersion/DocsPreferredVersionStorage.d.ts +0 -13
  237. package/lib/utils/docsPreferredVersion/DocsPreferredVersionStorage.js +0 -20
  238. package/lib/utils/docsPreferredVersion/useDocsPreferredVersion.d.ts +0 -5
  239. package/lib/utils/docsPreferredVersion/useDocsPreferredVersion.js +0 -41
  240. package/lib/utils/pathUtils.js +0 -13
  241. package/lib/utils/useChangeRoute.js +0 -18
  242. package/src/utils/__tests__/codeBlockUtils.test.ts +0 -54
  243. package/src/utils/__tests__/pathUtils.test.ts +0 -32
  244. package/src/utils/docsPreferredVersion/DocsPreferredVersionProvider.tsx +0 -165
  245. package/src/utils/docsPreferredVersion/DocsPreferredVersionStorage.ts +0 -34
  246. package/src/utils/docsPreferredVersion/useDocsPreferredVersion.ts +0 -66
  247. package/src/utils/docsUtils.ts +0 -11
  248. package/src/utils/pathUtils.ts +0 -17
  249. package/src/utils/useChangeRoute.ts +0 -21
  250. package/tsconfig.json +0 -10
@@ -0,0 +1,21 @@
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 { useColorMode } from '../contexts/colorMode';
8
+ import { useThemeConfig } from '../utils/useThemeConfig';
9
+ /**
10
+ * Returns a color-mode-dependent Prism theme: whatever the user specified in
11
+ * the config. Falls back to `palenight`.
12
+ */
13
+ export function usePrismTheme() {
14
+ const { prism } = useThemeConfig();
15
+ const { colorMode } = useColorMode();
16
+ const lightModeTheme = prism.theme;
17
+ const darkModeTheme = prism.darkTheme || lightModeTheme;
18
+ const prismTheme = colorMode === 'dark' ? darkModeTheme : lightModeTheme;
19
+ return prismTheme;
20
+ }
21
+ //# sourceMappingURL=usePrismTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePrismTheme.js","sourceRoot":"","sources":["../../src/hooks/usePrismTheme.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAEvD;;;GAGG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,EAAC,KAAK,EAAC,GAAG,cAAc,EAAE,CAAC;IACjC,MAAM,EAAC,SAAS,EAAC,GAAG,YAAY,EAAE,CAAC;IACnC,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC;IACnC,MAAM,aAAa,GAAG,KAAK,CAAC,SAAS,IAAI,cAAc,CAAC;IACxD,MAAM,UAAU,GAAG,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC;IAEzE,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,25 @@
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
+ /** Some utility functions around search queries. */
8
+ export declare function useSearchPage(): {
9
+ /**
10
+ * Works hand-in-hand with `setSearchQuery`; whatever the user has inputted
11
+ * into the search box.
12
+ */
13
+ searchQuery: string;
14
+ /**
15
+ * Set a new search query. In addition to updating `searchQuery`, this handle
16
+ * also mutates the location and appends the query.
17
+ */
18
+ setSearchQuery: (newSearchQuery: string) => void;
19
+ /**
20
+ * Given a query, this handle generates the corresponding search page link,
21
+ * with base URL prepended.
22
+ */
23
+ generateSearchPageLink: (targetSearchQuery: string) => string;
24
+ };
25
+ //# sourceMappingURL=useSearchPage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSearchPage.d.ts","sourceRoot":"","sources":["../../src/hooks/useSearchPage.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,oDAAoD;AACpD,wBAAgB,aAAa,IAAI;IAC/B;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,cAAc,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD;;;OAGG;IACH,sBAAsB,EAAE,CAAC,iBAAiB,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/D,CAgDA"}
@@ -0,0 +1,43 @@
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 { useHistory } from '@docusaurus/router';
8
+ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
9
+ import { useCallback, useEffect, useState } from 'react';
10
+ const SEARCH_PARAM_QUERY = 'q';
11
+ /** Some utility functions around search queries. */
12
+ export function useSearchPage() {
13
+ const history = useHistory();
14
+ const { siteConfig: { baseUrl }, } = useDocusaurusContext();
15
+ const [searchQuery, setSearchQueryState] = useState('');
16
+ // Init search query just after React hydration
17
+ useEffect(() => {
18
+ const searchQueryStringValue = new URLSearchParams(window.location.search).get(SEARCH_PARAM_QUERY) ?? '';
19
+ setSearchQueryState(searchQueryStringValue);
20
+ }, []);
21
+ const setSearchQuery = useCallback((newSearchQuery) => {
22
+ const searchParams = new URLSearchParams(window.location.search);
23
+ if (newSearchQuery) {
24
+ searchParams.set(SEARCH_PARAM_QUERY, newSearchQuery);
25
+ }
26
+ else {
27
+ searchParams.delete(SEARCH_PARAM_QUERY);
28
+ }
29
+ history.replace({
30
+ search: searchParams.toString(),
31
+ });
32
+ setSearchQueryState(newSearchQuery);
33
+ }, [history]);
34
+ const generateSearchPageLink = useCallback((targetSearchQuery) =>
35
+ // Refer to https://github.com/facebook/docusaurus/pull/2838
36
+ `${baseUrl}search?${SEARCH_PARAM_QUERY}=${encodeURIComponent(targetSearchQuery)}`, [baseUrl]);
37
+ return {
38
+ searchQuery,
39
+ setSearchQuery,
40
+ generateSearchPageLink,
41
+ };
42
+ }
43
+ //# sourceMappingURL=useSearchPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSearchPage.js","sourceRoot":"","sources":["../../src/hooks/useSearchPage.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAC9C,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEvD,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAE/B,oDAAoD;AACpD,MAAM,UAAU,aAAa;IAiB3B,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,EACJ,UAAU,EAAE,EAAC,OAAO,EAAC,GACtB,GAAG,oBAAoB,EAAE,CAAC;IAE3B,MAAM,CAAC,WAAW,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAExD,+CAA+C;IAC/C,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,sBAAsB,GAC1B,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;QAE5E,mBAAmB,CAAC,sBAAsB,CAAC,CAAC;IAC9C,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,cAAc,GAAG,WAAW,CAChC,CAAC,cAAsB,EAAE,EAAE;QACzB,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAEjE,IAAI,cAAc,EAAE;YAClB,YAAY,CAAC,GAAG,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;SACtD;aAAM;YACL,YAAY,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;SACzC;QAED,OAAO,CAAC,OAAO,CAAC;YACd,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE;SAChC,CAAC,CAAC;QACH,mBAAmB,CAAC,cAAc,CAAC,CAAC;IACtC,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,MAAM,sBAAsB,GAAG,WAAW,CACxC,CAAC,iBAAyB,EAAE,EAAE;IAC5B,4DAA4D;IAC5D,GAAG,OAAO,UAAU,kBAAkB,IAAI,kBAAkB,CAC1D,iBAAiB,CAClB,EAAE,EACL,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO;QACL,WAAW;QACX,cAAc;QACd,sBAAsB;KACvB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,25 @@
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 type React from 'react';
8
+ /** This hook wires the logic for a skip-to-content link. */
9
+ export declare function useSkipToContent(): {
10
+ /**
11
+ * The ref to the container. On page transition, the container will be focused
12
+ * so that keyboard navigators can instantly interact with the link and jump
13
+ * to content. **Note:** the type is `RefObject<HTMLDivElement>` only because
14
+ * the typing for refs don't reflect that the `ref` prop is contravariant, so
15
+ * using `HTMLElement` causes type-checking to fail. You can plug the ref into
16
+ * any HTML element, as long as it can be focused.
17
+ */
18
+ containerRef: React.RefObject<HTMLDivElement>;
19
+ /**
20
+ * Callback fired when the skip to content link has been interacted with. It
21
+ * will programmatically focus the main content.
22
+ */
23
+ handleSkip: (e: React.MouseEvent<HTMLAnchorElement>) => void;
24
+ };
25
+ //# sourceMappingURL=useSkipToContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSkipToContent.d.ts","sourceRoot":"","sources":["../../src/hooks/useSkipToContent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,4DAA4D;AAC5D,wBAAgB,gBAAgB,IAAI;IAClC;;;;;;;OAOG;IACH,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC9C;;;OAGG;IACH,UAAU,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAC9D,CAsBA"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { useCallback, useRef } from 'react';
8
+ import { useHistory } from '@docusaurus/router';
9
+ import { useLocationChange } from '../utils/useLocationChange';
10
+ import { ThemeClassNames } from '../utils/ThemeClassNames';
11
+ function programmaticFocus(el) {
12
+ el.setAttribute('tabindex', '-1');
13
+ el.focus();
14
+ el.removeAttribute('tabindex');
15
+ }
16
+ /** This hook wires the logic for a skip-to-content link. */
17
+ export function useSkipToContent() {
18
+ const containerRef = useRef(null);
19
+ const { action } = useHistory();
20
+ const handleSkip = useCallback((e) => {
21
+ e.preventDefault();
22
+ const targetElement = document.querySelector('main:first-of-type') ||
23
+ document.querySelector(`.${ThemeClassNames.wrapper.main}`);
24
+ if (targetElement) {
25
+ programmaticFocus(targetElement);
26
+ }
27
+ }, []);
28
+ useLocationChange(({ location }) => {
29
+ if (containerRef.current && !location.hash && action === 'PUSH') {
30
+ programmaticFocus(containerRef.current);
31
+ }
32
+ });
33
+ return { containerRef, handleSkip };
34
+ }
35
+ //# sourceMappingURL=useSkipToContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSkipToContent.js","sourceRoot":"","sources":["../../src/hooks/useSkipToContent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,WAAW,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAC,iBAAiB,EAAC,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AAEzD,SAAS,iBAAiB,CAAC,EAAe;IACxC,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAClC,EAAE,CAAC,KAAK,EAAE,CAAC;IACX,EAAE,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;AACjC,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,gBAAgB;IAgB9B,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAClD,MAAM,EAAC,MAAM,EAAC,GAAG,UAAU,EAAE,CAAC;IAC9B,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAsC,EAAE,EAAE;QACxE,CAAC,CAAC,cAAc,EAAE,CAAC;QAEnB,MAAM,aAAa,GACjB,QAAQ,CAAC,aAAa,CAAC,oBAAoB,CAAC;YAC5C,QAAQ,CAAC,aAAa,CAAC,IAAI,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAE7D,IAAI,aAAa,EAAE;YACjB,iBAAiB,CAAC,aAAa,CAAC,CAAC;SAClC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,iBAAiB,CAAC,CAAC,EAAC,QAAQ,EAAC,EAAE,EAAE;QAC/B,IAAI,YAAY,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,MAAM,KAAK,MAAM,EAAE;YAC/D,iBAAiB,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;SACzC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,EAAC,YAAY,EAAE,UAAU,EAAC,CAAC;AACpC,CAAC"}
@@ -0,0 +1,25 @@
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
+ export declare type TOCHighlightConfig = {
8
+ /** A class name that all TOC links share. */
9
+ linkClassName: string;
10
+ /** The class name applied to the active (highlighted) link. */
11
+ linkActiveClassName: string;
12
+ /**
13
+ * The minimum heading level that the TOC includes. Only headings that are in
14
+ * this range will be eligible as "active heading".
15
+ */
16
+ minHeadingLevel: number;
17
+ /** @see {@link TOCHighlightConfig.minHeadingLevel} */
18
+ maxHeadingLevel: number;
19
+ };
20
+ /**
21
+ * Side-effect that applies the active class name to the TOC heading that the
22
+ * user is currently viewing. Disabled when `config` is undefined.
23
+ */
24
+ export declare function useTOCHighlight(config: TOCHighlightConfig | undefined): void;
25
+ //# sourceMappingURL=useTOCHighlight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTOCHighlight.d.ts","sourceRoot":"","sources":["../../src/hooks/useTOCHighlight.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgHH,oBAAY,kBAAkB,GAAG;IAC/B,6CAA6C;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,kBAAkB,GAAG,SAAS,GAAG,IAAI,CAwD5E"}
@@ -0,0 +1,130 @@
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 { useEffect, useRef } from 'react';
8
+ import { useThemeConfig } from '../utils/useThemeConfig';
9
+ // TODO make the hardcoded theme-classic classnames configurable (or add them
10
+ // to ThemeClassNames?)
11
+ /**
12
+ * If the anchor has no height and is just a "marker" in the DOM; we'll use the
13
+ * parent (normally the link text) rect boundaries instead
14
+ */
15
+ function getVisibleBoundingClientRect(element) {
16
+ const rect = element.getBoundingClientRect();
17
+ const hasNoHeight = rect.top === rect.bottom;
18
+ if (hasNoHeight) {
19
+ return getVisibleBoundingClientRect(element.parentNode);
20
+ }
21
+ return rect;
22
+ }
23
+ /**
24
+ * Considering we divide viewport into 2 zones of each 50vh, this returns true
25
+ * if an element is in the first zone (i.e., appear in viewport, near the top)
26
+ */
27
+ function isInViewportTopHalf(boundingRect) {
28
+ return boundingRect.top > 0 && boundingRect.bottom < window.innerHeight / 2;
29
+ }
30
+ function getAnchors({ minHeadingLevel, maxHeadingLevel, }) {
31
+ const selectors = [];
32
+ for (let i = minHeadingLevel; i <= maxHeadingLevel; i += 1) {
33
+ selectors.push(`h${i}.anchor`);
34
+ }
35
+ return Array.from(document.querySelectorAll(selectors.join()));
36
+ }
37
+ function getActiveAnchor(anchors, { anchorTopOffset, }) {
38
+ // Naming is hard: The "nextVisibleAnchor" is the first anchor that appear
39
+ // under the viewport top boundary. It does not mean this anchor is visible
40
+ // yet, but if user continues scrolling down, it will be the first to become
41
+ // visible
42
+ const nextVisibleAnchor = anchors.find((anchor) => {
43
+ const boundingRect = getVisibleBoundingClientRect(anchor);
44
+ return boundingRect.top >= anchorTopOffset;
45
+ });
46
+ if (nextVisibleAnchor) {
47
+ const boundingRect = getVisibleBoundingClientRect(nextVisibleAnchor);
48
+ // If anchor is in the top half of the viewport: it is the one we consider
49
+ // "active" (unless it's too close to the top and and soon to be scrolled
50
+ // outside viewport)
51
+ if (isInViewportTopHalf(boundingRect)) {
52
+ return nextVisibleAnchor;
53
+ }
54
+ // If anchor is in the bottom half of the viewport, or under the viewport,
55
+ // we consider the active anchor is the previous one. This is because the
56
+ // main text appearing in the user screen mostly belong to the previous
57
+ // anchor. Returns null for the first anchor, see
58
+ // https://github.com/facebook/docusaurus/issues/5318
59
+ return anchors[anchors.indexOf(nextVisibleAnchor) - 1] ?? null;
60
+ }
61
+ // No anchor under viewport top (i.e. we are at the bottom of the page),
62
+ // highlight the last anchor found
63
+ return anchors[anchors.length - 1] ?? null;
64
+ }
65
+ function getLinkAnchorValue(link) {
66
+ return decodeURIComponent(link.href.substring(link.href.indexOf('#') + 1));
67
+ }
68
+ function getLinks(linkClassName) {
69
+ return Array.from(document.getElementsByClassName(linkClassName));
70
+ }
71
+ function getNavbarHeight() {
72
+ // Not ideal to obtain actual height this way
73
+ // Using TS ! (not ?) because otherwise a bad selector would be un-noticed
74
+ return document.querySelector('.navbar').clientHeight;
75
+ }
76
+ function useAnchorTopOffsetRef() {
77
+ const anchorTopOffsetRef = useRef(0);
78
+ const { navbar: { hideOnScroll }, } = useThemeConfig();
79
+ useEffect(() => {
80
+ anchorTopOffsetRef.current = hideOnScroll ? 0 : getNavbarHeight();
81
+ }, [hideOnScroll]);
82
+ return anchorTopOffsetRef;
83
+ }
84
+ /**
85
+ * Side-effect that applies the active class name to the TOC heading that the
86
+ * user is currently viewing. Disabled when `config` is undefined.
87
+ */
88
+ export function useTOCHighlight(config) {
89
+ const lastActiveLinkRef = useRef(undefined);
90
+ const anchorTopOffsetRef = useAnchorTopOffsetRef();
91
+ useEffect(() => {
92
+ if (!config) {
93
+ // No-op, highlighting is disabled
94
+ return () => { };
95
+ }
96
+ const { linkClassName, linkActiveClassName, minHeadingLevel, maxHeadingLevel, } = config;
97
+ function updateLinkActiveClass(link, active) {
98
+ if (active) {
99
+ if (lastActiveLinkRef.current && lastActiveLinkRef.current !== link) {
100
+ lastActiveLinkRef.current?.classList.remove(linkActiveClassName);
101
+ }
102
+ link.classList.add(linkActiveClassName);
103
+ lastActiveLinkRef.current = link;
104
+ // link.scrollIntoView({block: 'nearest'});
105
+ }
106
+ else {
107
+ link.classList.remove(linkActiveClassName);
108
+ }
109
+ }
110
+ function updateActiveLink() {
111
+ const links = getLinks(linkClassName);
112
+ const anchors = getAnchors({ minHeadingLevel, maxHeadingLevel });
113
+ const activeAnchor = getActiveAnchor(anchors, {
114
+ anchorTopOffset: anchorTopOffsetRef.current,
115
+ });
116
+ const activeLink = links.find((link) => activeAnchor && activeAnchor.id === getLinkAnchorValue(link));
117
+ links.forEach((link) => {
118
+ updateLinkActiveClass(link, link === activeLink);
119
+ });
120
+ }
121
+ document.addEventListener('scroll', updateActiveLink);
122
+ document.addEventListener('resize', updateActiveLink);
123
+ updateActiveLink();
124
+ return () => {
125
+ document.removeEventListener('scroll', updateActiveLink);
126
+ document.removeEventListener('resize', updateActiveLink);
127
+ };
128
+ }, [config, anchorTopOffsetRef]);
129
+ }
130
+ //# sourceMappingURL=useTOCHighlight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTOCHighlight.js","sourceRoot":"","sources":["../../src/hooks/useTOCHighlight.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,SAAS,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AACxC,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAEvD,6EAA6E;AAC7E,uBAAuB;AAEvB;;;GAGG;AACH,SAAS,4BAA4B,CAAC,OAAoB;IACxD,MAAM,IAAI,GAAG,OAAO,CA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,EAAE,IAAI,KAAK,UAAU,CAAC,CAAC;YACnD,CAAC,CAAC,CAAC;QACL,CAAC;QAED,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;QACtD,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;QAEtD,gBAAgB,EAAE,CAAC;QAEnB,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;YACzD,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;QAC3D,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC;AACnC,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ declare const windowSizes: {
8
+ readonly desktop: "desktop";
9
+ readonly mobile: "mobile";
10
+ readonly ssr: "ssr";
11
+ };
12
+ declare type WindowSize = keyof typeof windowSizes;
13
+ /**
14
+ * Gets the current window size as an enum value. We don't want it to return the
15
+ * actual width value, so that it only re-renders once a breakpoint is crossed.
16
+ *
17
+ * It may return `"ssr"`, which is very important to handle hydration FOUC or
18
+ * layout shifts. You have to handle it explicitly upfront. On the server, you
19
+ * may need to render BOTH the mobile/desktop elements (and hide one of them
20
+ * with mediaquery). We don't return `undefined` on purpose, to make it more
21
+ * explicit.
22
+ *
23
+ * In development mode, this hook will still return `"ssr"` for one second, to
24
+ * catch potential layout shifts, similar to strict mode calling effects twice.
25
+ */
26
+ export declare function useWindowSize(): WindowSize;
27
+ export {};
28
+ //# sourceMappingURL=useWindowSize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWindowSize.d.ts","sourceRoot":"","sources":["../../src/hooks/useWindowSize.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,QAAA,MAAM,WAAW;;;;CAIP,CAAC;AAEX,aAAK,UAAU,GAAG,MAAM,OAAO,WAAW,CAAC;AAe3C;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,IAAI,UAAU,CA0B1C"}
@@ -0,0 +1,59 @@
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 { useEffect, useState } from 'react';
8
+ import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
9
+ const windowSizes = {
10
+ desktop: 'desktop',
11
+ mobile: 'mobile',
12
+ ssr: 'ssr',
13
+ };
14
+ const DesktopThresholdWidth = 996;
15
+ function getWindowSize() {
16
+ if (!ExecutionEnvironment.canUseDOM) {
17
+ return windowSizes.ssr;
18
+ }
19
+ return window.innerWidth > DesktopThresholdWidth
20
+ ? windowSizes.desktop
21
+ : windowSizes.mobile;
22
+ }
23
+ const DevSimulateSSR = process.env.NODE_ENV === 'development' && true;
24
+ /**
25
+ * Gets the current window size as an enum value. We don't want it to return the
26
+ * actual width value, so that it only re-renders once a breakpoint is crossed.
27
+ *
28
+ * It may return `"ssr"`, which is very important to handle hydration FOUC or
29
+ * layout shifts. You have to handle it explicitly upfront. On the server, you
30
+ * may need to render BOTH the mobile/desktop elements (and hide one of them
31
+ * with mediaquery). We don't return `undefined` on purpose, to make it more
32
+ * explicit.
33
+ *
34
+ * In development mode, this hook will still return `"ssr"` for one second, to
35
+ * catch potential layout shifts, similar to strict mode calling effects twice.
36
+ */
37
+ export function useWindowSize() {
38
+ const [windowSize, setWindowSize] = useState(() => {
39
+ if (DevSimulateSSR) {
40
+ return 'ssr';
41
+ }
42
+ return getWindowSize();
43
+ });
44
+ useEffect(() => {
45
+ function updateWindowSize() {
46
+ setWindowSize(getWindowSize());
47
+ }
48
+ const timeout = DevSimulateSSR
49
+ ? window.setTimeout(updateWindowSize, 1000)
50
+ : undefined;
51
+ window.addEventListener('resize', updateWindowSize);
52
+ return () => {
53
+ window.removeEventListener('resize', updateWindowSize);
54
+ clearTimeout(timeout);
55
+ };
56
+ }, []);
57
+ return windowSize;
58
+ }
59
+ //# sourceMappingURL=useWindowSize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWindowSize.js","sourceRoot":"","sources":["../../src/hooks/useWindowSize.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAE1C,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;AAEpE,MAAM,WAAW,GAAG;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;CACF,CAAC;AAIX,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC,SAAS,aAAa;IACpB,IAAI,CAAC,oBAAoB,CAAC,SAAS,EAAE;QACnC,OAAO,WAAW,CAAC,GAAG,CAAC;KACxB;IACD,OAAO,MAAM,CAAC,UAAU,GAAG,qBAAqB;QAC9C,CAAC,CAAC,WAAW,CAAC,OAAO;QACrB,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC;AACzB,CAAC;AAED,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,IAAI,IAAI,CAAC;AAEtE;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAa,GAAG,EAAE;QAC5D,IAAI,cAAc,EAAE;YAClB,OAAO,KAAK,CAAC;SACd;QACD,OAAO,aAAa,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,gBAAgB;YACvB,aAAa,CAAC,aAAa,EAAE,CAAC,CAAC;QACjC,CAAC;QAED,MAAM,OAAO,GAAG,cAAc;YAC5B,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,gBAAgB,EAAE,IAAI,CAAC;YAC3C,CAAC,CAAC,SAAS,CAAC;QAEd,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;QAEpD,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;YACvD,YAAY,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,UAAU,CAAC;AACpB,CAAC"}
package/lib/index.d.ts CHANGED
@@ -4,17 +4,47 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- export { useThemeConfig } from './utils/useThemeConfig';
8
- export type { ThemeConfig, Navbar, NavbarItem, NavbarLogo, Footer, FooterLinks, FooterLinkItem, } from './utils/useThemeConfig';
7
+ export { useThemeConfig, type ThemeConfig, type UserThemeConfig, type Navbar, type NavbarItem, type NavbarLogo, type MultiColumnFooter, type SimpleFooter, type Footer, type FooterLogo, type FooterLinkItem, type ColorModeConfig, } from './utils/useThemeConfig';
8
+ export { DocSidebarItemsExpandedStateProvider, useDocSidebarItemsExpandedState, } from './contexts/docSidebarItemsExpandedState';
9
+ export { DocsVersionProvider, useDocsVersion } from './contexts/docsVersion';
10
+ export { DocsSidebarProvider, useDocsSidebar } from './contexts/docsSidebar';
9
11
  export { createStorageSlot, listStorageKeys } from './utils/storageUtils';
10
12
  export { useAlternatePageUtils } from './utils/useAlternatePageUtils';
11
- export { parseCodeBlockTitle } from './utils/codeBlockUtils';
12
- export { docVersionSearchTag, DEFAULT_SEARCH_TAG } from './utils/searchUtils';
13
- export { isDocsPluginEnabled } from './utils/docsUtils';
14
- export { isSamePath } from './utils/pathUtils';
13
+ export { parseCodeBlockTitle, parseLanguage, parseLines, containsLineNumbers, getPrismCssVariables, } from './utils/codeBlockUtils';
14
+ export { docVersionSearchTag, DEFAULT_SEARCH_TAG, useContextualSearchFilters, } from './utils/searchUtils';
15
+ export { isDocsPluginEnabled, useDocById, findSidebarCategory, findFirstCategoryLink, useCurrentSidebarCategory, isActiveSidebarItem, useSidebarBreadcrumbs, useDocsVersionCandidates, useLayoutDoc, useLayoutDocsSidebar, useDocRouteMetadata, } from './utils/docsUtils';
15
16
  export { useTitleFormatter } from './utils/generalUtils';
16
17
  export { usePluralForm } from './utils/usePluralForm';
17
- export { useChangeRoute } from './utils/useChangeRoute';
18
- export { useDocsPreferredVersion, useDocsPreferredVersionByPluginId, } from './utils/docsPreferredVersion/useDocsPreferredVersion';
19
- export { DocsPreferredVersionContextProvider } from './utils/docsPreferredVersion/DocsPreferredVersionProvider';
18
+ export { useLocationChange } from './utils/useLocationChange';
19
+ export { useCollapsible, Collapsible } from './components/Collapsible';
20
+ export { useDocsPreferredVersion, useDocsPreferredVersionByPluginId, DocsPreferredVersionContextProvider, } from './contexts/docsPreferredVersion';
21
+ export { duplicates, uniq } from './utils/jsUtils';
20
22
  export { ThemeClassNames } from './utils/ThemeClassNames';
23
+ export { AnnouncementBarProvider, useAnnouncementBar, } from './contexts/announcementBar';
24
+ export { useLocalPathname } from './utils/useLocalPathname';
25
+ export { translateTagsPageTitle, listTagsByLetters, type TagLetterEntry, } from './utils/tagsUtils';
26
+ export { useHistoryPopHandler } from './utils/historyUtils';
27
+ export { useTOCHighlight, type TOCHighlightConfig, } from './hooks/useTOCHighlight';
28
+ export { useFilteredAndTreeifiedTOC, useTreeifiedTOC, type TOCTreeNode, } from './utils/tocUtils';
29
+ export { isMultiColumnFooterLinks } from './utils/footerUtils';
30
+ export { ScrollControllerProvider, useScrollController, useScrollPosition, useScrollPositionBlocker, useSmoothScrollTo, } from './utils/scrollUtils';
31
+ export { useIsomorphicLayoutEffect, useDynamicCallback, usePrevious, ReactContextError, } from './utils/reactUtils';
32
+ export { isRegexpStringMatch } from './utils/regexpUtils';
33
+ export { useHomePageRoute, isSamePath } from './utils/routesUtils';
34
+ export { PageMetadata, HtmlClassNameProvider, PluginHtmlClassNameProvider, } from './utils/metadataUtils';
35
+ export { useColorMode, ColorModeProvider, type ColorMode, } from './contexts/colorMode';
36
+ export { splitNavbarItems, NavbarProvider } from './utils/navbarUtils';
37
+ export { useTabGroupChoice, TabGroupChoiceProvider, } from './contexts/tabGroupChoice';
38
+ export { useNavbarMobileSidebar } from './contexts/navbarMobileSidebar';
39
+ export { NavbarSecondaryMenuFiller, type NavbarSecondaryMenuComponent, } from './contexts/navbarSecondaryMenu/content';
40
+ export { useNavbarSecondaryMenu } from './contexts/navbarSecondaryMenu/display';
41
+ export { useBackToTopButton } from './hooks/useBackToTopButton';
42
+ export { useHideableNavbar } from './hooks/useHideableNavbar';
43
+ export { useKeyboardNavigation, keyboardFocusedClassName, } from './hooks/useKeyboardNavigation';
44
+ export { usePrismTheme } from './hooks/usePrismTheme';
45
+ export { useLockBodyScroll } from './hooks/useLockBodyScroll';
46
+ export { useWindowSize } from './hooks/useWindowSize';
47
+ export { useSearchPage } from './hooks/useSearchPage';
48
+ export { useCodeWordWrap } from './hooks/useCodeWordWrap';
49
+ export { useSkipToContent } from './hooks/useSkipToContent';
50
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,MAAM,EACX,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,MAAM,EACX,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,oCAAoC,EACpC,+BAA+B,GAChC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAC,mBAAmB,EAAE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AO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAC,iBAAiB,EAAC,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC"}
package/lib/index.js CHANGED
@@ -4,16 +4,47 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- export { useThemeConfig } from './utils/useThemeConfig';
7
+ export { useThemeConfig, } from './utils/useThemeConfig';
8
+ export { DocSidebarItemsExpandedStateProvider, useDocSidebarItemsExpandedState, } from './contexts/docSidebarItemsExpandedState';
9
+ export { DocsVersionProvider, useDocsVersion } from './contexts/docsVersion';
10
+ export { DocsSidebarProvider, useDocsSidebar } from './contexts/docsSidebar';
8
11
  export { createStorageSlot, listStorageKeys } from './utils/storageUtils';
9
12
  export { useAlternatePageUtils } from './utils/useAlternatePageUtils';
10
- export { parseCodeBlockTitle } from './utils/codeBlockUtils';
11
- export { docVersionSearchTag, DEFAULT_SEARCH_TAG } from './utils/searchUtils';
12
- export { isDocsPluginEnabled } from './utils/docsUtils';
13
- export { isSamePath } from './utils/pathUtils';
13
+ export { parseCodeBlockTitle, parseLanguage, parseLines, containsLineNumbers, getPrismCssVariables, } from './utils/codeBlockUtils';
14
+ export { docVersionSearchTag, DEFAULT_SEARCH_TAG, useContextualSearchFilters, } from './utils/searchUtils';
15
+ export { isDocsPluginEnabled, useDocById, findSidebarCategory, findFirstCategoryLink, useCurrentSidebarCategory, isActiveSidebarItem, useSidebarBreadcrumbs, useDocsVersionCandidates, useLayoutDoc, useLayoutDocsSidebar, useDocRouteMetadata, } from './utils/docsUtils';
14
16
  export { useTitleFormatter } from './utils/generalUtils';
15
17
  export { usePluralForm } from './utils/usePluralForm';
16
- export { useChangeRoute } from './utils/useChangeRoute';
17
- export { useDocsPreferredVersion, useDocsPreferredVersionByPluginId, } from './utils/docsPreferredVersion/useDocsPreferredVersion';
18
- export { DocsPreferredVersionContextProvider } from './utils/docsPreferredVersion/DocsPreferredVersionProvider';
18
+ export { useLocationChange } from './utils/useLocationChange';
19
+ export { useCollapsible, Collapsible } from './components/Collapsible';
20
+ export { useDocsPreferredVersion, useDocsPreferredVersionByPluginId, DocsPreferredVersionContextProvider, } from './contexts/docsPreferredVersion';
21
+ export { duplicates, uniq } from './utils/jsUtils';
19
22
  export { ThemeClassNames } from './utils/ThemeClassNames';
23
+ export { AnnouncementBarProvider, useAnnouncementBar, } from './contexts/announcementBar';
24
+ export { useLocalPathname } from './utils/useLocalPathname';
25
+ export { translateTagsPageTitle, listTagsByLetters, } from './utils/tagsUtils';
26
+ export { useHistoryPopHandler } from './utils/historyUtils';
27
+ export { useTOCHighlight, } from './hooks/useTOCHighlight';
28
+ export { useFilteredAndTreeifiedTOC, useTreeifiedTOC, } from './utils/tocUtils';
29
+ export { isMultiColumnFooterLinks } from './utils/footerUtils';
30
+ export { ScrollControllerProvider, useScrollController, useScrollPosition, useScrollPositionBlocker, useSmoothScrollTo, } from './utils/scrollUtils';
31
+ export { useIsomorphicLayoutEffect, useDynamicCallback, usePrevious, ReactContextError, } from './utils/reactUtils';
32
+ export { isRegexpStringMatch } from './utils/regexpUtils';
33
+ export { useHomePageRoute, isSamePath } from './utils/routesUtils';
34
+ export { PageMetadata, HtmlClassNameProvider, PluginHtmlClassNameProvider, } from './utils/metadataUtils';
35
+ export { useColorMode, ColorModeProvider, } from './contexts/colorMode';
36
+ export { splitNavbarItems, NavbarProvider } from './utils/navbarUtils';
37
+ export { useTabGroupChoice, TabGroupChoiceProvider, } from './contexts/tabGroupChoice';
38
+ export { useNavbarMobileSidebar } from './contexts/navbarMobileSidebar';
39
+ export { NavbarSecondaryMenuFiller, } from './contexts/navbarSecondaryMenu/content';
40
+ export { useNavbarSecondaryMenu } from './contexts/navbarSecondaryMenu/display';
41
+ export { useBackToTopButton } from './hooks/useBackToTopButton';
42
+ export { useHideableNavbar } from './hooks/useHideableNavbar';
43
+ export { useKeyboardNavigation, keyboardFocusedClassName, } from './hooks/useKeyboardNavigation';
44
+ export { usePrismTheme } from './hooks/usePrismTheme';
45
+ export { useLockBodyScroll } from './hooks/useLockBodyScroll';
46
+ export { useWindowSize } from './hooks/useWindowSize';
47
+ export { useSearchPage } from './hooks/useSearchPage';
48
+ export { useCodeWordWrap } from './hooks/useCodeWordWrap';
49
+ export { useSkipToContent } from './hooks/useSkipToContent';
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,cAAc,GAYf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,oCAAoC,EACpC,+BAA+B,GAChC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAC,mBAAmB,EAAE,cAAc,EAAC,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAC,mBAAmB,EAAE,cAAc,EAAC,MAAM,wBAAwB,CAAC;AAE3E,OAAO,EAAC,iBAAiB,EAAE,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAC,qBAAqB,EAAC,MAAM,+BAA+B,CAAC;AAEpE,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,YAAY,EACZ,oBAAoB,E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