instantsearch.js 4.64.0 → 4.64.2

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 (34) hide show
  1. package/cjs/components/SearchBox/SearchBox.js +2 -1
  2. package/cjs/connectors/numeric-menu/connectNumericMenu.js +5 -5
  3. package/cjs/connectors/rating-menu/connectRatingMenu.js +1 -2
  4. package/cjs/connectors/refinement-list/connectRefinementList.js +1 -2
  5. package/cjs/connectors/toggle-refinement/connectToggleRefinement.js +1 -1
  6. package/cjs/lib/InstantSearch.js +2 -6
  7. package/cjs/lib/server.js +27 -4
  8. package/cjs/lib/utils/hydrateSearchClient.js +10 -7
  9. package/cjs/lib/version.js +1 -1
  10. package/cjs/widgets/search-box/search-box.js +5 -0
  11. package/dist/instantsearch.development.d.ts +10 -6
  12. package/dist/instantsearch.development.js +43 -34
  13. package/dist/instantsearch.development.js.map +1 -1
  14. package/dist/instantsearch.production.d.ts +10 -6
  15. package/dist/instantsearch.production.min.d.ts +10 -6
  16. package/dist/instantsearch.production.min.js +2 -2
  17. package/dist/instantsearch.production.min.js.map +1 -1
  18. package/es/components/SearchBox/SearchBox.d.ts +3 -0
  19. package/es/components/SearchBox/SearchBox.js +2 -1
  20. package/es/connectors/numeric-menu/connectNumericMenu.js +5 -5
  21. package/es/connectors/rating-menu/connectRatingMenu.js +1 -2
  22. package/es/connectors/refinement-list/connectRefinementList.js +1 -2
  23. package/es/connectors/toggle-refinement/connectToggleRefinement.js +1 -1
  24. package/es/lib/InstantSearch.d.ts +2 -6
  25. package/es/lib/InstantSearch.js +2 -6
  26. package/es/lib/server.d.ts +8 -3
  27. package/es/lib/server.js +27 -4
  28. package/es/lib/utils/hydrateSearchClient.js +10 -7
  29. package/es/lib/version.d.ts +1 -1
  30. package/es/lib/version.js +1 -1
  31. package/es/types/results.d.ts +2 -0
  32. package/es/widgets/search-box/search-box.d.ts +6 -0
  33. package/es/widgets/search-box/search-box.js +5 -0
  34. package/package.json +6 -6
@@ -29,6 +29,7 @@ var defaultProps = {
29
29
  showLoadingIndicator: true,
30
30
  autofocus: false,
31
31
  searchAsYouType: true,
32
+ ignoreCompositionEvents: false,
32
33
  isSearchStalled: false,
33
34
  disabled: false,
34
35
  ariaLabel: 'Search',
@@ -58,7 +59,7 @@ var SearchBox = /*#__PURE__*/function (_Component) {
58
59
  refine = _this$props.refine,
59
60
  onChange = _this$props.onChange;
60
61
  var query = event.target.value;
61
- if (event.type === 'compositionend' || !event.isComposing) {
62
+ if (!(_this.props.ignoreCompositionEvents && event.isComposing)) {
62
63
  if (searchAsYouType) {
63
64
  refine(query);
64
65
  }
@@ -88,7 +88,7 @@ var connectNumericMenu = function connectNumericMenu(renderFn) {
88
88
  dispose: function dispose(_ref4) {
89
89
  var state = _ref4.state;
90
90
  unmountFn();
91
- return state.clearRefinements(attribute);
91
+ return state.removeNumericRefinement(attribute);
92
92
  },
93
93
  getWidgetUiState: function getWidgetUiState(uiState, _ref5) {
94
94
  var searchParameters = _ref5.searchParameters;
@@ -108,11 +108,11 @@ var connectNumericMenu = function connectNumericMenu(renderFn) {
108
108
  getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {
109
109
  var uiState = _ref6.uiState;
110
110
  var value = uiState.numericMenu && uiState.numericMenu[attribute];
111
- var withoutRefinements = searchParameters.clearRefinements(attribute);
111
+ var withoutRefinements = searchParameters.setQueryParameters({
112
+ numericRefinements: _objectSpread(_objectSpread({}, searchParameters.numericRefinements), {}, _defineProperty({}, attribute, {}))
113
+ });
112
114
  if (!value) {
113
- return withoutRefinements.setQueryParameters({
114
- numericRefinements: _objectSpread(_objectSpread({}, withoutRefinements.numericRefinements), {}, _defineProperty({}, attribute, {}))
115
- });
115
+ return withoutRefinements;
116
116
  }
117
117
  var isExact = value.indexOf(':') === -1;
118
118
  if (isExact) {
@@ -269,8 +269,7 @@ var connectRatingMenu = function connectRatingMenu(renderFn) {
269
269
  getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref8) {
270
270
  var uiState = _ref8.uiState;
271
271
  var value = uiState.ratingMenu && uiState.ratingMenu[attribute];
272
- var withoutRefinements = searchParameters.clearRefinements(attribute);
273
- var withDisjunctiveFacet = withoutRefinements.addDisjunctiveFacet(attribute);
272
+ var withDisjunctiveFacet = searchParameters.addDisjunctiveFacet(attribute).removeNumericRefinement(attribute).removeDisjunctiveFacetRefinement(attribute);
274
273
  if (!value) {
275
274
  return withDisjunctiveFacet.setQueryParameters({
276
275
  numericRefinements: _objectSpread(_objectSpread({}, withDisjunctiveFacet.numericRefinements), {}, _defineProperty({}, attribute, {}))
@@ -265,8 +265,7 @@ var connectRefinementList = function connectRefinementList(renderFn) {
265
265
  return searchParameters;
266
266
  }
267
267
  var values = uiState.refinementList && uiState.refinementList[attribute];
268
- var withoutRefinements = searchParameters.clearRefinements(attribute);
269
- var withFacetConfiguration = isDisjunctive ? withoutRefinements.addDisjunctiveFacet(attribute) : withoutRefinements.addFacet(attribute);
268
+ var withFacetConfiguration = isDisjunctive ? searchParameters.addDisjunctiveFacet(attribute).removeDisjunctiveFacetRefinement(attribute) : searchParameters.addFacet(attribute).removeFacetRefinement(attribute);
270
269
  var currentMaxValuesPerFacet = withFacetConfiguration.maxValuesPerFacet || 0;
271
270
  var nextMaxValuesPerFacet = Math.max(currentMaxValuesPerFacet, showMore ? showMoreLimit : limit);
272
271
  var withMaxValuesPerFacet = withFacetConfiguration.setQueryParameter('maxValuesPerFacet', nextMaxValuesPerFacet);
@@ -283,7 +283,7 @@ var connectToggleRefinement = function connectToggleRefinement(renderFn) {
283
283
  process.env.NODE_ENV === 'development' ? (0, _utils.warning)(false, "ToggleRefinement: Attribute \"".concat(attribute, "\" is already used by another widget of a different type.\nAs this is not supported, please make sure to remove this other widget or this ToggleRefinement widget will not work at all.")) : void 0;
284
284
  return searchParameters;
285
285
  }
286
- var withFacetConfiguration = searchParameters.clearRefinements(attribute).addDisjunctiveFacet(attribute);
286
+ var withFacetConfiguration = searchParameters.addDisjunctiveFacet(attribute).removeDisjunctiveFacetRefinement(attribute);
287
287
  var isRefined = Boolean(uiState.toggle && uiState.toggle[attribute]);
288
288
  if (isRefined) {
289
289
  if (on) {
@@ -365,9 +365,7 @@ var InstantSearch = /*#__PURE__*/function (_EventEmitter) {
365
365
 
366
366
  /**
367
367
  * Ends the initialization of InstantSearch.js and triggers the
368
- * first search. This method should be called after all widgets have been added
369
- * to the instance of InstantSearch.js. InstantSearch.js also supports adding and removing
370
- * widgets after the start as an **EXPERIMENTAL** feature.
368
+ * first search.
371
369
  */
372
370
  }, {
373
371
  key: "start",
@@ -519,9 +517,7 @@ var InstantSearch = /*#__PURE__*/function (_EventEmitter) {
519
517
  }
520
518
 
521
519
  /**
522
- * Removes all widgets without triggering a search afterwards. This is an **EXPERIMENTAL** feature,
523
- * if you find an issue with it, please
524
- * [open an issue](https://github.com/algolia/instantsearch/issues/new?title=Problem%20with%20dispose).
520
+ * Removes all widgets without triggering a search afterwards.
525
521
  * @return {undefined} This method does not return anything
526
522
  */
527
523
  }, {
package/cjs/lib/server.js CHANGED
@@ -18,12 +18,26 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
18
18
  */
19
19
  function waitForResults(search) {
20
20
  var helper = search.mainHelper;
21
+
22
+ // Extract search parameters from the search client to use them
23
+ // later during hydration.
24
+ var requestParamsList;
25
+ var client = helper.getClient();
26
+ helper.setClient({
27
+ search: function search(queries) {
28
+ requestParamsList = queries.map(function (_ref) {
29
+ var params = _ref.params;
30
+ return params;
31
+ });
32
+ return client.search(queries);
33
+ }
34
+ });
21
35
  helper.searchOnlyWithDerivedHelpers();
22
36
  return new Promise(function (resolve, reject) {
23
37
  // All derived helpers resolve in the same tick so we're safe only relying
24
38
  // on the first one.
25
39
  helper.derivedHelpers[0].on('result', function () {
26
- resolve();
40
+ resolve(requestParamsList);
27
41
  });
28
42
 
29
43
  // However, we listen to errors that can happen on any derived helper because
@@ -45,17 +59,26 @@ function waitForResults(search) {
45
59
  /**
46
60
  * Walks the InstantSearch root index to construct the initial results.
47
61
  */
48
- function getInitialResults(rootIndex) {
62
+ function getInitialResults(rootIndex,
63
+ /**
64
+ * Search parameters sent to the search client,
65
+ * returned by `waitForResults()`.
66
+ */
67
+ requestParamsList) {
49
68
  var initialResults = {};
69
+ var requestParamsIndex = 0;
50
70
  (0, _utils.walkIndex)(rootIndex, function (widget) {
51
71
  var searchResults = widget.getResults();
52
72
  if (searchResults) {
53
- initialResults[widget.getIndexId()] = {
73
+ var requestParams = requestParamsList === null || requestParamsList === void 0 ? void 0 : requestParamsList[requestParamsIndex++];
74
+ initialResults[widget.getIndexId()] = _objectSpread({
54
75
  // We convert the Helper state to a plain object to pass parsable data
55
76
  // structures from server to client.
56
77
  state: _objectSpread({}, searchResults._state),
57
78
  results: searchResults._rawResults
58
- };
79
+ }, requestParams && {
80
+ requestParams: requestParams
81
+ });
59
82
  }
60
83
  });
61
84
  if (Object.keys(initialResults).length === 0) {
@@ -29,13 +29,16 @@ function hydrateSearchClient(client, results) {
29
29
  return;
30
30
  }
31
31
  var cachedRequest = Object.keys(results).map(function (key) {
32
- return results[key].results.map(function (result) {
33
- return {
34
- indexName: result.index,
35
- // We normalize the params received from the server as they can
36
- // be serialized differently depending on the engine.
37
- params: serializeQueryParameters(deserializeQueryParameters(result.params))
38
- };
32
+ var _results$key = results[key],
33
+ state = _results$key.state,
34
+ requestParams = _results$key.requestParams,
35
+ serverResults = _results$key.results;
36
+ return serverResults.map(function (result) {
37
+ return _objectSpread({
38
+ indexName: state.index || result.index
39
+ }, requestParams || result.params ? {
40
+ params: serializeQueryParameters(requestParams || deserializeQueryParameters(result.params))
41
+ } : {});
39
42
  });
40
43
  });
41
44
  var cachedResults = Object.keys(results).reduce(function (acc, key) {
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _default = '4.64.0';
7
+ var _default = '4.64.2';
8
8
  exports.default = _default;
@@ -29,6 +29,7 @@ var renderer = function renderer(_ref) {
29
29
  templates = _ref.templates,
30
30
  autofocus = _ref.autofocus,
31
31
  searchAsYouType = _ref.searchAsYouType,
32
+ ignoreCompositionEvents = _ref.ignoreCompositionEvents,
32
33
  showReset = _ref.showReset,
33
34
  showSubmit = _ref.showSubmit,
34
35
  showLoadingIndicator = _ref.showLoadingIndicator;
@@ -42,6 +43,7 @@ var renderer = function renderer(_ref) {
42
43
  autofocus: autofocus,
43
44
  refine: refine,
44
45
  searchAsYouType: searchAsYouType,
46
+ ignoreCompositionEvents: ignoreCompositionEvents,
45
47
  templates: templates,
46
48
  showSubmit: showSubmit,
47
49
  showReset: showReset,
@@ -72,6 +74,8 @@ var searchBox = function searchBox(widgetParams) {
72
74
  autofocus = _ref3$autofocus === void 0 ? false : _ref3$autofocus,
73
75
  _ref3$searchAsYouType = _ref3.searchAsYouType,
74
76
  searchAsYouType = _ref3$searchAsYouType === void 0 ? true : _ref3$searchAsYouType,
77
+ _ref3$ignoreCompositi = _ref3.ignoreCompositionEvents,
78
+ ignoreCompositionEvents = _ref3$ignoreCompositi === void 0 ? false : _ref3$ignoreCompositi,
75
79
  _ref3$showReset = _ref3.showReset,
76
80
  showReset = _ref3$showReset === void 0 ? true : _ref3$showReset,
77
81
  _ref3$showSubmit = _ref3.showSubmit,
@@ -120,6 +124,7 @@ var searchBox = function searchBox(widgetParams) {
120
124
  templates: templates,
121
125
  autofocus: autofocus,
122
126
  searchAsYouType: searchAsYouType,
127
+ ignoreCompositionEvents: ignoreCompositionEvents,
123
128
  showReset: showReset,
124
129
  showSubmit: showSubmit,
125
130
  showLoadingIndicator: showLoadingIndicator
@@ -15,6 +15,7 @@ import type * as Places from 'places.js';
15
15
  import type { PlainSearchParameters } from 'algoliasearch-helper';
16
16
  import { default as qs_2 } from 'qs';
17
17
  import { SearchClient } from 'algoliasearch-helper/types/algoliasearch.js';
18
+ import { SearchOptions } from 'algoliasearch-helper/types/algoliasearch.js';
18
19
  import type { SearchParameters } from 'algoliasearch-helper';
19
20
  import type { SearchResults } from 'algoliasearch-helper';
20
21
  import { VNode } from 'preact';
@@ -2310,6 +2311,7 @@ declare type InfiniteHitsWidgetParams = {
2310
2311
  declare type InitialResult = {
2311
2312
  state: PlainSearchParameters;
2312
2313
  results: SearchResults['_rawResults'];
2314
+ requestParams?: SearchOptions;
2313
2315
  };
2314
2316
 
2315
2317
  declare type InitialResults = Record<string, InitialResult>;
@@ -2455,15 +2457,11 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
2455
2457
  removeWidgets(widgets: Array<Widget | IndexWidget>): this;
2456
2458
  /**
2457
2459
  * Ends the initialization of InstantSearch.js and triggers the
2458
- * first search. This method should be called after all widgets have been added
2459
- * to the instance of InstantSearch.js. InstantSearch.js also supports adding and removing
2460
- * widgets after the start as an **EXPERIMENTAL** feature.
2460
+ * first search.
2461
2461
  */
2462
2462
  start(): void;
2463
2463
  /**
2464
- * Removes all widgets without triggering a search afterwards. This is an **EXPERIMENTAL** feature,
2465
- * if you find an issue with it, please
2466
- * [open an issue](https://github.com/algolia/instantsearch/issues/new?title=Problem%20with%20dispose).
2464
+ * Removes all widgets without triggering a search afterwards.
2467
2465
  * @return {undefined} This method does not return anything
2468
2466
  */
2469
2467
  dispose(): void;
@@ -4824,6 +4822,12 @@ declare type SearchBoxWidgetParams = {
4824
4822
  * once `<Enter>` is pressed only.
4825
4823
  */
4826
4824
  searchAsYouType?: boolean;
4825
+ /**
4826
+ * Whether to update the search state in the middle of a
4827
+ * composition session.
4828
+ * @default false
4829
+ */
4830
+ ignoreCompositionEvents?: boolean;
4827
4831
  /**
4828
4832
  * Whether to show the reset button
4829
4833
  */
@@ -1,4 +1,4 @@
1
- /*! InstantSearch.js 4.64.0 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch */
1
+ /*! InstantSearch.js 4.64.2 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch */
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) :
@@ -1424,13 +1424,16 @@
1424
1424
  return;
1425
1425
  }
1426
1426
  var cachedRequest = Object.keys(results).map(function (key) {
1427
- return results[key].results.map(function (result) {
1428
- return {
1429
- indexName: result.index,
1430
- // We normalize the params received from the server as they can
1431
- // be serialized differently depending on the engine.
1432
- params: serializeQueryParameters(deserializeQueryParameters(result.params))
1433
- };
1427
+ var _results$key = results[key],
1428
+ state = _results$key.state,
1429
+ requestParams = _results$key.requestParams,
1430
+ serverResults = _results$key.results;
1431
+ return serverResults.map(function (result) {
1432
+ return _objectSpread2({
1433
+ indexName: state.index || result.index
1434
+ }, requestParams || result.params ? {
1435
+ params: serializeQueryParameters(requestParams || deserializeQueryParameters(result.params))
1436
+ } : {});
1434
1437
  });
1435
1438
  });
1436
1439
  var cachedResults = Object.keys(results).reduce(function (acc, key) {
@@ -3588,7 +3591,7 @@
3588
3591
  dispose: function dispose(_ref4) {
3589
3592
  var state = _ref4.state;
3590
3593
  unmountFn();
3591
- return state.clearRefinements(attribute);
3594
+ return state.removeNumericRefinement(attribute);
3592
3595
  },
3593
3596
  getWidgetUiState: function getWidgetUiState(uiState, _ref5) {
3594
3597
  var searchParameters = _ref5.searchParameters;
@@ -3608,11 +3611,11 @@
3608
3611
  getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {
3609
3612
  var uiState = _ref6.uiState;
3610
3613
  var value = uiState.numericMenu && uiState.numericMenu[attribute];
3611
- var withoutRefinements = searchParameters.clearRefinements(attribute);
3614
+ var withoutRefinements = searchParameters.setQueryParameters({
3615
+ numericRefinements: _objectSpread2(_objectSpread2({}, searchParameters.numericRefinements), {}, _defineProperty({}, attribute, {}))
3616
+ });
3612
3617
  if (!value) {
3613
- return withoutRefinements.setQueryParameters({
3614
- numericRefinements: _objectSpread2(_objectSpread2({}, withoutRefinements.numericRefinements), {}, _defineProperty({}, attribute, {}))
3615
- });
3618
+ return withoutRefinements;
3616
3619
  }
3617
3620
  var isExact = value.indexOf(':') === -1;
3618
3621
  if (isExact) {
@@ -4478,8 +4481,7 @@
4478
4481
  return searchParameters;
4479
4482
  }
4480
4483
  var values = uiState.refinementList && uiState.refinementList[attribute];
4481
- var withoutRefinements = searchParameters.clearRefinements(attribute);
4482
- var withFacetConfiguration = isDisjunctive ? withoutRefinements.addDisjunctiveFacet(attribute) : withoutRefinements.addFacet(attribute);
4484
+ var withFacetConfiguration = isDisjunctive ? searchParameters.addDisjunctiveFacet(attribute).removeDisjunctiveFacetRefinement(attribute) : searchParameters.addFacet(attribute).removeFacetRefinement(attribute);
4483
4485
  var currentMaxValuesPerFacet = withFacetConfiguration.maxValuesPerFacet || 0;
4484
4486
  var nextMaxValuesPerFacet = Math.max(currentMaxValuesPerFacet, showMore ? showMoreLimit : limit);
4485
4487
  var withMaxValuesPerFacet = withFacetConfiguration.setQueryParameter('maxValuesPerFacet', nextMaxValuesPerFacet);
@@ -4947,8 +4949,7 @@
4947
4949
  getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref8) {
4948
4950
  var uiState = _ref8.uiState;
4949
4951
  var value = uiState.ratingMenu && uiState.ratingMenu[attribute];
4950
- var withoutRefinements = searchParameters.clearRefinements(attribute);
4951
- var withDisjunctiveFacet = withoutRefinements.addDisjunctiveFacet(attribute);
4952
+ var withDisjunctiveFacet = searchParameters.addDisjunctiveFacet(attribute).removeNumericRefinement(attribute).removeDisjunctiveFacetRefinement(attribute);
4952
4953
  if (!value) {
4953
4954
  return withDisjunctiveFacet.setQueryParameters({
4954
4955
  numericRefinements: _objectSpread2(_objectSpread2({}, withDisjunctiveFacet.numericRefinements), {}, _defineProperty({}, attribute, {}))
@@ -5306,7 +5307,7 @@
5306
5307
  _warning(false, "ToggleRefinement: Attribute \"".concat(attribute, "\" is already used by another widget of a different type.\nAs this is not supported, please make sure to remove this other widget or this ToggleRefinement widget will not work at all.")) ;
5307
5308
  return searchParameters;
5308
5309
  }
5309
- var withFacetConfiguration = searchParameters.clearRefinements(attribute).addDisjunctiveFacet(attribute);
5310
+ var withFacetConfiguration = searchParameters.addDisjunctiveFacet(attribute).removeDisjunctiveFacetRefinement(attribute);
5310
5311
  var isRefined = Boolean(uiState.toggle && uiState.toggle[attribute]);
5311
5312
  if (isRefined) {
5312
5313
  if (on) {
@@ -6521,9 +6522,12 @@
6521
6522
  .sort()
6522
6523
  .forEach(function (facetName) {
6523
6524
  var facetValues = facetsRefinements[facetName] || [];
6524
- facetValues.sort().forEach(function (facetValue) {
6525
- facetFilters.push(facetName + ':' + facetValue);
6526
- });
6525
+ facetValues
6526
+ .slice()
6527
+ .sort()
6528
+ .forEach(function (facetValue) {
6529
+ facetFilters.push(facetName + ':' + facetValue);
6530
+ });
6527
6531
  });
6528
6532
 
6529
6533
  var facetsExcludes = state.facetsExcludes || {};
@@ -6546,9 +6550,12 @@
6546
6550
  }
6547
6551
  var orFilters = [];
6548
6552
 
6549
- facetValues.sort().forEach(function (facetValue) {
6550
- orFilters.push(facetName + ':' + facetValue);
6551
- });
6553
+ facetValues
6554
+ .slice()
6555
+ .sort()
6556
+ .forEach(function (facetValue) {
6557
+ orFilters.push(facetName + ':' + facetValue);
6558
+ });
6552
6559
 
6553
6560
  facetFilters.push(orFilters);
6554
6561
  });
@@ -7214,7 +7221,7 @@
7214
7221
  numbers.numericRefinements = numericRefinements;
7215
7222
  }
7216
7223
 
7217
- return merge_1({}, partialState, numbers);
7224
+ return merge_1(partialState, numbers);
7218
7225
  };
7219
7226
 
7220
7227
  /**
@@ -10086,7 +10093,7 @@
10086
10093
 
10087
10094
  var SearchResults_1 = SearchResults;
10088
10095
 
10089
- var version = '3.16.1';
10096
+ var version = '3.16.2';
10090
10097
 
10091
10098
  var escapeFacetValue$4 = escapeFacetValue_1.escapeFacetValue;
10092
10099
 
@@ -14883,7 +14890,7 @@
14883
14890
  };
14884
14891
  }
14885
14892
 
14886
- var version$1 = '4.64.0';
14893
+ var version$1 = '4.64.2';
14887
14894
 
14888
14895
  var withUsage$r = createDocumentationMessageGenerator({
14889
14896
  name: 'instantsearch'
@@ -15219,9 +15226,7 @@
15219
15226
 
15220
15227
  /**
15221
15228
  * Ends the initialization of InstantSearch.js and triggers the
15222
- * first search. This method should be called after all widgets have been added
15223
- * to the instance of InstantSearch.js. InstantSearch.js also supports adding and removing
15224
- * widgets after the start as an **EXPERIMENTAL** feature.
15229
+ * first search.
15225
15230
  */
15226
15231
  }, {
15227
15232
  key: "start",
@@ -15373,9 +15378,7 @@
15373
15378
  }
15374
15379
 
15375
15380
  /**
15376
- * Removes all widgets without triggering a search afterwards. This is an **EXPERIMENTAL** feature,
15377
- * if you find an issue with it, please
15378
- * [open an issue](https://github.com/algolia/instantsearch/issues/new?title=Problem%20with%20dispose).
15381
+ * Removes all widgets without triggering a search afterwards.
15379
15382
  * @return {undefined} This method does not return anything
15380
15383
  */
15381
15384
  }, {
@@ -18036,6 +18039,7 @@
18036
18039
  showLoadingIndicator: true,
18037
18040
  autofocus: false,
18038
18041
  searchAsYouType: true,
18042
+ ignoreCompositionEvents: false,
18039
18043
  isSearchStalled: false,
18040
18044
  disabled: false,
18041
18045
  ariaLabel: 'Search',
@@ -18065,7 +18069,7 @@
18065
18069
  refine = _this$props.refine,
18066
18070
  onChange = _this$props.onChange;
18067
18071
  var query = event.target.value;
18068
- if (event.type === 'compositionend' || !event.isComposing) {
18072
+ if (!(_this.props.ignoreCompositionEvents && event.isComposing)) {
18069
18073
  if (searchAsYouType) {
18070
18074
  refine(query);
18071
18075
  }
@@ -21823,6 +21827,7 @@
21823
21827
  templates = _ref.templates,
21824
21828
  autofocus = _ref.autofocus,
21825
21829
  searchAsYouType = _ref.searchAsYouType,
21830
+ ignoreCompositionEvents = _ref.ignoreCompositionEvents,
21826
21831
  showReset = _ref.showReset,
21827
21832
  showSubmit = _ref.showSubmit,
21828
21833
  showLoadingIndicator = _ref.showLoadingIndicator;
@@ -21836,6 +21841,7 @@
21836
21841
  autofocus: autofocus,
21837
21842
  refine: refine,
21838
21843
  searchAsYouType: searchAsYouType,
21844
+ ignoreCompositionEvents: ignoreCompositionEvents,
21839
21845
  templates: templates,
21840
21846
  showSubmit: showSubmit,
21841
21847
  showReset: showReset,
@@ -21866,6 +21872,8 @@
21866
21872
  autofocus = _ref3$autofocus === void 0 ? false : _ref3$autofocus,
21867
21873
  _ref3$searchAsYouType = _ref3.searchAsYouType,
21868
21874
  searchAsYouType = _ref3$searchAsYouType === void 0 ? true : _ref3$searchAsYouType,
21875
+ _ref3$ignoreCompositi = _ref3.ignoreCompositionEvents,
21876
+ ignoreCompositionEvents = _ref3$ignoreCompositi === void 0 ? false : _ref3$ignoreCompositi,
21869
21877
  _ref3$showReset = _ref3.showReset,
21870
21878
  showReset = _ref3$showReset === void 0 ? true : _ref3$showReset,
21871
21879
  _ref3$showSubmit = _ref3.showSubmit,
@@ -21914,6 +21922,7 @@
21914
21922
  templates: templates,
21915
21923
  autofocus: autofocus,
21916
21924
  searchAsYouType: searchAsYouType,
21925
+ ignoreCompositionEvents: ignoreCompositionEvents,
21917
21926
  showReset: showReset,
21918
21927
  showSubmit: showSubmit,
21919
21928
  showLoadingIndicator: showLoadingIndicator