instantsearch.js 4.83.0 → 4.85.0
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.
- package/cjs/connectors/chat/connectChat.js +2 -1
- package/cjs/lib/utils/getAlgoliaAgent.js +10 -0
- package/cjs/lib/utils/index.js +11 -0
- package/cjs/lib/version.js +1 -1
- package/cjs/middlewares/createMetadataMiddleware.js +1 -2
- package/cjs/widgets/autocomplete/autocomplete.js +146 -74
- package/cjs/widgets/chat/chat.js +3 -3
- package/cjs/widgets/index/index.js +10 -6
- package/dist/instantsearch.development.d.ts +31 -2
- package/dist/instantsearch.development.js +268 -134
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.production.d.ts +31 -2
- package/dist/instantsearch.production.min.d.ts +31 -2
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/connectors/chat/connectChat.js +3 -2
- package/es/lib/utils/getAlgoliaAgent.d.ts +1 -0
- package/es/lib/utils/getAlgoliaAgent.js +4 -0
- package/es/lib/utils/index.d.ts +1 -0
- package/es/lib/utils/index.js +1 -0
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/es/middlewares/createMetadataMiddleware.js +2 -3
- package/es/widgets/autocomplete/autocomplete.d.ts +26 -3
- package/es/widgets/autocomplete/autocomplete.js +147 -75
- package/es/widgets/chat/chat.js +4 -4
- package/es/widgets/index/index.d.ts +5 -0
- package/es/widgets/index/index.js +11 -7
- package/package.json +6 -6
|
@@ -309,7 +309,17 @@ declare type AutocompleteRenderState = {
|
|
|
309
309
|
refine: (query: string) => void;
|
|
310
310
|
};
|
|
311
311
|
|
|
312
|
-
declare type
|
|
312
|
+
declare type AutocompleteSearchParameters = Omit<PlainSearchParameters, 'index'>;
|
|
313
|
+
|
|
314
|
+
declare type AutocompleteTemplates = {
|
|
315
|
+
/**
|
|
316
|
+
* Template to use for the panel.
|
|
317
|
+
*/
|
|
318
|
+
panel?: Template<{
|
|
319
|
+
elements: PanelElements;
|
|
320
|
+
indices: AutocompleteRenderState['indices'];
|
|
321
|
+
}>;
|
|
322
|
+
};
|
|
313
323
|
|
|
314
324
|
declare type AutocompleteWidgetDescription = {
|
|
315
325
|
$$type: 'ais.autocomplete';
|
|
@@ -355,16 +365,24 @@ declare type AutocompleteWidgetParams<TItem extends BaseHit> = {
|
|
|
355
365
|
}>;
|
|
356
366
|
}>;
|
|
357
367
|
};
|
|
368
|
+
/**
|
|
369
|
+
* Search parameters to apply to the autocomplete indices.
|
|
370
|
+
*/
|
|
371
|
+
searchParameters?: AutocompleteSearchParameters;
|
|
358
372
|
getSearchPageURL?: (nextUiState: IndexUiState) => string;
|
|
359
373
|
onSelect?: AutocompleteIndexConfig<TItem>['onSelect'];
|
|
360
374
|
/**
|
|
361
375
|
* Templates to use for the widget.
|
|
362
376
|
*/
|
|
363
|
-
templates?: AutocompleteTemplates
|
|
377
|
+
templates?: AutocompleteTemplates;
|
|
364
378
|
/**
|
|
365
379
|
* CSS classes to add.
|
|
366
380
|
*/
|
|
367
381
|
cssClasses?: AutocompleteCSSClasses;
|
|
382
|
+
/**
|
|
383
|
+
* Placeholder text for the search input.
|
|
384
|
+
*/
|
|
385
|
+
placeholder?: string;
|
|
368
386
|
};
|
|
369
387
|
|
|
370
388
|
declare type BaseHit = Record<string, any>;
|
|
@@ -4887,6 +4905,10 @@ declare type IndexConfig<TItem extends BaseHit> = AutocompleteIndexConfig<TItem>
|
|
|
4887
4905
|
onSelect: () => void;
|
|
4888
4906
|
}>;
|
|
4889
4907
|
}>;
|
|
4908
|
+
/**
|
|
4909
|
+
* Search parameters to apply to this index.
|
|
4910
|
+
*/
|
|
4911
|
+
searchParameters?: AutocompleteSearchParameters;
|
|
4890
4912
|
cssClasses?: Partial<AutocompleteIndexClassNames>;
|
|
4891
4913
|
};
|
|
4892
4914
|
|
|
@@ -4947,6 +4969,11 @@ declare type IndexWidget<TUiState extends UiState = UiState> = Omit<Widget<Index
|
|
|
4947
4969
|
* @private
|
|
4948
4970
|
*/
|
|
4949
4971
|
_isolated: boolean;
|
|
4972
|
+
/**
|
|
4973
|
+
* Schedules a search for this index only.
|
|
4974
|
+
* @private
|
|
4975
|
+
*/
|
|
4976
|
+
scheduleLocalSearch: () => void;
|
|
4950
4977
|
};
|
|
4951
4978
|
|
|
4952
4979
|
declare type IndexWidgetDescription = {
|
|
@@ -6350,6 +6377,8 @@ declare type PanelCSSClasses = Partial<{
|
|
|
6350
6377
|
footer: string | string[];
|
|
6351
6378
|
}>;
|
|
6352
6379
|
|
|
6380
|
+
declare type PanelElements = Partial<Record<'recent' | 'suggestions' | (string & {}), preact.JSX.Element>>;
|
|
6381
|
+
|
|
6353
6382
|
declare type PanelRenderOptions<TWidgetFactory extends AnyWidgetFactory> = RenderOptions & GetWidgetRenderState<TWidgetFactory>;
|
|
6354
6383
|
|
|
6355
6384
|
declare type PanelTemplates<TWidget extends AnyWidgetFactory> = Partial<{
|
|
@@ -309,7 +309,17 @@ declare type AutocompleteRenderState = {
|
|
|
309
309
|
refine: (query: string) => void;
|
|
310
310
|
};
|
|
311
311
|
|
|
312
|
-
declare type
|
|
312
|
+
declare type AutocompleteSearchParameters = Omit<PlainSearchParameters, 'index'>;
|
|
313
|
+
|
|
314
|
+
declare type AutocompleteTemplates = {
|
|
315
|
+
/**
|
|
316
|
+
* Template to use for the panel.
|
|
317
|
+
*/
|
|
318
|
+
panel?: Template<{
|
|
319
|
+
elements: PanelElements;
|
|
320
|
+
indices: AutocompleteRenderState['indices'];
|
|
321
|
+
}>;
|
|
322
|
+
};
|
|
313
323
|
|
|
314
324
|
declare type AutocompleteWidgetDescription = {
|
|
315
325
|
$$type: 'ais.autocomplete';
|
|
@@ -355,16 +365,24 @@ declare type AutocompleteWidgetParams<TItem extends BaseHit> = {
|
|
|
355
365
|
}>;
|
|
356
366
|
}>;
|
|
357
367
|
};
|
|
368
|
+
/**
|
|
369
|
+
* Search parameters to apply to the autocomplete indices.
|
|
370
|
+
*/
|
|
371
|
+
searchParameters?: AutocompleteSearchParameters;
|
|
358
372
|
getSearchPageURL?: (nextUiState: IndexUiState) => string;
|
|
359
373
|
onSelect?: AutocompleteIndexConfig<TItem>['onSelect'];
|
|
360
374
|
/**
|
|
361
375
|
* Templates to use for the widget.
|
|
362
376
|
*/
|
|
363
|
-
templates?: AutocompleteTemplates
|
|
377
|
+
templates?: AutocompleteTemplates;
|
|
364
378
|
/**
|
|
365
379
|
* CSS classes to add.
|
|
366
380
|
*/
|
|
367
381
|
cssClasses?: AutocompleteCSSClasses;
|
|
382
|
+
/**
|
|
383
|
+
* Placeholder text for the search input.
|
|
384
|
+
*/
|
|
385
|
+
placeholder?: string;
|
|
368
386
|
};
|
|
369
387
|
|
|
370
388
|
declare type BaseHit = Record<string, any>;
|
|
@@ -4887,6 +4905,10 @@ declare type IndexConfig<TItem extends BaseHit> = AutocompleteIndexConfig<TItem>
|
|
|
4887
4905
|
onSelect: () => void;
|
|
4888
4906
|
}>;
|
|
4889
4907
|
}>;
|
|
4908
|
+
/**
|
|
4909
|
+
* Search parameters to apply to this index.
|
|
4910
|
+
*/
|
|
4911
|
+
searchParameters?: AutocompleteSearchParameters;
|
|
4890
4912
|
cssClasses?: Partial<AutocompleteIndexClassNames>;
|
|
4891
4913
|
};
|
|
4892
4914
|
|
|
@@ -4947,6 +4969,11 @@ declare type IndexWidget<TUiState extends UiState = UiState> = Omit<Widget<Index
|
|
|
4947
4969
|
* @private
|
|
4948
4970
|
*/
|
|
4949
4971
|
_isolated: boolean;
|
|
4972
|
+
/**
|
|
4973
|
+
* Schedules a search for this index only.
|
|
4974
|
+
* @private
|
|
4975
|
+
*/
|
|
4976
|
+
scheduleLocalSearch: () => void;
|
|
4950
4977
|
};
|
|
4951
4978
|
|
|
4952
4979
|
declare type IndexWidgetDescription = {
|
|
@@ -6350,6 +6377,8 @@ declare type PanelCSSClasses = Partial<{
|
|
|
6350
6377
|
footer: string | string[];
|
|
6351
6378
|
}>;
|
|
6352
6379
|
|
|
6380
|
+
declare type PanelElements = Partial<Record<'recent' | 'suggestions' | (string & {}), preact.JSX.Element>>;
|
|
6381
|
+
|
|
6353
6382
|
declare type PanelRenderOptions<TWidgetFactory extends AnyWidgetFactory> = RenderOptions & GetWidgetRenderState<TWidgetFactory>;
|
|
6354
6383
|
|
|
6355
6384
|
declare type PanelTemplates<TWidget extends AnyWidgetFactory> = Partial<{
|