@algolia/autocomplete-js 1.19.4 → 1.19.6

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.
@@ -27,7 +27,8 @@ function setStyle(style, key, value) {
27
27
  * Proxy an event to hooked event handlers
28
28
  */
29
29
  function eventProxy(event) {
30
- this._listeners[event.type](event);
30
+ var _this$_listeners;
31
+ this === null || this === void 0 ? void 0 : (_this$_listeners = this._listeners) === null || _this$_listeners === void 0 ? void 0 : _this$_listeners[event.type](event);
31
32
  }
32
33
 
33
34
  /**
@@ -1,4 +1,4 @@
1
- /*! @algolia/autocomplete-js 1.19.4 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
1
+ /*! @algolia/autocomplete-js 1.19.6 | 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.19.4';
350
+ var version = '1.19.6';
351
351
 
352
352
  var userAgents$1 = [{
353
353
  segment: 'autocomplete-core',
@@ -2556,11 +2556,10 @@
2556
2556
  var highlightedItem = getActiveItem(store.getState());
2557
2557
  var nodeItem = props.environment.document.getElementById(getAutocompleteElementId(props.id, "item-".concat(store.getState().activeItemId), highlightedItem === null || highlightedItem === void 0 ? void 0 : highlightedItem.source));
2558
2558
  if (nodeItem) {
2559
- if (nodeItem.scrollIntoViewIfNeeded) {
2560
- nodeItem.scrollIntoViewIfNeeded(false);
2561
- } else {
2562
- nodeItem.scrollIntoView(false);
2563
- }
2559
+ nodeItem.scrollIntoView({
2560
+ block: 'nearest',
2561
+ inline: 'nearest'
2562
+ });
2564
2563
  }
2565
2564
  }; // eslint-disable-next-line no-inner-declarations
2566
2565
  var triggerOnActive = function triggerOnActive() {
@@ -3707,7 +3706,8 @@
3707
3706
  * Proxy an event to hooked event handlers
3708
3707
  */
3709
3708
  function eventProxy(event) {
3710
- this._listeners[event.type](event);
3709
+ var _this$_listeners;
3710
+ this === null || this === void 0 ? void 0 : (_this$_listeners = this._listeners) === null || _this$_listeners === void 0 ? void 0 : _this$_listeners[event.type](event);
3711
3711
  }
3712
3712
 
3713
3713
  /**
@@ -4201,7 +4201,13 @@
4201
4201
  '"': '"',
4202
4202
  ''': "'"
4203
4203
  };
4204
- var hasAlphanumeric = new RegExp(/\w/i);
4204
+ var hasLetterOrNumber = function () {
4205
+ try {
4206
+ return new RegExp('[\\p{L}\\p{N}_]', 'u');
4207
+ } catch (_unused) {
4208
+ return new RegExp(/\w/i);
4209
+ }
4210
+ }();
4205
4211
  var regexEscapedHtml = /&(amp|quot|lt|gt|#39);/g;
4206
4212
  var regexHasEscapedHtml = RegExp(regexEscapedHtml.source);
4207
4213
  function unescape(value) {
@@ -4214,7 +4220,7 @@
4214
4220
  var current = parts[i];
4215
4221
  var isNextHighlighted = ((_parts = parts[i + 1]) === null || _parts === void 0 ? void 0 : _parts.isHighlighted) || true;
4216
4222
  var isPreviousHighlighted = ((_parts2 = parts[i - 1]) === null || _parts2 === void 0 ? void 0 : _parts2.isHighlighted) || true;
4217
- if (!hasAlphanumeric.test(unescape(current.value)) && isPreviousHighlighted === isNextHighlighted) {
4223
+ if (!hasLetterOrNumber.test(unescape(current.value)) && isPreviousHighlighted === isNextHighlighted) {
4218
4224
  return isPreviousHighlighted;
4219
4225
  }
4220
4226
  return current.isHighlighted;