@docusaurus/theme-search-algolia 3.9.2-canary-6447 → 3.9.2-canary-6449

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.
@@ -43,7 +43,7 @@ export function useAlgoliaAskAi(props) {
43
43
  setIsAskAiActive(askAiToggle);
44
44
  }, []);
45
45
  const extraAskAiProps = {
46
- askAi,
46
+ askAi: askAi,
47
47
  canHandleAskAi,
48
48
  isAskAiActive,
49
49
  onAskAiToggle,
@@ -27,7 +27,7 @@ export function useSearchResultUrlProcessor() {
27
27
  return url;
28
28
  }
29
29
  // Otherwise => transform to relative URL for SPA navigation
30
- const relativeUrl = `${parsedURL.pathname + parsedURL.hash}`;
30
+ const relativeUrl = `${parsedURL.pathname}${parsedURL.search}${parsedURL.hash}`;
31
31
  return withBaseUrl(replacePathname(relativeUrl, replaceSearchResultPathname));
32
32
  }, [withBaseUrl, externalUrlRegex, replaceSearchResultPathname]);
33
33
  }
@@ -66,6 +66,7 @@ exports.Schema = utils_validation_1.Joi.object({
66
66
  searchParameters: utils_validation_1.Joi.object({
67
67
  facetFilters: FacetFiltersSchema.optional(),
68
68
  }).optional(),
69
+ suggestedQuestions: utils_validation_1.Joi.boolean().optional(),
69
70
  }))
70
71
  .custom((askAiInput, helpers) => {
71
72
  if (!askAiInput) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-search-algolia",
3
- "version": "3.9.2-canary-6447",
3
+ "version": "3.9.2-canary-6449",
4
4
  "description": "Algolia search component for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "sideEffects": [
@@ -33,14 +33,14 @@
33
33
  "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
34
34
  },
35
35
  "dependencies": {
36
- "@docsearch/react": "^3.9.0 || ^4.1.0",
37
- "@docusaurus/core": "3.9.2-canary-6447",
38
- "@docusaurus/logger": "3.9.2-canary-6447",
39
- "@docusaurus/plugin-content-docs": "3.9.2-canary-6447",
40
- "@docusaurus/theme-common": "3.9.2-canary-6447",
41
- "@docusaurus/theme-translations": "3.9.2-canary-6447",
42
- "@docusaurus/utils": "3.9.2-canary-6447",
43
- "@docusaurus/utils-validation": "3.9.2-canary-6447",
36
+ "@docsearch/react": "^3.9.0 || ^4.3.2",
37
+ "@docusaurus/core": "3.9.2-canary-6449",
38
+ "@docusaurus/logger": "3.9.2-canary-6449",
39
+ "@docusaurus/plugin-content-docs": "3.9.2-canary-6449",
40
+ "@docusaurus/theme-common": "3.9.2-canary-6449",
41
+ "@docusaurus/theme-translations": "3.9.2-canary-6449",
42
+ "@docusaurus/utils": "3.9.2-canary-6449",
43
+ "@docusaurus/utils-validation": "3.9.2-canary-6449",
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-6447"
54
+ "@docusaurus/module-type-aliases": "3.9.2-canary-6449"
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": "4e8e951f5bc8f9e58d839ead1a48a3b234ba91f6"
63
+ "gitHead": "f8950c896d31a9a325353f6636a1a68549cb2d83"
64
64
  }
@@ -91,7 +91,7 @@ export function useAlgoliaAskAi(props: DocSearchV4PropsLite): UseAskAiResult {
91
91
  }, []);
92
92
 
93
93
  const extraAskAiProps: UseAskAiResult['extraAskAiProps'] = {
94
- askAi,
94
+ askAi: askAi as any,
95
95
  canHandleAskAi,
96
96
  isAskAiActive,
97
97
  onAskAiToggle,
@@ -43,7 +43,7 @@ export function useSearchResultUrlProcessor(): (url: string) => string {
43
43
  }
44
44
 
45
45
  // Otherwise => transform to relative URL for SPA navigation
46
- const relativeUrl = `${parsedURL.pathname + parsedURL.hash}`;
46
+ const relativeUrl = `${parsedURL.pathname}${parsedURL.search}${parsedURL.hash}`;
47
47
 
48
48
  return withBaseUrl(
49
49
  replacePathname(relativeUrl, replaceSearchResultPathname),
@@ -61,7 +61,7 @@ type DocSearchProps = Omit<
61
61
 
62
62
  // extend DocSearchProps for v4 features
63
63
  // TODO Docusaurus v4: cleanup after we drop support for DocSearch v3
64
- interface DocSearchV4Props extends DocSearchProps {
64
+ interface DocSearchV4Props extends Omit<DocSearchProps, 'askAi'> {
65
65
  indexName: string;
66
66
  askAi?: ThemeConfigAlgolia['askAi'];
67
67
  translations?: DocSearchTranslations;
@@ -199,7 +199,7 @@ function useSearchParameters({
199
199
 
200
200
  function DocSearch({externalUrlRegex, ...props}: DocSearchV4Props) {
201
201
  const navigator = useNavigator({externalUrlRegex});
202
- const searchParameters = useSearchParameters({...props});
202
+ const searchParameters = useSearchParameters({...props} as DocSearchProps);
203
203
  const transformItems = useTransformItems(props);
204
204
  const transformSearchClient = useTransformSearchClient();
205
205
 
@@ -301,7 +301,7 @@ function DocSearch({externalUrlRegex, ...props}: DocSearchV4Props) {
301
301
  resultsFooterComponent,
302
302
  })}
303
303
  placeholder={currentPlaceholder}
304
- {...props}
304
+ {...(props as any)}
305
305
  translations={props.translations?.modal ?? translations.modal}
306
306
  searchParameters={searchParameters}
307
307
  {...extraAskAiProps}
@@ -17,6 +17,7 @@ declare module '@docusaurus/theme-search-algolia' {
17
17
  import type {FacetFilters} from 'algoliasearch/lite';
18
18
 
19
19
  // The config after normalization (e.g. AskAI string -> object)
20
+ // This matches DocSearch v4.3+ AskAi configuration
20
21
  export type AskAiConfig = {
21
22
  indexName: string;
22
23
  apiKey: string;
@@ -25,6 +26,7 @@ declare module '@docusaurus/theme-search-algolia' {
25
26
  searchParameters?: {
26
27
  facetFilters?: FacetFilters;
27
28
  };
29
+ suggestedQuestions?: boolean;
28
30
  };
29
31
 
30
32
  // DocSearch props that Docusaurus exposes directly through props forwarding
@@ -75,6 +75,7 @@ export const Schema = Joi.object<ThemeConfig>({
75
75
  searchParameters: Joi.object({
76
76
  facetFilters: FacetFiltersSchema.optional(),
77
77
  }).optional(),
78
+ suggestedQuestions: Joi.boolean().optional(),
78
79
  }),
79
80
  )
80
81
  .custom(