@usereactify/search 3.0.0 → 3.1.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.
@@ -19,8 +19,6 @@ declare type Context = {
19
19
  curation?: ConfigCuration;
20
20
  /** Array of additional component IDs managed outside of Reactify Search */
21
21
  additionalComponentIds?: string[];
22
- /** Enable the new callouts feature */
23
- enableCallouts?: boolean;
24
22
  };
25
23
  declare const Context: React.Context<Context | undefined>;
26
24
  declare type Props = {
@@ -34,8 +32,6 @@ declare type Props = {
34
32
  theme?: Theme;
35
33
  /** Array of additional component IDs managed outside of Reactify Search */
36
34
  additionalComponentIds?: string[];
37
- /** Enable the new callouts feature */
38
- enableCallouts?: boolean;
39
35
  };
40
36
  export declare const Provider: React.FC<Props>;
41
37
  export declare const useContext: () => Context;
package/dist/provider.js CHANGED
@@ -15,7 +15,7 @@ const defaultCredentials = {
15
15
  };
16
16
  const Provider = (props) => {
17
17
  var _a, _b;
18
- const { index, config, children, collection, instantSearch, filterStackId, noReactiveBase, enableCallouts, additionalComponentIds, } = props;
18
+ const { index, config, children, collection, instantSearch, filterStackId, noReactiveBase, additionalComponentIds, } = props;
19
19
  const credentials = (_a = props.credentials) !== null && _a !== void 0 ? _a : defaultCredentials;
20
20
  const theme = (_b = props.theme) !== null && _b !== void 0 ? _b : {
21
21
  typography: {
@@ -76,7 +76,6 @@ const Provider = (props) => {
76
76
  setShowInstantSearchResults,
77
77
  theme,
78
78
  curation,
79
- enableCallouts,
80
79
  additionalComponentIds,
81
80
  instantSearch: !!instantSearch,
82
81
  showInstantSearchResults: !!showInstantSearchResults && !!searchQuery,
@@ -92,7 +91,6 @@ const Provider = (props) => {
92
91
  sortOptions,
93
92
  submitSearch,
94
93
  instantSearch,
95
- enableCallouts,
96
94
  additionalComponentIds,
97
95
  showInstantSearchResults,
98
96
  theme,
@@ -11,7 +11,6 @@ const ResultPagination_1 = require("./ResultPagination");
11
11
  const ResultCardCallout_1 = require("./ResultCardCallout");
12
12
  const ResultLoadMoreButton_1 = require("./ResultLoadMoreButton");
13
13
  const ResultPaginationNextPrev_1 = require("./ResultPaginationNextPrev");
14
- const provider_1 = require("../provider");
15
14
  const hooks_1 = require("../hooks");
16
15
  const elastic_1 = require("../types/elastic");
17
16
  const ResultList = (props) => {
@@ -24,18 +23,14 @@ const ResultList = (props) => {
24
23
  exports.ResultList = ResultList;
25
24
  const ResultListInner = (props) => {
26
25
  const { gridColumns, renderError, renderAfter, renderBefore, renderLoading, listClassName, renderResults, renderNoResults, renderResultCard, renderLoadMoreButton, renderResultCardCallout, reactivesearchResultProps, } = props;
27
- const curation = (0, hooks_1.useCuration)();
28
26
  const filterStack = (0, hooks_1.useFilterStack)();
29
27
  const { instantSearch } = (0, hooks_1.useSearch)();
30
- const { enableCallouts } = (0, provider_1.useContext)();
31
28
  const initialSearchHasRun = react_1.default.useMemo(() => "undefined" !==
32
29
  typeof reactivesearchResultProps.resultStats.numberOfResults, [reactivesearchResultProps]);
33
- const styleProp = react_1.default.useMemo(() => !!enableCallouts
34
- ? {
35
- display: "grid",
36
- gridTemplateColumns: `repeat(${gridColumns !== null && gridColumns !== void 0 ? gridColumns : 4}, minmax(0, 1fr))`,
37
- }
38
- : {}, [curation]);
30
+ const styleProp = react_1.default.useMemo(() => ({
31
+ display: "grid",
32
+ gridTemplateColumns: `repeat(${gridColumns !== null && gridColumns !== void 0 ? gridColumns : 4}, minmax(0, 1fr))`,
33
+ }), [gridColumns]);
39
34
  if (reactivesearchResultProps.error) {
40
35
  if (renderError)
41
36
  return renderError({ error: reactivesearchResultProps.error });
@@ -63,7 +58,7 @@ const ResultListInner = (props) => {
63
58
  if (elastic_1.ElasticDocumentType.Product === result.type || !result.type) {
64
59
  return (react_1.default.createElement(ResultCard_1.ResultCard, { key: result._id, product: result, document: result, pagePosition: key + 1, render: renderResultCard }));
65
60
  }
66
- if (!!enableCallouts && elastic_1.ElasticDocumentType.Callout === result.type) {
61
+ if (elastic_1.ElasticDocumentType.Callout === result.type) {
67
62
  return (react_1.default.createElement(ResultCardCallout_1.ResultCardCallout, { key: result._id, document: result, pagePosition: key + 1, callout: result.callout, render: renderResultCardCallout }));
68
63
  }
69
64
  return null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@usereactify/search",
3
3
  "description": "React UI library for Reactify Search",
4
- "version": "3.0.0",
4
+ "version": "3.1.0",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",