@usereactify/search 5.2.1 → 5.2.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,27 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [5.2.2](https://bitbucket.org/usereactify/reactify-search-ui/compare/release-v5.2.1...release-v5.2.2) (2022-09-08)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * fix storybook config ([b748e78](https://bitbucket.org/usereactify/reactify-search-ui/commit/b748e7845e17c52cd141401bb24bc3fe85e1a3bd))
11
+ * rs-306 add includeFields and excludeFields to ReactiveListProps ([5531b81](https://bitbucket.org/usereactify/reactify-search-ui/commit/5531b81f8305eee862d3124d691619203162f7bd))
12
+ * rs-306 teeny cleanup when getting fields from context options ([a4bae10](https://bitbucket.org/usereactify/reactify-search-ui/commit/a4bae10652702a3328a50a56cea106befda749fe))
13
+ * switch from reactify-apps to usereactify-demo ([deb36dd](https://bitbucket.org/usereactify/reactify-search-ui/commit/deb36dddd964f89173983f7eca07e9e802c3050e))
14
+
15
+ ### [5.2.2-beta.0](https://bitbucket.org/usereactify/reactify-search-ui/compare/beta-v5.2.1-beta.1...beta-v5.2.2-beta.0) (2022-09-08)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * fix storybook config ([b748e78](https://bitbucket.org/usereactify/reactify-search-ui/commit/b748e7845e17c52cd141401bb24bc3fe85e1a3bd))
21
+ * rs-306 add includeFields and excludeFields to ReactiveListProps ([5531b81](https://bitbucket.org/usereactify/reactify-search-ui/commit/5531b81f8305eee862d3124d691619203162f7bd))
22
+ * rs-306 teeny cleanup when getting fields from context options ([a4bae10](https://bitbucket.org/usereactify/reactify-search-ui/commit/a4bae10652702a3328a50a56cea106befda749fe))
23
+ * search results not updating when removing or clearing search term ([bc2a947](https://bitbucket.org/usereactify/reactify-search-ui/commit/bc2a947193c61b8dc202d2ca301b36c7498b9d52))
24
+ * switch from reactify-apps to usereactify-demo ([deb36dd](https://bitbucket.org/usereactify/reactify-search-ui/commit/deb36dddd964f89173983f7eca07e9e802c3050e))
25
+
5
26
  ### [5.2.1](https://bitbucket.org/usereactify/reactify-search-ui/compare/release-v5.2.0...release-v5.2.1) (2022-08-11)
6
27
 
7
28
 
package/dist/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": "5.2.1-beta.1",
4
+ "version": "5.2.2",
5
5
  "license": "MIT",
6
6
  "main": "dist/src/index.js",
7
7
  "types": "dist/src/index.d.ts",
@@ -48,13 +48,16 @@
48
48
  },
49
49
  "devDependencies": {
50
50
  "@appbaseio/reactivesearch": "^3.14.0",
51
+ "@babel/plugin-transform-typescript": "7.18.12",
51
52
  "@commitlint/cli": "13.2.0",
52
53
  "@commitlint/config-conventional": "13.2.0",
53
54
  "@sentry/cli": "2.5.0",
54
- "@storybook/addon-actions": "6.3.10",
55
- "@storybook/addon-essentials": "6.3.10",
56
- "@storybook/addon-links": "6.3.10",
57
- "@storybook/react": "6.3.10",
55
+ "@storybook/addon-actions": "6.5.10",
56
+ "@storybook/addon-docs": "6.5.10",
57
+ "@storybook/addon-essentials": "6.5.10",
58
+ "@storybook/addon-links": "6.5.10",
59
+ "@storybook/components": "6.5.10",
60
+ "@storybook/react": "6.5.10",
58
61
  "@types/debug": "4.1.7",
59
62
  "@types/react": "17.0.27",
60
63
  "babel-loader": "8.2.2",
@@ -7,7 +7,7 @@ exports.ExampleCustomComponent = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const components_1 = require("../../components");
9
9
  const ExampleCustomComponent = () => {
10
- return (react_1.default.createElement(components_1.ReactifySearchProvider, { mode: "search", shopifyPermanentDomain: "reactify-apps.myshopify.com", additionalComponentIds: ["SensorSpecialProduct"] },
10
+ return (react_1.default.createElement(components_1.ReactifySearchProvider, { mode: "search", shopifyPermanentDomain: "usereactify-demo.myshopify.com", additionalComponentIds: ["SensorSpecialProduct"] },
11
11
  react_1.default.createElement(components_1.CustomComponent, { componentId: "SensorSpecialProduct", customQuery: () => ({
12
12
  query: {
13
13
  match: {
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleCustomComponent.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleCustomComponent.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA2E;AAEpE,MAAM,sBAAsB,GAAa,GAAG,EAAE;IACnD,OAAO,CACL,8BAAC,mCAAsB,IACrB,IAAI,EAAC,QAAQ,EACb,sBAAsB,EAAC,6BAA6B,EACpD,sBAAsB,EAAE,CAAC,sBAAsB,CAAC;QAEhD,8BAAC,4BAAe,IACd,WAAW,EAAC,sBAAsB,EAClC,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;gBAClB,KAAK,EAAE;oBACL,KAAK,EAAE;wBACL,YAAY,EAAE,iBAAiB;qBAChC;iBACF;aACF,CAAC,GACF,CACqB,CAC1B,CAAC;AACJ,CAAC,CAAC;AAnBW,QAAA,sBAAsB,0BAmBjC","sourcesContent":["import React from \"react\";\n\nimport { ReactifySearchProvider, CustomComponent } from \"../../components\";\n\nexport const ExampleCustomComponent: React.FC = () => {\n return (\n <ReactifySearchProvider\n mode=\"search\"\n shopifyPermanentDomain=\"reactify-apps.myshopify.com\"\n additionalComponentIds={[\"SensorSpecialProduct\"]}\n >\n <CustomComponent\n componentId=\"SensorSpecialProduct\"\n customQuery={() => ({\n query: {\n match: {\n product_type: \"Special Product\",\n },\n },\n })}\n />\n </ReactifySearchProvider>\n );\n};\n"]}
1
+ {"version":3,"file":"ExampleCustomComponent.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleCustomComponent.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA2E;AAEpE,MAAM,sBAAsB,GAAa,GAAG,EAAE;IACnD,OAAO,CACL,8BAAC,mCAAsB,IACrB,IAAI,EAAC,QAAQ,EACb,sBAAsB,EAAC,gCAAgC,EACvD,sBAAsB,EAAE,CAAC,sBAAsB,CAAC;QAEhD,8BAAC,4BAAe,IACd,WAAW,EAAC,sBAAsB,EAClC,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;gBAClB,KAAK,EAAE;oBACL,KAAK,EAAE;wBACL,YAAY,EAAE,iBAAiB;qBAChC;iBACF;aACF,CAAC,GACF,CACqB,CAC1B,CAAC;AACJ,CAAC,CAAC;AAnBW,QAAA,sBAAsB,0BAmBjC","sourcesContent":["import React from \"react\";\n\nimport { ReactifySearchProvider, CustomComponent } from \"../../components\";\n\nexport const ExampleCustomComponent: React.FC = () => {\n return (\n <ReactifySearchProvider\n mode=\"search\"\n shopifyPermanentDomain=\"usereactify-demo.myshopify.com\"\n additionalComponentIds={[\"SensorSpecialProduct\"]}\n >\n <CustomComponent\n componentId=\"SensorSpecialProduct\"\n customQuery={() => ({\n query: {\n match: {\n product_type: \"Special Product\",\n },\n },\n })}\n />\n </ReactifySearchProvider>\n );\n};\n"]}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ExampleReactiveSearchProviderCollection = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const components_1 = require("../../components");
9
- const ExampleReactiveSearchProviderCollection = () => (react_1.default.createElement(components_1.ReactifySearchProvider, { mode: "collection", shopifyPermanentDomain: "reactify-apps.myshopify.com", collectionHandle: "example-collection" },
9
+ const ExampleReactiveSearchProviderCollection = () => (react_1.default.createElement(components_1.ReactifySearchProvider, { mode: "collection", shopifyPermanentDomain: "usereactify-demo.myshopify.com", collectionHandle: "example-collection" },
10
10
  react_1.default.createElement(react_1.default.Fragment, null)));
11
11
  exports.ExampleReactiveSearchProviderCollection = ExampleReactiveSearchProviderCollection;
12
12
  //# sourceMappingURL=ExampleReactiveSearchProviderCollection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleReactiveSearchProviderCollection.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleReactiveSearchProviderCollection.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA0D;AAEnD,MAAM,uCAAuC,GAAa,GAAG,EAAE,CAAC,CACrE,8BAAC,mCAAsB,IACrB,IAAI,EAAC,YAAY,EACjB,sBAAsB,EAAC,6BAA6B,EACpD,gBAAgB,EAAC,oBAAoB;IAErC,6DAAK,CACkB,CAC1B,CAAC;AARW,QAAA,uCAAuC,2CAQlD","sourcesContent":["import React from \"react\";\n\nimport { ReactifySearchProvider } from \"../../components\";\n\nexport const ExampleReactiveSearchProviderCollection: React.FC = () => (\n <ReactifySearchProvider\n mode=\"collection\"\n shopifyPermanentDomain=\"reactify-apps.myshopify.com\"\n collectionHandle=\"example-collection\"\n >\n <></>\n </ReactifySearchProvider>\n);\n"]}
1
+ {"version":3,"file":"ExampleReactiveSearchProviderCollection.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleReactiveSearchProviderCollection.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA0D;AAEnD,MAAM,uCAAuC,GAAa,GAAG,EAAE,CAAC,CACrE,8BAAC,mCAAsB,IACrB,IAAI,EAAC,YAAY,EACjB,sBAAsB,EAAC,gCAAgC,EACvD,gBAAgB,EAAC,oBAAoB;IAErC,6DAAK,CACkB,CAC1B,CAAC;AARW,QAAA,uCAAuC,2CAQlD","sourcesContent":["import React from \"react\";\n\nimport { ReactifySearchProvider } from \"../../components\";\n\nexport const ExampleReactiveSearchProviderCollection: React.FC = () => (\n <ReactifySearchProvider\n mode=\"collection\"\n shopifyPermanentDomain=\"usereactify-demo.myshopify.com\"\n collectionHandle=\"example-collection\"\n >\n <></>\n </ReactifySearchProvider>\n);\n"]}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ExampleReactiveSearchProviderInstantSearch = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const components_1 = require("../../components");
9
- const ExampleReactiveSearchProviderInstantSearch = () => (react_1.default.createElement(components_1.ReactifySearchProvider, { mode: "instant-search", shopifyPermanentDomain: "reactify-apps.myshopify.com" },
9
+ const ExampleReactiveSearchProviderInstantSearch = () => (react_1.default.createElement(components_1.ReactifySearchProvider, { mode: "instant-search", shopifyPermanentDomain: "usereactify-demo.myshopify.com" },
10
10
  react_1.default.createElement(react_1.default.Fragment, null)));
11
11
  exports.ExampleReactiveSearchProviderInstantSearch = ExampleReactiveSearchProviderInstantSearch;
12
12
  //# sourceMappingURL=ExampleReactiveSearchProviderInstantSearch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleReactiveSearchProviderInstantSearch.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleReactiveSearchProviderInstantSearch.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA0D;AAEnD,MAAM,0CAA0C,GAAa,GAAG,EAAE,CAAC,CACxE,8BAAC,mCAAsB,IACrB,IAAI,EAAC,gBAAgB,EACrB,sBAAsB,EAAC,6BAA6B;IAEpD,6DAAK,CACkB,CAC1B,CAAC;AAPW,QAAA,0CAA0C,8CAOrD","sourcesContent":["import React from \"react\";\n\nimport { ReactifySearchProvider } from \"../../components\";\n\nexport const ExampleReactiveSearchProviderInstantSearch: React.FC = () => (\n <ReactifySearchProvider\n mode=\"instant-search\"\n shopifyPermanentDomain=\"reactify-apps.myshopify.com\"\n >\n <></>\n </ReactifySearchProvider>\n);\n"]}
1
+ {"version":3,"file":"ExampleReactiveSearchProviderInstantSearch.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleReactiveSearchProviderInstantSearch.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA0D;AAEnD,MAAM,0CAA0C,GAAa,GAAG,EAAE,CAAC,CACxE,8BAAC,mCAAsB,IACrB,IAAI,EAAC,gBAAgB,EACrB,sBAAsB,EAAC,gCAAgC;IAEvD,6DAAK,CACkB,CAC1B,CAAC;AAPW,QAAA,0CAA0C,8CAOrD","sourcesContent":["import React from \"react\";\n\nimport { ReactifySearchProvider } from \"../../components\";\n\nexport const ExampleReactiveSearchProviderInstantSearch: React.FC = () => (\n <ReactifySearchProvider\n mode=\"instant-search\"\n shopifyPermanentDomain=\"usereactify-demo.myshopify.com\"\n >\n <></>\n </ReactifySearchProvider>\n);\n"]}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ExampleReactiveSearchProviderSearch = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const components_1 = require("../../components");
9
- const ExampleReactiveSearchProviderSearch = () => (react_1.default.createElement(components_1.ReactifySearchProvider, { mode: "search", shopifyPermanentDomain: "reactify-apps.myshopify.com" },
9
+ const ExampleReactiveSearchProviderSearch = () => (react_1.default.createElement(components_1.ReactifySearchProvider, { mode: "search", shopifyPermanentDomain: "usereactify-demo.myshopify.com" },
10
10
  react_1.default.createElement(react_1.default.Fragment, null)));
11
11
  exports.ExampleReactiveSearchProviderSearch = ExampleReactiveSearchProviderSearch;
12
12
  //# sourceMappingURL=ExampleReactiveSearchProviderSearch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleReactiveSearchProviderSearch.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleReactiveSearchProviderSearch.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA0D;AAEnD,MAAM,mCAAmC,GAAa,GAAG,EAAE,CAAC,CACjE,8BAAC,mCAAsB,IACrB,IAAI,EAAC,QAAQ,EACb,sBAAsB,EAAC,6BAA6B;IAEpD,6DAAK,CACkB,CAC1B,CAAC;AAPW,QAAA,mCAAmC,uCAO9C","sourcesContent":["import React from \"react\";\n\nimport { ReactifySearchProvider } from \"../../components\";\n\nexport const ExampleReactiveSearchProviderSearch: React.FC = () => (\n <ReactifySearchProvider\n mode=\"search\"\n shopifyPermanentDomain=\"reactify-apps.myshopify.com\"\n >\n <></>\n </ReactifySearchProvider>\n);\n"]}
1
+ {"version":3,"file":"ExampleReactiveSearchProviderSearch.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleReactiveSearchProviderSearch.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA0D;AAEnD,MAAM,mCAAmC,GAAa,GAAG,EAAE,CAAC,CACjE,8BAAC,mCAAsB,IACrB,IAAI,EAAC,QAAQ,EACb,sBAAsB,EAAC,gCAAgC;IAEvD,6DAAK,CACkB,CAC1B,CAAC;AAPW,QAAA,mCAAmC,uCAO9C","sourcesContent":["import React from \"react\";\n\nimport { ReactifySearchProvider } from \"../../components\";\n\nexport const ExampleReactiveSearchProviderSearch: React.FC = () => (\n <ReactifySearchProvider\n mode=\"search\"\n shopifyPermanentDomain=\"usereactify-demo.myshopify.com\"\n >\n <></>\n </ReactifySearchProvider>\n);\n"]}
@@ -26,6 +26,10 @@ export declare type ReactifySearchProviderProps = {
26
26
  };
27
27
  /** Advanced usage: Override the default ReactiveBase theme */
28
28
  theme?: Record<string, unknown>;
29
+ /** Advanced usage: Fields to include in the Elasticsearch response e.g. ["title"] */
30
+ includeFields?: string[];
31
+ /** Advanced usage: Fields to exclude from the Elasticsearch response e.g. ["variant_skus", "*price*"] */
32
+ excludeFields?: string[];
29
33
  } & ({
30
34
  mode: "search";
31
35
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"ReactifySearchProvider.js","sourceRoot":"","sources":["../../../../src/components/ReactifySearchProvider/ReactifySearchProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,sDAAwC;AAExC,uCAA+D;AAC/D,iDAAoE;AACpE,2CAAsC;AA2C/B,MAAM,sBAAsB,GAA0C,CAC3E,KAAK,EACL,EAAE;IACF,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,eAAK,CAAC,GAAG,CAAC,wBAAwB,EAAE,OAAO,EAAE,KAAK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C,QAAQ,IAAC,KAAK,EAAE,YAAY,IAChD,KAAK,CAAC,QAAQ,CACgB,CAClC,CAAC;KACH;IAED,OAAO,CACL,8BAAC,6BAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY;QACjD,8BAAC,6CAAgC,QAC9B,KAAK,CAAC,QAAQ,CACkB,CACJ,CAClC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport * as Sentry from \"@sentry/react\";\n\nimport { ReactifySearchContext, useConfig } from \"../../hooks\";\nimport { UtilityAuthenticatedReactiveBase } from \"../../components\";\nimport { debug } from \"../../utility\";\n\nexport type ReactifySearchProviderProps = {\n /** The search area the provider will be used in */\n mode: \"search\" | \"collection\" | \"instant-search\";\n /** Shopify store domain used to resolve the site configuration */\n shopifyPermanentDomain: string;\n /** Callback function for redirects, suitable for headless sites to avoid full page refresh */\n onRedirect?: (type: \"redirect\" | \"search\", url: string) => void;\n /** Render method to display a component when the config is loading */\n renderBooting?: () => JSX.Element | null;\n /** Advanced usage: Override the default Filters selection logic */\n filtersHandle?: string;\n /** Advanced usage: Allows you to wrap the ReactifySearchProvider in your own ReactiveBase component */\n noReactiveBase?: boolean;\n /** Advanced usage: Array of additional component IDs managed outside of Reactify Search */\n additionalComponentIds?: string[];\n /** Advanced usage: Override the default Elasticsearch index */\n index?: string;\n /** Advanced usage: Override the default Reactify Search config (for multi-instance stores) */\n configId?: string;\n /** Advanced usage: Override the default Elasticsearch credentials */\n credentials?: {\n username: string;\n password: string;\n endpoint: string;\n };\n /** Advanced usage: Override the default ReactiveBase theme */\n theme?: Record<string, unknown>;\n} & (\n | {\n mode: \"search\";\n }\n | {\n mode: \"collection\";\n /** Collection object that includes the handle, used to find curations */\n collectionHandle: string;\n }\n | {\n mode: \"instant-search\";\n }\n);\n\nexport const ReactifySearchProvider: React.FC<ReactifySearchProviderProps> = (\n props\n) => {\n React.useEffect(() => {\n debug.log(\"ReactifySearchProvider\", \"props\", props);\n\n Sentry.setTags({\n \"reactifysearch.index\": props.index,\n \"reactifysearch.shop\": props.shopifyPermanentDomain,\n \"reactifysearch.mode\": props.mode,\n \"reactifysearch.collection\":\n props.mode === \"collection\" ? props.collectionHandle : undefined,\n \"reactifysearch.filter\": props.filtersHandle,\n });\n }, [props]);\n\n return (\n <Sentry.ErrorBoundary fallback={<p>An error has occurred</p>}>\n <ReactifySearchInner {...props} />\n </Sentry.ErrorBoundary>\n );\n};\n\nconst ReactifySearchInner: React.FC<ReactifySearchProviderProps> = (props) => {\n const { config } = useConfig(props.shopifyPermanentDomain, props.configId);\n\n const [searchTerm, setSearchTerm] = React.useState<string>(\"\");\n const [showInstantSearchResults, setShowInstantSearchResults] =\n React.useState<boolean>(false);\n const [sortOption, setSortOption] = React.useState<string>(\"\");\n\n const credentials = props.credentials ?? {\n username: \"guest\",\n password: \"password\",\n endpoint: \"https://api.search.reactify.app\",\n };\n\n const theme = props.theme ?? {\n typography: {\n fontFamily: \"inherit\",\n fontSize: \"inherit\",\n },\n };\n\n const searchTermFromURL = React.useMemo(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n const urlParams = new URLSearchParams(window.location.search);\n return urlParams.get(\"q\") ?? undefined;\n }, [typeof window !== \"undefined\" && window.location.search]);\n\n const searchSortFromURL = React.useMemo(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n const urlParams = new URLSearchParams(window.location.search);\n return urlParams.get(\"sort\") ?? undefined;\n }, [typeof window !== \"undefined\" && window.location.search]);\n\n React.useEffect(() => {\n if (searchTermFromURL && searchTerm !== searchTermFromURL) {\n setSearchTerm(searchTermFromURL);\n }\n }, [searchTermFromURL]);\n\n React.useEffect(() => {\n if (searchSortFromURL && sortOption !== searchSortFromURL) {\n setSortOption(searchSortFromURL);\n }\n }, [searchSortFromURL]);\n\n React.useEffect(() => {\n if (typeof window == \"undefined\") {\n return;\n }\n\n if (window.location.search === \"\" && sortOption) {\n setSortOption(sortOption);\n }\n }, [typeof window !== \"undefined\" && window.location.search]);\n\n const contextValue = React.useMemo(() => {\n if (!config) {\n return;\n }\n\n return {\n config: config,\n options: {\n ...props,\n index: props.index ?? config.index,\n filtersHandle: props.filtersHandle,\n credentials: credentials,\n theme: theme,\n },\n search: {\n searchTerm: searchTerm,\n setSearchTerm: setSearchTerm,\n showInstantSearchResults: showInstantSearchResults,\n setShowInstantSearchResults: setShowInstantSearchResults,\n },\n sortby: {\n sortOption: sortOption,\n setSortOption: setSortOption,\n },\n };\n }, [config, props, searchTerm, showInstantSearchResults, sortOption]);\n\n debug.hook(\"ReactifySearchProvider\", \"context\", contextValue);\n\n if (!contextValue) {\n if (props.renderBooting) {\n return props.renderBooting();\n }\n return null;\n }\n\n if (props.noReactiveBase) {\n return (\n <ReactifySearchContext.Provider value={contextValue}>\n {props.children}\n </ReactifySearchContext.Provider>\n );\n }\n\n return (\n <ReactifySearchContext.Provider value={contextValue}>\n <UtilityAuthenticatedReactiveBase>\n {props.children}\n </UtilityAuthenticatedReactiveBase>\n </ReactifySearchContext.Provider>\n );\n};\n"]}
1
+ {"version":3,"file":"ReactifySearchProvider.js","sourceRoot":"","sources":["../../../../src/components/ReactifySearchProvider/ReactifySearchProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,sDAAwC;AAExC,uCAA+D;AAC/D,iDAAoE;AACpE,2CAAsC;AA+C/B,MAAM,sBAAsB,GAA0C,CAC3E,KAAK,EACL,EAAE;IACF,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,eAAK,CAAC,GAAG,CAAC,wBAAwB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QAEpD,MAAM,CAAC,OAAO,CAAC;YACb,sBAAsB,EAAE,KAAK,CAAC,KAAK;YACnC,qBAAqB,EAAE,KAAK,CAAC,sBAAsB;YACnD,qBAAqB,EAAE,KAAK,CAAC,IAAI;YACjC,2BAA2B,EACzB,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,KAAK,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AAC","sourcesContent":["import React from \"react\";\nimport * as Sentry from \"@sentry/react\";\n\nimport { ReactifySearchContext, useConfig } from \"../../hooks\";\nimport { UtilityAuthenticatedReactiveBase } from \"../../components\";\nimport { debug } from \"../../utility\";\n\nexport type ReactifySearchProviderProps = {\n /** The search area the provider will be used in */\n mode: \"search\" | \"collection\" | \"instant-search\";\n /** Shopify store domain used to resolve the site configuration */\n shopifyPermanentDomain: string;\n /** Callback function for redirects, suitable for headless sites to avoid full page refresh */\n onRedirect?: (type: \"redirect\" | \"search\", url: string) => void;\n /** Render method to display a component when the config is loading */\n renderBooting?: () => JSX.Element | null;\n /** Advanced usage: Override the default Filters selection logic */\n filtersHandle?: string;\n /** Advanced usage: Allows you to wrap the ReactifySearchProvider in your own ReactiveBase component */\n noReactiveBase?: boolean;\n /** Advanced usage: Array of additional component IDs managed outside of Reactify Search */\n additionalComponentIds?: string[];\n /** Advanced usage: Override the default Elasticsearch index */\n index?: string;\n /** Advanced usage: Override the default Reactify Search config (for multi-instance stores) */\n configId?: string;\n /** Advanced usage: Override the default Elasticsearch credentials */\n credentials?: {\n username: string;\n password: string;\n endpoint: string;\n };\n /** Advanced usage: Override the default ReactiveBase theme */\n theme?: Record<string, unknown>;\n /** Advanced usage: Fields to include in the Elasticsearch response e.g. [\"title\"] */\n includeFields?: string[];\n /** Advanced usage: Fields to exclude from the Elasticsearch response e.g. [\"variant_skus\", \"*price*\"] */\n excludeFields?: string[];\n} & (\n | {\n mode: \"search\";\n }\n | {\n mode: \"collection\";\n /** Collection object that includes the handle, used to find curations */\n collectionHandle: string;\n }\n | {\n mode: \"instant-search\";\n }\n);\n\nexport const ReactifySearchProvider: React.FC<ReactifySearchProviderProps> = (\n props\n) => {\n React.useEffect(() => {\n debug.log(\"ReactifySearchProvider\", \"props\", props);\n\n Sentry.setTags({\n \"reactifysearch.index\": props.index,\n \"reactifysearch.shop\": props.shopifyPermanentDomain,\n \"reactifysearch.mode\": props.mode,\n \"reactifysearch.collection\":\n props.mode === \"collection\" ? props.collectionHandle : undefined,\n \"reactifysearch.filter\": props.filtersHandle,\n });\n }, [props]);\n\n return (\n <Sentry.ErrorBoundary fallback={<p>An error has occurred</p>}>\n <ReactifySearchInner {...props} />\n </Sentry.ErrorBoundary>\n );\n};\n\nconst ReactifySearchInner: React.FC<ReactifySearchProviderProps> = (props) => {\n const { config } = useConfig(props.shopifyPermanentDomain, props.configId);\n\n const [searchTerm, setSearchTerm] = React.useState<string>(\"\");\n const [showInstantSearchResults, setShowInstantSearchResults] =\n React.useState<boolean>(false);\n const [sortOption, setSortOption] = React.useState<string>(\"\");\n\n const credentials = props.credentials ?? {\n username: \"guest\",\n password: \"password\",\n endpoint: \"https://api.search.reactify.app\",\n };\n\n const theme = props.theme ?? {\n typography: {\n fontFamily: \"inherit\",\n fontSize: \"inherit\",\n },\n };\n\n const searchTermFromURL = React.useMemo(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n const urlParams = new URLSearchParams(window.location.search);\n return urlParams.get(\"q\") ?? undefined;\n }, [typeof window !== \"undefined\" && window.location.search]);\n\n const searchSortFromURL = React.useMemo(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n const urlParams = new URLSearchParams(window.location.search);\n return urlParams.get(\"sort\") ?? undefined;\n }, [typeof window !== \"undefined\" && window.location.search]);\n\n React.useEffect(() => {\n if (searchTermFromURL && searchTerm !== searchTermFromURL) {\n setSearchTerm(searchTermFromURL);\n }\n }, [searchTermFromURL]);\n\n React.useEffect(() => {\n if (searchSortFromURL && sortOption !== searchSortFromURL) {\n setSortOption(searchSortFromURL);\n }\n }, [searchSortFromURL]);\n\n React.useEffect(() => {\n if (typeof window == \"undefined\") {\n return;\n }\n\n if (window.location.search === \"\" && sortOption) {\n setSortOption(sortOption);\n }\n }, [typeof window !== \"undefined\" && window.location.search]);\n\n const contextValue = React.useMemo(() => {\n if (!config) {\n return;\n }\n\n return {\n config: config,\n options: {\n ...props,\n index: props.index ?? config.index,\n filtersHandle: props.filtersHandle,\n credentials: credentials,\n theme: theme,\n },\n search: {\n searchTerm: searchTerm,\n setSearchTerm: setSearchTerm,\n showInstantSearchResults: showInstantSearchResults,\n setShowInstantSearchResults: setShowInstantSearchResults,\n },\n sortby: {\n sortOption: sortOption,\n setSortOption: setSortOption,\n },\n };\n }, [config, props, searchTerm, showInstantSearchResults, sortOption]);\n\n debug.hook(\"ReactifySearchProvider\", \"context\", contextValue);\n\n if (!contextValue) {\n if (props.renderBooting) {\n return props.renderBooting();\n }\n return null;\n }\n\n if (props.noReactiveBase) {\n return (\n <ReactifySearchContext.Provider value={contextValue}>\n {props.children}\n </ReactifySearchContext.Provider>\n );\n }\n\n return (\n <ReactifySearchContext.Provider value={contextValue}>\n <UtilityAuthenticatedReactiveBase>\n {props.children}\n </UtilityAuthenticatedReactiveBase>\n </ReactifySearchContext.Provider>\n );\n};\n"]}
@@ -10,6 +10,8 @@ const useReactiveReactProp_1 = require("./useReactiveReactProp");
10
10
  const useReactiveReactiveListProps = (options) => {
11
11
  const { filterStack } = (0, hooks_1.useFilters)();
12
12
  const reactiveReactProp = (0, useReactiveReactProp_1.useReactiveReactProp)();
13
+ const context = (0, hooks_1.useReactifySearchContext)();
14
+ const { includeFields, excludeFields } = context.options;
13
15
  const size = react_1.default.useMemo(() => {
14
16
  var _a, _b;
15
17
  return (_b = (_a = options.pageSize) !== null && _a !== void 0 ? _a : filterStack === null || filterStack === void 0 ? void 0 : filterStack.pageSize) !== null && _b !== void 0 ? _b : 20;
@@ -21,6 +23,8 @@ const useReactiveReactiveListProps = (options) => {
21
23
  dataField: "title",
22
24
  showResultStats: false,
23
25
  react: reactiveReactProp,
26
+ includeFields,
27
+ excludeFields,
24
28
  componentId: "page",
25
29
  scrollOnChange: false,
26
30
  pagination: (filterStack === null || filterStack === void 0 ? void 0 : filterStack.paginationType) !== "infinite_scroll",
@@ -1 +1 @@
1
- {"version":3,"file":"useReactiveReactiveListProps.js","sourceRoot":"","sources":["../../../../src/hooks/reactivesearch/useReactiveReactiveListProps.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,uCAAyC;AACzC,iEAA8D;AAEvD,MAAM,4BAA4B,GAAG,CAAC,OAE5C,EAA6C,EAAE;IAC9C,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,kBAAU,GAAE,CAAC;IACrC,MAAM,iBAAiB,GAAG,IAAA,2CAAoB,GAAE,CAAC;IAEjD,MAAM,IAAI,GAAG,eAAK,CAAC,OAAO,CAAC,GAAG,EAAE;;QAC9B,OAAO,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,QAAQ,mCAAI,EAAE,CAAC;IACzD,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;IAEpC,MAAM,yBAAyB,GAAG,eAAK,CAAC,OAAO,CAC7C,GAAG,EAAE,CAAC,CAAC;QACL,IAAI;QACJ,SAAS,EAAE,IAAI;QACf,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,OAAO;QAClB,eAAe,EAAE,KAAK;QACtB,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,MAAM;QACnB,cAAc,EAAE,KAAK;QACrB,UAAU,EAAE,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,MAAK,iBAAiB;QAC7D,cAAc,EAAE,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,MAAK,iBAAiB;QACjE,eAAe,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,mDAAmD;KACjF,CAAC,EACF,CAAC,WAAW,EAAE,iBAAiB,EAAE,OAAO,CAAC,QAAQ,CAAC,CACnD,CAAC;IAEF,OAAO,yBAAyB,CAAC;AACnC,CAAC,CAAC;AA5BW,QAAA,4BAA4B,gCA4BvC","sourcesContent":["import React from \"react\";\nimport ReactiveList from \"@appbaseio/reactivesearch/lib/components/result/ReactiveList\";\n\nimport { useFilters } from \"../../hooks\";\nimport { useReactiveReactProp } from \"./useReactiveReactProp\";\n\nexport const useReactiveReactiveListProps = (options: {\n pageSize?: number;\n}): React.ComponentProps<typeof ReactiveList> => {\n const { filterStack } = useFilters();\n const reactiveReactProp = useReactiveReactProp();\n\n const size = React.useMemo(() => {\n return options.pageSize ?? filterStack?.pageSize ?? 20;\n }, [options.pageSize, filterStack]);\n\n const reactiveReactiveListProps = React.useMemo(\n () => ({\n size,\n URLParams: true,\n showLoader: false,\n dataField: \"title\",\n showResultStats: false,\n react: reactiveReactProp,\n componentId: \"page\", // this sets ?page= in the URL\n scrollOnChange: false, // @todo make this better, it's really janky when enabled\n pagination: filterStack?.paginationType !== \"infinite_scroll\",\n infiniteScroll: filterStack?.paginationType === \"infinite_scroll\",\n renderNoResults: () => null, // always use only render, otherwise both are shown\n }),\n [filterStack, reactiveReactProp, options.pageSize]\n );\n\n return reactiveReactiveListProps;\n};\n"]}
1
+ {"version":3,"file":"useReactiveReactiveListProps.js","sourceRoot":"","sources":["../../../../src/hooks/reactivesearch/useReactiveReactiveListProps.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,uCAAmE;AACnE,iEAA8D;AAEvD,MAAM,4BAA4B,GAAG,CAAC,OAE5C,EAA6C,EAAE;IAC9C,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,kBAAU,GAAE,CAAC;IACrC,MAAM,iBAAiB,GAAG,IAAA,2CAAoB,GAAE,CAAC;IACjD,MAAM,OAAO,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAC3C,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAEzD,MAAM,IAAI,GAAG,eAAK,CAAC,OAAO,CAAC,GAAG,EAAE;;QAC9B,OAAO,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,QAAQ,mCAAI,EAAE,CAAC;IACzD,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;IAEpC,MAAM,yBAAyB,GAAG,eAAK,CAAC,OAAO,CAC7C,GAAG,EAAE,CAAC,CAAC;QACL,IAAI;QACJ,SAAS,EAAE,IAAI;QACf,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,OAAO;QAClB,eAAe,EAAE,KAAK;QACtB,KAAK,EAAE,iBAAiB;QACxB,aAAa;QACb,aAAa;QACb,WAAW,EAAE,MAAM;QACnB,cAAc,EAAE,KAAK;QACrB,UAAU,EAAE,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,MAAK,iBAAiB;QAC7D,cAAc,EAAE,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,MAAK,iBAAiB;QACjE,eAAe,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,mDAAmD;KACjF,CAAC,EACF,CAAC,WAAW,EAAE,iBAAiB,EAAE,OAAO,CAAC,QAAQ,CAAC,CACnD,CAAC;IAEF,OAAO,yBAAyB,CAAC;AACnC,CAAC,CAAC;AAhCW,QAAA,4BAA4B,gCAgCvC","sourcesContent":["import React from \"react\";\nimport ReactiveList from \"@appbaseio/reactivesearch/lib/components/result/ReactiveList\";\n\nimport { useFilters, useReactifySearchContext } from \"../../hooks\";\nimport { useReactiveReactProp } from \"./useReactiveReactProp\";\n\nexport const useReactiveReactiveListProps = (options: {\n pageSize?: number;\n}): React.ComponentProps<typeof ReactiveList> => {\n const { filterStack } = useFilters();\n const reactiveReactProp = useReactiveReactProp();\n const context = useReactifySearchContext();\n const { includeFields, excludeFields } = context.options;\n\n const size = React.useMemo(() => {\n return options.pageSize ?? filterStack?.pageSize ?? 20;\n }, [options.pageSize, filterStack]);\n\n const reactiveReactiveListProps = React.useMemo(\n () => ({\n size,\n URLParams: true,\n showLoader: false,\n dataField: \"title\",\n showResultStats: false,\n react: reactiveReactProp,\n includeFields,\n excludeFields,\n componentId: \"page\", // this sets ?page= in the URL\n scrollOnChange: false, // @todo make this better, it's really janky when enabled\n pagination: filterStack?.paginationType !== \"infinite_scroll\",\n infiniteScroll: filterStack?.paginationType === \"infinite_scroll\",\n renderNoResults: () => null, // always use only render, otherwise both are shown\n }),\n [filterStack, reactiveReactProp, options.pageSize]\n );\n\n return reactiveReactiveListProps;\n};\n"]}
@@ -15,6 +15,8 @@ export declare const ReactifySearchContext: React.Context<{
15
15
  onRedirect?: ((type: "redirect" | "search", url: string) => void) | undefined;
16
16
  theme: Record<string, unknown>;
17
17
  additionalComponentIds?: string[] | undefined;
18
+ includeFields?: string[] | undefined;
19
+ excludeFields?: string[] | undefined;
18
20
  } & ({
19
21
  mode: "search";
20
22
  } | {
@@ -49,6 +51,8 @@ export declare const useReactifySearchContext: () => {
49
51
  onRedirect?: ((type: "redirect" | "search", url: string) => void) | undefined;
50
52
  theme: Record<string, unknown>;
51
53
  additionalComponentIds?: string[] | undefined;
54
+ includeFields?: string[] | undefined;
55
+ excludeFields?: string[] | undefined;
52
56
  } & ({
53
57
  mode: "search";
54
58
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"useReactifySearchContext.js","sourceRoot":"","sources":["../../../src/hooks/useReactifySearchContext.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAIb,QAAA,qBAAqB,GAAG,eAAK,CAAC,aAAa,CA0CtD,SAAS,CAAC,CAAC;AAEN,MAAM,wBAAwB,GAAG,GAAG,EAAE,CAC3C,eAAK,CAAC,UAAU,CAAC,6BAAqB,CAAE,CAAC;AAD9B,QAAA,wBAAwB,4BACM","sourcesContent":["import React from \"react\";\n\nimport { Config } from \"../types\";\n\nexport const ReactifySearchContext = React.createContext<\n | {\n config: Config;\n options: {\n mode: \"search\" | \"collection\" | \"instant-search\";\n index: string;\n shopifyPermanentDomain: string;\n filtersHandle?: string;\n credentials: {\n username: string;\n password: string;\n endpoint: string;\n };\n onRedirect?: (type: \"redirect\" | \"search\", url: string) => void;\n theme: Record<string, unknown>;\n additionalComponentIds?: Array<string>;\n } & (\n | {\n mode: \"search\";\n }\n | {\n mode: \"collection\";\n collectionHandle: string;\n }\n | {\n mode: \"instant-search\";\n }\n );\n search: {\n searchTerm: string;\n setSearchTerm: React.Dispatch<React.SetStateAction<string>>;\n showInstantSearchResults: boolean;\n setShowInstantSearchResults: React.Dispatch<\n React.SetStateAction<boolean>\n >;\n };\n sortby: {\n sortOption: string;\n setSortOption: React.Dispatch<React.SetStateAction<string>>;\n };\n }\n | undefined\n>(undefined);\n\nexport const useReactifySearchContext = () =>\n React.useContext(ReactifySearchContext)!;\n"]}
1
+ {"version":3,"file":"useReactifySearchContext.js","sourceRoot":"","sources":["../../../src/hooks/useReactifySearchContext.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAIb,QAAA,qBAAqB,GAAG,eAAK,CAAC,aAAa,CA4CtD,SAAS,CAAC,CAAC;AAEN,MAAM,wBAAwB,GAAG,GAAG,EAAE,CAC3C,eAAK,CAAC,UAAU,CAAC,6BAAqB,CAAE,CAAC;AAD9B,QAAA,wBAAwB,4BACM","sourcesContent":["import React from \"react\";\n\nimport { Config } from \"../types\";\n\nexport const ReactifySearchContext = React.createContext<\n | {\n config: Config;\n options: {\n mode: \"search\" | \"collection\" | \"instant-search\";\n index: string;\n shopifyPermanentDomain: string;\n filtersHandle?: string;\n credentials: {\n username: string;\n password: string;\n endpoint: string;\n };\n onRedirect?: (type: \"redirect\" | \"search\", url: string) => void;\n theme: Record<string, unknown>;\n additionalComponentIds?: Array<string>;\n includeFields?: Array<string>;\n excludeFields?: Array<string>;\n } & (\n | {\n mode: \"search\";\n }\n | {\n mode: \"collection\";\n collectionHandle: string;\n }\n | {\n mode: \"instant-search\";\n }\n );\n search: {\n searchTerm: string;\n setSearchTerm: React.Dispatch<React.SetStateAction<string>>;\n showInstantSearchResults: boolean;\n setShowInstantSearchResults: React.Dispatch<\n React.SetStateAction<boolean>\n >;\n };\n sortby: {\n sortOption: string;\n setSortOption: React.Dispatch<React.SetStateAction<string>>;\n };\n }\n | undefined\n>(undefined);\n\nexport const useReactifySearchContext = () =>\n React.useContext(ReactifySearchContext)!;\n"]}
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": "5.2.1",
4
+ "version": "5.2.2",
5
5
  "license": "MIT",
6
6
  "main": "dist/src/index.js",
7
7
  "types": "dist/src/index.d.ts",
@@ -48,13 +48,16 @@
48
48
  },
49
49
  "devDependencies": {
50
50
  "@appbaseio/reactivesearch": "^3.14.0",
51
+ "@babel/plugin-transform-typescript": "7.18.12",
51
52
  "@commitlint/cli": "13.2.0",
52
53
  "@commitlint/config-conventional": "13.2.0",
53
54
  "@sentry/cli": "2.5.0",
54
- "@storybook/addon-actions": "6.3.10",
55
- "@storybook/addon-essentials": "6.3.10",
56
- "@storybook/addon-links": "6.3.10",
57
- "@storybook/react": "6.3.10",
55
+ "@storybook/addon-actions": "6.5.10",
56
+ "@storybook/addon-docs": "6.5.10",
57
+ "@storybook/addon-essentials": "6.5.10",
58
+ "@storybook/addon-links": "6.5.10",
59
+ "@storybook/components": "6.5.10",
60
+ "@storybook/react": "6.5.10",
58
61
  "@types/debug": "4.1.7",
59
62
  "@types/react": "17.0.27",
60
63
  "babel-loader": "8.2.2",