instantsearch.js 4.56.0 → 4.56.2

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.
@@ -52,6 +52,10 @@ function Hits(_ref) {
52
52
  onClick: function onClick(event) {
53
53
  handleInsightsClick(event);
54
54
  sendEvent('click:internal', hit, 'Hit Clicked');
55
+ },
56
+ onAuxClick: function onAuxClick(event) {
57
+ handleInsightsClick(event);
58
+ sendEvent('click:internal', hit, 'Hit Clicked');
55
59
  }
56
60
  },
57
61
  key: hit.objectID,
@@ -65,6 +65,10 @@ var InfiniteHits = function InfiniteHits(_ref) {
65
65
  onClick: function onClick(event) {
66
66
  handleInsightsClick(event);
67
67
  sendEvent('click:internal', hit, 'Hit Clicked');
68
+ },
69
+ onAuxClick: function onAuxClick(event) {
70
+ handleInsightsClick(event);
71
+ sendEvent('click:internal', hit, 'Hit Clicked');
68
72
  }
69
73
  },
70
74
  key: hit.objectID,
@@ -171,7 +171,7 @@ var connectInfiniteHits = function connectInfiniteHits(renderFn) {
171
171
  });
172
172
  isFirstPage = state.page === undefined || getFirstReceivedPage(state, cachedHits) === 0;
173
173
  } else {
174
- var _results$disjunctiveF, _results$facets, _results$hierarchical;
174
+ var _state$disjunctiveFac, _state$hierarchicalFa;
175
175
  var _state$page3 = state.page,
176
176
  _page = _state$page3 === void 0 ? 0 : _state$page3;
177
177
  if (escapeHTML && results.hits.length > 0) {
@@ -195,7 +195,9 @@ var connectInfiniteHits = function connectInfiniteHits(renderFn) {
195
195
  hasDynamicWidgets = true;
196
196
  }
197
197
  });
198
- var hasNoFacets = !((_results$disjunctiveF = results.disjunctiveFacets) !== null && _results$disjunctiveF !== void 0 && _results$disjunctiveF.length) && !((_results$facets = results.facets) !== null && _results$facets !== void 0 && _results$facets.length) && !((_results$hierarchical = results.hierarchicalFacets) !== null && _results$hierarchical !== void 0 && _results$hierarchical.length);
198
+ var hasNoFacets = !((_state$disjunctiveFac = state.disjunctiveFacets) !== null && _state$disjunctiveFac !== void 0 && _state$disjunctiveFac.length) && !(state.facets || []).filter(function (f) {
199
+ return f !== '*';
200
+ }).length && !((_state$hierarchicalFa = state.hierarchicalFacets) !== null && _state$hierarchicalFa !== void 0 && _state$hierarchicalFa.length);
199
201
  if (cachedHits[_page] === undefined && !results.__isArtificial && instantSearchInstance.status === 'idle' && !(hasDynamicWidgets && hasNoFacets)) {
200
202
  cachedHits[_page] = transformedHits;
201
203
  cache.write({
@@ -25,6 +25,8 @@ var TAG_REPLACEMENT = {
25
25
  highlightPreTag: '<mark>',
26
26
  highlightPostTag: '</mark>'
27
27
  };
28
+
29
+ // @MAJOR: in the future, this should only escape, not replace
28
30
  exports.TAG_REPLACEMENT = TAG_REPLACEMENT;
29
31
  function replaceTagsAndEscape(value) {
30
32
  return (0, _escapeHtml.escape)(value).replace(new RegExp(TAG_PLACEHOLDER.highlightPreTag, 'g'), TAG_REPLACEMENT.highlightPreTag).replace(new RegExp(TAG_PLACEHOLDER.highlightPostTag, 'g'), TAG_REPLACEMENT.highlightPostTag);
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getHighlightedParts = getHighlightedParts;
7
7
  var _escapeHighlight = require("./escape-highlight");
8
8
  function getHighlightedParts(highlightedValue) {
9
+ // @MAJOR: this should use TAG_PLACEHOLDER
9
10
  var highlightPostTag = _escapeHighlight.TAG_REPLACEMENT.highlightPostTag,
10
11
  highlightPreTag = _escapeHighlight.TAG_REPLACEMENT.highlightPreTag;
11
12
  var splitByPreTag = highlightedValue.split(highlightPreTag);
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _default = '4.56.0';
7
+ var _default = '4.56.2';
8
8
  exports.default = _default;
@@ -1,4 +1,4 @@
1
- /*! InstantSearch.js 4.56.0 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch.js */
1
+ /*! InstantSearch.js 4.56.2 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch.js */
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) :
@@ -641,6 +641,8 @@
641
641
  highlightPreTag: '<mark>',
642
642
  highlightPostTag: '</mark>'
643
643
  };
644
+
645
+ // @MAJOR: in the future, this should only escape, not replace
644
646
  function replaceTagsAndEscape(value) {
645
647
  return escape$1(value).replace(new RegExp(TAG_PLACEHOLDER.highlightPreTag, 'g'), TAG_REPLACEMENT.highlightPreTag).replace(new RegExp(TAG_PLACEHOLDER.highlightPostTag, 'g'), TAG_REPLACEMENT.highlightPostTag);
646
648
  }
@@ -1202,6 +1204,7 @@
1202
1204
  }
1203
1205
 
1204
1206
  function getHighlightedParts(highlightedValue) {
1207
+ // @MAJOR: this should use TAG_PLACEHOLDER
1205
1208
  var highlightPostTag = TAG_REPLACEMENT.highlightPostTag,
1206
1209
  highlightPreTag = TAG_REPLACEMENT.highlightPreTag;
1207
1210
  var splitByPreTag = highlightedValue.split(highlightPreTag);
@@ -3076,7 +3079,7 @@
3076
3079
  });
3077
3080
  isFirstPage = state.page === undefined || getFirstReceivedPage(state, cachedHits) === 0;
3078
3081
  } else {
3079
- var _results$disjunctiveF, _results$facets, _results$hierarchical;
3082
+ var _state$disjunctiveFac, _state$hierarchicalFa;
3080
3083
  var _state$page3 = state.page,
3081
3084
  _page = _state$page3 === void 0 ? 0 : _state$page3;
3082
3085
  if (escapeHTML && results.hits.length > 0) {
@@ -3100,7 +3103,9 @@
3100
3103
  hasDynamicWidgets = true;
3101
3104
  }
3102
3105
  });
3103
- var hasNoFacets = !((_results$disjunctiveF = results.disjunctiveFacets) !== null && _results$disjunctiveF !== void 0 && _results$disjunctiveF.length) && !((_results$facets = results.facets) !== null && _results$facets !== void 0 && _results$facets.length) && !((_results$hierarchical = results.hierarchicalFacets) !== null && _results$hierarchical !== void 0 && _results$hierarchical.length);
3106
+ var hasNoFacets = !((_state$disjunctiveFac = state.disjunctiveFacets) !== null && _state$disjunctiveFac !== void 0 && _state$disjunctiveFac.length) && !(state.facets || []).filter(function (f) {
3107
+ return f !== '*';
3108
+ }).length && !((_state$hierarchicalFa = state.hierarchicalFacets) !== null && _state$hierarchicalFa !== void 0 && _state$hierarchicalFa.length);
3104
3109
  if (cachedHits[_page] === undefined && !results.__isArtificial && instantSearchInstance.status === 'idle' && !(hasDynamicWidgets && hasNoFacets)) {
3105
3110
  cachedHits[_page] = transformedHits;
3106
3111
  cache.write({
@@ -14029,7 +14034,7 @@
14029
14034
  };
14030
14035
  }
14031
14036
 
14032
- var version$1 = '4.56.0';
14037
+ var version$1 = '4.56.2';
14033
14038
 
14034
14039
  var withUsage$r = createDocumentationMessageGenerator({
14035
14040
  name: 'instantsearch'
@@ -17770,6 +17775,10 @@
17770
17775
  onClick: function onClick(event) {
17771
17776
  handleInsightsClick(event);
17772
17777
  sendEvent('click:internal', hit, 'Hit Clicked');
17778
+ },
17779
+ onAuxClick: function onAuxClick(event) {
17780
+ handleInsightsClick(event);
17781
+ sendEvent('click:internal', hit, 'Hit Clicked');
17773
17782
  }
17774
17783
  },
17775
17784
  key: hit.objectID,
@@ -18002,6 +18011,10 @@
18002
18011
  onClick: function onClick(event) {
18003
18012
  handleInsightsClick(event);
18004
18013
  sendEvent('click:internal', hit, 'Hit Clicked');
18014
+ },
18015
+ onAuxClick: function onAuxClick(event) {
18016
+ handleInsightsClick(event);
18017
+ sendEvent('click:internal', hit, 'Hit Clicked');
18005
18018
  }
18006
18019
  },
18007
18020
  key: hit.objectID,