react-instantsearch-core 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.
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _default = '6.38.2';
7
+ var _default = '6.39.0';
8
8
  exports.default = _default;
@@ -1 +1 @@
1
- export default '6.38.2';
1
+ export default '6.39.0';
@@ -871,7 +871,7 @@
871
871
  });
872
872
  }
873
873
 
874
- var version = '6.38.2';
874
+ var version = '6.39.0';
875
875
 
876
876
  function translatable(defaultTranslations) {
877
877
  return function (Composed) {
@@ -1235,7 +1235,8 @@
1235
1235
  for (var key in source) {
1236
1236
  if (
1237
1237
  !Object.prototype.hasOwnProperty.call(source, key) ||
1238
- key === '__proto__'
1238
+ key === '__proto__' ||
1239
+ key === 'constructor'
1239
1240
  ) {
1240
1241
  continue;
1241
1242
  }
@@ -4051,7 +4052,33 @@
4051
4052
  };
4052
4053
  });
4053
4054
  } else if (results._state.isHierarchicalFacet(attribute)) {
4054
- return find$1(results.hierarchicalFacets, predicate);
4055
+ var hierarchicalFacetValues = find$1(results.hierarchicalFacets, predicate);
4056
+ if (!hierarchicalFacetValues) return hierarchicalFacetValues;
4057
+
4058
+ var hierarchicalFacet = results._state.getHierarchicalFacetByName(attribute);
4059
+ var currentRefinementSplit = unescapeFacetValue$3(
4060
+ results._state.getHierarchicalRefinement(attribute)[0] || ''
4061
+ ).split(results._state._getHierarchicalFacetSeparator(hierarchicalFacet));
4062
+ currentRefinementSplit.unshift(attribute);
4063
+
4064
+ setIsRefined(hierarchicalFacetValues, currentRefinementSplit, 0);
4065
+
4066
+ return hierarchicalFacetValues;
4067
+ }
4068
+ }
4069
+
4070
+ /**
4071
+ * Set the isRefined of a hierarchical facet result based on the current state.
4072
+ * @param {SearchResults.HierarchicalFacet} item Hierarchical facet to fix
4073
+ * @param {string[]} currentRefinementSplit array of parts of the current hierarchical refinement
4074
+ * @param {number} depth recursion depth in the currentRefinement
4075
+ */
4076
+ function setIsRefined(item, currentRefinement, depth) {
4077
+ item.isRefined = item.name === currentRefinement[depth];
4078
+ if (item.data) {
4079
+ item.data.forEach(function(child) {
4080
+ setIsRefined(child, currentRefinement, depth + 1);
4081
+ });
4055
4082
  }
4056
4083
  }
4057
4084
 
@@ -5140,7 +5167,7 @@
5140
5167
 
5141
5168
  var requestBuilder_1 = requestBuilder;
5142
5169
 
5143
- var version$1 = '3.11.1';
5170
+ var version$1 = '3.11.3';
5144
5171
 
5145
5172
  var escapeFacetValue$3 = escapeFacetValue_1.escapeFacetValue;
5146
5173
 
@@ -5390,8 +5417,10 @@
5390
5417
  * @param {number} options.nbHits - Maximum number of answers to retrieve from the Answers Engine. Cannot be greater than 1000.
5391
5418
  *
5392
5419
  * @return {promise} the answer results
5420
+ * @deprecated answers is deprecated and will be replaced with new initiatives
5393
5421
  */
5394
5422
  AlgoliaSearchHelper.prototype.findAnswers = function(options) {
5423
+ console.warn('[algoliasearch-helper] answers is no longer supported');
5395
5424
  var state = this.state;
5396
5425
  var derivedHelper = this.derivedHelpers[0];
5397
5426
  if (!derivedHelper) {