@docusaurus/theme-search-algolia 3.6.3-canary-6164 → 3.6.3-canary-6167
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.
|
@@ -4,4 +4,5 @@
|
|
|
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
|
-
|
|
7
|
+
import { type ReactNode } from 'react';
|
|
8
|
+
export default function SearchBar(): ReactNode;
|
|
@@ -58,6 +58,7 @@ function DocSearch({contextualSearch, externalUrlRegex, ...props}) {
|
|
|
58
58
|
};
|
|
59
59
|
const history = useHistory();
|
|
60
60
|
const searchContainer = useRef(null);
|
|
61
|
+
// TODO remove after React 19 upgrade?
|
|
61
62
|
const searchButtonRef = useRef(null);
|
|
62
63
|
const [isOpen, setIsOpen] = useState(false);
|
|
63
64
|
const [initialQuery, setInitialQuery] = useState(undefined);
|
|
@@ -122,6 +123,7 @@ function DocSearch({contextualSearch, externalUrlRegex, ...props}) {
|
|
|
122
123
|
url: processSearchResultUrl(item.url),
|
|
123
124
|
})),
|
|
124
125
|
).current;
|
|
126
|
+
// @ts-expect-error: TODO fix lib issue after React 19, using JSX.Element
|
|
125
127
|
const resultsFooterComponent = useMemo(
|
|
126
128
|
() =>
|
|
127
129
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
@@ -4,4 +4,5 @@
|
|
|
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
|
-
|
|
7
|
+
import { type ReactNode } from 'react';
|
|
8
|
+
export default function SearchPage(): ReactNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/theme-search-algolia",
|
|
3
|
-
"version": "3.6.3-canary-
|
|
3
|
+
"version": "3.6.3-canary-6167",
|
|
4
4
|
"description": "Algolia search component for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"sideEffects": [
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@docsearch/react": "^3.5.2",
|
|
37
|
-
"@docusaurus/core": "3.6.3-canary-
|
|
38
|
-
"@docusaurus/logger": "3.6.3-canary-
|
|
39
|
-
"@docusaurus/plugin-content-docs": "3.6.3-canary-
|
|
40
|
-
"@docusaurus/theme-common": "3.6.3-canary-
|
|
41
|
-
"@docusaurus/theme-translations": "3.6.3-canary-
|
|
42
|
-
"@docusaurus/utils": "3.6.3-canary-
|
|
43
|
-
"@docusaurus/utils-validation": "3.6.3-canary-
|
|
37
|
+
"@docusaurus/core": "3.6.3-canary-6167",
|
|
38
|
+
"@docusaurus/logger": "3.6.3-canary-6167",
|
|
39
|
+
"@docusaurus/plugin-content-docs": "3.6.3-canary-6167",
|
|
40
|
+
"@docusaurus/theme-common": "3.6.3-canary-6167",
|
|
41
|
+
"@docusaurus/theme-translations": "3.6.3-canary-6167",
|
|
42
|
+
"@docusaurus/utils": "3.6.3-canary-6167",
|
|
43
|
+
"@docusaurus/utils-validation": "3.6.3-canary-6167",
|
|
44
44
|
"algoliasearch": "^4.18.0",
|
|
45
45
|
"algoliasearch-helper": "^3.13.3",
|
|
46
46
|
"clsx": "^2.0.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"utility-types": "^3.10.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@docusaurus/module-type-aliases": "3.6.3-canary-
|
|
54
|
+
"@docusaurus/module-type-aliases": "3.6.3-canary-6167"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"react": "^18.0.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=18.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "d8c53eaab293c71917973e7358a894572141e1c8"
|
|
64
64
|
}
|
|
@@ -5,7 +5,13 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import React, {
|
|
8
|
+
import React, {
|
|
9
|
+
useCallback,
|
|
10
|
+
useMemo,
|
|
11
|
+
useRef,
|
|
12
|
+
useState,
|
|
13
|
+
type ReactNode,
|
|
14
|
+
} from 'react';
|
|
9
15
|
import {createPortal} from 'react-dom';
|
|
10
16
|
import {DocSearchButton, useDocSearchKeyboardEvents} from '@docsearch/react';
|
|
11
17
|
import Head from '@docusaurus/Head';
|
|
@@ -114,7 +120,8 @@ function DocSearch({
|
|
|
114
120
|
|
|
115
121
|
const history = useHistory();
|
|
116
122
|
const searchContainer = useRef<HTMLDivElement | null>(null);
|
|
117
|
-
|
|
123
|
+
// TODO remove after React 19 upgrade?
|
|
124
|
+
const searchButtonRef = useRef<HTMLButtonElement>(null as any);
|
|
118
125
|
const [isOpen, setIsOpen] = useState(false);
|
|
119
126
|
const [initialQuery, setInitialQuery] = useState<string | undefined>(
|
|
120
127
|
undefined,
|
|
@@ -192,11 +199,12 @@ function DocSearch({
|
|
|
192
199
|
})),
|
|
193
200
|
).current;
|
|
194
201
|
|
|
202
|
+
// @ts-expect-error: TODO fix lib issue after React 19, using JSX.Element
|
|
195
203
|
const resultsFooterComponent: DocSearchProps['resultsFooterComponent'] =
|
|
196
204
|
useMemo(
|
|
197
205
|
() =>
|
|
198
206
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
199
|
-
(footerProps: Omit<ResultsFooterProps, 'onClose'>):
|
|
207
|
+
(footerProps: Omit<ResultsFooterProps, 'onClose'>): ReactNode =>
|
|
200
208
|
<ResultsFooter {...footerProps} onClose={closeModal} />,
|
|
201
209
|
[closeModal],
|
|
202
210
|
);
|
|
@@ -269,7 +277,7 @@ function DocSearch({
|
|
|
269
277
|
);
|
|
270
278
|
}
|
|
271
279
|
|
|
272
|
-
export default function SearchBar():
|
|
280
|
+
export default function SearchBar(): ReactNode {
|
|
273
281
|
const {siteConfig} = useDocusaurusContext();
|
|
274
282
|
return <DocSearch {...(siteConfig.themeConfig.algolia as DocSearchProps)} />;
|
|
275
283
|
}
|
|
@@ -7,7 +7,13 @@
|
|
|
7
7
|
|
|
8
8
|
/* eslint-disable jsx-a11y/no-autofocus */
|
|
9
9
|
|
|
10
|
-
import React, {
|
|
10
|
+
import React, {
|
|
11
|
+
type ReactNode,
|
|
12
|
+
useEffect,
|
|
13
|
+
useReducer,
|
|
14
|
+
useRef,
|
|
15
|
+
useState,
|
|
16
|
+
} from 'react';
|
|
11
17
|
import clsx from 'clsx';
|
|
12
18
|
|
|
13
19
|
import algoliaSearchHelper from 'algoliasearch-helper';
|
|
@@ -154,7 +160,7 @@ type ResultDispatcher =
|
|
|
154
160
|
| {type: 'update'; value: ResultDispatcherState}
|
|
155
161
|
| {type: 'advance'; value?: undefined};
|
|
156
162
|
|
|
157
|
-
function SearchPageContent():
|
|
163
|
+
function SearchPageContent(): ReactNode {
|
|
158
164
|
const {
|
|
159
165
|
i18n: {currentLocale},
|
|
160
166
|
} = useDocusaurusContext();
|
|
@@ -530,7 +536,7 @@ function SearchPageContent(): JSX.Element {
|
|
|
530
536
|
);
|
|
531
537
|
}
|
|
532
538
|
|
|
533
|
-
export default function SearchPage():
|
|
539
|
+
export default function SearchPage(): ReactNode {
|
|
534
540
|
return (
|
|
535
541
|
<HtmlClassNameProvider className="search-page-wrapper">
|
|
536
542
|
<SearchPageContent />
|
|
@@ -38,11 +38,15 @@ declare module '@docusaurus/theme-search-algolia/client' {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
declare module '@theme/SearchPage' {
|
|
41
|
-
|
|
41
|
+
import type {ReactNode} from 'react';
|
|
42
|
+
|
|
43
|
+
export default function SearchPage(): ReactNode;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
declare module '@theme/SearchBar' {
|
|
45
|
-
|
|
47
|
+
import type {ReactNode} from 'react';
|
|
48
|
+
|
|
49
|
+
export default function SearchBar(): ReactNode;
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
declare module '@theme/SearchTranslations' {
|