react-instantsearch 7.20.0 → 7.20.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.
@@ -10,7 +10,7 @@ var _reactInstantsearchCore = require("react-instantsearch-core");
10
10
  var _AutocompleteSearch = require("../components/AutocompleteSearch");
11
11
  var _ReverseHighlight = require("./ReverseHighlight");
12
12
  var _excluded = ["indices", "showSuggestions", "showRecent", "searchParameters"],
13
- _excluded2 = ["indicesConfig", "refineSearchBox", "getSearchPageURL", "onSelect", "indexUiState", "isSearchPage", "panelComponent", "showRecent", "showSuggestions"];
13
+ _excluded2 = ["indicesConfig", "refineSearchBox", "getSearchPageURL", "onSelect", "indexUiState", "isSearchPage", "panelComponent", "showRecent", "showSuggestions", "placeholder"];
14
14
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
15
15
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
16
16
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
@@ -134,6 +134,7 @@ function InnerAutocomplete(_ref3) {
134
134
  PanelComponent = _ref3.panelComponent,
135
135
  showRecent = _ref3.showRecent,
136
136
  showSuggestions = _ref3.showSuggestions,
137
+ placeholder = _ref3.placeholder,
137
138
  props = _objectWithoutProperties(_ref3, _excluded2);
138
139
  var _useAutocomplete = (0, _reactInstantsearchCore.useAutocomplete)(),
139
140
  indices = _useAutocomplete.indices,
@@ -172,7 +173,8 @@ function InnerAutocomplete(_ref3) {
172
173
  return;
173
174
  }
174
175
  setQuery(query);
175
- }
176
+ },
177
+ placeholder: placeholder
176
178
  }),
177
179
  getInputProps = _usePropGetters.getInputProps,
178
180
  getItemProps = _usePropGetters.getItemProps,
@@ -203,7 +205,8 @@ function InnerAutocomplete(_ref3) {
203
205
  item: 'ais-AutocompleteRecentSearchesItem'
204
206
  },
205
207
  items: storageHits,
206
- getItemProps: getItemProps
208
+ getItemProps: getItemProps,
209
+ key: "recentSearches"
207
210
  });
208
211
  }
209
212
  indices.forEach(function (_ref6, i) {
@@ -211,6 +214,11 @@ function InnerAutocomplete(_ref3) {
211
214
  indexName = _ref6.indexName,
212
215
  hits = _ref6.hits;
213
216
  var elementId = indexName === (showSuggestions === null || showSuggestions === void 0 ? void 0 : showSuggestions.indexName) ? 'suggestions' : indexName;
217
+ var filteredHits = elementId === 'suggestions' && showRecent ? hits.filter(function (suggestionHit) {
218
+ return !storageHits.find(function (storageHit) {
219
+ return storageHit.query === suggestionHit.query;
220
+ });
221
+ }) : hits;
214
222
  elements[elementId] = /*#__PURE__*/_react.default.createElement(AutocompleteIndex, {
215
223
  key: indexId
216
224
  // @ts-expect-error - there seems to be problems with React.ComponentType and this, but it's actually correct
@@ -219,7 +227,7 @@ function InnerAutocomplete(_ref3) {
219
227
  // @ts-expect-error - there seems to be problems with React.ComponentType and this, but it's actually correct
220
228
  ,
221
229
  ItemComponent: indicesConfig[i].itemComponent,
222
- items: hits.map(function (item) {
230
+ items: filteredHits.map(function (item) {
223
231
  return _objectSpread(_objectSpread({}, item), {}, {
224
232
  __indexName: indexId
225
233
  });
@@ -89,7 +89,7 @@ function createCarouselTool(showViewAll, itemComponent, getSearchPageURL) {
89
89
  window.location.href = getSearchPageURL(nextUiState);
90
90
  },
91
91
  className: "ais-ChatToolSearchIndexCarouselHeaderViewAll"
92
- }, "View all", /*#__PURE__*/_react.default.createElement(_instantsearchUiComponents.ArrowRightIconComponent, {
92
+ }, "View all", /*#__PURE__*/_react.default.createElement(_instantsearchUiComponents.ArrowRightIcon, {
93
93
  createElement: _react.createElement
94
94
  }))), (hitsPerPage !== null && hitsPerPage !== void 0 ? hitsPerPage : 0) > 2 && /*#__PURE__*/_react.default.createElement("div", {
95
95
  className: "ais-ChatToolSearchIndexCarouselHeaderScrollButtons"
@@ -100,7 +100,7 @@ function createCarouselTool(showViewAll, itemComponent, getSearchPageURL) {
100
100
  onClick: scrollLeft,
101
101
  disabled: !canScrollLeft,
102
102
  className: "ais-ChatToolSearchIndexCarouselHeaderScrollButton"
103
- }, /*#__PURE__*/_react.default.createElement(_instantsearchUiComponents.ChevronLeftIconComponent, {
103
+ }, /*#__PURE__*/_react.default.createElement(_instantsearchUiComponents.ChevronLeftIcon, {
104
104
  createElement: _react.createElement
105
105
  })), /*#__PURE__*/_react.default.createElement(Button, {
106
106
  variant: "outline",
@@ -109,7 +109,7 @@ function createCarouselTool(showViewAll, itemComponent, getSearchPageURL) {
109
109
  onClick: scrollRight,
110
110
  disabled: !canScrollRight,
111
111
  className: "ais-ChatToolSearchIndexCarouselHeaderScrollButton"
112
- }, /*#__PURE__*/_react.default.createElement(_instantsearchUiComponents.ChevronRightIconComponent, {
112
+ }, /*#__PURE__*/_react.default.createElement(_instantsearchUiComponents.ChevronRightIcon, {
113
113
  createElement: _react.createElement
114
114
  }))));
115
115
  }
@@ -39,6 +39,7 @@ export type AutocompleteProps<TItem extends BaseHit> = ComponentProps<'div'> & {
39
39
  }) => React.JSX.Element;
40
40
  searchParameters?: AutocompleteSearchParameters;
41
41
  classNames?: Partial<AutocompleteClassNames>;
42
+ placeholder?: string;
42
43
  };
43
44
  export declare function EXPERIMENTAL_Autocomplete<TItem extends BaseHit = BaseHit>({ indices, showSuggestions, showRecent, searchParameters: userSearchParameters, ...props }: AutocompleteProps<TItem>): React.JSX.Element;
44
45
  export {};
@@ -1,5 +1,5 @@
1
1
  var _excluded = ["indices", "showSuggestions", "showRecent", "searchParameters"],
2
- _excluded2 = ["indicesConfig", "refineSearchBox", "getSearchPageURL", "onSelect", "indexUiState", "isSearchPage", "panelComponent", "showRecent", "showSuggestions"];
2
+ _excluded2 = ["indicesConfig", "refineSearchBox", "getSearchPageURL", "onSelect", "indexUiState", "isSearchPage", "panelComponent", "showRecent", "showSuggestions", "placeholder"];
3
3
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
4
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
5
5
  function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
@@ -127,6 +127,7 @@ function InnerAutocomplete(_ref3) {
127
127
  PanelComponent = _ref3.panelComponent,
128
128
  showRecent = _ref3.showRecent,
129
129
  showSuggestions = _ref3.showSuggestions,
130
+ placeholder = _ref3.placeholder,
130
131
  props = _objectWithoutProperties(_ref3, _excluded2);
131
132
  var _useAutocomplete = useAutocomplete(),
132
133
  indices = _useAutocomplete.indices,
@@ -165,7 +166,8 @@ function InnerAutocomplete(_ref3) {
165
166
  return;
166
167
  }
167
168
  setQuery(query);
168
- }
169
+ },
170
+ placeholder: placeholder
169
171
  }),
170
172
  getInputProps = _usePropGetters.getInputProps,
171
173
  getItemProps = _usePropGetters.getItemProps,
@@ -196,7 +198,8 @@ function InnerAutocomplete(_ref3) {
196
198
  item: 'ais-AutocompleteRecentSearchesItem'
197
199
  },
198
200
  items: storageHits,
199
- getItemProps: getItemProps
201
+ getItemProps: getItemProps,
202
+ key: "recentSearches"
200
203
  });
201
204
  }
202
205
  indices.forEach(function (_ref6, i) {
@@ -204,6 +207,11 @@ function InnerAutocomplete(_ref3) {
204
207
  indexName = _ref6.indexName,
205
208
  hits = _ref6.hits;
206
209
  var elementId = indexName === (showSuggestions === null || showSuggestions === void 0 ? void 0 : showSuggestions.indexName) ? 'suggestions' : indexName;
210
+ var filteredHits = elementId === 'suggestions' && showRecent ? hits.filter(function (suggestionHit) {
211
+ return !storageHits.find(function (storageHit) {
212
+ return storageHit.query === suggestionHit.query;
213
+ });
214
+ }) : hits;
207
215
  elements[elementId] = /*#__PURE__*/React.createElement(AutocompleteIndex, {
208
216
  key: indexId
209
217
  // @ts-expect-error - there seems to be problems with React.ComponentType and this, but it's actually correct
@@ -212,7 +220,7 @@ function InnerAutocomplete(_ref3) {
212
220
  // @ts-expect-error - there seems to be problems with React.ComponentType and this, but it's actually correct
213
221
  ,
214
222
  ItemComponent: indicesConfig[i].itemComponent,
215
- items: hits.map(function (item) {
223
+ items: filteredHits.map(function (item) {
216
224
  return _objectSpread(_objectSpread({}, item), {}, {
217
225
  __indexName: indexId
218
226
  });
@@ -5,7 +5,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
8
- import { ChevronLeftIconComponent, ChevronRightIconComponent, ArrowRightIconComponent, createButtonComponent } from 'instantsearch-ui-components';
8
+ import { ChevronLeftIcon, ChevronRightIcon, ArrowRightIcon, createButtonComponent } from 'instantsearch-ui-components';
9
9
  import React, { createElement } from 'react';
10
10
  import { Carousel } from "../../../components/index.js";
11
11
  function createCarouselTool(showViewAll, itemComponent, getSearchPageURL) {
@@ -82,7 +82,7 @@ function createCarouselTool(showViewAll, itemComponent, getSearchPageURL) {
82
82
  window.location.href = getSearchPageURL(nextUiState);
83
83
  },
84
84
  className: "ais-ChatToolSearchIndexCarouselHeaderViewAll"
85
- }, "View all", /*#__PURE__*/React.createElement(ArrowRightIconComponent, {
85
+ }, "View all", /*#__PURE__*/React.createElement(ArrowRightIcon, {
86
86
  createElement: createElement
87
87
  }))), (hitsPerPage !== null && hitsPerPage !== void 0 ? hitsPerPage : 0) > 2 && /*#__PURE__*/React.createElement("div", {
88
88
  className: "ais-ChatToolSearchIndexCarouselHeaderScrollButtons"
@@ -93,7 +93,7 @@ function createCarouselTool(showViewAll, itemComponent, getSearchPageURL) {
93
93
  onClick: scrollLeft,
94
94
  disabled: !canScrollLeft,
95
95
  className: "ais-ChatToolSearchIndexCarouselHeaderScrollButton"
96
- }, /*#__PURE__*/React.createElement(ChevronLeftIconComponent, {
96
+ }, /*#__PURE__*/React.createElement(ChevronLeftIcon, {
97
97
  createElement: createElement
98
98
  })), /*#__PURE__*/React.createElement(Button, {
99
99
  variant: "outline",
@@ -102,7 +102,7 @@ function createCarouselTool(showViewAll, itemComponent, getSearchPageURL) {
102
102
  onClick: scrollRight,
103
103
  disabled: !canScrollRight,
104
104
  className: "ais-ChatToolSearchIndexCarouselHeaderScrollButton"
105
- }, /*#__PURE__*/React.createElement(ChevronRightIconComponent, {
105
+ }, /*#__PURE__*/React.createElement(ChevronRightIcon, {
106
106
  createElement: createElement
107
107
  }))));
108
108
  }
@@ -7,7 +7,7 @@
7
7
 
8
8
  var React__default = 'default' in React ? React['default'] : React;
9
9
 
10
- var version = '7.20.0';
10
+ var version = '7.20.1';
11
11
 
12
12
  // Copyright Joyent, Inc. and other Node contributors.
13
13
  //
@@ -8068,6 +8068,11 @@
8068
8068
  return insideBoundingBoxStringToBoundingBox(value);
8069
8069
  }
8070
8070
 
8071
+ function getAlgoliaAgent(client) {
8072
+ var clientTyped = client;
8073
+ return clientTyped.transporter && clientTyped.transporter.userAgent ? clientTyped.transporter.userAgent.value : clientTyped._ua;
8074
+ }
8075
+
8071
8076
  // typed as any, since it accepts the _real_ js clients, not the interface we otherwise expect
8072
8077
  function getAppIdAndApiKey(searchClient) {
8073
8078
  if (searchClient.appId && searchClient.apiKey) {
@@ -11827,8 +11832,7 @@
11827
11832
  subscribe: function subscribe() {
11828
11833
  // using setTimeout here to delay extraction until widgets have been added in a tick (e.g. Vue)
11829
11834
  setTimeout(function () {
11830
- var client = instantSearchInstance.client;
11831
- payload.ua = client.transporter && client.transporter.userAgent ? client.transporter.userAgent.value : client._ua;
11835
+ payload.ua = getAlgoliaAgent(instantSearchInstance.client);
11832
11836
  extractWidgetPayload(instantSearchInstance.mainIndex.getWidgets(), instantSearchInstance, payload);
11833
11837
  instantSearchInstance.middleware.forEach(function (middleware) {
11834
11838
  return payload.widgets.push({
@@ -13351,7 +13355,7 @@
13351
13355
  };
13352
13356
  }
13353
13357
 
13354
- var version$3 = '4.84.0';
13358
+ var version$3 = '4.85.0';
13355
13359
 
13356
13360
  function _typeof$q(o) {
13357
13361
  "@babel/helpers - typeof";
@@ -20941,7 +20945,7 @@
20941
20945
  onSelect = _getItemProps.onSelect,
20942
20946
  itemProps = _objectWithoutProperties$d(_getItemProps, _excluded$d);
20943
20947
  return createElement("li", _extends$2({
20944
- key: item.objectID
20948
+ key: "".concat(itemProps.id, ":").concat(item.objectID)
20945
20949
  }, itemProps, {
20946
20950
  className: cx('ais-AutocompleteIndexItem', classNames.item, className)
20947
20951
  }), createElement(ItemComponent, {
@@ -20952,16 +20956,23 @@
20952
20956
  };
20953
20957
  }
20954
20958
 
20955
- var _excluded$e = ["children", "classNames"];
20959
+ var _excluded$e = ["children", "classNames", "hidden"];
20956
20960
  function createAutocompletePanelComponent(_ref) {
20957
20961
  var createElement = _ref.createElement;
20958
20962
  return function AutocompletePanel(userProps) {
20959
20963
  var children = userProps.children,
20960
20964
  _userProps$classNames = userProps.classNames,
20961
20965
  classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
20966
+ hidden = userProps.hidden,
20962
20967
  props = _objectWithoutProperties$d(userProps, _excluded$e);
20963
20968
  return createElement("div", _extends$2({}, props, {
20964
- className: cx('ais-AutocompletePanel', classNames.root, props.className)
20969
+ "aria-hidden": hidden,
20970
+ className: cx('ais-AutocompletePanel', !hidden && 'ais-AutocompletePanel--open', classNames.root, props.className),
20971
+ onMouseDown: function onMouseDown(event) {
20972
+ // Prevents the autocomplete panel from blurring the input when
20973
+ // clicking inside the panel.
20974
+ event.preventDefault();
20975
+ }
20965
20976
  }), createElement("div", {
20966
20977
  className: cx('ais-AutocompletePanelLayout', classNames.layout)
20967
20978
  }, children));
@@ -21110,25 +21121,21 @@
21110
21121
 
21111
21122
  var _slicedToArray$h = unwrapExports(slicedToArray);
21112
21123
 
21113
- function AutocompleteSubmitIcon(_ref) {
21124
+ function SubmitIcon(_ref) {
21114
21125
  var createElement = _ref.createElement;
21115
21126
  return createElement("svg", {
21116
21127
  className: "ais-AutocompleteSubmitIcon",
21117
21128
  viewBox: "0 0 24 24",
21118
- width: "20",
21119
- height: "20",
21120
21129
  fill: "currentColor"
21121
21130
  }, createElement("path", {
21122
21131
  d: "M16.041 15.856c-0.034 0.026-0.067 0.055-0.099 0.087s-0.060 0.064-0.087 0.099c-1.258 1.213-2.969 1.958-4.855 1.958-1.933 0-3.682-0.782-4.95-2.050s-2.050-3.017-2.050-4.95 0.782-3.682 2.050-4.95 3.017-2.050 4.95-2.050 3.682 0.782 4.95 2.050 2.050 3.017 2.050 4.95c0 1.886-0.745 3.597-1.959 4.856zM21.707 20.293l-3.675-3.675c1.231-1.54 1.968-3.493 1.968-5.618 0-2.485-1.008-4.736-2.636-6.364s-3.879-2.636-6.364-2.636-4.736 1.008-6.364 2.636-2.636 3.879-2.636 6.364 1.008 4.736 2.636 6.364 3.879 2.636 6.364 2.636c2.125 0 4.078-0.737 5.618-1.968l3.675 3.675c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414z"
21123
21132
  }));
21124
21133
  }
21125
- function AutocompleteLoadingIcon(_ref2) {
21134
+ function LoadingIcon(_ref2) {
21126
21135
  var createElement = _ref2.createElement;
21127
21136
  return createElement("svg", {
21128
21137
  className: "ais-AutocompleteLoadingIcon",
21129
- viewBox: "0 0 100 100",
21130
- width: "20",
21131
- height: "20"
21138
+ viewBox: "0 0 100 100"
21132
21139
  }, createElement("circle", {
21133
21140
  cx: "50",
21134
21141
  cy: "50",
@@ -21146,19 +21153,17 @@
21146
21153
  keyTimes: "0;0.40;0.65;1"
21147
21154
  })));
21148
21155
  }
21149
- function AutocompleteClearIcon(_ref3) {
21156
+ function ClearIcon(_ref3) {
21150
21157
  var createElement = _ref3.createElement;
21151
21158
  return createElement("svg", {
21152
21159
  className: "ais-AutocompleteClearIcon",
21153
21160
  viewBox: "0 0 24 24",
21154
- width: "18",
21155
- height: "18",
21156
21161
  fill: "currentColor"
21157
21162
  }, createElement("path", {
21158
21163
  d: "M5.293 6.707l5.293 5.293-5.293 5.293c-0.391 0.391-0.391 1.024 0 1.414s1.024 0.391 1.414 0l5.293-5.293 5.293 5.293c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414l-5.293-5.293 5.293-5.293c0.391-0.391 0.391-1.024 0-1.414s-1.024-0.391-1.414 0l-5.293 5.293-5.293-5.293c-0.391-0.391-1.024-0.391-1.414 0s-0.391 1.024 0 1.414z"
21159
21164
  }));
21160
21165
  }
21161
- function AutocompleteClockIcon(_ref4) {
21166
+ function ClockIcon(_ref4) {
21162
21167
  var createElement = _ref4.createElement;
21163
21168
  return createElement("svg", {
21164
21169
  viewBox: "0 0 24 24",
@@ -21167,7 +21172,7 @@
21167
21172
  d: "M12.516 6.984v5.25l4.5 2.672-0.75 1.266-5.25-3.188v-6h1.5zM12 20.016q3.281 0 5.648-2.367t2.367-5.648-2.367-5.648-5.648-2.367-5.648 2.367-2.367 5.648 2.367 5.648 5.648 2.367zM12 2.016q4.125 0 7.055 2.93t2.93 7.055-2.93 7.055-7.055 2.93-7.055-2.93-2.93-7.055 2.93-7.055 7.055-2.93z"
21168
21173
  }));
21169
21174
  }
21170
- function AutocompleteTrashIcon(_ref5) {
21175
+ function TrashIcon(_ref5) {
21171
21176
  var createElement = _ref5.createElement;
21172
21177
  return createElement("svg", {
21173
21178
  viewBox: "0 0 24 24",
@@ -21193,7 +21198,7 @@
21193
21198
  className: cx('ais-AutocompleteItemContent', 'ais-AutocompleteRecentSearchItemContent', classNames.content)
21194
21199
  }, createElement("div", {
21195
21200
  className: cx('ais-AutocompleteItemIcon', 'ais-AutocompleteRecentSearchItemIcon', classNames.content)
21196
- }, createElement(AutocompleteClockIcon, {
21201
+ }, createElement(ClockIcon, {
21197
21202
  createElement: createElement
21198
21203
  })), createElement("div", {
21199
21204
  className: cx('ais-AutocompleteItemContentBody', 'ais-AutocompleteRecentSearchItemContentBody', classNames.content)
@@ -21206,7 +21211,7 @@
21206
21211
  evt.stopPropagation();
21207
21212
  onRemoveRecentSearch();
21208
21213
  }
21209
- }, createElement(AutocompleteTrashIcon, {
21214
+ }, createElement(TrashIcon, {
21210
21215
  createElement: createElement
21211
21216
  }))));
21212
21217
  };
@@ -21243,12 +21248,12 @@
21243
21248
  className: "ais-AutocompleteSubmitButton",
21244
21249
  type: "submit",
21245
21250
  title: "Submit"
21246
- }, createElement(AutocompleteSubmitIcon, {
21251
+ }, createElement(SubmitIcon, {
21247
21252
  createElement: createElement
21248
21253
  }))), createElement("div", {
21249
21254
  className: "ais-AutocompleteLoadingIndicator",
21250
21255
  hidden: !isSearchStalled
21251
- }, createElement(AutocompleteLoadingIcon, {
21256
+ }, createElement(LoadingIcon, {
21252
21257
  createElement: createElement
21253
21258
  }))), createElement("div", {
21254
21259
  className: "ais-AutocompleteInputWrapper"
@@ -21261,7 +21266,6 @@
21261
21266
  autoCapitalize: "off",
21262
21267
  enterKeyHint: "search",
21263
21268
  spellCheck: "false",
21264
- placeholder: "",
21265
21269
  maxLength: 512,
21266
21270
  type: "search",
21267
21271
  value: query
@@ -21273,7 +21277,7 @@
21273
21277
  title: "Clear",
21274
21278
  hidden: query.length === 0 || isSearchStalled,
21275
21279
  onClick: onClear
21276
- }, createElement(AutocompleteClearIcon, {
21280
+ }, createElement(ClearIcon, {
21277
21281
  createElement: createElement
21278
21282
  }))));
21279
21283
  };
@@ -21293,7 +21297,7 @@
21293
21297
  className: cx('ais-AutocompleteItemContent', 'ais-AutocompleteSuggestionItemContent', classNames.content)
21294
21298
  }, createElement("div", {
21295
21299
  className: cx('ais-AutocompleteItemIcon', 'ais-AutocompleteSuggestionItemIcon', classNames.content)
21296
- }, createElement(AutocompleteSubmitIcon, {
21300
+ }, createElement(SubmitIcon, {
21297
21301
  createElement: createElement
21298
21302
  })), createElement("div", {
21299
21303
  className: cx('ais-AutocompleteItemContentBody', 'ais-AutocompleteSuggestionItemContentBody', classNames.content)
@@ -21311,7 +21315,8 @@
21311
21315
  var indices = _ref2.indices,
21312
21316
  indicesConfig = _ref2.indicesConfig,
21313
21317
  onRefine = _ref2.onRefine,
21314
- globalOnSelect = _ref2.onSelect;
21318
+ globalOnSelect = _ref2.onSelect,
21319
+ placeholder = _ref2.placeholder;
21315
21320
  var getElementId = createGetElementId(useId());
21316
21321
  var inputRef = useRef(null);
21317
21322
  var rootRef = useRef(null);
@@ -21407,6 +21412,7 @@
21407
21412
  'aria-haspopup': 'grid',
21408
21413
  'aria-controls': getElementId('panel'),
21409
21414
  'aria-activedescendant': activeDescendant,
21415
+ placeholder: placeholder,
21410
21416
  onFocus: function onFocus() {
21411
21417
  return setIsOpen(true);
21412
21418
  },
@@ -21877,9 +21883,9 @@
21877
21883
  Fragment: Fragment
21878
21884
  }) : _userProps$itemCompon,
21879
21885
  _userProps$previousIc = userProps.previousIconComponent,
21880
- PreviousIconComponent = _userProps$previousIc === void 0 ? PreviousIconDefaultComponent : _userProps$previousIc,
21886
+ PreviousIcon = _userProps$previousIc === void 0 ? PreviousIconDefaultComponent : _userProps$previousIc,
21881
21887
  _userProps$nextIconCo = userProps.nextIconComponent,
21882
- NextIconComponent = _userProps$nextIconCo === void 0 ? NextIconDefaultComponent : _userProps$nextIconCo,
21888
+ NextIcon = _userProps$nextIconCo === void 0 ? NextIconDefaultComponent : _userProps$nextIconCo,
21883
21889
  HeaderComponent = userProps.headerComponent,
21884
21890
  _userProps$showNaviga = userProps.showNavigation,
21885
21891
  showNavigation = _userProps$showNaviga === void 0 ? true : _userProps$showNaviga,
@@ -21948,7 +21954,7 @@
21948
21954
  event.preventDefault();
21949
21955
  scrollLeft();
21950
21956
  }
21951
- }, createElement(PreviousIconComponent, {
21957
+ }, createElement(PreviousIcon, {
21952
21958
  createElement: createElement
21953
21959
  })), createElement("ol", {
21954
21960
  className: cx(cssClasses.list),
@@ -21994,7 +22000,7 @@
21994
22000
  event.preventDefault();
21995
22001
  scrollRight();
21996
22002
  }
21997
- }, createElement(NextIconComponent, {
22003
+ }, createElement(NextIcon, {
21998
22004
  createElement: createElement
21999
22005
  })));
22000
22006
  };
@@ -22540,7 +22546,7 @@
22540
22546
  }
22541
22547
 
22542
22548
  var _excluded$o = ["indices", "showSuggestions", "showRecent", "searchParameters"],
22543
- _excluded2$5 = ["indicesConfig", "refineSearchBox", "getSearchPageURL", "onSelect", "indexUiState", "isSearchPage", "panelComponent", "showRecent", "showSuggestions"];
22549
+ _excluded2$5 = ["indicesConfig", "refineSearchBox", "getSearchPageURL", "onSelect", "indexUiState", "isSearchPage", "panelComponent", "showRecent", "showSuggestions", "placeholder"];
22544
22550
  var Autocomplete = createAutocompleteComponent({
22545
22551
  createElement: React.createElement,
22546
22552
  Fragment: React.Fragment
@@ -22648,6 +22654,7 @@
22648
22654
  PanelComponent = _ref3.panelComponent,
22649
22655
  showRecent = _ref3.showRecent,
22650
22656
  showSuggestions = _ref3.showSuggestions,
22657
+ placeholder = _ref3.placeholder,
22651
22658
  props = _objectWithoutProperties$c(_ref3, _excluded2$5);
22652
22659
  var _useAutocomplete = useAutocomplete(),
22653
22660
  indices = _useAutocomplete.indices,
@@ -22686,7 +22693,8 @@
22686
22693
  return;
22687
22694
  }
22688
22695
  setQuery(query);
22689
- }
22696
+ },
22697
+ placeholder: placeholder
22690
22698
  }),
22691
22699
  getInputProps = _usePropGetters.getInputProps,
22692
22700
  getItemProps = _usePropGetters.getItemProps,
@@ -22717,7 +22725,8 @@
22717
22725
  item: 'ais-AutocompleteRecentSearchesItem'
22718
22726
  },
22719
22727
  items: storageHits,
22720
- getItemProps: getItemProps
22728
+ getItemProps: getItemProps,
22729
+ key: "recentSearches"
22721
22730
  });
22722
22731
  }
22723
22732
  indices.forEach(function (_ref6, i) {
@@ -22725,6 +22734,11 @@
22725
22734
  indexName = _ref6.indexName,
22726
22735
  hits = _ref6.hits;
22727
22736
  var elementId = indexName === (showSuggestions === null || showSuggestions === void 0 ? void 0 : showSuggestions.indexName) ? 'suggestions' : indexName;
22737
+ var filteredHits = elementId === 'suggestions' && showRecent ? hits.filter(function (suggestionHit) {
22738
+ return !storageHits.find(function (storageHit) {
22739
+ return storageHit.query === suggestionHit.query;
22740
+ });
22741
+ }) : hits;
22728
22742
  elements[elementId] = /*#__PURE__*/React__default.createElement(AutocompleteIndex, {
22729
22743
  key: indexId
22730
22744
  // @ts-expect-error - there seems to be problems with React.ComponentType and this, but it's actually correct
@@ -22733,7 +22747,7 @@
22733
22747
  // @ts-expect-error - there seems to be problems with React.ComponentType and this, but it's actually correct
22734
22748
  ,
22735
22749
  ItemComponent: indicesConfig[i].itemComponent,
22736
- items: hits.map(function (item) {
22750
+ items: filteredHits.map(function (item) {
22737
22751
  return _objectSpread2(_objectSpread2({}, item), {}, {
22738
22752
  __indexName: indexId
22739
22753
  });