react-instantsearch-core 7.13.6 → 7.13.7

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 = '7.13.6';
7
+ var _default = '7.13.7';
8
8
  exports.default = _default;
@@ -1,2 +1,2 @@
1
- declare const _default: "7.13.6";
1
+ declare const _default: "7.13.7";
2
2
  export default _default;
@@ -1 +1 @@
1
- export default '7.13.6';
1
+ export default '7.13.7';
@@ -7,7 +7,7 @@
7
7
 
8
8
  var React__default = 'default' in React ? React['default'] : React;
9
9
 
10
- var version = '7.13.6';
10
+ var version = '7.13.7';
11
11
 
12
12
  function _iterableToArrayLimit(arr, i) {
13
13
  var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
@@ -10935,10 +10935,33 @@
10935
10935
  return insightsClient(method, payload, extraParams);
10936
10936
  };
10937
10937
  }
10938
+ var viewedObjectIDs = new Set();
10939
+ var lastQueryId;
10940
+ instantSearchInstance.mainHelper.derivedHelpers[0].on('result', function (_ref11) {
10941
+ var results = _ref11.results;
10942
+ if (!results.queryID || results.queryID !== lastQueryId) {
10943
+ lastQueryId = results.queryID;
10944
+ viewedObjectIDs.clear();
10945
+ }
10946
+ });
10938
10947
  instantSearchInstance.sendEventToInsights = function (event) {
10939
10948
  if (onEvent) {
10940
10949
  onEvent(event, insightsClientWithLocalCredentials);
10941
10950
  } else if (event.insightsMethod) {
10951
+ if (event.insightsMethod === 'viewedObjectIDs') {
10952
+ var _payload = event.payload;
10953
+ var difference = _payload.objectIDs.filter(function (objectID) {
10954
+ return !viewedObjectIDs.has(objectID);
10955
+ });
10956
+ if (difference.length === 0) {
10957
+ return;
10958
+ }
10959
+ difference.forEach(function (objectID) {
10960
+ return viewedObjectIDs.add(objectID);
10961
+ });
10962
+ _payload.objectIDs = difference;
10963
+ }
10964
+
10942
10965
  // Source is used to differentiate events sent by instantsearch from those sent manually.
10943
10966
  event.payload.algoliaSource = ['instantsearch'];
10944
10967
  if ($$automatic) {
@@ -12628,7 +12651,7 @@
12628
12651
  };
12629
12652
  }
12630
12653
 
12631
- var version$2 = '4.75.3';
12654
+ var version$2 = '4.75.4';
12632
12655
 
12633
12656
  function _typeof$l(obj) {
12634
12657
  "@babel/helpers - typeof";