@docusaurus/theme-common 3.10.2 → 4.0.0-canary-6809
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.map +1 -1
- package/lib/components/Collapsible/index.js +0 -1
- package/lib/components/Collapsible/index.js.map +1 -1
- package/lib/components/Details/index.d.ts.map +1 -1
- package/lib/components/Details/index.js +9 -0
- package/lib/components/Details/index.js.map +1 -1
- package/lib/components/ThemedComponent/index.d.ts +1 -2
- package/lib/components/ThemedComponent/index.d.ts.map +1 -1
- package/lib/components/ThemedComponent/index.js +0 -1
- package/lib/components/ThemedComponent/index.js.map +1 -1
- package/lib/contexts/colorMode.d.ts +0 -3
- package/lib/contexts/colorMode.d.ts.map +1 -1
- package/lib/contexts/colorMode.js +0 -18
- package/lib/contexts/colorMode.js.map +1 -1
- package/lib/hooks/useLockBodyScroll.js.map +1 -1
- package/lib/hooks/useMutationObserver.js.map +1 -1
- package/lib/hooks/useWindowSize.d.ts +3 -3
- package/lib/hooks/useWindowSize.d.ts.map +1 -1
- package/lib/hooks/useWindowSize.js.map +1 -1
- package/lib/index.d.ts +2 -10
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -29
- package/lib/index.js.map +1 -1
- package/lib/internal.d.ts +1 -1
- package/lib/internal.d.ts.map +1 -1
- package/lib/internal.js +1 -4
- package/lib/internal.js.map +1 -1
- package/lib/translations/contentVisibilityTranslations.d.ts +0 -1
- package/lib/translations/contentVisibilityTranslations.d.ts.map +1 -1
- package/lib/translations/contentVisibilityTranslations.js +0 -8
- package/lib/translations/contentVisibilityTranslations.js.map +1 -1
- package/lib/utils/IntlUtils.js.map +1 -1
- package/lib/utils/ThemeClassNames.d.ts +52 -52
- package/lib/utils/ThemeClassNames.d.ts.map +1 -1
- package/lib/utils/codeBlockUtils.d.ts +0 -1
- package/lib/utils/codeBlockUtils.d.ts.map +1 -1
- package/lib/utils/codeBlockUtils.js +0 -5
- package/lib/utils/codeBlockUtils.js.map +1 -1
- package/lib/utils/emojiUtils.d.ts.map +1 -1
- package/lib/utils/emojiUtils.js +0 -1
- package/lib/utils/emojiUtils.js.map +1 -1
- package/lib/utils/errorBoundaryUtils.d.ts.map +1 -1
- package/lib/utils/jsUtils.js.map +1 -1
- package/lib/utils/reactUtils.d.ts.map +1 -1
- package/lib/utils/reactUtils.js +7 -5
- package/lib/utils/reactUtils.js.map +1 -1
- package/lib/utils/scrollUtils.d.ts.map +1 -1
- package/lib/utils/scrollUtils.js +0 -1
- package/lib/utils/scrollUtils.js.map +1 -1
- package/lib/utils/storageUtils.js.map +1 -1
- package/lib/utils/tagsUtils.d.ts +2 -0
- package/lib/utils/tagsUtils.d.ts.map +1 -1
- package/lib/utils/tagsUtils.js +6 -1
- package/lib/utils/tagsUtils.js.map +1 -1
- package/package.json +19 -20
- package/src/components/Collapsible/index.tsx +0 -1
- package/src/components/Details/index.tsx +10 -0
- package/src/components/ThemedComponent/index.tsx +1 -3
- package/src/contexts/colorMode.tsx +0 -30
- package/src/index.ts +1 -40
- package/src/internal.ts +0 -8
- package/src/translations/contentVisibilityTranslations.tsx +0 -11
- package/src/utils/codeBlockUtils.tsx +0 -6
- package/src/utils/emojiUtils.ts +0 -1
- package/src/utils/reactUtils.tsx +14 -12
- package/src/utils/scrollUtils.tsx +0 -1
- package/src/utils/{tagsUtils.ts → tagsUtils.tsx} +12 -1
- package/lib/hooks/useSearchPage.d.ts +0 -15
- package/lib/hooks/useSearchPage.d.ts.map +0 -1
- package/lib/hooks/useSearchPage.js +0 -28
- package/lib/hooks/useSearchPage.js.map +0 -1
- package/src/hooks/useSearchPage.ts +0 -42
|
@@ -124,7 +124,6 @@ export function useScrollPosition(
|
|
|
124
124
|
window.addEventListener('scroll', handleScroll, opts);
|
|
125
125
|
|
|
126
126
|
return () => window.removeEventListener('scroll', handleScroll, opts);
|
|
127
|
-
// eslint-disable-next-line react-compiler/react-compiler
|
|
128
127
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
129
128
|
}, [dynamicEffect, scrollEventsEnabledRef, ...deps]);
|
|
130
129
|
}
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import type {ReactNode} from 'react';
|
|
9
|
+
import Translate, {translate} from '@docusaurus/Translate';
|
|
9
10
|
import type {TagsListItem} from '@docusaurus/utils';
|
|
10
11
|
|
|
11
12
|
export const translateTagsPageTitle = (): string =>
|
|
@@ -15,6 +16,16 @@ export const translateTagsPageTitle = (): string =>
|
|
|
15
16
|
description: 'The title of the tag list page',
|
|
16
17
|
});
|
|
17
18
|
|
|
19
|
+
export function TagsPageLinkLabel(): ReactNode {
|
|
20
|
+
return (
|
|
21
|
+
<Translate
|
|
22
|
+
id="theme.tags.tagsPageLink"
|
|
23
|
+
description="The label of the link targeting the tag list page">
|
|
24
|
+
View all tags
|
|
25
|
+
</Translate>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
18
29
|
export type TagLetterEntry = {letter: string; tags: TagsListItem[]};
|
|
19
30
|
|
|
20
31
|
function getTagLetter(tag: string): string {
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
* Permits to read/write the current search query string
|
|
9
|
-
*/
|
|
10
|
-
export declare function useSearchQueryString(): [string, (newValue: string) => void];
|
|
11
|
-
/**
|
|
12
|
-
* Permits to create links to the search page with the appropriate query string
|
|
13
|
-
*/
|
|
14
|
-
export declare function useSearchLinkCreator(): (searchValue: string) => string;
|
|
15
|
-
//# sourceMappingURL=useSearchPage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSearchPage.d.ts","sourceRoot":"","sources":["../../src/hooks/useSearchPage.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC,CAE3E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAiBtE"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
import { useCallback } from 'react';
|
|
8
|
-
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
9
|
-
import { useQueryString } from '../utils/historyUtils';
|
|
10
|
-
const SEARCH_PARAM_QUERY = 'q';
|
|
11
|
-
/**
|
|
12
|
-
* Permits to read/write the current search query string
|
|
13
|
-
*/
|
|
14
|
-
export function useSearchQueryString() {
|
|
15
|
-
return useQueryString(SEARCH_PARAM_QUERY);
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Permits to create links to the search page with the appropriate query string
|
|
19
|
-
*/
|
|
20
|
-
export function useSearchLinkCreator() {
|
|
21
|
-
const { siteConfig: { baseUrl, themeConfig }, } = useDocusaurusContext();
|
|
22
|
-
const { algolia: { searchPagePath }, } = themeConfig;
|
|
23
|
-
return useCallback((searchValue) =>
|
|
24
|
-
// Refer to https://github.com/facebook/docusaurus/pull/2838
|
|
25
|
-
// Note: if searchPagePath is falsy, useSearchPage() will not be called
|
|
26
|
-
`${baseUrl}${searchPagePath}?${SEARCH_PARAM_QUERY}=${encodeURIComponent(searchValue)}`, [baseUrl, searchPagePath]);
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=useSearchPage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSearchPage.js","sourceRoot":"","sources":["../../src/hooks/useSearchPage.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,WAAW,EAAC,MAAM,OAAO,CAAC;AAClC,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAGrD,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAE/B;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,cAAc,CAAC,kBAAkB,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,MAAM,EACJ,UAAU,EAAE,EAAC,OAAO,EAAE,WAAW,EAAC,GACnC,GAAG,oBAAoB,EAAE,CAAC;IAC3B,MAAM,EACJ,OAAO,EAAE,EAAC,cAAc,EAAC,GAC1B,GAAG,WAAiC,CAAC;IAEtC,OAAO,WAAW,CAChB,CAAC,WAAmB,EAAE,EAAE;IACtB,4DAA4D;IAC5D,uEAAuE;IACvE,GAAG,OAAO,GACR,cACF,IAAI,kBAAkB,IAAI,kBAAkB,CAAC,WAAW,CAAC,EAAE,EAC7D,CAAC,OAAO,EAAE,cAAc,CAAC,CAC1B,CAAC;AACJ,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
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
|
-
import {useCallback} from 'react';
|
|
9
|
-
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
10
|
-
import {useQueryString} from '../utils/historyUtils';
|
|
11
|
-
import type {ThemeConfig as AlgoliaThemeConfig} from '@docusaurus/theme-search-algolia';
|
|
12
|
-
|
|
13
|
-
const SEARCH_PARAM_QUERY = 'q';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Permits to read/write the current search query string
|
|
17
|
-
*/
|
|
18
|
-
export function useSearchQueryString(): [string, (newValue: string) => void] {
|
|
19
|
-
return useQueryString(SEARCH_PARAM_QUERY);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Permits to create links to the search page with the appropriate query string
|
|
24
|
-
*/
|
|
25
|
-
export function useSearchLinkCreator(): (searchValue: string) => string {
|
|
26
|
-
const {
|
|
27
|
-
siteConfig: {baseUrl, themeConfig},
|
|
28
|
-
} = useDocusaurusContext();
|
|
29
|
-
const {
|
|
30
|
-
algolia: {searchPagePath},
|
|
31
|
-
} = themeConfig as AlgoliaThemeConfig;
|
|
32
|
-
|
|
33
|
-
return useCallback(
|
|
34
|
-
(searchValue: string) =>
|
|
35
|
-
// Refer to https://github.com/facebook/docusaurus/pull/2838
|
|
36
|
-
// Note: if searchPagePath is falsy, useSearchPage() will not be called
|
|
37
|
-
`${baseUrl}${
|
|
38
|
-
searchPagePath as string
|
|
39
|
-
}?${SEARCH_PARAM_QUERY}=${encodeURIComponent(searchValue)}`,
|
|
40
|
-
[baseUrl, searchPagePath],
|
|
41
|
-
);
|
|
42
|
-
}
|