react-instantsearch 7.5.5 → 7.7.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 (56) hide show
  1. package/dist/cjs/ui/Breadcrumb.js +8 -8
  2. package/dist/cjs/ui/ClearRefinements.js +3 -3
  3. package/dist/cjs/ui/CurrentRefinements.js +9 -8
  4. package/dist/cjs/ui/HierarchicalMenu.js +9 -9
  5. package/dist/cjs/ui/Highlight.js +5 -5
  6. package/dist/cjs/ui/HitsPerPage.js +4 -4
  7. package/dist/cjs/ui/InfiniteHits.js +6 -6
  8. package/dist/cjs/ui/InternalHighlight.js +8 -51
  9. package/dist/cjs/ui/Menu.js +8 -8
  10. package/dist/cjs/ui/Pagination.js +12 -12
  11. package/dist/cjs/ui/PoweredBy.js +4 -4
  12. package/dist/cjs/ui/RangeInput.js +9 -9
  13. package/dist/cjs/ui/RefinementList.js +11 -11
  14. package/dist/cjs/ui/SearchBox.js +10 -12
  15. package/dist/cjs/ui/Snippet.js +5 -5
  16. package/dist/cjs/ui/SortBy.js +4 -4
  17. package/dist/cjs/ui/Stats.js +2 -2
  18. package/dist/cjs/ui/ToggleRefinement.js +5 -5
  19. package/dist/cjs/ui/lib/index.js +0 -11
  20. package/dist/cjs/widgets/Hits.js +41 -10
  21. package/dist/es/ui/Breadcrumb.js +1 -1
  22. package/dist/es/ui/ClearRefinements.js +1 -1
  23. package/dist/es/ui/CurrentRefinements.js +2 -1
  24. package/dist/es/ui/HierarchicalMenu.js +1 -1
  25. package/dist/es/ui/Highlight.d.ts +1 -1
  26. package/dist/es/ui/Highlight.js +1 -1
  27. package/dist/es/ui/HitsPerPage.js +1 -1
  28. package/dist/es/ui/InfiniteHits.js +1 -1
  29. package/dist/es/ui/InternalHighlight.d.ts +1 -32
  30. package/dist/es/ui/InternalHighlight.js +6 -47
  31. package/dist/es/ui/Menu.js +1 -1
  32. package/dist/es/ui/Pagination.js +1 -1
  33. package/dist/es/ui/PoweredBy.js +1 -1
  34. package/dist/es/ui/RangeInput.js +1 -1
  35. package/dist/es/ui/RefinementList.js +1 -1
  36. package/dist/es/ui/SearchBox.js +2 -4
  37. package/dist/es/ui/Snippet.d.ts +1 -1
  38. package/dist/es/ui/Snippet.js +1 -1
  39. package/dist/es/ui/SortBy.js +1 -1
  40. package/dist/es/ui/Stats.js +1 -1
  41. package/dist/es/ui/ToggleRefinement.js +1 -1
  42. package/dist/es/ui/lib/index.d.ts +0 -1
  43. package/dist/es/ui/lib/index.js +0 -1
  44. package/dist/es/widgets/Hits.d.ts +11 -4
  45. package/dist/es/widgets/Hits.js +37 -8
  46. package/dist/umd/ReactInstantSearch.js +224 -109
  47. package/dist/umd/ReactInstantSearch.js.map +1 -1
  48. package/dist/umd/ReactInstantSearch.min.js +1 -1
  49. package/dist/umd/ReactInstantSearch.min.js.map +1 -1
  50. package/package.json +9 -8
  51. package/dist/cjs/ui/Hits.js +0 -49
  52. package/dist/cjs/ui/lib/cx.js +0 -12
  53. package/dist/es/ui/Hits.d.ts +0 -31
  54. package/dist/es/ui/Hits.js +0 -42
  55. package/dist/es/ui/lib/cx.d.ts +0 -1
  56. package/dist/es/ui/lib/cx.js +0 -6
@@ -7,7 +7,7 @@
7
7
 
8
8
  var React__default = 'default' in React ? React['default'] : React;
9
9
 
10
- var version = '7.5.5';
10
+ var version = '7.7.0';
11
11
 
12
12
  // Copyright Joyent, Inc. and other Node contributors.
13
13
  //
@@ -3942,7 +3942,8 @@
3942
3942
  * @return {undefined} function mutates the item
3943
3943
  */
3944
3944
  function setIsRefined(item, currentRefinement, depth) {
3945
- item.isRefined = item.name === currentRefinement[depth];
3945
+ item.isRefined =
3946
+ item.name === (currentRefinement[depth] && currentRefinement[depth].trim());
3946
3947
  if (item.data) {
3947
3948
  item.data.forEach(function (child) {
3948
3949
  setIsRefined(child, currentRefinement, depth + 1);
@@ -4343,7 +4344,7 @@
4343
4344
 
4344
4345
  var SearchResults_1 = SearchResults;
4345
4346
 
4346
- var version$1 = '3.16.2';
4347
+ var version$1 = '3.16.3';
4347
4348
 
4348
4349
  var escapeFacetValue$3 = escapeFacetValue_1.escapeFacetValue;
4349
4350
 
@@ -12204,7 +12205,7 @@
12204
12205
  };
12205
12206
  }
12206
12207
 
12207
- var version$3 = '4.64.3';
12208
+ var version$3 = '4.66.0';
12208
12209
 
12209
12210
  function _typeof$o(obj) {
12210
12211
  "@babel/helpers - typeof";
@@ -12927,6 +12928,10 @@
12927
12928
  return InstantSearch;
12928
12929
  }(events);
12929
12930
 
12931
+ function unwrapExports (x) {
12932
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
12933
+ }
12934
+
12930
12935
  function createCommonjsModule(fn, module) {
12931
12936
  return module = { exports: {} }, fn(module, module.exports), module.exports;
12932
12937
  }
@@ -19000,11 +19005,170 @@
19000
19005
  return typeof key === "symbol" ? key : String(key);
19001
19006
  }
19002
19007
 
19008
+ var _extends_1 = createCommonjsModule(function (module) {
19009
+ function _extends() {
19010
+ module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {
19011
+ for (var i = 1; i < arguments.length; i++) {
19012
+ var source = arguments[i];
19013
+ for (var key in source) {
19014
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
19015
+ target[key] = source[key];
19016
+ }
19017
+ }
19018
+ }
19019
+ return target;
19020
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports;
19021
+ return _extends.apply(this, arguments);
19022
+ }
19023
+ module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
19024
+ });
19025
+
19026
+ var _extends$2 = unwrapExports(_extends_1);
19027
+
19028
+ var objectWithoutPropertiesLoose = createCommonjsModule(function (module) {
19029
+ function _objectWithoutPropertiesLoose(source, excluded) {
19030
+ if (source == null) return {};
19031
+ var target = {};
19032
+ var sourceKeys = Object.keys(source);
19033
+ var key, i;
19034
+ for (i = 0; i < sourceKeys.length; i++) {
19035
+ key = sourceKeys[i];
19036
+ if (excluded.indexOf(key) >= 0) continue;
19037
+ target[key] = source[key];
19038
+ }
19039
+ return target;
19040
+ }
19041
+ module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
19042
+ });
19043
+
19044
+ unwrapExports(objectWithoutPropertiesLoose);
19045
+
19046
+ var objectWithoutProperties = createCommonjsModule(function (module) {
19047
+ function _objectWithoutProperties(source, excluded) {
19048
+ if (source == null) return {};
19049
+ var target = objectWithoutPropertiesLoose(source, excluded);
19050
+ var key, i;
19051
+ if (Object.getOwnPropertySymbols) {
19052
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
19053
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
19054
+ key = sourceSymbolKeys[i];
19055
+ if (excluded.indexOf(key) >= 0) continue;
19056
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
19057
+ target[key] = source[key];
19058
+ }
19059
+ }
19060
+ return target;
19061
+ }
19062
+ module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
19063
+ });
19064
+
19065
+ var _objectWithoutProperties$d = unwrapExports(objectWithoutProperties);
19066
+
19003
19067
  function cx() {
19004
19068
  for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) {
19005
19069
  classNames[_key] = arguments[_key];
19006
19070
  }
19007
- return classNames.filter(Boolean).join(' ');
19071
+ return classNames.reduce(function (acc, className) {
19072
+ if (Array.isArray(className)) {
19073
+ return acc.concat(className);
19074
+ }
19075
+ return acc.concat([className]);
19076
+ }, []).filter(Boolean).join(' ');
19077
+ }
19078
+
19079
+ var _excluded$c = ["parts", "highlightedTagName", "nonHighlightedTagName", "separator", "className", "classNames"];
19080
+ function createHighlightPartComponent(_ref) {
19081
+ var createElement = _ref.createElement;
19082
+ return function HighlightPart(_ref2) {
19083
+ var classNames = _ref2.classNames,
19084
+ children = _ref2.children,
19085
+ highlightedTagName = _ref2.highlightedTagName,
19086
+ isHighlighted = _ref2.isHighlighted,
19087
+ nonHighlightedTagName = _ref2.nonHighlightedTagName;
19088
+ var TagName = isHighlighted ? highlightedTagName : nonHighlightedTagName;
19089
+ return createElement(TagName, {
19090
+ className: isHighlighted ? classNames.highlighted : classNames.nonHighlighted
19091
+ }, children);
19092
+ };
19093
+ }
19094
+ function createHighlightComponent(_ref3) {
19095
+ var createElement = _ref3.createElement,
19096
+ Fragment = _ref3.Fragment;
19097
+ var HighlightPart = createHighlightPartComponent({
19098
+ createElement: createElement,
19099
+ Fragment: Fragment
19100
+ });
19101
+ return function Highlight(userProps) {
19102
+ var parts = userProps.parts,
19103
+ _userProps$highlighte = userProps.highlightedTagName,
19104
+ highlightedTagName = _userProps$highlighte === void 0 ? 'mark' : _userProps$highlighte,
19105
+ _userProps$nonHighlig = userProps.nonHighlightedTagName,
19106
+ nonHighlightedTagName = _userProps$nonHighlig === void 0 ? 'span' : _userProps$nonHighlig,
19107
+ _userProps$separator = userProps.separator,
19108
+ separator = _userProps$separator === void 0 ? ', ' : _userProps$separator,
19109
+ className = userProps.className,
19110
+ _userProps$classNames = userProps.classNames,
19111
+ classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
19112
+ props = _objectWithoutProperties$d(userProps, _excluded$c);
19113
+ return createElement("span", _extends$2({}, props, {
19114
+ className: cx(classNames.root, className)
19115
+ }), parts.map(function (part, partIndex) {
19116
+ var isLastPart = partIndex === parts.length - 1;
19117
+ return createElement(Fragment, {
19118
+ key: partIndex
19119
+ }, part.map(function (subPart, subPartIndex) {
19120
+ return createElement(HighlightPart, {
19121
+ key: subPartIndex,
19122
+ classNames: classNames,
19123
+ highlightedTagName: highlightedTagName,
19124
+ nonHighlightedTagName: nonHighlightedTagName,
19125
+ isHighlighted: subPart.isHighlighted
19126
+ }, subPart.value);
19127
+ }), !isLastPart && createElement("span", {
19128
+ className: classNames.separator
19129
+ }, separator));
19130
+ }));
19131
+ };
19132
+ }
19133
+
19134
+ var _excluded$d = ["classNames", "hits", "itemComponent", "sendEvent", "emptyComponent"];
19135
+
19136
+ // Should be imported from a shared package in the future
19137
+
19138
+ function createHitsComponent(_ref) {
19139
+ var createElement = _ref.createElement;
19140
+ return function Hits(userProps) {
19141
+ var _userProps$classNames = userProps.classNames,
19142
+ classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
19143
+ hits = userProps.hits,
19144
+ ItemComponent = userProps.itemComponent,
19145
+ sendEvent = userProps.sendEvent,
19146
+ EmptyComponent = userProps.emptyComponent,
19147
+ props = _objectWithoutProperties$d(userProps, _excluded$d);
19148
+ if (hits.length === 0 && EmptyComponent) {
19149
+ return createElement(EmptyComponent, {
19150
+ className: cx('ais-Hits', classNames.root, cx('ais-Hits--empty', classNames.emptyRoot), props.className)
19151
+ });
19152
+ }
19153
+ return createElement("div", _extends$2({}, props, {
19154
+ className: cx('ais-Hits', classNames.root, hits.length === 0 && cx('ais-Hits--empty', classNames.emptyRoot), props.className)
19155
+ }), createElement("ol", {
19156
+ className: cx('ais-Hits-list', classNames.list)
19157
+ }, hits.map(function (hit, index) {
19158
+ return createElement(ItemComponent, {
19159
+ key: hit.objectID,
19160
+ hit: hit,
19161
+ index: index,
19162
+ className: cx('ais-Hits-item', classNames.item),
19163
+ onClick: function onClick() {
19164
+ sendEvent('click:internal', hit, 'Hit Clicked');
19165
+ },
19166
+ onAuxClick: function onAuxClick() {
19167
+ sendEvent('click:internal', hit, 'Hit Clicked');
19168
+ }
19169
+ });
19170
+ })));
19171
+ };
19008
19172
  }
19009
19173
 
19010
19174
  function isModifierClick(event) {
@@ -19012,7 +19176,7 @@
19012
19176
  return Boolean(isMiddleClick || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey);
19013
19177
  }
19014
19178
 
19015
- var _excluded$c = ["classNames", "items", "hasItems", "createURL", "onNavigate", "separator", "translations"];
19179
+ var _excluded$e = ["classNames", "items", "hasItems", "createURL", "onNavigate", "separator", "translations"];
19016
19180
  function Breadcrumb(_ref) {
19017
19181
  var _ref$classNames = _ref.classNames,
19018
19182
  classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
@@ -19024,7 +19188,7 @@
19024
19188
  _ref$separator = _ref.separator,
19025
19189
  separator = _ref$separator === void 0 ? '>' : _ref$separator,
19026
19190
  translations = _ref.translations,
19027
- props = _objectWithoutProperties$c(_ref, _excluded$c);
19191
+ props = _objectWithoutProperties$c(_ref, _excluded$e);
19028
19192
  var handleClick = function handleClick(value) {
19029
19193
  return function (event) {
19030
19194
  if (!isModifierClick(event)) {
@@ -19059,14 +19223,14 @@
19059
19223
  })));
19060
19224
  }
19061
19225
 
19062
- var _excluded$d = ["attributes", "rootPath", "separator", "transformItems", "translations"];
19226
+ var _excluded$f = ["attributes", "rootPath", "separator", "transformItems", "translations"];
19063
19227
  function Breadcrumb$1(_ref) {
19064
19228
  var attributes = _ref.attributes,
19065
19229
  rootPath = _ref.rootPath,
19066
19230
  separator = _ref.separator,
19067
19231
  transformItems = _ref.transformItems,
19068
19232
  translations = _ref.translations,
19069
- props = _objectWithoutProperties$c(_ref, _excluded$d);
19233
+ props = _objectWithoutProperties$c(_ref, _excluded$f);
19070
19234
  var _useBreadcrumb = useBreadcrumb({
19071
19235
  attributes: attributes,
19072
19236
  rootPath: rootPath,
@@ -19090,7 +19254,7 @@
19090
19254
  return /*#__PURE__*/React__default.createElement(Breadcrumb, _extends$1({}, props, uiProps));
19091
19255
  }
19092
19256
 
19093
- var _excluded$e = ["classNames", "disabled", "onClick", "translations"];
19257
+ var _excluded$g = ["classNames", "disabled", "onClick", "translations"];
19094
19258
  function ClearRefinements(_ref) {
19095
19259
  var _ref$classNames = _ref.classNames,
19096
19260
  classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
@@ -19099,7 +19263,7 @@
19099
19263
  _ref$onClick = _ref.onClick,
19100
19264
  onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
19101
19265
  translations = _ref.translations,
19102
- props = _objectWithoutProperties$c(_ref, _excluded$e);
19266
+ props = _objectWithoutProperties$c(_ref, _excluded$g);
19103
19267
  return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
19104
19268
  className: cx('ais-ClearRefinements', classNames.root, props.className)
19105
19269
  }), /*#__PURE__*/React__default.createElement("button", {
@@ -19109,13 +19273,13 @@
19109
19273
  }, translations.resetButtonText));
19110
19274
  }
19111
19275
 
19112
- var _excluded$f = ["includedAttributes", "excludedAttributes", "transformItems", "translations"];
19276
+ var _excluded$h = ["includedAttributes", "excludedAttributes", "transformItems", "translations"];
19113
19277
  function ClearRefinements$1(_ref) {
19114
19278
  var includedAttributes = _ref.includedAttributes,
19115
19279
  excludedAttributes = _ref.excludedAttributes,
19116
19280
  transformItems = _ref.transformItems,
19117
19281
  translations = _ref.translations,
19118
- props = _objectWithoutProperties$c(_ref, _excluded$f);
19282
+ props = _objectWithoutProperties$c(_ref, _excluded$h);
19119
19283
  var _useClearRefinements = useClearRefinements({
19120
19284
  includedAttributes: includedAttributes,
19121
19285
  excludedAttributes: excludedAttributes,
@@ -19139,7 +19303,7 @@
19139
19303
  return text.toString().charAt(0).toUpperCase() + text.toString().slice(1);
19140
19304
  }
19141
19305
 
19142
- var _excluded$g = ["classNames", "items", "hasRefinements"];
19306
+ var _excluded$i = ["classNames", "items", "hasRefinements"];
19143
19307
  function CurrentRefinements(_ref) {
19144
19308
  var _ref$classNames = _ref.classNames,
19145
19309
  classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
@@ -19147,7 +19311,7 @@
19147
19311
  items = _ref$items === void 0 ? [] : _ref$items,
19148
19312
  _ref$hasRefinements = _ref.hasRefinements,
19149
19313
  hasRefinements = _ref$hasRefinements === void 0 ? false : _ref$hasRefinements,
19150
- props = _objectWithoutProperties$c(_ref, _excluded$g);
19314
+ props = _objectWithoutProperties$c(_ref, _excluded$i);
19151
19315
  return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
19152
19316
  className: cx('ais-CurrentRefinements', classNames.root, !hasRefinements && cx('ais-CurrentRefinements--noRefinement', classNames.noRefinementRoot), props.className)
19153
19317
  }), /*#__PURE__*/React__default.createElement("ul", {
@@ -19179,12 +19343,12 @@
19179
19343
  })));
19180
19344
  }
19181
19345
 
19182
- var _excluded$h = ["includedAttributes", "excludedAttributes", "transformItems"];
19346
+ var _excluded$j = ["includedAttributes", "excludedAttributes", "transformItems"];
19183
19347
  function CurrentRefinements$1(_ref) {
19184
19348
  var includedAttributes = _ref.includedAttributes,
19185
19349
  excludedAttributes = _ref.excludedAttributes,
19186
19350
  transformItems = _ref.transformItems,
19187
- props = _objectWithoutProperties$c(_ref, _excluded$h);
19351
+ props = _objectWithoutProperties$c(_ref, _excluded$j);
19188
19352
  var _useCurrentRefinement = useCurrentRefinements({
19189
19353
  includedAttributes: includedAttributes,
19190
19354
  excludedAttributes: excludedAttributes,
@@ -19201,17 +19365,17 @@
19201
19365
  return /*#__PURE__*/React__default.createElement(CurrentRefinements, _extends$1({}, props, uiProps));
19202
19366
  }
19203
19367
 
19204
- var _excluded$i = ["isShowingMore", "translations"];
19368
+ var _excluded$k = ["isShowingMore", "translations"];
19205
19369
  function ShowMoreButton(_ref) {
19206
19370
  var isShowingMore = _ref.isShowingMore,
19207
19371
  translations = _ref.translations,
19208
- props = _objectWithoutProperties$c(_ref, _excluded$i);
19372
+ props = _objectWithoutProperties$c(_ref, _excluded$k);
19209
19373
  return /*#__PURE__*/React__default.createElement("button", props, translations.showMoreButtonText({
19210
19374
  isShowingMore: isShowingMore
19211
19375
  }));
19212
19376
  }
19213
19377
 
19214
- var _excluded$j = ["classNames", "items", "hasItems", "onNavigate", "createURL", "showMore", "canToggleShowMore", "onToggleShowMore", "isShowingMore", "translations"];
19378
+ var _excluded$l = ["classNames", "items", "hasItems", "onNavigate", "createURL", "showMore", "canToggleShowMore", "onToggleShowMore", "isShowingMore", "translations"];
19215
19379
  function HierarchicalList(_ref) {
19216
19380
  var className = _ref.className,
19217
19381
  _ref$classNames = _ref.classNames,
@@ -19263,7 +19427,7 @@
19263
19427
  onToggleShowMore = _ref2.onToggleShowMore,
19264
19428
  isShowingMore = _ref2.isShowingMore,
19265
19429
  translations = _ref2.translations,
19266
- props = _objectWithoutProperties$c(_ref2, _excluded$j);
19430
+ props = _objectWithoutProperties$c(_ref2, _excluded$l);
19267
19431
  return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
19268
19432
  className: cx('ais-HierarchicalMenu', classNames.root, !hasItems && cx('ais-HierarchicalMenu--noRefinement', classNames.noRefinementRoot), props.className)
19269
19433
  }), /*#__PURE__*/React__default.createElement(HierarchicalList, {
@@ -19280,7 +19444,7 @@
19280
19444
  }));
19281
19445
  }
19282
19446
 
19283
- var _excluded$k = ["attributes", "limit", "rootPath", "separator", "showMore", "showMoreLimit", "showParentLevel", "sortBy", "transformItems", "translations"];
19447
+ var _excluded$m = ["attributes", "limit", "rootPath", "separator", "showMore", "showMoreLimit", "showParentLevel", "sortBy", "transformItems", "translations"];
19284
19448
  function HierarchicalMenu$1(_ref) {
19285
19449
  var attributes = _ref.attributes,
19286
19450
  limit = _ref.limit,
@@ -19292,7 +19456,7 @@
19292
19456
  sortBy = _ref.sortBy,
19293
19457
  transformItems = _ref.transformItems,
19294
19458
  translations = _ref.translations,
19295
- props = _objectWithoutProperties$c(_ref, _excluded$k);
19459
+ props = _objectWithoutProperties$c(_ref, _excluded$m);
19296
19460
  var _useHierarchicalMenu = useHierarchicalMenu({
19297
19461
  attributes: attributes,
19298
19462
  limit: limit,
@@ -19332,54 +19496,16 @@
19332
19496
  }));
19333
19497
  }
19334
19498
 
19335
- var _excluded$l = ["parts", "highlightedTagName", "nonHighlightedTagName", "separator", "className", "classNames"];
19336
- function HighlightPart(_ref) {
19337
- var classNames = _ref.classNames,
19338
- children = _ref.children,
19339
- highlightedTagName = _ref.highlightedTagName,
19340
- isHighlighted = _ref.isHighlighted,
19341
- nonHighlightedTagName = _ref.nonHighlightedTagName;
19342
- var TagName = isHighlighted ? highlightedTagName : nonHighlightedTagName;
19343
- return /*#__PURE__*/React__default.createElement(TagName, {
19344
- className: isHighlighted ? classNames.highlighted : classNames.nonHighlighted
19345
- }, children);
19346
- }
19347
- function InternalHighlight(_ref2) {
19348
- var parts = _ref2.parts,
19349
- _ref2$highlightedTagN = _ref2.highlightedTagName,
19350
- highlightedTagName = _ref2$highlightedTagN === void 0 ? 'mark' : _ref2$highlightedTagN,
19351
- _ref2$nonHighlightedT = _ref2.nonHighlightedTagName,
19352
- nonHighlightedTagName = _ref2$nonHighlightedT === void 0 ? 'span' : _ref2$nonHighlightedT,
19353
- _ref2$separator = _ref2.separator,
19354
- separator = _ref2$separator === void 0 ? ', ' : _ref2$separator,
19355
- className = _ref2.className,
19356
- classNames = _ref2.classNames,
19357
- props = _objectWithoutProperties$c(_ref2, _excluded$l);
19358
- return /*#__PURE__*/React__default.createElement("span", _extends$1({}, props, {
19359
- className: cx(classNames.root, className)
19360
- }), parts.map(function (part, partIndex) {
19361
- var isLastPart = partIndex === parts.length - 1;
19362
- return /*#__PURE__*/React__default.createElement(React.Fragment, {
19363
- key: partIndex
19364
- }, part.map(function (subPart, subPartIndex) {
19365
- return /*#__PURE__*/React__default.createElement(HighlightPart, {
19366
- key: subPartIndex,
19367
- classNames: classNames,
19368
- highlightedTagName: highlightedTagName,
19369
- nonHighlightedTagName: nonHighlightedTagName,
19370
- isHighlighted: subPart.isHighlighted
19371
- }, subPart.value);
19372
- }), !isLastPart && /*#__PURE__*/React__default.createElement("span", {
19373
- className: classNames.separator
19374
- }, separator));
19375
- }));
19376
- }
19499
+ var InternalHighlight = createHighlightComponent({
19500
+ createElement: React.createElement,
19501
+ Fragment: React.Fragment
19502
+ });
19377
19503
 
19378
- var _excluded$m = ["classNames"];
19504
+ var _excluded$n = ["classNames"];
19379
19505
  function Highlight(_ref) {
19380
19506
  var _ref$classNames = _ref.classNames,
19381
19507
  classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
19382
- props = _objectWithoutProperties$c(_ref, _excluded$m);
19508
+ props = _objectWithoutProperties$c(_ref, _excluded$n);
19383
19509
  return /*#__PURE__*/React__default.createElement(InternalHighlight, _extends$1({
19384
19510
  classNames: {
19385
19511
  root: cx('ais-Highlight', classNames.root),
@@ -19390,14 +19516,14 @@
19390
19516
  }, props));
19391
19517
  }
19392
19518
 
19393
- var _excluded$n = ["hit", "attribute", "highlightedTagName", "nonHighlightedTagName", "separator"];
19519
+ var _excluded$o = ["hit", "attribute", "highlightedTagName", "nonHighlightedTagName", "separator"];
19394
19520
  function Highlight$1(_ref) {
19395
19521
  var hit = _ref.hit,
19396
19522
  attribute = _ref.attribute,
19397
19523
  highlightedTagName = _ref.highlightedTagName,
19398
19524
  nonHighlightedTagName = _ref.nonHighlightedTagName,
19399
19525
  separator = _ref.separator,
19400
- props = _objectWithoutProperties$c(_ref, _excluded$n);
19526
+ props = _objectWithoutProperties$c(_ref, _excluded$o);
19401
19527
  var property = getPropertyByPath(hit._highlightResult, attribute) || [];
19402
19528
  var properties = Array.isArray(property) ? property : [property];
19403
19529
  var parts = properties.map(function (singleValue) {
@@ -19411,7 +19537,10 @@
19411
19537
  }));
19412
19538
  }
19413
19539
 
19414
- var _excluded$o = ["hits", "sendEvent", "hitComponent", "classNames"];
19540
+ var _excluded$p = ["escapeHTML", "transformItems", "hitComponent"],
19541
+ _excluded2$3 = ["hit", "index"];
19542
+ // @MAJOR: Move default hit component back to the UI library
19543
+ // once flavour specificities are erased
19415
19544
  function DefaultHitComponent(_ref) {
19416
19545
  var hit = _ref.hit;
19417
19546
  return /*#__PURE__*/React__default.createElement("div", {
@@ -19420,40 +19549,16 @@
19420
19549
  }
19421
19550
  }, JSON.stringify(hit).slice(0, 100), "\u2026");
19422
19551
  }
19552
+ var HitsUiComponent = createHitsComponent({
19553
+ createElement: React.createElement,
19554
+ Fragment: React.Fragment
19555
+ });
19423
19556
  function Hits(_ref2) {
19424
- var hits = _ref2.hits,
19425
- sendEvent = _ref2.sendEvent,
19557
+ var escapeHTML = _ref2.escapeHTML,
19558
+ transformItems = _ref2.transformItems,
19426
19559
  _ref2$hitComponent = _ref2.hitComponent,
19427
19560
  HitComponent = _ref2$hitComponent === void 0 ? DefaultHitComponent : _ref2$hitComponent,
19428
- _ref2$classNames = _ref2.classNames,
19429
- classNames = _ref2$classNames === void 0 ? {} : _ref2$classNames,
19430
- props = _objectWithoutProperties$c(_ref2, _excluded$o);
19431
- return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
19432
- className: cx('ais-Hits', classNames.root, hits.length === 0 && cx('ais-Hits--empty', classNames.emptyRoot), props.className)
19433
- }), /*#__PURE__*/React__default.createElement("ol", {
19434
- className: cx('ais-Hits-list', classNames.list)
19435
- }, hits.map(function (hit) {
19436
- return /*#__PURE__*/React__default.createElement("li", {
19437
- key: hit.objectID,
19438
- className: cx('ais-Hits-item', classNames.item),
19439
- onClick: function onClick() {
19440
- sendEvent('click:internal', hit, 'Hit Clicked');
19441
- },
19442
- onAuxClick: function onAuxClick() {
19443
- sendEvent('click:internal', hit, 'Hit Clicked');
19444
- }
19445
- }, /*#__PURE__*/React__default.createElement(HitComponent, {
19446
- hit: hit,
19447
- sendEvent: sendEvent
19448
- }));
19449
- })));
19450
- }
19451
-
19452
- var _excluded$p = ["escapeHTML", "transformItems"];
19453
- function Hits$1(_ref) {
19454
- var escapeHTML = _ref.escapeHTML,
19455
- transformItems = _ref.transformItems,
19456
- props = _objectWithoutProperties$c(_ref, _excluded$p);
19561
+ props = _objectWithoutProperties$c(_ref2, _excluded$p);
19457
19562
  var _useHits = useHits({
19458
19563
  escapeHTML: escapeHTML,
19459
19564
  transformItems: transformItems
@@ -19462,11 +19567,23 @@
19462
19567
  }),
19463
19568
  hits = _useHits.hits,
19464
19569
  sendEvent = _useHits.sendEvent;
19570
+ var itemComponent = function itemComponent(_ref3) {
19571
+ var hit = _ref3.hit,
19572
+ index = _ref3.index,
19573
+ itemProps = _objectWithoutProperties$c(_ref3, _excluded2$3);
19574
+ return /*#__PURE__*/React__default.createElement("li", _extends$1({
19575
+ key: hit.objectID
19576
+ }, itemProps), /*#__PURE__*/React__default.createElement(HitComponent, {
19577
+ hit: hit,
19578
+ sendEvent: sendEvent
19579
+ }));
19580
+ };
19465
19581
  var uiProps = {
19466
19582
  hits: hits,
19467
- sendEvent: sendEvent
19583
+ sendEvent: sendEvent,
19584
+ itemComponent: itemComponent
19468
19585
  };
19469
- return /*#__PURE__*/React__default.createElement(Hits, _extends$1({}, props, uiProps));
19586
+ return /*#__PURE__*/React__default.createElement(HitsUiComponent, _extends$1({}, props, uiProps));
19470
19587
  }
19471
19588
 
19472
19589
  var _excluded$q = ["items", "onChange", "currentValue", "classNames"];
@@ -19701,7 +19818,7 @@
19701
19818
  }
19702
19819
 
19703
19820
  var _excluded$w = ["pages", "currentPage", "nbPages", "isFirstPage", "isLastPage", "showFirst", "showPrevious", "showNext", "showLast", "createURL", "onNavigate", "translations", "classNames"],
19704
- _excluded2$3 = ["isDisabled", "className", "classNames", "href", "onClick"];
19821
+ _excluded2$4 = ["isDisabled", "className", "classNames", "href", "onClick"];
19705
19822
  function Pagination(_ref) {
19706
19823
  var pages = _ref.pages,
19707
19824
  currentPage = _ref.currentPage,
@@ -19792,7 +19909,7 @@
19792
19909
  classNames = _ref2.classNames,
19793
19910
  href = _ref2.href,
19794
19911
  _onClick = _ref2.onClick,
19795
- props = _objectWithoutProperties$c(_ref2, _excluded2$3);
19912
+ props = _objectWithoutProperties$c(_ref2, _excluded2$4);
19796
19913
  if (isDisabled) {
19797
19914
  return /*#__PURE__*/React__default.createElement("li", {
19798
19915
  className: cx('ais-Pagination-item', classNames.item, 'ais-Pagination-item--disabled', classNames.disabledItem, className)
@@ -20243,9 +20360,7 @@
20243
20360
  }, /*#__PURE__*/React__default.createElement(ResetIcon, {
20244
20361
  classNames: classNames
20245
20362
  })), /*#__PURE__*/React__default.createElement("span", {
20246
- className: cx('ais-SearchBox-loadingIndicator', classNames.loadingIndicator)
20247
- // @ts-ignore (this error is due to conflict with @algolia/ui-components-highlight-vdom, which declares "too global" type for span in case there's no @types/react or preact)
20248
- ,
20363
+ className: cx('ais-SearchBox-loadingIndicator', classNames.loadingIndicator),
20249
20364
  hidden: !isSearchStalled
20250
20365
  }, /*#__PURE__*/React__default.createElement(LoadingIcon, {
20251
20366
  classNames: classNames
@@ -20643,7 +20758,7 @@
20643
20758
  exports.DynamicWidgets = DynamicWidgets;
20644
20759
  exports.HierarchicalMenu = HierarchicalMenu$1;
20645
20760
  exports.Highlight = Highlight$1;
20646
- exports.Hits = Hits$1;
20761
+ exports.Hits = Hits;
20647
20762
  exports.HitsPerPage = HitsPerPage$1;
20648
20763
  exports.Index = Index;
20649
20764
  exports.InfiniteHits = InfiniteHits$1;