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<
6969 }
7070
7171 if (
72- options . insights &&
72+ props . insights &&
7373 ! props . plugins . some ( ( plugin ) => plugin . name === 'aa.algoliaInsightsPlugin' )
7474 ) {
7575 const insightsParams =
76- typeof options . insights === 'boolean' ? { } : options . insights ;
76+ typeof props . insights === 'boolean' ? { } : props . insights ;
7777 props . plugins . push ( createAlgoliaInsightsPlugin ( insightsParams ) ) ;
7878 }
7979
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export function getDefaultProps<TItem extends BaseItem>(
3232 autoFocus : false ,
3333 defaultActiveItemId : null ,
3434 stallThreshold : 300 ,
35- insights : false ,
35+ insights : undefined ,
3636 environment,
3737 shouldPanelOpen : ( { state } ) => getItemsCount ( state ) > 0 ,
3838 reshape : ( { sources } ) => sources ,
Original file line number Diff line number Diff line change @@ -9,20 +9,28 @@ import {
99} from '@algolia/autocomplete-plugin-algolia-insights' ;
1010import {
1111 AutocompleteOptions as _AutocompleteOptions ,
12+ InternalAutocompleteOptions as _InternalAutocompleteOptions ,
1213 BaseItem ,
1314} from '@algolia/autocomplete-shared/dist/esm/core' ;
1415
1516export type AutocompleteInsightsApi = _AutocompleteInsightsApi ;
1617export type AlgoliaInsightsHit = _AlgoliaInsightsHit ;
17- export interface AutocompleteOptions < TItem extends BaseItem >
18- extends _AutocompleteOptions < TItem > {
18+
19+ type InsightsOption = {
1920 /**
2021 * Whether to enable the Insights plugin and load the Insights library if it has not been loaded yet.
2122 *
2223 * See [**autocomplete-plugin-algolia-insights**](https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-plugin-algolia-insights/) for more information.
2324 *
24- * @default false
25+ * @default undefined
2526 * @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-insights
2627 */
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