react-instantsearch-core 7.8.1 → 7.9.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.
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useFrequentlyBoughtTogether = useFrequentlyBoughtTogether;
7
+ var _connectFrequentlyBoughtTogether = _interopRequireDefault(require("instantsearch.js/cjs/connectors/frequently-bought-together/connectFrequentlyBoughtTogether"));
8
+ var _useConnector = require("../hooks/useConnector");
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ function useFrequentlyBoughtTogether(props, additionalWidgetProperties) {
11
+ return (0, _useConnector.useConnector)(_connectFrequentlyBoughtTogether.default, props, additionalWidgetProperties);
12
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useLookingSimilar = useLookingSimilar;
7
+ var _connectLookingSimilar = _interopRequireDefault(require("instantsearch.js/cjs/connectors/looking-similar/connectLookingSimilar"));
8
+ var _useConnector = require("../hooks/useConnector");
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ function useLookingSimilar(props, additionalWidgetProperties) {
11
+ return (0, _useConnector.useConnector)(_connectLookingSimilar.default, props, additionalWidgetProperties);
12
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useRelatedProducts = useRelatedProducts;
7
+ var _connectRelatedProducts = _interopRequireDefault(require("instantsearch.js/cjs/connectors/related-products/connectRelatedProducts"));
8
+ var _useConnector = require("../hooks/useConnector");
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ function useRelatedProducts(props, additionalWidgetProperties) {
11
+ return (0, _useConnector.useConnector)(_connectRelatedProducts.default, props, additionalWidgetProperties);
12
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useTrendingItems = useTrendingItems;
7
+ var _connectTrendingItems = _interopRequireDefault(require("instantsearch.js/cjs/connectors/trending-items/connectTrendingItems"));
8
+ var _useConnector = require("../hooks/useConnector");
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ function useTrendingItems(props, additionalWidgetProperties) {
11
+ return (0, _useConnector.useConnector)(_connectTrendingItems.default, props, additionalWidgetProperties);
12
+ }
@@ -105,7 +105,10 @@ function useConnector(connector) {
105
105
  helper: helper,
106
106
  parent: parentIndex,
107
107
  instantSearchInstance: search,
108
- results: results,
108
+ results: widget.dependsOn === 'recommend' ?
109
+ // @TODO: this is to avoid using wrong hits in SSR,
110
+ // will be replace with SSR support for recommend
111
+ null : results,
109
112
  scopedResults: scopedResults,
110
113
  state: helper.state,
111
114
  renderState: search.renderState,
package/dist/cjs/index.js CHANGED
@@ -145,6 +145,18 @@ Object.keys(_useDynamicWidgets).forEach(function (key) {
145
145
  }
146
146
  });
147
147
  });
148
+ var _useFrequentlyBoughtTogether = require("./connectors/useFrequentlyBoughtTogether");
149
+ Object.keys(_useFrequentlyBoughtTogether).forEach(function (key) {
150
+ if (key === "default" || key === "__esModule") return;
151
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
152
+ if (key in exports && exports[key] === _useFrequentlyBoughtTogether[key]) return;
153
+ Object.defineProperty(exports, key, {
154
+ enumerable: true,
155
+ get: function get() {
156
+ return _useFrequentlyBoughtTogether[key];
157
+ }
158
+ });
159
+ });
148
160
  var _useGeoSearch = require("./connectors/useGeoSearch");
149
161
  Object.keys(_useGeoSearch).forEach(function (key) {
150
162
  if (key === "default" || key === "__esModule") return;
@@ -289,6 +301,18 @@ Object.keys(_useRefinementList).forEach(function (key) {
289
301
  }
290
302
  });
291
303
  });
304
+ var _useRelatedProducts = require("./connectors/useRelatedProducts");
305
+ Object.keys(_useRelatedProducts).forEach(function (key) {
306
+ if (key === "default" || key === "__esModule") return;
307
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
308
+ if (key in exports && exports[key] === _useRelatedProducts[key]) return;
309
+ Object.defineProperty(exports, key, {
310
+ enumerable: true,
311
+ get: function get() {
312
+ return _useRelatedProducts[key];
313
+ }
314
+ });
315
+ });
292
316
  var _useSearchBox = require("./connectors/useSearchBox");
293
317
  Object.keys(_useSearchBox).forEach(function (key) {
294
318
  if (key === "default" || key === "__esModule") return;
@@ -337,6 +361,30 @@ Object.keys(_useToggleRefinement).forEach(function (key) {
337
361
  }
338
362
  });
339
363
  });
364
+ var _useTrendingItems = require("./connectors/useTrendingItems");
365
+ Object.keys(_useTrendingItems).forEach(function (key) {
366
+ if (key === "default" || key === "__esModule") return;
367
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
368
+ if (key in exports && exports[key] === _useTrendingItems[key]) return;
369
+ Object.defineProperty(exports, key, {
370
+ enumerable: true,
371
+ get: function get() {
372
+ return _useTrendingItems[key];
373
+ }
374
+ });
375
+ });
376
+ var _useLookingSimilar = require("./connectors/useLookingSimilar");
377
+ Object.keys(_useLookingSimilar).forEach(function (key) {
378
+ if (key === "default" || key === "__esModule") return;
379
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
380
+ if (key in exports && exports[key] === _useLookingSimilar[key]) return;
381
+ Object.defineProperty(exports, key, {
382
+ enumerable: true,
383
+ get: function get() {
384
+ return _useLookingSimilar[key];
385
+ }
386
+ });
387
+ });
340
388
  var _useConnector = require("./hooks/useConnector");
341
389
  Object.keys(_useConnector).forEach(function (key) {
342
390
  if (key === "default" || key === "__esModule") return;
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _default = '7.8.1';
7
+ var _default = '7.9.0';
8
8
  exports.default = _default;
@@ -0,0 +1,5 @@
1
+ import type { AdditionalWidgetProperties } from '../hooks/useConnector';
2
+ import type { BaseHit } from 'instantsearch.js';
3
+ import type { FrequentlyBoughtTogetherConnectorParams } from 'instantsearch.js/es/connectors/frequently-bought-together/connectFrequentlyBoughtTogether';
4
+ export type UseFrequentlyBoughtTogetherProps<THit extends BaseHit = BaseHit> = FrequentlyBoughtTogetherConnectorParams<THit>;
5
+ export declare function useFrequentlyBoughtTogether<THit extends BaseHit = BaseHit>(props?: UseFrequentlyBoughtTogetherProps<THit>, additionalWidgetProperties?: AdditionalWidgetProperties): import("instantsearch.js/es/connectors/frequently-bought-together/connectFrequentlyBoughtTogether").FrequentlyBoughtTogetherRenderState<THit>;
@@ -0,0 +1,5 @@
1
+ import connectFrequentlyBoughtTogether from "instantsearch.js/es/connectors/frequently-bought-together/connectFrequentlyBoughtTogether.js";
2
+ import { useConnector } from "../hooks/useConnector.js";
3
+ export function useFrequentlyBoughtTogether(props, additionalWidgetProperties) {
4
+ return useConnector(connectFrequentlyBoughtTogether, props, additionalWidgetProperties);
5
+ }
@@ -0,0 +1,5 @@
1
+ import type { AdditionalWidgetProperties } from '../hooks/useConnector';
2
+ import type { BaseHit } from 'instantsearch.js';
3
+ import type { LookingSimilarConnectorParams } from 'instantsearch.js/es/connectors/looking-similar/connectLookingSimilar';
4
+ export type UseLookingSimilarProps<THit extends BaseHit = BaseHit> = LookingSimilarConnectorParams<THit>;
5
+ export declare function useLookingSimilar<THit extends BaseHit = BaseHit>(props?: UseLookingSimilarProps<THit>, additionalWidgetProperties?: AdditionalWidgetProperties): import("instantsearch.js/es/connectors/looking-similar/connectLookingSimilar").LookingSimilarRenderState<THit>;
@@ -0,0 +1,5 @@
1
+ import connectLookingSimilar from "instantsearch.js/es/connectors/looking-similar/connectLookingSimilar.js";
2
+ import { useConnector } from "../hooks/useConnector.js";
3
+ export function useLookingSimilar(props, additionalWidgetProperties) {
4
+ return useConnector(connectLookingSimilar, props, additionalWidgetProperties);
5
+ }
@@ -0,0 +1,5 @@
1
+ import type { AdditionalWidgetProperties } from '../hooks/useConnector';
2
+ import type { BaseHit } from 'instantsearch.js';
3
+ import type { RelatedProductsConnectorParams } from 'instantsearch.js/es/connectors/related-products/connectRelatedProducts';
4
+ export type UseRelatedProductsProps<THit extends BaseHit = BaseHit> = RelatedProductsConnectorParams<THit>;
5
+ export declare function useRelatedProducts<THit extends BaseHit = BaseHit>(props: UseRelatedProductsProps<THit>, additionalWidgetProperties?: AdditionalWidgetProperties): import("instantsearch.js/es/connectors/related-products/connectRelatedProducts").RelatedProductsRenderState<THit>;
@@ -0,0 +1,5 @@
1
+ import connectRelatedProducts from "instantsearch.js/es/connectors/related-products/connectRelatedProducts.js";
2
+ import { useConnector } from "../hooks/useConnector.js";
3
+ export function useRelatedProducts(props, additionalWidgetProperties) {
4
+ return useConnector(connectRelatedProducts, props, additionalWidgetProperties);
5
+ }
@@ -0,0 +1,5 @@
1
+ import type { AdditionalWidgetProperties } from '../hooks/useConnector';
2
+ import type { BaseHit } from 'instantsearch.js';
3
+ import type { TrendingItemsConnectorParams } from 'instantsearch.js/es/connectors/trending-items/connectTrendingItems';
4
+ export type UseTrendingItemsProps<THit extends BaseHit = BaseHit> = TrendingItemsConnectorParams<THit>;
5
+ export declare function useTrendingItems<THit extends BaseHit = BaseHit>(props?: UseTrendingItemsProps<THit>, additionalWidgetProperties?: AdditionalWidgetProperties): import("instantsearch.js/es/connectors/trending-items/connectTrendingItems").TrendingItemsRenderState<THit>;
@@ -0,0 +1,5 @@
1
+ import connectTrendingItems from "instantsearch.js/es/connectors/trending-items/connectTrendingItems.js";
2
+ import { useConnector } from "../hooks/useConnector.js";
3
+ export function useTrendingItems(props, additionalWidgetProperties) {
4
+ return useConnector(connectTrendingItems, props, additionalWidgetProperties);
5
+ }
@@ -99,7 +99,10 @@ export function useConnector(connector) {
99
99
  helper: helper,
100
100
  parent: parentIndex,
101
101
  instantSearchInstance: search,
102
- results: results,
102
+ results: widget.dependsOn === 'recommend' ?
103
+ // @TODO: this is to avoid using wrong hits in SSR,
104
+ // will be replace with SSR support for recommend
105
+ null : results,
103
106
  scopedResults: scopedResults,
104
107
  state: helper.state,
105
108
  renderState: search.renderState,
@@ -10,6 +10,7 @@ export * from './connectors/useClearRefinements';
10
10
  export * from './connectors/useConfigure';
11
11
  export * from './connectors/useCurrentRefinements';
12
12
  export * from './connectors/useDynamicWidgets';
13
+ export * from './connectors/useFrequentlyBoughtTogether';
13
14
  export * from './connectors/useGeoSearch';
14
15
  export * from './connectors/useHierarchicalMenu';
15
16
  export * from './connectors/useHits';
@@ -22,10 +23,13 @@ export * from './connectors/usePoweredBy';
22
23
  export * from './connectors/useQueryRules';
23
24
  export * from './connectors/useRange';
24
25
  export * from './connectors/useRefinementList';
26
+ export * from './connectors/useRelatedProducts';
25
27
  export * from './connectors/useSearchBox';
26
28
  export * from './connectors/useSortBy';
27
29
  export * from './connectors/useStats';
28
30
  export * from './connectors/useToggleRefinement';
31
+ export * from './connectors/useTrendingItems';
32
+ export * from './connectors/useLookingSimilar';
29
33
  export * from './hooks/useConnector';
30
34
  export * from './hooks/useInstantSearch';
31
35
  export * from './lib/wrapPromiseWithState';
package/dist/es/index.js CHANGED
@@ -10,6 +10,7 @@ export * from "./connectors/useClearRefinements.js";
10
10
  export * from "./connectors/useConfigure.js";
11
11
  export * from "./connectors/useCurrentRefinements.js";
12
12
  export * from "./connectors/useDynamicWidgets.js";
13
+ export * from "./connectors/useFrequentlyBoughtTogether.js";
13
14
  export * from "./connectors/useGeoSearch.js";
14
15
  export * from "./connectors/useHierarchicalMenu.js";
15
16
  export * from "./connectors/useHits.js";
@@ -22,10 +23,13 @@ export * from "./connectors/usePoweredBy.js";
22
23
  export * from "./connectors/useQueryRules.js";
23
24
  export * from "./connectors/useRange.js";
24
25
  export * from "./connectors/useRefinementList.js";
26
+ export * from "./connectors/useRelatedProducts.js";
25
27
  export * from "./connectors/useSearchBox.js";
26
28
  export * from "./connectors/useSortBy.js";
27
29
  export * from "./connectors/useStats.js";
28
30
  export * from "./connectors/useToggleRefinement.js";
31
+ export * from "./connectors/useTrendingItems.js";
32
+ export * from "./connectors/useLookingSimilar.js";
29
33
  export * from "./hooks/useConnector.js";
30
34
  export * from "./hooks/useInstantSearch.js";
31
35
  export * from "./lib/wrapPromiseWithState.js";
@@ -1,2 +1,2 @@
1
- declare const _default: "7.8.1";
1
+ declare const _default: "7.9.0";
2
2
  export default _default;
@@ -1 +1 @@
1
- export default '7.8.1';
1
+ export default '7.9.0';