@usereactify/search 5.26.0 → 5.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/package.json +11 -10
- package/dist/src/components/ClearAll/ClearAll.js +3 -31
- package/dist/src/components/ClearAll/ClearAll.js.map +1 -1
- package/dist/src/components/Example/ExampleFilterRange.js +1 -3
- package/dist/src/components/Example/ExampleFilterRange.js.map +1 -1
- package/dist/src/components/Example/ExampleFilterSlider.js +7 -24
- package/dist/src/components/Example/ExampleFilterSlider.js.map +1 -1
- package/dist/src/components/Example/ExampleFilters.d.ts +3 -1
- package/dist/src/components/Example/ExampleFilters.js +4 -8
- package/dist/src/components/Example/ExampleFilters.js.map +1 -1
- package/dist/src/components/Example/ExampleFiltersSelected.js +10 -24
- package/dist/src/components/Example/ExampleFiltersSelected.js.map +1 -1
- package/dist/src/components/Example/index.d.ts +0 -3
- package/dist/src/components/Example/index.js +0 -3
- package/dist/src/components/Example/index.js.map +1 -1
- package/dist/src/components/Filter/Filter.d.ts +2 -2
- package/dist/src/components/Filter/Filter.js +18 -91
- package/dist/src/components/Filter/Filter.js.map +1 -1
- package/dist/src/components/Filter/Filters.d.ts +3 -17
- package/dist/src/components/Filter/Filters.js +2 -1
- package/dist/src/components/Filter/Filters.js.map +1 -1
- package/dist/src/components/Filter/FiltersSelected.d.ts +2 -7
- package/dist/src/components/Filter/FiltersSelected.js +2 -45
- package/dist/src/components/Filter/FiltersSelected.js.map +1 -1
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.d.ts +7 -5
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js +24 -42
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js.map +1 -1
- package/dist/src/components/Result/Results.js +9 -24
- package/dist/src/components/Result/Results.js.map +1 -1
- package/dist/src/components/Sensor/SensorCollection.js +0 -4
- package/dist/src/components/Sensor/SensorCollection.js.map +1 -1
- package/dist/src/components/Sensor/SensorInventoryAvailable.js +1 -6
- package/dist/src/components/Sensor/SensorInventoryAvailable.js.map +1 -1
- package/dist/src/components/Sensor/SensorPublished.js +6 -13
- package/dist/src/components/Sensor/SensorPublished.js.map +1 -1
- package/dist/src/components/Sensor/SensorSearchTerm.js +66 -92
- package/dist/src/components/Sensor/SensorSearchTerm.js.map +1 -1
- package/dist/src/components/Sensor/SensorSort.js +65 -75
- package/dist/src/components/Sensor/SensorSort.js.map +1 -1
- package/dist/src/components/Sensor/SensorSortScore.d.ts +2 -0
- package/dist/src/components/Sensor/SensorSortScore.js +13 -0
- package/dist/src/components/Sensor/SensorSortScore.js.map +1 -0
- package/dist/src/components/Sensor/index.d.ts +1 -0
- package/dist/src/components/Sensor/index.js +2 -0
- package/dist/src/components/Sensor/index.js.map +1 -1
- package/dist/src/components/index.d.ts +0 -1
- package/dist/src/components/index.js +0 -1
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/hooks/index.d.ts +0 -3
- package/dist/src/hooks/index.js +0 -3
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.d.ts +7 -2
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js +3 -10
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.d.ts +27 -0
- package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js +71 -0
- package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.d.ts +0 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.js +5 -3
- package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.d.ts +0 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.js +5 -3
- package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.js +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.js +3 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveReactProp.d.ts +1 -2
- package/dist/src/hooks/reactivesearch/useReactiveReactProp.js +3 -8
- package/dist/src/hooks/reactivesearch/useReactiveReactProp.js.map +1 -1
- package/dist/src/hooks/useAnalytics.js +3 -23
- package/dist/src/hooks/useAnalytics.js.map +1 -1
- package/dist/src/hooks/useConfig.js +27 -9
- package/dist/src/hooks/useConfig.js.map +1 -1
- package/dist/src/hooks/useCuration.js +1 -12
- package/dist/src/hooks/useCuration.js.map +1 -1
- package/dist/src/hooks/useFilterListProps.js +2 -15
- package/dist/src/hooks/useFilterListProps.js.map +1 -1
- package/dist/src/hooks/useFilterRangeProps.d.ts +10 -1
- package/dist/src/hooks/useFilterRangeProps.js +47 -36
- package/dist/src/hooks/useFilterRangeProps.js.map +1 -1
- package/dist/src/hooks/useFilterSliderProps.d.ts +8 -6
- package/dist/src/hooks/useFilterSliderProps.js +10 -31
- package/dist/src/hooks/useFilterSliderProps.js.map +1 -1
- package/dist/src/hooks/usePaginationLoadMore.d.ts +15 -0
- package/dist/src/hooks/usePaginationLoadMore.js +38 -0
- package/dist/src/hooks/usePaginationLoadMore.js.map +1 -0
- package/dist/src/hooks/useReactifySearchContext.d.ts +11 -19
- package/dist/src/hooks/useReactifySearchContext.js.map +1 -1
- package/dist/src/hooks/useSearch.js +2 -4
- package/dist/src/hooks/useSearch.js.map +1 -1
- package/dist/src/types/config.d.ts +5 -11
- package/dist/src/types/config.js.map +1 -1
- package/dist/src/types/elastic.d.ts +17 -53
- package/dist/src/types/elastic.js.map +1 -1
- package/dist/src/types/firestore.d.ts +0 -3
- package/dist/src/types/firestore.js.map +1 -1
- package/dist/src/types/reactivesearch.d.ts +1 -1
- package/dist/src/types/reactivesearch.js.map +1 -1
- package/package.json +1 -1
- package/dist/src/components/Example/ExampleHookUseResults.d.ts +0 -2
- package/dist/src/components/Example/ExampleHookUseResults.js +0 -25
- package/dist/src/components/Example/ExampleHookUseResults.js.map +0 -1
- package/dist/src/components/Example/ExampleSuggestions.d.ts +0 -4
- package/dist/src/components/Example/ExampleSuggestions.js +0 -16
- package/dist/src/components/Example/ExampleSuggestions.js.map +0 -1
- package/dist/src/components/Suggestions/Suggestions.d.ts +0 -12
- package/dist/src/components/Suggestions/Suggestions.js +0 -44
- package/dist/src/components/Suggestions/Suggestions.js.map +0 -1
- package/dist/src/components/Suggestions/index.d.ts +0 -1
- package/dist/src/components/Suggestions/index.js +0 -14
- package/dist/src/components/Suggestions/index.js.map +0 -1
- package/dist/src/hooks/react-slider/useReactSliderProps.d.ts +0 -4
- package/dist/src/hooks/react-slider/useReactSliderProps.js +0 -28
- package/dist/src/hooks/react-slider/useReactSliderProps.js.map +0 -1
- package/dist/src/hooks/useFlags.d.ts +0 -21
- package/dist/src/hooks/useFlags.js +0 -49
- package/dist/src/hooks/useFlags.js.map +0 -1
- package/dist/src/hooks/useIndices.d.ts +0 -5
- package/dist/src/hooks/useIndices.js +0 -49
- package/dist/src/hooks/useIndices.js.map +0 -1
- package/dist/src/hooks/useResults.d.ts +0 -21
- package/dist/src/hooks/useResults.js +0 -19
- package/dist/src/hooks/useResults.js.map +0 -1
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Config
|
|
2
|
+
import { Config } from "../types";
|
|
3
3
|
export declare type ReactifySearchMode = "search" | "collection" | "instant-search";
|
|
4
4
|
export declare const ReactifySearchContext: React.Context<{
|
|
5
5
|
config: Config;
|
|
6
6
|
options: {
|
|
7
|
-
clientId: string;
|
|
8
7
|
mode: ReactifySearchMode;
|
|
9
8
|
index: string;
|
|
10
9
|
shopifyPermanentDomain: string;
|
|
11
10
|
filtersHandle?: string | undefined;
|
|
12
|
-
credentials
|
|
13
|
-
|
|
11
|
+
credentials: {
|
|
12
|
+
username: string;
|
|
13
|
+
password: string;
|
|
14
|
+
endpoint: string;
|
|
15
|
+
};
|
|
14
16
|
onRedirect?: ((type: "redirect" | "search", url: string) => void) | undefined;
|
|
15
17
|
theme: Record<string, unknown>;
|
|
16
18
|
additionalComponentIds?: string[] | undefined;
|
|
@@ -34,23 +36,19 @@ export declare const ReactifySearchContext: React.Context<{
|
|
|
34
36
|
sortOption: string;
|
|
35
37
|
setSortOption: React.Dispatch<React.SetStateAction<string>>;
|
|
36
38
|
};
|
|
37
|
-
results: {
|
|
38
|
-
results: ReactivesearchResultProps["data"];
|
|
39
|
-
setResults: React.Dispatch<React.SetStateAction<ReactivesearchResultProps["data"]>>;
|
|
40
|
-
resultStats?: ReactivesearchResultProps["resultStats"];
|
|
41
|
-
setResultStats: React.Dispatch<React.SetStateAction<ReactivesearchResultProps["resultStats"] | undefined>>;
|
|
42
|
-
};
|
|
43
39
|
} | undefined>;
|
|
44
40
|
export declare const useReactifySearchContext: () => {
|
|
45
41
|
config: Config;
|
|
46
42
|
options: {
|
|
47
|
-
clientId: string;
|
|
48
43
|
mode: ReactifySearchMode;
|
|
49
44
|
index: string;
|
|
50
45
|
shopifyPermanentDomain: string;
|
|
51
46
|
filtersHandle?: string | undefined;
|
|
52
|
-
credentials
|
|
53
|
-
|
|
47
|
+
credentials: {
|
|
48
|
+
username: string;
|
|
49
|
+
password: string;
|
|
50
|
+
endpoint: string;
|
|
51
|
+
};
|
|
54
52
|
onRedirect?: ((type: "redirect" | "search", url: string) => void) | undefined;
|
|
55
53
|
theme: Record<string, unknown>;
|
|
56
54
|
additionalComponentIds?: string[] | undefined;
|
|
@@ -74,10 +72,4 @@ export declare const useReactifySearchContext: () => {
|
|
|
74
72
|
sortOption: string;
|
|
75
73
|
setSortOption: React.Dispatch<React.SetStateAction<string>>;
|
|
76
74
|
};
|
|
77
|
-
results: {
|
|
78
|
-
results: ReactivesearchResultProps["data"];
|
|
79
|
-
setResults: React.Dispatch<React.SetStateAction<ReactivesearchResultProps["data"]>>;
|
|
80
|
-
resultStats?: ReactivesearchResultProps["resultStats"];
|
|
81
|
-
setResultStats: React.Dispatch<React.SetStateAction<ReactivesearchResultProps["resultStats"] | undefined>>;
|
|
82
|
-
};
|
|
83
75
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReactifySearchContext.js","sourceRoot":"","sources":["../../../src/hooks/useReactifySearchContext.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAMb,QAAA,qBAAqB,GAAG,eAAK,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"useReactifySearchContext.js","sourceRoot":"","sources":["../../../src/hooks/useReactifySearchContext.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAMb,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 type ReactifySearchMode = \"search\" | \"collection\" | \"instant-search\";\n\nexport const ReactifySearchContext = React.createContext<\n | {\n config: Config;\n options: {\n mode: ReactifySearchMode;\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"]}
|
|
@@ -28,15 +28,13 @@ const useSearch = () => {
|
|
|
28
28
|
}
|
|
29
29
|
search.setShowInstantSearchResults(false);
|
|
30
30
|
if (options.onRedirect) {
|
|
31
|
-
options.onRedirect(redirect ? "redirect" : "search", redirect
|
|
32
|
-
? redirect.url
|
|
33
|
-
: `/search?q=${encodeURIComponent(searchTerm)}`);
|
|
31
|
+
options.onRedirect(redirect ? "redirect" : "search", redirect ? redirect.url : `/search?q=${searchTerm}`);
|
|
34
32
|
}
|
|
35
33
|
else if (redirect) {
|
|
36
34
|
window.location.href = redirect.url;
|
|
37
35
|
}
|
|
38
36
|
else {
|
|
39
|
-
window.location.href = `/search?q=${
|
|
37
|
+
window.location.href = `/search?q=${searchTerm}`;
|
|
40
38
|
}
|
|
41
39
|
}, [search.searchTerm]);
|
|
42
40
|
const handleSetSearchTerm = react_1.default.useCallback((searchTerm = "") => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearch.js","sourceRoot":"","sources":["../../../src/hooks/useSearch.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,oCAAoD;AACpD,wCAAmC;AAE5B,MAAM,SAAS,GAAG,GAWvB,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAE/D,MAAM,sBAAsB,GAAG,eAAK,CAAC,WAAW,CAC9C,CAAC,aAAqB,MAAM,CAAC,UAAU,EAAE,EAAE;QACzC,eAAK,CAAC,UAAU,CAAC;YACf,QAAQ,EAAE,QAAQ;YAClB,OAAO,EAAE,eAAe;YACxB,IAAI,EAAE;gBACJ,UAAU,EAAE,UAAU;aACvB;SACF,CAAC,CAAC;QAEH,eAAK,CAAC,GAAG,CAAC,WAAW,EAAE,yBAAyB,EAAE,UAAU,CAAC,CAAC;QAE9D,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;SACR;QAED,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CACpC,CAAC,QAAQ,EAAE,EAAE,CACX,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,UAAU,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAClC,CAAC;QAEF,IAAI,QAAQ,EAAE;YACZ,eAAK,CAAC,GAAG,CAAC,WAAW,EAAE,4BAA4B,EAAE,QAAQ,CAAC,CAAC;SAChE;QAED,MAAM,CAAC,2BAA2B,CAAC,KAAK,CAAC,CAAC;QAE1C,IAAI,OAAO,CAAC,UAAU,EAAE;YACtB,OAAO,CAAC,UAAU,CAChB,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,EAChC,QAAQ
|
|
1
|
+
{"version":3,"file":"useSearch.js","sourceRoot":"","sources":["../../../src/hooks/useSearch.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,oCAAoD;AACpD,wCAAmC;AAE5B,MAAM,SAAS,GAAG,GAWvB,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAE/D,MAAM,sBAAsB,GAAG,eAAK,CAAC,WAAW,CAC9C,CAAC,aAAqB,MAAM,CAAC,UAAU,EAAE,EAAE;QACzC,eAAK,CAAC,UAAU,CAAC;YACf,QAAQ,EAAE,QAAQ;YAClB,OAAO,EAAE,eAAe;YACxB,IAAI,EAAE;gBACJ,UAAU,EAAE,UAAU;aACvB;SACF,CAAC,CAAC;QAEH,eAAK,CAAC,GAAG,CAAC,WAAW,EAAE,yBAAyB,EAAE,UAAU,CAAC,CAAC;QAE9D,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;SACR;QAED,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CACpC,CAAC,QAAQ,EAAE,EAAE,CACX,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,UAAU,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAClC,CAAC;QAEF,IAAI,QAAQ,EAAE;YACZ,eAAK,CAAC,GAAG,CAAC,WAAW,EAAE,4BAA4B,EAAE,QAAQ,CAAC,CAAC;SAChE;QAED,MAAM,CAAC,2BAA2B,CAAC,KAAK,CAAC,CAAC;QAE1C,IAAI,OAAO,CAAC,UAAU,EAAE;YACtB,OAAO,CAAC,UAAU,CAChB,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,EAChC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,UAAU,EAAE,CACpD,CAAC;SACH;aAAM,IAAI,QAAQ,EAAE;YACnB,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC;SACrC;aAAM;YACL,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,aAAa,UAAU,EAAE,CAAC;SAClD;IACH,CAAC,EACD,CAAC,MAAM,CAAC,UAAU,CAAC,CACpB,CAAC;IAEF,MAAM,mBAAmB,GAAG,eAAK,CAAC,WAAW,CAC3C,CAAC,aAAqB,EAAE,EAAE,EAAE;QAC1B,eAAK,CAAC,GAAG,CAAC,WAAW,EAAE,2BAA2B,EAAE,UAAU,CAAC,CAAC;QAChE,eAAK,CAAC,UAAU,CAAC;YACf,QAAQ,EAAE,QAAQ;YAClB,OAAO,EAAE,cAAc;YACvB,IAAI,EAAE;gBACJ,UAAU,EAAE,UAAU;aACvB;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACnC,CAAC,EACD,CAAC,MAAM,CAAC,UAAU,CAAC,CACpB,CAAC;IAEF,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,aAAa,EAAE,mBAAmB;QAClC,gBAAgB,EAAE,sBAAsB;QACxC,wBAAwB,EACtB,CAAC,CAAC,MAAM,CAAC,wBAAwB,IAAI,CAAC,CAAC,MAAM,CAAC,UAAU;QAC1D,2BAA2B,EAAE,MAAM,CAAC,2BAA2B;KAChE,CAAC;AACJ,CAAC,CAAC;AAhFW,QAAA,SAAS,aAgFpB","sourcesContent":["import React from \"react\";\n\nimport { useReactifySearchContext } from \"../hooks\";\nimport { debug } from \"../utility\";\n\nexport const useSearch = (): {\n /** The current search term */\n searchTerm: string;\n /** Function for changing the current search term */\n setSearchTerm: (searchTerm?: string) => void;\n /** Function for navigating to the search page, includes logic for redirects */\n submitSearchTerm: (searchTerm?: string) => void;\n /** Used to determine if instant search results should be displayed */\n showInstantSearchResults: boolean;\n /** Used to manually set the \"showInstantSearchResults\" value */\n setShowInstantSearchResults: React.Dispatch<React.SetStateAction<boolean>>;\n} => {\n const { options, config, search } = useReactifySearchContext();\n\n const handleSubmitSearchTerm = React.useCallback(\n (searchTerm: string = search.searchTerm) => {\n debug.breadcrumb({\n category: \"search\",\n message: \"search submit\",\n data: {\n searchTerm: searchTerm,\n },\n });\n\n debug.log(\"useSearch\", \"submitSearchTerm[query]\", searchTerm);\n\n if (!searchTerm) {\n return;\n }\n\n const redirect = config.redirects.find(\n (redirect) =>\n redirect.query.trim().toLowerCase() ===\n searchTerm.trim().toLowerCase()\n );\n\n if (redirect) {\n debug.log(\"useSearch\", \"submitSearchTerm[redirect]\", redirect);\n }\n\n search.setShowInstantSearchResults(false);\n\n if (options.onRedirect) {\n options.onRedirect(\n redirect ? \"redirect\" : \"search\",\n redirect ? redirect.url : `/search?q=${searchTerm}`\n );\n } else if (redirect) {\n window.location.href = redirect.url;\n } else {\n window.location.href = `/search?q=${searchTerm}`;\n }\n },\n [search.searchTerm]\n );\n\n const handleSetSearchTerm = React.useCallback(\n (searchTerm: string = \"\") => {\n debug.log(\"useSearch\", \"setSearchTerm[searchTerm]\", searchTerm);\n debug.breadcrumb({\n category: \"search\",\n message: \"search query\",\n data: {\n searchTerm: searchTerm,\n },\n });\n\n search.setSearchTerm(searchTerm);\n },\n [search.searchTerm]\n );\n\n return {\n searchTerm: search.searchTerm,\n setSearchTerm: handleSetSearchTerm,\n submitSearchTerm: handleSubmitSearchTerm,\n showInstantSearchResults:\n !!search.showInstantSearchResults && !!search.searchTerm,\n setShowInstantSearchResults: search.setShowInstantSearchResults,\n };\n};\n"]}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { Sort, Filter, FilterOption, Redirect, Field, Curation } from "./firestore";
|
|
2
2
|
export interface Config {
|
|
3
3
|
index: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
sort: Array<ConfigSort>;
|
|
11
|
-
fields: Array<ConfigField>;
|
|
12
|
-
filters: Array<ConfigFilter>;
|
|
13
|
-
redirects: Array<ConfigRedirect>;
|
|
14
|
-
curations: Array<ConfigCuration>;
|
|
4
|
+
sort: ConfigSort[];
|
|
5
|
+
fields: ConfigField[];
|
|
6
|
+
filters: ConfigFilter[];
|
|
7
|
+
redirects: ConfigRedirect[];
|
|
8
|
+
curations: ConfigCuration[];
|
|
15
9
|
}
|
|
16
10
|
export declare type ConfigSort = Omit<Sort, "enabled">;
|
|
17
11
|
export declare type ConfigField = Omit<Field, "enabled">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":"","sourcesContent":["import {\n Sort,\n Filter,\n FilterOption,\n Redirect,\n Field,\n Curation,\n} from \"./firestore\";\n\n// when exposed as config, most resources have the `enabled` and `keywords` attributes removed\n// curation boosting groupings and sortings both have a json encoded elastic query added to them\nexport interface Config {\n index: string;\n
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":"","sourcesContent":["import {\n Sort,\n Filter,\n FilterOption,\n Redirect,\n Field,\n Curation,\n} from \"./firestore\";\n\n// when exposed as config, most resources have the `enabled` and `keywords` attributes removed\n// curation boosting groupings and sortings both have a json encoded elastic query added to them\nexport interface Config {\n index: string;\n sort: ConfigSort[];\n fields: ConfigField[];\n filters: ConfigFilter[];\n redirects: ConfigRedirect[];\n curations: ConfigCuration[];\n}\n\nexport type ConfigSort = Omit<Sort, \"enabled\">;\nexport type ConfigField = Omit<Field, \"enabled\">;\nexport type ConfigRedirect = Omit<Redirect, \"enabled\" | \"keywords\">;\nexport type ConfigFilter = Omit<Filter, \"enabled\" | \"keywords\"> & {\n options: Omit<FilterOption, \"enabled\">[];\n};\nexport type ConfigFilterOption = Omit<FilterOption, \"enabled\">;\nexport type ConfigCuration = Omit<\n Curation,\n \"keywords\" | \"boosting\" | \"longRunningTask\" | \"callouts\"\n> & {\n boosting: {\n groupings: (NonNullable<\n NonNullable<Curation[\"boosting\"]>[\"groupings\"]\n >[0] & { query: string })[];\n sortings: (NonNullable<NonNullable<Curation[\"boosting\"]>[\"sortings\"]>[0] & {\n query: string;\n })[];\n };\n};\n"]}
|
|
@@ -27,16 +27,16 @@ export interface ElasticProduct {
|
|
|
27
27
|
product_type: string;
|
|
28
28
|
handle: string;
|
|
29
29
|
url: string;
|
|
30
|
-
tags:
|
|
31
|
-
collection_titles:
|
|
30
|
+
tags: string[];
|
|
31
|
+
collection_titles: string[];
|
|
32
32
|
/** tag prefixes defined in tagKeys are split to their own attributes */
|
|
33
|
-
[key: `tags_${string}`]:
|
|
33
|
+
[key: `tags_${string}`]: string[] | undefined;
|
|
34
34
|
/** decimal number e.g. 99.95 */
|
|
35
35
|
price_min: number;
|
|
36
36
|
/** decimal number e.g. 99.95 */
|
|
37
37
|
price_max: number;
|
|
38
38
|
/** array of option names e.g. ["Colour", "Size"] */
|
|
39
|
-
options:
|
|
39
|
+
options: string[];
|
|
40
40
|
/** @todo it would be better to use ProductStatus directly, which has uppercase */
|
|
41
41
|
status: "active" | "archived" | "draft";
|
|
42
42
|
published: boolean;
|
|
@@ -50,22 +50,22 @@ export interface ElasticProduct {
|
|
|
50
50
|
/** originalSrc URL for featured image */
|
|
51
51
|
image: Maybe<string>;
|
|
52
52
|
/** array of images (undefined if images are disabled in sync settings) */
|
|
53
|
-
images?:
|
|
53
|
+
images?: ElasticImage[];
|
|
54
54
|
/** array of variants attached to product (undefined if variants are disabled in sync settings) */
|
|
55
|
-
variants?:
|
|
55
|
+
variants?: ElasticVariant[];
|
|
56
56
|
/** price ranges from presentment prices (undefined if presentment prices or variants are disabled in sync settings) */
|
|
57
57
|
presentment_price_ranges?: {
|
|
58
|
-
min_variant_price:
|
|
59
|
-
max_variant_price:
|
|
58
|
+
min_variant_price: ElasticPresentmentPrice[];
|
|
59
|
+
max_variant_price: ElasticPresentmentPrice[];
|
|
60
60
|
};
|
|
61
61
|
/** array of variant skus (undefined if variants are disabled in sync settings) */
|
|
62
|
-
variant_skus?:
|
|
62
|
+
variant_skus?: string[];
|
|
63
63
|
/** combined array of option values from all option types (undefined if variants are disabled in sync settings) */
|
|
64
|
-
variant_options?:
|
|
64
|
+
variant_options?: string[];
|
|
65
65
|
/** array of collections which this product belongs to (undefined if collections are disabled in sync settings) */
|
|
66
|
-
collections?:
|
|
66
|
+
collections?: ElasticCollection[];
|
|
67
67
|
/** array of whitelisted metafields (undefined if metafields are disabled in sync settings) */
|
|
68
|
-
metafields?:
|
|
68
|
+
metafields?: ElasticMetafield[];
|
|
69
69
|
/** decimal number e.g. 99.95 (undefined if variants are disabled in sync settings) */
|
|
70
70
|
discount_amount?: number;
|
|
71
71
|
/** combined inventory for all variants (undefined if variants are disabled in sync settings) */
|
|
@@ -73,43 +73,7 @@ export interface ElasticProduct {
|
|
|
73
73
|
/** number of days since published, null if unpublished */
|
|
74
74
|
published_days: Maybe<number>;
|
|
75
75
|
/** collection of curations that this product is attached to */
|
|
76
|
-
curations?:
|
|
77
|
-
/** related products **/
|
|
78
|
-
related?: Array<ElasticProductRelated>;
|
|
79
|
-
}
|
|
80
|
-
export interface ElasticProductRelated {
|
|
81
|
-
createdAt: string;
|
|
82
|
-
description: string;
|
|
83
|
-
featuredImage: {
|
|
84
|
-
originalSrc: "https://cdn.shopify.com/s/files/1/0614/3977/0777/p…71d6-e7fd-4f5f-aa99-c722e2832d01.jpg?v=1660776345";
|
|
85
|
-
};
|
|
86
|
-
handle: string;
|
|
87
|
-
id: string;
|
|
88
|
-
images: Array<ElasticImage>;
|
|
89
|
-
legacyResourceId: string;
|
|
90
|
-
metafields?: Array<ElasticMetafield>;
|
|
91
|
-
options: Array<{
|
|
92
|
-
name: string;
|
|
93
|
-
}>;
|
|
94
|
-
priceRangeV2: {
|
|
95
|
-
maxVariantPrice: {
|
|
96
|
-
amount: string;
|
|
97
|
-
};
|
|
98
|
-
minVariantPrice: {
|
|
99
|
-
amount: string;
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
productType: string;
|
|
103
|
-
publishedAt: string;
|
|
104
|
-
status: "ACTIVE" | "ARCHIVED" | "DRAFT";
|
|
105
|
-
storefrontId: string;
|
|
106
|
-
tags: Array<string>;
|
|
107
|
-
title: string;
|
|
108
|
-
tracksInventory: boolean;
|
|
109
|
-
updatedAt: string;
|
|
110
|
-
variants: Array<ElasticVariant>;
|
|
111
|
-
vendor: string;
|
|
112
|
-
__typename: "Product";
|
|
76
|
+
curations?: ElasticCuration[];
|
|
113
77
|
}
|
|
114
78
|
export interface ElasticVariant {
|
|
115
79
|
/** legacy resource id */
|
|
@@ -119,10 +83,10 @@ export interface ElasticVariant {
|
|
|
119
83
|
sku: Maybe<string>;
|
|
120
84
|
barcode: Maybe<string>;
|
|
121
85
|
/** array of presentment prices (undefined if presentment prices are disabled in sync settings) */
|
|
122
|
-
presentment_prices?:
|
|
86
|
+
presentment_prices?: {
|
|
123
87
|
price: ElasticPresentmentPrice;
|
|
124
88
|
compare_at_price: Maybe<ElasticPresentmentPrice>;
|
|
125
|
-
}
|
|
89
|
+
}[];
|
|
126
90
|
/** decimal number e.g. 99.95 */
|
|
127
91
|
price: number;
|
|
128
92
|
/** decimal number e.g. 99.95 */
|
|
@@ -139,7 +103,7 @@ export interface ElasticVariant {
|
|
|
139
103
|
inventory_quantity: number;
|
|
140
104
|
available: boolean;
|
|
141
105
|
/** array of images (only available if this variant has been merged from another product and if images are enabled in sync settings) */
|
|
142
|
-
images?:
|
|
106
|
+
images?: ElasticImage[];
|
|
143
107
|
}
|
|
144
108
|
export interface ElasticCollection {
|
|
145
109
|
/** legacy resource id */
|
|
@@ -211,7 +175,7 @@ export declare type ElasticBulkOperationIndex = [
|
|
|
211
175
|
export declare type ElasticBulkOperation = ElasticBulkOperationUpdate | ElasticBulkOperationIndex;
|
|
212
176
|
export declare type ElasticSearchResult<T = ElasticDocument> = {
|
|
213
177
|
hits: {
|
|
214
|
-
hits:
|
|
178
|
+
hits: ElasticHit<T>[];
|
|
215
179
|
};
|
|
216
180
|
};
|
|
217
181
|
export declare type ElasticHit<T = ElasticDocument> = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elastic.js","sourceRoot":"","sources":["../../../src/types/elastic.ts"],"names":[],"mappings":";;;AAOA,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,0CAAmB,CAAA;AACrB,CAAC,EAHW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAG9B;
|
|
1
|
+
{"version":3,"file":"elastic.js","sourceRoot":"","sources":["../../../src/types/elastic.ts"],"names":[],"mappings":";;;AAOA,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,0CAAmB,CAAA;AACrB,CAAC,EAHW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAG9B;AA6LD,IAAY,eAQX;AARD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,oCAAiB,CAAA;IACjB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;AACrB,CAAC,EARW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAQ1B","sourcesContent":["import { Callout } from \"./firestore\";\nimport {\n Maybe,\n ProductVariantInventoryPolicy,\n MetafieldValueType,\n} from \"./graphql\";\n\nexport enum ElasticDocumentType {\n Callout = \"callout\",\n Product = \"product\",\n}\n\nexport type ElasticDocument = ElasticCallout | ElasticProduct;\n\nexport interface ElasticCallout {\n type: ElasticDocumentType.Callout;\n key: string;\n callout: Omit<Callout, \"keywords\">;\n /** elastic callouts are always published */\n published: true;\n /** elastic callouts are always attached to one curation */\n curations: [ElasticCuration];\n}\n\nexport interface ElasticProduct {\n type: ElasticDocumentType.Product;\n /** the log id from which this product was last uploaded */\n lastLogId: string;\n /** legacy resource id */\n id: number;\n storefrontId: string;\n title: string;\n description: string;\n vendor: string;\n product_type: string;\n handle: string;\n url: string;\n tags: string[];\n collection_titles: string[];\n /** tag prefixes defined in tagKeys are split to their own attributes */\n [key: `tags_${string}`]: string[] | undefined;\n /** decimal number e.g. 99.95 */\n price_min: number;\n /** decimal number e.g. 99.95 */\n price_max: number;\n /** array of option names e.g. [\"Colour\", \"Size\"] */\n options: string[];\n /** @todo it would be better to use ProductStatus directly, which has uppercase */\n status: \"active\" | \"archived\" | \"draft\";\n published: boolean;\n /** ISO 8601 datetime */\n published_at: Maybe<string>;\n /** ISO 8601 datetime */\n updated_at: string;\n /** ISO 8601 datetime */\n created_at: string;\n tracks_inventory: boolean;\n /** originalSrc URL for featured image */\n image: Maybe<string>;\n /** array of images (undefined if images are disabled in sync settings) */\n images?: ElasticImage[];\n /** array of variants attached to product (undefined if variants are disabled in sync settings) */\n variants?: ElasticVariant[];\n /** price ranges from presentment prices (undefined if presentment prices or variants are disabled in sync settings) */\n presentment_price_ranges?: {\n min_variant_price: ElasticPresentmentPrice[];\n max_variant_price: ElasticPresentmentPrice[];\n };\n /** array of variant skus (undefined if variants are disabled in sync settings) */\n variant_skus?: string[];\n /** combined array of option values from all option types (undefined if variants are disabled in sync settings) */\n variant_options?: string[];\n /** array of collections which this product belongs to (undefined if collections are disabled in sync settings) */\n collections?: ElasticCollection[];\n /** array of whitelisted metafields (undefined if metafields are disabled in sync settings) */\n metafields?: ElasticMetafield[];\n /** decimal number e.g. 99.95 (undefined if variants are disabled in sync settings) */\n discount_amount?: number;\n /** combined inventory for all variants (undefined if variants are disabled in sync settings) */\n inventory_total?: number;\n /** number of days since published, null if unpublished */\n published_days: Maybe<number>;\n /** collection of curations that this product is attached to */\n curations?: ElasticCuration[];\n}\n\nexport interface ElasticVariant {\n /** legacy resource id */\n id: number;\n storefrontId: string;\n title: string;\n sku: Maybe<string>;\n barcode: Maybe<string>;\n /** array of presentment prices (undefined if presentment prices are disabled in sync settings) */\n presentment_prices?: {\n price: ElasticPresentmentPrice;\n compare_at_price: Maybe<ElasticPresentmentPrice>;\n }[];\n /** decimal number e.g. 99.95 */\n price: number;\n /** decimal number e.g. 99.95 */\n compare_at_price: Maybe<number>;\n /** value string for option 1 e.g. Blue */\n option1: Maybe<string>;\n /** value string for option 2 e.g. Medium */\n option2: Maybe<string>;\n /** value string for option 3 */\n option3: Maybe<string>;\n /** sort position within the product */\n position: number;\n inventory_policy: ProductVariantInventoryPolicy;\n inventory_quantity: number;\n available: boolean;\n /** array of images (only available if this variant has been merged from another product and if images are enabled in sync settings) */\n images?: ElasticImage[];\n}\n\nexport interface ElasticCollection {\n /** legacy resource id */\n id: number;\n storefrontId: string;\n handle: string;\n title: string;\n position: number;\n}\n\nexport interface ElasticMetafield {\n key: string;\n type: string;\n value: string;\n namespace: string;\n /**\n * Legacy valueType attribute which is no longer provided by Shopify. We still\n * populate this field to prevent any frontends breaking which rely on it.\n *\n * @see https://shopify.dev/apps/metafields/definitions/types\n */\n value_type: MetafieldValueType;\n}\n\nexport interface ElasticPresentmentPrice {\n /** decimal number e.g. 99.95 */\n amount: number;\n currency_code: string;\n}\n\nexport interface ElasticImage {\n /** originalSrc URL */\n src: string;\n /** alt text */\n alt: Maybe<string>;\n}\n\nexport interface ElasticCuration {\n id: string;\n hidden: boolean;\n position?: number;\n searchTerm?: string;\n collectionHandle?: string;\n}\n\n// non-exhaustive type for bulk request\n// https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-bulk.html\nexport type ElasticBulkOperationUpdate = [\n { update: { _index: string; _id: string } },\n {\n script?: {\n lang: \"painless\";\n source: string;\n params?: Record<string, any>;\n };\n upsert?: Partial<ElasticProduct>;\n scripted_upsert?: true;\n doc?: Partial<ElasticProduct>;\n doc_as_upsert?: true;\n }\n];\n\nexport type ElasticBulkOperationIndex = [\n { index: { _index: string; _id: string } },\n ElasticDocument\n];\n\nexport type ElasticBulkOperation =\n | ElasticBulkOperationUpdate\n | ElasticBulkOperationIndex;\n\nexport type ElasticSearchResult<T = ElasticDocument> = {\n hits: {\n hits: ElasticHit<T>[];\n };\n};\n\nexport type ElasticHit<T = ElasticDocument> = {\n _id: string;\n _source: T;\n _score: number | null;\n};\n\nexport enum ElasticDataType {\n Text = \"text\",\n Long = \"long\",\n Date = \"date\",\n Float = \"float\",\n Nested = \"nested\",\n Keyword = \"keyword\",\n Boolean = \"boolean\",\n}\n\nexport interface ElasticProperty {\n analyzer?: string;\n type: ElasticDataType;\n ignore_above?: number;\n fields?: { [key: string]: ElasticField };\n properties?: { [key: string]: ElasticProperty };\n}\n\nexport interface ElasticField {\n type: ElasticDataType;\n ignore_above?: number;\n}\n"]}
|
|
@@ -128,7 +128,6 @@ export interface Filter {
|
|
|
128
128
|
inventoryVisibility: "show_all" | "hide_products" | "hide_variants" | "hide_all";
|
|
129
129
|
}
|
|
130
130
|
export interface FilterOption {
|
|
131
|
-
customSortOrder?: string;
|
|
132
131
|
displaySize: string;
|
|
133
132
|
displaySliderInterval: string;
|
|
134
133
|
displaySliderStep: string;
|
|
@@ -148,10 +147,8 @@ export interface FilterOption {
|
|
|
148
147
|
settingsShowFilter: boolean;
|
|
149
148
|
settingsShowMore: boolean;
|
|
150
149
|
settingsShowSearch: boolean;
|
|
151
|
-
settingsShowEmptyValues: boolean;
|
|
152
150
|
settingsUppercase: boolean;
|
|
153
151
|
settingsHideUnavailable: boolean;
|
|
154
|
-
settingsFilterLogic: "and" | "or";
|
|
155
152
|
valuesExclude: Array<string>;
|
|
156
153
|
valuesManual: Array<string>;
|
|
157
154
|
valuesShow: "all" | "manual";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firestore.js","sourceRoot":"","sources":["../../../src/types/firestore.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"firestore.js","sourceRoot":"","sources":["../../../src/types/firestore.ts"],"names":[],"mappings":";;;AAkOA,IAAY,cAQX;AARD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,2CAAyB,CAAA;IACzB,yCAAuB,CAAA;IACvB,+CAA6B,CAAA;IAC7B,yCAAuB,CAAA;IACvB,qCAAmB,CAAA;IACnB,qCAAmB,CAAA;AACrB,CAAC,EARW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAQzB;AAyBD,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,8BAAmB,CAAA;IACnB,8BAAmB,CAAA;AACrB,CAAC,EAHW,OAAO,GAAP,eAAO,KAAP,eAAO,QAGlB","sourcesContent":["// @todo this is so we don't need to import firebase\ntype Timestamp = string;\n\nimport { ShopifyProduct } from \"./shopify\";\nimport { ElasticDataType } from \"./elastic\";\n\nexport interface Log {\n id: string;\n keywords: string[];\n message: string;\n platform: \"reactify\" | \"shopify\" | \"elastic\";\n percentCompleted: number;\n action?: {\n type: \"retry\";\n label: string;\n task: Task[\"taskId\"];\n };\n step:\n | \"download\"\n | \"transform\"\n | \"merge\"\n | \"upload\"\n | \"cleanup\"\n | \"complete\"\n | \"sync\";\n title: string;\n type: \"bulk\";\n data?: string; // JSON sringified data\n progress: \"new\" | \"error\" | \"complete\" | \"partiallyComplete\";\n status: \"success\" | \"info\" | \"warning\" | \"critical\"; // polaris banner status\n createdAt: Timestamp;\n updatedAt?: Timestamp;\n finishedAt?: Timestamp;\n}\n\nexport interface Task {\n logId: string;\n taskId:\n | \"download\"\n | \"transform\"\n | \"merge\"\n | \"upload\"\n | \"cleanup\"\n | \"refreshDefinedFields\"\n | \"install\";\n firstRun: boolean;\n createdAt: Timestamp;\n updatedAt?: Timestamp;\n}\n\nexport interface TaskDownload extends Task {\n taskId: \"download\";\n type: \"collection\" | \"product\";\n productUrl?: string;\n collectionUrl?: string;\n}\n\nexport interface TaskTransform extends Task {\n taskId: \"transform\";\n productUrl: string;\n collectionUrl: string;\n}\n\nexport interface TaskMerge extends Task {\n taskId: \"merge\";\n productCount: number;\n collectionCount: number;\n startAfterId?: string;\n}\n\nexport interface TaskUpload extends Task {\n taskId: \"upload\";\n productCount: number;\n collectionCount: number;\n startAfterId?: string;\n}\n\nexport interface TaskCleanup extends Task {\n taskId: \"cleanup\";\n}\n\nexport interface TaskRefreshDefinedFields extends Task {\n taskId: \"refreshDefinedFields\";\n}\n\nexport interface TaskInstall extends Task {\n taskId: \"install\";\n}\n\nexport interface Lock {\n logId: string;\n taskType: \"sync\";\n createdAt: Timestamp;\n}\n\nexport interface SettingsInstance {\n index: string;\n cloudId: string;\n endpoint: string;\n password: string;\n username: string;\n syncFrequency: string;\n syncThreshold: number;\n provider: \"elastic\" | \"aws\";\n storefrontAccessToken: string;\n customMappings: string; // JSON sringified data\n}\n\nexport interface SettingsProduct {\n tagChild?: string;\n tagKeys?: string[];\n tagParent?: string;\n syncObjects: string[];\n tagExclude?: string[];\n tagSeparator?: string;\n metafieldWhitelist?: string[];\n}\n\nexport interface SettingsCurations {\n moreInfo?: boolean;\n pageSize?: number;\n gridColumns?: number;\n}\n\nexport interface Field {\n id: string;\n field: string;\n enabled: boolean;\n importance: number;\n searchType: \"always_search\" | \"search_page\" | \"instant_search\";\n}\n\nexport interface DefinedField {\n label: string;\n value: string;\n type: ElasticDataType;\n}\n\nexport interface Sort {\n id: string;\n name: string;\n handle: string;\n field: string;\n position: number;\n enabled: boolean;\n direction: \"desc\" | \"asc\";\n visibility: \"all\" | \"search\" | \"collection\";\n}\n\nexport interface Filter {\n id: string;\n name: string;\n handle: string;\n enabled: boolean;\n pageSize: number;\n keywords: string[];\n defaultSort: string;\n collections: string[];\n type: \"search\" | \"collection\";\n paginationType: \"pagination\" | \"load_more\" | \"next_prev\" | \"infinite_scroll\";\n inventoryVisibility:\n | \"show_all\"\n | \"hide_products\"\n | \"hide_variants\"\n | \"hide_all\";\n}\n\nexport interface FilterOption {\n displaySize: string;\n displaySliderInterval: string;\n displaySliderStep: string;\n displaySliderPrefix?: string;\n displaySliderSuffix?: string;\n displayRangeOptions?: Array<string>; // formatted like \"<label>:<start>:<end>\"\n displayType: \"multi\" | \"single\" | \"range\" | \"slider\";\n displayView: \"list\" | \"check\" | \"swatch\" | \"range\" | \"box\";\n enabled: boolean;\n field: string;\n id: string;\n name: string;\n handle: string;\n position: number;\n settingsCollapsedDesktop: boolean;\n settingsCollapsedMobile: boolean;\n settingsShowFilter: boolean;\n settingsShowMore: boolean;\n settingsShowSearch: boolean;\n settingsUppercase: boolean;\n settingsHideUnavailable: boolean;\n valuesExclude: Array<string>;\n valuesManual: Array<string>;\n valuesShow: \"all\" | \"manual\";\n}\n\nexport interface Redirect {\n id: string;\n url: string;\n query: string;\n enabled: boolean;\n keywords: string[];\n}\n\nexport interface Curation {\n id: string;\n title: string;\n status: CurationStatus;\n published: boolean;\n keywords: string[];\n searchTerm?: string;\n longRunningTask?: boolean;\n collectionHandle?: string;\n type: \"collection\" | \"search\";\n boosting?: {\n groupings?: BoostGrouping[];\n sortings?: BoostSorting[];\n };\n sort?: CurationSort;\n}\n\nexport interface CurationSort {\n sortTag?: string;\n sortOption: string;\n sortDirection: \"asc\" | \"desc\";\n sortVariantOption?: \"option1\" | \"option2\" | \"option3\";\n}\n\nexport enum CurationStatus {\n Draft = \"draft\",\n Publishing = \"publishing\",\n Published = \"published\",\n Unpublishing = \"unpublishing\",\n Resetting = \"resetting\",\n Pinning = \"pinning\",\n Sorting = \"sorting\",\n}\n\nexport interface CurationHiding {\n productId: number;\n productHandle: string;\n}\n\nexport interface BoostGrouping {\n key: string;\n value: string;\n field: string;\n position: number;\n operation: string;\n}\n\nexport interface BoostSorting {\n key: string;\n field: string;\n query?: string;\n position: number;\n direction: \"asc\" | \"desc\";\n}\n\nexport type Pin = PinProduct | PinCallout;\n\nexport enum PinType {\n Product = \"product\",\n Callout = \"callout\",\n}\n\nexport interface PinProduct {\n key: string;\n type: PinType.Product;\n position: number;\n productId: number;\n productHandle: string;\n}\n\nexport interface PinCallout {\n key: string;\n type: PinType.Callout;\n position: number;\n calloutId: string;\n}\n\nexport interface Callout {\n id: string;\n link: string;\n title: string;\n content: string;\n enabled: boolean;\n textColor: string;\n keywords: string[];\n mobileImage: string;\n mobileVideo: string;\n desktopVideo: string;\n desktopImage: string;\n backgroundColor: string;\n visibility: \"desktop\" | \"mobile\" | \"all\";\n displayColumns: string; // @todo this should be a number\n displayRows: string; // @todo this should be a number\n selectedDates?: {\n end: Timestamp;\n start: Timestamp;\n };\n}\n\nexport interface Synonym {\n id: string;\n name: string;\n enabled: boolean;\n keywords: string[];\n synonyms: string[];\n type: \"group\" | \"oneway\";\n}\n\nexport interface MergedValue {\n id: string;\n name: string;\n field: string;\n keywords: string[];\n values: string[];\n}\n\nexport interface Collection {\n title: string;\n handle: string;\n shopifyId: string;\n productIds: string[];\n storefrontId: string;\n legacyResourceId: number;\n}\n\n// product is the shopify product with edges and nodes normalised\nexport type Product = Omit<\n ShopifyProduct,\n \"variants\" | \"images\" | \"media\" | \"metafields\"\n> & {\n variants: (Omit<\n ShopifyProduct[\"variants\"][\"edges\"][0][\"node\"],\n \"presentmentPrices\"\n > & {\n images?: ShopifyProduct[\"images\"][\"edges\"][0][\"node\"][]; // from child product if this variant is from a child\n presentmentPrices: ShopifyProduct[\"variants\"][\"edges\"][0][\"node\"][\"presentmentPrices\"][\"edges\"][0][\"node\"][];\n })[];\n images: ShopifyProduct[\"images\"][\"edges\"][0][\"node\"][];\n media: ShopifyProduct[\"media\"][\"edges\"][0][\"node\"][];\n metafields: ShopifyProduct[\"metafields\"][\"edges\"][0][\"node\"][];\n};\n"]}
|
|
@@ -21,7 +21,7 @@ export interface ReactivesearchPaginationProps {
|
|
|
21
21
|
export interface ReactivesearchResultProps {
|
|
22
22
|
error?: ReactivesearchError;
|
|
23
23
|
loading: boolean;
|
|
24
|
-
data:
|
|
24
|
+
data: (Omit<ElasticHit, "_source"> & ElasticDocument)[];
|
|
25
25
|
loadMore: () => void;
|
|
26
26
|
customData: unknown;
|
|
27
27
|
promotedData: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactivesearch.js","sourceRoot":"","sources":["../../../src/types/reactivesearch.ts"],"names":[],"mappings":"","sourcesContent":["import { ElasticDocument, ElasticHit } from \"./elastic\";\n\n// props passed to SingleList/MultiList.render\nexport interface ReactivesearchFilterListProps {\n loading: boolean;\n error: Error | null;\n handleChange: (key: string) => void;\n data: { doc_count: number; key: string }[];\n value: string | { [key: string]: boolean };\n}\n\n// props passed to ReactiveList.renderPagination\nexport interface ReactivesearchPaginationProps {\n pages: number;\n showEndPage: false;\n totalPages: number;\n currentPage: number;\n setPage: (page: number) => void;\n}\n\n// props passed to ReactiveList.render\n// @todo complete missing types\nexport interface ReactivesearchResultProps {\n error?: ReactivesearchError;\n loading: boolean;\n data:
|
|
1
|
+
{"version":3,"file":"reactivesearch.js","sourceRoot":"","sources":["../../../src/types/reactivesearch.ts"],"names":[],"mappings":"","sourcesContent":["import { ElasticDocument, ElasticHit } from \"./elastic\";\n\n// props passed to SingleList/MultiList.render\nexport interface ReactivesearchFilterListProps {\n loading: boolean;\n error: Error | null;\n handleChange: (key: string) => void;\n data: { doc_count: number; key: string }[];\n value: string | { [key: string]: boolean };\n}\n\n// props passed to ReactiveList.renderPagination\nexport interface ReactivesearchPaginationProps {\n pages: number;\n showEndPage: false;\n totalPages: number;\n currentPage: number;\n setPage: (page: number) => void;\n}\n\n// props passed to ReactiveList.render\n// @todo complete missing types\nexport interface ReactivesearchResultProps {\n error?: ReactivesearchError;\n loading: boolean;\n data: (Omit<ElasticHit, \"_source\"> & ElasticDocument)[];\n loadMore: () => void;\n customData: unknown;\n promotedData: unknown;\n aggregationData: unknown;\n rawData?: {\n _shards: {\n failed: number;\n skipped: number;\n successful: number;\n total: number;\n };\n took: number;\n status: number;\n timed_out: boolean;\n hits: ElasticHit[];\n };\n resultStats: {\n time: number;\n hidden: number;\n promoted: number;\n currentPage: number;\n numberOfPages: number;\n numberOfResults?: number;\n displayedResults: number;\n };\n streamData: unknown;\n triggerAnalytics: unknown;\n triggerClickAnalytics: unknown;\n}\n\n// state for the \"page\" component returned by StateProvider when given the keys: [\"isLoading\", \"hits\", \"resultStats\", \"error\"]\nexport interface ReactivesearchSearchStatePage {\n isLoading: boolean;\n hits: {\n hidden: number;\n time: number;\n total: number;\n hits: ElasticHit[];\n };\n resultStats: {\n hidden: number;\n numberOfResults?: number;\n promoted: number;\n time: number;\n };\n error?: ReactivesearchError;\n}\n\nexport interface ReactivesearchError {\n status: number;\n statusText: string;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ExampleHookUseResults = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const hooks_1 = require("../../hooks");
|
|
9
|
-
const types_1 = require("../../types");
|
|
10
|
-
const ExampleHookUseResults = () => {
|
|
11
|
-
const resultsHook = (0, hooks_1.useResults)();
|
|
12
|
-
const collections = resultsHook.results
|
|
13
|
-
.map((result) => {
|
|
14
|
-
if (result.type === types_1.ElasticDocumentType.Product) {
|
|
15
|
-
return result.collections;
|
|
16
|
-
}
|
|
17
|
-
return [];
|
|
18
|
-
})
|
|
19
|
-
.flat()
|
|
20
|
-
.filter((item, index, self) => self.findIndex((itemNested) => (itemNested === null || itemNested === void 0 ? void 0 : itemNested.id) === (item === null || item === void 0 ? void 0 : item.id)) === index);
|
|
21
|
-
return (react_1.default.createElement("ul", null, collections.map((collection) => (react_1.default.createElement("li", null,
|
|
22
|
-
react_1.default.createElement("a", { href: `/collections/${collection === null || collection === void 0 ? void 0 : collection.handle}` }, collection === null || collection === void 0 ? void 0 : collection.title))))));
|
|
23
|
-
};
|
|
24
|
-
exports.ExampleHookUseResults = ExampleHookUseResults;
|
|
25
|
-
//# sourceMappingURL=ExampleHookUseResults.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleHookUseResults.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleHookUseResults.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAAyC;AACzC,uCAAkD;AAE3C,MAAM,qBAAqB,GAAa,GAAG,EAAE;IAClD,MAAM,WAAW,GAAG,IAAA,kBAAU,GAAE,CAAC;IAEjC,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO;SACpC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACd,IAAI,MAAM,CAAC,IAAI,KAAK,2BAAmB,CAAC,OAAO,EAAE;YAC/C,OAAO,MAAM,CAAC,WAAW,CAAC;SAC3B;QAED,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;SACD,IAAI,EAAE;SACN,MAAM,CACL,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CACpB,IAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,EAAE,OAAK,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE,CAAA,CAAC,KAAK,KAAK,CACxE,CAAC;IAEJ,OAAO,CACL,0CACG,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAC/B;QACE,qCAAG,IAAI,EAAE,gBAAgB,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,EAAE,IAAG,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,CAAK,CACnE,CACN,CAAC,CACC,CACN,CAAC;AACJ,CAAC,CAAC;AA1BW,QAAA,qBAAqB,yBA0BhC","sourcesContent":["import React from \"react\";\n\nimport { useResults } from \"../../hooks\";\nimport { ElasticDocumentType } from \"../../types\";\n\nexport const ExampleHookUseResults: React.FC = () => {\n const resultsHook = useResults();\n\n const collections = resultsHook.results\n .map((result) => {\n if (result.type === ElasticDocumentType.Product) {\n return result.collections;\n }\n\n return [];\n })\n .flat()\n .filter(\n (item, index, self) =>\n self.findIndex((itemNested) => itemNested?.id === item?.id) === index\n );\n\n return (\n <ul>\n {collections.map((collection) => (\n <li>\n <a href={`/collections/${collection?.handle}`}>{collection?.title}</a>\n </li>\n ))}\n </ul>\n );\n};\n"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ExampleSuggestions = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const hooks_1 = require("../../hooks");
|
|
9
|
-
const ExampleSuggestions = (props) => {
|
|
10
|
-
const { setSearchTerm } = (0, hooks_1.useSearch)();
|
|
11
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
12
|
-
react_1.default.createElement("h3", null, "Suggestions"),
|
|
13
|
-
react_1.default.createElement("ul", null, props.suggestions.map((suggestion) => (react_1.default.createElement("li", { onClick: () => setSearchTerm(suggestion.text) }, suggestion.text))))));
|
|
14
|
-
};
|
|
15
|
-
exports.ExampleSuggestions = ExampleSuggestions;
|
|
16
|
-
//# sourceMappingURL=ExampleSuggestions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleSuggestions.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleSuggestions.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,uCAAwC;AAMjC,MAAM,kBAAkB,GAAsC,CACnE,KAAK,EACL,EAAE;IACF,MAAM,EAAE,aAAa,EAAE,GAAG,IAAA,iBAAS,GAAE,CAAC;IAEtC,OAAO,CACL;QACE,wDAAoB;QACpB,0CACG,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CACrC,sCAAI,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,IAC9C,UAAU,CAAC,IAAI,CACb,CACN,CAAC,CACC,CACJ,CACJ,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,kBAAkB,sBAiB7B","sourcesContent":["import React from \"react\";\n\nimport { SuggestionsProps } from \"../../components\";\nimport { useSearch } from \"../../hooks\";\n\nexport type ExampleSuggestionsProps = React.ComponentProps<\n NonNullable<SuggestionsProps[\"render\"]>\n>;\n\nexport const ExampleSuggestions: React.FC<ExampleSuggestionsProps> = (\n props\n) => {\n const { setSearchTerm } = useSearch();\n\n return (\n <>\n <h3>Suggestions</h3>\n <ul>\n {props.suggestions.map((suggestion) => (\n <li onClick={() => setSearchTerm(suggestion.text)}>\n {suggestion.text}\n </li>\n ))}\n </ul>\n </>\n );\n};\n"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export declare type SuggestionsProps = {
|
|
3
|
-
/** The field which should be used for autocompletion */
|
|
4
|
-
field: "title";
|
|
5
|
-
/** Render method */
|
|
6
|
-
render?: React.FC<{
|
|
7
|
-
suggestions: Array<{
|
|
8
|
-
text: string;
|
|
9
|
-
}>;
|
|
10
|
-
}>;
|
|
11
|
-
};
|
|
12
|
-
export declare const Suggestions: React.FC<SuggestionsProps>;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Suggestions = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const components_1 = require("../../components");
|
|
9
|
-
const hooks_1 = require("../../hooks");
|
|
10
|
-
const Suggestions = (props) => {
|
|
11
|
-
var _a;
|
|
12
|
-
const RenderComponent = (_a = props.render) !== null && _a !== void 0 ? _a : components_1.ExampleSuggestions;
|
|
13
|
-
const { searchTerm } = (0, hooks_1.useSearch)();
|
|
14
|
-
return (react_1.default.createElement(components_1.CustomComponent, { componentId: "SensorSuggestions", defaultQuery: () => {
|
|
15
|
-
return {
|
|
16
|
-
suggest: {
|
|
17
|
-
suggestions: {
|
|
18
|
-
text: searchTerm,
|
|
19
|
-
term: {
|
|
20
|
-
field: props.field,
|
|
21
|
-
sort: "score",
|
|
22
|
-
suggest_mode: "always",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
}, react: {
|
|
28
|
-
and: components_1.SENSOR_IDS,
|
|
29
|
-
}, render: (renderProps) => {
|
|
30
|
-
var _a, _b, _c;
|
|
31
|
-
const props = {
|
|
32
|
-
suggestions: [],
|
|
33
|
-
};
|
|
34
|
-
if ((_b = (_a = renderProps.rawData) === null || _a === void 0 ? void 0 : _a.suggest) === null || _b === void 0 ? void 0 : _b.suggestions.length) {
|
|
35
|
-
const options = (_c = renderProps.rawData.suggest.suggestions[renderProps.rawData.suggest.suggestions.length - 1]) === null || _c === void 0 ? void 0 : _c.options;
|
|
36
|
-
props.suggestions.push(...options.map((option) => ({
|
|
37
|
-
text: option.text,
|
|
38
|
-
})));
|
|
39
|
-
}
|
|
40
|
-
return react_1.default.createElement(RenderComponent, Object.assign({}, props));
|
|
41
|
-
} }));
|
|
42
|
-
};
|
|
43
|
-
exports.Suggestions = Suggestions;
|
|
44
|
-
//# sourceMappingURL=Suggestions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Suggestions.js","sourceRoot":"","sources":["../../../../src/components/Suggestions/Suggestions.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAI0B;AAC1B,uCAAwC;AAajC,MAAM,WAAW,GAA+B,CAAC,KAAK,EAAE,EAAE;;IAC/D,MAAM,eAAe,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,+BAAkB,CAAC;IAE3D,MAAM,EAAE,UAAU,EAAE,GAAG,IAAA,iBAAS,GAAE,CAAC;IAEnC,OAAO,CACL,8BAAC,4BAAe,IACd,WAAW,EAAC,mBAAmB,EAC/B,YAAY,EAAE,GAAG,EAAE;YACjB,OAAO;gBACL,OAAO,EAAE;oBACP,WAAW,EAAE;wBACX,IAAI,EAAE,UAAU;wBAChB,IAAI,EAAE;4BACJ,KAAK,EAAE,KAAK,CAAC,KAAK;4BAClB,IAAI,EAAE,OAAO;4BACb,YAAY,EAAE,QAAQ;yBACvB;qBACF;iBACF;aACF,CAAC;QACJ,CAAC,EACD,KAAK,EAAE;YACL,GAAG,EAAE,uBAAU;SAChB,EACD,MAAM,EAAE,CAAC,WAAW,EAAE,EAAE;;YACtB,MAAM,KAAK,GAEP;gBACF,WAAW,EAAE,EAAE;aAChB,CAAC;YAEF,IAAI,MAAA,MAAA,WAAW,CAAC,OAAO,0CAAE,OAAO,0CAAE,WAAW,CAAC,MAAM,EAAE;gBACpD,MAAM,OAAO,GACX,MAAA,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CACrC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CACnD,0CAAE,OAAO,CAAC;gBACb,KAAK,CAAC,WAAW,CAAC,IAAI,CACpB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAsC,EAAE,EAAE,CAAC,CAAC;oBAC1D,IAAI,EAAE,MAAM,CAAC,IAAI;iBAClB,CAAC,CAAC,CACJ,CAAC;aACH;YAED,OAAO,8BAAC,eAAe,oBAAK,KAAK,EAAI,CAAC;QACxC,CAAC,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAhDW,QAAA,WAAW,eAgDtB","sourcesContent":["import React from \"react\";\n\nimport {\n CustomComponent,\n ExampleSuggestions,\n SENSOR_IDS,\n} from \"../../components\";\nimport { useSearch } from \"../../hooks\";\n\nexport type SuggestionsProps = {\n /** The field which should be used for autocompletion */\n field: \"title\";\n /** Render method */\n render?: React.FC<{\n suggestions: Array<{\n text: string;\n }>;\n }>;\n};\n\nexport const Suggestions: React.FC<SuggestionsProps> = (props) => {\n const RenderComponent = props.render ?? ExampleSuggestions;\n\n const { searchTerm } = useSearch();\n\n return (\n <CustomComponent\n componentId=\"SensorSuggestions\"\n defaultQuery={() => {\n return {\n suggest: {\n suggestions: {\n text: searchTerm,\n term: {\n field: props.field,\n sort: \"score\",\n suggest_mode: \"always\",\n },\n },\n },\n };\n }}\n react={{\n and: SENSOR_IDS,\n }}\n render={(renderProps) => {\n const props: React.ComponentProps<\n NonNullable<SuggestionsProps[\"render\"]>\n > = {\n suggestions: [],\n };\n\n if (renderProps.rawData?.suggest?.suggestions.length) {\n const options =\n renderProps.rawData.suggest.suggestions[\n renderProps.rawData.suggest.suggestions.length - 1\n ]?.options;\n props.suggestions.push(\n ...options.map((option: { text: string; freq: number }) => ({\n text: option.text,\n }))\n );\n }\n\n return <RenderComponent {...props} />;\n }}\n />\n );\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Suggestions";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./Suggestions"), exports);
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Suggestions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA8B","sourcesContent":["export * from \"./Suggestions\";\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ConfigFilterOption } from "../../types";
|
|
3
|
-
import ReactSlider from "react-slider";
|
|
4
|
-
export declare const useReactSliderProps: (filter: ConfigFilterOption, filterValue: [number, number], filterRange: [number, number], handleChange: (value: [number, number]) => void) => Pick<React.ComponentProps<typeof ReactSlider>, "value" | "defaultValue" | "min" | "max" | "step" | "pearling" | "minDistance" | "onChange">;
|