react-instantsearch 7.6.0 → 7.7.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.
- package/dist/cjs/ui/RefinementList.js +1 -1
- package/dist/cjs/widgets/Hits.js +41 -10
- package/dist/es/ui/RefinementList.js +1 -1
- package/dist/es/widgets/Hits.d.ts +11 -4
- package/dist/es/widgets/Hits.js +37 -8
- package/dist/umd/ReactInstantSearch.js +152 -68
- package/dist/umd/ReactInstantSearch.js.map +1 -1
- package/dist/umd/ReactInstantSearch.min.js +1 -1
- package/dist/umd/ReactInstantSearch.min.js.map +1 -1
- package/package.json +9 -8
- package/dist/cjs/ui/Hits.js +0 -49
- package/dist/es/ui/Hits.d.ts +0 -31
- package/dist/es/ui/Hits.js +0 -42
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
var React__default = 'default' in React ? React['default'] : React;
|
|
9
9
|
|
|
10
|
-
var version = '7.
|
|
10
|
+
var version = '7.7.1';
|
|
11
11
|
|
|
12
12
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
13
13
|
//
|
|
@@ -497,6 +497,42 @@
|
|
|
497
497
|
|
|
498
498
|
var omit = _objectWithoutPropertiesLoose;
|
|
499
499
|
|
|
500
|
+
/**
|
|
501
|
+
* RecommendParameters is the data structure that contains all the information
|
|
502
|
+
* usable for getting recommendations from the Algolia API. It doesn't do the
|
|
503
|
+
* search itself, nor does it contains logic about the parameters.
|
|
504
|
+
* It is an immutable object, therefore it has been created in a way that each
|
|
505
|
+
* changes does not change the object itself but returns a copy with the
|
|
506
|
+
* modification.
|
|
507
|
+
* This object should probably not be instantiated outside of the helper. It
|
|
508
|
+
* will be provided when needed.
|
|
509
|
+
* @constructor
|
|
510
|
+
* @classdesc contains all the parameters for recommendations
|
|
511
|
+
* @param {RecommendParametersOptions} opts the options to create the object
|
|
512
|
+
*/
|
|
513
|
+
function RecommendParameters(opts) {
|
|
514
|
+
opts = opts || {};
|
|
515
|
+
this.params = opts.params || [];
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
RecommendParameters.prototype = {
|
|
519
|
+
constructor: RecommendParameters,
|
|
520
|
+
|
|
521
|
+
addParams: function (params) {
|
|
522
|
+
return new RecommendParameters({ params: this.params.concat(params) });
|
|
523
|
+
},
|
|
524
|
+
|
|
525
|
+
removeParams: function (id) {
|
|
526
|
+
return new RecommendParameters({
|
|
527
|
+
params: this.params.filter(function (param) {
|
|
528
|
+
return param.$$id !== id;
|
|
529
|
+
}),
|
|
530
|
+
});
|
|
531
|
+
},
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
var RecommendParameters_1 = RecommendParameters;
|
|
535
|
+
|
|
500
536
|
function sortObject(obj) {
|
|
501
537
|
return Object.keys(obj)
|
|
502
538
|
.sort()
|
|
@@ -3942,7 +3978,8 @@
|
|
|
3942
3978
|
* @return {undefined} function mutates the item
|
|
3943
3979
|
*/
|
|
3944
3980
|
function setIsRefined(item, currentRefinement, depth) {
|
|
3945
|
-
item.isRefined =
|
|
3981
|
+
item.isRefined =
|
|
3982
|
+
item.name === (currentRefinement[depth] && currentRefinement[depth].trim());
|
|
3946
3983
|
if (item.data) {
|
|
3947
3984
|
item.data.forEach(function (child) {
|
|
3948
3985
|
setIsRefined(child, currentRefinement, depth + 1);
|
|
@@ -4343,7 +4380,7 @@
|
|
|
4343
4380
|
|
|
4344
4381
|
var SearchResults_1 = SearchResults;
|
|
4345
4382
|
|
|
4346
|
-
var version$1 = '3.
|
|
4383
|
+
var version$1 = '3.17.0';
|
|
4347
4384
|
|
|
4348
4385
|
var escapeFacetValue$3 = escapeFacetValue_1.escapeFacetValue;
|
|
4349
4386
|
|
|
@@ -4355,6 +4392,7 @@
|
|
|
4355
4392
|
|
|
4356
4393
|
|
|
4357
4394
|
|
|
4395
|
+
|
|
4358
4396
|
/**
|
|
4359
4397
|
* Event triggered when a parameter is set or updated
|
|
4360
4398
|
* @event AlgoliaSearchHelper#event:change
|
|
@@ -4468,6 +4506,9 @@
|
|
|
4468
4506
|
var opts = options || {};
|
|
4469
4507
|
opts.index = index;
|
|
4470
4508
|
this.state = SearchParameters_1.make(opts);
|
|
4509
|
+
this.recommendState = new RecommendParameters_1({
|
|
4510
|
+
params: opts.recommendState,
|
|
4511
|
+
});
|
|
4471
4512
|
this.lastResults = null;
|
|
4472
4513
|
this._queryId = 0;
|
|
4473
4514
|
this._lastQueryIdReceived = -1;
|
|
@@ -5851,6 +5892,17 @@
|
|
|
5851
5892
|
}
|
|
5852
5893
|
};
|
|
5853
5894
|
|
|
5895
|
+
AlgoliaSearchHelper.prototype._recommendChange = function (event) {
|
|
5896
|
+
var state = event.state;
|
|
5897
|
+
|
|
5898
|
+
if (state !== this.recommendState) {
|
|
5899
|
+
this.recommendState = state;
|
|
5900
|
+
|
|
5901
|
+
// eslint-disable-next-line no-warning-comments
|
|
5902
|
+
// TODO: emit "change" event when events for Recommend are implemented
|
|
5903
|
+
}
|
|
5904
|
+
};
|
|
5905
|
+
|
|
5854
5906
|
/**
|
|
5855
5907
|
* Clears the cache of the underlying Algolia client.
|
|
5856
5908
|
* @return {AlgoliaSearchHelper} Method is chainable, it returns itself
|
|
@@ -8630,7 +8682,7 @@
|
|
|
8630
8682
|
|
|
8631
8683
|
// Scenario 1: the widget is added for the first time.
|
|
8632
8684
|
if (!cleanupTimerRef.current) {
|
|
8633
|
-
if (!
|
|
8685
|
+
if (!shouldSsr) {
|
|
8634
8686
|
parentIndex.addWidgets([widget]);
|
|
8635
8687
|
}
|
|
8636
8688
|
}
|
|
@@ -8667,7 +8719,7 @@
|
|
|
8667
8719
|
});
|
|
8668
8720
|
});
|
|
8669
8721
|
};
|
|
8670
|
-
}, [parentIndex, widget,
|
|
8722
|
+
}, [parentIndex, widget, shouldSsr, search, props]);
|
|
8671
8723
|
if (shouldAddWidgetEarly || (waitingForResultsRef === null || waitingForResultsRef === void 0 ? void 0 : (_waitingForResultsRef = waitingForResultsRef.current) === null || _waitingForResultsRef === void 0 ? void 0 : _waitingForResultsRef.status) === 'pending') {
|
|
8672
8724
|
parentIndex.addWidgets([widget]);
|
|
8673
8725
|
}
|
|
@@ -12204,7 +12256,7 @@
|
|
|
12204
12256
|
};
|
|
12205
12257
|
}
|
|
12206
12258
|
|
|
12207
|
-
var version$3 = '4.
|
|
12259
|
+
var version$3 = '4.66.1';
|
|
12208
12260
|
|
|
12209
12261
|
function _typeof$o(obj) {
|
|
12210
12262
|
"@babel/helpers - typeof";
|
|
@@ -14892,6 +14944,8 @@
|
|
|
14892
14944
|
if (!escapeHTML) {
|
|
14893
14945
|
return state;
|
|
14894
14946
|
}
|
|
14947
|
+
|
|
14948
|
+
// @MAJOR: set this globally, not in the Hits widget to allow Hits to be conditionally used
|
|
14895
14949
|
return state.setQueryParameters(TAG_PLACEHOLDER);
|
|
14896
14950
|
}
|
|
14897
14951
|
};
|
|
@@ -15471,6 +15525,7 @@
|
|
|
15471
15525
|
var uiState = _ref10.uiState;
|
|
15472
15526
|
var widgetSearchParameters = searchParameters;
|
|
15473
15527
|
if (escapeHTML) {
|
|
15528
|
+
// @MAJOR: set this globally, not in the InfiniteHits widget to allow InfiniteHits to be conditionally used
|
|
15474
15529
|
widgetSearchParameters = searchParameters.setQueryParameters(TAG_PLACEHOLDER);
|
|
15475
15530
|
}
|
|
15476
15531
|
|
|
@@ -19098,8 +19153,6 @@
|
|
|
19098
19153
|
Fragment: Fragment
|
|
19099
19154
|
});
|
|
19100
19155
|
return function Highlight(userProps) {
|
|
19101
|
-
// Not destructured in function signature, to make sure it's not exposed in
|
|
19102
|
-
// the type definition.
|
|
19103
19156
|
var parts = userProps.parts,
|
|
19104
19157
|
_userProps$highlighte = userProps.highlightedTagName,
|
|
19105
19158
|
highlightedTagName = _userProps$highlighte === void 0 ? 'mark' : _userProps$highlighte,
|
|
@@ -19132,12 +19185,52 @@
|
|
|
19132
19185
|
};
|
|
19133
19186
|
}
|
|
19134
19187
|
|
|
19188
|
+
var _excluded$d = ["classNames", "hits", "itemComponent", "sendEvent", "emptyComponent"];
|
|
19189
|
+
|
|
19190
|
+
// Should be imported from a shared package in the future
|
|
19191
|
+
|
|
19192
|
+
function createHitsComponent(_ref) {
|
|
19193
|
+
var createElement = _ref.createElement;
|
|
19194
|
+
return function Hits(userProps) {
|
|
19195
|
+
var _userProps$classNames = userProps.classNames,
|
|
19196
|
+
classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
|
|
19197
|
+
hits = userProps.hits,
|
|
19198
|
+
ItemComponent = userProps.itemComponent,
|
|
19199
|
+
sendEvent = userProps.sendEvent,
|
|
19200
|
+
EmptyComponent = userProps.emptyComponent,
|
|
19201
|
+
props = _objectWithoutProperties$d(userProps, _excluded$d);
|
|
19202
|
+
if (hits.length === 0 && EmptyComponent) {
|
|
19203
|
+
return createElement(EmptyComponent, {
|
|
19204
|
+
className: cx('ais-Hits', classNames.root, cx('ais-Hits--empty', classNames.emptyRoot), props.className)
|
|
19205
|
+
});
|
|
19206
|
+
}
|
|
19207
|
+
return createElement("div", _extends$2({}, props, {
|
|
19208
|
+
className: cx('ais-Hits', classNames.root, hits.length === 0 && cx('ais-Hits--empty', classNames.emptyRoot), props.className)
|
|
19209
|
+
}), createElement("ol", {
|
|
19210
|
+
className: cx('ais-Hits-list', classNames.list)
|
|
19211
|
+
}, hits.map(function (hit, index) {
|
|
19212
|
+
return createElement(ItemComponent, {
|
|
19213
|
+
key: hit.objectID,
|
|
19214
|
+
hit: hit,
|
|
19215
|
+
index: index,
|
|
19216
|
+
className: cx('ais-Hits-item', classNames.item),
|
|
19217
|
+
onClick: function onClick() {
|
|
19218
|
+
sendEvent('click:internal', hit, 'Hit Clicked');
|
|
19219
|
+
},
|
|
19220
|
+
onAuxClick: function onAuxClick() {
|
|
19221
|
+
sendEvent('click:internal', hit, 'Hit Clicked');
|
|
19222
|
+
}
|
|
19223
|
+
});
|
|
19224
|
+
})));
|
|
19225
|
+
};
|
|
19226
|
+
}
|
|
19227
|
+
|
|
19135
19228
|
function isModifierClick(event) {
|
|
19136
19229
|
var isMiddleClick = event.button === 1;
|
|
19137
19230
|
return Boolean(isMiddleClick || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey);
|
|
19138
19231
|
}
|
|
19139
19232
|
|
|
19140
|
-
var _excluded$
|
|
19233
|
+
var _excluded$e = ["classNames", "items", "hasItems", "createURL", "onNavigate", "separator", "translations"];
|
|
19141
19234
|
function Breadcrumb(_ref) {
|
|
19142
19235
|
var _ref$classNames = _ref.classNames,
|
|
19143
19236
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
@@ -19149,7 +19242,7 @@
|
|
|
19149
19242
|
_ref$separator = _ref.separator,
|
|
19150
19243
|
separator = _ref$separator === void 0 ? '>' : _ref$separator,
|
|
19151
19244
|
translations = _ref.translations,
|
|
19152
|
-
props = _objectWithoutProperties$c(_ref, _excluded$
|
|
19245
|
+
props = _objectWithoutProperties$c(_ref, _excluded$e);
|
|
19153
19246
|
var handleClick = function handleClick(value) {
|
|
19154
19247
|
return function (event) {
|
|
19155
19248
|
if (!isModifierClick(event)) {
|
|
@@ -19184,14 +19277,14 @@
|
|
|
19184
19277
|
})));
|
|
19185
19278
|
}
|
|
19186
19279
|
|
|
19187
|
-
var _excluded$
|
|
19280
|
+
var _excluded$f = ["attributes", "rootPath", "separator", "transformItems", "translations"];
|
|
19188
19281
|
function Breadcrumb$1(_ref) {
|
|
19189
19282
|
var attributes = _ref.attributes,
|
|
19190
19283
|
rootPath = _ref.rootPath,
|
|
19191
19284
|
separator = _ref.separator,
|
|
19192
19285
|
transformItems = _ref.transformItems,
|
|
19193
19286
|
translations = _ref.translations,
|
|
19194
|
-
props = _objectWithoutProperties$c(_ref, _excluded$
|
|
19287
|
+
props = _objectWithoutProperties$c(_ref, _excluded$f);
|
|
19195
19288
|
var _useBreadcrumb = useBreadcrumb({
|
|
19196
19289
|
attributes: attributes,
|
|
19197
19290
|
rootPath: rootPath,
|
|
@@ -19215,7 +19308,7 @@
|
|
|
19215
19308
|
return /*#__PURE__*/React__default.createElement(Breadcrumb, _extends$1({}, props, uiProps));
|
|
19216
19309
|
}
|
|
19217
19310
|
|
|
19218
|
-
var _excluded$
|
|
19311
|
+
var _excluded$g = ["classNames", "disabled", "onClick", "translations"];
|
|
19219
19312
|
function ClearRefinements(_ref) {
|
|
19220
19313
|
var _ref$classNames = _ref.classNames,
|
|
19221
19314
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
@@ -19224,7 +19317,7 @@
|
|
|
19224
19317
|
_ref$onClick = _ref.onClick,
|
|
19225
19318
|
onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
19226
19319
|
translations = _ref.translations,
|
|
19227
|
-
props = _objectWithoutProperties$c(_ref, _excluded$
|
|
19320
|
+
props = _objectWithoutProperties$c(_ref, _excluded$g);
|
|
19228
19321
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
|
|
19229
19322
|
className: cx('ais-ClearRefinements', classNames.root, props.className)
|
|
19230
19323
|
}), /*#__PURE__*/React__default.createElement("button", {
|
|
@@ -19234,13 +19327,13 @@
|
|
|
19234
19327
|
}, translations.resetButtonText));
|
|
19235
19328
|
}
|
|
19236
19329
|
|
|
19237
|
-
var _excluded$
|
|
19330
|
+
var _excluded$h = ["includedAttributes", "excludedAttributes", "transformItems", "translations"];
|
|
19238
19331
|
function ClearRefinements$1(_ref) {
|
|
19239
19332
|
var includedAttributes = _ref.includedAttributes,
|
|
19240
19333
|
excludedAttributes = _ref.excludedAttributes,
|
|
19241
19334
|
transformItems = _ref.transformItems,
|
|
19242
19335
|
translations = _ref.translations,
|
|
19243
|
-
props = _objectWithoutProperties$c(_ref, _excluded$
|
|
19336
|
+
props = _objectWithoutProperties$c(_ref, _excluded$h);
|
|
19244
19337
|
var _useClearRefinements = useClearRefinements({
|
|
19245
19338
|
includedAttributes: includedAttributes,
|
|
19246
19339
|
excludedAttributes: excludedAttributes,
|
|
@@ -19264,7 +19357,7 @@
|
|
|
19264
19357
|
return text.toString().charAt(0).toUpperCase() + text.toString().slice(1);
|
|
19265
19358
|
}
|
|
19266
19359
|
|
|
19267
|
-
var _excluded$
|
|
19360
|
+
var _excluded$i = ["classNames", "items", "hasRefinements"];
|
|
19268
19361
|
function CurrentRefinements(_ref) {
|
|
19269
19362
|
var _ref$classNames = _ref.classNames,
|
|
19270
19363
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
@@ -19272,7 +19365,7 @@
|
|
|
19272
19365
|
items = _ref$items === void 0 ? [] : _ref$items,
|
|
19273
19366
|
_ref$hasRefinements = _ref.hasRefinements,
|
|
19274
19367
|
hasRefinements = _ref$hasRefinements === void 0 ? false : _ref$hasRefinements,
|
|
19275
|
-
props = _objectWithoutProperties$c(_ref, _excluded$
|
|
19368
|
+
props = _objectWithoutProperties$c(_ref, _excluded$i);
|
|
19276
19369
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
|
|
19277
19370
|
className: cx('ais-CurrentRefinements', classNames.root, !hasRefinements && cx('ais-CurrentRefinements--noRefinement', classNames.noRefinementRoot), props.className)
|
|
19278
19371
|
}), /*#__PURE__*/React__default.createElement("ul", {
|
|
@@ -19304,12 +19397,12 @@
|
|
|
19304
19397
|
})));
|
|
19305
19398
|
}
|
|
19306
19399
|
|
|
19307
|
-
var _excluded$
|
|
19400
|
+
var _excluded$j = ["includedAttributes", "excludedAttributes", "transformItems"];
|
|
19308
19401
|
function CurrentRefinements$1(_ref) {
|
|
19309
19402
|
var includedAttributes = _ref.includedAttributes,
|
|
19310
19403
|
excludedAttributes = _ref.excludedAttributes,
|
|
19311
19404
|
transformItems = _ref.transformItems,
|
|
19312
|
-
props = _objectWithoutProperties$c(_ref, _excluded$
|
|
19405
|
+
props = _objectWithoutProperties$c(_ref, _excluded$j);
|
|
19313
19406
|
var _useCurrentRefinement = useCurrentRefinements({
|
|
19314
19407
|
includedAttributes: includedAttributes,
|
|
19315
19408
|
excludedAttributes: excludedAttributes,
|
|
@@ -19326,17 +19419,17 @@
|
|
|
19326
19419
|
return /*#__PURE__*/React__default.createElement(CurrentRefinements, _extends$1({}, props, uiProps));
|
|
19327
19420
|
}
|
|
19328
19421
|
|
|
19329
|
-
var _excluded$
|
|
19422
|
+
var _excluded$k = ["isShowingMore", "translations"];
|
|
19330
19423
|
function ShowMoreButton(_ref) {
|
|
19331
19424
|
var isShowingMore = _ref.isShowingMore,
|
|
19332
19425
|
translations = _ref.translations,
|
|
19333
|
-
props = _objectWithoutProperties$c(_ref, _excluded$
|
|
19426
|
+
props = _objectWithoutProperties$c(_ref, _excluded$k);
|
|
19334
19427
|
return /*#__PURE__*/React__default.createElement("button", props, translations.showMoreButtonText({
|
|
19335
19428
|
isShowingMore: isShowingMore
|
|
19336
19429
|
}));
|
|
19337
19430
|
}
|
|
19338
19431
|
|
|
19339
|
-
var _excluded$
|
|
19432
|
+
var _excluded$l = ["classNames", "items", "hasItems", "onNavigate", "createURL", "showMore", "canToggleShowMore", "onToggleShowMore", "isShowingMore", "translations"];
|
|
19340
19433
|
function HierarchicalList(_ref) {
|
|
19341
19434
|
var className = _ref.className,
|
|
19342
19435
|
_ref$classNames = _ref.classNames,
|
|
@@ -19388,7 +19481,7 @@
|
|
|
19388
19481
|
onToggleShowMore = _ref2.onToggleShowMore,
|
|
19389
19482
|
isShowingMore = _ref2.isShowingMore,
|
|
19390
19483
|
translations = _ref2.translations,
|
|
19391
|
-
props = _objectWithoutProperties$c(_ref2, _excluded$
|
|
19484
|
+
props = _objectWithoutProperties$c(_ref2, _excluded$l);
|
|
19392
19485
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
|
|
19393
19486
|
className: cx('ais-HierarchicalMenu', classNames.root, !hasItems && cx('ais-HierarchicalMenu--noRefinement', classNames.noRefinementRoot), props.className)
|
|
19394
19487
|
}), /*#__PURE__*/React__default.createElement(HierarchicalList, {
|
|
@@ -19405,7 +19498,7 @@
|
|
|
19405
19498
|
}));
|
|
19406
19499
|
}
|
|
19407
19500
|
|
|
19408
|
-
var _excluded$
|
|
19501
|
+
var _excluded$m = ["attributes", "limit", "rootPath", "separator", "showMore", "showMoreLimit", "showParentLevel", "sortBy", "transformItems", "translations"];
|
|
19409
19502
|
function HierarchicalMenu$1(_ref) {
|
|
19410
19503
|
var attributes = _ref.attributes,
|
|
19411
19504
|
limit = _ref.limit,
|
|
@@ -19417,7 +19510,7 @@
|
|
|
19417
19510
|
sortBy = _ref.sortBy,
|
|
19418
19511
|
transformItems = _ref.transformItems,
|
|
19419
19512
|
translations = _ref.translations,
|
|
19420
|
-
props = _objectWithoutProperties$c(_ref, _excluded$
|
|
19513
|
+
props = _objectWithoutProperties$c(_ref, _excluded$m);
|
|
19421
19514
|
var _useHierarchicalMenu = useHierarchicalMenu({
|
|
19422
19515
|
attributes: attributes,
|
|
19423
19516
|
limit: limit,
|
|
@@ -19462,11 +19555,11 @@
|
|
|
19462
19555
|
Fragment: React.Fragment
|
|
19463
19556
|
});
|
|
19464
19557
|
|
|
19465
|
-
var _excluded$
|
|
19558
|
+
var _excluded$n = ["classNames"];
|
|
19466
19559
|
function Highlight(_ref) {
|
|
19467
19560
|
var _ref$classNames = _ref.classNames,
|
|
19468
19561
|
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
19469
|
-
props = _objectWithoutProperties$c(_ref, _excluded$
|
|
19562
|
+
props = _objectWithoutProperties$c(_ref, _excluded$n);
|
|
19470
19563
|
return /*#__PURE__*/React__default.createElement(InternalHighlight, _extends$1({
|
|
19471
19564
|
classNames: {
|
|
19472
19565
|
root: cx('ais-Highlight', classNames.root),
|
|
@@ -19477,14 +19570,14 @@
|
|
|
19477
19570
|
}, props));
|
|
19478
19571
|
}
|
|
19479
19572
|
|
|
19480
|
-
var _excluded$
|
|
19573
|
+
var _excluded$o = ["hit", "attribute", "highlightedTagName", "nonHighlightedTagName", "separator"];
|
|
19481
19574
|
function Highlight$1(_ref) {
|
|
19482
19575
|
var hit = _ref.hit,
|
|
19483
19576
|
attribute = _ref.attribute,
|
|
19484
19577
|
highlightedTagName = _ref.highlightedTagName,
|
|
19485
19578
|
nonHighlightedTagName = _ref.nonHighlightedTagName,
|
|
19486
19579
|
separator = _ref.separator,
|
|
19487
|
-
props = _objectWithoutProperties$c(_ref, _excluded$
|
|
19580
|
+
props = _objectWithoutProperties$c(_ref, _excluded$o);
|
|
19488
19581
|
var property = getPropertyByPath(hit._highlightResult, attribute) || [];
|
|
19489
19582
|
var properties = Array.isArray(property) ? property : [property];
|
|
19490
19583
|
var parts = properties.map(function (singleValue) {
|
|
@@ -19498,7 +19591,10 @@
|
|
|
19498
19591
|
}));
|
|
19499
19592
|
}
|
|
19500
19593
|
|
|
19501
|
-
var _excluded$
|
|
19594
|
+
var _excluded$p = ["escapeHTML", "transformItems", "hitComponent"],
|
|
19595
|
+
_excluded2$3 = ["hit", "index"];
|
|
19596
|
+
// @MAJOR: Move default hit component back to the UI library
|
|
19597
|
+
// once flavour specificities are erased
|
|
19502
19598
|
function DefaultHitComponent(_ref) {
|
|
19503
19599
|
var hit = _ref.hit;
|
|
19504
19600
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -19507,40 +19603,16 @@
|
|
|
19507
19603
|
}
|
|
19508
19604
|
}, JSON.stringify(hit).slice(0, 100), "\u2026");
|
|
19509
19605
|
}
|
|
19606
|
+
var HitsUiComponent = createHitsComponent({
|
|
19607
|
+
createElement: React.createElement,
|
|
19608
|
+
Fragment: React.Fragment
|
|
19609
|
+
});
|
|
19510
19610
|
function Hits(_ref2) {
|
|
19511
|
-
var
|
|
19512
|
-
|
|
19611
|
+
var escapeHTML = _ref2.escapeHTML,
|
|
19612
|
+
transformItems = _ref2.transformItems,
|
|
19513
19613
|
_ref2$hitComponent = _ref2.hitComponent,
|
|
19514
19614
|
HitComponent = _ref2$hitComponent === void 0 ? DefaultHitComponent : _ref2$hitComponent,
|
|
19515
|
-
|
|
19516
|
-
classNames = _ref2$classNames === void 0 ? {} : _ref2$classNames,
|
|
19517
|
-
props = _objectWithoutProperties$c(_ref2, _excluded$o);
|
|
19518
|
-
return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
|
|
19519
|
-
className: cx('ais-Hits', classNames.root, hits.length === 0 && cx('ais-Hits--empty', classNames.emptyRoot), props.className)
|
|
19520
|
-
}), /*#__PURE__*/React__default.createElement("ol", {
|
|
19521
|
-
className: cx('ais-Hits-list', classNames.list)
|
|
19522
|
-
}, hits.map(function (hit) {
|
|
19523
|
-
return /*#__PURE__*/React__default.createElement("li", {
|
|
19524
|
-
key: hit.objectID,
|
|
19525
|
-
className: cx('ais-Hits-item', classNames.item),
|
|
19526
|
-
onClick: function onClick() {
|
|
19527
|
-
sendEvent('click:internal', hit, 'Hit Clicked');
|
|
19528
|
-
},
|
|
19529
|
-
onAuxClick: function onAuxClick() {
|
|
19530
|
-
sendEvent('click:internal', hit, 'Hit Clicked');
|
|
19531
|
-
}
|
|
19532
|
-
}, /*#__PURE__*/React__default.createElement(HitComponent, {
|
|
19533
|
-
hit: hit,
|
|
19534
|
-
sendEvent: sendEvent
|
|
19535
|
-
}));
|
|
19536
|
-
})));
|
|
19537
|
-
}
|
|
19538
|
-
|
|
19539
|
-
var _excluded$p = ["escapeHTML", "transformItems"];
|
|
19540
|
-
function Hits$1(_ref) {
|
|
19541
|
-
var escapeHTML = _ref.escapeHTML,
|
|
19542
|
-
transformItems = _ref.transformItems,
|
|
19543
|
-
props = _objectWithoutProperties$c(_ref, _excluded$p);
|
|
19615
|
+
props = _objectWithoutProperties$c(_ref2, _excluded$p);
|
|
19544
19616
|
var _useHits = useHits({
|
|
19545
19617
|
escapeHTML: escapeHTML,
|
|
19546
19618
|
transformItems: transformItems
|
|
@@ -19549,11 +19621,23 @@
|
|
|
19549
19621
|
}),
|
|
19550
19622
|
hits = _useHits.hits,
|
|
19551
19623
|
sendEvent = _useHits.sendEvent;
|
|
19624
|
+
var itemComponent = function itemComponent(_ref3) {
|
|
19625
|
+
var hit = _ref3.hit,
|
|
19626
|
+
index = _ref3.index,
|
|
19627
|
+
itemProps = _objectWithoutProperties$c(_ref3, _excluded2$3);
|
|
19628
|
+
return /*#__PURE__*/React__default.createElement("li", _extends$1({
|
|
19629
|
+
key: hit.objectID
|
|
19630
|
+
}, itemProps), /*#__PURE__*/React__default.createElement(HitComponent, {
|
|
19631
|
+
hit: hit,
|
|
19632
|
+
sendEvent: sendEvent
|
|
19633
|
+
}));
|
|
19634
|
+
};
|
|
19552
19635
|
var uiProps = {
|
|
19553
19636
|
hits: hits,
|
|
19554
|
-
sendEvent: sendEvent
|
|
19637
|
+
sendEvent: sendEvent,
|
|
19638
|
+
itemComponent: itemComponent
|
|
19555
19639
|
};
|
|
19556
|
-
return /*#__PURE__*/React__default.createElement(
|
|
19640
|
+
return /*#__PURE__*/React__default.createElement(HitsUiComponent, _extends$1({}, props, uiProps));
|
|
19557
19641
|
}
|
|
19558
19642
|
|
|
19559
19643
|
var _excluded$q = ["items", "onChange", "currentValue", "classNames"];
|
|
@@ -19788,7 +19872,7 @@
|
|
|
19788
19872
|
}
|
|
19789
19873
|
|
|
19790
19874
|
var _excluded$w = ["pages", "currentPage", "nbPages", "isFirstPage", "isLastPage", "showFirst", "showPrevious", "showNext", "showLast", "createURL", "onNavigate", "translations", "classNames"],
|
|
19791
|
-
_excluded2$
|
|
19875
|
+
_excluded2$4 = ["isDisabled", "className", "classNames", "href", "onClick"];
|
|
19792
19876
|
function Pagination(_ref) {
|
|
19793
19877
|
var pages = _ref.pages,
|
|
19794
19878
|
currentPage = _ref.currentPage,
|
|
@@ -19879,7 +19963,7 @@
|
|
|
19879
19963
|
classNames = _ref2.classNames,
|
|
19880
19964
|
href = _ref2.href,
|
|
19881
19965
|
_onClick = _ref2.onClick,
|
|
19882
|
-
props = _objectWithoutProperties$c(_ref2, _excluded2$
|
|
19966
|
+
props = _objectWithoutProperties$c(_ref2, _excluded2$4);
|
|
19883
19967
|
if (isDisabled) {
|
|
19884
19968
|
return /*#__PURE__*/React__default.createElement("li", {
|
|
19885
19969
|
className: cx('ais-Pagination-item', classNames.item, 'ais-Pagination-item--disabled', classNames.disabledItem, className)
|
|
@@ -20155,7 +20239,7 @@
|
|
|
20155
20239
|
translations = _ref.translations,
|
|
20156
20240
|
props = _objectWithoutProperties$c(_ref, _excluded$B);
|
|
20157
20241
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({}, props, {
|
|
20158
|
-
className: cx('ais-RefinementList', classNames.root,
|
|
20242
|
+
className: cx('ais-RefinementList', classNames.root, items.length === 0 && cx('ais-RefinementList--noRefinement', classNames.noRefinementRoot), className)
|
|
20159
20243
|
}), searchBox && /*#__PURE__*/React__default.createElement("div", {
|
|
20160
20244
|
className: cx('ais-RefinementList-searchBox', classNames.searchBox)
|
|
20161
20245
|
}, searchBox), noResults ? /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -20728,7 +20812,7 @@
|
|
|
20728
20812
|
exports.DynamicWidgets = DynamicWidgets;
|
|
20729
20813
|
exports.HierarchicalMenu = HierarchicalMenu$1;
|
|
20730
20814
|
exports.Highlight = Highlight$1;
|
|
20731
|
-
exports.Hits = Hits
|
|
20815
|
+
exports.Hits = Hits;
|
|
20732
20816
|
exports.HitsPerPage = HitsPerPage$1;
|
|
20733
20817
|
exports.Index = Index;
|
|
20734
20818
|
exports.InfiniteHits = InfiniteHits$1;
|