@usereactify/search 5.0.0-beta.4 → 5.0.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/package.json +1 -1
- package/dist/src/components/Example/ExampleFilterList.d.ts +1 -1
- package/dist/src/components/Example/ExampleFilterList.js.map +1 -1
- package/dist/src/components/Example/ExampleFilterRange.d.ts +1 -1
- package/dist/src/components/Example/ExampleFilterRange.js.map +1 -1
- package/dist/src/components/Example/ExampleFilterSlider.d.ts +1 -1
- package/dist/src/components/Example/ExampleFilterSlider.js +1 -1
- package/dist/src/components/Example/ExampleFilterSlider.js.map +1 -1
- package/dist/src/components/Example/ExampleFilterStack.d.ts +1 -1
- package/dist/src/components/Example/ExampleFilterStack.js.map +1 -1
- package/dist/src/components/Example/ExampleResultCardCallout.d.ts +1 -1
- package/dist/src/components/Example/ExampleResultCardCallout.js.map +1 -1
- package/dist/src/components/Example/ExampleResultCardProduct.d.ts +1 -1
- package/dist/src/components/Example/ExampleResultCardProduct.js +1 -1
- package/dist/src/components/Example/ExampleResultCardProduct.js.map +1 -1
- package/dist/src/components/Example/ExampleResultPaginationLoadMore.d.ts +1 -1
- package/dist/src/components/Example/ExampleResultPaginationLoadMore.js.map +1 -1
- package/dist/src/components/Example/ExampleResultPaginationNextPrev.d.ts +1 -1
- package/dist/src/components/Example/ExampleResultPaginationNextPrev.js.map +1 -1
- package/dist/src/components/Example/ExampleResultPaginationNumbered.d.ts +1 -1
- package/dist/src/components/Example/ExampleResultPaginationNumbered.js +2 -2
- package/dist/src/components/Example/ExampleResultPaginationNumbered.js.map +1 -1
- package/dist/src/components/Example/ExampleSortby.d.ts +1 -1
- package/dist/src/components/Example/ExampleSortby.js.map +1 -1
- package/dist/src/components/Example/index.js.map +1 -1
- package/dist/src/components/Filter/Filter.js.map +1 -1
- package/dist/src/components/Filter/FilterStack.js.map +1 -1
- package/dist/src/components/Filter/index.js.map +1 -1
- package/dist/src/components/ReactifySearchBase/ReactifySearchBase.js +15 -32
- package/dist/src/components/ReactifySearchBase/ReactifySearchBase.js.map +1 -1
- package/dist/src/components/ReactifySearchBase/index.js.map +1 -1
- package/dist/src/components/Result/ResultCardCallout.js +3 -5
- package/dist/src/components/Result/ResultCardCallout.js.map +1 -1
- package/dist/src/components/Result/ResultCardProduct.js +4 -18
- package/dist/src/components/Result/ResultCardProduct.js.map +1 -1
- package/dist/src/components/Result/ResultPaginationLoadMore.js.map +1 -1
- package/dist/src/components/Result/ResultPaginationNextPrev.js.map +1 -1
- package/dist/src/components/Result/ResultPaginationNumbered.js.map +1 -1
- package/dist/src/components/Result/ResultStack.js +6 -6
- package/dist/src/components/Result/ResultStack.js.map +1 -1
- package/dist/src/components/Result/ResultStateProvider.d.ts +1 -1
- package/dist/src/components/Result/ResultStateProvider.js +4 -1
- package/dist/src/components/Result/ResultStateProvider.js.map +1 -1
- package/dist/src/components/Result/index.js.map +1 -1
- package/dist/src/components/Search/SearchInput.js.map +1 -1
- package/dist/src/components/Search/index.js.map +1 -1
- package/dist/src/components/Sensor/SensorCollection.js.map +1 -1
- package/dist/src/components/Sensor/SensorInventoryAvailable.js +1 -1
- package/dist/src/components/Sensor/SensorInventoryAvailable.js.map +1 -1
- package/dist/src/components/Sensor/SensorPublished.js.map +1 -1
- package/dist/src/components/Sensor/SensorSearch.js.map +1 -1
- package/dist/src/components/Sensor/SensorSort.js +1 -19
- package/dist/src/components/Sensor/SensorSort.js.map +1 -1
- package/dist/src/components/Sensor/SensorSortScore.js.map +1 -1
- package/dist/src/components/Sensor/SensorStack.js.map +1 -1
- package/dist/src/components/Sensor/index.js.map +1 -1
- package/dist/src/components/Sortby/Sortby.js.map +1 -1
- package/dist/src/components/Sortby/index.js.map +1 -1
- package/dist/src/components/Utility/UtilityAuthenticatedReactiveBase.js +3 -3
- package/dist/src/components/Utility/UtilityAuthenticatedReactiveBase.js.map +1 -1
- package/dist/src/components/Utility/index.js.map +1 -1
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/index.js +1 -0
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/reactivesearch/index.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.d.ts +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js +0 -1
- package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveReactProp.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveResultStackProps.js +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveResultStackProps.js.map +1 -1
- package/dist/src/hooks/useAnalytics.js +2 -0
- package/dist/src/hooks/useAnalytics.js.map +1 -1
- package/dist/src/hooks/useConfig.js +9 -8
- package/dist/src/hooks/useConfig.js.map +1 -1
- package/dist/src/hooks/useCuration.js +16 -3
- package/dist/src/hooks/useCuration.js.map +1 -1
- package/dist/src/hooks/useDebugger.d.ts +1 -0
- package/dist/src/hooks/useDebugger.js +15 -0
- package/dist/src/hooks/useDebugger.js.map +1 -0
- package/dist/src/hooks/useFilterCollapsedState.js.map +1 -1
- package/dist/src/hooks/useFilterListProps.js.map +1 -1
- package/dist/src/hooks/useFilterStack.d.ts +3 -1
- package/dist/src/hooks/useFilterStack.js +6 -1
- package/dist/src/hooks/useFilterStack.js.map +1 -1
- package/dist/src/hooks/useFilters.js +7 -3
- package/dist/src/hooks/useFilters.js.map +1 -1
- package/dist/src/hooks/usePagination.d.ts +1 -1
- package/dist/src/hooks/usePagination.js +11 -0
- package/dist/src/hooks/usePagination.js.map +1 -1
- package/dist/src/hooks/usePaginationLoadMore.d.ts +1 -1
- package/dist/src/hooks/usePaginationLoadMore.js +7 -7
- package/dist/src/hooks/usePaginationLoadMore.js.map +1 -1
- package/dist/src/hooks/useProductPrice.js.map +1 -1
- package/dist/src/hooks/useReactifySearchContext.js.map +1 -1
- package/dist/src/hooks/useSearch.d.ts +1 -1
- package/dist/src/hooks/useSearch.js +19 -6
- package/dist/src/hooks/useSearch.js.map +1 -1
- package/dist/src/hooks/useSortby.js +21 -5
- package/dist/src/hooks/useSortby.js.map +1 -1
- package/dist/src/index.js +45 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/types/config.js.map +1 -1
- package/dist/src/types/elastic.js.map +1 -1
- package/dist/src/types/firestore.js.map +1 -1
- package/dist/src/types/graphql.js.map +1 -1
- package/dist/src/types/index.js.map +1 -1
- package/dist/src/types/reactivesearch.js.map +1 -1
- package/dist/src/types/shopify.js.map +1 -1
- package/dist/src/utility/debug.d.ts +10 -0
- package/dist/src/utility/debug.js +39 -0
- package/dist/src/utility/debug.js.map +1 -0
- package/dist/src/utility/index.d.ts +1 -0
- package/dist/src/utility/index.js +14 -0
- package/dist/src/utility/index.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [5.0.0-beta.7](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.6...v5.0.0-beta.7) (2022-07-27)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* improve sentry stacktraces and logging ([7f34b30](https://bitbucket.org/usereactify/reactify-search-ui/commit/7f34b3064f41ad9a0e5a3ddc3fa071e5981d0141))
|
|
11
|
+
|
|
12
|
+
## [5.0.0-beta.6](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.5...v5.0.0-beta.6) (2022-07-26)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* enable typescript inlinesources ([6998e8e](https://bitbucket.org/usereactify/reactify-search-ui/commit/6998e8e3e884d62cf08b08c43ae7dbc73db7f471))
|
|
18
|
+
|
|
19
|
+
## [5.0.0-beta.5](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.4...v5.0.0-beta.5) (2022-07-26)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* switch to reactify sentry org dsn ([cae3cf0](https://bitbucket.org/usereactify/reactify-search-ui/commit/cae3cf02721ee8b40ddf13854e7aa3cea88034f4))
|
|
25
|
+
|
|
5
26
|
## [5.0.0-beta.4](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.3...v5.0.0-beta.4) (2022-07-26)
|
|
6
27
|
|
|
7
28
|
## [5.0.0-beta.3](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.2...v5.0.0-beta.3) (2022-07-26)
|
package/dist/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FilterProps } from "../../components";
|
|
3
|
-
export declare type ExampleFilterListProps =
|
|
3
|
+
export declare type ExampleFilterListProps = React.ComponentProps<NonNullable<FilterProps["renderFilterList"]>>;
|
|
4
4
|
export declare const ExampleFilterList: React.FC<ExampleFilterListProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleFilterList.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterList.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;
|
|
1
|
+
{"version":3,"file":"ExampleFilterList.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterList.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,iBAAiB,GAAqC,CAAC,KAAK,EAAE,EAAE;IAC3E,OAAO,CACL;QACE,0CAAK,KAAK,CAAC,MAAM,CAAC,IAAI,CAAM;QAC5B,0CACG,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC7C,sCAAI,GAAG,EAAE,MAAM,CAAC,GAAG;YACjB;gBACE,yCACE,KAAK,EAAE,MAAM,CAAC,GAAG,EACjB,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAClC,KAAK,CAAC,eAAe,CAAC,YAAY,CAAC,KAAK,CAAC,GAE3C;gBACD,MAAM,CAAC,GAAG;;gBAAI,MAAM,CAAC,SAAS;oBACzB,CACL,CACN,CAAC,CACC,CACJ,CACJ,CAAC;AACJ,CAAC,CAAC;AAvBW,QAAA,iBAAiB,qBAuB5B","sourcesContent":["import React from \"react\";\n\nimport { FilterProps } from \"../../components\";\n\nexport type ExampleFilterListProps = React.ComponentProps<\n NonNullable<FilterProps[\"renderFilterList\"]>\n>;\n\nexport const ExampleFilterList: React.FC<ExampleFilterListProps> = (props) => {\n return (\n <>\n <h1>{props.filter.name}</h1>\n <ul>\n {props.filterListProps.options.map((option) => (\n <li key={option.key}>\n <label>\n <input\n value={option.key}\n type=\"checkbox\"\n checked={option.checked}\n onChange={({ target: { value } }) =>\n props.filterListProps.handleChange(value)\n }\n />\n {option.key} ({option.doc_count})\n </label>\n </li>\n ))}\n </ul>\n </>\n );\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FilterProps } from "../../components";
|
|
3
|
-
export declare type ExampleFilterRangeProps =
|
|
3
|
+
export declare type ExampleFilterRangeProps = React.ComponentProps<NonNullable<FilterProps["renderFilterRange"]>>;
|
|
4
4
|
export declare const ExampleFilterRange: React.FC<ExampleFilterRangeProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleFilterRange.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterRange.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,8DAAwD;
|
|
1
|
+
{"version":3,"file":"ExampleFilterRange.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterRange.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,8DAAwD;AAQjD,MAAM,kBAAkB,GAAsC,CACnE,KAAK,EACL,EAAE;IACF,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE;QACnC,OAAO,CACL;YACE,0CAAK,KAAK,CAAC,MAAM,CAAC,IAAI,CAAM;YAC5B,8BAAC,4BAAW,kBACV,IAAI,EAAE;oBACJ,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE;oBACnC,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE;oBAC9C,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE;iBAC9C,IACG,KAAK,CAAC,wBAAwB,EAClC,CACD,CACJ,CAAC;KACH;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AApBW,QAAA,kBAAkB,sBAoB7B","sourcesContent":["import React from \"react\";\nimport { SingleRange } from \"@appbaseio/reactivesearch\";\n\nimport { FilterProps } from \"../../components\";\n\nexport type ExampleFilterRangeProps = React.ComponentProps<\n NonNullable<FilterProps[\"renderFilterRange\"]>\n>;\n\nexport const ExampleFilterRange: React.FC<ExampleFilterRangeProps> = (\n props\n) => {\n if (props.filter.handle === \"price\") {\n return (\n <>\n <h1>{props.filter.name}</h1>\n <SingleRange\n data={[\n { start: \"0\", label: \"All prices\" },\n { start: \"0\", end: \"99\", label: \"Under $100\" },\n { start: \"0\", end: \"49\", label: \"Under $50\" },\n ]}\n {...props.reactiveFilterRangeProps}\n />\n </>\n );\n }\n\n return null;\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FilterProps } from "../../components";
|
|
3
|
-
export declare type ExampleFilterSliderProps =
|
|
3
|
+
export declare type ExampleFilterSliderProps = React.ComponentProps<NonNullable<FilterProps["renderFilterSlider"]>>;
|
|
4
4
|
export declare const ExampleFilterSlider: React.FC<ExampleFilterSliderProps>;
|
|
@@ -12,7 +12,7 @@ const ExampleFilterSlider = (props) => {
|
|
|
12
12
|
react_1.default.createElement("h1", null, props.filter.name),
|
|
13
13
|
react_1.default.createElement(reactivesearch_1.RangeSlider, Object.assign({ range: {
|
|
14
14
|
start: 0,
|
|
15
|
-
end: 500
|
|
15
|
+
end: 500,
|
|
16
16
|
} }, props.reactiveFilterSliderProps))));
|
|
17
17
|
}
|
|
18
18
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleFilterSlider.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterSlider.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,8DAAwD;
|
|
1
|
+
{"version":3,"file":"ExampleFilterSlider.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterSlider.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,8DAAwD;AAQjD,MAAM,mBAAmB,GAAuC,CACrE,KAAK,EACL,EAAE;IACF,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE;QACnC,OAAO,CACL;YACE,0CAAK,KAAK,CAAC,MAAM,CAAC,IAAI,CAAM;YAC5B,8BAAC,4BAAW,kBACV,KAAK,EAAE;oBACL,KAAK,EAAE,CAAC;oBACR,GAAG,EAAE,GAAG;iBACT,IACG,KAAK,CAAC,yBAAyB,EACnC,CACD,CACJ,CAAC;KACH;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAnBW,QAAA,mBAAmB,uBAmB9B","sourcesContent":["import React from \"react\";\nimport { RangeSlider } from \"@appbaseio/reactivesearch\";\n\nimport { FilterProps } from \"../../components\";\n\nexport type ExampleFilterSliderProps = React.ComponentProps<\n NonNullable<FilterProps[\"renderFilterSlider\"]>\n>;\n\nexport const ExampleFilterSlider: React.FC<ExampleFilterSliderProps> = (\n props\n) => {\n if (props.filter.handle === \"price\") {\n return (\n <>\n <h1>{props.filter.name}</h1>\n <RangeSlider\n range={{\n start: 0,\n end: 500,\n }}\n {...props.reactiveFilterSliderProps}\n />\n </>\n );\n }\n\n return null;\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FilterStackProps } from "../../components";
|
|
3
|
-
export declare type ExampleFilterStackProps =
|
|
3
|
+
export declare type ExampleFilterStackProps = React.ComponentProps<NonNullable<FilterStackProps["renderFilters"]>>;
|
|
4
4
|
export declare const ExampleFilterStack: React.FC<ExampleFilterStackProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleFilterStack.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterStack.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA4D;
|
|
1
|
+
{"version":3,"file":"ExampleFilterStack.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterStack.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA4D;AAMrD,MAAM,kBAAkB,GAAsC,CACnE,KAAK,EACL,EAAE;IACF,OAAO,CACL,8DACG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC7B,8BAAC,mBAAM,kBAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,IAAM,KAAK,EAAI,CACtD,CAAC,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,kBAAkB,sBAU7B","sourcesContent":["import React from \"react\";\n\nimport { Filter, FilterStackProps } from \"../../components\";\n\nexport type ExampleFilterStackProps = React.ComponentProps<\n NonNullable<FilterStackProps[\"renderFilters\"]>\n>;\n\nexport const ExampleFilterStack: React.FC<ExampleFilterStackProps> = (\n props\n) => {\n return (\n <>\n {props.filters.map((filter) => (\n <Filter key={filter.id} filter={filter} {...props} />\n ))}\n </>\n );\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ResultCardCalloutProps } from "../../components";
|
|
3
|
-
export declare type ExampleResultCardCalloutProps =
|
|
3
|
+
export declare type ExampleResultCardCalloutProps = React.ComponentProps<NonNullable<ResultCardCalloutProps["render"]>>;
|
|
4
4
|
export declare const ExampleResultCardCallout: React.FC<ExampleResultCardCalloutProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleResultCardCallout.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultCardCallout.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;
|
|
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,2CAAS,GAAG,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS;QAC3C,qCAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,WAAW;YACpD,KAAK,CAAC,OAAO,CAAC,YAAY,IAAI,CAC7B,uCAAK,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,EAAC,MAAM,GAAG,CACtD;YACA,KAAK,CAAC,OAAO,CAAC,KAAK,CAClB,CACI,CACX,CAAC;AACJ,CAAC,CAAC;AApBS,QAAA,wBAAwB,4BAoBjC","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 <article ref={props.itemRef} style={styleProp}>\n <a href={props.callout.link} onClick={props.handleClick}>\n {props.callout.desktopImage && (\n <img src={props.callout.desktopImage} width=\"100%\" />\n )}\n {props.callout.title}\n </a>\n </article>\n );\n };\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ResultCardProductProps } from "../../components";
|
|
3
|
-
export declare type ExampleResultCardProductProps =
|
|
3
|
+
export declare type ExampleResultCardProductProps = React.ComponentProps<NonNullable<ResultCardProductProps["render"]>>;
|
|
4
4
|
export declare const ExampleResultCardProduct: React.FC<ExampleResultCardProductProps>;
|
|
@@ -12,7 +12,7 @@ const ExampleResultCardProduct = (props) => {
|
|
|
12
12
|
props.product.title),
|
|
13
13
|
react_1.default.createElement("span", null, props.formattedPrice),
|
|
14
14
|
props.onSale && (react_1.default.createElement("span", { style: {
|
|
15
|
-
textDecoration: "line-through"
|
|
15
|
+
textDecoration: "line-through",
|
|
16
16
|
} }, props.formattedCompareAtPrice))));
|
|
17
17
|
};
|
|
18
18
|
exports.ExampleResultCardProduct = ExampleResultCardProduct;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleResultCardProduct.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultCardProduct.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;
|
|
1
|
+
{"version":3,"file":"ExampleResultCardProduct.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultCardProduct.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,wBAAwB,GACnC,CAAC,KAAK,EAAE,EAAE;IACR,OAAO,CACL,2CAAS,GAAG,EAAE,KAAK,CAAC,OAAO;QACzB,qCACE,OAAO,EAAE,KAAK,CAAC,WAAW,EAC1B,IAAI,EAAE,aAAa,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE;YAExC,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,CACtB,uCAAK,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,EAAC,MAAM,GAAG,CAC/C;YACA,KAAK,CAAC,OAAO,CAAC,KAAK,CAClB;QACJ,4CAAO,KAAK,CAAC,cAAc,CAAQ;QAClC,KAAK,CAAC,MAAM,IAAI,CACf,wCACE,KAAK,EAAE;gBACL,cAAc,EAAE,cAAc;aAC/B,IAEA,KAAK,CAAC,uBAAuB,CACzB,CACR,CACO,CACX,CAAC;AACJ,CAAC,CAAC;AAzBS,QAAA,wBAAwB,4BAyBjC","sourcesContent":["import React from \"react\";\n\nimport { ResultCardProductProps } from \"../../components\";\n\nexport type ExampleResultCardProductProps = React.ComponentProps<\n NonNullable<ResultCardProductProps[\"render\"]>\n>;\n\nexport const ExampleResultCardProduct: React.FC<ExampleResultCardProductProps> =\n (props) => {\n return (\n <article ref={props.itemRef}>\n <a\n onClick={props.handleClick}\n href={`/products/${props.product.handle}`}\n >\n {props.product.image && (\n <img src={props.product.image} width=\"100%\" />\n )}\n {props.product.title}\n </a>\n <span>{props.formattedPrice}</span>\n {props.onSale && (\n <span\n style={{\n textDecoration: \"line-through\",\n }}\n >\n {props.formattedCompareAtPrice}\n </span>\n )}\n </article>\n );\n };\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ResultPaginationLoadMoreProps } from "../../components";
|
|
3
|
-
export declare type ExampleResultPaginationLoadMoreProps =
|
|
3
|
+
export declare type ExampleResultPaginationLoadMoreProps = React.ComponentProps<NonNullable<ResultPaginationLoadMoreProps["render"]>>;
|
|
4
4
|
export declare const ExampleResultPaginationLoadMore: React.FC<ExampleResultPaginationLoadMoreProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleResultPaginationLoadMore.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultPaginationLoadMore.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;
|
|
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,0CAAQ,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,IAAG,WAAW,CAAU,CACtE,CAAC;AACJ,CAAC,CAAC;AALS,QAAA,+BAA+B,mCAKxC","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 onClick={() => props.handleLoadMore()}>{\"Load more\"}</button>\n );\n };\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ResultPaginationNextPrevProps } from "../../components";
|
|
3
|
-
export declare type ExampleResultPaginationNextPrevProps =
|
|
3
|
+
export declare type ExampleResultPaginationNextPrevProps = React.ComponentProps<NonNullable<ResultPaginationNextPrevProps["render"]>>;
|
|
4
4
|
export declare const ExampleResultPaginationNextPrev: React.FC<ExampleResultPaginationNextPrevProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleResultPaginationNextPrev.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultPaginationNextPrev.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;
|
|
1
|
+
{"version":3,"file":"ExampleResultPaginationNextPrev.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultPaginationNextPrev.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,+BAA+B,GAC1C,CAAC,KAAK,EAAE,EAAE;IACR,OAAO,CACL;QACG,KAAK,CAAC,eAAe,IAAI,CACxB,qCACE,GAAG,EAAC,MAAM,EACV,OAAO,EAAE,KAAK,CAAC,kBAAkB,EACjC,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,iBAAiB,GAAG,CAAC,CAAC,IAErD,MAAM,CACL,CACL;QACA,KAAK,CAAC,WAAW,IAAI,CACpB,qCACE,GAAG,EAAC,MAAM,EACV,OAAO,EAAE,KAAK,CAAC,cAAc,EAC7B,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,iBAAiB,GAAG,CAAC,CAAC,IAErD,MAAM,CACL,CACL,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAxBS,QAAA,+BAA+B,mCAwBxC","sourcesContent":["import React from \"react\";\n\nimport { ResultPaginationNextPrevProps } from \"../../components\";\n\nexport type ExampleResultPaginationNextPrevProps = React.ComponentProps<\n NonNullable<ResultPaginationNextPrevProps[\"render\"]>\n>;\n\nexport const ExampleResultPaginationNextPrev: React.FC<ExampleResultPaginationNextPrevProps> =\n (props) => {\n return (\n <nav>\n {props.hasPreviousPage && (\n <a\n rel=\"prev\"\n onClick={props.handlePreviousPage}\n href={props.buildPagePath(props.actualCurrentPage - 1)}\n >\n {\"Prev\"}\n </a>\n )}\n {props.hasNextPage && (\n <a\n rel=\"next\"\n onClick={props.handleNextPage}\n href={props.buildPagePath(props.actualCurrentPage + 1)}\n >\n {\"Next\"}\n </a>\n )}\n </nav>\n );\n };\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ResultPaginationNumberedProps } from "../../components";
|
|
3
|
-
export declare type ExampleResultPaginationNumberedProps =
|
|
3
|
+
export declare type ExampleResultPaginationNumberedProps = React.ComponentProps<NonNullable<ResultPaginationNumberedProps["render"]>>;
|
|
4
4
|
export declare const ExampleResultPaginationNumbered: React.FC<ExampleResultPaginationNumberedProps>;
|
|
@@ -7,7 +7,7 @@ exports.ExampleResultPaginationNumbered = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const ExampleResultPaginationNumbered = (props) => {
|
|
9
9
|
return (react_1.default.createElement("nav", null,
|
|
10
|
-
props.currentPage > 0 && (react_1.default.createElement("a", { rel: "prev", href: props.buildPagePath(props.currentPage), onClick: (event) => props.
|
|
10
|
+
props.currentPage > 0 && (react_1.default.createElement("a", { rel: "prev", href: props.buildPagePath(props.currentPage), onClick: (event) => props.handlePreviousPage(event) }, "Prev")),
|
|
11
11
|
!props.pagesToShow.includes(0) && (react_1.default.createElement("a", { href: props.buildPagePath(1), onClick: (event) => props.handlePageChange(0, event), rel: 0 === props.currentPage - 1 ? `prev` : undefined }, "1")),
|
|
12
12
|
!props.pagesToShow.includes(1) && react_1.default.createElement("span", null, "..."),
|
|
13
13
|
props.pagesToShow.map((page) => page === props.currentPage ? (react_1.default.createElement("span", { key: page + 1 }, page + 1)) : (react_1.default.createElement("a", { key: page + 1, href: props.buildPagePath(page + 1), onClick: (event) => props.handlePageChange(page, event), rel: page === props.currentPage + 1
|
|
@@ -21,7 +21,7 @@ const ExampleResultPaginationNumbered = (props) => {
|
|
|
21
21
|
: props.totalPages - 1 === props.currentPage - 1
|
|
22
22
|
? `prev`
|
|
23
23
|
: undefined }, props.totalPages)),
|
|
24
|
-
props.currentPage + 1 < props.totalPages && (react_1.default.createElement("a", { rel: "next", href: props.buildPagePath(props.currentPage + 2), onClick: (event) => props.
|
|
24
|
+
props.currentPage + 1 < props.totalPages && (react_1.default.createElement("a", { rel: "next", href: props.buildPagePath(props.currentPage + 2), onClick: (event) => props.handleNextPage(event) }, "Next"))));
|
|
25
25
|
};
|
|
26
26
|
exports.ExampleResultPaginationNumbered = ExampleResultPaginationNumbered;
|
|
27
27
|
//# sourceMappingURL=ExampleResultPaginationNumbered.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleResultPaginationNumbered.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultPaginationNumbered.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;
|
|
1
|
+
{"version":3,"file":"ExampleResultPaginationNumbered.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultPaginationNumbered.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,+BAA+B,GAC1C,CAAC,KAAK,EAAE,EAAE;IACR,OAAO,CACL;QACG,KAAK,CAAC,WAAW,GAAG,CAAC,IAAI,CACxB,qCACE,GAAG,EAAC,MAAM,EACV,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,EAC5C,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,KAAK,CAAC,IAElD,MAAM,CACL,CACL;QACA,CAAC,KAAK,CAA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AAU,GAAG,CAAC,CAAC,IAAI,CACpD,qCACE,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,EAC3C,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,EAAE,KAAK,CAAC,EAErD,GAAG,EACD,KAAK,CAAC,UAAU,GAAG,CAAC,KAAK,KAAK,CAAC,WAAW,GAAG,CAAC;gBAC5C,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,KAAK,KAAK,CAAC,WAAW,GAAG,CAAC;oBAChD,CAAC,CAAC,MAAM;oBACR,CAAC,CAAC,SAAS,IAGd,KAAK,CAAC,UAAU,CACf,CACL;QACA,KAAK,CAAC,WAAW,GAAG,CAAC,GAAG,KAAK,CAAC,UAAU,IAAI,CAC3C,qCACE,GAAG,EAAC,MAAM,EACV,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,GAAG,CAAC,CAAC,EAChD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,IAE9C,MAAM,CACL,CACL,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAxES,QAAA,+BAA+B,mCAwExC","sourcesContent":["import React from \"react\";\n\nimport { ResultPaginationNumberedProps } from \"../../components\";\n\nexport type ExampleResultPaginationNumberedProps = React.ComponentProps<\n NonNullable<ResultPaginationNumberedProps[\"render\"]>\n>;\n\nexport const ExampleResultPaginationNumbered: React.FC<ExampleResultPaginationNumberedProps> =\n (props) => {\n return (\n <nav>\n {props.currentPage > 0 && (\n <a\n rel=\"prev\"\n href={props.buildPagePath(props.currentPage)}\n onClick={(event) => props.handlePreviousPage(event)}\n >\n {\"Prev\"}\n </a>\n )}\n {!props.pagesToShow.includes(0) && (\n <a\n href={props.buildPagePath(1)}\n onClick={(event) => props.handlePageChange(0, event)}\n rel={0 === props.currentPage - 1 ? `prev` : undefined}\n >\n {\"1\"}\n </a>\n )}\n {!props.pagesToShow.includes(1) && <span>...</span>}\n {props.pagesToShow.map((page) =>\n page === props.currentPage ? (\n <span key={page + 1}>{page + 1}</span>\n ) : (\n <a\n key={page + 1}\n href={props.buildPagePath(page + 1)}\n onClick={(event) => props.handlePageChange(page, event)}\n rel={\n page === props.currentPage + 1\n ? `next`\n : page === props.currentPage - 1\n ? `prev`\n : undefined\n }\n >\n {page + 1}\n </a>\n )\n )}\n {!props.pagesToShow.includes(props.totalPages - 2) && <span>...</span>}\n {!props.pagesToShow.includes(props.totalPages - 1) && (\n <a\n href={props.buildPagePath(props.totalPages)}\n onClick={(event) =>\n props.handlePageChange(props.totalPages - 1, event)\n }\n rel={\n props.totalPages - 1 === props.currentPage + 1\n ? `next`\n : props.totalPages - 1 === props.currentPage - 1\n ? `prev`\n : undefined\n }\n >\n {props.totalPages}\n </a>\n )}\n {props.currentPage + 1 < props.totalPages && (\n <a\n rel=\"next\"\n href={props.buildPagePath(props.currentPage + 2)}\n onClick={(event) => props.handleNextPage(event)}\n >\n {\"Next\"}\n </a>\n )}\n </nav>\n );\n };\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SortbyProps } from "../../components";
|
|
3
|
-
export declare type ExampleSortbyProps =
|
|
3
|
+
export declare type ExampleSortbyProps = React.ComponentProps<NonNullable<SortbyProps["renderSortOptions"]>>;
|
|
4
4
|
export declare const ExampleSortby: React.FC<ExampleSortbyProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleSortby.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleSortby.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;
|
|
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,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,0CAAQ,GAAG,EAAE,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,IACrD,UAAU,CAAC,IAAI,CACT,CACV,CAAC,CACK,CACV,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,aAAa,iBAaxB","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 value={props.sortOption?.handle}\n onChange={(event) => props.setSortOption(event.target.value)}\n >\n {props.sortOptions.map((sortOption) => (\n <option key={sortOption.handle} value={sortOption.handle}>\n {sortOption.name}\n </option>\n ))}\n </select>\n );\n};\n"]}
|
|
@@ -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"}
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../../../src/components/Filter/Filter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,wGAAgF;AAChF,0GAAkF;AAGlF,uCAAsJ;AACtJ,iDAAqD;AAoB9C,MAAM,MAAM,GAA0B,CAAC,KAAK,EAAE,EAAE;IACrD,IAAI,QAAQ,KAAK,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE;QACzC,OAAO,CACL,8BAAC,gBAAgB,oBAAK,KAAK,EAAI,CAChC,CAAA;KACF;IAED,IAAI,OAAO,KAAK,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE;QACxC,OAAO,CACL,8BAAC,eAAe,oBAAK,KAAK,EAAI,CAC/B,CAAA;KACF;IAED,IAAI,OAAO,KAAK,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE;QACxC,OAAO,CACL,8BAAC,WAAW,oBAAK,KAAK,EAAI,CAC3B,CAAA;KACF;IAED,IAAI,QAAQ,KAAK,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE;QACzC,OAAO,CACL,8BAAC,YAAY,oBAAK,KAAK,EAAI,CAC5B,CAAA;KACF;IAED,OAAO,CAAC,GAAG,CACT,6BAA6B,KAAK,CAAC,MAAM,CAAC,WAAW,qBAAqB,CAC3E,CAAC;IAEF,OAAO,IAAI,CAAC;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AAyB,KAEvB,KAAK,EADJ,UAAU,UACX,KAAK,EALH,2DAKL,CAAQ,CAAC;IAEV,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,oBAAY,GAAE,CAAC;IAEjC,MAAM,KAAuC,IAAA,0BAAkB,EAC7D,MAAM,EACN,yBAAyB,CAC1B,EAHK,EAAE,YAAY,OAGnB,EAHwB,eAAe,cAAlC,gBAAoC,CAGzC,CAAC;IAEF,MAAM,kBAAkB,GAAG,eAAK,CAAC,WAAW,CAC1C,CAAC,KAAa,EAAE,EAAE;QAChB,YAAY,CAAC,KAAK,CAAC,CAAC;QACpB,KAAK,CAAC;YACJ,SAAS,EAAE,cAAc;YACzB,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,KAAK,EAAE,KAAK;aACb;SACF,CAAC,CAAC;IACL,CAAC,EACD,CAAC,eAAe,CAAC,CAClB,CAAC;IAEF,MAAM,sBAAsB,mCACvB,eAAe,KAClB,YAAY,EAAE,kBAAkB,GACjC,CAAC;IAEF,+CAA+C;IAC/C,IAAI,CAAC,KAAK,eAAe,CAAC,OAAO,CAAC,MAAM,EAAE;QACxC,OAAO,IAAI,CAAC;KACb;IAED,IAAI,gBAAgB,EAAE;QACpB,MAAM,SAAS,GAAG,gBAAgB,CAAC;QACnC,OAAO,CACL,8BAAC,SAAS,kBACR,eAAe,EAAE,sBAAsB,EACvC,MAAM,EAAE,MAAM,IACV,UAAU,EACd,CACH,CAAC;KACH;IAED,OAAO,CACL,8BAAC,8BAAiB,kBAChB,eAAe,EAAE,sBAAsB,EACvC,MAAM,EAAE,MAAM,IACV,UAAU,EACd,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport MultiList from \"@appbaseio/reactivesearch/lib/components/list/MultiList\";\nimport SingleList from \"@appbaseio/reactivesearch/lib/components/list/SingleList\";\n\nimport type { ConfigFilterOption, ReactivesearchFilterProps } from \"../../types\";\nimport { useAnalytics, useFilterListProps, useReactiveFilterListProps, useReactiveFilterRangeProps, useReactiveFilterSliderProps } from \"../../hooks\";\nimport { ExampleFilterList } from \"../../components\";\n\n\nexport type FilterProps = {\n /** The filter option being rendered */\n filter: ConfigFilterOption;\n /** Render method for List filters */\n renderFilterList?: React.FC<Omit<FilterProps, \"renderFilterList\"> & {\n filterListProps: ReturnType<typeof useFilterListProps>;\n }>;\n /** Render method for Range filters */\n renderFilterRange?: React.FC<Omit<FilterProps, \"renderFilterRange\"> & {\n reactiveFilterRangeProps: ReturnType<typeof useReactiveFilterRangeProps>;\n }>;\n /** Render method for Slider filters */\n renderFilterSlider?: React.FC<Omit<FilterProps, \"renderFilterSlider\"> & {\n reactiveFilterSliderProps: ReturnType<typeof useReactiveFilterSliderProps>;\n }>;\n};\n\nexport const Filter: React.FC<FilterProps> = (props) => {\n if (\"single\" === props.filter.displayType) {\n return (\n <FilterSingleList {...props} />\n )\n }\n\n if (\"multi\" === props.filter.displayType) {\n return (\n <FilterMultiList {...props} />\n )\n }\n\n if (\"range\" === props.filter.displayType) {\n return (\n <FilterRange {...props} />\n )\n }\n\n if (\"slider\" === props.filter.displayType) {\n return (\n <FilterSlider {...props} />\n )\n }\n\n console.log(\n `filter with display type \"${props.filter.displayType}\" not yet supported`\n );\n\n return null;\n};\n\nconst FilterSingleList: React.FC<FilterProps> = (props) => {\n const reactiveFilterListProps = useReactiveFilterListProps(props.filter);\n\n return (\n <SingleList\n {...reactiveFilterListProps}\n render={(reactivesearchFilterProps: ReactivesearchFilterProps) => (\n <FilterListInner\n {...props}\n reactivesearchFilterProps={reactivesearchFilterProps}\n />\n )}\n />\n );\n}\n\nconst FilterMultiList: React.FC<FilterProps> = (props) => {\n const reactiveFilterListProps = useReactiveFilterListProps(props.filter);\n\n return (\n <MultiList\n {...reactiveFilterListProps}\n render={(reactivesearchFilterProps: ReactivesearchFilterProps) => (\n <FilterListInner\n {...props}\n reactivesearchFilterProps={reactivesearchFilterProps}\n />\n )}\n />\n );\n}\n\nconst FilterRange: React.FC<FilterProps> = (props) => {\n const reactiveFilterRangeProps = useReactiveFilterRangeProps(props.filter);\n\n if (props.renderFilterRange) {\n const Component = props.renderFilterRange;\n\n return (\n <Component\n {...props}\n reactiveFilterRangeProps={reactiveFilterRangeProps}\n />\n )\n }\n \n return null;\n}\n\nconst FilterSlider: React.FC<FilterProps> = (props) => {\n const reactiveFilterSliderProps = useReactiveFilterSliderProps(props.filter);\n\n if (props.renderFilterSlider) {\n const Component = props.renderFilterSlider;\n\n return (\n <Component\n {...props}\n reactiveFilterSliderProps={reactiveFilterSliderProps}\n />\n )\n }\n\n return null;\n}\n\n// inner component exists only so we can use memos in reactivesearch render functions\nconst FilterListInner: React.FC<\n FilterProps & { reactivesearchFilterProps: ReactivesearchFilterProps }\n> = (props) => {\n const {\n filter,\n renderFilterList,\n reactivesearchFilterProps,\n ...otherProps\n } = props;\n\n const { track } = useAnalytics();\n\n const { handleChange, ...filterListProps } = useFilterListProps(\n filter,\n reactivesearchFilterProps\n );\n\n const handleFilterChange = React.useCallback(\n (value: string) => {\n handleChange(value);\n track({\n eventName: \"filterChange\",\n payload: {\n name: filter.name,\n value: value,\n },\n });\n },\n [filterListProps]\n );\n\n const updatedFilterListProps = {\n ...filterListProps,\n handleChange: handleFilterChange,\n };\n\n // hide entire filter when no options available\n if (0 === filterListProps.options.length) {\n return null;\n }\n\n if (renderFilterList) {\n const Component = renderFilterList;\n return (\n <Component\n filterListProps={updatedFilterListProps}\n filter={filter}\n {...otherProps}\n />\n );\n }\n\n return (\n <ExampleFilterList\n filterListProps={updatedFilterListProps}\n filter={filter}\n {...otherProps}\n />\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterStack.js","sourceRoot":"","sources":["../../../../src/components/Filter/FilterStack.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAAyC;AACzC,iDAAsD;AAO/C,MAAM,WAAW,GAA+B,CAAC,KAAK,EAAE,EAAE;;IAC/D,MAAM,WAAW,GAAG,IAAA,kBAAU,GAAE,CAAC;IAEjC,MAAM,sBAAsB,GAAG,MAAA,KAAK,CAAC,aAAa,mCAAI,+BAAkB,CAAC;IAEzE,OAAO,CACL,8BAAC,sBAAsB,oBACjB,WAAW,EACf,CACH,CAAA;AACH,CAAC,CAAC;AAVW,QAAA,WAAW,eAUtB"}
|
|
1
|
+
{"version":3,"file":"FilterStack.js","sourceRoot":"","sources":["../../../../src/components/Filter/FilterStack.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAAyC;AACzC,iDAAsD;AAO/C,MAAM,WAAW,GAA+B,CAAC,KAAK,EAAE,EAAE;;IAC/D,MAAM,WAAW,GAAG,IAAA,kBAAU,GAAE,CAAC;IAEjC,MAAM,sBAAsB,GAAG,MAAA,KAAK,CAAC,aAAa,mCAAI,+BAAkB,CAAC;IAEzE,OAAO,CACL,8BAAC,sBAAsB,oBACjB,WAAW,EACf,CACH,CAAA;AACH,CAAC,CAAC;AAVW,QAAA,WAAW,eAUtB","sourcesContent":["import React from \"react\";\n\nimport { useFilters } from \"../../hooks\";\nimport { ExampleFilterStack } from \"../../components\";\n\nexport type FilterStackProps = {\n /** Render method called once for all filters */\n renderFilters?: React.FC<ReturnType<typeof useFilters>>\n};\n\nexport const FilterStack: React.FC<FilterStackProps> = (props) => {\n const filtersHook = useFilters();\n\n const RenderFiltersComponent = props.renderFilters ?? ExampleFilterStack;\n\n return (\n <RenderFiltersComponent\n {...filtersHook}\n />\n )\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Filter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB;AACzB,gDAA8B"}
|
|
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"]}
|
|
@@ -25,33 +25,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
25
|
exports.ReactifySearchBase = void 0;
|
|
26
26
|
const react_1 = __importDefault(require("react"));
|
|
27
27
|
const Sentry = __importStar(require("@sentry/react"));
|
|
28
|
-
const tracing_1 = require("@sentry/tracing");
|
|
29
28
|
const hooks_1 = require("../../hooks");
|
|
30
29
|
const components_1 = require("../../components");
|
|
31
|
-
const
|
|
32
|
-
const debug = require("debug")("reactify-search:ReactifySearchBase");
|
|
33
|
-
Sentry.init({
|
|
34
|
-
dsn: "https://cd8abf47496c4956bd061e461f857319@o301775.ingest.sentry.io/6600694",
|
|
35
|
-
integrations: [new tracing_1.BrowserTracing()],
|
|
36
|
-
tracesSampleRate: 1.0,
|
|
37
|
-
release: package_json_1.version,
|
|
38
|
-
});
|
|
30
|
+
const utility_1 = require("../../utility");
|
|
39
31
|
const ReactifySearchBase = (props) => {
|
|
40
32
|
react_1.default.useEffect(() => {
|
|
41
|
-
debug("
|
|
33
|
+
utility_1.debug.log("ReactifySearchBase", "props", props);
|
|
34
|
+
Sentry.setTags({
|
|
35
|
+
"reactifysearch.index": props.index,
|
|
36
|
+
"reactifysearch.shop": props.shopifyPermanentDomain,
|
|
37
|
+
"reactifysearch.mode": props.mode,
|
|
38
|
+
"reactifysearch.collection": props.mode === "collection" ? props.collection.handle : undefined,
|
|
39
|
+
"reactifysearch.filter": props.filterStackHandle,
|
|
40
|
+
});
|
|
42
41
|
}, [props]);
|
|
43
|
-
return (react_1.default.createElement(Sentry.ErrorBoundary, { fallback: react_1.default.createElement("p", null, "An error has occurred"),
|
|
44
|
-
scope.setTag("index", props.index);
|
|
45
|
-
scope.setTag("shop", props.shopifyPermanentDomain);
|
|
46
|
-
scope.setTag("mode", props.mode);
|
|
47
|
-
if (props.mode === "collection") {
|
|
48
|
-
scope.setTag("collection", props.collection.handle);
|
|
49
|
-
}
|
|
50
|
-
if (props.filterStackHandle) {
|
|
51
|
-
scope.setTag("filter", props.filterStackHandle);
|
|
52
|
-
}
|
|
53
|
-
debug("set sentry scope");
|
|
54
|
-
} },
|
|
42
|
+
return (react_1.default.createElement(Sentry.ErrorBoundary, { fallback: react_1.default.createElement("p", null, "An error has occurred") },
|
|
55
43
|
react_1.default.createElement(ReactifySearchInner, Object.assign({}, props))));
|
|
56
44
|
};
|
|
57
45
|
exports.ReactifySearchBase = ReactifySearchBase;
|
|
@@ -106,8 +94,7 @@ const ReactifySearchInner = (props) => {
|
|
|
106
94
|
if (!config) {
|
|
107
95
|
return;
|
|
108
96
|
}
|
|
109
|
-
|
|
110
|
-
return {
|
|
97
|
+
const memoValue = {
|
|
111
98
|
config: config,
|
|
112
99
|
options: Object.assign(Object.assign({}, props), { index: (_a = props.index) !== null && _a !== void 0 ? _a : config.index, filterStackHandle: props.filterStackHandle, credentials: credentials, theme: theme }),
|
|
113
100
|
search: {
|
|
@@ -119,15 +106,11 @@ const ReactifySearchInner = (props) => {
|
|
|
119
106
|
sortby: {
|
|
120
107
|
sortOption: sortOption,
|
|
121
108
|
setSortOption: setSortOption,
|
|
122
|
-
}
|
|
109
|
+
},
|
|
123
110
|
};
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
searchQuery,
|
|
128
|
-
instantSearchVisible,
|
|
129
|
-
sortOption,
|
|
130
|
-
]);
|
|
111
|
+
utility_1.debug.log("ReactifySearchBase", "context", memoValue);
|
|
112
|
+
return memoValue;
|
|
113
|
+
}, [config, props, searchQuery, instantSearchVisible, sortOption]);
|
|
131
114
|
if (!contextValue) {
|
|
132
115
|
if (props.renderBooting) {
|
|
133
116
|
return props.renderBooting();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactifySearchBase.js","sourceRoot":"","sources":["../../../../src/components/ReactifySearchBase/ReactifySearchBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,sDAAwC;
|
|
1
|
+
{"version":3,"file":"ReactifySearchBase.js","sourceRoot":"","sources":["../../../../src/components/ReactifySearchBase/ReactifySearchBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,sDAAwC;AAExC,uCAA+D;AAC/D,iDAAoE;AACpE,2CAAsC;AA+C/B,MAAM,kBAAkB,GAAsC,CACnE,KAAK,EACL,EAAE;IACF,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,eAAK,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QAEhD,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,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;YACnE,uBAAuB,EAAE,KAAK,CAAC,iBAAiB;SACjD,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,CACL,8BAAC,MAAM,CAAC,aAAa,IAAC,QAAQ,EAAE,iEAA4B;QAC1D,8BAAC,mBAAmB,oBAAK,KAAK,EAAI,CACb,CACxB,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,kBAAkB,sBAqB7B;AAEF,MAAM,mBAAmB,GAAsC,CAAC,KAAK,EAAE,EAAE;;IACvE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,iBAAS,EAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAE3E,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAS,EAAE,CAAC,CAAC;IACjE,MAAM,CAAC,oBAAoB,EAAE,uBAA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,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,UAAU,CAAC,CAAC,CAAC;IAEnE,IAAI,CAAC,YAAY,EAAE;QACjB,IAAI,KAAK,CAAC,aAAa,EAAE;YACvB,OAAO,KAAK,CAAC,aAAa,EAAE,CAAC;SAC9B;QACD,OAAO,IAAI,CAAC;KACb;IAED,IAAI,KAAK,CAAC,cAAc,EAAE;QACxB,OAAO,CACL,8BAAC,6BAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAChD,KAAK,CAAC,QAAQ,CACgB,CAClC,CAAC;KACH;IAED,OAAO,CACL,8BAAC,6BAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY;QACjD,8BAAC,6CAAgC,QAC9B,KAAK,CAAC,QAAQ,CACkB,CACJ,CAClC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport * as Sentry from \"@sentry/react\";\n\nimport { ReactifySearchContext, useConfig } from \"../../hooks\";\nimport { UtilityAuthenticatedReactiveBase } from \"../../components\";\nimport { debug } from \"../../utility\";\n\nexport type ReactifySearchBaseProps = {\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 filterStackHandle?: 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 ReactifySearchBase 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 collection: {\n id: number;\n title: string;\n handle: string;\n };\n }\n | {\n mode: \"instant-search\";\n }\n);\n\nexport const ReactifySearchBase: React.FC<ReactifySearchBaseProps> = (\n props\n) => {\n React.useEffect(() => {\n debug.log(\"ReactifySearchBase\", \"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.collection.handle : undefined,\n \"reactifysearch.filter\": props.filterStackHandle,\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<ReactifySearchBaseProps> = (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\") return undefined;\n const urlParams = new URLSearchParams(window.location.search);\n return urlParams.get(\"q\") ?? undefined;\n }, [window.location.search]);\n\n const searchSortFromURL = React.useMemo(() => {\n if (typeof window === \"undefined\") return undefined;\n const urlParams = new URLSearchParams(window.location.search);\n return urlParams.get(\"sort\") ?? undefined;\n }, [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 (window.location.search === \"\" && sortOption) {\n setSortOption(sortOption);\n }\n }, [window.location.href]);\n\n const contextValue = React.useMemo(() => {\n if (!config) {\n return;\n }\n\n const memoValue = {\n config: config,\n options: {\n ...props,\n index: props.index ?? config.index,\n filterStackHandle: props.filterStackHandle,\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\n debug.log(\"ReactifySearchBase\", \"context\", memoValue);\n\n return memoValue;\n }, [config, props, searchQuery, instantSearchVisible, 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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ReactifySearchBase/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ReactifySearchBase/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAAqC","sourcesContent":["export * from \"./ReactifySearchBase\";"]}
|
|
@@ -9,6 +9,7 @@ const react_intersection_observer_1 = require("react-intersection-observer");
|
|
|
9
9
|
const hooks_1 = require("../../hooks");
|
|
10
10
|
const __1 = require("..");
|
|
11
11
|
const ResultCardCallout = (props) => {
|
|
12
|
+
var _a;
|
|
12
13
|
const { track } = (0, hooks_1.useAnalytics)();
|
|
13
14
|
const { ref, inView } = (0, react_intersection_observer_1.useInView)({
|
|
14
15
|
threshold: 0.5,
|
|
@@ -37,11 +38,8 @@ const ResultCardCallout = (props) => {
|
|
|
37
38
|
handleView();
|
|
38
39
|
}
|
|
39
40
|
}, [inView]);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return (react_1.default.createElement(Component, Object.assign({}, props, { itemRef: ref, handleClick: handleClick })));
|
|
43
|
-
}
|
|
44
|
-
return (react_1.default.createElement(__1.ExampleResultCardCallout, Object.assign({}, props, { itemRef: ref, handleClick: handleClick })));
|
|
41
|
+
const RenderComponent = (_a = props.render) !== null && _a !== void 0 ? _a : __1.ExampleResultCardCallout;
|
|
42
|
+
return react_1.default.createElement(RenderComponent, Object.assign({}, props, { itemRef: ref, handleClick: handleClick }));
|
|
45
43
|
};
|
|
46
44
|
exports.ResultCardCallout = ResultCardCallout;
|
|
47
45
|
//# sourceMappingURL=ResultCardCallout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultCardCallout.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultCardCallout.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,6EAAwD;AAGxD,uCAA2C;AAC3C,0BAA8C;
|
|
1
|
+
{"version":3,"file":"ResultCardCallout.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultCardCallout.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,6EAAwD;AAGxD,uCAA2C;AAC3C,0BAA8C;AAcvC,MAAM,iBAAiB,GAAqC,CAAC,KAAK,EAAE,EAAE;;IAC3E,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,oBAAY,GAAE,CAAC;IACjC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,IAAA,uCAAS,EAAC;QAChC,SAAS,EAAE,GAAG;QACd,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,eAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACzC,KAAK,CAAC;YACJ,SAAS,EAAE,gBAAgB;YAC3B,OAAO,EAAE;gBACP,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI;gBACxB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;aAC3B;SACF,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAE3B,MAAM,UAAU,GAAG,eAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACxC,KAAK,CAAC;YACJ,SAAS,EAAE,eAAe;YAC1B,OAAO,EAAE;gBACP,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI;gBACxB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;aAC3B;SACF,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAE3B,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,MAAM,EAAE;YACV,UAAU,EAAE,CAAC;SACd;IACH,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,MAAM,eAAe,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,4BAAwB,CAAC;IAEjE,OAAO,8BAAC,eAAe,oBAAK,KAAK,IAAE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,WAAW,IAAI,CAAC;AAChF,CAAC,CAAC;AApCW,QAAA,iBAAiB,qBAoC5B","sourcesContent":["import React from \"react\";\nimport { useInView } from \"react-intersection-observer\";\n\nimport { ElasticCallout } from \"../../types\";\nimport { useAnalytics } from \"../../hooks\";\nimport { ExampleResultCardCallout } from \"..\";\n\nexport type ResultCardCalloutProps = {\n pagePosition: number;\n document: ElasticCallout;\n callout: ElasticCallout[\"callout\"];\n render?: React.FC<\n Omit<ResultCardCalloutProps, \"render\"> & {\n itemRef: (node?: Element | null) => void;\n handleClick: () => void;\n }\n >;\n};\n\nexport const ResultCardCallout: React.FC<ResultCardCalloutProps> = (props) => {\n const { track } = useAnalytics();\n const { ref, inView } = useInView({\n threshold: 0.5,\n triggerOnce: true,\n });\n\n const handleClick = React.useCallback(() => {\n track({\n eventName: \"clickPromotion\",\n payload: {\n link: props.callout.link,\n title: props.callout.title,\n },\n });\n }, [track, props.callout]);\n\n const handleView = React.useCallback(() => {\n track({\n eventName: \"viewPromotion\",\n payload: {\n link: props.callout.link,\n title: props.callout.title,\n },\n });\n }, [track, props.callout]);\n\n React.useEffect(() => {\n if (inView) {\n handleView();\n }\n }, [inView]);\n\n const RenderComponent = props.render ?? ExampleResultCardCallout;\n\n return <RenderComponent {...props} itemRef={ref} handleClick={handleClick} />;\n};\n"]}
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
@@ -19,8 +8,8 @@ const react_1 = __importDefault(require("react"));
|
|
|
19
8
|
const react_intersection_observer_1 = require("react-intersection-observer");
|
|
20
9
|
const hooks_1 = require("../../hooks");
|
|
21
10
|
const components_1 = require("../../components");
|
|
22
|
-
const ResultCardProduct = (
|
|
23
|
-
var
|
|
11
|
+
const ResultCardProduct = (props) => {
|
|
12
|
+
var _a;
|
|
24
13
|
const productPrice = (0, hooks_1.useProductPrice)(props.product);
|
|
25
14
|
const { track } = (0, hooks_1.useAnalytics)();
|
|
26
15
|
const { ref, inView } = (0, react_intersection_observer_1.useInView)({
|
|
@@ -54,11 +43,8 @@ const ResultCardProduct = (_a) => {
|
|
|
54
43
|
handleView();
|
|
55
44
|
}
|
|
56
45
|
}, [inView]);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return (react_1.default.createElement(Component, Object.assign({}, props, productPrice, { itemRef: ref, handleClick: handleClick })));
|
|
60
|
-
}
|
|
61
|
-
return (react_1.default.createElement(components_1.ExampleResultCardProduct, Object.assign({}, props, productPrice, { itemRef: ref, handleClick: handleClick })));
|
|
46
|
+
const RenderComponent = (_a = props.render) !== null && _a !== void 0 ? _a : components_1.ExampleResultCardProduct;
|
|
47
|
+
return (react_1.default.createElement(RenderComponent, Object.assign({}, productPrice, { pagePosition: props.pagePosition, product: props.product, document: props.document, itemRef: ref, handleClick: handleClick })));
|
|
62
48
|
};
|
|
63
49
|
exports.ResultCardProduct = ResultCardProduct;
|
|
64
50
|
//# sourceMappingURL=ResultCardProduct.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultCardProduct.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultCardProduct.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResultCardProduct.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultCardProduct.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,6EAAwD;AAGxD,uCAA4D;AAC5D,iDAA4D;AAerD,MAAM,iBAAiB,GAAqC,CAAC,KAAK,EAAE,EAAE;;IAC3E,MAAM,YAAY,GAAG,IAAA,uBAAe,EAAC,KAA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AQ,EAAE,KAAK,CAAC,QAAQ,EACxB,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,WAAW,IACxB,CACH,CAAC;AACJ,CAAC,CAAC;AAnDW,QAAA,iBAAiB,qBAmD5B","sourcesContent":["import React from \"react\";\nimport { useInView } from \"react-intersection-observer\";\n\nimport type { ElasticProduct } from \"../../types\";\nimport { useProductPrice, useAnalytics } from \"../../hooks\";\nimport { ExampleResultCardProduct } from \"../../components\";\n\nexport type ResultCardProductProps = {\n pagePosition: number;\n product: ElasticProduct;\n document: ElasticProduct;\n render?: React.FC<\n Omit<ResultCardProductProps, \"render\"> &\n ReturnType<typeof useProductPrice> & {\n itemRef: (node?: Element | null) => void;\n handleClick: () => void;\n }\n >;\n};\n\nexport const ResultCardProduct: React.FC<ResultCardProductProps> = (props) => {\n const productPrice = useProductPrice(props.product);\n\n const { track } = useAnalytics();\n const { ref, inView } = useInView({\n threshold: 0.5,\n triggerOnce: true,\n });\n\n const handleClick = React.useCallback(() => {\n track({\n eventName: \"clickProduct\",\n payload: {\n elasticProduct: {\n id: props.product.id,\n title: props.product.title,\n },\n },\n });\n }, [track, props.product]);\n\n const handleView = React.useCallback(() => {\n track({\n eventName: \"viewProduct\",\n payload: {\n elasticProduct: {\n id: props.product.id,\n title: props.product.title,\n },\n },\n });\n }, [track, props.product]);\n\n React.useEffect(() => {\n if (inView) {\n handleView();\n }\n }, [inView]);\n\n const RenderComponent = props.render ?? ExampleResultCardProduct;\n\n return (\n <RenderComponent\n {...productPrice}\n pagePosition={props.pagePosition}\n product={props.product}\n document={props.document}\n itemRef={ref}\n handleClick={handleClick}\n />\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultPaginationLoadMore.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultPaginationLoadMore.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,uCAAoD;AACpD,iDAAmE;AAM5D,MAAM,wBAAwB,GAA4C,CAAC,KAAK,EAAE,EAAE;;IACzF,MAAM,sBAAsB,GAAG,IAAA,6BAAqB,EAAC,KAAK,CAAC,CAAC;IAE5D,MAAM,yBAAyB,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,4CAA+B,CAAC;IAElF,OAAO,CACL,8BAAC,yBAAyB,oBACpB,sBAAsB,EAC1B,CACH,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,wBAAwB,4BAUnC"}
|
|
1
|
+
{"version":3,"file":"ResultPaginationLoadMore.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultPaginationLoadMore.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,uCAAoD;AACpD,iDAAmE;AAM5D,MAAM,wBAAwB,GAA4C,CAAC,KAAK,EAAE,EAAE;;IACzF,MAAM,sBAAsB,GAAG,IAAA,6BAAqB,EAAC,KAAK,CAAC,CAAC;IAE5D,MAAM,yBAAyB,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,4CAA+B,CAAC;IAElF,OAAO,CACL,8BAAC,yBAAyB,oBACpB,sBAAsB,EAC1B,CACH,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,wBAAwB,4BAUnC","sourcesContent":["import React from \"react\";\n\nimport { ReactivesearchResultProps } from \"../../types\";\nimport { usePaginationLoadMore } from \"../../hooks\";\nimport { ExampleResultPaginationLoadMore } from \"../../components\";\n\nexport type ResultPaginationLoadMoreProps = ReactivesearchResultProps & {\n render?: React.FC<ReturnType<typeof usePaginationLoadMore>>;\n};\n\nexport const ResultPaginationLoadMore: React.FC<ResultPaginationLoadMoreProps> = (props) => {\n const paginationLoadMoreHook = usePaginationLoadMore(props);\n\n const RenderPaginationComponent = props.render ?? ExampleResultPaginationLoadMore;\n\n return (\n <RenderPaginationComponent\n {...paginationLoadMoreHook}\n />\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultPaginationNextPrev.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultPaginationNextPrev.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAA4C;AAE5C,iDAAmE;AAM5D,MAAM,wBAAwB,GAA4C,CAAC,KAAK,EAAE,EAAE;;IACzF,MAAM,cAAc,GAAG,IAAA,qBAAa,EAAC,KAAK,CAAC,CAAC;IAE5C,MAAM,yBAAyB,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,4CAA+B,CAAC;IAElF,OAAO,CACL,8BAAC,yBAAyB,oBACpB,cAAc,EAClB,CACH,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,wBAAwB,4BAUnC"}
|
|
1
|
+
{"version":3,"file":"ResultPaginationNextPrev.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultPaginationNextPrev.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAA4C;AAE5C,iDAAmE;AAM5D,MAAM,wBAAwB,GAA4C,CAAC,KAAK,EAAE,EAAE;;IACzF,MAAM,cAAc,GAAG,IAAA,qBAAa,EAAC,KAAK,CAAC,CAAC;IAE5C,MAAM,yBAAyB,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,4CAA+B,CAAC;IAElF,OAAO,CACL,8BAAC,yBAAyB,oBACpB,cAAc,EAClB,CACH,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,wBAAwB,4BAUnC","sourcesContent":["import React from \"react\";\n\nimport { usePagination } from \"../../hooks\";\nimport { ReactivesearchPaginationProps } from \"../../types\";\nimport { ExampleResultPaginationNextPrev } from \"../../components\";\n\nexport type ResultPaginationNextPrevProps = ReactivesearchPaginationProps & {\n render?: React.FC<ReturnType<typeof usePagination>>;\n};\n\nexport const ResultPaginationNextPrev: React.FC<ResultPaginationNextPrevProps> = (props) => {\n const paginationHook = usePagination(props);\n\n const RenderPaginationComponent = props.render ?? ExampleResultPaginationNextPrev;\n\n return (\n <RenderPaginationComponent\n {...paginationHook}\n />\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultPaginationNumbered.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultPaginationNumbered.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,uCAA4C;AAC5C,iDAAmE;AAM5D,MAAM,wBAAwB,GAA4C,CAAC,KAAK,EAAE,EAAE;;IACzF,MAAM,cAAc,GAAG,IAAA,qBAAa,EAAC,KAAK,CAAC,CAAC;IAE5C,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE;QAC9B,OAAO,IAAI,CAAC;KACb;IAED,MAAM,yBAAyB,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,4CAA+B,CAAC;IAElF,OAAO,CACL,8BAAC,yBAAyB,oBACpB,cAAc,EAClB,CACH,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,wBAAwB,4BAcnC"}
|
|
1
|
+
{"version":3,"file":"ResultPaginationNumbered.js","sourceRoot":"","sources":["../../../../src/components/Result/ResultPaginationNumbered.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,uCAA4C;AAC5C,iDAAmE;AAM5D,MAAM,wBAAwB,GAA4C,CAAC,KAAK,EAAE,EAAE;;IACzF,MAAM,cAAc,GAAG,IAAA,qBAAa,EAAC,KAAK,CAAC,CAAC;IAE5C,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE;QAC9B,OAAO,IAAI,CAAC;KACb;IAED,MAAM,yBAAyB,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,4CAA+B,CAAC;IAElF,OAAO,CACL,8BAAC,yBAAyB,oBACpB,cAAc,EAClB,CACH,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,wBAAwB,4BAcnC","sourcesContent":["import React from \"react\";\n\nimport { ReactivesearchPaginationProps } from \"../../types\";\nimport { usePagination } from \"../../hooks\";\nimport { ExampleResultPaginationNumbered } from \"../../components\";\n\nexport type ResultPaginationNumberedProps = ReactivesearchPaginationProps & {\n render?: React.FC<ReturnType<typeof usePagination>>;\n};\n\nexport const ResultPaginationNumbered: React.FC<ResultPaginationNumberedProps> = (props) => {\n const paginationHook = usePagination(props);\n\n if (!paginationHook.totalPages) {\n return null;\n }\n \n const RenderPaginationComponent = props.render ?? ExampleResultPaginationNumbered;\n\n return (\n <RenderPaginationComponent\n {...paginationHook}\n />\n );\n};\n"]}
|