instantsearch.js 4.42.0 → 4.44.0

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.
Files changed (53) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/cjs/components/Highlight/Highlight.js +33 -0
  3. package/cjs/components/InternalHighlight/InternalHighlight.js +16 -0
  4. package/cjs/components/ReverseHighlight/ReverseHighlight.js +33 -0
  5. package/cjs/components/ReverseSnippet/ReverseSnippet.js +33 -0
  6. package/cjs/components/Snippet/Snippet.js +33 -0
  7. package/cjs/connectors/rating-menu/connectRatingMenu.js +1 -1
  8. package/cjs/helpers/components/Highlight.js +45 -0
  9. package/cjs/helpers/components/ReverseHighlight.js +58 -0
  10. package/cjs/helpers/components/ReverseSnippet.js +58 -0
  11. package/cjs/helpers/components/Snippet.js +45 -0
  12. package/cjs/helpers/components/index.js +57 -0
  13. package/cjs/lib/InstantSearch.js +11 -1
  14. package/cjs/lib/version.js +1 -1
  15. package/cjs/types/algoliasearch.js +18 -1
  16. package/dist/instantsearch.development.d.ts +12 -31
  17. package/dist/instantsearch.development.js +20 -10
  18. package/dist/instantsearch.development.js.map +1 -1
  19. package/dist/instantsearch.production.d.ts +12 -31
  20. package/dist/instantsearch.production.min.d.ts +12 -31
  21. package/dist/instantsearch.production.min.js +2 -2
  22. package/dist/instantsearch.production.min.js.map +1 -1
  23. package/es/components/Highlight/Highlight.d.ts +7 -0
  24. package/es/components/Highlight/Highlight.js +24 -0
  25. package/es/components/InternalHighlight/InternalHighlight.d.ts +2 -0
  26. package/es/components/InternalHighlight/InternalHighlight.js +6 -0
  27. package/es/components/ReverseHighlight/ReverseHighlight.d.ts +7 -0
  28. package/es/components/ReverseHighlight/ReverseHighlight.js +24 -0
  29. package/es/components/ReverseSnippet/ReverseSnippet.d.ts +7 -0
  30. package/es/components/ReverseSnippet/ReverseSnippet.js +24 -0
  31. package/es/components/Snippet/Snippet.d.ts +7 -0
  32. package/es/components/Snippet/Snippet.js +24 -0
  33. package/es/connectors/geo-search/connectGeoSearch.d.ts +10 -10
  34. package/es/connectors/rating-menu/connectRatingMenu.js +1 -1
  35. package/es/helpers/components/Highlight.d.ts +10 -0
  36. package/es/helpers/components/Highlight.js +31 -0
  37. package/es/helpers/components/ReverseHighlight.d.ts +10 -0
  38. package/es/helpers/components/ReverseHighlight.js +44 -0
  39. package/es/helpers/components/ReverseSnippet.d.ts +10 -0
  40. package/es/helpers/components/ReverseSnippet.js +44 -0
  41. package/es/helpers/components/Snippet.d.ts +10 -0
  42. package/es/helpers/components/Snippet.js +31 -0
  43. package/es/helpers/components/index.d.ts +4 -0
  44. package/es/helpers/components/index.js +4 -0
  45. package/es/lib/InstantSearch.js +11 -1
  46. package/es/lib/version.d.ts +1 -1
  47. package/es/lib/version.js +1 -1
  48. package/es/types/algoliasearch.d.ts +1 -40
  49. package/es/types/algoliasearch.js +2 -0
  50. package/es/types/index.js +1 -0
  51. package/es/types/results.d.ts +1 -1
  52. package/es/types/utils.d.ts +4 -0
  53. package/package.json +6 -3
@@ -1,4 +1,4 @@
1
- /*! InstantSearch.js 4.42.0 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch.js */
1
+ /*! InstantSearch.js 4.44.0 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch.js */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -3963,16 +3963,16 @@
3963
3963
  var numericFilters = requestBuilder._getNumericFilters(state, facet);
3964
3964
  var tagFilters = requestBuilder._getTagFilters(state);
3965
3965
  var additionalParams = {
3966
- hitsPerPage: 1,
3966
+ hitsPerPage: 0,
3967
3967
  page: 0,
3968
- attributesToRetrieve: [],
3969
- attributesToHighlight: [],
3970
- attributesToSnippet: [],
3971
- tagFilters: tagFilters,
3972
3968
  analytics: false,
3973
3969
  clickAnalytics: false
3974
3970
  };
3975
3971
 
3972
+ if (tagFilters.length > 0) {
3973
+ additionalParams.tagFilters = tagFilters;
3974
+ }
3975
+
3976
3976
  var hierarchicalFacet = state.getHierarchicalFacetByName(facet);
3977
3977
 
3978
3978
  if (hierarchicalFacet) {
@@ -4196,7 +4196,7 @@
4196
4196
 
4197
4197
  var requestBuilder_1 = requestBuilder;
4198
4198
 
4199
- var version = '3.9.0';
4199
+ var version = '3.10.0';
4200
4200
 
4201
4201
  var escapeFacetValue$3 = escapeFacetValue_1.escapeFacetValue;
4202
4202
 
@@ -8603,7 +8603,7 @@
8603
8603
  instantSearchInstance.renderState = _objectSpread2(_objectSpread2({}, instantSearchInstance.renderState), {}, _defineProperty({}, parentIndexName, _objectSpread2(_objectSpread2({}, instantSearchInstance.renderState[parentIndexName]), renderState)));
8604
8604
  }
8605
8605
 
8606
- var version$1 = '4.42.0';
8606
+ var version$1 = '4.44.0';
8607
8607
 
8608
8608
  var NAMESPACE = 'ais';
8609
8609
  var component = function component(componentName) {
@@ -10477,12 +10477,22 @@
10477
10477
 
10478
10478
  mainHelper.on('error', function (_ref4) {
10479
10479
  var error = _ref4.error;
10480
- // If an error is emitted, it is re-thrown by events. In previous versions
10480
+
10481
+ if (!(error instanceof Error)) {
10482
+ // typescript lies here, error is in some cases { name: string, message: string }
10483
+ var err = error;
10484
+ error = Object.keys(err).reduce(function (acc, key) {
10485
+ acc[key] = err[key];
10486
+ return acc;
10487
+ }, new Error(err.message));
10488
+ } // If an error is emitted, it is re-thrown by events. In previous versions
10481
10489
  // we emitted {error}, which is thrown as:
10482
10490
  // "Uncaught, unspecified \"error\" event. ([object Object])"
10483
10491
  // To avoid breaking changes, we make the error available in both
10484
10492
  // `error` and `error.error`
10485
10493
  // @MAJOR emit only error
10494
+
10495
+
10486
10496
  error.error = error;
10487
10497
 
10488
10498
  _this3.emit('error', error);
@@ -13612,7 +13622,7 @@
13612
13622
  var maxValuesPerFacet = facetResults.length;
13613
13623
  var maxDecimalPlaces = getFacetsMaxDecimalPlaces(facetResults);
13614
13624
  var maxFacets = Math.pow(10, maxDecimalPlaces) * max;
13615
- _warning(maxFacets <= maxValuesPerFacet, getFacetValuesWarningMessage({
13625
+ _warning(maxFacets <= maxValuesPerFacet || Boolean(results.__isArtificial), getFacetValuesWarningMessage({
13616
13626
  maxDecimalPlaces: maxDecimalPlaces,
13617
13627
  maxFacets: maxFacets,
13618
13628
  maxValuesPerFacet: maxValuesPerFacet