@docusaurus/theme-search-algolia 3.9.1 → 3.9.2
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.
|
@@ -58,10 +58,11 @@ exports.Schema = utils_validation_1.Joi.object({
|
|
|
58
58
|
utils_validation_1.Joi.string(),
|
|
59
59
|
// Full configuration object
|
|
60
60
|
utils_validation_1.Joi.object({
|
|
61
|
-
indexName: utils_validation_1.Joi.string().required(),
|
|
62
|
-
apiKey: utils_validation_1.Joi.string().required(),
|
|
63
|
-
appId: utils_validation_1.Joi.string().required(),
|
|
64
61
|
assistantId: utils_validation_1.Joi.string().required(),
|
|
62
|
+
// Optional Ask AI configuration
|
|
63
|
+
indexName: utils_validation_1.Joi.string().optional(),
|
|
64
|
+
apiKey: utils_validation_1.Joi.string().optional(),
|
|
65
|
+
appId: utils_validation_1.Joi.string().optional(),
|
|
65
66
|
searchParameters: utils_validation_1.Joi.object({
|
|
66
67
|
facetFilters: FacetFiltersSchema.optional(),
|
|
67
68
|
}).optional(),
|
|
@@ -87,6 +88,10 @@ exports.Schema = utils_validation_1.Joi.object({
|
|
|
87
88
|
: {}),
|
|
88
89
|
};
|
|
89
90
|
}
|
|
91
|
+
// Fill in missing fields with the top-level Algolia config
|
|
92
|
+
askAiInput.indexName = askAiInput.indexName ?? algolia.indexName;
|
|
93
|
+
askAiInput.apiKey = askAiInput.apiKey ?? algolia.apiKey;
|
|
94
|
+
askAiInput.appId = askAiInput.appId ?? algolia.appId;
|
|
90
95
|
if (askAiInput.searchParameters?.facetFilters === undefined &&
|
|
91
96
|
algoliaFacetFilters) {
|
|
92
97
|
askAiInput.searchParameters = askAiInput.searchParameters ?? {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/theme-search-algolia",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.2",
|
|
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.1.0",
|
|
37
|
-
"@docusaurus/core": "3.9.
|
|
38
|
-
"@docusaurus/logger": "3.9.
|
|
39
|
-
"@docusaurus/plugin-content-docs": "3.9.
|
|
40
|
-
"@docusaurus/theme-common": "3.9.
|
|
41
|
-
"@docusaurus/theme-translations": "3.9.
|
|
42
|
-
"@docusaurus/utils": "3.9.
|
|
43
|
-
"@docusaurus/utils-validation": "3.9.
|
|
37
|
+
"@docusaurus/core": "3.9.2",
|
|
38
|
+
"@docusaurus/logger": "3.9.2",
|
|
39
|
+
"@docusaurus/plugin-content-docs": "3.9.2",
|
|
40
|
+
"@docusaurus/theme-common": "3.9.2",
|
|
41
|
+
"@docusaurus/theme-translations": "3.9.2",
|
|
42
|
+
"@docusaurus/utils": "3.9.2",
|
|
43
|
+
"@docusaurus/utils-validation": "3.9.2",
|
|
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.
|
|
54
|
+
"@docusaurus/module-type-aliases": "3.9.2"
|
|
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": "abfbe5621b08407bc3dcbe6111ff118d4c22f7a1"
|
|
64
64
|
}
|
|
@@ -11,7 +11,7 @@ declare module '@docsearch/react/useDocSearchKeyboardEvents';
|
|
|
11
11
|
declare module '@docsearch/react/version';
|
|
12
12
|
|
|
13
13
|
declare module '@docusaurus/theme-search-algolia' {
|
|
14
|
-
import type {DeepPartial, Overwrite} from 'utility-types';
|
|
14
|
+
import type {DeepPartial, Overwrite, Optional} from 'utility-types';
|
|
15
15
|
|
|
16
16
|
import type {DocSearchProps} from '@docsearch/react';
|
|
17
17
|
import type {FacetFilters} from 'algoliasearch/lite';
|
|
@@ -70,7 +70,9 @@ declare module '@docusaurus/theme-search-algolia' {
|
|
|
70
70
|
apiKey: ThemeConfigAlgolia['apiKey'];
|
|
71
71
|
indexName: ThemeConfigAlgolia['indexName'];
|
|
72
72
|
// askAi also accepts a shorter string form
|
|
73
|
-
askAi?:
|
|
73
|
+
askAi?:
|
|
74
|
+
| string
|
|
75
|
+
| Optional<AskAiConfig, 'indexName' | 'appId' | 'apiKey'>;
|
|
74
76
|
}
|
|
75
77
|
>;
|
|
76
78
|
};
|
|
@@ -67,10 +67,11 @@ export const Schema = Joi.object<ThemeConfig>({
|
|
|
67
67
|
Joi.string(),
|
|
68
68
|
// Full configuration object
|
|
69
69
|
Joi.object({
|
|
70
|
-
indexName: Joi.string().required(),
|
|
71
|
-
apiKey: Joi.string().required(),
|
|
72
|
-
appId: Joi.string().required(),
|
|
73
70
|
assistantId: Joi.string().required(),
|
|
71
|
+
// Optional Ask AI configuration
|
|
72
|
+
indexName: Joi.string().optional(),
|
|
73
|
+
apiKey: Joi.string().optional(),
|
|
74
|
+
appId: Joi.string().optional(),
|
|
74
75
|
searchParameters: Joi.object({
|
|
75
76
|
facetFilters: FacetFiltersSchema.optional(),
|
|
76
77
|
}).optional(),
|
|
@@ -102,6 +103,10 @@ export const Schema = Joi.object<ThemeConfig>({
|
|
|
102
103
|
} satisfies ThemeConfigAlgolia['askAi'];
|
|
103
104
|
}
|
|
104
105
|
|
|
106
|
+
// Fill in missing fields with the top-level Algolia config
|
|
107
|
+
askAiInput.indexName = askAiInput.indexName ?? algolia.indexName;
|
|
108
|
+
askAiInput.apiKey = askAiInput.apiKey ?? algolia.apiKey;
|
|
109
|
+
askAiInput.appId = askAiInput.appId ?? algolia.appId;
|
|
105
110
|
if (
|
|
106
111
|
askAiInput.searchParameters?.facetFilters === undefined &&
|
|
107
112
|
algoliaFacetFilters
|
|
@@ -109,6 +114,7 @@ export const Schema = Joi.object<ThemeConfig>({
|
|
|
109
114
|
askAiInput.searchParameters = askAiInput.searchParameters ?? {};
|
|
110
115
|
askAiInput.searchParameters.facetFilters = algoliaFacetFilters;
|
|
111
116
|
}
|
|
117
|
+
|
|
112
118
|
return askAiInput;
|
|
113
119
|
},
|
|
114
120
|
)
|