@docusaurus/theme-common 2.0.0-beta.17 → 2.0.0-beta.18
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.
- package/lib/components/Collapsible/index.d.ts +32 -4
- package/lib/components/Collapsible/index.d.ts.map +1 -1
- package/lib/components/Collapsible/index.js +12 -3
- package/lib/components/Collapsible/index.js.map +1 -1
- package/lib/components/Details/index.d.ts +6 -1
- package/lib/components/Details/index.d.ts.map +1 -1
- package/lib/components/Details/index.js +8 -4
- package/lib/components/Details/index.js.map +1 -1
- package/lib/{utils/announcementBarUtils.d.ts → contexts/announcementBar.d.ts} +7 -3
- package/lib/contexts/announcementBar.d.ts.map +1 -0
- package/lib/{utils/announcementBarUtils.js → contexts/announcementBar.js} +11 -11
- package/lib/contexts/announcementBar.js.map +1 -0
- package/lib/{utils/colorModeUtils.d.ts → contexts/colorMode.d.ts} +12 -3
- package/lib/contexts/colorMode.d.ts.map +1 -0
- package/lib/contexts/colorMode.js +114 -0
- package/lib/contexts/colorMode.js.map +1 -0
- package/lib/contexts/docSidebarItemsExpandedState.d.ts +31 -0
- package/lib/contexts/docSidebarItemsExpandedState.d.ts.map +1 -0
- package/lib/{utils → contexts}/docSidebarItemsExpandedState.js +9 -4
- package/lib/contexts/docSidebarItemsExpandedState.js.map +1 -0
- package/lib/contexts/docsPreferredVersion.d.ts +28 -0
- package/lib/contexts/docsPreferredVersion.d.ts.map +1 -0
- package/lib/contexts/docsPreferredVersion.js +125 -0
- package/lib/contexts/docsPreferredVersion.js.map +1 -0
- package/lib/contexts/docsSidebar.d.ts +20 -0
- package/lib/contexts/docsSidebar.d.ts.map +1 -0
- package/lib/contexts/docsSidebar.js +29 -0
- package/lib/contexts/docsSidebar.js.map +1 -0
- package/lib/contexts/docsVersion.d.ts +20 -0
- package/lib/contexts/docsVersion.d.ts.map +1 -0
- package/lib/contexts/docsVersion.js +26 -0
- package/lib/contexts/docsVersion.js.map +1 -0
- package/lib/contexts/navbarMobileSidebar.d.ts +31 -0
- package/lib/contexts/navbarMobileSidebar.d.ts.map +1 -0
- package/lib/contexts/navbarMobileSidebar.js +56 -0
- package/lib/contexts/navbarMobileSidebar.js.map +1 -0
- package/lib/contexts/navbarSecondaryMenu.d.ts +38 -0
- package/lib/contexts/navbarSecondaryMenu.d.ts.map +1 -0
- package/lib/contexts/navbarSecondaryMenu.js +93 -0
- package/lib/contexts/navbarSecondaryMenu.js.map +1 -0
- package/lib/{utils/tabGroupChoiceUtils.d.ts → contexts/tabGroupChoice.d.ts} +5 -3
- package/lib/contexts/tabGroupChoice.d.ts.map +1 -0
- package/lib/{utils/tabGroupChoiceUtils.js → contexts/tabGroupChoice.js} +14 -20
- package/lib/contexts/tabGroupChoice.js.map +1 -0
- package/lib/hooks/useHideableNavbar.d.ts +7 -3
- package/lib/hooks/useHideableNavbar.d.ts.map +1 -1
- package/lib/hooks/useHideableNavbar.js +8 -6
- package/lib/hooks/useHideableNavbar.js.map +1 -1
- package/lib/hooks/useKeyboardNavigation.d.ts +11 -1
- package/lib/hooks/useKeyboardNavigation.d.ts.map +1 -1
- package/lib/hooks/useKeyboardNavigation.js +11 -3
- package/lib/hooks/useKeyboardNavigation.js.map +1 -1
- package/lib/hooks/useLockBodyScroll.d.ts +5 -1
- package/lib/hooks/useLockBodyScroll.d.ts.map +1 -1
- package/lib/hooks/useLockBodyScroll.js +5 -1
- package/lib/hooks/useLockBodyScroll.js.map +1 -1
- package/lib/hooks/usePrismTheme.d.ts +5 -1
- package/lib/hooks/usePrismTheme.d.ts.map +1 -1
- package/lib/hooks/usePrismTheme.js +8 -4
- package/lib/hooks/usePrismTheme.js.map +1 -1
- package/lib/hooks/useSearchPage.d.ts +15 -4
- package/lib/hooks/useSearchPage.d.ts.map +1 -1
- package/lib/hooks/useSearchPage.js +3 -2
- package/lib/hooks/useSearchPage.js.map +1 -1
- package/lib/hooks/useTOCHighlight.d.ts +25 -0
- package/lib/hooks/useTOCHighlight.d.ts.map +1 -0
- package/lib/{utils → hooks}/useTOCHighlight.js +13 -9
- package/lib/hooks/useTOCHighlight.js.map +1 -0
- package/lib/hooks/useWindowSize.d.ts +14 -1
- package/lib/hooks/useWindowSize.d.ts.map +1 -1
- package/lib/hooks/useWindowSize.js +14 -11
- package/lib/hooks/useWindowSize.js.map +1 -1
- package/lib/index.d.ts +26 -30
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +26 -24
- package/lib/index.js.map +1 -1
- package/lib/utils/ThemeClassNames.d.ts +7 -0
- package/lib/utils/ThemeClassNames.d.ts.map +1 -1
- package/lib/utils/ThemeClassNames.js +7 -4
- package/lib/utils/ThemeClassNames.js.map +1 -1
- package/lib/utils/codeBlockUtils.d.ts +25 -2
- package/lib/utils/codeBlockUtils.d.ts.map +1 -1
- package/lib/utils/codeBlockUtils.js +36 -35
- package/lib/utils/codeBlockUtils.js.map +1 -1
- package/lib/utils/docsUtils.d.ts +25 -18
- package/lib/utils/docsUtils.d.ts.map +1 -1
- package/lib/utils/docsUtils.js +38 -56
- package/lib/utils/docsUtils.js.map +1 -1
- package/lib/utils/footerUtils.d.ts +13 -0
- package/lib/utils/footerUtils.d.ts.map +1 -0
- package/lib/utils/footerUtils.js +14 -0
- package/lib/utils/footerUtils.js.map +1 -0
- package/lib/utils/generalUtils.d.ts +4 -1
- package/lib/utils/generalUtils.d.ts.map +1 -1
- package/lib/utils/generalUtils.js +6 -3
- package/lib/utils/generalUtils.js.map +1 -1
- package/lib/utils/historyUtils.d.ts +1 -7
- package/lib/utils/historyUtils.d.ts.map +1 -1
- package/lib/utils/historyUtils.js +10 -13
- package/lib/utils/historyUtils.js.map +1 -1
- package/lib/utils/jsUtils.d.ts +1 -1
- package/lib/utils/jsUtils.js +1 -1
- package/lib/utils/metadataUtils.d.ts +38 -0
- package/lib/utils/metadataUtils.d.ts.map +1 -0
- package/lib/utils/metadataUtils.js +61 -0
- package/lib/utils/metadataUtils.js.map +1 -0
- package/lib/utils/navbarUtils.d.ts +21 -0
- package/lib/utils/navbarUtils.d.ts.map +1 -0
- package/lib/utils/navbarUtils.js +30 -0
- package/lib/utils/navbarUtils.js.map +1 -0
- package/lib/utils/reactUtils.d.ts +16 -5
- package/lib/utils/reactUtils.d.ts.map +1 -1
- package/lib/utils/reactUtils.js +28 -7
- package/lib/utils/reactUtils.js.map +1 -1
- package/lib/utils/regexpUtils.d.ts +2 -1
- package/lib/utils/regexpUtils.d.ts.map +1 -1
- package/lib/utils/regexpUtils.js +2 -1
- package/lib/utils/regexpUtils.js.map +1 -1
- package/lib/utils/routesUtils.d.ts +14 -2
- package/lib/utils/routesUtils.d.ts.map +1 -1
- package/lib/utils/routesUtils.js +20 -7
- package/lib/utils/routesUtils.js.map +1 -1
- package/lib/utils/scrollUtils.d.ts +32 -26
- package/lib/utils/scrollUtils.d.ts.map +1 -1
- package/lib/utils/scrollUtils.js +30 -17
- package/lib/utils/scrollUtils.js.map +1 -1
- package/lib/utils/searchUtils.d.ts +12 -0
- package/lib/utils/searchUtils.d.ts.map +1 -1
- package/lib/utils/searchUtils.js +34 -0
- package/lib/utils/searchUtils.js.map +1 -1
- package/lib/utils/storageUtils.d.ts +10 -7
- package/lib/utils/storageUtils.d.ts.map +1 -1
- package/lib/utils/storageUtils.js +20 -12
- package/lib/utils/storageUtils.js.map +1 -1
- package/lib/utils/tagsUtils.d.ts +5 -2
- package/lib/utils/tagsUtils.d.ts.map +1 -1
- package/lib/utils/tagsUtils.js +7 -4
- package/lib/utils/tagsUtils.js.map +1 -1
- package/lib/utils/tocUtils.d.ts +16 -0
- package/lib/utils/tocUtils.d.ts.map +1 -1
- package/lib/utils/tocUtils.js +17 -6
- package/lib/utils/tocUtils.js.map +1 -1
- package/lib/utils/useAlternatePageUtils.d.ts +20 -1
- package/lib/utils/useAlternatePageUtils.d.ts.map +1 -1
- package/lib/utils/useAlternatePageUtils.js +6 -3
- package/lib/utils/useAlternatePageUtils.js.map +1 -1
- package/lib/utils/useLocalPathname.d.ts +5 -0
- package/lib/utils/useLocalPathname.d.ts.map +1 -1
- package/lib/utils/useLocalPathname.js +6 -4
- package/lib/utils/useLocalPathname.js.map +1 -1
- package/lib/utils/useLocationChange.d.ts +7 -5
- package/lib/utils/useLocationChange.d.ts.map +1 -1
- package/lib/utils/useLocationChange.js +6 -2
- package/lib/utils/useLocationChange.js.map +1 -1
- package/lib/utils/usePluralForm.d.ts +11 -0
- package/lib/utils/usePluralForm.d.ts.map +1 -1
- package/lib/utils/usePluralForm.js +19 -24
- package/lib/utils/usePluralForm.js.map +1 -1
- package/lib/utils/useThemeConfig.d.ts +21 -11
- package/lib/utils/useThemeConfig.d.ts.map +1 -1
- package/lib/utils/useThemeConfig.js +3 -0
- package/lib/utils/useThemeConfig.js.map +1 -1
- package/package.json +8 -9
- package/src/components/Collapsible/index.tsx +40 -22
- package/src/components/Details/index.tsx +11 -6
- package/src/{utils/announcementBarUtils.tsx → contexts/announcementBar.tsx} +17 -18
- package/src/contexts/colorMode.tsx +176 -0
- package/src/contexts/docSidebarItemsExpandedState.tsx +55 -0
- package/src/contexts/docsPreferredVersion.tsx +250 -0
- package/src/contexts/docsSidebar.tsx +42 -0
- package/src/contexts/docsVersion.tsx +36 -0
- package/src/contexts/navbarMobileSidebar.tsx +99 -0
- package/src/contexts/navbarSecondaryMenu.tsx +170 -0
- package/src/{utils/tabGroupChoiceUtils.tsx → contexts/tabGroupChoice.tsx} +21 -28
- package/src/hooks/useHideableNavbar.ts +11 -11
- package/src/hooks/useKeyboardNavigation.ts +11 -3
- package/src/hooks/useLockBodyScroll.ts +5 -2
- package/src/hooks/usePrismTheme.ts +8 -4
- package/src/hooks/useSearchPage.ts +18 -5
- package/src/{utils → hooks}/useTOCHighlight.ts +21 -12
- package/src/hooks/useWindowSize.ts +14 -12
- package/src/index.ts +68 -56
- package/src/utils/ThemeClassNames.ts +10 -6
- package/src/utils/codeBlockUtils.ts +49 -47
- package/src/utils/docsUtils.tsx +48 -99
- package/src/utils/footerUtils.ts +18 -0
- package/src/utils/generalUtils.ts +6 -3
- package/src/utils/historyUtils.ts +11 -17
- package/src/utils/jsUtils.ts +1 -1
- package/src/utils/metadataUtils.tsx +115 -0
- package/src/utils/navbarUtils.tsx +40 -0
- package/src/utils/reactUtils.tsx +31 -8
- package/src/utils/regexpUtils.ts +2 -1
- package/src/utils/routesUtils.ts +27 -8
- package/src/utils/scrollUtils.tsx +44 -45
- package/src/utils/searchUtils.ts +49 -0
- package/src/utils/storageUtils.ts +21 -13
- package/src/utils/tagsUtils.ts +14 -7
- package/src/utils/tocUtils.ts +18 -7
- package/src/utils/useAlternatePageUtils.ts +17 -5
- package/src/utils/useLocalPathname.ts +6 -4
- package/src/utils/useLocationChange.ts +12 -10
- package/src/utils/usePluralForm.ts +27 -24
- package/src/utils/useThemeConfig.ts +16 -11
- package/lib/utils/announcementBarUtils.d.ts.map +0 -1
- package/lib/utils/announcementBarUtils.js.map +0 -1
- package/lib/utils/colorModeUtils.d.ts.map +0 -1
- package/lib/utils/colorModeUtils.js +0 -107
- package/lib/utils/colorModeUtils.js.map +0 -1
- package/lib/utils/docSidebarItemsExpandedState.d.ts +0 -17
- package/lib/utils/docSidebarItemsExpandedState.d.ts.map +0 -1
- package/lib/utils/docSidebarItemsExpandedState.js.map +0 -1
- package/lib/utils/docsPreferredVersion/DocsPreferredVersionProvider.d.ts +0 -22
- package/lib/utils/docsPreferredVersion/DocsPreferredVersionProvider.d.ts.map +0 -1
- package/lib/utils/docsPreferredVersion/DocsPreferredVersionProvider.js +0 -92
- package/lib/utils/docsPreferredVersion/DocsPreferredVersionProvider.js.map +0 -1
- package/lib/utils/docsPreferredVersion/DocsPreferredVersionStorage.d.ts +0 -14
- package/lib/utils/docsPreferredVersion/DocsPreferredVersionStorage.d.ts.map +0 -1
- package/lib/utils/docsPreferredVersion/DocsPreferredVersionStorage.js +0 -19
- package/lib/utils/docsPreferredVersion/DocsPreferredVersionStorage.js.map +0 -1
- package/lib/utils/docsPreferredVersion/useDocsPreferredVersion.d.ts +0 -14
- package/lib/utils/docsPreferredVersion/useDocsPreferredVersion.d.ts.map +0 -1
- package/lib/utils/docsPreferredVersion/useDocsPreferredVersion.js +0 -41
- package/lib/utils/docsPreferredVersion/useDocsPreferredVersion.js.map +0 -1
- package/lib/utils/mobileSecondaryMenu.d.ts +0 -21
- package/lib/utils/mobileSecondaryMenu.d.ts.map +0 -1
- package/lib/utils/mobileSecondaryMenu.js +0 -51
- package/lib/utils/mobileSecondaryMenu.js.map +0 -1
- package/lib/utils/pathUtils.d.ts +0 -8
- package/lib/utils/pathUtils.d.ts.map +0 -1
- package/lib/utils/pathUtils.js +0 -14
- package/lib/utils/pathUtils.js.map +0 -1
- package/lib/utils/tabGroupChoiceUtils.d.ts.map +0 -1
- package/lib/utils/tabGroupChoiceUtils.js.map +0 -1
- package/lib/utils/useContextualSearchFilters.d.ts +0 -12
- package/lib/utils/useContextualSearchFilters.d.ts.map +0 -1
- package/lib/utils/useContextualSearchFilters.js +0 -36
- package/lib/utils/useContextualSearchFilters.js.map +0 -1
- package/lib/utils/usePrevious.d.ts +0 -8
- package/lib/utils/usePrevious.d.ts.map +0 -1
- package/lib/utils/usePrevious.js +0 -16
- package/lib/utils/usePrevious.js.map +0 -1
- package/lib/utils/useTOCHighlight.d.ts +0 -14
- package/lib/utils/useTOCHighlight.d.ts.map +0 -1
- package/lib/utils/useTOCHighlight.js.map +0 -1
- package/src/utils/colorModeUtils.tsx +0 -158
- package/src/utils/docSidebarItemsExpandedState.tsx +0 -40
- package/src/utils/docsPreferredVersion/DocsPreferredVersionProvider.tsx +0 -166
- package/src/utils/docsPreferredVersion/DocsPreferredVersionStorage.ts +0 -33
- package/src/utils/docsPreferredVersion/useDocsPreferredVersion.ts +0 -70
- package/src/utils/mobileSecondaryMenu.tsx +0 -114
- package/src/utils/pathUtils.ts +0 -19
- package/src/utils/useContextualSearchFilters.ts +0 -53
- package/src/utils/usePrevious.ts +0 -19
package/lib/utils/jsUtils.js
CHANGED
|
@@ -18,7 +18,7 @@ export function duplicates(arr, comparator = (a, b) => a === b) {
|
|
|
18
18
|
return arr.filter((v, vIndex) => arr.findIndex((u) => comparator(u, v)) !== vIndex);
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
* Remove duplicate array items (similar to _.uniq)
|
|
21
|
+
* Remove duplicate array items (similar to `_.uniq`)
|
|
22
22
|
* @param arr The array.
|
|
23
23
|
* @returns An array with duplicate elements removed by reference comparison.
|
|
24
24
|
*/
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
interface PageMetadataProps {
|
|
9
|
+
readonly title?: string;
|
|
10
|
+
readonly description?: string;
|
|
11
|
+
readonly keywords?: readonly string[] | string;
|
|
12
|
+
readonly image?: string;
|
|
13
|
+
readonly children?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Helper component to manipulate page metadata and override site defaults.
|
|
17
|
+
* Works in the same way as Helmet.
|
|
18
|
+
*/
|
|
19
|
+
export declare function PageMetadata({ title, description, keywords, image, children, }: PageMetadataProps): JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Every layer of this provider will append a class name to the HTML element.
|
|
22
|
+
* There's no consumer for this hook: it's side-effect-only. This wrapper is
|
|
23
|
+
* necessary because Helmet does not "merge" classes.
|
|
24
|
+
* @see https://github.com/staylor/react-helmet-async/issues/161
|
|
25
|
+
*/
|
|
26
|
+
export declare function HtmlClassNameProvider({ className: classNameProp, children, }: {
|
|
27
|
+
className: string;
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
}): JSX.Element;
|
|
30
|
+
/**
|
|
31
|
+
* A very thin wrapper around `HtmlClassNameProvider` that adds the plugin ID +
|
|
32
|
+
* name to the HTML class name.
|
|
33
|
+
*/
|
|
34
|
+
export declare function PluginHtmlClassNameProvider({ children, }: {
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
}): JSX.Element;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=metadataUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadataUtils.d.ts","sourceRoot":"","sources":["../../src/utils/metadataUtils.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAc,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAO5C,UAAU,iBAAiB;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAAC;IAC/C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,WAAW,EACX,QAAQ,EACR,KAAK,EACL,QAAQ,GACT,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CA6BjC;AAID;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EAAE,aAAa,EACxB,QAAQ,GACT,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CAWd;AASD;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CASd"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import Head from '@docusaurus/Head';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
import useRouteContext from '@docusaurus/useRouteContext';
|
|
11
|
+
import { useBaseUrlUtils } from '@docusaurus/useBaseUrl';
|
|
12
|
+
import { useTitleFormatter } from './generalUtils';
|
|
13
|
+
/**
|
|
14
|
+
* Helper component to manipulate page metadata and override site defaults.
|
|
15
|
+
* Works in the same way as Helmet.
|
|
16
|
+
*/
|
|
17
|
+
export function PageMetadata({ title, description, keywords, image, children, }) {
|
|
18
|
+
const pageTitle = useTitleFormatter(title);
|
|
19
|
+
const { withBaseUrl } = useBaseUrlUtils();
|
|
20
|
+
const pageImage = image ? withBaseUrl(image, { absolute: true }) : undefined;
|
|
21
|
+
return (React.createElement(Head, null,
|
|
22
|
+
title && React.createElement("title", null, pageTitle),
|
|
23
|
+
title && React.createElement("meta", { property: "og:title", content: pageTitle }),
|
|
24
|
+
description && React.createElement("meta", { name: "description", content: description }),
|
|
25
|
+
description && React.createElement("meta", { property: "og:description", content: description }),
|
|
26
|
+
keywords && (React.createElement("meta", { name: "keywords", content:
|
|
27
|
+
// https://github.com/microsoft/TypeScript/issues/17002
|
|
28
|
+
(Array.isArray(keywords) ? keywords.join(',') : keywords) })),
|
|
29
|
+
pageImage && React.createElement("meta", { property: "og:image", content: pageImage }),
|
|
30
|
+
pageImage && React.createElement("meta", { name: "twitter:image", content: pageImage }),
|
|
31
|
+
children));
|
|
32
|
+
}
|
|
33
|
+
const HtmlClassNameContext = React.createContext(undefined);
|
|
34
|
+
/**
|
|
35
|
+
* Every layer of this provider will append a class name to the HTML element.
|
|
36
|
+
* There's no consumer for this hook: it's side-effect-only. This wrapper is
|
|
37
|
+
* necessary because Helmet does not "merge" classes.
|
|
38
|
+
* @see https://github.com/staylor/react-helmet-async/issues/161
|
|
39
|
+
*/
|
|
40
|
+
export function HtmlClassNameProvider({ className: classNameProp, children, }) {
|
|
41
|
+
const classNameContext = React.useContext(HtmlClassNameContext);
|
|
42
|
+
const className = clsx(classNameContext, classNameProp);
|
|
43
|
+
return (React.createElement(HtmlClassNameContext.Provider, { value: className },
|
|
44
|
+
React.createElement(Head, null,
|
|
45
|
+
React.createElement("html", { className: className })),
|
|
46
|
+
children));
|
|
47
|
+
}
|
|
48
|
+
function pluginNameToClassName(pluginName) {
|
|
49
|
+
return `plugin-${pluginName.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi, '')}`;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A very thin wrapper around `HtmlClassNameProvider` that adds the plugin ID +
|
|
53
|
+
* name to the HTML class name.
|
|
54
|
+
*/
|
|
55
|
+
export function PluginHtmlClassNameProvider({ children, }) {
|
|
56
|
+
const routeContext = useRouteContext();
|
|
57
|
+
const nameClass = pluginNameToClassName(routeContext.plugin.name);
|
|
58
|
+
const idClass = `plugin-id-${routeContext.plugin.id}`;
|
|
59
|
+
return (React.createElement(HtmlClassNameProvider, { className: clsx(nameClass, idClass) }, children));
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=metadataUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadataUtils.js","sourceRoot":"","sources":["../../src/utils/metadataUtils.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,eAAe,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAUjD;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,KAAK,EACL,WAAW,EACX,QAAQ,E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S,GAAG,IAAI,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;IACxD,OAAO,CACL,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,SAAS;QAC7C,oBAAC,IAAI;YACH,8BAAM,SAAS,EAAE,SAAS,GAAI,CACzB;QACN,QAAQ,CACqB,CACjC,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,UAAkB;IAC/C,OAAO,UAAU,UAAU,CAAC,OAAO,CACjC,6CAA6C,EAC7C,EAAE,CACH,EAAE,CAAC;AACN,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,EAC1C,QAAQ,GAGT;IACC,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,MAAM,SAAS,GAAG,qBAAqB,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClE,MAAM,OAAO,GAAG,aAAa,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;IACtD,OAAO,CACL,oBAAC,qBAAqB,IAAC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,IACvD,QAAQ,CACa,CACzB,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
|
+
/**
|
|
9
|
+
* Split links by left/right. If position is unspecified, fallback to right.
|
|
10
|
+
*/
|
|
11
|
+
export declare function splitNavbarItems<T extends {
|
|
12
|
+
position?: 'left' | 'right';
|
|
13
|
+
}>(items: T[]): [leftItems: T[], rightItems: T[]];
|
|
14
|
+
/**
|
|
15
|
+
* Composes the `NavbarMobileSidebarProvider` and `NavbarSecondaryMenuProvider`.
|
|
16
|
+
* Because the latter depends on the former, they can't be re-ordered.
|
|
17
|
+
*/
|
|
18
|
+
export declare function NavbarProvider({ children }: {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}): JSX.Element;
|
|
21
|
+
//# sourceMappingURL=navbarUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navbarUtils.d.ts","sourceRoot":"","sources":["../../src/utils/navbarUtils.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAc,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAM5C;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAAC,EACtE,KAAK,EAAE,CAAC,EAAE,GACT,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CASnC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAC,QAAQ,EAAC,EAAE;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAC,GAAG,GAAG,CAAC,OAAO,CAM7E"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { NavbarMobileSidebarProvider } from '../contexts/navbarMobileSidebar';
|
|
9
|
+
import { NavbarSecondaryMenuProvider } from '../contexts/navbarSecondaryMenu';
|
|
10
|
+
const DefaultNavItemPosition = 'right';
|
|
11
|
+
/**
|
|
12
|
+
* Split links by left/right. If position is unspecified, fallback to right.
|
|
13
|
+
*/
|
|
14
|
+
export function splitNavbarItems(items) {
|
|
15
|
+
function isLeft(item) {
|
|
16
|
+
return (item.position ?? DefaultNavItemPosition) === 'left';
|
|
17
|
+
}
|
|
18
|
+
const leftItems = items.filter(isLeft);
|
|
19
|
+
const rightItems = items.filter((item) => !isLeft(item));
|
|
20
|
+
return [leftItems, rightItems];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Composes the `NavbarMobileSidebarProvider` and `NavbarSecondaryMenuProvider`.
|
|
24
|
+
* Because the latter depends on the former, they can't be re-ordered.
|
|
25
|
+
*/
|
|
26
|
+
export function NavbarProvider({ children }) {
|
|
27
|
+
return (React.createElement(NavbarMobileSidebarProvider, null,
|
|
28
|
+
React.createElement(NavbarSecondaryMenuProvider, null, children)));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=navbarUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navbarUtils.js","sourceRoot":"","sources":["../../src/utils/navbarUtils.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAC,2BAA2B,EAAC,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAC,2BAA2B,EAAC,MAAM,iCAAiC,CAAC;AAE5E,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAEvC;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAU;IAEV,SAAS,MAAM,CAAC,IAAO;QACrB,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,sBAAsB,CAAC,KAAK,MAAM,CAAC;IAC9D,CAAC;IAED,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAEzD,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AACjC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,EAAC,QAAQ,EAAwB;IAC9D,OAAO,CACL,oBAAC,2BAA2B;QAC1B,oBAAC,2BAA2B,QAAE,QAAQ,CAA+B,CACzC,CAC/B,CAAC;AACJ,CAAC"}
|
|
@@ -6,25 +6,36 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { useLayoutEffect } from 'react';
|
|
8
8
|
/**
|
|
9
|
-
* This hook is like useLayoutEffect
|
|
10
|
-
* It seems hacky but it's used in many React libs (Redux, Formik...)
|
|
9
|
+
* This hook is like `useLayoutEffect`, but without the SSR warning.
|
|
10
|
+
* It seems hacky but it's used in many React libs (Redux, Formik...).
|
|
11
11
|
* Also mentioned here: https://github.com/facebook/react/issues/16956
|
|
12
|
+
*
|
|
12
13
|
* It is useful when you need to update a ref as soon as possible after a React
|
|
13
|
-
* render (before `useEffect`)
|
|
14
|
+
* render (before `useEffect`).
|
|
14
15
|
*/
|
|
15
16
|
export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
|
|
16
17
|
/**
|
|
17
18
|
* Permits to transform an unstable callback (like an arrow function provided as
|
|
18
|
-
* props) to a "stable" callback that is safe to use in a useEffect dependency
|
|
19
|
+
* props) to a "stable" callback that is safe to use in a `useEffect` dependency
|
|
19
20
|
* array. Useful to avoid React stale closure problems + avoid useless effect
|
|
20
|
-
* re-executions
|
|
21
|
+
* re-executions.
|
|
21
22
|
*
|
|
22
23
|
* Workaround until the React team recommends a good solution, see
|
|
23
24
|
* https://github.com/facebook/react/issues/16956
|
|
25
|
+
*
|
|
24
26
|
* This generally works but has some potential drawbacks, such as
|
|
25
27
|
* https://github.com/facebook/react/issues/16956#issuecomment-536636418
|
|
26
28
|
*/
|
|
27
29
|
export declare function useDynamicCallback<T extends (...args: never[]) => unknown>(callback: T): T;
|
|
30
|
+
/**
|
|
31
|
+
* Gets `value` from the last render.
|
|
32
|
+
*/
|
|
33
|
+
export declare function usePrevious<T>(value: T): T | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* This error is thrown when a context is consumed outside its provider. Allows
|
|
36
|
+
* reusing a generic error message format and reduces bundle size. The hook's
|
|
37
|
+
* name will be extracted from its stack, so only the provider's name is needed.
|
|
38
|
+
*/
|
|
28
39
|
export declare class ReactContextError extends Error {
|
|
29
40
|
constructor(providerName: string, additionalInfo?: string);
|
|
30
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactUtils.d.ts","sourceRoot":"","sources":["../../src/utils/reactUtils.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAyB,eAAe,EAAS,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"reactUtils.d.ts","sourceRoot":"","sources":["../../src/utils/reactUtils.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAyB,eAAe,EAAS,MAAM,OAAO,CAAC;AAGtE;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,wBAEzB,CAAC;AAEd;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,EACxE,QAAQ,EAAE,CAAC,GACV,CAAC,CAUH;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAQtD;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,YAAY,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM;CAQ1D"}
|
package/lib/utils/reactUtils.js
CHANGED
|
@@ -5,22 +5,27 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import { useCallback, useEffect, useLayoutEffect, useRef } from 'react';
|
|
8
|
+
import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
|
|
8
9
|
/**
|
|
9
|
-
* This hook is like useLayoutEffect
|
|
10
|
-
* It seems hacky but it's used in many React libs (Redux, Formik...)
|
|
10
|
+
* This hook is like `useLayoutEffect`, but without the SSR warning.
|
|
11
|
+
* It seems hacky but it's used in many React libs (Redux, Formik...).
|
|
11
12
|
* Also mentioned here: https://github.com/facebook/react/issues/16956
|
|
13
|
+
*
|
|
12
14
|
* It is useful when you need to update a ref as soon as possible after a React
|
|
13
|
-
* render (before `useEffect`)
|
|
15
|
+
* render (before `useEffect`).
|
|
14
16
|
*/
|
|
15
|
-
export const useIsomorphicLayoutEffect =
|
|
17
|
+
export const useIsomorphicLayoutEffect = ExecutionEnvironment.canUseDOM
|
|
18
|
+
? useLayoutEffect
|
|
19
|
+
: useEffect;
|
|
16
20
|
/**
|
|
17
21
|
* Permits to transform an unstable callback (like an arrow function provided as
|
|
18
|
-
* props) to a "stable" callback that is safe to use in a useEffect dependency
|
|
22
|
+
* props) to a "stable" callback that is safe to use in a `useEffect` dependency
|
|
19
23
|
* array. Useful to avoid React stale closure problems + avoid useless effect
|
|
20
|
-
* re-executions
|
|
24
|
+
* re-executions.
|
|
21
25
|
*
|
|
22
26
|
* Workaround until the React team recommends a good solution, see
|
|
23
27
|
* https://github.com/facebook/react/issues/16956
|
|
28
|
+
*
|
|
24
29
|
* This generally works but has some potential drawbacks, such as
|
|
25
30
|
* https://github.com/facebook/react/issues/16956#issuecomment-536636418
|
|
26
31
|
*/
|
|
@@ -33,11 +38,27 @@ export function useDynamicCallback(callback) {
|
|
|
33
38
|
// but good enough for our use
|
|
34
39
|
return useCallback((...args) => ref.current(...args), []);
|
|
35
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Gets `value` from the last render.
|
|
43
|
+
*/
|
|
44
|
+
export function usePrevious(value) {
|
|
45
|
+
const ref = useRef();
|
|
46
|
+
useIsomorphicLayoutEffect(() => {
|
|
47
|
+
ref.current = value;
|
|
48
|
+
});
|
|
49
|
+
return ref.current;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* This error is thrown when a context is consumed outside its provider. Allows
|
|
53
|
+
* reusing a generic error message format and reduces bundle size. The hook's
|
|
54
|
+
* name will be extracted from its stack, so only the provider's name is needed.
|
|
55
|
+
*/
|
|
36
56
|
export class ReactContextError extends Error {
|
|
37
57
|
constructor(providerName, additionalInfo) {
|
|
38
58
|
super();
|
|
39
59
|
this.name = 'ReactContextError';
|
|
40
|
-
this.message = `Hook ${this.stack?.split('\n')[1]?.match(/at (?<name>\w+)/)?.groups
|
|
60
|
+
this.message = `Hook ${this.stack?.split('\n')[1]?.match(/at (?:\w+\.)?(?<name>\w+)/)?.groups
|
|
61
|
+
.name} is called outside the <${providerName}>. ${additionalInfo || ''}`;
|
|
41
62
|
}
|
|
42
63
|
}
|
|
43
64
|
//# sourceMappingURL=reactUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactUtils.js","sourceRoot":"","sources":["../../src/utils/reactUtils.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"reactUtils.js","sourceRoot":"","sources":["../../src/utils/reactUtils.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AACtE,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;AAEpE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,oBAAoB,CAAC,SAAS;IACrE,CAAC,CAAC,eAAe;IACjB,CAAC,CAAC,SAAS,CAAC;AAEd;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAChC,QAAW;IAEX,MAAM,GAAG,GAAG,MAAM,CAAI,QAAQ,CAAC,CAAC;IAEhC,yBAAyB,CAAC,GAAG,EAAE;QAC7B,GAAG,CAAC,OAAO,GAAG,QAAQ,CAAC;IACzB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,4EAA4E;IAC5E,8BAA8B;IAC9B,OAAO,WAAW,CAAI,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;AAC/D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAI,KAAQ;IACrC,MAAM,GAAG,GAAG,MAAM,EAAK,CAAC;IAExB,yBAAyB,CAAC,GAAG,EAAE;QAC7B,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC;IACtB,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC,OAAO,CAAC;AACrB,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC1C,YAAY,YAAoB,EAAE,cAAuB;QACvD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,QACb,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,2BAA2B,CAAC,EAAE,MAAO;aACpE,IACL,2BAA2B,YAAY,MAAM,cAAc,IAAI,EAAE,EAAE,CAAC;IACtE,CAAC;CACF"}
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Matches a string regex (as provided from the config) against a target in a
|
|
9
|
+
* null-safe fashion, case insensitive and global.
|
|
9
10
|
*/
|
|
10
11
|
export declare function isRegexpStringMatch(regexAsString?: string, valueToTest?: string): boolean;
|
|
11
12
|
//# sourceMappingURL=regexpUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regexpUtils.d.ts","sourceRoot":"","sources":["../../src/utils/regexpUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH
|
|
1
|
+
{"version":3,"file":"regexpUtils.d.ts","sourceRoot":"","sources":["../../src/utils/regexpUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,CAAC,EAAE,MAAM,EACtB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAST"}
|
package/lib/utils/regexpUtils.js
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Matches a string regex (as provided from the config) against a target in a
|
|
9
|
+
* null-safe fashion, case insensitive and global.
|
|
9
10
|
*/
|
|
10
11
|
export function isRegexpStringMatch(regexAsString, valueToTest) {
|
|
11
12
|
if (typeof regexAsString === 'undefined' ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regexpUtils.js","sourceRoot":"","sources":["../../src/utils/regexpUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH
|
|
1
|
+
{"version":3,"file":"regexpUtils.js","sourceRoot":"","sources":["../../src/utils/regexpUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CACjC,aAAsB,EACtB,WAAoB;IAEpB,IACE,OAAO,aAAa,KAAK,WAAW;QACpC,OAAO,WAAW,KAAK,WAAW,EAClC;QACA,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -4,11 +4,23 @@
|
|
|
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
|
-
|
|
8
|
-
|
|
7
|
+
import type { Route } from '@docusaurus/types';
|
|
8
|
+
/**
|
|
9
|
+
* Compare the 2 paths, case insensitive and ignoring trailing slash
|
|
10
|
+
*/
|
|
11
|
+
export declare function isSamePath(path1: string | undefined, path2: string | undefined): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Note that sites don't always have a homepage in practice, so we can't assume
|
|
14
|
+
* that linking to '/' is always safe.
|
|
15
|
+
* @see https://github.com/facebook/docusaurus/pull/6517#issuecomment-1048709116
|
|
16
|
+
*/
|
|
9
17
|
export declare function findHomePageRoute({ baseUrl, routes: initialRoutes, }: {
|
|
10
18
|
routes: Route[];
|
|
11
19
|
baseUrl: string;
|
|
12
20
|
}): Route | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Fetches the route that points to "/". Use this instead of the naive "/",
|
|
23
|
+
* because the homepage may not exist.
|
|
24
|
+
*/
|
|
13
25
|
export declare function useHomePageRoute(): Route | undefined;
|
|
14
26
|
//# sourceMappingURL=routesUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routesUtils.d.ts","sourceRoot":"","sources":["../../src/utils/routesUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"routesUtils.d.ts","sourceRoot":"","sources":["../../src/utils/routesUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAE7C;;GAEG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,OAAO,CAOT;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,MAAM,EAAE,aAAa,GACtB,EAAE;IACD,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,KAAK,GAAG,SAAS,CAwBpB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,KAAK,GAAG,SAAS,CAMpD"}
|
package/lib/utils/routesUtils.js
CHANGED
|
@@ -4,11 +4,23 @@
|
|
|
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
|
-
import GeneratedRoutes from '@generated/routes';
|
|
8
7
|
import { useMemo } from 'react';
|
|
8
|
+
import generatedRoutes from '@generated/routes';
|
|
9
9
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Compare the 2 paths, case insensitive and ignoring trailing slash
|
|
12
|
+
*/
|
|
13
|
+
export function isSamePath(path1, path2) {
|
|
14
|
+
const normalize = (pathname) => (!pathname || pathname?.endsWith('/')
|
|
15
|
+
? pathname
|
|
16
|
+
: `${pathname}/`)?.toLowerCase();
|
|
17
|
+
return normalize(path1) === normalize(path2);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Note that sites don't always have a homepage in practice, so we can't assume
|
|
21
|
+
* that linking to '/' is always safe.
|
|
22
|
+
* @see https://github.com/facebook/docusaurus/pull/6517#issuecomment-1048709116
|
|
23
|
+
*/
|
|
12
24
|
export function findHomePageRoute({ baseUrl, routes: initialRoutes, }) {
|
|
13
25
|
function isHomePageRoute(route) {
|
|
14
26
|
return route.path === baseUrl && route.exact === true;
|
|
@@ -31,11 +43,12 @@ export function findHomePageRoute({ baseUrl, routes: initialRoutes, }) {
|
|
|
31
43
|
}
|
|
32
44
|
return doFindHomePageRoute(initialRoutes);
|
|
33
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Fetches the route that points to "/". Use this instead of the naive "/",
|
|
48
|
+
* because the homepage may not exist.
|
|
49
|
+
*/
|
|
34
50
|
export function useHomePageRoute() {
|
|
35
51
|
const { baseUrl } = useDocusaurusContext().siteConfig;
|
|
36
|
-
return useMemo(() => findHomePageRoute({
|
|
37
|
-
routes: GeneratedRoutes,
|
|
38
|
-
baseUrl,
|
|
39
|
-
}), [baseUrl]);
|
|
52
|
+
return useMemo(() => findHomePageRoute({ routes: generatedRoutes, baseUrl }), [baseUrl]);
|
|
40
53
|
}
|
|
41
54
|
//# sourceMappingURL=routesUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routesUtils.js","sourceRoot":"","sources":["../../src/utils/routesUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"routesUtils.js","sourceRoot":"","sources":["../../src/utils/routesUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAC9B,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;AAGpE;;GAEG;AACH,MAAM,UAAU,UAAU,CACxB,KAAyB,EACzB,KAAyB;IAEzB,MAAM,SAAS,GAAG,CAAC,QAA4B,EAAE,EAAE,CACjD,CAAC,CAAC,QAAQ,IAAI,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC;QACnC,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,GAAG,QAAQ,GAAG,CACjB,EAAE,WAAW,EAAE,CAAC;IACnB,OAAO,SAAS,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,OAAO,EACP,MAAM,EAAE,aAAa,GAItB;IACC,SAAS,eAAe,CAAC,KAAY;QACnC,OAAO,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC;IACxD,CAAC;IAED,SAAS,iBAAiB,CAAC,KAAY;QACrC,OAAO,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;IAChD,CAAC;IAED,SAAS,mBAAmB,CAAC,MAAe;QAC1C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACvB,OAAO,SAAS,CAAC;SAClB;QACD,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC9C,IAAI,QAAQ,EAAE;YACZ,OAAO,QAAQ,CAAC;SACjB;QACD,MAAM,cAAc,GAAG,MAAM;aAC1B,MAAM,CAAC,iBAAiB,CAAC;aACzB,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;QAC1C,OAAO,mBAAmB,CAAC,cAAc,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,mBAAmB,CAAC,aAAa,CAAC,CAAC;AAC5C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,EAAC,OAAO,EAAC,GAAG,oBAAoB,EAAE,CAAC,UAAU,CAAC;IACpD,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,iBAAiB,CAAC,EAAC,MAAM,EAAE,eAAe,EAAE,OAAO,EAAC,CAAC,EAC3D,CAAC,OAAO,CAAC,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -5,49 +5,55 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React, { type ReactNode } from 'react';
|
|
8
|
-
/**
|
|
9
|
-
* We need a way to update the scroll position while ignoring scroll events
|
|
10
|
-
* without affecting Navbar/BackToTop visibility
|
|
11
|
-
*
|
|
12
|
-
* This API permits to temporarily disable/ignore scroll events
|
|
13
|
-
* Motivated by https://github.com/facebook/docusaurus/pull/5618
|
|
14
|
-
*/
|
|
15
8
|
declare type ScrollController = {
|
|
16
|
-
/**
|
|
17
|
-
* A boolean ref tracking whether scroll events are enabled
|
|
18
|
-
*/
|
|
9
|
+
/** A boolean ref tracking whether scroll events are enabled. */
|
|
19
10
|
scrollEventsEnabledRef: React.MutableRefObject<boolean>;
|
|
20
|
-
/**
|
|
21
|
-
* Enables scroll events in `useScrollPosition`
|
|
22
|
-
*/
|
|
11
|
+
/** Enable scroll events in `useScrollPosition`. */
|
|
23
12
|
enableScrollEvents: () => void;
|
|
24
|
-
/**
|
|
25
|
-
* Disables scroll events in `useScrollPosition`
|
|
26
|
-
*/
|
|
13
|
+
/** Disable scroll events in `useScrollPosition`. */
|
|
27
14
|
disableScrollEvents: () => void;
|
|
28
15
|
};
|
|
29
16
|
export declare function ScrollControllerProvider({ children, }: {
|
|
30
17
|
children: ReactNode;
|
|
31
18
|
}): JSX.Element;
|
|
19
|
+
/**
|
|
20
|
+
* We need a way to update the scroll position while ignoring scroll events
|
|
21
|
+
* so as not to toggle Navbar/BackToTop visibility.
|
|
22
|
+
*
|
|
23
|
+
* This API permits to temporarily disable/ignore scroll events. Motivated by
|
|
24
|
+
* https://github.com/facebook/docusaurus/pull/5618
|
|
25
|
+
*/
|
|
32
26
|
export declare function useScrollController(): ScrollController;
|
|
33
27
|
declare type ScrollPosition = {
|
|
34
28
|
scrollX: number;
|
|
35
29
|
scrollY: number;
|
|
36
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* This hook fires an effect when the scroll position changes. The effect will
|
|
33
|
+
* be provided with the before/after scroll positions. Note that the effect may
|
|
34
|
+
* not be always run: if scrolling is disabled through `useScrollController`, it
|
|
35
|
+
* will be a no-op.
|
|
36
|
+
*
|
|
37
|
+
* @see {@link useScrollController}
|
|
38
|
+
*/
|
|
37
39
|
export declare function useScrollPosition(effect: (position: ScrollPosition, lastPosition: ScrollPosition | null) => void, deps?: unknown[]): void;
|
|
38
|
-
declare type UseScrollPositionBlockerReturn = {
|
|
39
|
-
blockElementScrollPositionUntilNextRender: (el: HTMLElement) => void;
|
|
40
|
-
};
|
|
41
40
|
/**
|
|
42
|
-
* This hook permits to "block" the scroll position of a
|
|
41
|
+
* This hook permits to "block" the scroll position of a DOM element.
|
|
43
42
|
* The idea is that we should be able to update DOM content above this element
|
|
44
|
-
* but the screen position of this element should not change
|
|
43
|
+
* but the screen position of this element should not change.
|
|
44
|
+
*
|
|
45
|
+
* Feature motivated by the Tabs groups: clicking on a tab may affect tabs of
|
|
46
|
+
* the same group upper in the tree, yet to avoid a bad UX, the clicked tab must
|
|
47
|
+
* remain under the user mouse.
|
|
45
48
|
*
|
|
46
|
-
*
|
|
47
|
-
* clicking on a tab may affect tabs of the same group upper in the tree
|
|
48
|
-
* Yet to avoid a bad UX, the clicked tab must remain under the user mouse!
|
|
49
|
-
* See GIF here: https://github.com/facebook/docusaurus/pull/5618
|
|
49
|
+
* @see https://github.com/facebook/docusaurus/pull/5618
|
|
50
50
|
*/
|
|
51
|
-
export declare function useScrollPositionBlocker():
|
|
51
|
+
export declare function useScrollPositionBlocker(): {
|
|
52
|
+
/**
|
|
53
|
+
* Takes an element, and keeps its screen position no matter what's getting
|
|
54
|
+
* rendered above it, until the next render.
|
|
55
|
+
*/
|
|
56
|
+
blockElementScrollPositionUntilNextRender: (el: HTMLElement) => void;
|
|
57
|
+
};
|
|
52
58
|
export {};
|
|
53
59
|
//# sourceMappingURL=scrollUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrollUtils.d.ts","sourceRoot":"","sources":["../../src/utils/scrollUtils.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"scrollUtils.d.ts","sourceRoot":"","sources":["../../src/utils/scrollUtils.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,aAAK,gBAAgB,GAAG;IACtB,gEAAgE;IAChE,sBAAsB,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACxD,mDAAmD;IACnD,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,oDAAoD;IACpD,mBAAmB,EAAE,MAAM,IAAI,CAAC;CACjC,CAAC;AAuBF,wBAAgB,wBAAwB,CAAC,EACvC,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CAOd;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,IAAI,gBAAgB,CAMtD;AAED,aAAK,cAAc,GAAG;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAAC;AAUzD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,CACN,QAAQ,EAAE,cAAc,EACxB,YAAY,EAAE,cAAc,GAAG,IAAI,KAChC,IAAI,EACT,IAAI,GAAE,OAAO,EAAO,GACnB,IAAI,CA8BN;AA6CD;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,IAAI;IAC1C;;;OAGG;IACH,yCAAyC,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC;CACtE,CAwCA"}
|
package/lib/utils/scrollUtils.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
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
|
-
import React, {
|
|
7
|
+
import React, { useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, } from 'react';
|
|
8
8
|
import { useDynamicCallback, ReactContextError } from './reactUtils';
|
|
9
9
|
import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
|
|
10
10
|
function useScrollControllerContextValue() {
|
|
@@ -19,10 +19,18 @@ function useScrollControllerContextValue() {
|
|
|
19
19
|
},
|
|
20
20
|
}), []);
|
|
21
21
|
}
|
|
22
|
-
const ScrollMonitorContext = createContext(undefined);
|
|
22
|
+
const ScrollMonitorContext = React.createContext(undefined);
|
|
23
23
|
export function ScrollControllerProvider({ children, }) {
|
|
24
|
-
|
|
24
|
+
const value = useScrollControllerContextValue();
|
|
25
|
+
return (React.createElement(ScrollMonitorContext.Provider, { value: value }, children));
|
|
25
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* We need a way to update the scroll position while ignoring scroll events
|
|
29
|
+
* so as not to toggle Navbar/BackToTop visibility.
|
|
30
|
+
*
|
|
31
|
+
* This API permits to temporarily disable/ignore scroll events. Motivated by
|
|
32
|
+
* https://github.com/facebook/docusaurus/pull/5618
|
|
33
|
+
*/
|
|
26
34
|
export function useScrollController() {
|
|
27
35
|
const context = useContext(ScrollMonitorContext);
|
|
28
36
|
if (context == null) {
|
|
@@ -36,6 +44,14 @@ const getScrollPosition = () => ExecutionEnvironment.canUseDOM
|
|
|
36
44
|
scrollY: window.pageYOffset,
|
|
37
45
|
}
|
|
38
46
|
: null;
|
|
47
|
+
/**
|
|
48
|
+
* This hook fires an effect when the scroll position changes. The effect will
|
|
49
|
+
* be provided with the before/after scroll positions. Note that the effect may
|
|
50
|
+
* not be always run: if scrolling is disabled through `useScrollController`, it
|
|
51
|
+
* will be a no-op.
|
|
52
|
+
*
|
|
53
|
+
* @see {@link useScrollController}
|
|
54
|
+
*/
|
|
39
55
|
export function useScrollPosition(effect, deps = []) {
|
|
40
56
|
const { scrollEventsEnabledRef } = useScrollController();
|
|
41
57
|
const lastPositionRef = useRef(getScrollPosition());
|
|
@@ -57,12 +73,8 @@ export function useScrollPosition(effect, deps = []) {
|
|
|
57
73
|
handleScroll();
|
|
58
74
|
window.addEventListener('scroll', handleScroll, opts);
|
|
59
75
|
return () => window.removeEventListener('scroll', handleScroll, opts);
|
|
60
|
-
}, [
|
|
61
|
-
dynamicEffect,
|
|
62
|
-
scrollEventsEnabledRef,
|
|
63
76
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
64
|
-
|
|
65
|
-
]);
|
|
77
|
+
}, [dynamicEffect, scrollEventsEnabledRef, ...deps]);
|
|
66
78
|
}
|
|
67
79
|
function useScrollPositionSaver() {
|
|
68
80
|
const lastElementRef = useRef({
|
|
@@ -91,14 +103,15 @@ function useScrollPositionSaver() {
|
|
|
91
103
|
return useMemo(() => ({ save, restore }), [restore, save]);
|
|
92
104
|
}
|
|
93
105
|
/**
|
|
94
|
-
* This hook permits to "block" the scroll position of a
|
|
106
|
+
* This hook permits to "block" the scroll position of a DOM element.
|
|
95
107
|
* The idea is that we should be able to update DOM content above this element
|
|
96
|
-
* but the screen position of this element should not change
|
|
108
|
+
* but the screen position of this element should not change.
|
|
109
|
+
*
|
|
110
|
+
* Feature motivated by the Tabs groups: clicking on a tab may affect tabs of
|
|
111
|
+
* the same group upper in the tree, yet to avoid a bad UX, the clicked tab must
|
|
112
|
+
* remain under the user mouse.
|
|
97
113
|
*
|
|
98
|
-
*
|
|
99
|
-
* clicking on a tab may affect tabs of the same group upper in the tree
|
|
100
|
-
* Yet to avoid a bad UX, the clicked tab must remain under the user mouse!
|
|
101
|
-
* See GIF here: https://github.com/facebook/docusaurus/pull/5618
|
|
114
|
+
* @see https://github.com/facebook/docusaurus/pull/5618
|
|
102
115
|
*/
|
|
103
116
|
export function useScrollPositionBlocker() {
|
|
104
117
|
const scrollController = useScrollController();
|
|
@@ -110,9 +123,9 @@ export function useScrollPositionBlocker() {
|
|
|
110
123
|
nextLayoutEffectCallbackRef.current = () => {
|
|
111
124
|
const { restored } = scrollPositionSaver.restore();
|
|
112
125
|
nextLayoutEffectCallbackRef.current = undefined;
|
|
113
|
-
// Restoring the former scroll position will trigger a scroll event
|
|
114
|
-
//
|
|
115
|
-
//
|
|
126
|
+
// Restoring the former scroll position will trigger a scroll event. We
|
|
127
|
+
// need to wait for next scroll event to happen before enabling the
|
|
128
|
+
// scrollController events again.
|
|
116
129
|
if (restored) {
|
|
117
130
|
const handleScrollRestoreEvent = () => {
|
|
118
131
|
scrollController.enableScrollEvents();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrollUtils.js","sourceRoot":"","sources":["../../src/utils/scrollUtils.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EACZ,
|
|
1
|
+
{"version":3,"file":"scrollUtils.js","source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