react-instantsearch-core 7.15.3 → 7.15.4

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,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _default = exports.default = '7.15.3';
7
+ var _default = exports.default = '7.15.4';
@@ -1,2 +1,2 @@
1
- declare const _default: "7.15.3";
1
+ declare const _default: "7.15.4";
2
2
  export default _default;
@@ -1 +1 @@
1
- export default '7.15.3';
1
+ export default '7.15.4';
@@ -7,7 +7,7 @@
7
7
 
8
8
  var React__default = 'default' in React ? React['default'] : React;
9
9
 
10
- var version = '7.15.3';
10
+ var version = '7.15.4';
11
11
 
12
12
  function _iterableToArrayLimit(r, l) {
13
13
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
@@ -4758,7 +4758,7 @@
4758
4758
 
4759
4759
  var sortAndMergeRecommendations_1 = sortAndMergeRecommendations;
4760
4760
 
4761
- var version$1 = '3.24.1';
4761
+ var version$1 = '3.24.2';
4762
4762
 
4763
4763
  var escapeFacetValue$3 = escapeFacetValue_1.escapeFacetValue;
4764
4764
 
@@ -7444,6 +7444,7 @@
7444
7444
  instantSearchInstance.sendEventToInsights(args[0]);
7445
7445
  } else if (eventType === 'click' && args.length >= 2 && args.length <= 4) {
7446
7446
  if (!isFacetRefined(helper, attribute, facetValue)) {
7447
+ var _helper$lastResults;
7447
7448
  // send event only when the facet is being checked "ON"
7448
7449
  instantSearchInstance.sendEventToInsights({
7449
7450
  insightsMethod: 'clickedFilters',
@@ -7452,7 +7453,7 @@
7452
7453
  eventModifier: eventModifier,
7453
7454
  payload: _objectSpread$1({
7454
7455
  eventName: eventName,
7455
- index: helper.getIndex(),
7456
+ index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,
7456
7457
  filters: ["".concat(attribute, ":").concat(facetValue)]
7457
7458
  }, additionalData),
7458
7459
  attribute: attribute
@@ -7583,7 +7584,7 @@
7583
7584
  return chunks;
7584
7585
  }
7585
7586
  function _buildEventPayloadsForHits(_ref) {
7586
- var getIndex = _ref.getIndex,
7587
+ var helper = _ref.helper,
7587
7588
  widgetType = _ref.widgetType,
7588
7589
  methodName = _ref.methodName,
7589
7590
  args = _ref.args,
@@ -7630,13 +7631,14 @@
7630
7631
  return [];
7631
7632
  }
7632
7633
  return hitsChunks.map(function (batch, i) {
7634
+ var _helper$lastResults;
7633
7635
  return {
7634
7636
  insightsMethod: 'viewedObjectIDs',
7635
7637
  widgetType: widgetType,
7636
7638
  eventType: eventType,
7637
7639
  payload: _objectSpread$2({
7638
7640
  eventName: eventName || 'Hits Viewed',
7639
- index: getIndex(),
7641
+ index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,
7640
7642
  objectIDs: objectIDsByChunk[i]
7641
7643
  }, additionalData),
7642
7644
  hits: batch,
@@ -7645,13 +7647,14 @@
7645
7647
  });
7646
7648
  } else if (eventType === 'click') {
7647
7649
  return hitsChunks.map(function (batch, i) {
7650
+ var _helper$lastResults2;
7648
7651
  return {
7649
7652
  insightsMethod: 'clickedObjectIDsAfterSearch',
7650
7653
  widgetType: widgetType,
7651
7654
  eventType: eventType,
7652
7655
  payload: _objectSpread$2({
7653
7656
  eventName: eventName || 'Hit Clicked',
7654
- index: getIndex(),
7657
+ index: ((_helper$lastResults2 = helper.lastResults) === null || _helper$lastResults2 === void 0 ? void 0 : _helper$lastResults2.index) || helper.state.index,
7655
7658
  queryID: queryID,
7656
7659
  objectIDs: objectIDsByChunk[i],
7657
7660
  positions: positionsByChunk[i]
@@ -7662,13 +7665,14 @@
7662
7665
  });
7663
7666
  } else if (eventType === 'conversion') {
7664
7667
  return hitsChunks.map(function (batch, i) {
7668
+ var _helper$lastResults3;
7665
7669
  return {
7666
7670
  insightsMethod: 'convertedObjectIDsAfterSearch',
7667
7671
  widgetType: widgetType,
7668
7672
  eventType: eventType,
7669
7673
  payload: _objectSpread$2({
7670
7674
  eventName: eventName || 'Hit Converted',
7671
- index: getIndex(),
7675
+ index: ((_helper$lastResults3 = helper.lastResults) === null || _helper$lastResults3 === void 0 ? void 0 : _helper$lastResults3.index) || helper.state.index,
7672
7676
  queryID: queryID,
7673
7677
  objectIDs: objectIDsByChunk[i]
7674
7678
  }, additionalData),
@@ -7682,7 +7686,7 @@
7682
7686
  }
7683
7687
  function createSendEventForHits(_ref2) {
7684
7688
  var instantSearchInstance = _ref2.instantSearchInstance,
7685
- getIndex = _ref2.getIndex,
7689
+ helper = _ref2.helper,
7686
7690
  widgetType = _ref2.widgetType;
7687
7691
  var sentEvents = {};
7688
7692
  var timer = undefined;
@@ -7692,7 +7696,7 @@
7692
7696
  }
7693
7697
  var payloads = _buildEventPayloadsForHits({
7694
7698
  widgetType: widgetType,
7695
- getIndex: getIndex,
7699
+ helper: helper,
7696
7700
  methodName: 'sendEvent',
7697
7701
  args: args,
7698
7702
  instantSearchInstance: instantSearchInstance
@@ -7712,7 +7716,7 @@
7712
7716
  return sendEventForHits;
7713
7717
  }
7714
7718
  function createBindEventForHits(_ref3) {
7715
- var getIndex = _ref3.getIndex,
7719
+ var helper = _ref3.helper,
7716
7720
  widgetType = _ref3.widgetType,
7717
7721
  instantSearchInstance = _ref3.instantSearchInstance;
7718
7722
  var bindEventForHits = function bindEventForHits() {
@@ -7721,7 +7725,7 @@
7721
7725
  }
7722
7726
  var payloads = _buildEventPayloadsForHits({
7723
7727
  widgetType: widgetType,
7724
- getIndex: getIndex,
7728
+ helper: helper,
7725
7729
  methodName: 'bindEvent',
7726
7730
  args: args,
7727
7731
  instantSearchInstance: instantSearchInstance
@@ -12861,7 +12865,7 @@
12861
12865
  };
12862
12866
  }
12863
12867
 
12864
- var version$2 = '4.77.3';
12868
+ var version$2 = '4.78.0';
12865
12869
 
12866
12870
  function _typeof$l(o) {
12867
12871
  "@babel/helpers - typeof";
@@ -14724,9 +14728,7 @@
14724
14728
  if (!sendEvent) {
14725
14729
  sendEvent = createSendEventForHits({
14726
14730
  instantSearchInstance: instantSearchInstance,
14727
- getIndex: function getIndex() {
14728
- return helper.getIndex();
14729
- },
14731
+ helper: helper,
14730
14732
  widgetType: this.$$type
14731
14733
  });
14732
14734
  }
@@ -14978,9 +14980,7 @@
14978
14980
  if (!sendEvent) {
14979
14981
  sendEvent = createSendEventForHits({
14980
14982
  instantSearchInstance: instantSearchInstance,
14981
- getIndex: function getIndex() {
14982
- return helper.getIndex();
14983
- },
14983
+ helper: helper,
14984
14984
  widgetType: $$type
14985
14985
  });
14986
14986
  }
@@ -15512,17 +15512,13 @@
15512
15512
  if (!sendEvent) {
15513
15513
  sendEvent = createSendEventForHits({
15514
15514
  instantSearchInstance: instantSearchInstance,
15515
- getIndex: function getIndex() {
15516
- return helper.getIndex();
15517
- },
15515
+ helper: helper,
15518
15516
  widgetType: this.$$type
15519
15517
  });
15520
15518
  }
15521
15519
  if (!bindEvent) {
15522
15520
  bindEvent = createBindEventForHits({
15523
- getIndex: function getIndex() {
15524
- return helper.getIndex();
15525
- },
15521
+ helper: helper,
15526
15522
  widgetType: this.$$type,
15527
15523
  instantSearchInstance: instantSearchInstance
15528
15524
  });
@@ -16058,15 +16054,11 @@
16058
16054
  showMore = getShowMore(helper);
16059
16055
  sendEvent = createSendEventForHits({
16060
16056
  instantSearchInstance: instantSearchInstance,
16061
- getIndex: function getIndex() {
16062
- return helper.getIndex();
16063
- },
16057
+ helper: helper,
16064
16058
  widgetType: this.$$type
16065
16059
  });
16066
16060
  bindEvent = createBindEventForHits({
16067
- getIndex: function getIndex() {
16068
- return helper.getIndex();
16069
- },
16061
+ helper: helper,
16070
16062
  widgetType: this.$$type,
16071
16063
  instantSearchInstance: instantSearchInstance
16072
16064
  });
@@ -18336,9 +18328,7 @@
18336
18328
  if (!sendEvent) {
18337
18329
  sendEvent = createSendEventForHits({
18338
18330
  instantSearchInstance: instantSearchInstance,
18339
- getIndex: function getIndex() {
18340
- return helper.getIndex();
18341
- },
18331
+ helper: helper,
18342
18332
  widgetType: this.$$type
18343
18333
  });
18344
18334
  }
@@ -18973,6 +18963,7 @@
18973
18963
  // only send an event when the refinement gets applied,
18974
18964
  // not when it gets removed
18975
18965
  if (!isRefined) {
18966
+ var _helper$lastResults;
18976
18967
  instantSearchInstance.sendEventToInsights({
18977
18968
  insightsMethod: 'clickedFilters',
18978
18969
  widgetType: $$type$3,
@@ -18980,7 +18971,7 @@
18980
18971
  eventModifier: eventModifier,
18981
18972
  payload: {
18982
18973
  eventName: eventName,
18983
- index: helper.getIndex(),
18974
+ index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,
18984
18975
  filters: on.map(function (value) {
18985
18976
  return "".concat(attribute, ":").concat(value);
18986
18977
  })
@@ -19347,9 +19338,7 @@
19347
19338
  if (!sendEvent) {
19348
19339
  sendEvent = createSendEventForHits({
19349
19340
  instantSearchInstance: instantSearchInstance,
19350
- getIndex: function getIndex() {
19351
- return helper.getIndex();
19352
- },
19341
+ helper: helper,
19353
19342
  widgetType: this.$$type
19354
19343
  });
19355
19344
  }
@@ -19504,9 +19493,7 @@
19504
19493
  if (!sendEvent) {
19505
19494
  sendEvent = createSendEventForHits({
19506
19495
  instantSearchInstance: instantSearchInstance,
19507
- getIndex: function getIndex() {
19508
- return helper.getIndex();
19509
- },
19496
+ helper: helper,
19510
19497
  widgetType: this.$$type
19511
19498
  });
19512
19499
  }