instantsearch.js 4.77.1 → 4.77.3

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.
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _default = exports.default = '4.77.1';
7
+ var _default = exports.default = '4.77.3';
@@ -1888,7 +1888,7 @@ declare const _default_12: <THit extends NonNullable<object> = BaseHit>(widgetPa
1888
1888
  } & {
1889
1889
  results: RecommendResponse<any>;
1890
1890
  })): {
1891
- items: AlgoliaHit<BaseHit>[] | AlgoliaHit<THit>[];
1891
+ items: Hit<BaseHit>[] | Hit<THit>[];
1892
1892
  widgetParams: Partial<RelatedProductsWidgetParams<BaseHit>> & RelatedProductsConnectorParams<THit>;
1893
1893
  sendEvent: SendEventForHits;
1894
1894
  };
@@ -2078,7 +2078,7 @@ declare const _default_13: <THit extends NonNullable<object> = BaseHit>(widgetPa
2078
2078
  } & {
2079
2079
  results: RecommendResponse<any>;
2080
2080
  })): {
2081
- items: AlgoliaHit<THit>[];
2081
+ items: Hit<THit>[];
2082
2082
  widgetParams: Partial<TrendingItemsWidgetParams<BaseHit>> & TrendingItemsConnectorParams<THit>;
2083
2083
  sendEvent: SendEventForHits;
2084
2084
  };
@@ -2268,7 +2268,7 @@ declare const _default_14: <THit extends NonNullable<object> = BaseHit>(widgetPa
2268
2268
  } & {
2269
2269
  results: RecommendResponse<any>;
2270
2270
  })): {
2271
- items: AlgoliaHit<THit>[];
2271
+ items: Hit<THit>[];
2272
2272
  widgetParams: Partial<FrequentlyBoughtTogetherWidgetParams<BaseHit>> & FrequentlyBoughtTogetherConnectorParams<THit>;
2273
2273
  sendEvent: SendEventForHits;
2274
2274
  };
@@ -2458,7 +2458,7 @@ declare const _default_15: <THit extends NonNullable<object> = BaseHit>(widgetPa
2458
2458
  } & {
2459
2459
  results: RecommendResponse<any>;
2460
2460
  })): {
2461
- items: AlgoliaHit<THit>[];
2461
+ items: Hit<THit>[];
2462
2462
  widgetParams: Partial<LookingSimilarWidgetParams<BaseHit>> & LookingSimilarConnectorParams<THit>;
2463
2463
  sendEvent: SendEventForHits;
2464
2464
  };
@@ -2755,7 +2755,7 @@ declare const _default_3: <TWidgetParams extends UnknownWidgetParams>(renderFn:
2755
2755
  } & {
2756
2756
  results: RecommendResponse<any>;
2757
2757
  })): {
2758
- items: AlgoliaHit<BaseHit>[] | AlgoliaHit<THit>[];
2758
+ items: Hit<BaseHit>[] | Hit<THit>[];
2759
2759
  widgetParams: TWidgetParams & RelatedProductsConnectorParams<THit>;
2760
2760
  sendEvent: SendEventForHits;
2761
2761
  };
@@ -2874,7 +2874,7 @@ declare const _default_4: <TWidgetParams extends UnknownWidgetParams>(renderFn:
2874
2874
  } & {
2875
2875
  results: RecommendResponse<any>;
2876
2876
  })): {
2877
- items: AlgoliaHit<THit>[];
2877
+ items: Hit<THit>[];
2878
2878
  widgetParams: TWidgetParams & TrendingItemsConnectorParams<THit>;
2879
2879
  sendEvent: SendEventForHits;
2880
2880
  };
@@ -3213,7 +3213,7 @@ declare const _default_6: <TWidgetParams extends UnknownWidgetParams>(renderFn:
3213
3213
  } & {
3214
3214
  results: RecommendResponse<any>;
3215
3215
  })): {
3216
- items: AlgoliaHit<THit>[];
3216
+ items: Hit<THit>[];
3217
3217
  widgetParams: TWidgetParams & FrequentlyBoughtTogetherConnectorParams<THit>;
3218
3218
  sendEvent: SendEventForHits;
3219
3219
  };
@@ -3332,7 +3332,7 @@ declare const _default_7: <TWidgetParams extends UnknownWidgetParams>(renderFn:
3332
3332
  } & {
3333
3333
  results: RecommendResponse<any>;
3334
3334
  })): {
3335
- items: AlgoliaHit<THit>[];
3335
+ items: Hit<THit>[];
3336
3336
  widgetParams: TWidgetParams & LookingSimilarConnectorParams<THit>;
3337
3337
  sendEvent: SendEventForHits;
3338
3338
  };
@@ -3846,7 +3846,7 @@ declare type FrequentlyBoughtTogetherConnectorParams<THit extends NonNullable<ob
3846
3846
  /**
3847
3847
  * Function to transform the items passed to the templates.
3848
3848
  */
3849
- transformItems?: TransformItems<AlgoliaHit<THit>, {
3849
+ transformItems?: TransformItems<Hit<THit>, {
3850
3850
  results: RecommendResponse<AlgoliaHit<THit>>;
3851
3851
  }>;
3852
3852
  };
@@ -3857,7 +3857,7 @@ declare type FrequentlyBoughtTogetherRenderState<THit extends NonNullable<object
3857
3857
  /**
3858
3858
  * The matched recommendations from Algolia API.
3859
3859
  */
3860
- items: Array<AlgoliaHit<THit>>;
3860
+ items: Array<Hit<THit>>;
3861
3861
  /**
3862
3862
  * Sends an event to the Insights middleware.
3863
3863
  */
@@ -3868,23 +3868,23 @@ declare type FrequentlyBoughtTogetherTemplates<THit extends NonNullable<object>
3868
3868
  /**
3869
3869
  * Template to use when there are no results.
3870
3870
  */
3871
- empty: Template<RecommendResponse<AlgoliaHit<THit>>>;
3871
+ empty: Template<RecommendResponse<Hit<THit>>>;
3872
3872
  /**
3873
3873
  * Template to use for the header of the widget.
3874
3874
  */
3875
- header: Template<Pick<Parameters<NonNullable<FrequentlyBoughtTogetherProps<AlgoliaHit<THit>>['headerComponent']>>[0], 'items'> & {
3875
+ header: Template<Pick<Parameters<NonNullable<FrequentlyBoughtTogetherProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {
3876
3876
  cssClasses: RecommendClassNames;
3877
3877
  }>;
3878
3878
  /**
3879
3879
  * Template to use for each result. This template will receive an object containing a single record.
3880
3880
  */
3881
- item: TemplateWithBindEvent<AlgoliaHit<THit>>;
3881
+ item: TemplateWithBindEvent<Hit<THit>>;
3882
3882
  /**
3883
3883
  * Template to use to wrap all items.
3884
3884
  */
3885
- layout: Template<Pick<Parameters<NonNullable<FrequentlyBoughtTogetherProps<AlgoliaHit<THit>>['layout']>>[0], 'items'> & {
3885
+ layout: Template<Pick<Parameters<NonNullable<FrequentlyBoughtTogetherProps<Hit<THit>>['layout']>>[0], 'items'> & {
3886
3886
  templates: {
3887
- item: FrequentlyBoughtTogetherProps<AlgoliaHit<THit>>['itemComponent'];
3887
+ item: FrequentlyBoughtTogetherProps<Hit<THit>>['itemComponent'];
3888
3888
  };
3889
3889
  cssClasses: Pick<FrequentlyBoughtTogetherCSSClasses, 'list' | 'item'>;
3890
3890
  }>;
@@ -5373,7 +5373,7 @@ declare type LookingSimilarConnectorParams<THit extends NonNullable<object> = Ba
5373
5373
  /**
5374
5374
  * Function to transform the items passed to the templates.
5375
5375
  */
5376
- transformItems?: TransformItems<AlgoliaHit<THit>, {
5376
+ transformItems?: TransformItems<Hit<THit>, {
5377
5377
  results: RecommendResponse<AlgoliaHit<THit>>;
5378
5378
  }>;
5379
5379
  };
@@ -5384,7 +5384,7 @@ declare type LookingSimilarRenderState<THit extends NonNullable<object> = BaseHi
5384
5384
  /**
5385
5385
  * The matched recommendations from the Algolia API.
5386
5386
  */
5387
- items: Array<AlgoliaHit<THit>>;
5387
+ items: Array<Hit<THit>>;
5388
5388
  /**
5389
5389
  * Sends an event to the Insights middleware.
5390
5390
  */
@@ -5395,23 +5395,23 @@ declare type LookingSimilarTemplates<THit extends NonNullable<object> = BaseHit>
5395
5395
  /**
5396
5396
  * Template to use when there are no results.
5397
5397
  */
5398
- empty: Template<RecommendResponse<AlgoliaHit<THit>>>;
5398
+ empty: Template<RecommendResponse<Hit<THit>>>;
5399
5399
  /**
5400
5400
  * Template to use for the header of the widget.
5401
5401
  */
5402
- header: Template<Pick<Parameters<NonNullable<LookingSimilarProps<AlgoliaHit<THit>>['headerComponent']>>[0], 'items'> & {
5402
+ header: Template<Pick<Parameters<NonNullable<LookingSimilarProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {
5403
5403
  cssClasses: RecommendClassNames;
5404
5404
  }>;
5405
5405
  /**
5406
5406
  * Template to use for each result. This template will receive an object containing a single record.
5407
5407
  */
5408
- item: TemplateWithBindEvent<AlgoliaHit<THit>>;
5408
+ item: TemplateWithBindEvent<Hit<THit>>;
5409
5409
  /**
5410
5410
  * Template to use to wrap all items.
5411
5411
  */
5412
- layout: Template<Pick<Parameters<NonNullable<LookingSimilarProps<AlgoliaHit<THit>>['layout']>>[0], 'items'> & {
5412
+ layout: Template<Pick<Parameters<NonNullable<LookingSimilarProps<Hit<THit>>['layout']>>[0], 'items'> & {
5413
5413
  templates: {
5414
- item: LookingSimilarProps<AlgoliaHit<THit>>['itemComponent'];
5414
+ item: LookingSimilarProps<Hit<THit>>['itemComponent'];
5415
5415
  };
5416
5416
  cssClasses: Pick<LookingSimilarCSSClasses, 'list' | 'item'>;
5417
5417
  }>;
@@ -7188,7 +7188,7 @@ declare type RelatedProductsConnectorParams<THit extends NonNullable<object> = B
7188
7188
  /**
7189
7189
  * Function to transform the items passed to the templates.
7190
7190
  */
7191
- transformItems?: TransformItems<AlgoliaHit<THit>, {
7191
+ transformItems?: TransformItems<Hit<THit>, {
7192
7192
  results: RecommendResponse<AlgoliaHit<THit>>;
7193
7193
  }>;
7194
7194
  };
@@ -7199,7 +7199,7 @@ declare type RelatedProductsRenderState<THit extends NonNullable<object> = BaseH
7199
7199
  /**
7200
7200
  * The matched recommendations from the Algolia API.
7201
7201
  */
7202
- items: Array<AlgoliaHit<THit>>;
7202
+ items: Array<Hit<THit>>;
7203
7203
  /**
7204
7204
  * Sends an event to the Insights middleware.
7205
7205
  */
@@ -7210,23 +7210,23 @@ declare type RelatedProductsTemplates<THit extends NonNullable<object> = BaseHit
7210
7210
  /**
7211
7211
  * Template to use when there are no results.
7212
7212
  */
7213
- empty: Template<RecommendResponse<AlgoliaHit<THit>>>;
7213
+ empty: Template<RecommendResponse<Hit<THit>>>;
7214
7214
  /**
7215
7215
  * Template to use for the header of the widget.
7216
7216
  */
7217
- header: Template<Pick<Parameters<NonNullable<RelatedProductsProps<AlgoliaHit<THit>>['headerComponent']>>[0], 'items'> & {
7217
+ header: Template<Pick<Parameters<NonNullable<RelatedProductsProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {
7218
7218
  cssClasses: RecommendClassNames;
7219
7219
  }>;
7220
7220
  /**
7221
7221
  * Template to use for each result. This template will receive an object containing a single record.
7222
7222
  */
7223
- item: TemplateWithBindEvent<AlgoliaHit<THit>>;
7223
+ item: TemplateWithBindEvent<Hit<THit>>;
7224
7224
  /**
7225
7225
  * Template to use to wrap all items.
7226
7226
  */
7227
- layout: Template<Pick<Parameters<NonNullable<RelatedProductsProps<AlgoliaHit<THit>>['layout']>>[0], 'items'> & {
7227
+ layout: Template<Pick<Parameters<NonNullable<RelatedProductsProps<Hit<THit>>['layout']>>[0], 'items'> & {
7228
7228
  templates: {
7229
- item: RelatedProductsProps<AlgoliaHit<THit>>['itemComponent'];
7229
+ item: RelatedProductsProps<Hit<THit>>['itemComponent'];
7230
7230
  };
7231
7231
  cssClasses: Pick<RelatedProductsCSSClasses, 'list' | 'item'>;
7232
7232
  }>;
@@ -8356,7 +8356,7 @@ declare type TrendingItemsConnectorParams<THit extends NonNullable<object> = Bas
8356
8356
  /**
8357
8357
  * Function to transform the items passed to the templates.
8358
8358
  */
8359
- transformItems?: TransformItems<AlgoliaHit<THit>, {
8359
+ transformItems?: TransformItems<Hit<THit>, {
8360
8360
  results: RecommendResponse<AlgoliaHit<THit>>;
8361
8361
  }>;
8362
8362
  };
@@ -8367,7 +8367,7 @@ declare type TrendingItemsRenderState<THit extends NonNullable<object> = BaseHit
8367
8367
  /**
8368
8368
  * The matched recommendations from the Algolia API.
8369
8369
  */
8370
- items: Array<AlgoliaHit<THit>>;
8370
+ items: Array<Hit<THit>>;
8371
8371
  /**
8372
8372
  * Sends an event to the Insights middleware.
8373
8373
  */
@@ -8378,23 +8378,23 @@ declare type TrendingItemsTemplates<THit extends NonNullable<object> = BaseHit>
8378
8378
  /**
8379
8379
  * Template to use when there are no results.
8380
8380
  */
8381
- empty: Template<RecommendResponse<AlgoliaHit<THit>>>;
8381
+ empty: Template<RecommendResponse<Hit<THit>>>;
8382
8382
  /**
8383
8383
  * Template to use for the header of the widget.
8384
8384
  */
8385
- header: Template<Pick<Parameters<NonNullable<TrendingItemsProps<AlgoliaHit<THit>>['headerComponent']>>[0], 'items'> & {
8385
+ header: Template<Pick<Parameters<NonNullable<TrendingItemsProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {
8386
8386
  cssClasses: RecommendClassNames;
8387
8387
  }>;
8388
8388
  /**
8389
8389
  * Template to use for each result. This template will receive an object containing a single record.
8390
8390
  */
8391
- item: TemplateWithBindEvent<AlgoliaHit<THit>>;
8391
+ item: TemplateWithBindEvent<Hit<THit>>;
8392
8392
  /**
8393
8393
  * Template to use to wrap all items.
8394
8394
  */
8395
- layout: Template<Pick<Parameters<NonNullable<TrendingItemsProps<AlgoliaHit<THit>>['layout']>>[0], 'items'> & {
8395
+ layout: Template<Pick<Parameters<NonNullable<TrendingItemsProps<Hit<THit>>['layout']>>[0], 'items'> & {
8396
8396
  templates: {
8397
- item: TrendingItemsProps<AlgoliaHit<THit>>['itemComponent'];
8397
+ item: TrendingItemsProps<Hit<THit>>['itemComponent'];
8398
8398
  };
8399
8399
  cssClasses: Pick<TrendingItemsCSSClasses, 'list' | 'item'>;
8400
8400
  }>;
@@ -1,4 +1,4 @@
1
- /*! InstantSearch.js 4.77.1 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch */
1
+ /*! InstantSearch.js 4.77.3 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -6583,7 +6583,7 @@
6583
6583
 
6584
6584
  var sortAndMergeRecommendations_1 = sortAndMergeRecommendations;
6585
6585
 
6586
- var version = '3.23.1';
6586
+ var version = '3.24.1';
6587
6587
 
6588
6588
  var escapeFacetValue$4 = escapeFacetValue_1.escapeFacetValue;
6589
6589
 
@@ -8426,6 +8426,14 @@
8426
8426
  if (this._currentNbQueries === 0) this.emit('searchQueueEmpty');
8427
8427
 
8428
8428
  var results = content.results.slice();
8429
+ var rawContent = Object.keys(content).reduce(function (value, key) {
8430
+ if (key !== 'results') value[key] = content[key];
8431
+ return value;
8432
+ }, {});
8433
+
8434
+ if (Object.keys(rawContent).length <= 0) {
8435
+ rawContent = undefined;
8436
+ }
8429
8437
 
8430
8438
  states.forEach(function (s) {
8431
8439
  var state = s.state;
@@ -8446,6 +8454,7 @@
8446
8454
  specificResults,
8447
8455
  self._searchResultsOptions
8448
8456
  );
8457
+ if (rawContent !== undefined) helper.lastResults._rawContent = rawContent;
8449
8458
 
8450
8459
  helper.emit('result', {
8451
8460
  results: helper.lastResults,
@@ -16408,7 +16417,7 @@
16408
16417
  };
16409
16418
  }
16410
16419
 
16411
- var version$1 = '4.77.1';
16420
+ var version$1 = '4.77.3';
16412
16421
 
16413
16422
  var withUsage$v = createDocumentationMessageGenerator({
16414
16423
  name: 'instantsearch'