instantsearch.js 4.43.0 → 4.44.1

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/numeric-menu/connectNumericMenu.js +4 -41
  8. package/cjs/connectors/range/connectRange.js +7 -46
  9. package/cjs/connectors/rating-menu/connectRatingMenu.js +1 -1
  10. package/cjs/helpers/components/Highlight.js +45 -0
  11. package/cjs/helpers/components/ReverseHighlight.js +58 -0
  12. package/cjs/helpers/components/ReverseSnippet.js +58 -0
  13. package/cjs/helpers/components/Snippet.js +45 -0
  14. package/cjs/helpers/components/index.js +57 -0
  15. package/cjs/lib/InstantSearch.js +11 -1
  16. package/cjs/lib/version.js +1 -1
  17. package/dist/instantsearch.development.d.ts +10 -10
  18. package/dist/instantsearch.development.js +25 -116
  19. package/dist/instantsearch.development.js.map +1 -1
  20. package/dist/instantsearch.production.d.ts +10 -10
  21. package/dist/instantsearch.production.min.d.ts +10 -10
  22. package/dist/instantsearch.production.min.js +2 -2
  23. package/dist/instantsearch.production.min.js.map +1 -1
  24. package/es/components/Highlight/Highlight.d.ts +7 -0
  25. package/es/components/Highlight/Highlight.js +24 -0
  26. package/es/components/InternalHighlight/InternalHighlight.d.ts +2 -0
  27. package/es/components/InternalHighlight/InternalHighlight.js +6 -0
  28. package/es/components/ReverseHighlight/ReverseHighlight.d.ts +7 -0
  29. package/es/components/ReverseHighlight/ReverseHighlight.js +24 -0
  30. package/es/components/ReverseSnippet/ReverseSnippet.d.ts +7 -0
  31. package/es/components/ReverseSnippet/ReverseSnippet.js +24 -0
  32. package/es/components/Snippet/Snippet.d.ts +7 -0
  33. package/es/components/Snippet/Snippet.js +24 -0
  34. package/es/connectors/geo-search/connectGeoSearch.d.ts +10 -10
  35. package/es/connectors/numeric-menu/connectNumericMenu.js +5 -42
  36. package/es/connectors/range/connectRange.js +8 -47
  37. package/es/connectors/rating-menu/connectRatingMenu.js +1 -1
  38. package/es/helpers/components/Highlight.d.ts +10 -0
  39. package/es/helpers/components/Highlight.js +31 -0
  40. package/es/helpers/components/ReverseHighlight.d.ts +10 -0
  41. package/es/helpers/components/ReverseHighlight.js +44 -0
  42. package/es/helpers/components/ReverseSnippet.d.ts +10 -0
  43. package/es/helpers/components/ReverseSnippet.js +44 -0
  44. package/es/helpers/components/Snippet.d.ts +10 -0
  45. package/es/helpers/components/Snippet.js +31 -0
  46. package/es/helpers/components/index.d.ts +4 -0
  47. package/es/helpers/components/index.js +4 -0
  48. package/es/lib/InstantSearch.js +11 -1
  49. package/es/lib/version.d.ts +1 -1
  50. package/es/lib/version.js +1 -1
  51. package/es/types/results.d.ts +1 -1
  52. package/es/types/utils.d.ts +4 -0
  53. package/package.json +5 -2
@@ -424,12 +424,22 @@ var InstantSearch = /*#__PURE__*/function (_EventEmitter) {
424
424
 
425
425
  mainHelper.on('error', function (_ref4) {
426
426
  var error = _ref4.error;
427
- // If an error is emitted, it is re-thrown by events. In previous versions
427
+
428
+ if (!(error instanceof Error)) {
429
+ // typescript lies here, error is in some cases { name: string, message: string }
430
+ var err = error;
431
+ error = Object.keys(err).reduce(function (acc, key) {
432
+ acc[key] = err[key];
433
+ return acc;
434
+ }, new Error(err.message));
435
+ } // If an error is emitted, it is re-thrown by events. In previous versions
428
436
  // we emitted {error}, which is thrown as:
429
437
  // "Uncaught, unspecified \"error\" event. ([object Object])"
430
438
  // To avoid breaking changes, we make the error available in both
431
439
  // `error` and `error.error`
432
440
  // @MAJOR emit only error
441
+
442
+
433
443
  error.error = error;
434
444
 
435
445
  _this3.emit('error', error);
@@ -1,2 +1,2 @@
1
- declare const _default: "4.43.0";
1
+ declare const _default: "4.44.1";
2
2
  export default _default;
package/es/lib/version.js CHANGED
@@ -1 +1 @@
1
- export default '4.43.0';
1
+ export default '4.44.1';
@@ -38,7 +38,7 @@ export declare type AlgoliaHit<THit extends BaseHit = Record<string, any>> = {
38
38
  };
39
39
  };
40
40
  _distinctSeqID?: number;
41
- _geoLoc?: GeoLoc;
41
+ _geoloc?: GeoLoc;
42
42
  } & THit;
43
43
  export declare type BaseHit = Record<string, unknown>;
44
44
  export declare type Hit<THit extends BaseHit = Record<string, any>> = {
@@ -10,3 +10,7 @@ export declare type Expand<T> = T extends infer O ? {
10
10
  } : never;
11
11
  export declare type RequiredKeys<TObject, TKeys extends keyof TObject> = Expand<Required<Pick<TObject, TKeys>> & Omit<TObject, TKeys>>;
12
12
  export declare type Awaited<T> = T extends PromiseLike<infer U> ? Awaited<U> : T;
13
+ /**
14
+ * Make certain keys of an object optional.
15
+ */
16
+ export declare type PartialKeys<TObj, TKeys extends keyof TObj> = Omit<TObj, TKeys> & Partial<Pick<TObj, TKeys>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instantsearch.js",
3
- "version": "4.43.0",
3
+ "version": "4.44.1",
4
4
  "description": "InstantSearch.js is a JavaScript library for building performant and instant search experiences with Algolia.",
5
5
  "homepage": "https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/",
6
6
  "types": "es/index.d.ts",
@@ -54,12 +54,15 @@
54
54
  ],
55
55
  "dependencies": {
56
56
  "@algolia/events": "^4.0.1",
57
+ "@algolia/ui-components-highlight-vdom": "^1.1.2",
58
+ "@algolia/ui-components-shared": "^1.1.2",
57
59
  "@types/google.maps": "^3.45.3",
58
60
  "@types/hogan.js": "^3.0.0",
59
61
  "@types/qs": "^6.5.3",
60
62
  "algoliasearch-helper": "^3.10.0",
61
63
  "classnames": "^2.2.5",
62
64
  "hogan.js": "^3.0.2",
65
+ "htm": "^3.0.0",
63
66
  "preact": "^10.6.0",
64
67
  "qs": "^6.5.1 < 6.10",
65
68
  "search-insights": "^2.1.0"
@@ -158,7 +161,7 @@
158
161
  },
159
162
  {
160
163
  "path": "./dist/instantsearch.development.js",
161
- "maxSize": "155.00 kB"
164
+ "maxSize": "151.50 kB"
162
165
  }
163
166
  ]
164
167
  }