@usereactify/search 5.10.0-beta.1 → 5.10.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
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.10.1](https://bitbucket.org/usereactify/reactify-search-ui/compare/release-v5.10.0...release-v5.10.1) (2022-10-21)
6
+
7
+ ## [5.10.0](https://bitbucket.org/usereactify/reactify-search-ui/compare/release-v5.9.0...release-v5.10.0) (2022-10-21)
8
+
9
+
10
+ ### Features
11
+
12
+ * add prefix and suffix to filter slider labels ([0eba7c2](https://bitbucket.org/usereactify/reactify-search-ui/commit/0eba7c29dd5590c1dbee7dbcaefaaf9b3cb1c886))
13
+ * get intial slider value from URL search params ([98e5ec1](https://bitbucket.org/usereactify/reactify-search-ui/commit/98e5ec1c50735e33aea56a299557823bdec8f659))
14
+ * implement custom slider filter logic ([f5ecc3a](https://bitbucket.org/usereactify/reactify-search-ui/commit/f5ecc3ae8c5e19db61b7ffbe9be4de3401c4e85c))
15
+ * improve example slider styling ([02763a6](https://bitbucket.org/usereactify/reactify-search-ui/commit/02763a6f6f9f2ce6103bf76a343f1d29d0aa484c))
16
+ * improve selected filter labels ([0612f46](https://bitbucket.org/usereactify/reactify-search-ui/commit/0612f46cc136ac447552586251bcb71a7853eea3))
17
+ * improve styling of example slider component ([1dd42dd](https://bitbucket.org/usereactify/reactify-search-ui/commit/1dd42dd6c5c4b409e538600add1074f6a114ab8e))
18
+ * use zillow react-slider as example slider ([3be008f](https://bitbucket.org/usereactify/reactify-search-ui/commit/3be008f69d75ed5620c9b1894aa103ad5a263493))
19
+
5
20
  ## [5.10.0-beta.1](https://bitbucket.org/usereactify/reactify-search-ui/compare/beta-v5.10.0-beta.0...beta-v5.10.0-beta.1) (2022-10-21)
6
21
 
7
22
 
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.10.0-beta.1",
4
+ "version": "5.10.1",
5
5
  "license": "MIT",
6
6
  "main": "dist/src/index.js",
7
7
  "types": "dist/src/index.d.ts",
@@ -27,7 +27,7 @@ const ExampleFilterSlider = (props) => {
27
27
  react_1.default.createElement("span", { style: {
28
28
  position: "absolute",
29
29
  top: "-24px",
30
- left: "0",
30
+ left: "-50%",
31
31
  } },
32
32
  props.filter.displaySliderPrefix,
33
33
  state.valueNow,
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleFilterSlider.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterSlider.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,gEAAuC;AAOhC,MAAM,mBAAmB,GAAuC,CACrE,KAAK,EACL,EAAE;IACF,MAAM,cAAc,GAAG;QACrB,GAAG,EAAE,MAAM;QACX,MAAM,EAAE,KAAK;QACb,UAAU,EAAE,oBAAoB;QAChC,MAAM,EAAE,8BAA8B;QACtC,YAAY,EAAE,KAAK;KACpB,CAAC;IACF,MAAM,gBAAgB,mCACjB,cAAc,KACjB,UAAU,EAAE,kBAAkB,EAC9B,MAAM,EAAE,6BAA6B,GACtC,CAAC;IAEF,OAAO,CACL,uCAAK,SAAS,EAAC,YAAY;QACzB,sCAAI,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAM;QACzD,uCACE,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAE;gBACL,QAAQ,EAAE,OAAO;gBACjB,MAAM,EAAE,MAAM;gBACd,MAAM,EAAE,MAAM;gBACd,GAAG,EAAE,KAAK;aACX;YAED,8BAAC,sBAAW,kBACV,cAAc,EAAC,2BAA2B,IACtC,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,IAC5C,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC7B,uDACM,KAAK,IACT,KAAK,kCACA,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,cAAc,CAAC,GACvD,KAAK,CAAC,KAAK,KAEX,CACR,EACD,WAAW,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE,CAAC,CACnC,uDACM,WAAW,IACf,KAAK,kBACH,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,kBAAkB,EAC9B,GAAG,EAAE,KAAK,EACV,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,IACZ,WAAW,CAAC,KAAK;oBAGtB,wCACE,KAAK,EAAE;4BACL,QAAQ,EAAE,UAAU;4BACpB,GAAG,EAAE,OAAO;4BACZ,IAAI,EAAE,GAAG;yBACV;wBAEA,KAAK,CAAC,MAAM,CAAC,mBAAmB;wBAChC,KAAK,CAAC,QAAQ;wBACd,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAC5B,CACH,CACP,IACD,CACE,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAvEW,QAAA,mBAAmB,uBAuE9B","sourcesContent":["import React from \"react\";\nimport ReactSlider from \"react-slider\";\nimport { FilterProps } from \"../../components\";\n\nexport type ExampleFilterSliderProps = React.ComponentProps<\n NonNullable<FilterProps[\"renderFilterSlider\"]>\n>;\n\nexport const ExampleFilterSlider: React.FC<ExampleFilterSliderProps> = (\n props\n) => {\n const trackStyleEnds = {\n top: \"10px\",\n height: \"8px\",\n background: \"rgb(239, 239, 239)\",\n border: \"1px solid rgb(179, 179, 179)\",\n borderRadius: \"4px\",\n };\n const trackStyleMiddle = {\n ...trackStyleEnds,\n background: \"rgb(2, 117, 255)\",\n border: \"1px solid rgb(74, 117, 187)\",\n };\n\n return (\n <div className=\"rs__filter\">\n <h3 className=\"rs__filter__name\">{props.filter.name}</h3>\n <div\n className=\"rs__filter__slider\"\n style={{\n maxWidth: \"300px\",\n height: \"26px\",\n margin: \"auto\",\n top: \"6px\",\n }}\n >\n <ReactSlider\n thumbClassName=\"rs__filter__slider__thumb\"\n {...props.filterSliderProps.reactSliderProps}\n renderTrack={(props, state) => (\n <div\n {...props}\n style={{\n ...(state.index === 1 ? trackStyleMiddle : trackStyleEnds),\n ...props.style,\n }}\n ></div>\n )}\n renderThumb={(renderProps, state) => (\n <div\n {...renderProps}\n style={{\n cursor: \"grab\",\n background: \"rgb(2, 117, 255)\",\n top: \"6px\",\n width: \"16px\",\n height: \"16px\",\n borderRadius: \"100%\",\n outline: \"none\",\n ...renderProps.style,\n }}\n >\n <span\n style={{\n position: \"absolute\",\n top: \"-24px\",\n left: \"0\",\n }}\n >\n {props.filter.displaySliderPrefix}\n {state.valueNow}\n {props.filter.displaySliderSuffix}\n </span>\n </div>\n )}\n />\n </div>\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"ExampleFilterSlider.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterSlider.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,gEAAuC;AAOhC,MAAM,mBAAmB,GAAuC,CACrE,KAAK,EACL,EAAE;IACF,MAAM,cAAc,GAAG;QACrB,GAAG,EAAE,MAAM;QACX,MAAM,EAAE,KAAK;QACb,UAAU,EAAE,oBAAoB;QAChC,MAAM,EAAE,8BAA8B;QACtC,YAAY,EAAE,KAAK;KACpB,CAAC;IACF,MAAM,gBAAgB,mCACjB,cAAc,KACjB,UAAU,EAAE,kBAAkB,EAC9B,MAAM,EAAE,6BAA6B,GACtC,CAAC;IAEF,OAAO,CACL,uCAAK,SAAS,EAAC,YAAY;QACzB,sCAAI,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAM;QACzD,uCACE,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAE;gBACL,QAAQ,EAAE,OAAO;gBACjB,MAAM,EAAE,MAAM;gBACd,MAAM,EAAE,MAAM;gBACd,GAAG,EAAE,KAAK;aACX;YAED,8BAAC,sBAAW,kBACV,cAAc,EAAC,2BAA2B,IACtC,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,IAC5C,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC7B,uDACM,KAAK,IACT,KAAK,kCACA,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,cAAc,CAAC,GACvD,KAAK,CAAC,KAAK,KAEX,CACR,EACD,WAAW,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE,CAAC,CACnC,uDACM,WAAW,IACf,KAAK,kBACH,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,kBAAkB,EAC9B,GAAG,EAAE,KAAK,EACV,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,IACZ,WAAW,CAAC,KAAK;oBAGtB,wCACE,KAAK,EAAE;4BACL,QAAQ,EAAE,UAAU;4BACpB,GAAG,EAAE,OAAO;4BACZ,IAAI,EAAE,MAAM;yBACb;wBAEA,KAAK,CAAC,MAAM,CAAC,mBAAmB;wBAChC,KAAK,CAAC,QAAQ;wBACd,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAC5B,CACH,CACP,IACD,CACE,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAvEW,QAAA,mBAAmB,uBAuE9B","sourcesContent":["import React from \"react\";\nimport ReactSlider from \"react-slider\";\nimport { FilterProps } from \"../../components\";\n\nexport type ExampleFilterSliderProps = React.ComponentProps<\n NonNullable<FilterProps[\"renderFilterSlider\"]>\n>;\n\nexport const ExampleFilterSlider: React.FC<ExampleFilterSliderProps> = (\n props\n) => {\n const trackStyleEnds = {\n top: \"10px\",\n height: \"8px\",\n background: \"rgb(239, 239, 239)\",\n border: \"1px solid rgb(179, 179, 179)\",\n borderRadius: \"4px\",\n };\n const trackStyleMiddle = {\n ...trackStyleEnds,\n background: \"rgb(2, 117, 255)\",\n border: \"1px solid rgb(74, 117, 187)\",\n };\n\n return (\n <div className=\"rs__filter\">\n <h3 className=\"rs__filter__name\">{props.filter.name}</h3>\n <div\n className=\"rs__filter__slider\"\n style={{\n maxWidth: \"300px\",\n height: \"26px\",\n margin: \"auto\",\n top: \"6px\",\n }}\n >\n <ReactSlider\n thumbClassName=\"rs__filter__slider__thumb\"\n {...props.filterSliderProps.reactSliderProps}\n renderTrack={(props, state) => (\n <div\n {...props}\n style={{\n ...(state.index === 1 ? trackStyleMiddle : trackStyleEnds),\n ...props.style,\n }}\n ></div>\n )}\n renderThumb={(renderProps, state) => (\n <div\n {...renderProps}\n style={{\n cursor: \"grab\",\n background: \"rgb(2, 117, 255)\",\n top: \"6px\",\n width: \"16px\",\n height: \"16px\",\n borderRadius: \"100%\",\n outline: \"none\",\n ...renderProps.style,\n }}\n >\n <span\n style={{\n position: \"absolute\",\n top: \"-24px\",\n left: \"-50%\",\n }}\n >\n {props.filter.displaySliderPrefix}\n {state.valueNow}\n {props.filter.displaySliderSuffix}\n </span>\n </div>\n )}\n />\n </div>\n </div>\n );\n};\n"]}
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const ExampleHookUseResults: React.FC;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ExampleHookUseResults = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const hooks_1 = require("../../hooks");
9
+ const types_1 = require("../../types");
10
+ const ExampleHookUseResults = () => {
11
+ const resultsHook = (0, hooks_1.useResults)();
12
+ const collections = resultsHook.results
13
+ .map((result) => {
14
+ if (result.type === types_1.ElasticDocumentType.Product) {
15
+ return result.collections;
16
+ }
17
+ return [];
18
+ })
19
+ .flat()
20
+ .filter((item, index, self) => self.findIndex((itemNested) => (itemNested === null || itemNested === void 0 ? void 0 : itemNested.id) === (item === null || item === void 0 ? void 0 : item.id)) === index);
21
+ return (react_1.default.createElement("ul", null, collections.map((collection) => (react_1.default.createElement("li", null,
22
+ react_1.default.createElement("a", { href: `/collections/${collection === null || collection === void 0 ? void 0 : collection.handle}` }, collection === null || collection === void 0 ? void 0 : collection.title))))));
23
+ };
24
+ exports.ExampleHookUseResults = ExampleHookUseResults;
25
+ //# sourceMappingURL=ExampleHookUseResults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExampleHookUseResults.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleHookUseResults.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAAyC;AACzC,uCAAkD;AAE3C,MAAM,qBAAqB,GAAa,GAAG,EAAE;IAClD,MAAM,WAAW,GAAG,IAAA,kBAAU,GAAE,CAAC;IAEjC,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO;SACpC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACd,IAAI,MAAM,CAAC,IAAI,KAAK,2BAAmB,CAAC,OAAO,EAAE;YAC/C,OAAO,MAAM,CAAC,WAAW,CAAC;SAC3B;QAED,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;SACD,IAAI,EAAE;SACN,MAAM,CACL,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CACpB,IAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,EAAE,OAAK,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE,CAAA,CAAC,KAAK,KAAK,CACxE,CAAC;IAEJ,OAAO,CACL,0CACG,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAC/B;QACE,qCAAG,IAAI,EAAE,gBAAgB,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,EAAE,IAAG,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,CAAK,CACnE,CACN,CAAC,CACC,CACN,CAAC;AACJ,CAAC,CAAC;AA1BW,QAAA,qBAAqB,yBA0BhC","sourcesContent":["import React from \"react\";\n\nimport { useResults } from \"../../hooks\";\nimport { ElasticDocumentType } from \"../../types\";\n\nexport const ExampleHookUseResults: React.FC = () => {\n const resultsHook = useResults();\n\n const collections = resultsHook.results\n .map((result) => {\n if (result.type === ElasticDocumentType.Product) {\n return result.collections;\n }\n\n return [];\n })\n .flat()\n .filter(\n (item, index, self) =>\n self.findIndex((itemNested) => itemNested?.id === item?.id) === index\n );\n\n return (\n <ul>\n {collections.map((collection) => (\n <li>\n <a href={`/collections/${collection?.handle}`}>{collection?.title}</a>\n </li>\n ))}\n </ul>\n );\n};\n"]}
@@ -17,5 +17,7 @@ export * from "./ExampleResultPaginationNextPrev";
17
17
  export * from "./ExampleSearch";
18
18
  export * from "./ExampleSortBy";
19
19
  export * from "./ExampleStats";
20
+ export * from "./ExampleHookUseFilters";
21
+ export * from "./ExampleHookUseResults";
20
22
  export * from "./ExampleHookUseSearch";
21
23
  export * from "./ExampleHookUseSortBy";
@@ -29,6 +29,8 @@ __exportStar(require("./ExampleResultPaginationNextPrev"), exports);
29
29
  __exportStar(require("./ExampleSearch"), exports);
30
30
  __exportStar(require("./ExampleSortBy"), exports);
31
31
  __exportStar(require("./ExampleStats"), exports);
32
+ __exportStar(require("./ExampleHookUseFilters"), exports);
33
+ __exportStar(require("./ExampleHookUseResults"), exports);
32
34
  __exportStar(require("./ExampleHookUseSearch"), exports);
33
35
  __exportStar(require("./ExampleHookUseSortBy"), exports);
34
36
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Example/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAkC;AAClC,2DAAyC;AACzC,sDAAoC;AACpC,uDAAqC;AACrC,wDAAsC;AACtC,mDAAiC;AACjC,2DAAyC;AACzC,4EAA0D;AAC1D,+EAA6D;AAC7D,wEAAsD;AACtD,6DAA2C;AAC3C,6DAA2C;AAC3C,oEAAkD;AAClD,oEAAkD;AAClD,0EAAwD;AACxD,oEAAkD;AAClD,kDAAgC;AAChC,kDAAgC;AAChC,iDAA+B;AAE/B,yDAAuC;AACvC,yDAAuC","sourcesContent":["export * from \"./ExampleClearAll\";\nexport * from \"./ExampleCustomComponent\";\nexport * from \"./ExampleFilterList\";\nexport * from \"./ExampleFilterRange\";\nexport * from \"./ExampleFilterSlider\";\nexport * from \"./ExampleFilters\";\nexport * from \"./ExampleFiltersSelected\";\nexport * from \"./ExampleReactiveSearchProviderCollection\";\nexport * from \"./ExampleReactiveSearchProviderInstantSearch\";\nexport * from \"./ExampleReactiveSearchProviderSearch\";\nexport * from \"./ExampleResultCardCallout\";\nexport * from \"./ExampleResultCardProduct\";\nexport * from \"./ExampleResultPaginationNumbered\";\nexport * from \"./ExampleResultPaginationLoadMore\";\nexport * from \"./ExampleResultPaginationInfiniteScroll\";\nexport * from \"./ExampleResultPaginationNextPrev\";\nexport * from \"./ExampleSearch\";\nexport * from \"./ExampleSortBy\";\nexport * from \"./ExampleStats\";\n\nexport * from \"./ExampleHookUseSearch\";\nexport * from \"./ExampleHookUseSortBy\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Example/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAkC;AAClC,2DAAyC;AACzC,sDAAoC;AACpC,uDAAqC;AACrC,wDAAsC;AACtC,mDAAiC;AACjC,2DAAyC;AACzC,4EAA0D;AAC1D,+EAA6D;AAC7D,wEAAsD;AACtD,6DAA2C;AAC3C,6DAA2C;AAC3C,oEAAkD;AAClD,oEAAkD;AAClD,0EAAwD;AACxD,oEAAkD;AAClD,kDAAgC;AAChC,kDAAgC;AAChC,iDAA+B;AAE/B,0DAAwC;AACxC,0DAAwC;AACxC,yDAAuC;AACvC,yDAAuC","sourcesContent":["export * from \"./ExampleClearAll\";\nexport * from \"./ExampleCustomComponent\";\nexport * from \"./ExampleFilterList\";\nexport * from \"./ExampleFilterRange\";\nexport * from \"./ExampleFilterSlider\";\nexport * from \"./ExampleFilters\";\nexport * from \"./ExampleFiltersSelected\";\nexport * from \"./ExampleReactiveSearchProviderCollection\";\nexport * from \"./ExampleReactiveSearchProviderInstantSearch\";\nexport * from \"./ExampleReactiveSearchProviderSearch\";\nexport * from \"./ExampleResultCardCallout\";\nexport * from \"./ExampleResultCardProduct\";\nexport * from \"./ExampleResultPaginationNumbered\";\nexport * from \"./ExampleResultPaginationLoadMore\";\nexport * from \"./ExampleResultPaginationInfiniteScroll\";\nexport * from \"./ExampleResultPaginationNextPrev\";\nexport * from \"./ExampleSearch\";\nexport * from \"./ExampleSortBy\";\nexport * from \"./ExampleStats\";\n\nexport * from \"./ExampleHookUseFilters\";\nexport * from \"./ExampleHookUseResults\";\nexport * from \"./ExampleHookUseSearch\";\nexport * from \"./ExampleHookUseSortBy\";\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.10.0-beta.1",
4
+ "version": "5.10.1",
5
5
  "license": "MIT",
6
6
  "main": "dist/src/index.js",
7
7
  "types": "dist/src/index.d.ts",