react-instantsearch 6.38.2 → 6.39.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/dist/umd/Dom.js CHANGED
@@ -868,7 +868,7 @@
868
868
  });
869
869
  }
870
870
 
871
- var version = '6.38.2';
871
+ var version = '6.39.0';
872
872
 
873
873
  function _typeof$2(obj) {
874
874
  "@babel/helpers - typeof";
@@ -1530,7 +1530,8 @@
1530
1530
  for (var key in source) {
1531
1531
  if (
1532
1532
  !Object.prototype.hasOwnProperty.call(source, key) ||
1533
- key === '__proto__'
1533
+ key === '__proto__' ||
1534
+ key === 'constructor'
1534
1535
  ) {
1535
1536
  continue;
1536
1537
  }
@@ -4346,7 +4347,33 @@
4346
4347
  };
4347
4348
  });
4348
4349
  } else if (results._state.isHierarchicalFacet(attribute)) {
4349
- return find$1(results.hierarchicalFacets, predicate);
4350
+ var hierarchicalFacetValues = find$1(results.hierarchicalFacets, predicate);
4351
+ if (!hierarchicalFacetValues) return hierarchicalFacetValues;
4352
+
4353
+ var hierarchicalFacet = results._state.getHierarchicalFacetByName(attribute);
4354
+ var currentRefinementSplit = unescapeFacetValue$3(
4355
+ results._state.getHierarchicalRefinement(attribute)[0] || ''
4356
+ ).split(results._state._getHierarchicalFacetSeparator(hierarchicalFacet));
4357
+ currentRefinementSplit.unshift(attribute);
4358
+
4359
+ setIsRefined(hierarchicalFacetValues, currentRefinementSplit, 0);
4360
+
4361
+ return hierarchicalFacetValues;
4362
+ }
4363
+ }
4364
+
4365
+ /**
4366
+ * Set the isRefined of a hierarchical facet result based on the current state.
4367
+ * @param {SearchResults.HierarchicalFacet} item Hierarchical facet to fix
4368
+ * @param {string[]} currentRefinementSplit array of parts of the current hierarchical refinement
4369
+ * @param {number} depth recursion depth in the currentRefinement
4370
+ */
4371
+ function setIsRefined(item, currentRefinement, depth) {
4372
+ item.isRefined = item.name === currentRefinement[depth];
4373
+ if (item.data) {
4374
+ item.data.forEach(function(child) {
4375
+ setIsRefined(child, currentRefinement, depth + 1);
4376
+ });
4350
4377
  }
4351
4378
  }
4352
4379
 
@@ -5435,7 +5462,7 @@
5435
5462
 
5436
5463
  var requestBuilder_1 = requestBuilder;
5437
5464
 
5438
- var version$1 = '3.11.1';
5465
+ var version$1 = '3.11.3';
5439
5466
 
5440
5467
  var escapeFacetValue$3 = escapeFacetValue_1.escapeFacetValue;
5441
5468
 
@@ -5685,8 +5712,10 @@
5685
5712
  * @param {number} options.nbHits - Maximum number of answers to retrieve from the Answers Engine. Cannot be greater than 1000.
5686
5713
  *
5687
5714
  * @return {promise} the answer results
5715
+ * @deprecated answers is deprecated and will be replaced with new initiatives
5688
5716
  */
5689
5717
  AlgoliaSearchHelper.prototype.findAnswers = function(options) {
5718
+ console.warn('[algoliasearch-helper] answers is no longer supported');
5690
5719
  var state = this.state;
5691
5720
  var derivedHelper = this.derivedHelpers[0];
5692
5721
  if (!derivedHelper) {