instantsearch.js 4.42.0 → 4.43.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # [4.43.0](https://github.com/algolia/instantsearch.js/compare/v4.42.0...v4.43.0) (2022-06-28)
2
+
3
+
4
+ ### Features
5
+
6
+ * **types:** support algoliasearch v5 ([#5066](https://github.com/algolia/instantsearch.js/issues/5066)) ([3eb4dc7](https://github.com/algolia/instantsearch.js/commit/3eb4dc75a5935f2ee4fead8787f39af0150b24c4))
7
+
8
+
9
+
1
10
  # [4.42.0](https://github.com/algolia/instantsearch.js/compare/v4.41.2...v4.42.0) (2022-06-21)
2
11
 
3
12
 
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _default = '4.42.0';
7
+ var _default = '4.43.0';
8
8
  exports.default = _default;
@@ -1 +1,18 @@
1
- "use strict";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _algoliasearch = require("algoliasearch-helper/types/algoliasearch.js");
8
+
9
+ Object.keys(_algoliasearch).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _algoliasearch[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _algoliasearch[key];
16
+ }
17
+ });
18
+ });
@@ -1,14 +1,14 @@
1
1
  /// <reference types="google.maps" />
2
2
 
3
- import type algoliasearch from 'algoliasearch/lite';
4
3
  import type { AlgoliaSearchHelper } from 'algoliasearch-helper';
5
- import type * as ClientSearch from '@algolia/client-search';
6
4
  import EventEmitter from '@algolia/events';
5
+ import { FindAnswersOptions } from 'algoliasearch-helper/types/algoliasearch.js';
7
6
  import type { InsightsClient as InsightsClient_2 } from 'search-insights';
8
7
  import type { InsightsMethodMap } from 'search-insights';
9
8
  import type * as Places from 'places.js';
10
9
  import type { PlainSearchParameters } from 'algoliasearch-helper';
11
10
  import { default as qs_2 } from 'qs';
11
+ import { SearchClient } from 'algoliasearch-helper/types/algoliasearch.js';
12
12
  import type { SearchParameters } from 'algoliasearch-helper';
13
13
  import type { SearchResults } from 'algoliasearch-helper';
14
14
 
@@ -1075,18 +1075,12 @@ declare type CustomSendEventForHits = (customPayload: any) => void;
1075
1075
 
1076
1076
  declare type CustomSendEventForToggle = (customPayload: any) => void;
1077
1077
 
1078
- declare type DefaultSearchClient = ReturnType<typeof algoliasearch>;
1079
-
1080
1078
  declare type DisposeOptions = {
1081
1079
  helper: AlgoliaSearchHelper;
1082
1080
  state: SearchParameters;
1083
1081
  parent: IndexWidget;
1084
1082
  };
1085
1083
 
1086
- declare type DummySearchClientV4 = {
1087
- readonly transporter: any;
1088
- };
1089
-
1090
1084
  declare const dynamicWidgets: DynamicWidgetsWidget;
1091
1085
 
1092
1086
  declare type DynamicWidgetsConnector = Connector<DynamicWidgetsWidgetDescription, DynamicWidgetsConnectorParams>;
@@ -1175,8 +1169,6 @@ declare const EXPERIMENTAL_connectDynamicWidgets: DynamicWidgetsConnector;
1175
1169
  /** @deprecated use dynamicWidgets */
1176
1170
  declare const EXPERIMENTAL_dynamicWidgets: DynamicWidgetsWidget;
1177
1171
 
1178
- declare type FindAnswersOptions = DefaultSearchClient extends DummySearchClientV4 ? ClientSearch.FindAnswersOptions : any;
1179
-
1180
1172
  declare type GeoHit = Hit & Required<Pick<Hit, '_geoLoc'>>;
1181
1173
 
1182
1174
  declare type GeoLoc = {
@@ -4582,17 +4574,6 @@ declare type SearchBoxWidgetParams = {
4582
4574
  queryHook?: (query: string, hook: (value: string) => void) => void;
4583
4575
  };
4584
4576
 
4585
- declare type SearchClient = {
4586
- search: DefaultSearchClient['search'];
4587
- searchForFacetValues: DefaultSearchClient['searchForFacetValues'];
4588
- addAlgoliaAgent?: DefaultSearchClient['addAlgoliaAgent'];
4589
- initIndex?: (indexName: string) => SearchIndex extends {
4590
- findAnswers: any;
4591
- } ? Partial<Pick<SearchIndex, 'findAnswers'>> : SearchIndex;
4592
- };
4593
-
4594
- declare type SearchIndex = ReturnType<DefaultSearchClient['initIndex']>;
4595
-
4596
4577
  declare type SendEvent = (...args: [InsightsEvent] | [string, string, string?]) => void;
4597
4578
 
4598
4579
  declare type SendEventForFacet = BuiltInSendEventForFacet & CustomSendEventForFacet;
@@ -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.43.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.43.0';
8607
8607
 
8608
8608
  var NAMESPACE = 'ais';
8609
8609
  var component = function component(componentName) {