@usereactify/search 5.2.1-beta.1 → 5.2.3
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 +30 -0
- package/dist/package.json +8 -5
- package/dist/src/components/ClearAll/ClearAll.js +2 -2
- package/dist/src/components/ClearAll/ClearAll.js.map +1 -1
- package/dist/src/components/CustomComponent/CustomComponent.d.ts +1 -1
- package/dist/src/components/CustomComponent/CustomComponent.js +2 -2
- package/dist/src/components/CustomComponent/CustomComponent.js.map +1 -1
- package/dist/src/components/Example/ExampleCustomComponent.js +1 -1
- package/dist/src/components/Example/ExampleCustomComponent.js.map +1 -1
- package/dist/src/components/Example/ExampleFilterSlider.js +2 -2
- package/dist/src/components/Example/ExampleFilterSlider.js.map +1 -1
- package/dist/src/components/Example/ExampleReactiveSearchProviderCollection.js +1 -1
- package/dist/src/components/Example/ExampleReactiveSearchProviderCollection.js.map +1 -1
- package/dist/src/components/Example/ExampleReactiveSearchProviderInstantSearch.js +1 -1
- package/dist/src/components/Example/ExampleReactiveSearchProviderInstantSearch.js.map +1 -1
- package/dist/src/components/Example/ExampleReactiveSearchProviderSearch.js +1 -1
- package/dist/src/components/Example/ExampleReactiveSearchProviderSearch.js.map +1 -1
- package/dist/src/components/Filter/Filter.js +4 -3
- package/dist/src/components/Filter/Filter.js.map +1 -1
- package/dist/src/components/Filter/FiltersSelected.js +2 -2
- package/dist/src/components/Filter/FiltersSelected.js.map +1 -1
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.d.ts +4 -0
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js.map +1 -1
- package/dist/src/components/Sensor/SensorSearchTerm.js +1 -1
- package/dist/src/components/Sensor/SensorSearchTerm.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveReactiveListProps.js +4 -0
- package/dist/src/hooks/reactivesearch/useReactiveReactiveListProps.js.map +1 -1
- package/dist/src/hooks/useReactifySearchContext.d.ts +4 -0
- package/dist/src/hooks/useReactifySearchContext.js.map +1 -1
- package/package.json +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [5.2.3](https://bitbucket.org/usereactify/reactify-search-ui/compare/release-v5.2.2...release-v5.2.3) (2022-09-11)
|
|
6
|
+
|
|
7
|
+
### [5.2.2](https://bitbucket.org/usereactify/reactify-search-ui/compare/release-v5.2.1...release-v5.2.2) (2022-09-08)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* fix storybook config ([b748e78](https://bitbucket.org/usereactify/reactify-search-ui/commit/b748e7845e17c52cd141401bb24bc3fe85e1a3bd))
|
|
13
|
+
* rs-306 add includeFields and excludeFields to ReactiveListProps ([5531b81](https://bitbucket.org/usereactify/reactify-search-ui/commit/5531b81f8305eee862d3124d691619203162f7bd))
|
|
14
|
+
* rs-306 teeny cleanup when getting fields from context options ([a4bae10](https://bitbucket.org/usereactify/reactify-search-ui/commit/a4bae10652702a3328a50a56cea106befda749fe))
|
|
15
|
+
* switch from reactify-apps to usereactify-demo ([deb36dd](https://bitbucket.org/usereactify/reactify-search-ui/commit/deb36dddd964f89173983f7eca07e9e802c3050e))
|
|
16
|
+
|
|
17
|
+
### [5.2.2-beta.0](https://bitbucket.org/usereactify/reactify-search-ui/compare/beta-v5.2.1-beta.1...beta-v5.2.2-beta.0) (2022-09-08)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* fix storybook config ([b748e78](https://bitbucket.org/usereactify/reactify-search-ui/commit/b748e7845e17c52cd141401bb24bc3fe85e1a3bd))
|
|
23
|
+
* rs-306 add includeFields and excludeFields to ReactiveListProps ([5531b81](https://bitbucket.org/usereactify/reactify-search-ui/commit/5531b81f8305eee862d3124d691619203162f7bd))
|
|
24
|
+
* rs-306 teeny cleanup when getting fields from context options ([a4bae10](https://bitbucket.org/usereactify/reactify-search-ui/commit/a4bae10652702a3328a50a56cea106befda749fe))
|
|
25
|
+
* search results not updating when removing or clearing search term ([bc2a947](https://bitbucket.org/usereactify/reactify-search-ui/commit/bc2a947193c61b8dc202d2ca301b36c7498b9d52))
|
|
26
|
+
* switch from reactify-apps to usereactify-demo ([deb36dd](https://bitbucket.org/usereactify/reactify-search-ui/commit/deb36dddd964f89173983f7eca07e9e802c3050e))
|
|
27
|
+
|
|
28
|
+
### [5.2.1](https://bitbucket.org/usereactify/reactify-search-ui/compare/release-v5.2.0...release-v5.2.1) (2022-08-11)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* search results not updating when removing or clearing search term ([bc2a947](https://bitbucket.org/usereactify/reactify-search-ui/commit/bc2a947193c61b8dc202d2ca301b36c7498b9d52))
|
|
34
|
+
|
|
5
35
|
### [5.2.1-beta.1](https://bitbucket.org/usereactify/reactify-search-ui/compare/beta-v5.2.1-beta.0...beta-v5.2.1-beta.1) (2022-08-11)
|
|
6
36
|
|
|
7
37
|
### [5.2.1-beta.0](https://bitbucket.org/usereactify/reactify-search-ui/compare/beta-v5.2.0-beta.4...beta-v5.2.1-beta.0) (2022-08-11)
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usereactify/search",
|
|
3
3
|
"description": "React UI library for Reactify Search",
|
|
4
|
-
"version": "5.2.
|
|
4
|
+
"version": "5.2.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"types": "dist/src/index.d.ts",
|
|
@@ -48,13 +48,16 @@
|
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@appbaseio/reactivesearch": "^3.14.0",
|
|
51
|
+
"@babel/plugin-transform-typescript": "7.18.12",
|
|
51
52
|
"@commitlint/cli": "13.2.0",
|
|
52
53
|
"@commitlint/config-conventional": "13.2.0",
|
|
53
54
|
"@sentry/cli": "2.5.0",
|
|
54
|
-
"@storybook/addon-actions": "6.
|
|
55
|
-
"@storybook/addon-
|
|
56
|
-
"@storybook/addon-
|
|
57
|
-
"@storybook/
|
|
55
|
+
"@storybook/addon-actions": "6.5.10",
|
|
56
|
+
"@storybook/addon-docs": "6.5.10",
|
|
57
|
+
"@storybook/addon-essentials": "6.5.10",
|
|
58
|
+
"@storybook/addon-links": "6.5.10",
|
|
59
|
+
"@storybook/components": "6.5.10",
|
|
60
|
+
"@storybook/react": "6.5.10",
|
|
58
61
|
"@types/debug": "4.1.7",
|
|
59
62
|
"@types/react": "17.0.27",
|
|
60
63
|
"babel-loader": "8.2.2",
|
|
@@ -5,12 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ClearAll = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const
|
|
8
|
+
const SelectedFilters_1 = __importDefault(require("@appbaseio/reactivesearch/lib/components/basic/SelectedFilters"));
|
|
9
9
|
const components_1 = require("../../components");
|
|
10
10
|
const ClearAll = (props) => {
|
|
11
11
|
var _a;
|
|
12
12
|
const RenderComponent = (_a = props.render) !== null && _a !== void 0 ? _a : components_1.ExampleClearAll;
|
|
13
|
-
return (react_1.default.createElement(
|
|
13
|
+
return (react_1.default.createElement(SelectedFilters_1.default, { render: ({ selectedValues, clearValues }) => {
|
|
14
14
|
const selectedFilters = Object.values(selectedValues)
|
|
15
15
|
.map((value) => value)
|
|
16
16
|
.filter((item) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClearAll.js","sourceRoot":"","sources":["../../../../src/components/ClearAll/ClearAll.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"ClearAll.js","sourceRoot":"","sources":["../../../../src/components/ClearAll/ClearAll.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,qHAA6F;AAE7F,iDAAmD;AAS5C,MAAM,QAAQ,GAA4B,CAAC,KAAK,EAAE,EAAE;;IACzD,MAAM,eAAe,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,4BAAe,CAAC;IAExD,OAAO,CACL,8BAAC,yBAAe,IACd,MAAM,EAAE,CAAC,EAAE,cAAc,EAAE,WAAW,EAAE,EAAE,EAAE;YAC1C,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;iBAClD,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC;iBACrB,MAAM,CACL,CAAC,IAAS,EAAE,EAAE;;gBACZ,OAAA,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,SAAS;qBACf,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,CAAA;oBAChB,CAAC,CAAC,CAAC,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,0CAAE,MAAM,CAAA,IAAI,CAAC,CAAC,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,0CAAE,KAAK,CAAA,CAAC,CAAA;aAAA,CAClD,CAAC;YAEJ,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;gBAC3B,OAAO,IAAI,CAAC;aACb;YAED,OAAO,8BAAC,eAAe,IAAC,QAAQ,EAAE,WAAW,GAAI,CAAC;QACpD,CAAC,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAvBW,QAAA,QAAQ,YAuBnB","sourcesContent":["import React from \"react\";\nimport SelectedFilters from \"@appbaseio/reactivesearch/lib/components/basic/SelectedFilters\";\n\nimport { ExampleClearAll } from \"../../components\";\n\nexport type ClearAllProps = {\n /** Render method */\n render?: React.FC<{\n clearAll: () => void;\n }>;\n};\n\nexport const ClearAll: React.FC<ClearAllProps> = (props) => {\n const RenderComponent = props.render ?? ExampleClearAll;\n\n return (\n <SelectedFilters\n render={({ selectedValues, clearValues }) => {\n const selectedFilters = Object.values(selectedValues)\n .map((value) => value)\n .filter(\n (item: any) =>\n item?.URLParams &&\n item?.showFilter &&\n (!!item?.value?.length || !!item?.value?.label)\n );\n\n if (!selectedFilters.length) {\n return null;\n }\n\n return <RenderComponent clearAll={clearValues} />;\n }}\n />\n );\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
2
|
+
import ReactiveComponent from "@appbaseio/reactivesearch/lib/components/basic/ReactiveComponent";
|
|
3
3
|
export declare type CustomComponentProps = React.ComponentProps<typeof ReactiveComponent>;
|
|
4
4
|
export declare const CustomComponent: React.FC<CustomComponentProps>;
|
|
@@ -5,9 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CustomComponent = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const
|
|
8
|
+
const ReactiveComponent_1 = __importDefault(require("@appbaseio/reactivesearch/lib/components/basic/ReactiveComponent"));
|
|
9
9
|
const CustomComponent = (props) => {
|
|
10
|
-
return react_1.default.createElement(
|
|
10
|
+
return react_1.default.createElement(ReactiveComponent_1.default, Object.assign({}, props));
|
|
11
11
|
};
|
|
12
12
|
exports.CustomComponent = CustomComponent;
|
|
13
13
|
//# sourceMappingURL=CustomComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomComponent.js","sourceRoot":"","sources":["../../../../src/components/CustomComponent/CustomComponent.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"CustomComponent.js","sourceRoot":"","sources":["../../../../src/components/CustomComponent/CustomComponent.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,yHAAiG;AAM1F,MAAM,eAAe,GAAmC,CAAC,KAAK,EAAE,EAAE;IACvE,OAAO,8BAAC,2BAAiB,oBAAK,KAAK,EAAI,CAAC;AAC1C,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B","sourcesContent":["import React from \"react\";\nimport ReactiveComponent from \"@appbaseio/reactivesearch/lib/components/basic/ReactiveComponent\";\n\nexport type CustomComponentProps = React.ComponentProps<\n typeof ReactiveComponent\n>;\n\nexport const CustomComponent: React.FC<CustomComponentProps> = (props) => {\n return <ReactiveComponent {...props} />;\n};\n"]}
|
|
@@ -7,7 +7,7 @@ exports.ExampleCustomComponent = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const components_1 = require("../../components");
|
|
9
9
|
const ExampleCustomComponent = () => {
|
|
10
|
-
return (react_1.default.createElement(components_1.ReactifySearchProvider, { mode: "search", shopifyPermanentDomain: "
|
|
10
|
+
return (react_1.default.createElement(components_1.ReactifySearchProvider, { mode: "search", shopifyPermanentDomain: "usereactify-demo.myshopify.com", additionalComponentIds: ["SensorSpecialProduct"] },
|
|
11
11
|
react_1.default.createElement(components_1.CustomComponent, { componentId: "SensorSpecialProduct", customQuery: () => ({
|
|
12
12
|
query: {
|
|
13
13
|
match: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleCustomComponent.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleCustomComponent.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA2E;AAEpE,MAAM,sBAAsB,GAAa,GAAG,EAAE;IACnD,OAAO,CACL,8BAAC,mCAAsB,IACrB,IAAI,EAAC,QAAQ,EACb,sBAAsB,EAAC,
|
|
1
|
+
{"version":3,"file":"ExampleCustomComponent.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleCustomComponent.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA2E;AAEpE,MAAM,sBAAsB,GAAa,GAAG,EAAE;IACnD,OAAO,CACL,8BAAC,mCAAsB,IACrB,IAAI,EAAC,QAAQ,EACb,sBAAsB,EAAC,gCAAgC,EACvD,sBAAsB,EAAE,CAAC,sBAAsB,CAAC;QAEhD,8BAAC,4BAAe,IACd,WAAW,EAAC,sBAAsB,EAClC,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;gBAClB,KAAK,EAAE;oBACL,KAAK,EAAE;wBACL,YAAY,EAAE,iBAAiB;qBAChC;iBACF;aACF,CAAC,GACF,CACqB,CAC1B,CAAC;AACJ,CAAC,CAAC;AAnBW,QAAA,sBAAsB,0BAmBjC","sourcesContent":["import React from \"react\";\n\nimport { ReactifySearchProvider, CustomComponent } from \"../../components\";\n\nexport const ExampleCustomComponent: React.FC = () => {\n return (\n <ReactifySearchProvider\n mode=\"search\"\n shopifyPermanentDomain=\"usereactify-demo.myshopify.com\"\n additionalComponentIds={[\"SensorSpecialProduct\"]}\n >\n <CustomComponent\n componentId=\"SensorSpecialProduct\"\n customQuery={() => ({\n query: {\n match: {\n product_type: \"Special Product\",\n },\n },\n })}\n />\n </ReactifySearchProvider>\n );\n};\n"]}
|
|
@@ -5,13 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ExampleFilterSlider = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const
|
|
8
|
+
const DynamicRangeSlider_1 = __importDefault(require("@appbaseio/reactivesearch/lib/components/range/DynamicRangeSlider"));
|
|
9
9
|
const hooks_1 = require("../../hooks");
|
|
10
10
|
const ExampleFilterSlider = (props) => {
|
|
11
11
|
const reactiveFilterSliderProps = (0, hooks_1.useReactiveFilterSliderProps)(props.filter);
|
|
12
12
|
return (react_1.default.createElement("div", { className: "rs__filter" },
|
|
13
13
|
react_1.default.createElement("h3", { className: "rs__filter__name" }, props.filter.name),
|
|
14
|
-
react_1.default.createElement(
|
|
14
|
+
react_1.default.createElement(DynamicRangeSlider_1.default, Object.assign({}, reactiveFilterSliderProps, { value: () => props.filterSliderProps.value, onChange: (value) => props.filterSliderProps.handleChange({
|
|
15
15
|
start: value[0],
|
|
16
16
|
end: value[1],
|
|
17
17
|
}) }))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleFilterSlider.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterSlider.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"ExampleFilterSlider.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterSlider.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,2HAAmG;AAEnG,uCAA2D;AAOpD,MAAM,mBAAmB,GAAuC,CACrE,KAAK,EACL,EAAE;IACF,MAAM,yBAAyB,GAAG,IAAA,oCAA4B,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE7E,OAAO,CACL,uCAAK,SAAS,EAAC,YAAY;QACzB,sCAAI,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAM;QACzD,8BAAC,4BAAkB,oBACb,yBAAyB,IAC7B,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,EAC1C,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAClB,KAAK,CAAC,iBAAiB,CAAC,YAAY,CAAC;gBACnC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;gBACf,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;aACd,CAAC,IAEJ,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,mBAAmB,uBAoB9B","sourcesContent":["import React from \"react\";\nimport DynamicRangeSlider from \"@appbaseio/reactivesearch/lib/components/range/DynamicRangeSlider\";\n\nimport { useReactiveFilterSliderProps } from \"../../hooks\";\nimport { FilterProps } from \"../../components\";\n\nexport type ExampleFilterSliderProps = React.ComponentProps<\n NonNullable<FilterProps[\"renderFilterSlider\"]>\n>;\n\nexport const ExampleFilterSlider: React.FC<ExampleFilterSliderProps> = (\n props\n) => {\n const reactiveFilterSliderProps = useReactiveFilterSliderProps(props.filter);\n\n return (\n <div className=\"rs__filter\">\n <h3 className=\"rs__filter__name\">{props.filter.name}</h3>\n <DynamicRangeSlider\n {...reactiveFilterSliderProps}\n value={() => props.filterSliderProps.value}\n onChange={(value) =>\n props.filterSliderProps.handleChange({\n start: value[0],\n end: value[1],\n })\n }\n />\n </div>\n );\n};\n"]}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ExampleReactiveSearchProviderCollection = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const components_1 = require("../../components");
|
|
9
|
-
const ExampleReactiveSearchProviderCollection = () => (react_1.default.createElement(components_1.ReactifySearchProvider, { mode: "collection", shopifyPermanentDomain: "
|
|
9
|
+
const ExampleReactiveSearchProviderCollection = () => (react_1.default.createElement(components_1.ReactifySearchProvider, { mode: "collection", shopifyPermanentDomain: "usereactify-demo.myshopify.com", collectionHandle: "example-collection" },
|
|
10
10
|
react_1.default.createElement(react_1.default.Fragment, null)));
|
|
11
11
|
exports.ExampleReactiveSearchProviderCollection = ExampleReactiveSearchProviderCollection;
|
|
12
12
|
//# sourceMappingURL=ExampleReactiveSearchProviderCollection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleReactiveSearchProviderCollection.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleReactiveSearchProviderCollection.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA0D;AAEnD,MAAM,uCAAuC,GAAa,GAAG,EAAE,CAAC,CACrE,8BAAC,mCAAsB,IACrB,IAAI,EAAC,YAAY,EACjB,sBAAsB,EAAC,
|
|
1
|
+
{"version":3,"file":"ExampleReactiveSearchProviderCollection.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleReactiveSearchProviderCollection.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA0D;AAEnD,MAAM,uCAAuC,GAAa,GAAG,EAAE,CAAC,CACrE,8BAAC,mCAAsB,IACrB,IAAI,EAAC,YAAY,EACjB,sBAAsB,EAAC,gCAAgC,EACvD,gBAAgB,EAAC,oBAAoB;IAErC,6DAAK,CACkB,CAC1B,CAAC;AARW,QAAA,uCAAuC,2CAQlD","sourcesContent":["import React from \"react\";\n\nimport { ReactifySearchProvider } from \"../../components\";\n\nexport const ExampleReactiveSearchProviderCollection: React.FC = () => (\n <ReactifySearchProvider\n mode=\"collection\"\n shopifyPermanentDomain=\"usereactify-demo.myshopify.com\"\n collectionHandle=\"example-collection\"\n >\n <></>\n </ReactifySearchProvider>\n);\n"]}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ExampleReactiveSearchProviderInstantSearch = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const components_1 = require("../../components");
|
|
9
|
-
const ExampleReactiveSearchProviderInstantSearch = () => (react_1.default.createElement(components_1.ReactifySearchProvider, { mode: "instant-search", shopifyPermanentDomain: "
|
|
9
|
+
const ExampleReactiveSearchProviderInstantSearch = () => (react_1.default.createElement(components_1.ReactifySearchProvider, { mode: "instant-search", shopifyPermanentDomain: "usereactify-demo.myshopify.com" },
|
|
10
10
|
react_1.default.createElement(react_1.default.Fragment, null)));
|
|
11
11
|
exports.ExampleReactiveSearchProviderInstantSearch = ExampleReactiveSearchProviderInstantSearch;
|
|
12
12
|
//# sourceMappingURL=ExampleReactiveSearchProviderInstantSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleReactiveSearchProviderInstantSearch.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleReactiveSearchProviderInstantSearch.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA0D;AAEnD,MAAM,0CAA0C,GAAa,GAAG,EAAE,CAAC,CACxE,8BAAC,mCAAsB,IACrB,IAAI,EAAC,gBAAgB,EACrB,sBAAsB,EAAC,
|
|
1
|
+
{"version":3,"file":"ExampleReactiveSearchProviderInstantSearch.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleReactiveSearchProviderInstantSearch.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA0D;AAEnD,MAAM,0CAA0C,GAAa,GAAG,EAAE,CAAC,CACxE,8BAAC,mCAAsB,IACrB,IAAI,EAAC,gBAAgB,EACrB,sBAAsB,EAAC,gCAAgC;IAEvD,6DAAK,CACkB,CAC1B,CAAC;AAPW,QAAA,0CAA0C,8CAOrD","sourcesContent":["import React from \"react\";\n\nimport { ReactifySearchProvider } from \"../../components\";\n\nexport const ExampleReactiveSearchProviderInstantSearch: React.FC = () => (\n <ReactifySearchProvider\n mode=\"instant-search\"\n shopifyPermanentDomain=\"usereactify-demo.myshopify.com\"\n >\n <></>\n </ReactifySearchProvider>\n);\n"]}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ExampleReactiveSearchProviderSearch = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const components_1 = require("../../components");
|
|
9
|
-
const ExampleReactiveSearchProviderSearch = () => (react_1.default.createElement(components_1.ReactifySearchProvider, { mode: "search", shopifyPermanentDomain: "
|
|
9
|
+
const ExampleReactiveSearchProviderSearch = () => (react_1.default.createElement(components_1.ReactifySearchProvider, { mode: "search", shopifyPermanentDomain: "usereactify-demo.myshopify.com" },
|
|
10
10
|
react_1.default.createElement(react_1.default.Fragment, null)));
|
|
11
11
|
exports.ExampleReactiveSearchProviderSearch = ExampleReactiveSearchProviderSearch;
|
|
12
12
|
//# sourceMappingURL=ExampleReactiveSearchProviderSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleReactiveSearchProviderSearch.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleReactiveSearchProviderSearch.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA0D;AAEnD,MAAM,mCAAmC,GAAa,GAAG,EAAE,CAAC,CACjE,8BAAC,mCAAsB,IACrB,IAAI,EAAC,QAAQ,EACb,sBAAsB,EAAC,
|
|
1
|
+
{"version":3,"file":"ExampleReactiveSearchProviderSearch.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleReactiveSearchProviderSearch.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAA0D;AAEnD,MAAM,mCAAmC,GAAa,GAAG,EAAE,CAAC,CACjE,8BAAC,mCAAsB,IACrB,IAAI,EAAC,QAAQ,EACb,sBAAsB,EAAC,gCAAgC;IAEvD,6DAAK,CACkB,CAC1B,CAAC;AAPW,QAAA,mCAAmC,uCAO9C","sourcesContent":["import React from \"react\";\n\nimport { ReactifySearchProvider } from \"../../components\";\n\nexport const ExampleReactiveSearchProviderSearch: React.FC = () => (\n <ReactifySearchProvider\n mode=\"search\"\n shopifyPermanentDomain=\"usereactify-demo.myshopify.com\"\n >\n <></>\n </ReactifySearchProvider>\n);\n"]}
|
|
@@ -18,9 +18,10 @@ exports.Filter = void 0;
|
|
|
18
18
|
const react_1 = __importDefault(require("react"));
|
|
19
19
|
const MultiList_1 = __importDefault(require("@appbaseio/reactivesearch/lib/components/list/MultiList"));
|
|
20
20
|
const SingleList_1 = __importDefault(require("@appbaseio/reactivesearch/lib/components/list/SingleList"));
|
|
21
|
+
const DynamicRangeSlider_1 = __importDefault(require("@appbaseio/reactivesearch/lib/components/range/DynamicRangeSlider"));
|
|
22
|
+
const SingleRange_1 = __importDefault(require("@appbaseio/reactivesearch/lib/components/range/SingleRange"));
|
|
21
23
|
const hooks_1 = require("../../hooks");
|
|
22
24
|
const components_1 = require("../../components");
|
|
23
|
-
const reactivesearch_1 = require("@appbaseio/reactivesearch");
|
|
24
25
|
const Filter = (props) => {
|
|
25
26
|
if ("single" === props.filter.displayType) {
|
|
26
27
|
return react_1.default.createElement(FilterSingleList, Object.assign({}, props));
|
|
@@ -55,7 +56,7 @@ const FilterRange = (props) => {
|
|
|
55
56
|
react_1.default.createElement("div", { style: {
|
|
56
57
|
display: "none",
|
|
57
58
|
} },
|
|
58
|
-
react_1.default.createElement(
|
|
59
|
+
react_1.default.createElement(SingleRange_1.default, Object.assign({}, reactiveFilterRangeProps, { value: filterRangeProps.value, onChange: filterRangeProps.handleChange }))),
|
|
59
60
|
react_1.default.createElement(RenderRangeComponent, { filterRangeProps: filterRangeProps, filter: props.filter })));
|
|
60
61
|
};
|
|
61
62
|
const FilterSlider = (props) => {
|
|
@@ -67,7 +68,7 @@ const FilterSlider = (props) => {
|
|
|
67
68
|
props.renderFilterSlider ? (react_1.default.createElement("div", { style: {
|
|
68
69
|
display: "none",
|
|
69
70
|
} },
|
|
70
|
-
react_1.default.createElement(
|
|
71
|
+
react_1.default.createElement(DynamicRangeSlider_1.default, Object.assign({}, reactiveFilterSliderProps, { value: () => filterSliderProps.value, onChange: (value) => filterSliderProps.handleChange({
|
|
71
72
|
start: value[0],
|
|
72
73
|
end: value[1],
|
|
73
74
|
}) })))) : null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../../../src/components/Filter/Filter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,wGAAgF;AAChF,0GAAkF;
|
|
1
|
+
{"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../../../src/components/Filter/Filter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,wGAAgF;AAChF,0GAAkF;AAClF,2HAAmG;AACnG,6GAAqF;AAMrF,uCAOqB;AAC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AAC,KAAK,EAAE,EAAE,CAClB,iBAAiB,CAAC,YAAY,CAAC;oBAC7B,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;oBACf,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;iBACd,CAAC,IAEJ,CACE,CACP,CAAC,CAAC,CAAC,IAAI;QACR,8BAAC,qBAAqB,IACpB,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,EAAE,KAAK,CAAC,MAAM,GACpB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,qFAAqF;AACrF,MAAM,eAAe,GAEjB,CAAC,KAAK,EAAE,EAAE;IACZ,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,yBAAyB,KACzD,KAAK,EADyD,UAAU,UACxE,KAAK,EADD,2DAAsE,CACrE,CAAC;IAER,MAAM,eAAe,GAAG,IAAA,0BAAkB,EAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;IAE9E,+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,eAAe,EAChC,MAAM,EAAE,MAAM,IACV,UAAU,EACd,CACH,CAAC;KACH;IAED,OAAO,CACL,8BAAC,8BAAiB,kBAChB,eAAe,EAAE,eAAe,EAChC,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\";\nimport DynamicRangeSlider from \"@appbaseio/reactivesearch/lib/components/range/DynamicRangeSlider\";\nimport SingleRange from \"@appbaseio/reactivesearch/lib/components/range/SingleRange\";\n\nimport type {\n ConfigFilterOption,\n ReactivesearchFilterListProps,\n} from \"../../types\";\nimport {\n useFilterListProps,\n useFilterRangeProps,\n useFilterSliderProps,\n useReactiveFilterListProps,\n useReactiveFilterRangeProps,\n useReactiveFilterSliderProps,\n} from \"../../hooks\";\nimport {\n ExampleFilterList,\n ExampleFilterRange,\n ExampleFilterSlider,\n} from \"../../components\";\n\nexport type FilterProps = {\n /** The filter option being rendered */\n filter: ConfigFilterOption;\n /** Render method for List filters */\n renderFilterList?: React.FC<{\n filter: ConfigFilterOption;\n filterListProps: ReturnType<typeof useFilterListProps>;\n }>;\n /** Render method for Range filters */\n renderFilterRange?: React.FC<{\n filter: ConfigFilterOption;\n filterRangeProps: ReturnType<typeof useFilterRangeProps>;\n }>;\n /** Render method for Slider filters */\n renderFilterSlider?: React.FC<{\n filter: ConfigFilterOption;\n filterSliderProps: ReturnType<typeof useFilterSliderProps>;\n }>;\n};\n\nexport const Filter: React.FC<FilterProps> = (props) => {\n if (\"single\" === props.filter.displayType) {\n return <FilterSingleList {...props} />;\n }\n\n if (\"multi\" === props.filter.displayType) {\n return <FilterMultiList {...props} />;\n }\n\n if (\"range\" === props.filter.displayType) {\n return <FilterRange {...props} />;\n }\n\n if (\"slider\" === props.filter.displayType) {\n return <FilterSlider {...props} />;\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: ReactivesearchFilterListProps) => (\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: ReactivesearchFilterListProps) => (\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 const filterRangeProps = useFilterRangeProps(props.filter);\n\n const RenderRangeComponent = props.renderFilterRange ?? ExampleFilterRange;\n\n return (\n <>\n <div\n style={{\n display: \"none\",\n }}\n >\n <SingleRange\n {...reactiveFilterRangeProps}\n value={filterRangeProps.value}\n onChange={filterRangeProps.handleChange}\n />\n </div>\n <RenderRangeComponent\n filterRangeProps={filterRangeProps}\n filter={props.filter}\n />\n </>\n );\n};\n\nconst FilterSlider: React.FC<FilterProps> = (props) => {\n const reactiveFilterSliderProps = useReactiveFilterSliderProps(props.filter);\n\n const filterSliderProps = useFilterSliderProps(props.filter);\n\n const RenderSliderComponent = props.renderFilterSlider ?? ExampleFilterSlider;\n\n return (\n <>\n {props.renderFilterSlider ? (\n <div\n style={{\n display: \"none\",\n }}\n >\n <DynamicRangeSlider\n {...reactiveFilterSliderProps}\n value={() => filterSliderProps.value}\n onChange={(value) =>\n filterSliderProps.handleChange({\n start: value[0],\n end: value[1],\n })\n }\n />\n </div>\n ) : null}\n <RenderSliderComponent\n filterSliderProps={filterSliderProps}\n filter={props.filter}\n />\n </>\n );\n};\n\n// inner component exists only so we can use memos in reactivesearch render functions\nconst FilterListInner: React.FC<\n FilterProps & { reactivesearchFilterProps: ReactivesearchFilterListProps }\n> = (props) => {\n const { filter, renderFilterList, reactivesearchFilterProps, ...otherProps } =\n props;\n\n const filterListProps = useFilterListProps(filter, reactivesearchFilterProps);\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={filterListProps}\n filter={filter}\n {...otherProps}\n />\n );\n }\n\n return (\n <ExampleFilterList\n filterListProps={filterListProps}\n filter={filter}\n {...otherProps}\n />\n );\n};\n"]}
|
|
@@ -4,13 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.FiltersSelected = void 0;
|
|
7
|
-
const reactivesearch_1 = require("@appbaseio/reactivesearch");
|
|
8
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const SelectedFilters_1 = __importDefault(require("@appbaseio/reactivesearch/lib/components/basic/SelectedFilters"));
|
|
9
9
|
const components_1 = require("../../components");
|
|
10
10
|
const FiltersSelected = (props) => {
|
|
11
11
|
var _a;
|
|
12
12
|
const RenderComponent = (_a = props.render) !== null && _a !== void 0 ? _a : components_1.ExampleFiltersSelected;
|
|
13
|
-
return (react_1.default.createElement(
|
|
13
|
+
return (react_1.default.createElement(SelectedFilters_1.default, { render: ({ selectedValues, setValue }) => {
|
|
14
14
|
const selectedFilters = Object.entries(selectedValues)
|
|
15
15
|
.filter(([key, item]) => {
|
|
16
16
|
var _a, _b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FiltersSelected.js","sourceRoot":"","sources":["../../../../src/components/Filter/FiltersSelected.tsx"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"FiltersSelected.js","sourceRoot":"","sources":["../../../../src/components/Filter/FiltersSelected.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,qHAA6F;AAE7F,iDAA0D;AAcnD,MAAM,eAAe,GAAmC,CAAC,KAAK,EAAE,EAAE;;IACvE,MAAM,eAAe,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,mCAAsB,CAAC;IAE/D,OAAO,CACL,8BAAC,yBAAe,IACd,MAAM,EAAE,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE,EAAE;YACvC,MAAM,eAAe,GACnB,MAAM,CAAC,OAAO,CAAC,cAAc,CAC9B;iBACE,MAAM,CACL,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;;gBACd,OAAA,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,SAAS;qBACf,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,CAAA;oBAChB,CAAC,CAAC,CAAC,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,0CAAE,MAAM,CAAA,IAAI,CAAC,CAAC,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,0CAAE,KAAK,CAAA,CAAC,CAAA;aAAA,CAClD;iBACA,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;gBACrB,GAAG,EAAE,GAAG;gBACR,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,KAAK,EAAE,IAAI,CAAC,KAAK;aAClB,CAAC,CAAC,CAAC;YAEN,MAAM,YAAY,GAAG,CAAC,iBAAyB,EAAE,EAAE;gBACjD,QAAQ,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;YACpC,CAAC,CAAC;YAEF,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;gBAC3B,OAAO,IAAI,CAAC;aACb;YAED,OAAO,CACL,8BAAC,eAAe,IACd,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;QACJ,CAAC,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAtCW,QAAA,eAAe,mBAsC1B","sourcesContent":["import React from \"react\";\nimport SelectedFilters from \"@appbaseio/reactivesearch/lib/components/basic/SelectedFilters\";\n\nimport { ExampleFiltersSelected } from \"../../components\";\n\nexport type FiltersSelectedProps = {\n /** Render method called once for all active filters */\n render?: React.FC<{\n selectedFilters: Array<{\n key: string;\n label: string;\n value: Array<string> | string | { start: number; end: number };\n }>;\n handleRemove: (filterKey: string) => void;\n }>;\n};\n\nexport const FiltersSelected: React.FC<FiltersSelectedProps> = (props) => {\n const RenderComponent = props.render ?? ExampleFiltersSelected;\n\n return (\n <SelectedFilters\n render={({ selectedValues, setValue }) => {\n const selectedFilters = (\n Object.entries(selectedValues) as Array<[string, any]>\n )\n .filter(\n ([key, item]) =>\n item?.URLParams &&\n item?.showFilter &&\n (!!item?.value?.length || !!item?.value?.label)\n )\n .map(([key, item]) => ({\n key: key,\n label: item.label,\n value: item.value,\n }));\n\n const handleRemove = (selectedFilterKey: string) => {\n setValue(selectedFilterKey, null);\n };\n\n if (!selectedFilters.length) {\n return null;\n }\n\n return (\n <RenderComponent\n selectedFilters={selectedFilters}\n handleRemove={handleRemove}\n />\n );\n }}\n />\n );\n};\n"]}
|
|
@@ -26,6 +26,10 @@ export declare type ReactifySearchProviderProps = {
|
|
|
26
26
|
};
|
|
27
27
|
/** Advanced usage: Override the default ReactiveBase theme */
|
|
28
28
|
theme?: Record<string, unknown>;
|
|
29
|
+
/** Advanced usage: Fields to include in the Elasticsearch response e.g. ["title"] */
|
|
30
|
+
includeFields?: string[];
|
|
31
|
+
/** Advanced usage: Fields to exclude from the Elasticsearch response e.g. ["variant_skus", "*price*"] */
|
|
32
|
+
excludeFields?: string[];
|
|
29
33
|
} & ({
|
|
30
34
|
mode: "search";
|
|
31
35
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactifySearchProvider.js","sourceRoot":"","sources":["../../../../src/components/ReactifySearchProvider/ReactifySearchProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,sDAAwC;AAExC,uCAA+D;AAC/D,iDAAoE;AACpE,2CAAsC;
|
|
1
|
+
{"version":3,"file":"ReactifySearchProvider.js","sourceRoot":"","sources":["../../../../src/components/ReactifySearchProvider/ReactifySearchProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,sDAAwC;AAExC,uCAA+D;AAC/D,iDAAoE;AACpE,2CAAsC;AA+C/B,MAAM,sBAAsB,GAA0C,CAC3E,KAAK,EACL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AC;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 ReactifySearchProviderProps = {\n /** The search area the provider will be used in */\n mode: \"search\" | \"collection\" | \"instant-search\";\n /** Shopify store domain used to resolve the site configuration */\n shopifyPermanentDomain: string;\n /** Callback function for redirects, suitable for headless sites to avoid full page refresh */\n onRedirect?: (type: \"redirect\" | \"search\", url: string) => void;\n /** Render method to display a component when the config is loading */\n renderBooting?: () => JSX.Element | null;\n /** Advanced usage: Override the default Filters selection logic */\n filtersHandle?: string;\n /** Advanced usage: Allows you to wrap the ReactifySearchProvider in your own ReactiveBase component */\n noReactiveBase?: boolean;\n /** Advanced usage: Array of additional component IDs managed outside of Reactify Search */\n additionalComponentIds?: string[];\n /** Advanced usage: Override the default Elasticsearch index */\n index?: string;\n /** Advanced usage: Override the default Reactify Search config (for multi-instance stores) */\n configId?: string;\n /** Advanced usage: Override the default Elasticsearch credentials */\n credentials?: {\n username: string;\n password: string;\n endpoint: string;\n };\n /** Advanced usage: Override the default ReactiveBase theme */\n theme?: Record<string, unknown>;\n /** Advanced usage: Fields to include in the Elasticsearch response e.g. [\"title\"] */\n includeFields?: string[];\n /** Advanced usage: Fields to exclude from the Elasticsearch response e.g. [\"variant_skus\", \"*price*\"] */\n excludeFields?: string[];\n} & (\n | {\n mode: \"search\";\n }\n | {\n mode: \"collection\";\n /** Collection object that includes the handle, used to find curations */\n collectionHandle: string;\n }\n | {\n mode: \"instant-search\";\n }\n);\n\nexport const ReactifySearchProvider: React.FC<ReactifySearchProviderProps> = (\n props\n) => {\n React.useEffect(() => {\n debug.log(\"ReactifySearchProvider\", \"props\", props);\n\n Sentry.setTags({\n \"reactifysearch.index\": props.index,\n \"reactifysearch.shop\": props.shopifyPermanentDomain,\n \"reactifysearch.mode\": props.mode,\n \"reactifysearch.collection\":\n props.mode === \"collection\" ? props.collectionHandle : undefined,\n \"reactifysearch.filter\": props.filtersHandle,\n });\n }, [props]);\n\n return (\n <Sentry.ErrorBoundary fallback={<p>An error has occurred</p>}>\n <ReactifySearchInner {...props} />\n </Sentry.ErrorBoundary>\n );\n};\n\nconst ReactifySearchInner: React.FC<ReactifySearchProviderProps> = (props) => {\n const { config } = useConfig(props.shopifyPermanentDomain, props.configId);\n\n const [searchTerm, setSearchTerm] = React.useState<string>(\"\");\n const [showInstantSearchResults, setShowInstantSearchResults] =\n React.useState<boolean>(false);\n const [sortOption, setSortOption] = React.useState<string>(\"\");\n\n const credentials = props.credentials ?? {\n username: \"guest\",\n password: \"password\",\n endpoint: \"https://api.search.reactify.app\",\n };\n\n const theme = props.theme ?? {\n typography: {\n fontFamily: \"inherit\",\n fontSize: \"inherit\",\n },\n };\n\n const searchTermFromURL = React.useMemo(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n const urlParams = new URLSearchParams(window.location.search);\n return urlParams.get(\"q\") ?? undefined;\n }, [typeof window !== \"undefined\" && window.location.search]);\n\n const searchSortFromURL = React.useMemo(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n const urlParams = new URLSearchParams(window.location.search);\n return urlParams.get(\"sort\") ?? undefined;\n }, [typeof window !== \"undefined\" && window.location.search]);\n\n React.useEffect(() => {\n if (searchTermFromURL && searchTerm !== searchTermFromURL) {\n setSearchTerm(searchTermFromURL);\n }\n }, [searchTermFromURL]);\n\n React.useEffect(() => {\n if (searchSortFromURL && sortOption !== searchSortFromURL) {\n setSortOption(searchSortFromURL);\n }\n }, [searchSortFromURL]);\n\n React.useEffect(() => {\n if (typeof window == \"undefined\") {\n return;\n }\n\n if (window.location.search === \"\" && sortOption) {\n setSortOption(sortOption);\n }\n }, [typeof window !== \"undefined\" && window.location.search]);\n\n const contextValue = React.useMemo(() => {\n if (!config) {\n return;\n }\n\n return {\n config: config,\n options: {\n ...props,\n index: props.index ?? config.index,\n filtersHandle: props.filtersHandle,\n credentials: credentials,\n theme: theme,\n },\n search: {\n searchTerm: searchTerm,\n setSearchTerm: setSearchTerm,\n showInstantSearchResults: showInstantSearchResults,\n setShowInstantSearchResults: setShowInstantSearchResults,\n },\n sortby: {\n sortOption: sortOption,\n setSortOption: setSortOption,\n },\n };\n }, [config, props, searchTerm, showInstantSearchResults, sortOption]);\n\n debug.hook(\"ReactifySearchProvider\", \"context\", contextValue);\n\n if (!contextValue) {\n if (props.renderBooting) {\n return props.renderBooting();\n }\n return null;\n }\n\n if (props.noReactiveBase) {\n return (\n <ReactifySearchContext.Provider value={contextValue}>\n {props.children}\n </ReactifySearchContext.Provider>\n );\n }\n\n return (\n <ReactifySearchContext.Provider value={contextValue}>\n <UtilityAuthenticatedReactiveBase>\n {props.children}\n </UtilityAuthenticatedReactiveBase>\n </ReactifySearchContext.Provider>\n );\n};\n"]}
|
|
@@ -24,7 +24,7 @@ const SensorSearchTerm = () => {
|
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
26
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
27
|
-
react_1.default.createElement(DataSearch_1.default, { fuzziness: 1,
|
|
27
|
+
react_1.default.createElement(DataSearch_1.default, { fuzziness: 1, queryFormat: "and", autosuggest: false, value: searchTerm, componentId: "SensorSearchTerm", style: { display: "none" }, dataField: searchFields.map((field) => field.field), fieldWeights: searchFields.map((field) => field.importance), customQuery: (value, props) => {
|
|
28
28
|
const { dataField, fieldWeights } = props;
|
|
29
29
|
const fieldsCrossFields = dataField.map((field, index) => `${field}^${fieldWeights[index]}`);
|
|
30
30
|
const fieldsPhrase = dataField.map((field, index) => `${field}^${fieldWeights[index]}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SensorSearchTerm.js","sourceRoot":"","sources":["../../../../src/components/Sensor/SensorSearchTerm.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4GAAoF;AAEpF,uCAAkE;AAE3D,MAAM,gBAAgB,GAAa,GAAG,EAAE;IAC7C,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IACvD,MAAM,EAAE,UAAU,EAAE,GAAG,IAAA,iBAAS,GAAE,CAAC;IAEnC,mDAAmD;IACnD,MAAM,YAAY,GAAG,eAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACtC,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE;YAC7B,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CACpC,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAC5D,CAAC;SACH;QAED,IAAI,OAAO,CAAC,IAAI,KAAK,gBAAgB,EAAE;YACrC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CACpC,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAC/D,CAAC;SACH;QAED,OAAO,EAAE,CAAC;IACZ,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAEpB,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;QAC7B,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL;QACE,8BAAC,oBAAU,IACT,SAAS,EAAE,CAAC,EACZ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AM,GAAG,CAAC;gCAC9B,CAAC,CAAC;oCACE;wCACE,WAAW,EAAE;4CACX,KAAK,EAAE,KAAK;4CACZ,MAAM,EAAE,iBAAiB;4CACzB,IAAI,EAAE,cAAc;4CACpB,QAAQ,EAAE,KAAK;yCAChB;qCACF;iCACF;gCACH,CAAC,CAAC,EAAE,CAAC;4BACP,GAAG,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;gCACzB,CAAC,CAAC;oCACE;wCACE,WAAW,EAAE;4CACX,KAAK,EAAE,KAAK;4CACZ,MAAM,EAAE,YAAY;4CACpB,IAAI,EAAE,QAAQ;4CACd,QAAQ,EAAE,KAAK;yCAChB;qCACF;iCACF;gCACH,CAAC,CAAC,EAAE,CAAC;4BACP,GAAG,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC;gCAC/B,CAAC,CAAC;oCACE;wCACE,WAAW,EAAE;4CACX,KAAK,EAAE,KAAK;4CACZ,MAAM,EAAE,kBAAkB;4CAC1B,IAAI,EAAE,eAAe;4CACrB,QAAQ,EAAE,KAAK;yCAChB;qCACF;iCACF;gCACH,CAAC,CAAC,EAAE,CAAC;yBACR;wBACD,oBAAoB,EAAE,GAAG;qBAC1B;iBACF,CAAC;gBACF,OAAO,EAAE,KAAK,EAAE,CAAC;YACnB,CAAC,GACD,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAnHW,QAAA,gBAAgB,oBAmH3B","sourcesContent":["import React from \"react\";\nimport DataSearch from \"@appbaseio/reactivesearch/lib/components/search/DataSearch\";\n\nimport { useReactifySearchContext, useSearch } from \"../../hooks\";\n\nexport const SensorSearchTerm: React.FC = () => {\n const { options, config } = useReactifySearchContext();\n const { searchTerm } = useSearch();\n\n // ignore search fields only set for instant search\n const searchFields = React.useMemo(() => {\n if (options.mode === \"search\") {\n return config.fields.filter((field) =>\n [\"always_search\", \"search_page\"].includes(field.searchType)\n );\n }\n\n if (options.mode === \"instant-search\") {\n return config.fields.filter((field) =>\n [\"always_search\", \"instant_search\"].includes(field.searchType)\n );\n }\n\n return [];\n }, [config.fields]);\n\n if (searchFields.length === 0) {\n return null;\n }\n\n return (\n <>\n <DataSearch\n fuzziness={1}\n queryFormat=\"and\"\n autosuggest={false}\n value={searchTerm}\n componentId=\"SensorSearchTerm\"\n style={{ display: \"none\" }}\n dataField={searchFields.map((field) => field.field)}\n fieldWeights={searchFields.map((field) => field.importance)}\n customQuery={(value, props) => {\n const { dataField, fieldWeights } = props;\n\n const fieldsCrossFields = dataField.map(\n (field: string, index: number) => `${field}^${fieldWeights[index]}`\n );\n const fieldsPhrase = dataField.map(\n (field: string, index: number) => `${field}^${fieldWeights[index]}`\n );\n const fieldsPhrasePrefix = dataField\n .filter((field: string) => !field.includes(\".\"))\n .map(\n (field: string, index: number) =>\n `${field}^${fieldWeights[index]}`\n );\n\n const query = {\n bool: {\n should: [\n ...(options.mode === \"search\" && value\n ? [\n {\n nested: {\n path: \"curations\",\n query: {\n term: {\n \"curations.searchTerm.keyword\":\n value.toLowerCase(),\n },\n },\n },\n },\n ]\n : []),\n ...(fieldsCrossFields.length > 0\n ? [\n {\n multi_match: {\n query: value,\n fields: fieldsCrossFields,\n type: \"cross_fields\",\n operator: \"and\",\n },\n },\n ]\n : []),\n ...(fieldsPhrase.length > 0\n ? [\n {\n multi_match: {\n query: value,\n fields: fieldsPhrase,\n type: \"phrase\",\n operator: \"and\",\n },\n },\n ]\n : []),\n ...(fieldsPhrasePrefix.length > 0\n ? [\n {\n multi_match: {\n query: value,\n fields: fieldsPhrasePrefix,\n type: \"phrase_prefix\",\n operator: \"and\",\n },\n },\n ]\n : []),\n ],\n minimum_should_match: \"1\",\n },\n };\n return { query };\n }}\n />\n </>\n );\n};\n"]}
|
|
@@ -10,6 +10,8 @@ const useReactiveReactProp_1 = require("./useReactiveReactProp");
|
|
|
10
10
|
const useReactiveReactiveListProps = (options) => {
|
|
11
11
|
const { filterStack } = (0, hooks_1.useFilters)();
|
|
12
12
|
const reactiveReactProp = (0, useReactiveReactProp_1.useReactiveReactProp)();
|
|
13
|
+
const context = (0, hooks_1.useReactifySearchContext)();
|
|
14
|
+
const { includeFields, excludeFields } = context.options;
|
|
13
15
|
const size = react_1.default.useMemo(() => {
|
|
14
16
|
var _a, _b;
|
|
15
17
|
return (_b = (_a = options.pageSize) !== null && _a !== void 0 ? _a : filterStack === null || filterStack === void 0 ? void 0 : filterStack.pageSize) !== null && _b !== void 0 ? _b : 20;
|
|
@@ -21,6 +23,8 @@ const useReactiveReactiveListProps = (options) => {
|
|
|
21
23
|
dataField: "title",
|
|
22
24
|
showResultStats: false,
|
|
23
25
|
react: reactiveReactProp,
|
|
26
|
+
includeFields,
|
|
27
|
+
excludeFields,
|
|
24
28
|
componentId: "page",
|
|
25
29
|
scrollOnChange: false,
|
|
26
30
|
pagination: (filterStack === null || filterStack === void 0 ? void 0 : filterStack.paginationType) !== "infinite_scroll",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReactiveReactiveListProps.js","sourceRoot":"","sources":["../../../../src/hooks/reactivesearch/useReactiveReactiveListProps.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,
|
|
1
|
+
{"version":3,"file":"useReactiveReactiveListProps.js","sourceRoot":"","sources":["../../../../src/hooks/reactivesearch/useReactiveReactiveListProps.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,uCAAmE;AACnE,iEAA8D;AAEvD,MAAM,4BAA4B,GAAG,CAAC,OAE5C,EAA6C,EAAE;IAC9C,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,kBAAU,GAAE,CAAC;IACrC,MAAM,iBAAiB,GAAG,IAAA,2CAAoB,GAAE,CAAC;IACjD,MAAM,OAAO,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAC3C,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAEzD,MAAM,IAAI,GAAG,eAAK,CAAC,OAAO,CAAC,GAAG,EAAE;;QAC9B,OAAO,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,QAAQ,mCAAI,EAAE,CAAC;IACzD,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;IAEpC,MAAM,yBAAyB,GAAG,eAAK,CAAC,OAAO,CAC7C,GAAG,EAAE,CAAC,CAAC;QACL,IAAI;QACJ,SAAS,EAAE,IAAI;QACf,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,OAAO;QAClB,eAAe,EAAE,KAAK;QACtB,KAAK,EAAE,iBAAiB;QACxB,aAAa;QACb,aAAa;QACb,WAAW,EAAE,MAAM;QACnB,cAAc,EAAE,KAAK;QACrB,UAAU,EAAE,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,MAAK,iBAAiB;QAC7D,cAAc,EAAE,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,MAAK,iBAAiB;QACjE,eAAe,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,mDAAmD;KACjF,CAAC,EACF,CAAC,WAAW,EAAE,iBAAiB,EAAE,OAAO,CAAC,QAAQ,CAAC,CACnD,CAAC;IAEF,OAAO,yBAAyB,CAAC;AACnC,CAAC,CAAC;AAhCW,QAAA,4BAA4B,gCAgCvC","sourcesContent":["import React from \"react\";\nimport ReactiveList from \"@appbaseio/reactivesearch/lib/components/result/ReactiveList\";\n\nimport { useFilters, useReactifySearchContext } from \"../../hooks\";\nimport { useReactiveReactProp } from \"./useReactiveReactProp\";\n\nexport const useReactiveReactiveListProps = (options: {\n pageSize?: number;\n}): React.ComponentProps<typeof ReactiveList> => {\n const { filterStack } = useFilters();\n const reactiveReactProp = useReactiveReactProp();\n const context = useReactifySearchContext();\n const { includeFields, excludeFields } = context.options;\n\n const size = React.useMemo(() => {\n return options.pageSize ?? filterStack?.pageSize ?? 20;\n }, [options.pageSize, filterStack]);\n\n const reactiveReactiveListProps = React.useMemo(\n () => ({\n size,\n URLParams: true,\n showLoader: false,\n dataField: \"title\",\n showResultStats: false,\n react: reactiveReactProp,\n includeFields,\n excludeFields,\n componentId: \"page\", // this sets ?page= in the URL\n scrollOnChange: false, // @todo make this better, it's really janky when enabled\n pagination: filterStack?.paginationType !== \"infinite_scroll\",\n infiniteScroll: filterStack?.paginationType === \"infinite_scroll\",\n renderNoResults: () => null, // always use only render, otherwise both are shown\n }),\n [filterStack, reactiveReactProp, options.pageSize]\n );\n\n return reactiveReactiveListProps;\n};\n"]}
|
|
@@ -15,6 +15,8 @@ export declare const ReactifySearchContext: React.Context<{
|
|
|
15
15
|
onRedirect?: ((type: "redirect" | "search", url: string) => void) | undefined;
|
|
16
16
|
theme: Record<string, unknown>;
|
|
17
17
|
additionalComponentIds?: string[] | undefined;
|
|
18
|
+
includeFields?: string[] | undefined;
|
|
19
|
+
excludeFields?: string[] | undefined;
|
|
18
20
|
} & ({
|
|
19
21
|
mode: "search";
|
|
20
22
|
} | {
|
|
@@ -49,6 +51,8 @@ export declare const useReactifySearchContext: () => {
|
|
|
49
51
|
onRedirect?: ((type: "redirect" | "search", url: string) => void) | undefined;
|
|
50
52
|
theme: Record<string, unknown>;
|
|
51
53
|
additionalComponentIds?: string[] | undefined;
|
|
54
|
+
includeFields?: string[] | undefined;
|
|
55
|
+
excludeFields?: string[] | undefined;
|
|
52
56
|
} & ({
|
|
53
57
|
mode: "search";
|
|
54
58
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReactifySearchContext.js","sourceRoot":"","sources":["../../../src/hooks/useReactifySearchContext.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAIb,QAAA,qBAAqB,GAAG,eAAK,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"useReactifySearchContext.js","sourceRoot":"","sources":["../../../src/hooks/useReactifySearchContext.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAIb,QAAA,qBAAqB,GAAG,eAAK,CAAC,aAAa,CA4CtD,SAAS,CAAC,CAAC;AAEN,MAAM,wBAAwB,GAAG,GAAG,EAAE,CAC3C,eAAK,CAAC,UAAU,CAAC,6BAAqB,CAAE,CAAC;AAD9B,QAAA,wBAAwB,4BACM","sourcesContent":["import React from \"react\";\n\nimport { Config } from \"../types\";\n\nexport const ReactifySearchContext = React.createContext<\n | {\n config: Config;\n options: {\n mode: \"search\" | \"collection\" | \"instant-search\";\n index: string;\n shopifyPermanentDomain: string;\n filtersHandle?: string;\n credentials: {\n username: string;\n password: string;\n endpoint: string;\n };\n onRedirect?: (type: \"redirect\" | \"search\", url: string) => void;\n theme: Record<string, unknown>;\n additionalComponentIds?: Array<string>;\n includeFields?: Array<string>;\n excludeFields?: Array<string>;\n } & (\n | {\n mode: \"search\";\n }\n | {\n mode: \"collection\";\n collectionHandle: string;\n }\n | {\n mode: \"instant-search\";\n }\n );\n search: {\n searchTerm: string;\n setSearchTerm: React.Dispatch<React.SetStateAction<string>>;\n showInstantSearchResults: boolean;\n setShowInstantSearchResults: React.Dispatch<\n React.SetStateAction<boolean>\n >;\n };\n sortby: {\n sortOption: string;\n setSortOption: React.Dispatch<React.SetStateAction<string>>;\n };\n }\n | undefined\n>(undefined);\n\nexport const useReactifySearchContext = () =>\n React.useContext(ReactifySearchContext)!;\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usereactify/search",
|
|
3
3
|
"description": "React UI library for Reactify Search",
|
|
4
|
-
"version": "5.2.
|
|
4
|
+
"version": "5.2.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"types": "dist/src/index.d.ts",
|
|
@@ -48,13 +48,16 @@
|
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@appbaseio/reactivesearch": "^3.14.0",
|
|
51
|
+
"@babel/plugin-transform-typescript": "7.18.12",
|
|
51
52
|
"@commitlint/cli": "13.2.0",
|
|
52
53
|
"@commitlint/config-conventional": "13.2.0",
|
|
53
54
|
"@sentry/cli": "2.5.0",
|
|
54
|
-
"@storybook/addon-actions": "6.
|
|
55
|
-
"@storybook/addon-
|
|
56
|
-
"@storybook/addon-
|
|
57
|
-
"@storybook/
|
|
55
|
+
"@storybook/addon-actions": "6.5.10",
|
|
56
|
+
"@storybook/addon-docs": "6.5.10",
|
|
57
|
+
"@storybook/addon-essentials": "6.5.10",
|
|
58
|
+
"@storybook/addon-links": "6.5.10",
|
|
59
|
+
"@storybook/components": "6.5.10",
|
|
60
|
+
"@storybook/react": "6.5.10",
|
|
58
61
|
"@types/debug": "4.1.7",
|
|
59
62
|
"@types/react": "17.0.27",
|
|
60
63
|
"babel-loader": "8.2.2",
|