@usereactify/search 5.0.0-beta.12 → 5.0.0-beta.13

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 (94) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +3 -21
  3. package/dist/package.json +1 -1
  4. package/dist/src/components/Example/ExampleFilters.d.ts +4 -0
  5. package/dist/src/components/Example/{ExampleFilterStack.js → ExampleFilters.js} +4 -4
  6. package/dist/src/components/Example/ExampleFilters.js.map +1 -0
  7. package/dist/src/components/Example/ExampleSortBy.d.ts +4 -0
  8. package/dist/src/components/Example/{ExampleSortby.js → ExampleSortBy.js} +4 -4
  9. package/dist/src/components/Example/{ExampleSortby.js.map → ExampleSortBy.js.map} +1 -1
  10. package/dist/src/components/Example/index.d.ts +2 -2
  11. package/dist/src/components/Example/index.js +2 -2
  12. package/dist/src/components/Example/index.js.map +1 -1
  13. package/dist/src/components/Filter/Filters.d.ts +7 -0
  14. package/dist/src/components/Filter/{FilterStack.js → Filters.js} +6 -6
  15. package/dist/src/components/Filter/Filters.js.map +1 -0
  16. package/dist/src/components/Filter/index.d.ts +1 -1
  17. package/dist/src/components/Filter/index.js +1 -1
  18. package/dist/src/components/Filter/index.js.map +1 -1
  19. package/dist/src/components/{ReactifySearchBase/ReactifySearchBase.d.ts → ReactifySearchProvider/ReactifySearchProvider.d.ts} +5 -9
  20. package/dist/src/components/{ReactifySearchBase/ReactifySearchBase.js → ReactifySearchProvider/ReactifySearchProvider.js} +12 -11
  21. package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js.map +1 -0
  22. package/dist/src/components/ReactifySearchProvider/index.d.ts +1 -0
  23. package/dist/src/components/{ReactifySearchBase → ReactifySearchProvider}/index.js +1 -1
  24. package/dist/src/components/ReactifySearchProvider/index.js.map +1 -0
  25. package/dist/src/components/Result/{ResultStack.d.ts → Results.d.ts} +2 -2
  26. package/dist/src/components/Result/{ResultStack.js → Results.js} +43 -26
  27. package/dist/src/components/Result/Results.js.map +1 -0
  28. package/dist/src/components/Result/index.d.ts +1 -1
  29. package/dist/src/components/Result/index.js +1 -1
  30. package/dist/src/components/Result/index.js.map +1 -1
  31. package/dist/src/components/Sensor/SensorCollection.js +2 -2
  32. package/dist/src/components/Sensor/SensorCollection.js.map +1 -1
  33. package/dist/src/components/Sensor/SensorInventoryAvailable.js +1 -1
  34. package/dist/src/components/Sensor/SensorInventoryAvailable.js.map +1 -1
  35. package/dist/src/components/Sensor/SensorSort.js +13 -13
  36. package/dist/src/components/Sensor/SensorSort.js.map +1 -1
  37. package/dist/src/components/Sensor/Sensors.d.ts +3 -0
  38. package/dist/src/components/Sensor/{SensorStack.js → Sensors.js} +4 -4
  39. package/dist/src/components/Sensor/Sensors.js.map +1 -0
  40. package/dist/src/components/Sensor/index.d.ts +1 -1
  41. package/dist/src/components/Sensor/index.js +1 -1
  42. package/dist/src/components/Sensor/index.js.map +1 -1
  43. package/dist/src/components/SortBy/SortBy.d.ts +7 -0
  44. package/dist/src/components/{Sortby/Sortby.js → SortBy/SortBy.js} +7 -7
  45. package/dist/src/components/SortBy/SortBy.js.map +1 -0
  46. package/dist/src/components/SortBy/index.d.ts +1 -0
  47. package/dist/src/components/{Sortby → SortBy}/index.js +1 -1
  48. package/dist/src/components/{Sortby → SortBy}/index.js.map +1 -1
  49. package/dist/src/components/index.d.ts +2 -2
  50. package/dist/src/components/index.js +2 -2
  51. package/dist/src/components/index.js.map +1 -1
  52. package/dist/src/hooks/index.d.ts +2 -3
  53. package/dist/src/hooks/index.js +2 -3
  54. package/dist/src/hooks/index.js.map +1 -1
  55. package/dist/src/hooks/reactivesearch/useReactiveReactProp.js +4 -4
  56. package/dist/src/hooks/reactivesearch/useReactiveReactProp.js.map +1 -1
  57. package/dist/src/hooks/reactivesearch/useReactiveReactiveListProps.js +1 -1
  58. package/dist/src/hooks/reactivesearch/useReactiveReactiveListProps.js.map +1 -1
  59. package/dist/src/hooks/useCuration.js +2 -6
  60. package/dist/src/hooks/useCuration.js.map +1 -1
  61. package/dist/src/hooks/useFilters.d.ts +3 -2
  62. package/dist/src/hooks/useFilters.js +45 -11
  63. package/dist/src/hooks/useFilters.js.map +1 -1
  64. package/dist/src/hooks/usePaginationLoadMore.js +1 -1
  65. package/dist/src/hooks/usePaginationLoadMore.js.map +1 -1
  66. package/dist/src/hooks/useReactifySearchContext.d.ts +4 -12
  67. package/dist/src/hooks/useReactifySearchContext.js.map +1 -1
  68. package/dist/src/hooks/useSearch.d.ts +1 -1
  69. package/dist/src/hooks/useSearch.js +25 -5
  70. package/dist/src/hooks/useSearch.js.map +1 -1
  71. package/dist/src/hooks/{useSortby.d.ts → useSortBy.d.ts} +1 -1
  72. package/dist/src/hooks/{useSortby.js → useSortBy.js} +5 -7
  73. package/dist/src/hooks/useSortBy.js.map +1 -0
  74. package/dist/src/utility/debug.d.ts +1 -1
  75. package/dist/src/utility/debug.js.map +1 -1
  76. package/package.json +1 -1
  77. package/dist/src/components/Example/ExampleFilterStack.d.ts +0 -4
  78. package/dist/src/components/Example/ExampleFilterStack.js.map +0 -1
  79. package/dist/src/components/Example/ExampleSortby.d.ts +0 -4
  80. package/dist/src/components/Filter/FilterStack.d.ts +0 -7
  81. package/dist/src/components/Filter/FilterStack.js.map +0 -1
  82. package/dist/src/components/ReactifySearchBase/ReactifySearchBase.js.map +0 -1
  83. package/dist/src/components/ReactifySearchBase/index.d.ts +0 -1
  84. package/dist/src/components/ReactifySearchBase/index.js.map +0 -1
  85. package/dist/src/components/Result/ResultStack.js.map +0 -1
  86. package/dist/src/components/Sensor/SensorStack.d.ts +0 -3
  87. package/dist/src/components/Sensor/SensorStack.js.map +0 -1
  88. package/dist/src/components/Sortby/Sortby.d.ts +0 -7
  89. package/dist/src/components/Sortby/Sortby.js.map +0 -1
  90. package/dist/src/components/Sortby/index.d.ts +0 -1
  91. package/dist/src/hooks/useFilterStack.d.ts +0 -4
  92. package/dist/src/hooks/useFilterStack.js +0 -52
  93. package/dist/src/hooks/useFilterStack.js.map +0 -1
  94. package/dist/src/hooks/useSortby.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
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.0.0-beta.13](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.12...v5.0.0-beta.13) (2022-08-03)
6
+
7
+
8
+ ### Features
9
+
10
+ * add breadcrumb for ES search result errors ([22ae301](https://bitbucket.org/usereactify/reactify-search-ui/commit/22ae301bbb7618aec14499970ffd2578ab569a7a))
11
+ * add breadcrumb for search query update ([6a2e442](https://bitbucket.org/usereactify/reactify-search-ui/commit/6a2e44269396353fced1d597d48502ef5b1a6bb2))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * use correct names of components and imports ([e180a75](https://bitbucket.org/usereactify/reactify-search-ui/commit/e180a75b0c4be555a61d72e48a54434b7aa27960))
17
+
5
18
  ## [5.0.0-beta.12](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.11...v5.0.0-beta.12) (2022-07-27)
6
19
 
7
20
 
package/README.md CHANGED
@@ -4,25 +4,9 @@ This library provides React components and hooks for building UI's for the [Reac
4
4
 
5
5
  The aim of this library is not to build a search and filter interface from the ground up. The aim of this library is to abstract the complexities of Reactify Search, whilst providing the developer a wide range of approaches and escape hatches to build in the way they want to. To do this, we wrap a mature Elasticsearch UI library called [Reactivesearch](https://github.com/appbaseio/reactivesearch) (similar name, but completely unaffiliated with Reactify Search).
6
6
 
7
- ## Getting started
7
+ ## Documentation
8
8
 
9
- ```sh
10
- npm install @reactify-apps/search
11
- ```
12
-
13
- You should always begin with the `Provider` component, which you need to pass the Reactify Search config and index name, using whichever mechanism is most appropriate for your project. Within the provider, you can then begin to render components from the `@reactify-apps/search` package or ordinary [Reactivesearch](https://github.com/appbaseio/reactivesearch) components.
14
-
15
- ```tsx
16
- import { Provider } from "@reactify-apps/search";
17
-
18
- export const YourComponent: React.FC = () => {
19
- return (
20
- <Provider index="my-cool-shop" config={config}>
21
- <YourComponents />
22
- </Provider>
23
- );
24
- };
25
- ```
9
+ All end-user documentation is available at https://search.docs.reactify.com.au which is powered by GitBooks.
26
10
 
27
11
  ## Contributing
28
12
 
@@ -40,7 +24,5 @@ npm run storybook
40
24
  npm run release
41
25
 
42
26
  # release a beta version
43
- npm run release -- --prerelease beta
44
-
45
- npm publish --tag beta
27
+ npm run release:beta
46
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.0.0-beta.12",
4
+ "version": "5.0.0-beta.13",
5
5
  "license": "MIT",
6
6
  "main": "dist/src/index.js",
7
7
  "types": "dist/src/index.d.ts",
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { FiltersProps } from "../../components";
3
+ export declare type ExampleFiltersProps = React.ComponentProps<NonNullable<FiltersProps["renderFilters"]>>;
4
+ export declare const ExampleFilters: React.FC<ExampleFiltersProps>;
@@ -3,12 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ExampleFilterStack = void 0;
6
+ exports.ExampleFilters = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const components_1 = require("../../components");
9
- const ExampleFilterStack = (props) => {
9
+ const ExampleFilters = (props) => {
10
10
  var _a;
11
11
  return (react_1.default.createElement(react_1.default.Fragment, null, (_a = props.filterStack) === null || _a === void 0 ? void 0 : _a.options.map((filter) => (react_1.default.createElement(components_1.Filter, Object.assign({ key: filter.id, filter: filter }, props))))));
12
12
  };
13
- exports.ExampleFilterStack = ExampleFilterStack;
14
- //# sourceMappingURL=ExampleFilterStack.js.map
13
+ exports.ExampleFilters = ExampleFilters;
14
+ //# sourceMappingURL=ExampleFilters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExampleFilters.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilters.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAAwD;AAMjD,MAAM,cAAc,GAAkC,CAAC,KAAK,EAAE,EAAE;;IACrE,OAAO,CACL,8DACG,MAAA,KAAK,CAAC,WAAW,0CAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC1C,8BAAC,mBAAM,kBAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,IAAM,KAAK,EAAI,CACtD,CAAC,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,cAAc,kBAQzB","sourcesContent":["import React from \"react\";\n\nimport { Filter, FiltersProps } from \"../../components\";\n\nexport type ExampleFiltersProps = React.ComponentProps<\n NonNullable<FiltersProps[\"renderFilters\"]>\n>;\n\nexport const ExampleFilters: React.FC<ExampleFiltersProps> = (props) => {\n return (\n <>\n {props.filterStack?.options.map((filter) => (\n <Filter key={filter.id} filter={filter} {...props} />\n ))}\n </>\n );\n};\n"]}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { SortByProps } from "../../components";
3
+ export declare type ExampleSortByProps = React.ComponentProps<NonNullable<SortByProps["renderSortOptions"]>>;
4
+ export declare const ExampleSortBy: React.FC<ExampleSortByProps>;
@@ -3,11 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ExampleSortby = void 0;
6
+ exports.ExampleSortBy = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
- const ExampleSortby = (props) => {
8
+ const ExampleSortBy = (props) => {
9
9
  var _a;
10
10
  return (react_1.default.createElement("select", { className: "rs__sortby__select", value: (_a = props.sortOption) === null || _a === void 0 ? void 0 : _a.handle, onChange: (event) => props.setSortOption(event.target.value) }, props.sortOptions.map((sortOption) => (react_1.default.createElement("option", { key: sortOption.handle, className: "rs__sortby__option", value: sortOption.handle }, sortOption.name)))));
11
11
  };
12
- exports.ExampleSortby = ExampleSortby;
13
- //# sourceMappingURL=ExampleSortby.js.map
12
+ exports.ExampleSortBy = ExampleSortBy;
13
+ //# sourceMappingURL=ExampleSortBy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleSortby.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleSortby.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,aAAa,GAAiC,CAAC,KAAK,EAAE,EAAE;;IACnE,OAAO,CACL,0CACE,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAE,MAAA,KAAK,CAAC,UAAU,0CAAE,MAAM,EAC/B,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAE3D,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CACrC,0CACE,GAAG,EAAE,UAAU,CAAC,MAAM,EACtB,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAE,UAAU,CAAC,MAAM,IAEvB,UAAU,CAAC,IAAI,CACT,CACV,CAAC,CACK,CACV,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,aAAa,iBAkBxB","sourcesContent":["import React from \"react\";\n\nimport { SortbyProps } from \"../../components\";\n\nexport type ExampleSortbyProps = React.ComponentProps<\n NonNullable<SortbyProps[\"renderSortOptions\"]>\n>;\n\nexport const ExampleSortby: React.FC<ExampleSortbyProps> = (props) => {\n return (\n <select\n className=\"rs__sortby__select\"\n value={props.sortOption?.handle}\n onChange={(event) => props.setSortOption(event.target.value)}\n >\n {props.sortOptions.map((sortOption) => (\n <option\n key={sortOption.handle}\n className=\"rs__sortby__option\"\n value={sortOption.handle}\n >\n {sortOption.name}\n </option>\n ))}\n </select>\n );\n};\n"]}
1
+ {"version":3,"file":"ExampleSortBy.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleSortBy.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,aAAa,GAAiC,CAAC,KAAK,EAAE,EAAE;;IACnE,OAAO,CACL,0CACE,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAE,MAAA,KAAK,CAAC,UAAU,0CAAE,MAAM,EAC/B,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAE3D,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CACrC,0CACE,GAAG,EAAE,UAAU,CAAC,MAAM,EACtB,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAE,UAAU,CAAC,MAAM,IAEvB,UAAU,CAAC,IAAI,CACT,CACV,CAAC,CACK,CACV,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,aAAa,iBAkBxB","sourcesContent":["import React from \"react\";\n\nimport { SortByProps } from \"../../components\";\n\nexport type ExampleSortByProps = React.ComponentProps<\n NonNullable<SortByProps[\"renderSortOptions\"]>\n>;\n\nexport const ExampleSortBy: React.FC<ExampleSortByProps> = (props) => {\n return (\n <select\n className=\"rs__sortby__select\"\n value={props.sortOption?.handle}\n onChange={(event) => props.setSortOption(event.target.value)}\n >\n {props.sortOptions.map((sortOption) => (\n <option\n key={sortOption.handle}\n className=\"rs__sortby__option\"\n value={sortOption.handle}\n >\n {sortOption.name}\n </option>\n ))}\n </select>\n );\n};\n"]}
@@ -1,10 +1,10 @@
1
1
  export * from "./ExampleFilterList";
2
2
  export * from "./ExampleFilterRange";
3
3
  export * from "./ExampleFilterSlider";
4
- export * from "./ExampleFilterStack";
4
+ export * from "./ExampleFilters";
5
5
  export * from "./ExampleResultCardCallout";
6
6
  export * from "./ExampleResultCardProduct";
7
7
  export * from "./ExampleResultPaginationNumbered";
8
8
  export * from "./ExampleResultPaginationLoadMore";
9
9
  export * from "./ExampleResultPaginationNextPrev";
10
- export * from "./ExampleSortby";
10
+ export * from "./ExampleSortBy";
@@ -13,11 +13,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./ExampleFilterList"), exports);
14
14
  __exportStar(require("./ExampleFilterRange"), exports);
15
15
  __exportStar(require("./ExampleFilterSlider"), exports);
16
- __exportStar(require("./ExampleFilterStack"), exports);
16
+ __exportStar(require("./ExampleFilters"), exports);
17
17
  __exportStar(require("./ExampleResultCardCallout"), exports);
18
18
  __exportStar(require("./ExampleResultCardProduct"), exports);
19
19
  __exportStar(require("./ExampleResultPaginationNumbered"), exports);
20
20
  __exportStar(require("./ExampleResultPaginationLoadMore"), exports);
21
21
  __exportStar(require("./ExampleResultPaginationNextPrev"), exports);
22
- __exportStar(require("./ExampleSortby"), exports);
22
+ __exportStar(require("./ExampleSortBy"), exports);
23
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Example/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sDAAoC;AACpC,uDAAqC;AACrC,wDAAsC;AACtC,uDAAqC;AACrC,6DAA0C;AAC1C,6DAA2C;AAC3C,oEAAkD;AAClD,oEAAkD;AAClD,oEAAkD;AAClD,kDAAgC","sourcesContent":["export * from \"./ExampleFilterList\";\nexport * from \"./ExampleFilterRange\";\nexport * from \"./ExampleFilterSlider\";\nexport * from \"./ExampleFilterStack\";\nexport * from \"./ExampleResultCardCallout\"\nexport * from \"./ExampleResultCardProduct\";\nexport * from \"./ExampleResultPaginationNumbered\";\nexport * from \"./ExampleResultPaginationLoadMore\";\nexport * from \"./ExampleResultPaginationNextPrev\";\nexport * from \"./ExampleSortby\";"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Example/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sDAAoC;AACpC,uDAAqC;AACrC,wDAAsC;AACtC,mDAAiC;AACjC,6DAA2C;AAC3C,6DAA2C;AAC3C,oEAAkD;AAClD,oEAAkD;AAClD,oEAAkD;AAClD,kDAAgC","sourcesContent":["export * from \"./ExampleFilterList\";\nexport * from \"./ExampleFilterRange\";\nexport * from \"./ExampleFilterSlider\";\nexport * from \"./ExampleFilters\";\nexport * from \"./ExampleResultCardCallout\";\nexport * from \"./ExampleResultCardProduct\";\nexport * from \"./ExampleResultPaginationNumbered\";\nexport * from \"./ExampleResultPaginationLoadMore\";\nexport * from \"./ExampleResultPaginationNextPrev\";\nexport * from \"./ExampleSortBy\";\n"]}
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import { useFilters } from "../../hooks";
3
+ export declare type FiltersProps = {
4
+ /** Render method called once for all filters */
5
+ renderFilters?: React.FC<ReturnType<typeof useFilters>>;
6
+ };
7
+ export declare const Filters: React.FC<FiltersProps>;
@@ -3,15 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.FilterStack = void 0;
6
+ exports.Filters = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const hooks_1 = require("../../hooks");
9
9
  const components_1 = require("../../components");
10
- const FilterStack = (props) => {
10
+ const Filters = (props) => {
11
11
  var _a;
12
- const filterStackHook = (0, hooks_1.useFilterStack)();
13
- const RenderFiltersComponent = (_a = props.renderFilters) !== null && _a !== void 0 ? _a : components_1.ExampleFilterStack;
12
+ const filterStackHook = (0, hooks_1.useFilters)();
13
+ const RenderFiltersComponent = (_a = props.renderFilters) !== null && _a !== void 0 ? _a : components_1.ExampleFilters;
14
14
  return react_1.default.createElement(RenderFiltersComponent, Object.assign({}, filterStackHook));
15
15
  };
16
- exports.FilterStack = FilterStack;
17
- //# sourceMappingURL=FilterStack.js.map
16
+ exports.Filters = Filters;
17
+ //# sourceMappingURL=Filters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Filters.js","sourceRoot":"","sources":["../../../../src/components/Filter/Filters.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAAyC;AACzC,iDAAkD;AAO3C,MAAM,OAAO,GAA2B,CAAC,KAAK,EAAE,EAAE;;IACvD,MAAM,eAAe,GAAG,IAAA,kBAAU,GAAE,CAAC;IAErC,MAAM,sBAAsB,GAAG,MAAA,KAAK,CAAC,aAAa,mCAAI,2BAAc,CAAC;IAErE,OAAO,8BAAC,sBAAsB,oBAAK,eAAe,EAAI,CAAC;AACzD,CAAC,CAAC;AANW,QAAA,OAAO,WAMlB","sourcesContent":["import React from \"react\";\n\nimport { useFilters } from \"../../hooks\";\nimport { ExampleFilters } from \"../../components\";\n\nexport type FiltersProps = {\n /** Render method called once for all filters */\n renderFilters?: React.FC<ReturnType<typeof useFilters>>;\n};\n\nexport const Filters: React.FC<FiltersProps> = (props) => {\n const filterStackHook = useFilters();\n\n const RenderFiltersComponent = props.renderFilters ?? ExampleFilters;\n\n return <RenderFiltersComponent {...filterStackHook} />;\n};\n"]}
@@ -1,2 +1,2 @@
1
1
  export * from "./Filter";
2
- export * from "./FilterStack";
2
+ export * from "./Filters";
@@ -11,5 +11,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./Filter"), exports);
14
- __exportStar(require("./FilterStack"), exports);
14
+ __exportStar(require("./Filters"), exports);
15
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Filter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB;AACzB,gDAA8B","sourcesContent":["export * from \"./Filter\";\nexport * from \"./FilterStack\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Filter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB;AACzB,4CAA0B","sourcesContent":["export * from \"./Filter\";\nexport * from \"./Filters\";\n"]}
@@ -1,16 +1,16 @@
1
1
  import React from "react";
2
- export declare type ReactifySearchBaseProps = {
2
+ export declare type ReactifySearchProviderProps = {
3
3
  /** The search area the provider will be used in */
4
4
  mode: "search" | "collection" | "instant-search";
5
5
  /** Shopify store domain used to resolve the site configuration */
6
6
  shopifyPermanentDomain: string;
7
7
  /** Specific filter group handle, used to override automated logic */
8
- filterStackHandle?: string;
8
+ filtersHandle?: string;
9
9
  /** Callback function for redirects, suitable for headless sites to avoid full page refresh */
10
10
  onRedirect?: (type: "redirect" | "search", url: string) => void;
11
11
  /** Render method to display a component when the config is loading */
12
12
  renderBooting?: () => JSX.Element | null;
13
- /** Advanced usage: Allows you to wrap the ReactifySearchBase in your own ReactiveBase component */
13
+ /** Advanced usage: Allows you to wrap the ReactifySearchProvider in your own ReactiveBase component */
14
14
  noReactiveBase?: boolean;
15
15
  /** Advanced usage: Array of additional component IDs managed outside of Reactify Search */
16
16
  additionalComponentHandles?: string[];
@@ -31,12 +31,8 @@ export declare type ReactifySearchBaseProps = {
31
31
  } | {
32
32
  mode: "collection";
33
33
  /** Collection object that includes the handle, used to find curations */
34
- collection: {
35
- id: number;
36
- title: string;
37
- handle: string;
38
- };
34
+ collectionHandle: string;
39
35
  } | {
40
36
  mode: "instant-search";
41
37
  });
42
- export declare const ReactifySearchBase: React.FC<ReactifySearchBaseProps>;
38
+ export declare const ReactifySearchProvider: React.FC<ReactifySearchProviderProps>;
@@ -22,27 +22,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
22
22
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.ReactifySearchBase = void 0;
25
+ exports.ReactifySearchProvider = void 0;
26
26
  const react_1 = __importDefault(require("react"));
27
27
  const Sentry = __importStar(require("@sentry/react"));
28
28
  const hooks_1 = require("../../hooks");
29
29
  const components_1 = require("../../components");
30
30
  const utility_1 = require("../../utility");
31
- const ReactifySearchBase = (props) => {
31
+ const ReactifySearchProvider = (props) => {
32
32
  react_1.default.useEffect(() => {
33
- utility_1.debug.log("ReactifySearchBase", "props", props);
33
+ utility_1.debug.log("ReactifySearchProvider", "props", props);
34
34
  Sentry.setTags({
35
35
  "reactifysearch.index": props.index,
36
36
  "reactifysearch.shop": props.shopifyPermanentDomain,
37
37
  "reactifysearch.mode": props.mode,
38
- "reactifysearch.collection": props.mode === "collection" ? props.collection.handle : undefined,
39
- "reactifysearch.filter": props.filterStackHandle,
38
+ "reactifysearch.collection": props.mode === "collection" ? props.collectionHandle : undefined,
39
+ "reactifysearch.filter": props.filtersHandle,
40
40
  });
41
41
  }, [props]);
42
42
  return (react_1.default.createElement(Sentry.ErrorBoundary, { fallback: react_1.default.createElement("p", null, "An error has occurred") },
43
43
  react_1.default.createElement(ReactifySearchInner, Object.assign({}, props))));
44
44
  };
45
- exports.ReactifySearchBase = ReactifySearchBase;
45
+ exports.ReactifySearchProvider = ReactifySearchProvider;
46
46
  const ReactifySearchInner = (props) => {
47
47
  var _a, _b;
48
48
  const { config } = (0, hooks_1.useConfig)(props.shopifyPermanentDomain, props.configId);
@@ -99,9 +99,9 @@ const ReactifySearchInner = (props) => {
99
99
  if (!config) {
100
100
  return;
101
101
  }
102
- const memoValue = {
102
+ return {
103
103
  config: config,
104
- options: Object.assign(Object.assign({}, props), { index: (_a = props.index) !== null && _a !== void 0 ? _a : config.index, filterStackHandle: props.filterStackHandle, credentials: credentials, theme: theme }),
104
+ options: Object.assign(Object.assign({}, props), { index: (_a = props.index) !== null && _a !== void 0 ? _a : config.index, filtersHandle: props.filtersHandle, credentials: credentials, theme: theme }),
105
105
  search: {
106
106
  searchQuery: searchQuery,
107
107
  setSearchQuery: setSearchQuery,
@@ -113,9 +113,10 @@ const ReactifySearchInner = (props) => {
113
113
  setSortOption: setSortOption,
114
114
  },
115
115
  };
116
- utility_1.debug.log("ReactifySearchBase", "context", memoValue);
117
- return memoValue;
118
116
  }, [config, props, searchQuery, instantSearchVisible, sortOption]);
117
+ utility_1.debug.hook("ReactifySearchProvider", "context", contextValue);
118
+ utility_1.debug.hook("ReactifySearchProvider", "searchQuery", searchQuery);
119
+ utility_1.debug.hook("ReactifySearchProvider", "sortOption", sortOption);
119
120
  if (!contextValue) {
120
121
  if (props.renderBooting) {
121
122
  return props.renderBooting();
@@ -128,4 +129,4 @@ const ReactifySearchInner = (props) => {
128
129
  return (react_1.default.createElement(hooks_1.ReactifySearchContext.Provider, { value: contextValue },
129
130
  react_1.default.createElement(components_1.UtilityAuthenticatedReactiveBase, null, props.children)));
130
131
  };
131
- //# sourceMappingURL=ReactifySearchBase.js.map
132
+ //# sourceMappingURL=ReactifySearchProvider.js.map
@@ -0,0 +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,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,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS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AQ,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 /** Specific filter group handle, used to override automated logic */\n filtersHandle?: 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: 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 additionalComponentHandles?: 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 [searchQuery, setSearchQuery] = React.useState<string>(\"\");\n const [instantSearchVisible, setInstantSearchVisible] =\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 searchQueryFromURL = 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 (searchQueryFromURL && searchQuery !== searchQueryFromURL) {\n setSearchQuery(searchQueryFromURL);\n }\n }, [searchQueryFromURL]);\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 searchQuery: searchQuery,\n setSearchQuery: setSearchQuery,\n instantSearchVisible: instantSearchVisible,\n setInstantSearchVisible: setInstantSearchVisible,\n },\n sortby: {\n sortOption: sortOption,\n setSortOption: setSortOption,\n },\n };\n }, [config, props, searchQuery, instantSearchVisible, sortOption]);\n\n debug.hook(\"ReactifySearchProvider\", \"context\", contextValue);\n debug.hook(\"ReactifySearchProvider\", \"searchQuery\", searchQuery);\n debug.hook(\"ReactifySearchProvider\", \"sortOption\", sortOption);\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"]}
@@ -0,0 +1 @@
1
+ export * from "./ReactifySearchProvider";
@@ -10,5 +10,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./ReactifySearchBase"), exports);
13
+ __exportStar(require("./ReactifySearchProvider"), exports);
14
14
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ReactifySearchProvider/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAAyC","sourcesContent":["export * from \"./ReactifySearchProvider\";\n"]}
@@ -9,7 +9,7 @@ export declare type ResultProps = ReactivesearchResultProps & {
9
9
  callouts: ElasticCallout[];
10
10
  products: ElasticProduct[];
11
11
  };
12
- export declare type ResultStackProps = {
12
+ export declare type ResultsProps = {
13
13
  /** Style prop for the list wrapper */
14
14
  listStyle?: React.HTMLAttributes<HTMLElement>["style"];
15
15
  /** Classname prop for the list wrapper */
@@ -37,4 +37,4 @@ export declare type ResultStackProps = {
37
37
  /** Advanced Usage: Override the default amount of results per page */
38
38
  pageSize?: number;
39
39
  };
40
- export declare const ResultStack: React.FC<ResultStackProps>;
40
+ export declare const Results: React.FC<ResultsProps>;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ResultStack = void 0;
6
+ exports.Results = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const ReactiveList_1 = __importDefault(require("@appbaseio/reactivesearch/lib/components/result/ReactiveList"));
9
9
  const ResultCardCallout_1 = require("./ResultCardCallout");
@@ -11,27 +11,28 @@ const ResultCardProduct_1 = require("./ResultCardProduct");
11
11
  const ResultPaginationNumbered_1 = require("./ResultPaginationNumbered");
12
12
  const ResultPaginationLoadMore_1 = require("./ResultPaginationLoadMore");
13
13
  const ResultPaginationNextPrev_1 = require("./ResultPaginationNextPrev");
14
- const hooks_1 = require("../../hooks");
15
14
  const types_1 = require("../../types");
16
- const ResultStack = (props) => {
15
+ const hooks_1 = require("../../hooks");
16
+ const utility_1 = require("../../utility");
17
+ const Results = (props) => {
17
18
  const reactiveReactiveListProps = (0, hooks_1.useReactiveReactiveListProps)({
18
19
  pageSize: props.pageSize,
19
20
  });
20
- return (react_1.default.createElement(ReactiveList_1.default, Object.assign({}, reactiveReactiveListProps, { render: (reactivesearchResultProps) => (react_1.default.createElement(ResultStackInner, Object.assign({}, props, { reactivesearchResultProps: reactivesearchResultProps }))), renderPagination: (reactivesearchPaginationProps) => (react_1.default.createElement(ResultStackPaginationStack, Object.assign({}, props, reactivesearchPaginationProps))) })));
21
+ return (react_1.default.createElement(ReactiveList_1.default, Object.assign({}, reactiveReactiveListProps, { render: (reactivesearchResultProps) => (react_1.default.createElement(ResultsInner, Object.assign({}, props, { reactivesearchResultProps: reactivesearchResultProps }))), renderPagination: (reactivesearchPaginationProps) => (react_1.default.createElement(ResultsPaginationStack, Object.assign({}, props, reactivesearchPaginationProps))) })));
21
22
  };
22
- exports.ResultStack = ResultStack;
23
- const ResultStackRenderErrorComponent = (props) => {
23
+ exports.Results = Results;
24
+ const ResultsRenderErrorComponent = (props) => {
24
25
  return (react_1.default.createElement("div", null,
25
26
  "Error: ",
26
27
  props.error.statusText));
27
28
  };
28
- const ResultStackRenderLoadingComponent = () => {
29
+ const ResultsRenderLoadingComponent = () => {
29
30
  return react_1.default.createElement("div", null, "Loading");
30
31
  };
31
- const ResultStackRenderNoResultsComponent = () => {
32
+ const ResultsRenderNoResultsComponent = () => {
32
33
  return react_1.default.createElement("div", null, "No results");
33
34
  };
34
- const ResultStackInner = (props) => {
35
+ const ResultsInner = (props) => {
35
36
  var _a, _b, _c;
36
37
  const { track } = (0, hooks_1.useAnalytics)();
37
38
  const { searchQuery } = (0, hooks_1.useSearch)();
@@ -45,24 +46,40 @@ const ResultStackInner = (props) => {
45
46
  gridTemplateColumns: "repeat(4, minmax(0, 1fr))",
46
47
  };
47
48
  }, [props.listStyle]);
49
+ react_1.default.useEffect(() => {
50
+ if (!props.reactivesearchResultProps.loading &&
51
+ !props.reactivesearchResultProps.resultStats.numberOfResults) {
52
+ if (searchQuery) {
53
+ track({
54
+ eventName: "zeroResults",
55
+ payload: {
56
+ searchTerm: searchQuery,
57
+ },
58
+ });
59
+ }
60
+ }
61
+ }, [
62
+ props.reactivesearchResultProps.loading,
63
+ props.reactivesearchResultProps.resultStats.numberOfResults,
64
+ searchQuery,
65
+ ]);
48
66
  if (props.reactivesearchResultProps.error) {
49
- const RenderErrorComponent = (_a = props.renderError) !== null && _a !== void 0 ? _a : ResultStackRenderErrorComponent;
67
+ utility_1.debug.breadcrumb({
68
+ category: "result",
69
+ message: "error",
70
+ data: {
71
+ error: props.reactivesearchResultProps.error,
72
+ },
73
+ });
74
+ const RenderErrorComponent = (_a = props.renderError) !== null && _a !== void 0 ? _a : ResultsRenderErrorComponent;
50
75
  return (react_1.default.createElement(RenderErrorComponent, { error: props.reactivesearchResultProps.error }));
51
76
  }
52
77
  if (!initialSearchHasRun) {
53
- const RenderLoadingComponent = (_b = props.renderLoading) !== null && _b !== void 0 ? _b : ResultStackRenderLoadingComponent;
78
+ const RenderLoadingComponent = (_b = props.renderLoading) !== null && _b !== void 0 ? _b : ResultsRenderLoadingComponent;
54
79
  return react_1.default.createElement(RenderLoadingComponent, null);
55
80
  }
56
81
  if (!props.reactivesearchResultProps.resultStats.numberOfResults) {
57
- if (searchQuery) {
58
- track({
59
- eventName: "zeroResults",
60
- payload: {
61
- searchTerm: searchQuery,
62
- },
63
- });
64
- }
65
- const RenderNoResultsComponent = (_c = props.renderNoResults) !== null && _c !== void 0 ? _c : ResultStackRenderNoResultsComponent;
82
+ const RenderNoResultsComponent = (_c = props.renderNoResults) !== null && _c !== void 0 ? _c : ResultsRenderNoResultsComponent;
66
83
  return react_1.default.createElement(RenderNoResultsComponent, null);
67
84
  }
68
85
  return (react_1.default.createElement(react_1.default.Fragment, null,
@@ -76,12 +93,12 @@ const ResultStackInner = (props) => {
76
93
  }
77
94
  return null;
78
95
  })),
79
- react_1.default.createElement(ResultStackPaginationStackLoadMore, Object.assign({}, props, props.reactivesearchResultProps))));
96
+ react_1.default.createElement(ResultsPaginationStackLoadMore, Object.assign({}, props, props.reactivesearchResultProps))));
80
97
  };
81
98
  /** Handles rendering pagination for types that use "pagination props" */
82
- const ResultStackPaginationStack = (props) => {
99
+ const ResultsPaginationStack = (props) => {
83
100
  const { options } = (0, hooks_1.useReactifySearchContext)();
84
- const { filterStack } = (0, hooks_1.useFilterStack)();
101
+ const { filterStack } = (0, hooks_1.useFilters)();
85
102
  if (options.mode === "instant-search") {
86
103
  return null;
87
104
  }
@@ -94,9 +111,9 @@ const ResultStackPaginationStack = (props) => {
94
111
  return null;
95
112
  };
96
113
  /** Handles rendering pagination for types that use "result props" */
97
- const ResultStackPaginationStackLoadMore = (props) => {
114
+ const ResultsPaginationStackLoadMore = (props) => {
98
115
  const { options } = (0, hooks_1.useReactifySearchContext)();
99
- const { filterStack } = (0, hooks_1.useFilterStack)();
116
+ const { filterStack } = (0, hooks_1.useFilters)();
100
117
  if (options.mode === "instant-search") {
101
118
  return null;
102
119
  }
@@ -105,4 +122,4 @@ const ResultStackPaginationStackLoadMore = (props) => {
105
122
  }
106
123
  return null;
107
124
  };
108
- //# sourceMappingURL=ResultStack.js.map
125
+ //# sourceMappingURL=Results.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Results.js","sourceRoot":"","sources":["../../../../src/components/Result/Results.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,gHAAwF;AAExF,2DAAwD;AACxD,2DAAwD;AACxD,yEAAsE;AACtE,yEAAsE;AACtE,yEAAsE;AAEtE,uCAOqB;AACrB,uCAMqB;AACrB,2CAAsC;AA8C/B,MAAM,OAAO,GAA2B,CAAC,KAAK,EAAE,EAAE;IACvD,MAAM,yBAAyB,GAAG,IAAA,oCAA4B,EAAC;QAC7D,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC,CAAC;IAEH,OAAO,CACL,8BAAC,sBAAY,oBACP,yBAAyB,IAC7B,MAAM,EAAE,CAAC,yBAAoD,EAAE,EAAE,CAAC,CAChE,8BAAC,YAAY,oBACP,KAAK,IACT,yBAAyB,EAAE,yBAAyB,IACpD,CACH,EACD,gBAAgB,EAAE,CAChB,6BAA4D,EAC5D,EAAE,CAAC,CACH,8BAAC,sBAAsB,oBAAK,KAAK,EAAM,6BAA6B,EAAI,CACzE,IACD,CACH,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,OAAO,WAqBlB;AAEF,MAAM,2BAA2B,GAAgC,CAAC,KAAK,EAAE,EAAE;IACzE,OAAO,CACL;QACG,SAAS;QACT,KAAK,CAAC,KAAK,CAAC,UAAU,CACnB,CACP,C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AA,gCAAwB,GAAE,CAAC;IAC/C,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,kBAAU,GAAE,CAAC;IAErC,IAAI,OAAO,CAAC,IAAI,KAAK,gBAAgB,EAAE;QACrC,OAAO,IAAI,CAAC;KACb;IAED,IAAI,WAAW,MAAK,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,CAAA,EAAE;QAC/C,OAAO,CACL,8BAAC,mDAAwB,oBACnB,KAAK,CAAC,yBAAyB,IACnC,MAAM,EAAE,KAAK,CAAC,wBAAwB,IACtC,CACH,CAAC;KACH;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport ReactiveList from \"@appbaseio/reactivesearch/lib/components/result/ReactiveList\";\n\nimport { ResultCardCallout } from \"./ResultCardCallout\";\nimport { ResultCardProduct } from \"./ResultCardProduct\";\nimport { ResultPaginationNumbered } from \"./ResultPaginationNumbered\";\nimport { ResultPaginationLoadMore } from \"./ResultPaginationLoadMore\";\nimport { ResultPaginationNextPrev } from \"./ResultPaginationNextPrev\";\n\nimport {\n ElasticCallout,\n ElasticProduct,\n ElasticDocumentType,\n ReactivesearchError,\n ReactivesearchResultProps,\n ReactivesearchPaginationProps,\n} from \"../../types\";\nimport {\n useReactifySearchContext,\n useAnalytics,\n useSearch,\n useFilters,\n useReactiveReactiveListProps,\n} from \"../../hooks\";\nimport { debug } from \"../../utility\";\n\nexport type ResultProps = ReactivesearchResultProps & {\n callouts: ElasticCallout[];\n products: ElasticProduct[];\n};\n\nexport type ResultsProps = {\n /** Style prop for the list wrapper */\n listStyle?: React.HTMLAttributes<HTMLElement>[\"style\"];\n /** Classname prop for the list wrapper */\n listClassName?: string;\n /** Render method called when an error occurs */\n renderError?: React.FC<{ error: ReactivesearchError }>;\n /** Render method called while loading for the first time */\n renderLoading?: React.FC;\n /** Render method called when no results are found */\n renderNoResults?: React.FC;\n /** Render method called once for each product result */\n renderResultCardProduct?: React.ComponentProps<\n typeof ResultCardProduct\n >[\"render\"];\n /** Render method called once for each callout result */\n renderResultCardCallout?: React.ComponentProps<\n typeof ResultCardCallout\n >[\"render\"];\n /** Render method called for pagination type \"pagination\" */\n renderPaginationNumbered?: React.ComponentProps<\n typeof ResultPaginationNumbered\n >[\"render\"];\n /** Render method called for pagination type \"next_prev\" */\n renderPaginationNextPrev?: React.ComponentProps<\n typeof ResultPaginationNextPrev\n >[\"render\"];\n /** Render method called for pagination type \"load_more\" */\n renderPaginationLoadMore?: React.ComponentProps<\n typeof ResultPaginationLoadMore\n >[\"render\"];\n /** Render method called for pagination type \"infinite_scroll\" */\n renderPaginationInfiniteScroll?: React.ComponentProps<\n typeof ResultPaginationLoadMore\n >[\"render\"];\n /** Advanced Usage: Override the default amount of results per page */\n pageSize?: number;\n};\n\nexport const Results: React.FC<ResultsProps> = (props) => {\n const reactiveReactiveListProps = useReactiveReactiveListProps({\n pageSize: props.pageSize,\n });\n\n return (\n <ReactiveList\n {...reactiveReactiveListProps}\n render={(reactivesearchResultProps: ReactivesearchResultProps) => (\n <ResultsInner\n {...props}\n reactivesearchResultProps={reactivesearchResultProps}\n />\n )}\n renderPagination={(\n reactivesearchPaginationProps: ReactivesearchPaginationProps\n ) => (\n <ResultsPaginationStack {...props} {...reactivesearchPaginationProps} />\n )}\n />\n );\n};\n\nconst ResultsRenderErrorComponent: ResultsProps[\"renderError\"] = (props) => {\n return (\n <div>\n {\"Error: \"}\n {props.error.statusText}\n </div>\n );\n};\n\nconst ResultsRenderLoadingComponent: ResultsProps[\"renderLoading\"] = () => {\n return <div>{\"Loading\"}</div>;\n};\n\nconst ResultsRenderNoResultsComponent: ResultsProps[\"renderNoResults\"] = () => {\n return <div>{\"No results\"}</div>;\n};\n\nconst ResultsInner: React.FC<\n ResultsProps & { reactivesearchResultProps: ReactivesearchResultProps }\n> = (props) => {\n const { track } = useAnalytics();\n const { searchQuery } = useSearch();\n\n const initialSearchHasRun = React.useMemo(\n () =>\n \"undefined\" !==\n typeof props.reactivesearchResultProps.resultStats.numberOfResults,\n [props.reactivesearchResultProps]\n );\n\n const listStyle = React.useMemo<React.HTMLAttributes<HTMLElement>[\"style\"]>(\n () =>\n props.listStyle ?? {\n display: \"grid\",\n gap: \"8px\",\n gridTemplateColumns: \"repeat(4, minmax(0, 1fr))\",\n },\n [props.listStyle]\n );\n\n React.useEffect(() => {\n if (\n !props.reactivesearchResultProps.loading &&\n !props.reactivesearchResultProps.resultStats.numberOfResults\n ) {\n if (searchQuery) {\n track({\n eventName: \"zeroResults\",\n payload: {\n searchTerm: searchQuery,\n },\n });\n }\n }\n }, [\n props.reactivesearchResultProps.loading,\n props.reactivesearchResultProps.resultStats.numberOfResults,\n searchQuery,\n ]);\n\n if (props.reactivesearchResultProps.error) {\n debug.breadcrumb({\n category: \"result\",\n message: \"error\",\n data: {\n error: props.reactivesearchResultProps.error,\n },\n });\n\n const RenderErrorComponent =\n props.renderError ?? ResultsRenderErrorComponent;\n\n return (\n <RenderErrorComponent error={props.reactivesearchResultProps.error} />\n );\n }\n\n if (!initialSearchHasRun) {\n const RenderLoadingComponent =\n props.renderLoading ?? ResultsRenderLoadingComponent;\n return <RenderLoadingComponent />;\n }\n\n if (!props.reactivesearchResultProps.resultStats.numberOfResults) {\n const RenderNoResultsComponent =\n props.renderNoResults ?? ResultsRenderNoResultsComponent;\n return <RenderNoResultsComponent />;\n }\n\n return (\n <>\n <section style={listStyle} className={props.listClassName}>\n {props.reactivesearchResultProps.data.map((item, key) => {\n // @todo result.type is missing in v1 indexes, this check ensures that they are assumed to be products\n if (ElasticDocumentType.Product === item.type || !item.type) {\n return (\n <ResultCardProduct\n key={item._id}\n product={item}\n document={item}\n pagePosition={key + 1}\n render={props.renderResultCardProduct}\n />\n );\n }\n\n if (ElasticDocumentType.Callout === item.type) {\n return (\n <ResultCardCallout\n key={item._id}\n document={item}\n pagePosition={key + 1}\n callout={item.callout}\n render={props.renderResultCardCallout}\n />\n );\n }\n\n return null;\n })}\n </section>\n <ResultsPaginationStackLoadMore\n {...props}\n {...props.reactivesearchResultProps}\n />\n </>\n );\n};\n\n/** Handles rendering pagination for types that use \"pagination props\" */\nconst ResultsPaginationStack: React.FC<\n ResultsProps & ReactivesearchPaginationProps\n> = (props) => {\n const { options } = useReactifySearchContext();\n const { filterStack } = useFilters();\n\n if (options.mode === \"instant-search\") {\n return null;\n }\n\n if (\"pagination\" === filterStack?.paginationType) {\n return (\n <ResultPaginationNumbered\n {...props}\n render={props.renderPaginationNumbered}\n />\n );\n }\n\n if (\"next_prev\" === filterStack?.paginationType) {\n return (\n <ResultPaginationNextPrev\n {...props}\n render={props.renderPaginationNextPrev}\n />\n );\n }\n\n return null;\n};\n\n/** Handles rendering pagination for types that use \"result props\" */\nconst ResultsPaginationStackLoadMore: React.FC<\n ResultsProps & { reactivesearchResultProps: ReactivesearchResultProps }\n> = (props) => {\n const { options } = useReactifySearchContext();\n const { filterStack } = useFilters();\n\n if (options.mode === \"instant-search\") {\n return null;\n }\n\n if (\"load_more\" === filterStack?.paginationType) {\n return (\n <ResultPaginationLoadMore\n {...props.reactivesearchResultProps}\n render={props.renderPaginationLoadMore}\n />\n );\n }\n\n return null;\n};\n"]}
@@ -1,4 +1,4 @@
1
- export * from "./ResultStack";
1
+ export * from "./Results";
2
2
  export * from "./ResultCardCallout";
3
3
  export * from "./ResultCardProduct";
4
4
  export * from "./ResultStateProvider";
@@ -10,7 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./ResultStack"), exports);
13
+ __exportStar(require("./Results"), exports);
14
14
  __exportStar(require("./ResultCardCallout"), exports);
15
15
  __exportStar(require("./ResultCardProduct"), exports);
16
16
  __exportStar(require("./ResultStateProvider"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Result/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA8B;AAC9B,sDAAmC;AACnC,sDAAoC;AACpC,wDAAsC;AACtC,6DAA2C;AAC3C,6DAA2C;AAC3C,6DAA2C","sourcesContent":["export * from \"./ResultStack\";\nexport * from \"./ResultCardCallout\"\nexport * from \"./ResultCardProduct\";\nexport * from \"./ResultStateProvider\";\nexport * from \"./ResultPaginationNumbered\";\nexport * from \"./ResultPaginationLoadMore\";\nexport * from \"./ResultPaginationNextPrev\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Result/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA0B;AAC1B,sDAAoC;AACpC,sDAAoC;AACpC,wDAAsC;AACtC,6DAA2C;AAC3C,6DAA2C;AAC3C,6DAA2C","sourcesContent":["export * from \"./Results\";\nexport * from \"./ResultCardCallout\";\nexport * from \"./ResultCardProduct\";\nexport * from \"./ResultStateProvider\";\nexport * from \"./ResultPaginationNumbered\";\nexport * from \"./ResultPaginationLoadMore\";\nexport * from \"./ResultPaginationNextPrev\";\n"]}
@@ -21,7 +21,7 @@ const SensorCollection = () => {
21
21
  path: "collections",
22
22
  query: {
23
23
  term: {
24
- "collections.handle.keyword": options.collection.handle,
24
+ "collections.handle.keyword": options.collectionHandle,
25
25
  },
26
26
  },
27
27
  },
@@ -31,7 +31,7 @@ const SensorCollection = () => {
31
31
  path: "curations",
32
32
  query: {
33
33
  term: {
34
- "curations.collectionHandle.keyword": options.collection.handle,
34
+ "curations.collectionHandle.keyword": options.collectionHandle,
35
35
  },
36
36
  },
37
37
  },
@@ -1 +1 @@
1
- {"version":3,"file":"SensorCollection.js","sourceRoot":"","sources":["../../../../src/components/Sensor/SensorCollection.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,yHAAiG;AAEjG,uCAAuD;AAEhD,MAAM,gBAAgB,GAAa,GAAG,EAAE;IAC7C,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAE/C,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,EAAE;QACjC,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,8BAAC,2BAAiB,IAChB,WAAW,EAAC,kBAAkB,EAC9B,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;YAClB,KAAK,EAAE;gBACL,IAAI,EAAE;oBACJ,MAAM,EAAE;wBACN;4BACE,MAAM,EAAE;gCACN,IAAI,EAAE,aAAa;gCACnB,KAAK,EAAE;oCACL,IAAI,EAAE;wCACJ,4BAA4B,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM;qCACxD;iCACF;6BACF;yBACF;wBACD;4BACE,MAAM,EAAE;gCACN,IAAI,EAAE,WAAW;gCACjB,KAAK,EAAE;oCACL,IAAI,EAAE;wCACJ,oCAAoC,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM;qCAChE;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF,CAAC,GACF,CACH,CAAC;AACJ,CAAC,CAAC;AAxCW,QAAA,gBAAgB,oBAwC3B","sourcesContent":["import React from \"react\";\nimport ReactiveComponent from \"@appbaseio/reactivesearch/lib/components/basic/ReactiveComponent\";\n\nimport { useReactifySearchContext } from \"../../hooks\";\n\nexport const SensorCollection: React.FC = () => {\n const { options } = useReactifySearchContext();\n\n if (options.mode !== \"collection\") {\n return null;\n }\n\n return (\n <ReactiveComponent\n componentId=\"SensorCollection\"\n customQuery={() => ({\n query: {\n bool: {\n should: [\n {\n nested: {\n path: \"collections\",\n query: {\n term: {\n \"collections.handle.keyword\": options.collection.handle,\n },\n },\n },\n },\n {\n nested: {\n path: \"curations\",\n query: {\n term: {\n \"curations.collectionHandle.keyword\": options.collection.handle,\n },\n },\n },\n },\n ],\n },\n },\n })}\n />\n );\n};\n"]}
1
+ {"version":3,"file":"SensorCollection.js","sourceRoot":"","sources":["../../../../src/components/Sensor/SensorCollection.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,yHAAiG;AAEjG,uCAAuD;AAEhD,MAAM,gBAAgB,GAAa,GAAG,EAAE;IAC7C,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAE/C,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,EAAE;QACjC,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,8BAAC,2BAAiB,IAChB,WAAW,EAAC,kBAAkB,EAC9B,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;YAClB,KAAK,EAAE;gBACL,IAAI,EAAE;oBACJ,MAAM,EAAE;wBACN;4BACE,MAAM,EAAE;gCACN,IAAI,EAAE,aAAa;gCACnB,KAAK,EAAE;oCACL,IAAI,EAAE;wCACJ,4BAA4B,EAAE,OAAO,CAAC,gBAAgB;qCACvD;iCACF;6BACF;yBACF;wBACD;4BACE,MAAM,EAAE;gCACN,IAAI,EAAE,WAAW;gCACjB,KAAK,EAAE;oCACL,IAAI,EAAE;wCACJ,oCAAoC,EAClC,OAAO,CAAC,gBAAgB;qCAC3B;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF,CAAC,GACF,CACH,CAAC;AACJ,CAAC,CAAC;AAzCW,QAAA,gBAAgB,oBAyC3B","sourcesContent":["import React from \"react\";\nimport ReactiveComponent from \"@appbaseio/reactivesearch/lib/components/basic/ReactiveComponent\";\n\nimport { useReactifySearchContext } from \"../../hooks\";\n\nexport const SensorCollection: React.FC = () => {\n const { options } = useReactifySearchContext();\n\n if (options.mode !== \"collection\") {\n return null;\n }\n\n return (\n <ReactiveComponent\n componentId=\"SensorCollection\"\n customQuery={() => ({\n query: {\n bool: {\n should: [\n {\n nested: {\n path: \"collections\",\n query: {\n term: {\n \"collections.handle.keyword\": options.collectionHandle,\n },\n },\n },\n },\n {\n nested: {\n path: \"curations\",\n query: {\n term: {\n \"curations.collectionHandle.keyword\":\n options.collectionHandle,\n },\n },\n },\n },\n ],\n },\n },\n })}\n />\n );\n};\n"]}