instantsearch.js 4.33.0 → 4.35.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +24 -1
  3. package/cjs/connectors/autocomplete/connectAutocomplete.js +2 -1
  4. package/cjs/connectors/infinite-hits/connectInfiniteHits.js +1 -1
  5. package/cjs/connectors/numeric-menu/connectNumericMenu.js +6 -4
  6. package/cjs/connectors/pagination/connectPagination.js +3 -3
  7. package/cjs/connectors/search-box/connectSearchBox.js +4 -3
  8. package/cjs/connectors/sort-by/connectSortBy.js +2 -1
  9. package/cjs/connectors/stats/connectStats.js +4 -4
  10. package/cjs/connectors/toggle-refinement/connectToggleRefinement.js +1 -1
  11. package/cjs/lib/InstantSearch.js +23 -2
  12. package/cjs/lib/version.js +1 -1
  13. package/cjs/widgets/index/index.js +21 -3
  14. package/dist/instantsearch.development.d.ts +9 -2
  15. package/dist/instantsearch.development.js +72 -28
  16. package/dist/instantsearch.development.js.map +1 -1
  17. package/dist/instantsearch.development.min.d.ts +9 -2
  18. package/dist/instantsearch.production.d.ts +9 -2
  19. package/dist/instantsearch.production.min.d.ts +9 -2
  20. package/dist/instantsearch.production.min.js +2 -2
  21. package/dist/instantsearch.production.min.js.map +1 -1
  22. package/es/connectors/autocomplete/connectAutocomplete.js +2 -1
  23. package/es/connectors/infinite-hits/connectInfiniteHits.js +1 -1
  24. package/es/connectors/numeric-menu/connectNumericMenu.js +6 -4
  25. package/es/connectors/pagination/connectPagination.js +3 -3
  26. package/es/connectors/search-box/connectSearchBox.js +4 -3
  27. package/es/connectors/sort-by/connectSortBy.js +2 -1
  28. package/es/connectors/stats/connectStats.js +4 -4
  29. package/es/connectors/toggle-refinement/connectToggleRefinement.js +1 -1
  30. package/es/lib/InstantSearch.d.ts +3 -3
  31. package/es/lib/InstantSearch.js +23 -2
  32. package/es/lib/version.d.ts +1 -1
  33. package/es/lib/version.js +1 -1
  34. package/es/types/results.d.ts +7 -0
  35. package/es/widgets/index/index.js +21 -3
  36. package/package.json +10 -7
@@ -1,10 +1,9 @@
1
1
  /// <reference types="google.maps" />
2
- /// <reference types="node" />
3
2
 
4
3
  import type algoliasearch from 'algoliasearch/lite';
5
4
  import type { AlgoliaSearchHelper } from 'algoliasearch-helper';
6
5
  import type * as ClientSearch from '@algolia/client-search';
7
- import EventEmitter from 'events';
6
+ import EventEmitter from '@algolia/events';
8
7
  import type { InsightsClient as InsightsClient_2 } from 'search-insights';
9
8
  import type { InsightsMethodMap } from 'search-insights';
10
9
  import type * as Places from 'places.js';
@@ -2194,6 +2193,13 @@ declare type InfiniteHitsWidgetParams = {
2194
2193
  cache?: InfiniteHitsCache;
2195
2194
  };
2196
2195
 
2196
+ declare type InitialResult = {
2197
+ state: PlainSearchParameters;
2198
+ results: SearchResults['_rawResults'];
2199
+ };
2200
+
2201
+ declare type InitialResults = Record<string, InitialResult>;
2202
+
2197
2203
  declare type InitOptions = SharedRenderOptions & {
2198
2204
  uiState: UiState;
2199
2205
  results?: undefined;
@@ -2258,6 +2264,7 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
2258
2264
  _searchStalledTimer: any;
2259
2265
  _isSearchStalled: boolean;
2260
2266
  _initialUiState: UiState;
2267
+ _initialResults: InitialResults | null;
2261
2268
  _createURL: CreateURL<UiState>;
2262
2269
  _searchFunction?: InstantSearchOptions['searchFunction'];
2263
2270
  _mainHelperSearch?: AlgoliaSearchHelper['search'];
@@ -1,10 +1,9 @@
1
1
  /// <reference types="google.maps" />
2
- /// <reference types="node" />
3
2
 
4
3
  import type algoliasearch from 'algoliasearch/lite';
5
4
  import type { AlgoliaSearchHelper } from 'algoliasearch-helper';
6
5
  import type * as ClientSearch from '@algolia/client-search';
7
- import EventEmitter from 'events';
6
+ import EventEmitter from '@algolia/events';
8
7
  import type { InsightsClient as InsightsClient_2 } from 'search-insights';
9
8
  import type { InsightsMethodMap } from 'search-insights';
10
9
  import type * as Places from 'places.js';
@@ -2194,6 +2193,13 @@ declare type InfiniteHitsWidgetParams = {
2194
2193
  cache?: InfiniteHitsCache;
2195
2194
  };
2196
2195
 
2196
+ declare type InitialResult = {
2197
+ state: PlainSearchParameters;
2198
+ results: SearchResults['_rawResults'];
2199
+ };
2200
+
2201
+ declare type InitialResults = Record<string, InitialResult>;
2202
+
2197
2203
  declare type InitOptions = SharedRenderOptions & {
2198
2204
  uiState: UiState;
2199
2205
  results?: undefined;
@@ -2258,6 +2264,7 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
2258
2264
  _searchStalledTimer: any;
2259
2265
  _isSearchStalled: boolean;
2260
2266
  _initialUiState: UiState;
2267
+ _initialResults: InitialResults | null;
2261
2268
  _createURL: CreateURL<UiState>;
2262
2269
  _searchFunction?: InstantSearchOptions['searchFunction'];
2263
2270
  _mainHelperSearch?: AlgoliaSearchHelper['search'];
@@ -1,10 +1,9 @@
1
1
  /// <reference types="google.maps" />
2
- /// <reference types="node" />
3
2
 
4
3
  import type algoliasearch from 'algoliasearch/lite';
5
4
  import type { AlgoliaSearchHelper } from 'algoliasearch-helper';
6
5
  import type * as ClientSearch from '@algolia/client-search';
7
- import EventEmitter from 'events';
6
+ import EventEmitter from '@algolia/events';
8
7
  import type { InsightsClient as InsightsClient_2 } from 'search-insights';
9
8
  import type { InsightsMethodMap } from 'search-insights';
10
9
  import type * as Places from 'places.js';
@@ -2194,6 +2193,13 @@ declare type InfiniteHitsWidgetParams = {
2194
2193
  cache?: InfiniteHitsCache;
2195
2194
  };
2196
2195
 
2196
+ declare type InitialResult = {
2197
+ state: PlainSearchParameters;
2198
+ results: SearchResults['_rawResults'];
2199
+ };
2200
+
2201
+ declare type InitialResults = Record<string, InitialResult>;
2202
+
2197
2203
  declare type InitOptions = SharedRenderOptions & {
2198
2204
  uiState: UiState;
2199
2205
  results?: undefined;
@@ -2258,6 +2264,7 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
2258
2264
  _searchStalledTimer: any;
2259
2265
  _isSearchStalled: boolean;
2260
2266
  _initialUiState: UiState;
2267
+ _initialResults: InitialResults | null;
2261
2268
  _createURL: CreateURL<UiState>;
2262
2269
  _searchFunction?: InstantSearchOptions['searchFunction'];
2263
2270
  _mainHelperSearch?: AlgoliaSearchHelper['search'];