@algolia/autocomplete-js 1.9.3 → 1.9.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.
@@ -1,4 +1,4 @@
1
- /*! @algolia/autocomplete-js 1.9.3 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
1
+ /*! @algolia/autocomplete-js 1.9.4 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
4
4
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -347,7 +347,7 @@
347
347
  return undefined;
348
348
  }
349
349
 
350
- var version = '1.9.3';
350
+ var version = '1.9.4';
351
351
 
352
352
  var userAgents$1 = [{
353
353
  segment: 'autocomplete-core',
@@ -378,7 +378,8 @@
378
378
 
379
379
  function createClickedEvent(_ref) {
380
380
  var item = _ref.item,
381
- items = _ref.items;
381
+ _ref$items = _ref.items,
382
+ items = _ref$items === void 0 ? [] : _ref$items;
382
383
  return {
383
384
  index: item.__autocomplete_indexName,
384
385
  items: [item],
@@ -951,7 +952,8 @@
951
952
  onSelect(function (_ref5) {
952
953
  var item = _ref5.item,
953
954
  state = _ref5.state,
954
- event = _ref5.event;
955
+ event = _ref5.event,
956
+ source = _ref5.source;
955
957
  if (!isAlgoliaInsightsHit(item)) {
956
958
  return;
957
959
  }
@@ -964,12 +966,13 @@
964
966
  eventName: 'Item Selected'
965
967
  }, createClickedEvent({
966
968
  item: item,
967
- items: previousItems.current
969
+ items: source.getItems().filter(isAlgoliaInsightsHit)
968
970
  }))]
969
971
  });
970
972
  });
971
973
  onActive(function (_ref6) {
972
974
  var item = _ref6.item,
975
+ source = _ref6.source,
973
976
  state = _ref6.state,
974
977
  event = _ref6.event;
975
978
  if (!isAlgoliaInsightsHit(item)) {
@@ -984,7 +987,7 @@
984
987
  eventName: 'Item Active'
985
988
  }, createClickedEvent({
986
989
  item: item,
987
- items: previousItems.current
990
+ items: source.getItems().filter(isAlgoliaInsightsHit)
988
991
  }))]
989
992
  });
990
993
  });