react-instantsearch-core 7.20.0 → 7.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -95,6 +95,6 @@ function useWidget(_ref) {
95
95
  }
96
96
  if ((waitForResultsRef === null || waitForResultsRef === void 0 ? void 0 : (_waitForResultsRef$cu2 = waitForResultsRef.current) === null || _waitForResultsRef$cu2 === void 0 ? void 0 : _waitForResultsRef$cu2.status) === 'fulfilled') {
97
97
  countRef.current += 1;
98
- process.env.NODE_ENV === 'development' ? (0, _warn.warn)(countRef.current > parentIndex.getWidgets().length && !ignoreMultipleHooksWarning, "We detected you may have a component with multiple InstantSearch hooks.\n\nWith Next.js, you need to set `skipSuspense` to `true` for all but the last hook in the component, otherwise, only the first hook will be rendered on the server.\n\nThis warning can be a false positive if you are using dynamic widgets or multi-index, in which case you can ignore it by setting `ignoreMultipleHooksWarning` to `true` in `<InstantSearchNext`.\n\nFor more information, see https://www.algolia.com/doc/guides/building-search-ui/going-further/server-side-rendering/react/#composing-hooks") : void 0;
98
+ process.env.NODE_ENV === 'development' ? (0, _warn.warn)(ignoreMultipleHooksWarning || countRef.current <= parentIndex.getWidgets().length, "We detected you may have a component with multiple InstantSearch hooks.\n\nWith Next.js, you need to set `skipSuspense` to `true` for all but the last hook in the component, otherwise, only the first hook will be rendered on the server.\n\nThis warning can be a false positive if you are using dynamic widgets or multi-index, in which case you can ignore it by setting `ignoreMultipleHooksWarning` to `true` in `<InstantSearchNext`.\n\nFor more information, see https://www.algolia.com/doc/guides/building-search-ui/going-further/server-side-rendering/react/#composing-hooks") : void 0;
99
99
  }
100
100
  }
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _default = exports.default = '7.20.0';
7
+ var _default = exports.default = '7.20.2';
@@ -89,6 +89,6 @@ export function useWidget(_ref) {
89
89
  }
90
90
  if ((waitForResultsRef === null || waitForResultsRef === void 0 ? void 0 : (_waitForResultsRef$cu2 = waitForResultsRef.current) === null || _waitForResultsRef$cu2 === void 0 ? void 0 : _waitForResultsRef$cu2.status) === 'fulfilled') {
91
91
  countRef.current += 1;
92
- process.env.NODE_ENV === 'development' ? warn(countRef.current > parentIndex.getWidgets().length && !ignoreMultipleHooksWarning, "We detected you may have a component with multiple InstantSearch hooks.\n\nWith Next.js, you need to set `skipSuspense` to `true` for all but the last hook in the component, otherwise, only the first hook will be rendered on the server.\n\nThis warning can be a false positive if you are using dynamic widgets or multi-index, in which case you can ignore it by setting `ignoreMultipleHooksWarning` to `true` in `<InstantSearchNext`.\n\nFor more information, see https://www.algolia.com/doc/guides/building-search-ui/going-further/server-side-rendering/react/#composing-hooks") : void 0;
92
+ process.env.NODE_ENV === 'development' ? warn(ignoreMultipleHooksWarning || countRef.current <= parentIndex.getWidgets().length, "We detected you may have a component with multiple InstantSearch hooks.\n\nWith Next.js, you need to set `skipSuspense` to `true` for all but the last hook in the component, otherwise, only the first hook will be rendered on the server.\n\nThis warning can be a false positive if you are using dynamic widgets or multi-index, in which case you can ignore it by setting `ignoreMultipleHooksWarning` to `true` in `<InstantSearchNext`.\n\nFor more information, see https://www.algolia.com/doc/guides/building-search-ui/going-further/server-side-rendering/react/#composing-hooks") : void 0;
93
93
  }
94
94
  }
@@ -1,2 +1,2 @@
1
- declare const _default: "7.20.0";
1
+ declare const _default: "7.20.2";
2
2
  export default _default;
@@ -1 +1 @@
1
- export default '7.20.0';
1
+ export default '7.20.2';
@@ -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.2';
11
11
 
12
12
  function _arrayLikeToArray(r, a) {
13
13
  (null == a || a > r.length) && (a = r.length);
@@ -7977,6 +7977,11 @@
7977
7977
  return insideBoundingBoxStringToBoundingBox(value);
7978
7978
  }
7979
7979
 
7980
+ function getAlgoliaAgent(client) {
7981
+ var clientTyped = client;
7982
+ return clientTyped.transporter && clientTyped.transporter.userAgent ? clientTyped.transporter.userAgent.value : clientTyped._ua;
7983
+ }
7984
+
7980
7985
  // typed as any, since it accepts the _real_ js clients, not the interface we otherwise expect
7981
7986
  function getAppIdAndApiKey(searchClient) {
7982
7987
  if (searchClient.appId && searchClient.apiKey) {
@@ -11305,8 +11310,7 @@
11305
11310
  subscribe: function subscribe() {
11306
11311
  // using setTimeout here to delay extraction until widgets have been added in a tick (e.g. Vue)
11307
11312
  setTimeout(function () {
11308
- var client = instantSearchInstance.client;
11309
- payload.ua = client.transporter && client.transporter.userAgent ? client.transporter.userAgent.value : client._ua;
11313
+ payload.ua = getAlgoliaAgent(instantSearchInstance.client);
11310
11314
  extractWidgetPayload(instantSearchInstance.mainIndex.getWidgets(), instantSearchInstance, payload);
11311
11315
  instantSearchInstance.middleware.forEach(function (middleware) {
11312
11316
  return payload.widgets.push({
@@ -12829,7 +12833,7 @@
12829
12833
  };
12830
12834
  }
12831
12835
 
12832
- var version$2 = '4.84.0';
12836
+ var version$2 = '4.85.1';
12833
12837
 
12834
12838
  function _typeof$l(o) {
12835
12839
  "@babel/helpers - typeof";