@algolia/autocomplete-js 1.19.3 → 1.19.5

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.
@@ -6,5 +6,16 @@ export var LoadingIcon = function LoadingIcon(_ref) {
6
6
  element.setAttribute('width', '20');
7
7
  element.setAttribute('height', '20');
8
8
  element.innerHTML = "<circle\n cx=\"50\"\n cy=\"50\"\n fill=\"none\"\n r=\"35\"\n stroke=\"currentColor\"\n stroke-dasharray=\"164.93361431346415 56.97787143782138\"\n stroke-width=\"6\"\n>\n <animateTransform\n attributeName=\"transform\"\n type=\"rotate\"\n repeatCount=\"indefinite\"\n dur=\"1s\"\n values=\"0 50 50;90 50 50;180 50 50;360 50 50\"\n keyTimes=\"0;0.40;0.65;1\"\n />\n</circle>";
9
+ var pauseAnimations = function pauseAnimations() {
10
+ // Wait until the element is in the DOM.
11
+ if (!element.parentElement) {
12
+ setTimeout(pauseAnimations, 0);
13
+ return;
14
+ }
15
+ element.pauseAnimations();
16
+ };
17
+ if ('pauseAnimations' in element) {
18
+ pauseAnimations();
19
+ }
9
20
  return element;
10
21
  };
@@ -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.3 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
1
+ /*! @algolia/autocomplete-js 1.19.5 | 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.3';
350
+ var version = '1.19.5';
351
351
 
352
352
  var userAgents$1 = [{
353
353
  segment: 'autocomplete-core',
@@ -3707,7 +3707,8 @@
3707
3707
  * Proxy an event to hooked event handlers
3708
3708
  */
3709
3709
  function eventProxy(event) {
3710
- this._listeners[event.type](event);
3710
+ var _this$_listeners;
3711
+ this === null || this === void 0 ? void 0 : (_this$_listeners = this._listeners) === null || _this$_listeners === void 0 ? void 0 : _this$_listeners[event.type](event);
3711
3712
  }
3712
3713
 
3713
3714
  /**
@@ -3841,6 +3842,17 @@
3841
3842
  element.setAttribute('width', '20');
3842
3843
  element.setAttribute('height', '20');
3843
3844
  element.innerHTML = "<circle\n cx=\"50\"\n cy=\"50\"\n fill=\"none\"\n r=\"35\"\n stroke=\"currentColor\"\n stroke-dasharray=\"164.93361431346415 56.97787143782138\"\n stroke-width=\"6\"\n>\n <animateTransform\n attributeName=\"transform\"\n type=\"rotate\"\n repeatCount=\"indefinite\"\n dur=\"1s\"\n values=\"0 50 50;90 50 50;180 50 50;360 50 50\"\n keyTimes=\"0;0.40;0.65;1\"\n />\n</circle>";
3845
+ var pauseAnimations = function pauseAnimations() {
3846
+ // Wait until the element is in the DOM.
3847
+ if (!element.parentElement) {
3848
+ setTimeout(pauseAnimations, 0);
3849
+ return;
3850
+ }
3851
+ element.pauseAnimations();
3852
+ };
3853
+ if ('pauseAnimations' in element) {
3854
+ pauseAnimations();
3855
+ }
3844
3856
  return element;
3845
3857
  };
3846
3858
 
@@ -4190,7 +4202,13 @@
4190
4202
  '&quot;': '"',
4191
4203
  '&#39;': "'"
4192
4204
  };
4193
- var hasAlphanumeric = new RegExp(/\w/i);
4205
+ var hasLetterOrNumber = function () {
4206
+ try {
4207
+ return new RegExp('[\\p{L}\\p{N}_]', 'u');
4208
+ } catch (_unused) {
4209
+ return new RegExp(/\w/i);
4210
+ }
4211
+ }();
4194
4212
  var regexEscapedHtml = /&(amp|quot|lt|gt|#39);/g;
4195
4213
  var regexHasEscapedHtml = RegExp(regexEscapedHtml.source);
4196
4214
  function unescape(value) {
@@ -4203,7 +4221,7 @@
4203
4221
  var current = parts[i];
4204
4222
  var isNextHighlighted = ((_parts = parts[i + 1]) === null || _parts === void 0 ? void 0 : _parts.isHighlighted) || true;
4205
4223
  var isPreviousHighlighted = ((_parts2 = parts[i - 1]) === null || _parts2 === void 0 ? void 0 : _parts2.isHighlighted) || true;
4206
- if (!hasAlphanumeric.test(unescape(current.value)) && isPreviousHighlighted === isNextHighlighted) {
4224
+ if (!hasLetterOrNumber.test(unescape(current.value)) && isPreviousHighlighted === isNextHighlighted) {
4207
4225
  return isPreviousHighlighted;
4208
4226
  }
4209
4227
  return current.isHighlighted;