@algolia/autocomplete-core 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-core 1.9.3 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
1
+ /*! @algolia/autocomplete-core 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) :
@@ -291,7 +291,7 @@
291
291
  return undefined;
292
292
  }
293
293
 
294
- var version = '1.9.3';
294
+ var version = '1.9.4';
295
295
 
296
296
  var userAgents = [{
297
297
  segment: 'autocomplete-core',
@@ -322,7 +322,8 @@
322
322
 
323
323
  function createClickedEvent(_ref) {
324
324
  var item = _ref.item,
325
- items = _ref.items;
325
+ _ref$items = _ref.items,
326
+ items = _ref$items === void 0 ? [] : _ref$items;
326
327
  return {
327
328
  index: item.__autocomplete_indexName,
328
329
  items: [item],
@@ -895,7 +896,8 @@
895
896
  onSelect(function (_ref5) {
896
897
  var item = _ref5.item,
897
898
  state = _ref5.state,
898
- event = _ref5.event;
899
+ event = _ref5.event,
900
+ source = _ref5.source;
899
901
  if (!isAlgoliaInsightsHit(item)) {
900
902
  return;
901
903
  }
@@ -908,12 +910,13 @@
908
910
  eventName: 'Item Selected'
909
911
  }, createClickedEvent({
910
912
  item: item,
911
- items: previousItems.current
913
+ items: source.getItems().filter(isAlgoliaInsightsHit)
912
914
  }))]
913
915
  });
914
916
  });
915
917
  onActive(function (_ref6) {
916
918
  var item = _ref6.item,
919
+ source = _ref6.source,
917
920
  state = _ref6.state,
918
921
  event = _ref6.event;
919
922
  if (!isAlgoliaInsightsHit(item)) {
@@ -928,7 +931,7 @@
928
931
  eventName: 'Item Active'
929
932
  }, createClickedEvent({
930
933
  item: item,
931
- items: previousItems.current
934
+ items: source.getItems().filter(isAlgoliaInsightsHit)
932
935
  }))]
933
936
  });
934
937
  });