File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed
packages/autocomplete-core/src Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -69,11 +69,11 @@ export function createAutocomplete<
69
69
}
70
70
71
71
if (
72
- options . insights &&
72
+ props . insights &&
73
73
! props . plugins . some ( ( plugin ) => plugin . name === 'aa.algoliaInsightsPlugin' )
74
74
) {
75
75
const insightsParams =
76
- typeof options . insights === 'boolean' ? { } : options . insights ;
76
+ typeof props . insights === 'boolean' ? { } : props . insights ;
77
77
props . plugins . push ( createAlgoliaInsightsPlugin ( insightsParams ) ) ;
78
78
}
79
79
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export function getDefaultProps<TItem extends BaseItem>(
32
32
autoFocus : false ,
33
33
defaultActiveItemId : null ,
34
34
stallThreshold : 300 ,
35
- insights : false ,
35
+ insights : undefined ,
36
36
environment,
37
37
shouldPanelOpen : ( { state } ) => getItemsCount ( state ) > 0 ,
38
38
reshape : ( { sources } ) => sources ,
Original file line number Diff line number Diff line change @@ -9,20 +9,28 @@ import {
9
9
} from '@algolia/autocomplete-plugin-algolia-insights' ;
10
10
import {
11
11
AutocompleteOptions as _AutocompleteOptions ,
12
+ InternalAutocompleteOptions as _InternalAutocompleteOptions ,
12
13
BaseItem ,
13
14
} from '@algolia/autocomplete-shared/dist/esm/core' ;
14
15
15
16
export type AutocompleteInsightsApi = _AutocompleteInsightsApi ;
16
17
export type AlgoliaInsightsHit = _AlgoliaInsightsHit ;
17
- export interface AutocompleteOptions < TItem extends BaseItem >
18
- extends _AutocompleteOptions < TItem > {
18
+
19
+ type InsightsOption = {
19
20
/**
20
21
* Whether to enable the Insights plugin and load the Insights library if it has not been loaded yet.
21
22
*
22
23
* See [**autocomplete-plugin-algolia-insights**](https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-plugin-algolia-insights/) for more information.
23
24
*
24
- * @default false
25
+ * @default undefined
25
26
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-insights
26
27
*/
27
- insights ?: CreateAlgoliaInsightsPluginParams | boolean ;
28
- }
28
+ insights ?: CreateAlgoliaInsightsPluginParams | boolean | undefined ;
29
+ } ;
30
+
31
+ export interface AutocompleteOptions < TItem extends BaseItem >
32
+ extends _AutocompleteOptions < TItem > ,
33
+ InsightsOption { }
34
+ export interface InternalAutocompleteOptions < TItem extends BaseItem >
35
+ extends _InternalAutocompleteOptions < TItem > ,
36
+ InsightsOption { }
You can’t perform that action at this time.
0 commit comments