@docusaurus/theme-search-algolia 3.9.2-canary-6460 → 3.9.2-canary-6463
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.
|
@@ -5,4 +5,20 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import { type ReactNode } from 'react';
|
|
8
|
-
|
|
8
|
+
import type { DocSearchModalProps, DocSearchTranslations } from '@docsearch/react';
|
|
9
|
+
import type { ThemeConfigAlgolia } from '@docusaurus/theme-search-algolia';
|
|
10
|
+
type DocSearchProps = Omit<DocSearchModalProps, 'onClose' | 'initialScrollY'> & {
|
|
11
|
+
contextualSearch?: string;
|
|
12
|
+
externalUrlRegex?: string;
|
|
13
|
+
searchPagePath: boolean | string;
|
|
14
|
+
askAi?: Exclude<(DocSearchModalProps & {
|
|
15
|
+
askAi: unknown;
|
|
16
|
+
})['askAi'], string | undefined>;
|
|
17
|
+
};
|
|
18
|
+
interface DocSearchV4Props extends Omit<DocSearchProps, 'askAi'> {
|
|
19
|
+
indexName: string;
|
|
20
|
+
askAi?: ThemeConfigAlgolia['askAi'];
|
|
21
|
+
translations?: DocSearchTranslations;
|
|
22
|
+
}
|
|
23
|
+
export default function SearchBar(props: Partial<DocSearchV4Props>): ReactNode;
|
|
24
|
+
export {};
|
|
@@ -217,7 +217,13 @@ function DocSearch({externalUrlRegex, ...props}) {
|
|
|
217
217
|
</>
|
|
218
218
|
);
|
|
219
219
|
}
|
|
220
|
-
export default function SearchBar() {
|
|
220
|
+
export default function SearchBar(props) {
|
|
221
221
|
const {siteConfig} = useDocusaurusContext();
|
|
222
|
-
|
|
222
|
+
const docSearchProps = {
|
|
223
|
+
...siteConfig.themeConfig.algolia,
|
|
224
|
+
// Let props override theme config
|
|
225
|
+
// See https://github.com/facebook/docusaurus/pull/11581
|
|
226
|
+
...props,
|
|
227
|
+
};
|
|
228
|
+
return <DocSearch {...docSearchProps} />;
|
|
223
229
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/theme-search-algolia",
|
|
3
|
-
"version": "3.9.2-canary-
|
|
3
|
+
"version": "3.9.2-canary-6463",
|
|
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.9.0 || ^4.3.2",
|
|
37
|
-
"@docusaurus/core": "3.9.2-canary-
|
|
38
|
-
"@docusaurus/logger": "3.9.2-canary-
|
|
39
|
-
"@docusaurus/plugin-content-docs": "3.9.2-canary-
|
|
40
|
-
"@docusaurus/theme-common": "3.9.2-canary-
|
|
41
|
-
"@docusaurus/theme-translations": "3.9.2-canary-
|
|
42
|
-
"@docusaurus/utils": "3.9.2-canary-
|
|
43
|
-
"@docusaurus/utils-validation": "3.9.2-canary-
|
|
37
|
+
"@docusaurus/core": "3.9.2-canary-6463",
|
|
38
|
+
"@docusaurus/logger": "3.9.2-canary-6463",
|
|
39
|
+
"@docusaurus/plugin-content-docs": "3.9.2-canary-6463",
|
|
40
|
+
"@docusaurus/theme-common": "3.9.2-canary-6463",
|
|
41
|
+
"@docusaurus/theme-translations": "3.9.2-canary-6463",
|
|
42
|
+
"@docusaurus/utils": "3.9.2-canary-6463",
|
|
43
|
+
"@docusaurus/utils-validation": "3.9.2-canary-6463",
|
|
44
44
|
"algoliasearch": "^5.37.0",
|
|
45
45
|
"algoliasearch-helper": "^3.26.0",
|
|
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.9.2-canary-
|
|
54
|
+
"@docusaurus/module-type-aliases": "3.9.2-canary-6463"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=20.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "2c636a936d9abbafdae9a9825d3cbbf482d4bd6b"
|
|
64
64
|
}
|
|
@@ -312,9 +312,15 @@ function DocSearch({externalUrlRegex, ...props}: DocSearchV4Props) {
|
|
|
312
312
|
);
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
-
export default function SearchBar(): ReactNode {
|
|
315
|
+
export default function SearchBar(props: Partial<DocSearchV4Props>): ReactNode {
|
|
316
316
|
const {siteConfig} = useDocusaurusContext();
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
317
|
+
|
|
318
|
+
const docSearchProps: DocSearchV4Props = {
|
|
319
|
+
...(siteConfig.themeConfig.algolia as DocSearchV4Props),
|
|
320
|
+
// Let props override theme config
|
|
321
|
+
// See https://github.com/facebook/docusaurus/pull/11581
|
|
322
|
+
...props,
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
return <DocSearch {...docSearchProps} />;
|
|
320
326
|
}
|