@usereactify/search 5.2.0-beta.3 → 5.2.1-beta.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.
Files changed (23) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/package.json +1 -1
  3. package/dist/src/components/Example/ExampleClearAll.js.map +1 -1
  4. package/dist/src/components/Example/ExampleHookUseFilters.js +2 -2
  5. package/dist/src/components/Example/ExampleHookUseFilters.js.map +1 -1
  6. package/dist/src/components/Example/ExampleReactiveSearchProviderCollection.js +2 -1
  7. package/dist/src/components/Example/ExampleReactiveSearchProviderCollection.js.map +1 -1
  8. package/dist/src/components/Example/ExampleReactiveSearchProviderInstantSearch.js +2 -1
  9. package/dist/src/components/Example/ExampleReactiveSearchProviderInstantSearch.js.map +1 -1
  10. package/dist/src/components/Example/ExampleReactiveSearchProviderSearch.js +2 -1
  11. package/dist/src/components/Example/ExampleReactiveSearchProviderSearch.js.map +1 -1
  12. package/dist/src/components/Example/ExampleResultCardCallout.js +1 -1
  13. package/dist/src/components/Example/ExampleResultCardCallout.js.map +1 -1
  14. package/dist/src/components/Example/ExampleResultPaginationLoadMore.js +1 -1
  15. package/dist/src/components/Example/ExampleResultPaginationLoadMore.js.map +1 -1
  16. package/dist/src/components/Example/ExampleSearch.js +1 -1
  17. package/dist/src/components/Example/ExampleSearch.js.map +1 -1
  18. package/dist/src/components/Sensor/SensorSearchTerm.js +1 -1
  19. package/dist/src/components/Sensor/SensorSearchTerm.js.map +1 -1
  20. package/dist/src/hooks/useSearch.js.map +1 -1
  21. package/dist/src/utility/liquid.js +2 -2
  22. package/dist/src/utility/liquid.js.map +1 -1
  23. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,30 @@
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.1-beta.0](https://bitbucket.org/usereactify/reactify-search-ui/compare/beta-v5.2.0-beta.4...beta-v5.2.1-beta.0) (2022-08-11)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * collection handle was include query string ([cbb2b4f](https://bitbucket.org/usereactify/reactify-search-ui/commit/cbb2b4f772410f9a23ced7b339ab6d12fa350ede))
11
+
12
+ ## [5.2.0](https://bitbucket.org/usereactify/reactify-search-ui/compare/release-v5.1.5...release-v5.2.0) (2022-08-10)
13
+
14
+
15
+ ### Features
16
+
17
+ * add getData method to liquid utility ([bf3b75c](https://bitbucket.org/usereactify/reactify-search-ui/commit/bf3b75c0b3a9f6ece11120ff190f0e740021a58f))
18
+ * add utilities for liquid consumers ([e8d738c](https://bitbucket.org/usereactify/reactify-search-ui/commit/e8d738c2a242e4437f05ab0832e86cabed756f75))
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * collection handle was include query string ([cbb2b4f](https://bitbucket.org/usereactify/reactify-search-ui/commit/cbb2b4f772410f9a23ced7b339ab6d12fa350ede))
24
+ * export liquid utility ([8df10b2](https://bitbucket.org/usereactify/reactify-search-ui/commit/8df10b2dd09658abf41d4404102db8eb20e4b63b))
25
+ * improve liquid utilities ([b54a8ca](https://bitbucket.org/usereactify/reactify-search-ui/commit/b54a8caa6c498d3798068fe47527ac5bcde74aca))
26
+
27
+ ## [5.2.0-beta.4](https://bitbucket.org/usereactify/reactify-search-ui/compare/beta-v5.2.0-beta.3...beta-v5.2.0-beta.4) (2022-08-10)
28
+
5
29
  ## [5.2.0-beta.3](https://bitbucket.org/usereactify/reactify-search-ui/compare/beta-v5.2.0-beta.2...beta-v5.2.0-beta.3) (2022-08-10)
6
30
 
7
31
 
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.0-beta.3",
4
+ "version": "5.2.0",
5
5
  "license": "MIT",
6
6
  "main": "dist/src/index.js",
7
7
  "types": "dist/src/index.d.ts",
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleClearAll.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleClearAll.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,eAAe,GAAmC,CAAC,KAAK,EAAE,EAAE;IACvE,OAAO,qCAAG,OAAO,EAAE,KAAK,CAAC,QAAQ,IAAG,WAAW,CAAK,CAAC;AACvD,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B","sourcesContent":["import React from \"react\";\n\nimport { Filter, ClearAllProps } from \"../../components\";\n\nexport type ExampleClearAllProps = React.ComponentProps<\n NonNullable<ClearAllProps[\"render\"]>\n>;\n\nexport const ExampleClearAll: React.FC<ExampleClearAllProps> = (props) => {\n return <a onClick={props.clearAll}>{\"Clear All\"}</a>;\n};\n"]}
1
+ {"version":3,"file":"ExampleClearAll.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleClearAll.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,eAAe,GAAmC,CAAC,KAAK,EAAE,EAAE;IACvE,OAAO,qCAAG,OAAO,EAAE,KAAK,CAAC,QAAQ,IAAG,WAAW,CAAK,CAAC;AACvD,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B","sourcesContent":["import React from \"react\";\n\nimport { ClearAllProps } from \"../../components\";\n\nexport type ExampleClearAllProps = React.ComponentProps<\n NonNullable<ClearAllProps[\"render\"]>\n>;\n\nexport const ExampleClearAll: React.FC<ExampleClearAllProps> = (props) => {\n return <a onClick={props.clearAll}>{\"Clear All\"}</a>;\n};\n"]}
@@ -11,9 +11,9 @@ const ExampleHookUseFilters = () => {
11
11
  var _a;
12
12
  const filtersHook = (0, hooks_1.useFilters)();
13
13
  return (react_1.default.createElement("div", null,
14
- react_1.default.createElement("h1", null, "Filters"), (_a = filtersHook.filters) === null || _a === void 0 ? void 0 :
14
+ react_1.default.createElement("h3", null, "Filters"), (_a = filtersHook.filters) === null || _a === void 0 ? void 0 :
15
15
  _a.map((filter) => (react_1.default.createElement("div", null,
16
- react_1.default.createElement("h3", null, filter.name),
16
+ react_1.default.createElement("p", null, filter.name),
17
17
  react_1.default.createElement(components_1.Filter, { key: filter.id, filter: filter }))))));
18
18
  };
19
19
  exports.ExampleHookUseFilters = ExampleHookUseFilters;
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleHookUseFilters.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleHookUseFilters.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAAyC;AACzC,iDAA0C;AAEnC,MAAM,qBAAqB,GAAa,GAAG,EAAE;;IAClD,MAAM,WAAW,GAAG,IAAA,kBAAU,GAAE,CAAC;IAEjC,OAAO,CACL;QACE,0CAAK,SAAS,CAAM,EACnB,MAAA,WAAW,CAAC,OAAO;WAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACpC;YACE,0CAAK,MAAM,CAAC,IAAI,CAAM;YACtB,8BAAC,mBAAM,IAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,GAAI,CACtC,CACP,CAAC,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,qBAAqB,yBAchC","sourcesContent":["import React from \"react\";\n\nimport { useFilters } from \"../../hooks\";\nimport { Filter } from \"../../components\";\n\nexport const ExampleHookUseFilters: React.FC = () => {\n const filtersHook = useFilters();\n\n return (\n <div>\n <h1>{\"Filters\"}</h1>\n {filtersHook.filters?.map((filter) => (\n <div>\n <h3>{filter.name}</h3>\n <Filter key={filter.id} filter={filter} />\n </div>\n ))}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"ExampleHookUseFilters.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleHookUseFilters.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAAyC;AACzC,iDAA0C;AAEnC,MAAM,qBAAqB,GAAa,GAAG,EAAE;;IAClD,MAAM,WAAW,GAAG,IAAA,kBAAU,GAAE,CAAC;IAEjC,OAAO,CACL;QACE,0CAAK,SAAS,CAAM,EACnB,MAAA,WAAW,CAAC,OAAO;WAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACpC;YACE,yCAAI,MAAM,CAAC,IAAI,CAAK;YACpB,8BAAC,mBAAM,IAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,GAAI,CACtC,CACP,CAAC,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,qBAAqB,yBAchC","sourcesContent":["import React from \"react\";\n\nimport { useFilters } from \"../../hooks\";\nimport { Filter } from \"../../components\";\n\nexport const ExampleHookUseFilters: React.FC = () => {\n const filtersHook = useFilters();\n\n return (\n <div>\n <h3>{\"Filters\"}</h3>\n {filtersHook.filters?.map((filter) => (\n <div>\n <p>{filter.name}</p>\n <Filter key={filter.id} filter={filter} />\n </div>\n ))}\n </div>\n );\n};\n"]}
@@ -6,6 +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: "reactify-apps.myshopify.com", collectionHandle: "example-collection" },
10
+ react_1.default.createElement(react_1.default.Fragment, null)));
10
11
  exports.ExampleReactiveSearchProviderCollection = ExampleReactiveSearchProviderCollection;
11
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,UAGd,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,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"]}
@@ -6,6 +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: "reactify-apps.myshopify.com" },
10
+ react_1.default.createElement(react_1.default.Fragment, null)));
10
11
  exports.ExampleReactiveSearchProviderInstantSearch = ExampleReactiveSearchProviderInstantSearch;
11
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,UAG7B,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,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"]}
@@ -6,6 +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: "reactify-apps.myshopify.com" },
10
+ react_1.default.createElement(react_1.default.Fragment, null)));
10
11
  exports.ExampleReactiveSearchProviderSearch = ExampleReactiveSearchProviderSearch;
11
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,UAG7B,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,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"]}
@@ -14,7 +14,7 @@ const ExampleResultCardCallout = (props) => {
14
14
  });
15
15
  }, [props.callout]);
16
16
  return (react_1.default.createElement("div", { className: "rs__result-card-callout", ref: props.itemRef, style: styleProp },
17
- react_1.default.createElement("a", { className: "rs__result-card-callout__link", href: props.callout.link, onClick: props.handleClick },
17
+ react_1.default.createElement("a", Object.assign({ className: "rs__result-card-callout__link", onClick: props.handleClick }, (!!props.callout.link && { href: props.callout.link })),
18
18
  props.callout.desktopImage && (react_1.default.createElement("img", { className: "rs__result-card-callout__image", src: props.callout.desktopImage, width: "100%" })),
19
19
  react_1.default.createElement("span", { className: "rs__result-card-callout__title" }, props.callout.title))));
20
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleResultCardCallout.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultCardCallout.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,wBAAwB,GACnC,CAAC,KAAK,EAAE,EAAE;IACR,MAAM,SAAS,GAAG,eAAK,CAAC,OAAO,CAC7B,GAAG,EAAE;;QAAC,OAAA,CAAC;YACL,OAAO,EAAE,QAAQ,MAAA,KAAK,CAAC,OAAO,CAAC,WAAW,mCAAI,CAAC,EAAE;YACjD,UAAU,EAAE,QAAQ,MAAA,KAAK,CAAC,OAAO,CAAC,cAAc,mCAAI,CAAC,EAAE;SACxD,CAAC,CAAA;KAAA,EACF,CAAC,KAAK,CAAC,OAAO,CAAC,CAChB,CAAC;IAEF,OAAO,CACL,uCACE,SAAS,EAAC,yBAAyB,EACnC,GAAG,EAAE,KAAK,CAAC,OAAO,EAClB,KAAK,EAAE,SAAS;QAEhB,qCACE,SAAS,EAAC,+BAA+B,EACzC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,EACxB,OAAO,EAAE,KAAK,CAAC,WAAW;YAEzB,KAAK,CAAC,OAAO,CAAC,YAAY,IAAI,CAC7B,uCACE,SAAS,EAAC,gCAAgC,EAC1C,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY,EAC/B,KAAK,EAAC,MAAM,GACZ,CACH;YACD,wCAAM,SAAS,EAAC,gCAAgC,IAC7C,KAAK,CAAC,OAAO,CAAC,KAAK,CACf,CACL,CACA,CACP,CAAC;AACJ,CAAC,CAAC;AAlCS,QAAA,wBAAwB,4BAkCjC","sourcesContent":["import React from \"react\";\n\nimport { ResultCardCalloutProps } from \"../../components\";\n\nexport type ExampleResultCardCalloutProps = React.ComponentProps<\n NonNullable<ResultCardCalloutProps[\"render\"]>\n>;\n\nexport const ExampleResultCardCallout: React.FC<ExampleResultCardCalloutProps> =\n (props) => {\n const styleProp = React.useMemo<React.HTMLAttributes<HTMLElement>[\"style\"]>(\n () => ({\n gridRow: `span ${props.callout.displayRows ?? 1}`,\n gridColumn: `span ${props.callout.displayColumns ?? 1}`,\n }),\n [props.callout]\n );\n\n return (\n <div\n className=\"rs__result-card-callout\"\n ref={props.itemRef}\n style={styleProp}\n >\n <a\n className=\"rs__result-card-callout__link\"\n href={props.callout.link}\n onClick={props.handleClick}\n >\n {props.callout.desktopImage && (\n <img\n className=\"rs__result-card-callout__image\"\n src={props.callout.desktopImage}\n width=\"100%\"\n />\n )}\n <span className=\"rs__result-card-callout__title\">\n {props.callout.title}\n </span>\n </a>\n </div>\n );\n };\n"]}
1
+ {"version":3,"file":"ExampleResultCardCallout.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultCardCallout.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,wBAAwB,GACnC,CAAC,KAAK,EAAE,EAAE;IACR,MAAM,SAAS,GAAG,eAAK,CAAC,OAAO,CAC7B,GAAG,EAAE;;QAAC,OAAA,CAAC;YACL,OAAO,EAAE,QAAQ,MAAA,KAAK,CAAC,OAAO,CAAC,WAAW,mCAAI,CAAC,EAAE;YACjD,UAAU,EAAE,QAAQ,MAAA,KAAK,CAAC,OAAO,CAAC,cAAc,mCAAI,CAAC,EAAE;SACxD,CAAC,CAAA;KAAA,EACF,CAAC,KAAK,CAAC,OAAO,CAAC,CAChB,CAAC;IAEF,OAAO,CACL,uCACE,SAAS,EAAC,yBAAyB,EACnC,GAAG,EAAE,KAAK,CAAC,OAAO,EAClB,KAAK,EAAE,SAAS;QAEhB,mDACE,SAAS,EAAC,+BAA+B,EACzC,OAAO,EAAE,KAAK,CAAC,WAAW,IACtB,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAEzD,KAAK,CAAC,OAAO,CAAC,YAAY,IAAI,CAC7B,uCACE,SAAS,EAAC,gCAAgC,EAC1C,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY,EAC/B,KAAK,EAAC,MAAM,GACZ,CACH;YACD,wCAAM,SAAS,EAAC,gCAAgC,IAC7C,KAAK,CAAC,OAAO,CAAC,KAAK,CACf,CACL,CACA,CACP,CAAC;AACJ,CAAC,CAAC;AAlCS,QAAA,wBAAwB,4BAkCjC","sourcesContent":["import React from \"react\";\n\nimport { ResultCardCalloutProps } from \"../../components\";\n\nexport type ExampleResultCardCalloutProps = React.ComponentProps<\n NonNullable<ResultCardCalloutProps[\"render\"]>\n>;\n\nexport const ExampleResultCardCallout: React.FC<ExampleResultCardCalloutProps> =\n (props) => {\n const styleProp = React.useMemo<React.HTMLAttributes<HTMLElement>[\"style\"]>(\n () => ({\n gridRow: `span ${props.callout.displayRows ?? 1}`,\n gridColumn: `span ${props.callout.displayColumns ?? 1}`,\n }),\n [props.callout]\n );\n\n return (\n <div\n className=\"rs__result-card-callout\"\n ref={props.itemRef}\n style={styleProp}\n >\n <a\n className=\"rs__result-card-callout__link\"\n onClick={props.handleClick}\n {...(!!props.callout.link && { href: props.callout.link })}\n >\n {props.callout.desktopImage && (\n <img\n className=\"rs__result-card-callout__image\"\n src={props.callout.desktopImage}\n width=\"100%\"\n />\n )}\n <span className=\"rs__result-card-callout__title\">\n {props.callout.title}\n </span>\n </a>\n </div>\n );\n };\n"]}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ExampleResultPaginationLoadMore = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const ExampleResultPaginationLoadMore = (props) => {
9
- return (react_1.default.createElement("button", { className: "rs__pagination__loadmore-button", onClick: () => props.handleLoadMore() }, "Load more"));
9
+ return (react_1.default.createElement("button", { className: "rs__pagination__loadmore-button", onClick: () => props.handleLoadMore(), disabled: !props.hasMore }, "Load more"));
10
10
  };
11
11
  exports.ExampleResultPaginationLoadMore = ExampleResultPaginationLoadMore;
12
12
  //# sourceMappingURL=ExampleResultPaginationLoadMore.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleResultPaginationLoadMore.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultPaginationLoadMore.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,+BAA+B,GAC1C,CAAC,KAAK,EAAE,EAAE;IACR,OAAO,CACL,0CACE,SAAS,EAAC,iCAAiC,EAC3C,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,IAEpC,WAAW,CACL,CACV,CAAC;AACJ,CAAC,CAAC;AAVS,QAAA,+BAA+B,mCAUxC","sourcesContent":["import React from \"react\";\n\nimport { ResultPaginationLoadMoreProps } from \"../../components\";\n\nexport type ExampleResultPaginationLoadMoreProps = React.ComponentProps<\n NonNullable<ResultPaginationLoadMoreProps[\"render\"]>\n>;\n\nexport const ExampleResultPaginationLoadMore: React.FC<ExampleResultPaginationLoadMoreProps> =\n (props) => {\n return (\n <button\n className=\"rs__pagination__loadmore-button\"\n onClick={() => props.handleLoadMore()}\n >\n {\"Load more\"}\n </button>\n );\n };\n"]}
1
+ {"version":3,"file":"ExampleResultPaginationLoadMore.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultPaginationLoadMore.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,+BAA+B,GAC1C,CAAC,KAAK,EAAE,EAAE;IACR,OAAO,CACL,0CACE,SAAS,EAAC,iCAAiC,EAC3C,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,EACrC,QAAQ,EAAE,CAAC,KAAK,CAAC,OAAO,IAEvB,WAAW,CACL,CACV,CAAC;AACJ,CAAC,CAAC;AAXS,QAAA,+BAA+B,mCAWxC","sourcesContent":["import React from \"react\";\n\nimport { ResultPaginationLoadMoreProps } from \"../../components\";\n\nexport type ExampleResultPaginationLoadMoreProps = React.ComponentProps<\n NonNullable<ResultPaginationLoadMoreProps[\"render\"]>\n>;\n\nexport const ExampleResultPaginationLoadMore: React.FC<ExampleResultPaginationLoadMoreProps> =\n (props) => {\n return (\n <button\n className=\"rs__pagination__loadmore-button\"\n onClick={() => props.handleLoadMore()}\n disabled={!props.hasMore}\n >\n {\"Load more\"}\n </button>\n );\n };\n"]}
@@ -14,7 +14,7 @@ const ExampleSearch = (props) => {
14
14
  props.setSearchTerm(event.target.value);
15
15
  }, [props.setSearchTerm]);
16
16
  return (react_1.default.createElement("form", { onSubmit: handleFormSubmit },
17
- react_1.default.createElement("input", { type: "text", placeholder: "Search terms...", value: props.searchTerm, onChange: handleInputChange })));
17
+ react_1.default.createElement("input", { type: "search", placeholder: "Search products...", value: props.searchTerm, onChange: handleInputChange })));
18
18
  };
19
19
  exports.ExampleSearch = ExampleSearch;
20
20
  //# sourceMappingURL=ExampleSearch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleSearch.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleSearch.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,aAAa,GAAiC,CAAC,KAAK,EAAE,EAAE;IACnE,MAAM,gBAAgB,GAAG,eAAK,CAAC,WAAW,CACxC,CAAC,KAAuC,EAAE,EAAE;QAC1C,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAC3B,CAAC,EACD,CAAC,KAAK,CAAC,gBAAgB,CAAC,CACzB,CAAC;IAEF,MAAM,iBAAiB,GAAG,eAAK,CAAC,WAAW,CACzC,CAAC,KAA0C,EAAE,EAAE;QAC7C,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC,EACD,CAAC,KAAK,CAAC,aAAa,CAAC,CACtB,CAAC;IAEF,OAAO,CACL,wCAAM,QAAQ,EAAE,gBAAgB;QAC9B,yCACE,IAAI,EAAC,MAAM,EACX,WAAW,EAAC,iBAAiB,EAC7B,KAAK,EAAE,KAAK,CAAC,UAAU,EACvB,QAAQ,EAAE,iBAAiB,GAC3B,CACG,CACR,CAAC;AACJ,CAAC,CAAC;AA1BW,QAAA,aAAa,iBA0BxB","sourcesContent":["import React from \"react\";\n\nimport { SearchProps } from \"../../components\";\n\nexport type ExampleSearchProps = React.ComponentProps<\n NonNullable<SearchProps[\"render\"]>\n>;\n\nexport const ExampleSearch: React.FC<ExampleSearchProps> = (props) => {\n const handleFormSubmit = React.useCallback(\n (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n props.submitSearchTerm();\n },\n [props.submitSearchTerm]\n );\n\n const handleInputChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n props.setSearchTerm(event.target.value);\n },\n [props.setSearchTerm]\n );\n\n return (\n <form onSubmit={handleFormSubmit}>\n <input\n type=\"text\"\n placeholder=\"Search terms...\"\n value={props.searchTerm}\n onChange={handleInputChange}\n />\n </form>\n );\n};\n"]}
1
+ {"version":3,"file":"ExampleSearch.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleSearch.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,aAAa,GAAiC,CAAC,KAAK,EAAE,EAAE;IACnE,MAAM,gBAAgB,GAAG,eAAK,CAAC,WAAW,CACxC,CAAC,KAAuC,EAAE,EAAE;QAC1C,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAC3B,CAAC,EACD,CAAC,KAAK,CAAC,gBAAgB,CAAC,CACzB,CAAC;IAEF,MAAM,iBAAiB,GAAG,eAAK,CAAC,WAAW,CACzC,CAAC,KAA0C,EAAE,EAAE;QAC7C,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC,EACD,CAAC,KAAK,CAAC,aAAa,CAAC,CACtB,CAAC;IAEF,OAAO,CACL,wCAAM,QAAQ,EAAE,gBAAgB;QAC9B,yCACE,IAAI,EAAC,QAAQ,EACb,WAAW,EAAC,oBAAoB,EAChC,KAAK,EAAE,KAAK,CAAC,UAAU,EACvB,QAAQ,EAAE,iBAAiB,GAC3B,CACG,CACR,CAAC;AACJ,CAAC,CAAC;AA1BW,QAAA,aAAa,iBA0BxB","sourcesContent":["import React from \"react\";\n\nimport { SearchProps } from \"../../components\";\n\nexport type ExampleSearchProps = React.ComponentProps<\n NonNullable<SearchProps[\"render\"]>\n>;\n\nexport const ExampleSearch: React.FC<ExampleSearchProps> = (props) => {\n const handleFormSubmit = React.useCallback(\n (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n props.submitSearchTerm();\n },\n [props.submitSearchTerm]\n );\n\n const handleInputChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n props.setSearchTerm(event.target.value);\n },\n [props.setSearchTerm]\n );\n\n return (\n <form onSubmit={handleFormSubmit}>\n <input\n type=\"search\"\n placeholder=\"Search products...\"\n value={props.searchTerm}\n onChange={handleInputChange}\n />\n </form>\n );\n};\n"]}
@@ -20,7 +20,7 @@ const SensorSearchTerm = () => {
20
20
  }
21
21
  return [];
22
22
  }, [config.fields]);
23
- if (!searchTerm || searchFields.length === 0) {
23
+ if (searchFields.length === 0) {
24
24
  return null;
25
25
  }
26
26
  return (react_1.default.createElement(react_1.default.Fragment, null,
@@ -1 +1 @@
1
- {"version":3,"file":"SensorSearchTerm.js","sourceRoot":"","sources":["../../../../src/components/Sensor/SensorSearchTerm.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4GAAoF;AAEpF,uCAAkE;AAE3D,MAAM,gBAAgB,GAAa,GAAG,EAAE;IAC7C,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IACvD,MAAM,EAAE,UAAU,EAAE,GAAG,IAAA,iBAAS,GAAE,CAAC;IAEnC,mDAAmD;IACnD,MAAM,YAAY,GAAG,eAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACtC,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE;YAC7B,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CACpC,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAC5D,CAAC;SACH;QAED,IAAI,OAAO,CAAC,IAAI,KAAK,gBAAgB,EAAE;YACrC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CACp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qBAC1B;iBACF,CAAC;gBACF,OAAO,EAAE,KAAK,EAAE,CAAC;YACnB,CAAC,GACD,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAnHW,QAAA,gBAAgB,oBAmH3B","sourcesContent":["import React from \"react\";\nimport DataSearch from \"@appbaseio/reactivesearch/lib/components/search/DataSearch\";\n\nimport { useReactifySearchContext, useSearch } from \"../../hooks\";\n\nexport const SensorSearchTerm: React.FC = () => {\n const { options, config } = useReactifySearchContext();\n const { searchTerm } = useSearch();\n\n // ignore search fields only set for instant search\n const searchFields = React.useMemo(() => {\n if (options.mode === \"search\") {\n return config.fields.filter((field) =>\n [\"always_search\", \"search_page\"].includes(field.searchType)\n );\n }\n\n if (options.mode === \"instant-search\") {\n return config.fields.filter((field) =>\n [\"always_search\", \"instant_search\"].includes(field.searchType)\n );\n }\n\n return [];\n }, [config.fields]);\n\n if (!searchTerm || searchFields.length === 0) {\n return null;\n }\n\n return (\n <>\n <DataSearch\n fuzziness={1}\n queryFormat=\"and\"\n autosuggest={false}\n value={searchTerm}\n componentId=\"SensorSearchTerm\"\n style={{ display: \"none\" }}\n dataField={searchFields.map((field) => field.field)}\n fieldWeights={searchFields.map((field) => field.importance)}\n customQuery={(value, props) => {\n const { dataField, fieldWeights } = props;\n\n const fieldsCrossFields = dataField.map(\n (field: string, index: number) => `${field}^${fieldWeights[index]}`\n );\n const fieldsPhrase = dataField.map(\n (field: string, index: number) => `${field}^${fieldWeights[index]}`\n );\n const fieldsPhrasePrefix = dataField\n .filter((field: string) => !field.includes(\".\"))\n .map(\n (field: string, index: number) =>\n `${field}^${fieldWeights[index]}`\n );\n\n const query = {\n bool: {\n should: [\n ...(options.mode === \"search\" && value\n ? [\n {\n nested: {\n path: \"curations\",\n query: {\n term: {\n \"curations.searchTerm.keyword\":\n value.toLowerCase(),\n },\n },\n },\n },\n ]\n : []),\n ...(fieldsCrossFields.length > 0\n ? [\n {\n multi_match: {\n query: value,\n fields: fieldsCrossFields,\n type: \"cross_fields\",\n operator: \"and\",\n },\n },\n ]\n : []),\n ...(fieldsPhrase.length > 0\n ? [\n {\n multi_match: {\n query: value,\n fields: fieldsPhrase,\n type: \"phrase\",\n operator: \"and\",\n },\n },\n ]\n : []),\n ...(fieldsPhrasePrefix.length > 0\n ? [\n {\n multi_match: {\n query: value,\n fields: fieldsPhrasePrefix,\n type: \"phrase_prefix\",\n operator: \"and\",\n },\n },\n ]\n : []),\n ],\n minimum_should_match: \"1\",\n },\n };\n return { query };\n }}\n />\n </>\n );\n};\n"]}
1
+ {"version":3,"file":"SensorSearchTerm.js","sourceRoot":"","sources":["../../../../src/components/Sensor/SensorSearchTerm.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4GAAoF;AAEpF,uCAAkE;AAE3D,MAAM,gBAAgB,GAAa,GAAG,EAAE;IAC7C,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IACvD,MAAM,EAAE,UAAU,EAAE,GAAG,IAAA,iBAAS,GAAE,CAAC;IAEnC,mDAAmD;IACnD,MAAM,YAAY,GAAG,eAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACtC,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE;YAC7B,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CACpC,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAC5D,CAAC;SACH;QAED,IAAI,OAAO,CAAC,IAAI,KAAK,gBAAgB,EAAE;YACrC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CACpC,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAC/D,CAAC;SACH;QAED,OAAO,EAAE,CAAC;IACZ,CAAC,EAAE,CAAC,MAAM,CAAC,MA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baseio/reactivesearch/lib/components/search/DataSearch\";\n\nimport { useReactifySearchContext, useSearch } from \"../../hooks\";\n\nexport const SensorSearchTerm: React.FC = () => {\n const { options, config } = useReactifySearchContext();\n const { searchTerm } = useSearch();\n\n // ignore search fields only set for instant search\n const searchFields = React.useMemo(() => {\n if (options.mode === \"search\") {\n return config.fields.filter((field) =>\n [\"always_search\", \"search_page\"].includes(field.searchType)\n );\n }\n\n if (options.mode === \"instant-search\") {\n return config.fields.filter((field) =>\n [\"always_search\", \"instant_search\"].includes(field.searchType)\n );\n }\n\n return [];\n }, [config.fields]);\n\n if (searchFields.length === 0) {\n return null;\n }\n\n return (\n <>\n <DataSearch\n fuzziness={1}\n queryFormat=\"and\"\n autosuggest={false}\n value={searchTerm}\n componentId=\"SensorSearchTerm\"\n style={{ display: \"none\" }}\n dataField={searchFields.map((field) => field.field)}\n fieldWeights={searchFields.map((field) => field.importance)}\n customQuery={(value, props) => {\n const { dataField, fieldWeights } = props;\n\n const fieldsCrossFields = dataField.map(\n (field: string, index: number) => `${field}^${fieldWeights[index]}`\n );\n const fieldsPhrase = dataField.map(\n (field: string, index: number) => `${field}^${fieldWeights[index]}`\n );\n const fieldsPhrasePrefix = dataField\n .filter((field: string) => !field.includes(\".\"))\n .map(\n (field: string, index: number) =>\n `${field}^${fieldWeights[index]}`\n );\n\n const query = {\n bool: {\n should: [\n ...(options.mode === \"search\" && value\n ? [\n {\n nested: {\n path: \"curations\",\n query: {\n term: {\n \"curations.searchTerm.keyword\":\n value.toLowerCase(),\n },\n },\n },\n },\n ]\n : []),\n ...(fieldsCrossFields.length > 0\n ? [\n {\n multi_match: {\n query: value,\n fields: fieldsCrossFields,\n type: \"cross_fields\",\n operator: \"and\",\n },\n },\n ]\n : []),\n ...(fieldsPhrase.length > 0\n ? [\n {\n multi_match: {\n query: value,\n fields: fieldsPhrase,\n type: \"phrase\",\n operator: \"and\",\n },\n },\n ]\n : []),\n ...(fieldsPhrasePrefix.length > 0\n ? [\n {\n multi_match: {\n query: value,\n fields: fieldsPhrasePrefix,\n type: \"phrase_prefix\",\n operator: \"and\",\n },\n },\n ]\n : []),\n ],\n minimum_should_match: \"1\",\n },\n };\n return { query };\n }}\n />\n </>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useSearch.js","sourceRoot":"","sources":["../../../src/hooks/useSearch.ts"],"names":[],"mappings":";;;;;;AACA,kDAA0B;AAE1B,oCAAoD;AACpD,wCAAmC;AAE5B,MAAM,SAAS,GAAG,GAWvB,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAE/D,MAAM,sBAAsB,GAAG,eAAK,CAAC,WAAW,CAC9C,CAAC,aAAqB,MAAM,CAAC,UAAU,EAAE,EAAE;QACzC,eAAK,CAAC,UAAU,CAAC;YACf,QAAQ,EAAE,QAAQ;YAClB,OAAO,EAAE,eAAe;YACxB,IAAI,EAAE;gBACJ,UAAU,EAAE,UAAU;aACvB;SACF,CAAC,CAAC;QAEH,eAAK,CAAC,GAAG,CAAC,WAAW,EAAE,yBAAyB,EAAE,UAAU,CAAC,CAAC;QAE9D,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;SACR;QAED,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CACpC,CAAC,QAAQ,EAAE,EAAE,CACX,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,UAAU,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAClC,CAAC;QAEF,IAAI,QAAQ,EAAE;YACZ,eAAK,CAAC,GAAG,CAAC,WAAW,EAAE,4BAA4B,EAAE,QAAQ,CAAC,CAAC;SAChE;QAED,MAAM,CAAC,2BAA2B,CAAC,KAAK,CAAC,CAAC;QAE1C,IAAI,OAAO,CAAC,UAAU,EAAE;YACtB,OAAO,CAAC,UAAU,CAChB,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,EAChC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,UAAU,EAAE,CACpD,CAAC;SACH;aAAM,IAAI,QAAQ,EAAE;YACnB,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC;SACrC;aAAM;YACL,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,aAAa,UAAU,EAAE,CAAC;SAClD;IACH,CAAC,EACD,CAAC,MAAM,CAAC,UAAU,CAAC,CACpB,CAAC;IAEF,MAAM,mBAAmB,GAAG,eAAK,CAAC,WAAW,CAC3C,CAAC,aAAqB,EAAE,EAAE,EAAE;QAC1B,eAAK,CAAC,GAAG,CAAC,WAAW,EAAE,2BAA2B,EAAE,UAAU,CAAC,CAAC;QAChE,eAAK,CAAC,UAAU,CAAC;YACf,QAAQ,EAAE,QAAQ;YAClB,OAAO,EAAE,cAAc;YACvB,IAAI,EAAE;gBACJ,UAAU,EAAE,UAAU;aACvB;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACnC,CAAC,EACD,CAAC,MAAM,CAAC,UAAU,CAAC,CACpB,CAAC;IAEF,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,aAAa,EAAE,mBAAmB;QAClC,gBAAgB,EAAE,sBAAsB;QACxC,wBAAwB,EACtB,CAAC,CAAC,MAAM,CAAC,wBAAwB,IAAI,CAAC,CAAC,MAAM,CAAC,UAAU;QAC1D,2BAA2B,EAAE,MAAM,CAAC,2BAA2B;KAChE,CAAC;AACJ,CAAC,CAAC;AAhFW,QAAA,SAAS,aAgFpB","sourcesContent":["import { useDebounceFn } from \"ahooks\";\nimport React from \"react\";\n\nimport { useReactifySearchContext } from \"../hooks\";\nimport { debug } from \"../utility\";\n\nexport const useSearch = (): {\n /** The current search term */\n searchTerm: string;\n /** Function for changing the current search term */\n setSearchTerm: (searchTerm?: string) => void;\n /** Function for navigating to the search page, includes logic for redirects */\n submitSearchTerm: (searchTerm?: string) => void;\n /** Used to determine if instant search results should be displayed */\n showInstantSearchResults: boolean;\n /** Used to manually set the \"showInstantSearchResults\" value */\n setShowInstantSearchResults: React.Dispatch<React.SetStateAction<boolean>>;\n} => {\n const { options, config, search } = useReactifySearchContext();\n\n const handleSubmitSearchTerm = React.useCallback(\n (searchTerm: string = search.searchTerm) => {\n debug.breadcrumb({\n category: \"search\",\n message: \"search submit\",\n data: {\n searchTerm: searchTerm,\n },\n });\n\n debug.log(\"useSearch\", \"submitSearchTerm[query]\", searchTerm);\n\n if (!searchTerm) {\n return;\n }\n\n const redirect = config.redirects.find(\n (redirect) =>\n redirect.query.trim().toLowerCase() ===\n searchTerm.trim().toLowerCase()\n );\n\n if (redirect) {\n debug.log(\"useSearch\", \"submitSearchTerm[redirect]\", redirect);\n }\n\n search.setShowInstantSearchResults(false);\n\n if (options.onRedirect) {\n options.onRedirect(\n redirect ? \"redirect\" : \"search\",\n redirect ? redirect.url : `/search?q=${searchTerm}`\n );\n } else if (redirect) {\n window.location.href = redirect.url;\n } else {\n window.location.href = `/search?q=${searchTerm}`;\n }\n },\n [search.searchTerm]\n );\n\n const handleSetSearchTerm = React.useCallback(\n (searchTerm: string = \"\") => {\n debug.log(\"useSearch\", \"setSearchTerm[searchTerm]\", searchTerm);\n debug.breadcrumb({\n category: \"search\",\n message: \"search query\",\n data: {\n searchTerm: searchTerm,\n },\n });\n\n search.setSearchTerm(searchTerm);\n },\n [search.searchTerm]\n );\n\n return {\n searchTerm: search.searchTerm,\n setSearchTerm: handleSetSearchTerm,\n submitSearchTerm: handleSubmitSearchTerm,\n showInstantSearchResults:\n !!search.showInstantSearchResults && !!search.searchTerm,\n setShowInstantSearchResults: search.setShowInstantSearchResults,\n };\n};\n"]}
1
+ {"version":3,"file":"useSearch.js","sourceRoot":"","sources":["../../../src/hooks/useSearch.ts"],"names":[],"mappings":";;;;;;AAA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M,CAAC,QAAQ,CAAC,IAAI,GAAG,aAAa,UAAU,EAAE,CAAC;SAClD;IACH,CAAC,EACD,CAAC,MAAM,CAAC,UAAU,CAAC,CACpB,CAAC;IAEF,MAAM,mBAAmB,GAAG,eAAK,CAAC,WAAW,CAC3C,CAAC,aAAqB,EAAE,EAAE,EAAE;QAC1B,eAAK,CAAC,GAAG,CAAC,WAAW,EAAE,2BAA2B,EAAE,UAAU,CAAC,CAAC;QAChE,eAAK,CAAC,UAAU,CAAC;YACf,QAAQ,EAAE,QAAQ;YAClB,OAAO,EAAE,cAAc;YACvB,IAAI,EAAE;gBACJ,UAAU,EAAE,UAAU;aACvB;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACnC,CAAC,EACD,CAAC,MAAM,CAAC,UAAU,CAAC,CACpB,CAAC;IAEF,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,aAAa,EAAE,mBAAmB;QAClC,gBAAgB,EAAE,sBAAsB;QACxC,wBAAwB,EACtB,CAAC,CAAC,MAAM,CAAC,wBAAwB,IAAI,CAAC,CAAC,MAAM,CAAC,UAAU;QAC1D,2BAA2B,EAAE,MAAM,CAAC,2BAA2B;KAChE,CAAC;AACJ,CAAC,CAAC;AAhFW,QAAA,SAAS,aAgFpB","sourcesContent":["import React from \"react\";\n\nimport { useReactifySearchContext } from \"../hooks\";\nimport { debug } from \"../utility\";\n\nexport const useSearch = (): {\n /** The current search term */\n searchTerm: string;\n /** Function for changing the current search term */\n setSearchTerm: (searchTerm?: string) => void;\n /** Function for navigating to the search page, includes logic for redirects */\n submitSearchTerm: (searchTerm?: string) => void;\n /** Used to determine if instant search results should be displayed */\n showInstantSearchResults: boolean;\n /** Used to manually set the \"showInstantSearchResults\" value */\n setShowInstantSearchResults: React.Dispatch<React.SetStateAction<boolean>>;\n} => {\n const { options, config, search } = useReactifySearchContext();\n\n const handleSubmitSearchTerm = React.useCallback(\n (searchTerm: string = search.searchTerm) => {\n debug.breadcrumb({\n category: \"search\",\n message: \"search submit\",\n data: {\n searchTerm: searchTerm,\n },\n });\n\n debug.log(\"useSearch\", \"submitSearchTerm[query]\", searchTerm);\n\n if (!searchTerm) {\n return;\n }\n\n const redirect = config.redirects.find(\n (redirect) =>\n redirect.query.trim().toLowerCase() ===\n searchTerm.trim().toLowerCase()\n );\n\n if (redirect) {\n debug.log(\"useSearch\", \"submitSearchTerm[redirect]\", redirect);\n }\n\n search.setShowInstantSearchResults(false);\n\n if (options.onRedirect) {\n options.onRedirect(\n redirect ? \"redirect\" : \"search\",\n redirect ? redirect.url : `/search?q=${searchTerm}`\n );\n } else if (redirect) {\n window.location.href = redirect.url;\n } else {\n window.location.href = `/search?q=${searchTerm}`;\n }\n },\n [search.searchTerm]\n );\n\n const handleSetSearchTerm = React.useCallback(\n (searchTerm: string = \"\") => {\n debug.log(\"useSearch\", \"setSearchTerm[searchTerm]\", searchTerm);\n debug.breadcrumb({\n category: \"search\",\n message: \"search query\",\n data: {\n searchTerm: searchTerm,\n },\n });\n\n search.setSearchTerm(searchTerm);\n },\n [search.searchTerm]\n );\n\n return {\n searchTerm: search.searchTerm,\n setSearchTerm: handleSetSearchTerm,\n submitSearchTerm: handleSubmitSearchTerm,\n showInstantSearchResults:\n !!search.showInstantSearchResults && !!search.searchTerm,\n setShowInstantSearchResults: search.setShowInstantSearchResults,\n };\n};\n"]}
@@ -11,12 +11,12 @@ class ReactifySearchLiquidFactory {
11
11
  this.providerProps = providerProps;
12
12
  }
13
13
  getProvider() {
14
- var _a, _b, _c, _d;
14
+ var _a, _b, _c, _d, _e;
15
15
  const shopifyPermanentDomain = (_a = this.providerProps.shopifyPermanentDomain) !== null && _a !== void 0 ? _a : (_c = (_b = window) === null || _b === void 0 ? void 0 : _b.Shopify) === null || _c === void 0 ? void 0 : _c.shop;
16
16
  if (!shopifyPermanentDomain) {
17
17
  throw new Error("Cannot determine shopifyPermanentDomain from window");
18
18
  }
19
- const collectionHandle = (_d = this.providerProps.collectionHandle) !== null && _d !== void 0 ? _d : window.location.href.split(/\//)[4];
19
+ const collectionHandle = (_d = this.providerProps.collectionHandle) !== null && _d !== void 0 ? _d : (_e = window.location.pathname.split("/")) === null || _e === void 0 ? void 0 : _e[2];
20
20
  if (this.providerProps.mode === "collection" && !collectionHandle) {
21
21
  throw new Error("Cannot determine collectionHandle from URL");
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"liquid.js","sourceRoot":"","sources":["../../../src/utility/liquid.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,8CAGuB;AAEvB,MAAa,2BAA2B;IACtC,YACS,aAMN;QANM,kBAAa,GAAb,aAAa,CAMnB;IACA,CAAC;IAEJ,WAAW;;QACT,MAAM,sBAAsB,GAC1B,MAAA,IAAI,CAAC,aAAa,CAAC,sBAAsB,mCACzC,MAAA,MAAC,MAAc,0CAAE,OAAO,0CAAE,IAAI,CAAC;QACjC,IAAI,CAAC,sBAAsB,EAAE;YAC3B,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;SACxE;QAED,MAAM,gBAAgB,GACpB,MAAA,IAAI,CAAC,aAAa,CAAC,gBAAgB,mCACnC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACtC,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,YAAY,IAAI,CAAC,gBAAgB,EAAE;YACjE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;SAC/D;QAED,MAAM,QAAQ,GAAa,CAAC,KAAK,EAAE,EAAE,CAAC,CACpC,8BAAC,mCAAsB,oBACjB,IAAI,CAAC,aAAa,IACtB,sBAAsB,EAAE,sBAAsB,EAC9C,gBAAgB,EAAE,gBAAgB,KAEjC,KAAK,CAAC,QAAQ,CACQ,CAC1B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,YAAY;QACV,MAAM,SAAS,GAAG,QAAQ,CAAC,cAAc,CACvC,kBAAkB,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAC5C,CAAC;QACF,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,IAAI,KAAK,CACb,kDAAkD,IAAI,CAAC,aAAa,CAAC,IAAI,GAAG,CAC7E,CAAC;SACH;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;QAC1D,IAAI,CAAC,QAAQ,EAAE;YACb,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;SAClE;QAED,IAAI;YACF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAE5C,OAAO,IAAI,CAAC;SACb;QAAC,WAAM;YACN,MAAM,IAAI,KAAK,CACb,kFAAkF,CACnF,CAAC;SACH;IACH,CAAC;CACF;AApED,kEAoEC","sourcesContent":["import React from \"react\";\n\nimport {\n ReactifySearchProvider,\n ReactifySearchProviderProps,\n} from \"../components\";\n\nexport class ReactifySearchLiquidFactory {\n constructor(\n public providerProps: Omit<\n ReactifySearchProviderProps,\n \"shopifyPermanentDomain\"\n > & {\n shopifyPermanentDomain?: string;\n collectionHandle?: string;\n }\n ) {}\n\n getProvider() {\n const shopifyPermanentDomain =\n this.providerProps.shopifyPermanentDomain ??\n (window as any)?.Shopify?.shop;\n if (!shopifyPermanentDomain) {\n throw new Error(\"Cannot determine shopifyPermanentDomain from window\");\n }\n\n const collectionHandle =\n this.providerProps.collectionHandle ??\n window.location.href.split(/\\//)[4];\n if (this.providerProps.mode === \"collection\" && !collectionHandle) {\n throw new Error(\"Cannot determine collectionHandle from URL\");\n }\n\n const provider: React.FC = (props) => (\n <ReactifySearchProvider\n {...this.providerProps}\n shopifyPermanentDomain={shopifyPermanentDomain}\n collectionHandle={collectionHandle}\n >\n {props.children}\n </ReactifySearchProvider>\n );\n\n return provider;\n }\n\n getMountNode() {\n const mountNode = document.getElementById(\n `reactify-mount-${this.providerProps.mode}`\n );\n if (!mountNode) {\n throw new Error(\n `Cannot find mount node with ID \"reactify-mount-${this.providerProps.mode}\"`\n );\n }\n\n return mountNode;\n }\n\n getData() {\n const dataNode = document.getElementById(\"reactify-data\");\n if (!dataNode) {\n throw new Error(`Cannot find data node with ID \"reactify-data\"`);\n }\n\n try {\n const data = JSON.parse(dataNode.innerHTML);\n\n return data;\n } catch {\n throw new Error(\n `Cannot parse the data node with ID \"reactify-data\", check your liquid formatting`\n );\n }\n }\n}\n"]}
1
+ {"version":3,"file":"liquid.js","sourceRoot":"","sources":["../../../src/utility/liquid.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,8CAGuB;AAEvB,MAAa,2BAA2B;IACtC,YACS,aAMN;QANM,kBAAa,GAAb,aAAa,CAMnB;IACA,CAAC;IAEJ,WAAW;;QACT,MAAM,sBAAsB,GAC1B,MAAA,IAAI,CAAC,aAAa,CAAC,sBAAsB,mCACzC,MAAA,MAAC,MAAc,0CAAE,OAAO,0CAAE,IAAI,CAAC;QAEjC,IAAI,CAAC,sBAAsB,EAAE;YAC3B,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;SACxE;QAED,MAAM,gBAAgB,GACpB,MAAA,IAAI,CAAC,aAAa,CAAC,gBAAgB,mCACnC,MAAA,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,0CAAG,CAAC,CAAC,CAAC;QAE3C,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,YAAY,IAAI,CAAC,gBAAgB,EAAE;YACjE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;SAC/D;QAED,MAAM,QAAQ,GAAa,CAAC,KAAK,EAAE,EAAE,CAAC,CACpC,8BAAC,mCAAsB,oBACjB,IAAI,CAAC,aAAa,IACtB,sBAAsB,EAAE,sBAAsB,EAC9C,gBAAgB,EAAE,gBAAgB,KAEjC,KAAK,CAAC,QAAQ,CACQ,CAC1B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,YAAY;QACV,MAAM,SAAS,GAAG,QAAQ,CAAC,cAAc,CACvC,kBAAkB,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAC5C,CAAC;QACF,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,IAAI,KAAK,CACb,kDAAkD,IAAI,CAAC,aAAa,CAAC,IAAI,GAAG,CAC7E,CAAC;SACH;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;QAC1D,IAAI,CAAC,QAAQ,EAAE;YACb,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;SAClE;QAED,IAAI;YACF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAE5C,OAAO,IAAI,CAAC;SACb;QAAC,WAAM;YACN,MAAM,IAAI,KAAK,CACb,kFAAkF,CACnF,CAAC;SACH;IACH,CAAC;CACF;AAtED,kEAsEC","sourcesContent":["import React from \"react\";\n\nimport {\n ReactifySearchProvider,\n ReactifySearchProviderProps,\n} from \"../components\";\n\nexport class ReactifySearchLiquidFactory {\n constructor(\n public providerProps: Omit<\n ReactifySearchProviderProps,\n \"shopifyPermanentDomain\"\n > & {\n shopifyPermanentDomain?: string;\n collectionHandle?: string;\n }\n ) {}\n\n getProvider() {\n const shopifyPermanentDomain =\n this.providerProps.shopifyPermanentDomain ??\n (window as any)?.Shopify?.shop;\n\n if (!shopifyPermanentDomain) {\n throw new Error(\"Cannot determine shopifyPermanentDomain from window\");\n }\n\n const collectionHandle =\n this.providerProps.collectionHandle ??\n window.location.pathname.split(\"/\")?.[2];\n\n if (this.providerProps.mode === \"collection\" && !collectionHandle) {\n throw new Error(\"Cannot determine collectionHandle from URL\");\n }\n\n const provider: React.FC = (props) => (\n <ReactifySearchProvider\n {...this.providerProps}\n shopifyPermanentDomain={shopifyPermanentDomain}\n collectionHandle={collectionHandle}\n >\n {props.children}\n </ReactifySearchProvider>\n );\n\n return provider;\n }\n\n getMountNode() {\n const mountNode = document.getElementById(\n `reactify-mount-${this.providerProps.mode}`\n );\n if (!mountNode) {\n throw new Error(\n `Cannot find mount node with ID \"reactify-mount-${this.providerProps.mode}\"`\n );\n }\n\n return mountNode;\n }\n\n getData() {\n const dataNode = document.getElementById(\"reactify-data\");\n if (!dataNode) {\n throw new Error(`Cannot find data node with ID \"reactify-data\"`);\n }\n\n try {\n const data = JSON.parse(dataNode.innerHTML);\n\n return data;\n } catch {\n throw new Error(\n `Cannot parse the data node with ID \"reactify-data\", check your liquid formatting`\n );\n }\n }\n}\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.0-beta.3",
4
+ "version": "5.2.1-beta.0",
5
5
  "license": "MIT",
6
6
  "main": "dist/src/index.js",
7
7
  "types": "dist/src/index.d.ts",