@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 @@
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/contexts/navbarSecondaryMenu/content.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAc,EAKZ,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAUf,oBAAY,4BAA4B,CAAC,KAAK,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;AAEvE,gBAAgB;AAChB,oBAAY,OAAO,GACf;IACE,SAAS,EAAE,4BAA4B,CAAC,MAAM,CAAC,CAAC;IAChD,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IAAC,SAAS,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,IAAI,CAAA;CAAC,CAAC;AASnC,gBAAgB;AAChB,wBAAgB,kCAAkC,CAAC,EACjD,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CAMd;AAED,gBAAgB;AAChB,wBAAgB,6BAA6B,IAAI,OAAO,CAMvD;AAWD;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,MAAM,EAAE,EAC1D,SAAS,EACT,KAAK,GACN,EAAE;IACD,SAAS,EAAE,4BAA4B,CAAC,CAAC,CAAC,CAAC;IAC3C,KAAK,EAAE,CAAC,CAAC;CACV,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAqBrB"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React, { useState, useContext, useEffect, useMemo, } from 'react';
8
+ import { ReactContextError } from '../../utils/reactUtils';
9
+ const Context = React.createContext(null);
10
+ /** @internal */
11
+ export function NavbarSecondaryMenuContentProvider({ children, }) {
12
+ const value = useState({ component: null, props: null });
13
+ return (
14
+ // @ts-expect-error: this context is hard to type
15
+ React.createElement(Context.Provider, { value: value }, children));
16
+ }
17
+ /** @internal */
18
+ export function useNavbarSecondaryMenuContent() {
19
+ const value = useContext(Context);
20
+ if (!value) {
21
+ throw new ReactContextError('NavbarSecondaryMenuContentProvider');
22
+ }
23
+ return value[0];
24
+ }
25
+ function useShallowMemoizedObject(obj) {
26
+ return useMemo(() => obj,
27
+ // Is this safe?
28
+ // eslint-disable-next-line react-hooks/exhaustive-deps
29
+ [...Object.keys(obj), ...Object.values(obj)]);
30
+ }
31
+ /**
32
+ * This component renders nothing by itself, but it fills the placeholder in the
33
+ * generic secondary menu layout. This reduces coupling between the main layout
34
+ * and the specific page.
35
+ *
36
+ * This kind of feature is often called portal/teleport/gateway/outlet...
37
+ * Various unmaintained React libs exist. Most up-to-date one:
38
+ * https://github.com/gregberge/react-teleporter
39
+ * Not sure any of those is safe regarding concurrent mode.
40
+ */
41
+ export function NavbarSecondaryMenuFiller({ component, props, }) {
42
+ const context = useContext(Context);
43
+ if (!context) {
44
+ throw new ReactContextError('NavbarSecondaryMenuContentProvider');
45
+ }
46
+ const [, setContent] = context;
47
+ // To avoid useless context re-renders, props are memoized shallowly
48
+ const memoizedProps = useShallowMemoizedObject(props);
49
+ useEffect(() => {
50
+ // @ts-expect-error: this context is hard to type
51
+ setContent({ component, props: memoizedProps });
52
+ }, [setContent, component, memoizedProps]);
53
+ useEffect(() => () => setContent({ component: null, props: null }), [setContent]);
54
+ return null;
55
+ }
56
+ //# sourceMappingURL=content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.js","sourceRoot":"","sources":["../../../src/contexts/navbarSecondaryMenu/content.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EACZ,QAAQ,EACR,UAAU,EACV,SAAS,EACT,OAAO,GAG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wBAAwB,CAAC,KAAK,CAAC,CAAC;IAEtD,SAAS,CAAC,GAAG,EAAE;QACb,iDAAiD;QACjD,UAAU,CAAC,EAAC,SAAS,EAAE,KAAK,EAAE,aAAa,EAAC,CAAC,CAAC;IAChD,CAAC,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC;IAE3C,SAAS,CACP,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,EAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC,EACtD,CAAC,UAAU,CAAC,CACb,CAAC;IAEF,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,24 @@
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 ReactNode } from 'react';
8
+ /** @internal */
9
+ export declare function NavbarSecondaryMenuDisplayProvider({ children, }: {
10
+ children: ReactNode;
11
+ }): JSX.Element;
12
+ /** Wires the logic for rendering the mobile navbar secondary menu. */
13
+ export declare function useNavbarSecondaryMenu(): {
14
+ /** Whether secondary menu is displayed. */
15
+ shown: boolean;
16
+ /**
17
+ * Hide the secondary menu; fired either when hiding the entire sidebar, or
18
+ * when going back to the primary menu.
19
+ */
20
+ hide: () => void;
21
+ /** The content returned from the current secondary menu filler. */
22
+ content: JSX.Element | undefined;
23
+ };
24
+ //# sourceMappingURL=display.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../../src/contexts/navbarSecondaryMenu/display.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAc,EAMZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AA6Cf,gBAAgB;AAChB,wBAAgB,kCAAkC,CAAC,EACjD,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CAGd;AAUD,sEAAsE;AACtE,wBAAgB,sBAAsB,IAAI;IACxC,2CAA2C;IAC3C,KAAK,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,mEAAmE;IACnE,OAAO,EAAE,GAAG,CAAC,OAAO,GAAG,SAAS,CAAC;CAClC,CAaA"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React, { useState, useContext, useEffect, useMemo, useCallback, } from 'react';
8
+ import { ReactContextError, usePrevious } from '../../utils/reactUtils';
9
+ import { useNavbarMobileSidebar } from '../navbarMobileSidebar';
10
+ import { useNavbarSecondaryMenuContent } from './content';
11
+ const Context = React.createContext(null);
12
+ function useContextValue() {
13
+ const mobileSidebar = useNavbarMobileSidebar();
14
+ const content = useNavbarSecondaryMenuContent();
15
+ const [shown, setShown] = useState(false);
16
+ const hasContent = content.component !== null;
17
+ const previousHasContent = usePrevious(hasContent);
18
+ // When content is become available for the first time (set in useEffect)
19
+ // we set this content to be shown!
20
+ useEffect(() => {
21
+ const contentBecameAvailable = hasContent && !previousHasContent;
22
+ if (contentBecameAvailable) {
23
+ setShown(true);
24
+ }
25
+ }, [hasContent, previousHasContent]);
26
+ // On sidebar close, secondary menu is set to be shown on next re-opening
27
+ // (if any secondary menu content available)
28
+ useEffect(() => {
29
+ if (!hasContent) {
30
+ setShown(false);
31
+ return;
32
+ }
33
+ if (!mobileSidebar.shown) {
34
+ setShown(true);
35
+ }
36
+ }, [mobileSidebar.shown, hasContent]);
37
+ return useMemo(() => [shown, setShown], [shown]);
38
+ }
39
+ /** @internal */
40
+ export function NavbarSecondaryMenuDisplayProvider({ children, }) {
41
+ const value = useContextValue();
42
+ return React.createElement(Context.Provider, { value: value }, children);
43
+ }
44
+ function renderElement(content) {
45
+ if (content.component) {
46
+ const Comp = content.component;
47
+ return React.createElement(Comp, { ...content.props });
48
+ }
49
+ return undefined;
50
+ }
51
+ /** Wires the logic for rendering the mobile navbar secondary menu. */
52
+ export function useNavbarSecondaryMenu() {
53
+ const value = useContext(Context);
54
+ if (!value) {
55
+ throw new ReactContextError('NavbarSecondaryMenuDisplayProvider');
56
+ }
57
+ const [shown, setShown] = value;
58
+ const hide = useCallback(() => setShown(false), [setShown]);
59
+ const content = useNavbarSecondaryMenuContent();
60
+ return useMemo(() => ({ shown, hide, content: renderElement(content) }), [hide, content, shown]);
61
+ }
62
+ //# sourceMappingURL=display.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"display.js","sourceRoot":"","sources":["../../../src/contexts/navbarSecondaryMenu/display.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EACZ,QAAQ,EACR,UAAU,EACV,SAAS,EACT,OAAO,EACP,WAAW,GAEZ,MAAM,OAAO,CAAC;AACf,OAAO,EAAC,iBAAiB,EAAE,WAAW,EAAC,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAC,sBAAsB,EAAC,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAC,6BAA6B,EAAe,MAAM,WAAW,CAAC;AAOtE,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CAAsB,IAAI,CAAC,CAAC;AAE/D,SAAS,eAAe;IACtB,MAAM,aAAa,GAAG,sBAAsB,EAAE,CAAC;IAC/C,MAAM,OAAO,GAAG,6BAA6B,EAAE,CAAC;IAEhD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE1C,MAAM,UAAU,GAAG,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC;IAC9C,MAAM,kBAAkB,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;IAEnD,yEAAyE;IACzE,mCAAmC;IACnC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,s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E,QAAQ,CAAC,GAAG,KAAK,CAAC;IAChC,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC5D,MAAM,OAAO,GAAG,6BAA6B,EAAE,CAAC;IAEhD,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC,EAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,EAAC,CAAC,EACtD,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CACvB,CAAC;AACJ,CAAC"}
@@ -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 { type ReactNode } from 'react';
8
+ declare type ContextValue = {
9
+ /** A map from `groupId` to the `value` of the saved choice. */
10
+ readonly tabGroupChoices: {
11
+ readonly [groupId: string]: string;
12
+ };
13
+ /** Set the new choice value of a group. */
14
+ readonly setTabGroupChoices: (groupId: string, newChoice: string) => void;
15
+ };
16
+ export declare function TabGroupChoiceProvider({ children, }: {
17
+ children: ReactNode;
18
+ }): JSX.Element;
19
+ export declare function useTabGroupChoice(): ContextValue;
20
+ export {};
21
+ //# sourceMappingURL=tabGroupChoice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tabGroupChoice.d.ts","sourceRoot":"","sources":["../../src/contexts/tabGroupChoice.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAc,EAMZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAMf,aAAK,YAAY,GAAG;IAClB,+DAA+D;IAC/D,QAAQ,CAAC,eAAe,EAAE;QAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;KAAC,CAAC;IAC/D,2CAA2C;IAC3C,QAAQ,CAAC,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3E,CAAC;AA4CF,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CAGd;AAED,wBAAgB,iBAAiB,IAAI,YAAY,CAMhD"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React, { useState, useCallback, useEffect, useMemo, useContext, } from 'react';
8
+ import { createStorageSlot, listStorageKeys } from '../utils/storageUtils';
9
+ import { ReactContextError } from '../utils/reactUtils';
10
+ const TAB_CHOICE_PREFIX = 'docusaurus.tab.';
11
+ const Context = React.createContext(undefined);
12
+ function useContextValue() {
13
+ const [tabGroupChoices, setChoices] = useState({});
14
+ const setChoiceSyncWithLocalStorage = useCallback((groupId, newChoice) => {
15
+ createStorageSlot(`${TAB_CHOICE_PREFIX}${groupId}`).set(newChoice);
16
+ }, []);
17
+ useEffect(() => {
18
+ try {
19
+ const localStorageChoices = {};
20
+ listStorageKeys().forEach((storageKey) => {
21
+ if (storageKey.startsWith(TAB_CHOICE_PREFIX)) {
22
+ const groupId = storageKey.substring(TAB_CHOICE_PREFIX.length);
23
+ localStorageChoices[groupId] = createStorageSlot(storageKey).get();
24
+ }
25
+ });
26
+ setChoices(localStorageChoices);
27
+ }
28
+ catch (err) {
29
+ console.error(err);
30
+ }
31
+ }, []);
32
+ const setTabGroupChoices = useCallback((groupId, newChoice) => {
33
+ setChoices((oldChoices) => ({ ...oldChoices, [groupId]: newChoice }));
34
+ setChoiceSyncWithLocalStorage(groupId, newChoice);
35
+ }, [setChoiceSyncWithLocalStorage]);
36
+ return useMemo(() => ({ tabGroupChoices, setTabGroupChoices }), [tabGroupChoices, setTabGroupChoices]);
37
+ }
38
+ export function TabGroupChoiceProvider({ children, }) {
39
+ const value = useContextValue();
40
+ return React.createElement(Context.Provider, { value: value }, children);
41
+ }
42
+ export function useTabGroupChoice() {
43
+ const context = useContext(Context);
44
+ if (context == null) {
45
+ throw new ReactContextError('TabGroupChoiceProvider');
46
+ }
47
+ return context;
48
+ }
49
+ //# sourceMappingURL=tabGroupChoice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tabGroupChoice.js","sourceRoot":"","sources":["../../src/contexts/tabGroupChoice.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EACZ,QAAQ,EACR,WAAW,EACX,SAAS,EACT,OAAO,EACP,UAAU,GAEX,MAAM,OAAO,CAAC;AACf,OAAO,EAAC,iBAAiB,EAAE,eAAe,EAAC,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAEtD,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAS5C,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CAA2B,SAAS,CAAC,CAAC;AAEzE,SAAS,eAAe;IACtB,MAAM,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG,QAAQ,CAE3C,EAAE,CAAC,CAAC;IACP,MAAM,6BAA6B,GAAG,WAAW,CAC/C,CAAC,OAAe,EAAE,SAAiB,EAAE,EAAE;QACrC,iBAAiB,CAAC,GAAG,iBAAiB,GAAG,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACrE,CAAC,EACD,EAAE,CACH,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI;YACF,MAAM,mBAAmB,GAAgC,EAAE,CAAC;YAC5D,eAAe,EAAE,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;gBACvC,IAAI,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE;oBAC5C,MAAM,OAAO,GAAG,UAAU,CAAC,SA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
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- export declare function useChangeRoute(onRouteChange: () => void): void;
7
+
8
+ body:not(.navigation-with-keyboard) *:not(input):focus {
9
+ outline: none;
10
+ }
@@ -0,0 +1,27 @@
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
+ /** Wires the logic for the back to top button. */
8
+ export declare function useBackToTopButton({ threshold, }: {
9
+ /**
10
+ * The minimum vertical scroll position, above which a scroll-up would not
11
+ * cause `shown` to become `true`. This is because BTT is only useful if the
12
+ * user is far down the page.
13
+ */
14
+ threshold: number;
15
+ }): {
16
+ /**
17
+ * Whether the button should be displayed. We only show if the user has
18
+ * scrolled up and is on a vertical position greater than `threshold`.
19
+ */
20
+ shown: boolean;
21
+ /**
22
+ * A (memoized) handle for starting the scroll, which you can directly plug
23
+ * into the props.
24
+ */
25
+ scrollToTop: () => void;
26
+ };
27
+ //# sourceMappingURL=useBackToTopButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBackToTopButton.d.ts","sourceRoot":"","sources":["../../src/hooks/useBackToTopButton.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,kDAAkD;AAClD,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,GACV,EAAE;IACD;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG;IACF;;;OAGG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,CAwCA"}
@@ -0,0 +1,50 @@
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 { useRef, useState } from 'react';
8
+ import { useScrollPosition, useSmoothScrollTo } from '../utils/scrollUtils';
9
+ import { useLocationChange } from '../utils/useLocationChange';
10
+ /** Wires the logic for the back to top button. */
11
+ export function useBackToTopButton({ threshold, }) {
12
+ const [shown, setShown] = useState(false);
13
+ const isFocusedAnchor = useRef(false);
14
+ const { startScroll, cancelScroll } = useSmoothScrollTo();
15
+ useScrollPosition(({ scrollY: scrollTop }, lastPosition) => {
16
+ const lastScrollTop = lastPosition?.scrollY;
17
+ // Component is just being mounted. Not really a scroll event from the user.
18
+ // Ignore it.
19
+ if (!lastScrollTop) {
20
+ return;
21
+ }
22
+ if (isFocusedAnchor.current) {
23
+ // This scroll position change is triggered by navigating to an anchor.
24
+ // Ignore it.
25
+ isFocusedAnchor.current = false;
26
+ }
27
+ else if (scrollTop >= lastScrollTop) {
28
+ // The user has scrolled down to "fight against" the animation. Cancel any
29
+ // animation under progress.
30
+ cancelScroll();
31
+ setShown(false);
32
+ }
33
+ else if (scrollTop < threshold) {
34
+ // Scrolled to the minimum position; hide the button.
35
+ setShown(false);
36
+ }
37
+ else if (scrollTop + window.innerHeight <
38
+ document.documentElement.scrollHeight) {
39
+ setShown(true);
40
+ }
41
+ });
42
+ useLocationChange((locationChangeEvent) => {
43
+ if (locationChangeEvent.location.hash) {
44
+ isFocusedAnchor.current = true;
45
+ setShown(false);
46
+ }
47
+ });
48
+ return { shown, scrollToTop: () => startScroll(0) };
49
+ }
50
+ //# sourceMappingURL=useBackToTopButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBackToTopButton.js","sourceRoot":"","sources":["../../src/hooks/useBackToTopButton.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACvC,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAC,iBAAiB,EAAC,MAAM,4BAA4B,CAAC;AAE7D,kDAAkD;AAClD,MAAM,UAAU,kBAAkB,CAAC,EACjC,SAAS,GAQV;IAYC,MAAM,CA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* 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 { RefObject } from 'react';
8
+ export declare function useCodeWordWrap(): {
9
+ readonly codeBlockRef: RefObject<HTMLPreElement>;
10
+ readonly isEnabled: boolean;
11
+ readonly isCodeScrollable: boolean;
12
+ readonly toggle: () => void;
13
+ };
14
+ //# sourceMappingURL=useCodeWordWrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCodeWordWrap.d.ts","sourceRoot":"","sources":["../../src/hooks/useCodeWordWrap.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAGrC,wBAAgB,eAAe,IAAI;IACjC,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IACjD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;CAC7B,CAwCA"}
@@ -0,0 +1,41 @@
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 { useState, useCallback, useEffect, useRef } from 'react';
8
+ export function useCodeWordWrap() {
9
+ const [isEnabled, setIsEnabled] = useState(false);
10
+ const [isCodeScrollable, setIsCodeScrollable] = useState(false);
11
+ const codeBlockRef = useRef(null);
12
+ const toggle = useCallback(() => {
13
+ const codeElement = codeBlockRef.current.querySelector('code');
14
+ if (isEnabled) {
15
+ codeElement.removeAttribute('style');
16
+ }
17
+ else {
18
+ codeElement.style.whiteSpace = 'pre-wrap';
19
+ }
20
+ setIsEnabled((value) => !value);
21
+ }, [codeBlockRef, isEnabled]);
22
+ const updateCodeIsScrollable = useCallback(() => {
23
+ const { scrollWidth, clientWidth } = codeBlockRef.current;
24
+ const isScrollable = scrollWidth > clientWidth ||
25
+ codeBlockRef.current.querySelector('code').hasAttribute('style');
26
+ setIsCodeScrollable(isScrollable);
27
+ }, [codeBlockRef]);
28
+ useEffect(() => {
29
+ updateCodeIsScrollable();
30
+ }, [isEnabled, updateCodeIsScrollable]);
31
+ useEffect(() => {
32
+ window.addEventListener('resize', updateCodeIsScrollable, {
33
+ passive: true,
34
+ });
35
+ return () => {
36
+ window.removeEventListener('resize', updateCodeIsScrollable);
37
+ };
38
+ }, [updateCodeIsScrollable]);
39
+ return { codeBlockRef, isEnabled, isCodeScrollable, toggle };
40
+ }
41
+ //# sourceMappingURL=useCodeWordWrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCodeWordWrap.js","sourceRoot":"","sources":["../../src/hooks/useCodeWordWrap.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AAE/D,MAAM,UAAU,eAAe;IAM7B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IACzE,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAElD,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,MAAM,WAAW,GAAG,YAAY,CAAC,OAAQ,CAAC,aAAa,CAAC,MAAM,CAAE,CAAC;QAEjE,IAAI,SAAS,EAAE;YACb,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;SACtC;aAAM;YACL,WAAW,CAAC,KAAK,CAAC,UAAU,GAAG,UAAU,CAAC;SAC3C;QAED,YAAY,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC;IAE9B,MAAM,sBAAsB,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9C,MAAM,EAAC,WAAW,EAAE,WAAW,EAAC,GAAG,YAAY,CAAC,OAAQ,CAAC;QACzD,MAAM,YAAY,GAChB,WAAW,GAAG,WAAW;YACzB,YAAY,CAAC,OAAQ,CAAC,aAAa,CAAC,MAAM,CAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACrE,mBAAmB,CAAC,YAAY,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,SAAS,CAAC,GAAG,EAAE;QACb,sBAAsB,EAAE,CAAC;IAC3B,CAAC,EAAE,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC,CAAC;IAExC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,sBAAsB,EAAE;YACxD,OAAO,EAAE,IAAI;SACd,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,sBAAsB,CAAC,CAAC;QAC/D,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAE7B,OAAO,EAAC,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,EAAC,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ /**
8
+ * Wires the imperative logic of a hideable navbar.
9
+ * @param hideOnScroll If `false`, this hook is basically a no-op.
10
+ */
11
+ export declare function useHideableNavbar(hideOnScroll: boolean): {
12
+ /** A ref to the navbar component. Plug this into the actual element. */
13
+ readonly navbarRef: (node: HTMLElement | null) => void;
14
+ /** If `false`, the navbar component should not be rendered. */
15
+ readonly isNavbarVisible: boolean;
16
+ };
17
+ //# sourceMappingURL=useHideableNavbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHideableNavbar.d.ts","sourceRoot":"","sources":["../../src/hooks/useHideableNavbar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,OAAO,GAAG;IACxD,wEAAwE;IACxE,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACvD,+DAA+D;IAC/D,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;CACnC,CAsDA"}
@@ -0,0 +1,60 @@
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 { useState, useCallback, useRef } from 'react';
8
+ import { useLocationChange } from '../utils/useLocationChange';
9
+ import { useScrollPosition } from '../utils/scrollUtils';
10
+ /**
11
+ * Wires the imperative logic of a hideable navbar.
12
+ * @param hideOnScroll If `false`, this hook is basically a no-op.
13
+ */
14
+ export function useHideableNavbar(hideOnScroll) {
15
+ const [isNavbarVisible, setIsNavbarVisible] = useState(hideOnScroll);
16
+ const isFocusedAnchor = useRef(false);
17
+ const navbarHeight = useRef(0);
18
+ const navbarRef = useCallback((node) => {
19
+ if (node !== null) {
20
+ navbarHeight.current = node.getBoundingClientRect().height;
21
+ }
22
+ }, []);
23
+ useScrollPosition(({ scrollY: scrollTop }, lastPosition) => {
24
+ if (!hideOnScroll) {
25
+ return;
26
+ }
27
+ // Needed mostly for handling rubber band scrolling.
28
+ // See https://github.com/facebook/docusaurus/pull/5721
29
+ if (scrollTop < navbarHeight.current) {
30
+ setIsNavbarVisible(true);
31
+ return;
32
+ }
33
+ if (isFocusedAnchor.current) {
34
+ isFocusedAnchor.current = false;
35
+ return;
36
+ }
37
+ const lastScrollTop = lastPosition?.scrollY;
38
+ const documentHeight = document.documentElement.scrollHeight - navbarHeight.current;
39
+ const windowHeight = window.innerHeight;
40
+ if (lastScrollTop && scrollTop >= lastScrollTop) {
41
+ setIsNavbarVisible(false);
42
+ }
43
+ else if (scrollTop + windowHeight < documentHeight) {
44
+ setIsNavbarVisible(true);
45
+ }
46
+ });
47
+ useLocationChange((locationChangeEvent) => {
48
+ if (!hideOnScroll) {
49
+ return;
50
+ }
51
+ if (locationChangeEvent.location.hash) {
52
+ isFocusedAnchor.current = true;
53
+ setIsNavbarVisible(false);
54
+ return;
55
+ }
56
+ setIsNavbarVisible(true);
57
+ });
58
+ return { navbarRef, isNavbarVisible };
59
+ }
60
+ //# sourceMappingURL=useHideableNavbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHideableNavbar.js","sourceRoot":"","sources":["../../src/hooks/useHideableNavbar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AACpD,OAAO,EAAC,iBAAiB,EAAC,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAEvD;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,YAAqB;IAMrD,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;IACrE,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,IAAwB,EAAE,EAAE;QACzD,IAAI,IAAI,KAAK,IAAI,EAAE;YACjB,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAA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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 './styles.css';
8
+ export declare const keyboardFocusedClassName = "navigation-with-keyboard";
9
+ /**
10
+ * Side-effect that adds the `keyboardFocusedClassName` to the body element when
11
+ * the keyboard has been pressed, or removes it when the mouse is clicked.
12
+ *
13
+ * The presence of this class name signals that the user may be using keyboard
14
+ * for navigation, and the theme **must** add focus outline when this class name
15
+ * is present. (And optionally not if it's absent, for design purposes)
16
+ *
17
+ * Inspired by https://hackernoon.com/removing-that-ugly-focus-ring-and-keeping-it-too-6c8727fefcd2
18
+ */
19
+ export declare function useKeyboardNavigation(): void;
20
+ //# sourceMappingURL=useKeyboardNavigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useKeyboardNavigation.d.ts","sourceRoot":"","sources":["../../src/hooks/useKeyboardNavigation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,cAAc,CAAC;AAEtB,eAAO,MAAM,wBAAwB,6BAA6B,CAAC;AAEnE;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAqB5C"}
@@ -0,0 +1,39 @@
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 } from 'react';
8
+ import './styles.css';
9
+ export const keyboardFocusedClassName = 'navigation-with-keyboard';
10
+ /**
11
+ * Side-effect that adds the `keyboardFocusedClassName` to the body element when
12
+ * the keyboard has been pressed, or removes it when the mouse is clicked.
13
+ *
14
+ * The presence of this class name signals that the user may be using keyboard
15
+ * for navigation, and the theme **must** add focus outline when this class name
16
+ * is present. (And optionally not if it's absent, for design purposes)
17
+ *
18
+ * Inspired by https://hackernoon.com/removing-that-ugly-focus-ring-and-keeping-it-too-6c8727fefcd2
19
+ */
20
+ export function useKeyboardNavigation() {
21
+ useEffect(() => {
22
+ function handleOutlineStyles(e) {
23
+ if (e.type === 'keydown' && e.key === 'Tab') {
24
+ document.body.classList.add(keyboardFocusedClassName);
25
+ }
26
+ if (e.type === 'mousedown') {
27
+ document.body.classList.remove(keyboardFocusedClassName);
28
+ }
29
+ }
30
+ document.addEventListener('keydown', handleOutlineStyles);
31
+ document.addEventListener('mousedown', handleOutlineStyles);
32
+ return () => {
33
+ document.body.classList.remove(keyboardFocusedClassName);
34
+ document.removeEventListener('keydown', handleOutlineStyles);
35
+ document.removeEventListener('mousedown', handleOutlineStyles);
36
+ };
37
+ }, []);
38
+ }
39
+ //# sourceMappingURL=useKeyboardNavigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useKeyboardNavigation.js","sourceRoot":"","sources":["../../src/hooks/useKeyboardNavigation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAEhC,OAAO,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,CAAC;AAEnE;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB;IACnC,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,mBAAmB,CAAC,CAA6B;YACxD,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,IAAK,CAAmB,CAAC,GAAG,KAAK,KAAK,EAAE;gBAC9D,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;aACvD;YAED,IAAI,CAAC,CAAC,IAAI,KAAK,WAAW,EAAE;gBAC1B,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC;aAC1D;QACH,CAAC;QAED,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC;QAC1D,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;QAE5D,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC;YACzD,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC;YAC7D,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;QACjE,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ /**
8
+ * Side-effect that locks the document body's scroll throughout the lifetime of
9
+ * the containing component. e.g. when the mobile sidebar is expanded.
10
+ */
11
+ export declare function useLockBodyScroll(lock?: boolean): void;
12
+ //# sourceMappingURL=useLockBodyScroll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLockBodyScroll.d.ts","sourceRoot":"","sources":["../../src/hooks/useLockBodyScroll.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,OAAc,GAAG,IAAI,CAO5D"}
@@ -0,0 +1,20 @@
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 } from 'react';
8
+ /**
9
+ * Side-effect that locks the document body's scroll throughout the lifetime of
10
+ * the containing component. e.g. when the mobile sidebar is expanded.
11
+ */
12
+ export function useLockBodyScroll(lock = true) {
13
+ useEffect(() => {
14
+ document.body.style.overflow = lock ? 'hidden' : 'visible';
15
+ return () => {
16
+ document.body.style.overflow = 'visible';
17
+ };
18
+ }, [lock]);
19
+ }
20
+ //# sourceMappingURL=useLockBodyScroll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLockBodyScroll.js","sourceRoot":"","sources":["../../src/hooks/useLockBodyScroll.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAEhC;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAgB,IAAI;IACpD,SAAS,CAAC,GAAG,EAAE;QACb,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3D,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC3C,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AACb,CAAC"}
@@ -0,0 +1,13 @@
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 { PrismTheme } from 'prism-react-renderer';
8
+ /**
9
+ * Returns a color-mode-dependent Prism theme: whatever the user specified in
10
+ * the config. Falls back to `palenight`.
11
+ */
12
+ export declare function usePrismTheme(): PrismTheme;
13
+ //# sourceMappingURL=usePrismTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePrismTheme.d.ts","sourceRoot":"","sources":["../../src/hooks/usePrismTheme.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAIrD;;;GAGG;AACH,wBAAgB,aAAa,IAAI,UAAU,CAQ1C"}