react-instantsearch 7.15.8 → 7.16.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.
@@ -7,7 +7,7 @@
7
7
 
8
8
  var React__default = 'default' in React ? React['default'] : React;
9
9
 
10
- var version = '7.15.8';
10
+ var version = '7.16.1';
11
11
 
12
12
  // Copyright Joyent, Inc. and other Node contributors.
13
13
  //
@@ -4634,7 +4634,7 @@
4634
4634
 
4635
4635
  var sortAndMergeRecommendations_1 = sortAndMergeRecommendations;
4636
4636
 
4637
- var version$1 = '3.25.0';
4637
+ var version$1 = '3.26.0';
4638
4638
 
4639
4639
  var escapeFacetValue$3 = escapeFacetValue_1.escapeFacetValue;
4640
4640
 
@@ -5070,6 +5070,16 @@
5070
5070
  query: query,
5071
5071
  });
5072
5072
 
5073
+ var hide =
5074
+ (this.lastResults &&
5075
+ this.lastResults.index === state.index &&
5076
+ this.lastResults.renderingContent &&
5077
+ this.lastResults.renderingContent.facetOrdering &&
5078
+ this.lastResults.renderingContent.facetOrdering.values &&
5079
+ this.lastResults.renderingContent.facetOrdering.values[facet] &&
5080
+ this.lastResults.renderingContent.facetOrdering.values[facet].hide) ||
5081
+ [];
5082
+
5073
5083
  return searchForFacetValuesPromise.then(
5074
5084
  function addIsRefined(content) {
5075
5085
  self._currentNbQueries--;
@@ -5077,7 +5087,11 @@
5077
5087
 
5078
5088
  content = Array.isArray(content) ? content[0] : content;
5079
5089
 
5080
- content.facetHits.forEach(function (f) {
5090
+ content.facetHits.forEach(function (f, i) {
5091
+ if (hide.indexOf(f.value) > -1) {
5092
+ content.facetHits.splice(i, 1);
5093
+ return;
5094
+ }
5081
5095
  f.escapedValue = escapeFacetValue$3(f.value);
5082
5096
  f.isRefined = isDisjunctive
5083
5097
  ? state.isDisjunctiveFacetRefined(facet, f.escapedValue)
@@ -9561,19 +9575,29 @@
9561
9575
  */
9562
9576
  var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
9563
9577
 
9564
- var InstantSearchRSCContext = /*#__PURE__*/React.createContext(null);
9578
+ var InstantSearchRSCContext = /*#__PURE__*/React.createContext({
9579
+ countRef: {
9580
+ current: 0
9581
+ },
9582
+ waitForResultsRef: null,
9583
+ ignoreMultipleHooksWarning: false
9584
+ });
9565
9585
 
9566
9586
  function useRSCContext() {
9567
9587
  return React.useContext(InstantSearchRSCContext);
9568
9588
  }
9569
9589
 
9570
9590
  function useWidget(_ref) {
9571
- var _waitingForResultsRef;
9591
+ var _waitForResultsRef$cu, _waitForResultsRef$cu2;
9572
9592
  var widget = _ref.widget,
9573
9593
  parentIndex = _ref.parentIndex,
9574
9594
  props = _ref.props,
9575
- shouldSsr = _ref.shouldSsr;
9576
- var waitingForResultsRef = useRSCContext();
9595
+ shouldSsr = _ref.shouldSsr,
9596
+ skipSuspense = _ref.skipSuspense;
9597
+ var _useRSCContext = useRSCContext(),
9598
+ waitForResultsRef = _useRSCContext.waitForResultsRef,
9599
+ countRef = _useRSCContext.countRef,
9600
+ ignoreMultipleHooksWarning = _useRSCContext.ignoreMultipleHooksWarning;
9577
9601
  var prevPropsRef = React.useRef(props);
9578
9602
  React.useEffect(function () {
9579
9603
  prevPropsRef.current = props;
@@ -9633,20 +9657,21 @@
9633
9657
  });
9634
9658
  };
9635
9659
  }, [parentIndex, widget, shouldSsr, search, props]);
9636
- if (shouldAddWidgetEarly || (waitingForResultsRef === null || waitingForResultsRef === void 0 ? void 0 : (_waitingForResultsRef = waitingForResultsRef.current) === null || _waitingForResultsRef === void 0 ? void 0 : _waitingForResultsRef.status) === 'pending') {
9660
+ if (shouldAddWidgetEarly || (waitForResultsRef === null || waitForResultsRef === void 0 ? void 0 : (_waitForResultsRef$cu = waitForResultsRef.current) === null || _waitForResultsRef$cu === void 0 ? void 0 : _waitForResultsRef$cu.status) === 'pending') {
9637
9661
  parentIndex.addWidgets([widget]);
9638
9662
  }
9639
- if (typeof window === 'undefined' && waitingForResultsRef !== null && waitingForResultsRef !== void 0 && waitingForResultsRef.current &&
9640
- // We need the widgets contained in the index to be added before we trigger the search request.
9641
- widget.$$type !== 'ais.index') {
9663
+ if (waitForResultsRef !== null && waitForResultsRef !== void 0 && waitForResultsRef.current && !skipSuspense) {
9642
9664
  var _search$helper;
9643
- use(waitingForResultsRef.current);
9665
+ use(waitForResultsRef.current);
9644
9666
  // If we made a second request because of DynamicWidgets, we need to wait for the second result,
9645
9667
  // except for DynamicWidgets itself which needs to render its children after the first result.
9646
9668
  if (widget.$$type !== 'ais.dynamicWidgets' && (_search$helper = search.helper) !== null && _search$helper !== void 0 && _search$helper.lastResults) {
9647
- use(waitingForResultsRef.current);
9669
+ use(waitForResultsRef.current);
9648
9670
  }
9649
9671
  }
9672
+ if ((waitForResultsRef === null || waitForResultsRef === void 0 ? void 0 : (_waitForResultsRef$cu2 = waitForResultsRef.current) === null || _waitForResultsRef$cu2 === void 0 ? void 0 : _waitForResultsRef$cu2.status) === 'fulfilled') {
9673
+ countRef.current += 1;
9674
+ }
9650
9675
  }
9651
9676
 
9652
9677
  function _typeof$d(o) {
@@ -9658,8 +9683,9 @@
9658
9683
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
9659
9684
  }, _typeof$d(o);
9660
9685
  }
9661
- var _excluded$1 = ["instantSearchInstance", "widgetParams"],
9662
- _excluded2 = ["widgetParams"];
9686
+ var _excluded$1 = ["skipSuspense"],
9687
+ _excluded2 = ["instantSearchInstance", "widgetParams"],
9688
+ _excluded3 = ["widgetParams"];
9663
9689
  function _slicedToArray$5(arr, i) {
9664
9690
  return _arrayWithHoles$5(arr) || _iterableToArrayLimit$5(arr, i) || _unsupportedIterableToArray$6(arr, i) || _nonIterableRest$5();
9665
9691
  }
@@ -9787,7 +9813,10 @@
9787
9813
  }
9788
9814
  function useConnector(connector) {
9789
9815
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
9790
- var additionalWidgetProperties = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
9816
+ var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
9817
+ _ref$skipSuspense = _ref.skipSuspense,
9818
+ skipSuspense = _ref$skipSuspense === void 0 ? false : _ref$skipSuspense,
9819
+ additionalWidgetProperties = _objectWithoutProperties$1(_ref, _excluded$1);
9791
9820
  var serverContext = useInstantSearchServerContext();
9792
9821
  var ssrContext = useInstantSearchSSRContext();
9793
9822
  var search = useInstantSearchContext();
@@ -9821,7 +9850,7 @@
9821
9850
  if (shouldSetStateRef.current) {
9822
9851
  var instantSearchInstance = connectorState.instantSearchInstance,
9823
9852
  widgetParams = connectorState.widgetParams,
9824
- renderState = _objectWithoutProperties$1(connectorState, _excluded$1);
9853
+ renderState = _objectWithoutProperties$1(connectorState, _excluded2);
9825
9854
 
9826
9855
  // We only update the state when a widget render state param changes,
9827
9856
  // except for functions. We ignore function reference changes to avoid
@@ -9877,7 +9906,7 @@
9877
9906
  error: search.error
9878
9907
  }),
9879
9908
  widgetParams = _widget$getWidgetRend.widgetParams,
9880
- renderState = _objectWithoutProperties$1(_widget$getWidgetRend, _excluded2);
9909
+ renderState = _objectWithoutProperties$1(_widget$getWidgetRend, _excluded3);
9881
9910
  return renderState;
9882
9911
  }
9883
9912
  return {};
@@ -9889,7 +9918,8 @@
9889
9918
  widget: widget,
9890
9919
  parentIndex: parentIndex,
9891
9920
  props: stableProps,
9892
- shouldSsr: Boolean(serverContext)
9921
+ shouldSsr: Boolean(serverContext),
9922
+ skipSuspense: skipSuspense
9893
9923
  });
9894
9924
  return state;
9895
9925
  }
@@ -11104,7 +11134,8 @@
11104
11134
  widget: indexWidget,
11105
11135
  parentIndex: parentIndex,
11106
11136
  props: stableProps,
11107
- shouldSsr: Boolean(serverContext || initialResults)
11137
+ shouldSsr: Boolean(serverContext || initialResults),
11138
+ skipSuspense: true
11108
11139
  });
11109
11140
  return indexWidget;
11110
11141
  }
@@ -13437,7 +13468,7 @@
13437
13468
  };
13438
13469
  }
13439
13470
 
13440
- var version$3 = '4.78.3';
13471
+ var version$3 = '4.79.1';
13441
13472
 
13442
13473
  function _typeof$q(o) {
13443
13474
  "@babel/helpers - typeof";
@@ -13637,6 +13668,8 @@
13637
13668
  _defineProperty$l(_assertThisInitialized(_this), "_searchStalledTimer", void 0);
13638
13669
  _defineProperty$l(_assertThisInitialized(_this), "_initialUiState", void 0);
13639
13670
  _defineProperty$l(_assertThisInitialized(_this), "_initialResults", void 0);
13671
+ _defineProperty$l(_assertThisInitialized(_this), "_manuallyResetScheduleSearch", false);
13672
+ _defineProperty$l(_assertThisInitialized(_this), "_resetScheduleSearch", void 0);
13640
13673
  _defineProperty$l(_assertThisInitialized(_this), "_createURL", void 0);
13641
13674
  _defineProperty$l(_assertThisInitialized(_this), "_searchFunction", void 0);
13642
13675
  _defineProperty$l(_assertThisInitialized(_this), "_mainHelperSearch", void 0);
@@ -14029,14 +14062,25 @@
14029
14062
  // because we already have the results to render. This skips the initial
14030
14063
  // network request on the browser on `start`.
14031
14064
  this.scheduleSearch = defer(noop$1);
14032
- // We also skip the initial network request when widgets are dynamically
14033
- // added in the first tick (that's the case in all the framework-based flavors).
14034
- // When we add a widget to `index`, it calls `scheduleSearch`. We can rely
14035
- // on our `defer` util to restore the original `scheduleSearch` value once
14036
- // widgets are added to hook back to the regular lifecycle.
14037
- defer(function () {
14038
- _this3.scheduleSearch = originalScheduleSearch;
14039
- })();
14065
+ if (this._manuallyResetScheduleSearch) {
14066
+ // If `_manuallyResetScheduleSearch` is passed, it means that we don't
14067
+ // want to rely on a single `defer` to reset the `scheduleSearch`.
14068
+ // Instead, the consumer will call `_resetScheduleSearch` to restore
14069
+ // the original `scheduleSearch` function.
14070
+ // This happens in the React flavour after rendering.
14071
+ this._resetScheduleSearch = function () {
14072
+ _this3.scheduleSearch = originalScheduleSearch;
14073
+ };
14074
+ } else {
14075
+ // We also skip the initial network request when widgets are dynamically
14076
+ // added in the first tick (that's the case in all the framework-based flavors).
14077
+ // When we add a widget to `index`, it calls `scheduleSearch`. We can rely
14078
+ // on our `defer` util to restore the original `scheduleSearch` value once
14079
+ // widgets are added to hook back to the regular lifecycle.
14080
+ defer(function () {
14081
+ _this3.scheduleSearch = originalScheduleSearch;
14082
+ })();
14083
+ }
14040
14084
  }
14041
14085
  // We only schedule a search when widgets have been added before `start()`
14042
14086
  // because there are listeners that can use these results.
@@ -14280,15 +14324,16 @@
14280
14324
  var forceUpdate = useForceUpdate();
14281
14325
  var serverContext = useInstantSearchServerContext();
14282
14326
  var serverState = useInstantSearchSSRContext();
14283
- var waitingForResultsRef = useRSCContext();
14327
+ var _useRSCContext = useRSCContext(),
14328
+ waitForResultsRef = _useRSCContext.waitForResultsRef;
14284
14329
  var initialResults = serverState === null || serverState === void 0 ? void 0 : serverState.initialResults;
14285
14330
  var prevPropsRef = React.useRef(props);
14286
- var shouldRenderAtOnce = serverContext || initialResults || waitingForResultsRef;
14331
+ var shouldRenderAtOnce = serverContext || initialResults || waitForResultsRef;
14287
14332
  var searchRef = React.useRef(null);
14288
14333
  // As we need to render on mount with SSR, using the local ref above in `StrictMode` will
14289
14334
  // create and start two instances of InstantSearch. To avoid this, we instead discard it and use
14290
14335
  // an upward ref from `InstantSearchSSRContext` as it has already been mounted a second time at this point.
14291
- if (serverState) {
14336
+ if (serverState !== null && serverState !== void 0 && serverState.ssrSearchRef) {
14292
14337
  searchRef = serverState.ssrSearchRef;
14293
14338
  }
14294
14339
  if (searchRef.current === null) {
@@ -14315,6 +14360,10 @@
14315
14360
  // an additional network request. (This is equivalent to monkey-patching
14316
14361
  // `scheduleSearch` to a noop.)
14317
14362
  search._initialResults = initialResults || {};
14363
+ // We don't rely on the `defer` to reset the schedule search, but will call
14364
+ // `search._resetScheduleSearch()` manually in the effect after children
14365
+ // mount in `InstantSearch`.
14366
+ search._manuallyResetScheduleSearch = true;
14318
14367
  }
14319
14368
  addAlgoliaAgents(props.searchClient, [].concat(defaultUserAgents, [serverContext && serverUserAgent, nextUserAgent(getNextVersion())]));
14320
14369
 
@@ -14397,6 +14446,9 @@
14397
14446
  search._preventWidgetCleanup = false;
14398
14447
  }
14399
14448
  return function () {
14449
+ if (serverState !== null && serverState !== void 0 && serverState.ssrSearchRef) {
14450
+ return;
14451
+ }
14400
14452
  function cleanup() {
14401
14453
  search.dispose();
14402
14454
  }
@@ -14408,13 +14460,12 @@
14408
14460
  // in the next effect.
14409
14461
  // (There might be better ways to do this.)
14410
14462
  cleanupTimerRef.current = setTimeout(cleanup);
14411
-
14412
14463
  // We need to prevent the `useWidget` cleanup function so that widgets
14413
14464
  // are not removed before the instance is disposed, triggering
14414
14465
  // an unwanted search request.
14415
14466
  search._preventWidgetCleanup = true;
14416
14467
  };
14417
- }, [forceUpdate]), function () {
14468
+ }, [forceUpdate, serverState]), function () {
14418
14469
  return searchRef.current;
14419
14470
  }, function () {
14420
14471
  return searchRef.current;
@@ -14481,7 +14532,18 @@
14481
14532
  value: search
14482
14533
  }, /*#__PURE__*/React__default.createElement(IndexContext.Provider, {
14483
14534
  value: search.mainIndex
14484
- }, children));
14535
+ }, children, /*#__PURE__*/React__default.createElement(ResetScheduleSearch, {
14536
+ search: search
14537
+ })));
14538
+ }
14539
+ function ResetScheduleSearch(_ref2) {
14540
+ var search = _ref2.search;
14541
+ React.useEffect(function () {
14542
+ if (search._resetScheduleSearch) {
14543
+ search._resetScheduleSearch();
14544
+ }
14545
+ }, [search]);
14546
+ return null;
14485
14547
  }
14486
14548
 
14487
14549
  function _typeof$s(o) {
@@ -14774,9 +14836,7 @@
14774
14836
  if (!results || state.hierarchicalFacets.length === 0) {
14775
14837
  return [];
14776
14838
  }
14777
- var _state$hierarchicalFa = _slicedToArray$8(state.hierarchicalFacets, 1),
14778
- facetName = _state$hierarchicalFa[0].name;
14779
- var facetValues = results.getFacetValues(facetName, {});
14839
+ var facetValues = results.getFacetValues(hierarchicalFacetName, {});
14780
14840
  var facetItems = facetValues && !Array.isArray(facetValues) && facetValues.data ? facetValues.data : [];
14781
14841
  var items = transformItems(shiftItemsValues(prepareItems(facetItems)), {
14782
14842
  results: results
@@ -16795,9 +16855,11 @@
16795
16855
  state: normalizeState(state)
16796
16856
  }) || {};
16797
16857
  var banner = results === null || results === void 0 ? void 0 : (_results$renderingCon = results.renderingContent) === null || _results$renderingCon === void 0 ? void 0 : (_results$renderingCon2 = _results$renderingCon.widgets) === null || _results$renderingCon2 === void 0 ? void 0 : (_results$renderingCon3 = _results$renderingCon2.banners) === null || _results$renderingCon3 === void 0 ? void 0 : _results$renderingCon3[0];
16798
- if (!results) {
16858
+ if (!showPrevious) {
16799
16859
  showPrevious = getShowPrevious(helper);
16800
16860
  showMore = getShowMore(helper);
16861
+ }
16862
+ if (!sendEvent) {
16801
16863
  sendEvent = createSendEventForHits({
16802
16864
  instantSearchInstance: instantSearchInstance,
16803
16865
  helper: helper,
@@ -16808,6 +16870,8 @@
16808
16870
  widgetType: this.$$type,
16809
16871
  instantSearchInstance: instantSearchInstance
16810
16872
  });
16873
+ }
16874
+ if (!results) {
16811
16875
  isFirstPage = state.page === undefined || getFirstReceivedPage(state, cachedHits) === 0;
16812
16876
  } else {
16813
16877
  var _state$disjunctiveFac, _state$hierarchicalFa;
@@ -20967,18 +21031,13 @@
20967
21031
 
20968
21032
  var _extends_1 = createCommonjsModule(function (module) {
20969
21033
  function _extends() {
20970
- module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {
20971
- for (var i = 1; i < arguments.length; i++) {
20972
- var source = arguments[i];
20973
- for (var key in source) {
20974
- if (Object.prototype.hasOwnProperty.call(source, key)) {
20975
- target[key] = source[key];
20976
- }
20977
- }
21034
+ return module.exports = _extends = Object.assign ? Object.assign.bind() : function (n) {
21035
+ for (var e = 1; e < arguments.length; e++) {
21036
+ var t = arguments[e];
21037
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
20978
21038
  }
20979
- return target;
20980
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
20981
- return _extends.apply(this, arguments);
21039
+ return n;
21040
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports, _extends.apply(null, arguments);
20982
21041
  }
20983
21042
  module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
20984
21043
  });
@@ -20986,63 +21045,57 @@
20986
21045
  var _extends$2 = unwrapExports(_extends_1);
20987
21046
 
20988
21047
  var _typeof_1 = createCommonjsModule(function (module) {
20989
- function _typeof(obj) {
21048
+ function _typeof(o) {
20990
21049
  "@babel/helpers - typeof";
20991
21050
 
20992
- return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
20993
- return typeof obj;
20994
- } : function (obj) {
20995
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
20996
- }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
21051
+ return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
21052
+ return typeof o;
21053
+ } : function (o) {
21054
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
21055
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
20997
21056
  }
20998
21057
  module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
20999
21058
  });
21000
21059
 
21001
21060
  unwrapExports(_typeof_1);
21002
21061
 
21003
- var toPrimitive = createCommonjsModule(function (module) {
21062
+ var toPrimitive_1 = createCommonjsModule(function (module) {
21004
21063
  var _typeof = _typeof_1["default"];
21005
- function _toPrimitive(input, hint) {
21006
- if (_typeof(input) !== "object" || input === null) return input;
21007
- var prim = input[Symbol.toPrimitive];
21008
- if (prim !== undefined) {
21009
- var res = prim.call(input, hint || "default");
21010
- if (_typeof(res) !== "object") return res;
21064
+ function toPrimitive(t, r) {
21065
+ if ("object" != _typeof(t) || !t) return t;
21066
+ var e = t[Symbol.toPrimitive];
21067
+ if (void 0 !== e) {
21068
+ var i = e.call(t, r || "default");
21069
+ if ("object" != _typeof(i)) return i;
21011
21070
  throw new TypeError("@@toPrimitive must return a primitive value.");
21012
21071
  }
21013
- return (hint === "string" ? String : Number)(input);
21072
+ return ("string" === r ? String : Number)(t);
21014
21073
  }
21015
- module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
21074
+ module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
21016
21075
  });
21017
21076
 
21018
- unwrapExports(toPrimitive);
21077
+ unwrapExports(toPrimitive_1);
21019
21078
 
21020
- var toPropertyKey = createCommonjsModule(function (module) {
21079
+ var toPropertyKey_1 = createCommonjsModule(function (module) {
21021
21080
  var _typeof = _typeof_1["default"];
21022
21081
 
21023
- function _toPropertyKey(arg) {
21024
- var key = toPrimitive(arg, "string");
21025
- return _typeof(key) === "symbol" ? key : String(key);
21082
+ function toPropertyKey(t) {
21083
+ var i = toPrimitive_1(t, "string");
21084
+ return "symbol" == _typeof(i) ? i : i + "";
21026
21085
  }
21027
- module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
21086
+ module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
21028
21087
  });
21029
21088
 
21030
- unwrapExports(toPropertyKey);
21089
+ unwrapExports(toPropertyKey_1);
21031
21090
 
21032
21091
  var defineProperty = createCommonjsModule(function (module) {
21033
- function _defineProperty(obj, key, value) {
21034
- key = toPropertyKey(key);
21035
- if (key in obj) {
21036
- Object.defineProperty(obj, key, {
21037
- value: value,
21038
- enumerable: true,
21039
- configurable: true,
21040
- writable: true
21041
- });
21042
- } else {
21043
- obj[key] = value;
21044
- }
21045
- return obj;
21092
+ function _defineProperty(e, r, t) {
21093
+ return (r = toPropertyKey_1(r)) in e ? Object.defineProperty(e, r, {
21094
+ value: t,
21095
+ enumerable: !0,
21096
+ configurable: !0,
21097
+ writable: !0
21098
+ }) : e[r] = t, e;
21046
21099
  }
21047
21100
  module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
21048
21101
  });
@@ -21050,17 +21103,14 @@
21050
21103
  var _defineProperty$N = unwrapExports(defineProperty);
21051
21104
 
21052
21105
  var objectWithoutPropertiesLoose = createCommonjsModule(function (module) {
21053
- function _objectWithoutPropertiesLoose(source, excluded) {
21054
- if (source == null) return {};
21055
- var target = {};
21056
- var sourceKeys = Object.keys(source);
21057
- var key, i;
21058
- for (i = 0; i < sourceKeys.length; i++) {
21059
- key = sourceKeys[i];
21060
- if (excluded.indexOf(key) >= 0) continue;
21061
- target[key] = source[key];
21106
+ function _objectWithoutPropertiesLoose(r, e) {
21107
+ if (null == r) return {};
21108
+ var t = {};
21109
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
21110
+ if (-1 !== e.indexOf(n)) continue;
21111
+ t[n] = r[n];
21062
21112
  }
21063
- return target;
21113
+ return t;
21064
21114
  }
21065
21115
  module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
21066
21116
  });
@@ -21068,20 +21118,16 @@
21068
21118
  unwrapExports(objectWithoutPropertiesLoose);
21069
21119
 
21070
21120
  var objectWithoutProperties = createCommonjsModule(function (module) {
21071
- function _objectWithoutProperties(source, excluded) {
21072
- if (source == null) return {};
21073
- var target = objectWithoutPropertiesLoose(source, excluded);
21074
- var key, i;
21121
+ function _objectWithoutProperties(e, t) {
21122
+ if (null == e) return {};
21123
+ var o,
21124
+ r,
21125
+ i = objectWithoutPropertiesLoose(e, t);
21075
21126
  if (Object.getOwnPropertySymbols) {
21076
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
21077
- for (i = 0; i < sourceSymbolKeys.length; i++) {
21078
- key = sourceSymbolKeys[i];
21079
- if (excluded.indexOf(key) >= 0) continue;
21080
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
21081
- target[key] = source[key];
21082
- }
21127
+ var n = Object.getOwnPropertySymbols(e);
21128
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
21083
21129
  }
21084
- return target;
21130
+ return i;
21085
21131
  }
21086
21132
  module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
21087
21133
  });
@@ -22426,13 +22472,12 @@
22426
22472
  }, translations.showMoreButtonText));
22427
22473
  }
22428
22474
 
22429
- var _excluded$z = ["showPrevious", "cache", "escapeHTML", "showPrevious", "transformItems", "translations", "bannerComponent"];
22475
+ var _excluded$z = ["showPrevious", "cache", "escapeHTML", "transformItems", "translations", "bannerComponent"];
22430
22476
  function InfiniteHits$1(_ref) {
22431
22477
  var _ref$showPrevious = _ref.showPrevious,
22432
22478
  shouldShowPrevious = _ref$showPrevious === void 0 ? true : _ref$showPrevious,
22433
22479
  cache = _ref.cache,
22434
22480
  escapeHTML = _ref.escapeHTML,
22435
- userShowPrevious = _ref.showPrevious,
22436
22481
  transformItems = _ref.transformItems,
22437
22482
  translations = _ref.translations,
22438
22483
  BannerComponent = _ref.bannerComponent,
@@ -22440,12 +22485,12 @@
22440
22485
  var _useInfiniteHits = useInfiniteHits({
22441
22486
  cache: cache,
22442
22487
  escapeHTML: escapeHTML,
22443
- showPrevious: userShowPrevious,
22488
+ showPrevious: shouldShowPrevious,
22444
22489
  transformItems: transformItems
22445
22490
  }, {
22446
22491
  $$widgetType: 'ais.infiniteHits'
22447
22492
  }),
22448
- hits = _useInfiniteHits.hits,
22493
+ items = _useInfiniteHits.items,
22449
22494
  banner = _useInfiniteHits.banner,
22450
22495
  sendEvent = _useInfiniteHits.sendEvent,
22451
22496
  showPrevious = _useInfiniteHits.showPrevious,
@@ -22456,7 +22501,7 @@
22456
22501
  return null;
22457
22502
  } : BannerComponent;
22458
22503
  var uiProps = {
22459
- hits: hits,
22504
+ hits: items,
22460
22505
  banner: banner,
22461
22506
  bannerComponent: bannerComponent,
22462
22507
  sendEvent: sendEvent,
@@ -23113,10 +23158,12 @@
23113
23158
  }))));
23114
23159
  }
23115
23160
 
23116
- var _excluded$J = ["searchable", "searchablePlaceholder", "attribute", "operator", "limit", "showMore", "showMoreLimit", "sortBy", "escapeFacetValues", "transformItems", "translations"];
23161
+ var _excluded$J = ["searchable", "searchablePlaceholder", "searchableSelectOnSubmit", "attribute", "operator", "limit", "showMore", "showMoreLimit", "sortBy", "escapeFacetValues", "transformItems", "translations"];
23117
23162
  function RefinementList$2(_ref) {
23118
23163
  var searchable = _ref.searchable,
23119
23164
  searchablePlaceholder = _ref.searchablePlaceholder,
23165
+ _ref$searchableSelect = _ref.searchableSelectOnSubmit,
23166
+ searchableSelectOnSubmit = _ref$searchableSelect === void 0 ? true : _ref$searchableSelect,
23120
23167
  attribute = _ref.attribute,
23121
23168
  operator = _ref.operator,
23122
23169
  limit = _ref.limit,
@@ -23171,6 +23218,9 @@
23171
23218
  setQuery('');
23172
23219
  }
23173
23220
  function onSubmit() {
23221
+ if (searchableSelectOnSubmit === false) {
23222
+ return;
23223
+ }
23174
23224
  if (items.length > 0) {
23175
23225
  refine(items[0].value);
23176
23226
  setQuery('');
@@ -23710,6 +23760,7 @@
23710
23760
  exports.InfiniteHits = InfiniteHits$1;
23711
23761
  exports.InstantSearch = InstantSearch$1;
23712
23762
  exports.InstantSearchRSCContext = InstantSearchRSCContext;
23763
+ exports.InstantSearchSSRContext = InstantSearchSSRContext;
23713
23764
  exports.InstantSearchSSRProvider = InstantSearchSSRProvider;
23714
23765
  exports.InstantSearchServerContext = InstantSearchServerContext;
23715
23766
  exports.LookingSimilar = LookingSimilar;