react-instantsearch 7.15.4 → 7.15.6

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/README.md CHANGED
@@ -51,7 +51,7 @@ Using React InstantSearch is as simple as adding these components to your app:
51
51
  ```javascript
52
52
  import React from 'react';
53
53
  import ReactDOM from 'react-dom';
54
- import algoliasearch from 'algoliasearch/lite';
54
+ import { liteClient as algoliasearch } from 'algoliasearch/lite';
55
55
  import { InstantSearch, SearchBox, Hits } from 'react-instantsearch';
56
56
 
57
57
  const searchClient = algoliasearch(
@@ -7,7 +7,7 @@
7
7
 
8
8
  var React__default = 'default' in React ? React['default'] : React;
9
9
 
10
- var version = '7.15.4';
10
+ var version = '7.15.6';
11
11
 
12
12
  // Copyright Joyent, Inc. and other Node contributors.
13
13
  //
@@ -804,7 +804,16 @@
804
804
  var facets = state.facets
805
805
  .concat(
806
806
  state.disjunctiveFacets.map(function (value) {
807
- return 'disjunctive(' + value + ')';
807
+ if (
808
+ state.disjunctiveFacetsRefinements &&
809
+ state.disjunctiveFacetsRefinements[value] &&
810
+ state.disjunctiveFacetsRefinements[value].length > 0
811
+ ) {
812
+ // only tag a disjunctiveFacet as disjunctive if it has a value selected
813
+ // this helps avoid hitting the limit of 20 disjunctive facets in the Composition API
814
+ return 'disjunctive(' + value + ')';
815
+ }
816
+ return value;
808
817
  })
809
818
  )
810
819
  .concat(requestBuilder._getHitsHierarchicalFacetsAttributes(state))
@@ -4589,11 +4598,13 @@
4589
4598
  });
4590
4599
  }
4591
4600
 
4592
- function sortAndMergeRecommendations(results) {
4601
+ function sortAndMergeRecommendations(objectIDs, results) {
4593
4602
  var indexTracker = {};
4594
4603
 
4595
4604
  results.forEach(function (hits) {
4596
4605
  hits.forEach(function (hit, index) {
4606
+ if (objectIDs.includes(hit.objectID)) return;
4607
+
4597
4608
  if (!indexTracker[hit.objectID]) {
4598
4609
  indexTracker[hit.objectID] = { indexSum: index, count: 1 };
4599
4610
  } else {
@@ -4623,7 +4634,7 @@
4623
4634
 
4624
4635
  var sortAndMergeRecommendations_1 = sortAndMergeRecommendations;
4625
4636
 
4626
- var version$1 = '3.24.2';
4637
+ var version$1 = '3.25.0';
4627
4638
 
4628
4639
  var escapeFacetValue$3 = escapeFacetValue_1.escapeFacetValue;
4629
4640
 
@@ -6544,6 +6555,7 @@
6544
6555
  }
6545
6556
  cache[id] = Object.assign({}, firstResult, {
6546
6557
  hits: sortAndMergeRecommendations_1(
6558
+ ids,
6547
6559
  indices.map(function (idx) {
6548
6560
  return content.results[idx].hits;
6549
6561
  })
@@ -13421,7 +13433,7 @@
13421
13433
  };
13422
13434
  }
13423
13435
 
13424
- var version$3 = '4.78.0';
13436
+ var version$3 = '4.78.2';
13425
13437
 
13426
13438
  function _typeof$q(o) {
13427
13439
  "@babel/helpers - typeof";