@usereactify/search 5.15.1 → 5.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/package.json +2 -1
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.d.ts +3 -5
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js +4 -9
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.d.ts +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js +3 -3
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js.map +1 -1
- package/dist/src/hooks/useReactifySearchContext.d.ts +4 -10
- package/dist/src/hooks/useReactifySearchContext.js.map +1 -1
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
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.16.0](https://bitbucket.org/usereactify/reactify-search-ui/compare/release-v5.15.2...release-v5.16.0) (2022-12-08)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* implement ga-gtag ([ff0bcb2](https://bitbucket.org/usereactify/reactify-search-ui/commit/ff0bcb2d8490f6a428769c21b8f9472207c8792f))
|
|
11
|
+
|
|
12
|
+
### [5.15.2](https://bitbucket.org/usereactify/reactify-search-ui/compare/release-v5.15.1...release-v5.15.2) (2022-12-07)
|
|
13
|
+
|
|
5
14
|
### [5.15.1](https://bitbucket.org/usereactify/reactify-search-ui/compare/release-v5.15.0...release-v5.15.1) (2022-12-07)
|
|
6
15
|
|
|
7
16
|
|
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.
|
|
4
|
+
"version": "5.16.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"types": "dist/src/index.d.ts",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"axios": "0.26.1",
|
|
36
36
|
"currency.js": "2.0.4",
|
|
37
37
|
"debug": "4.3.2",
|
|
38
|
+
"ga-gtag": "1.1.5",
|
|
38
39
|
"react-intersection-observer": "9.1.0",
|
|
39
40
|
"react-slider": "2.0.4"
|
|
40
41
|
},
|
|
@@ -21,11 +21,9 @@ export declare type ReactifySearchProviderProps = {
|
|
|
21
21
|
/** Advanced usage: Override the default Reactify Search config (for multi-instance stores) */
|
|
22
22
|
configId?: string;
|
|
23
23
|
/** Advanced usage: Override the default Elasticsearch credentials */
|
|
24
|
-
credentials?:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
endpoint: string;
|
|
28
|
-
};
|
|
24
|
+
credentials?: string;
|
|
25
|
+
/** Advanced usage: Override the default Elasticsearch endpoint */
|
|
26
|
+
endpoint?: string;
|
|
29
27
|
/** Advanced usage: Override the default ReactiveBase theme */
|
|
30
28
|
theme?: Record<string, unknown>;
|
|
31
29
|
/** Advanced usage: Fields to include in the Elasticsearch response e.g. ["title"] */
|
|
@@ -44,14 +44,9 @@ const ReactifySearchProvider = (props) => {
|
|
|
44
44
|
};
|
|
45
45
|
exports.ReactifySearchProvider = ReactifySearchProvider;
|
|
46
46
|
const ReactifySearchInner = (props) => {
|
|
47
|
-
var _a
|
|
47
|
+
var _a;
|
|
48
48
|
const { config } = (0, hooks_1.useConfig)(props.shopifyPermanentDomain, props.configId);
|
|
49
|
-
const
|
|
50
|
-
username: "guest",
|
|
51
|
-
password: "password",
|
|
52
|
-
endpoint: "https://api.search.reactify.app",
|
|
53
|
-
};
|
|
54
|
-
const theme = (_b = props.theme) !== null && _b !== void 0 ? _b : {
|
|
49
|
+
const theme = (_a = props.theme) !== null && _a !== void 0 ? _a : {
|
|
55
50
|
typography: {
|
|
56
51
|
fontFamily: "inherit",
|
|
57
52
|
fontSize: "inherit",
|
|
@@ -89,13 +84,13 @@ const ReactifySearchInner = (props) => {
|
|
|
89
84
|
}
|
|
90
85
|
}, [searchSortFromURL]);
|
|
91
86
|
const contextValue = react_1.default.useMemo(() => {
|
|
92
|
-
var _a;
|
|
87
|
+
var _a, _b;
|
|
93
88
|
if (!config) {
|
|
94
89
|
return;
|
|
95
90
|
}
|
|
96
91
|
return {
|
|
97
92
|
config: config,
|
|
98
|
-
options: Object.assign(Object.assign({}, props), { index: (_a = props.index) !== null && _a !== void 0 ? _a : config.index, filtersHandle: props.filtersHandle, credentials: credentials, theme: theme }),
|
|
93
|
+
options: Object.assign(Object.assign({}, props), { index: (_a = props.index) !== null && _a !== void 0 ? _a : config.index, filtersHandle: props.filtersHandle, credentials: props.credentials, endpoint: (_b = props.endpoint) !== null && _b !== void 0 ? _b : "https://api.search.reactify.app", theme: theme }),
|
|
99
94
|
search: {
|
|
100
95
|
searchTerm: searchTerm,
|
|
101
96
|
setSearchTerm: setSearchTerm,
|
|
@@ -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;AAkD/B,MAAM,sBAAsB,GAA0C,CAC3E,KAAK,EACL,EAAE;IACF,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,eAAK,CAAC,GAAG,CAAC,wBAAwB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QAEpD,MAAM,CAAC,OAAO,CAAC;YACb,sBAAsB,EAAE,KAAK,CAAC,KAAK;YACnC,qBAA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C,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\";\nimport { ReactivesearchResultProps } from \"../../types\";\n\nexport type ReactifySearchProviderProps = {\n /** Standard react children */\n children?: React.ReactNode | undefined;\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 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 const [searchTerm, setSearchTerm] = React.useState<string>(\n searchTermFromURL ?? \"\"\n );\n const [showInstantSearchResults, setShowInstantSearchResults] =\n React.useState<boolean>(false);\n const [sortOption, setSortOption] = React.useState<string>(\n searchSortFromURL ?? \"\"\n );\n\n const [results, setResults] = React.useState<\n ReactivesearchResultProps[\"data\"]\n >([]);\n const [resultStats, setResultStats] =\n React.useState<ReactivesearchResultProps[\"resultStats\"]>();\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 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 results: {\n results: results,\n setResults: setResults,\n resultStats: resultStats,\n setResultStats: setResultStats,\n },\n };\n }, [\n config,\n props,\n searchTerm,\n showInstantSearchResults,\n sortOption,\n results,\n resultStats,\n ]);\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"]}
|
|
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;AAgD/B,MAAM,sBAAsB,GAA0C,CAC3E,KAAK,EACL,EAAE;IACF,eAAK,CAAC,SAAS,CAAC,GAAG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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\";\nimport { ReactivesearchResultProps } from \"../../types\";\n\nexport type ReactifySearchProviderProps = {\n /** Standard react children */\n children?: React.ReactNode | undefined;\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?: string;\n /** Advanced usage: Override the default Elasticsearch endpoint */\n endpoint?: string;\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 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 const [searchTerm, setSearchTerm] = React.useState<string>(\n searchTermFromURL ?? \"\"\n );\n const [showInstantSearchResults, setShowInstantSearchResults] =\n React.useState<boolean>(false);\n const [sortOption, setSortOption] = React.useState<string>(\n searchSortFromURL ?? \"\"\n );\n\n const [results, setResults] = React.useState<\n ReactivesearchResultProps[\"data\"]\n >([]);\n const [resultStats, setResultStats] =\n React.useState<ReactivesearchResultProps[\"resultStats\"]>();\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 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: props.credentials,\n endpoint: props.endpoint ?? \"https://api.search.reactify.app\",\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 results: {\n results: results,\n setResults: setResults,\n resultStats: resultStats,\n setResultStats: setResultStats,\n },\n };\n }, [\n config,\n props,\n searchTerm,\n showInstantSearchResults,\n sortOption,\n results,\n resultStats,\n ]);\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"]}
|
|
@@ -19,8 +19,8 @@ const useReactiveBaseProps = () => {
|
|
|
19
19
|
const { options } = (0, hooks_1.useReactifySearchContext)();
|
|
20
20
|
const reactiveBaseProps = react_1.default.useMemo(() => ({
|
|
21
21
|
app: options.index,
|
|
22
|
-
url: options.
|
|
23
|
-
credentials:
|
|
22
|
+
url: options.endpoint,
|
|
23
|
+
credentials: options.credentials,
|
|
24
24
|
theme: options.theme,
|
|
25
25
|
transformResponse: (response) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
26
|
var _a, _b, _c, _d;
|
|
@@ -38,7 +38,7 @@ const useReactiveBaseProps = () => {
|
|
|
38
38
|
}
|
|
39
39
|
return response;
|
|
40
40
|
}),
|
|
41
|
-
}), [options.credentials, options.theme]);
|
|
41
|
+
}), [options.index, options.endpoint, options.credentials, options.theme]);
|
|
42
42
|
return reactiveBaseProps;
|
|
43
43
|
};
|
|
44
44
|
exports.useReactiveBaseProps = useReactiveBaseProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReactiveBaseProps.js","sourceRoot":"","sources":["../../../../src/hooks/reactivesearch/useReactiveBaseProps.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,uCAAuD;AAEhD,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACvC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAE/C,MAAM,iBAAiB,GAAG,eAAK,CAAC,OAAO,CACrC,GAAG,EAAE,CAAC,CAAC;QACL,GAAG,EAAE,OAAO,CAAC,KAAK;QAClB,GAAG,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"useReactiveBaseProps.js","sourceRoot":"","sources":["../../../../src/hooks/reactivesearch/useReactiveBaseProps.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,uCAAuD;AAEhD,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACvC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAE/C,MAAM,iBAAiB,GAAG,eAAK,CAAC,OAAO,CACrC,GAAG,EAAE,CAAC,CAAC;QACL,GAAG,EAAE,OAAO,CAAC,KAAK;QAClB,GAAG,EAAE,OAAO,CAAC,QAAQ;QACrB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,iBAAiB,EAAE,CAAO,QAAa,EAAE,EAAE;;YACzC,+EAA+E;YAC/E,uDAAuD;YACvD,EAAE;YACF,qFAAqF;YACrF,qFAAqF;YACrF,kEAAkE;YAClE,EAAE;YACF,0DAA0D;YAC1D,IACE,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,YAAY,0CAAE,qBAAqB,0CAAE,qBAAqB,EACpE;gBACA,QAAQ,CAAC,YAAY,CAAC,qBAAqB;oBACzC,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,YAAY,0CAAE,qBAAqB,0CAAE,qBAAqB,CAAC;aACxE;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA;KACF,CAAC,EACF,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,KAAK,CAAC,CACtE,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAhCW,QAAA,oBAAoB,wBAgC/B","sourcesContent":["import React from \"react\";\nimport { useReactifySearchContext } from \"../../hooks\";\n\nexport const useReactiveBaseProps = () => {\n const { options } = useReactifySearchContext();\n\n const reactiveBaseProps = React.useMemo(\n () => ({\n app: options.index,\n url: options.endpoint,\n credentials: options.credentials,\n theme: options.theme,\n transformResponse: async (response: any) => {\n // support filtering inside nested aggregations by moving the inner aggregation\n // up one level such that reactivesearch understands it\n //\n // see useReactiveFilterListProps > defaultQuery to see how a filter is being applied\n // to variant aggregations to ensure that only in stock sizes are displayed as filter\n // options, this involves a nested filter, which requires this fix\n //\n // https://github.com/appbaseio/reactivesearch/issues/1530\n if (\n response?.aggregations?.reactivesearch_nested?.reactify_nested_outer\n ) {\n response.aggregations.reactivesearch_nested =\n response?.aggregations?.reactivesearch_nested?.reactify_nested_outer;\n }\n\n return response;\n },\n }),\n [options.index, options.endpoint, options.credentials, options.theme]\n );\n\n return reactiveBaseProps;\n};\n"]}
|
|
@@ -8,11 +8,8 @@ export declare const ReactifySearchContext: React.Context<{
|
|
|
8
8
|
index: string;
|
|
9
9
|
shopifyPermanentDomain: string;
|
|
10
10
|
filtersHandle?: string | undefined;
|
|
11
|
-
credentials
|
|
12
|
-
|
|
13
|
-
password: string;
|
|
14
|
-
endpoint: string;
|
|
15
|
-
};
|
|
11
|
+
credentials?: string | undefined;
|
|
12
|
+
endpoint: string;
|
|
16
13
|
onRedirect?: ((type: "redirect" | "search", url: string) => void) | undefined;
|
|
17
14
|
theme: Record<string, unknown>;
|
|
18
15
|
additionalComponentIds?: string[] | undefined;
|
|
@@ -50,11 +47,8 @@ export declare const useReactifySearchContext: () => {
|
|
|
50
47
|
index: string;
|
|
51
48
|
shopifyPermanentDomain: string;
|
|
52
49
|
filtersHandle?: string | undefined;
|
|
53
|
-
credentials
|
|
54
|
-
|
|
55
|
-
password: string;
|
|
56
|
-
endpoint: string;
|
|
57
|
-
};
|
|
50
|
+
credentials?: string | undefined;
|
|
51
|
+
endpoint: string;
|
|
58
52
|
onRedirect?: ((type: "redirect" | "search", url: string) => void) | undefined;
|
|
59
53
|
theme: Record<string, unknown>;
|
|
60
54
|
additionalComponentIds?: string[] | undefined;
|
|
@@ -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,CAqDtD,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, ReactivesearchResultProps } 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?: string;\n endpoint: string;\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 results: {\n results: ReactivesearchResultProps[\"data\"];\n setResults: React.Dispatch<\n React.SetStateAction<ReactivesearchResultProps[\"data\"]>\n >;\n resultStats?: ReactivesearchResultProps[\"resultStats\"];\n setResultStats: React.Dispatch<\n React.SetStateAction<\n ReactivesearchResultProps[\"resultStats\"] | undefined\n >\n >;\n };\n }\n | undefined\n>(undefined);\n\nexport const useReactifySearchContext = () =>\n React.useContext(ReactifySearchContext)!;\n"]}
|
package/dist/src/index.js
CHANGED
|
@@ -27,9 +27,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
28
|
const Sentry = __importStar(require("@sentry/react"));
|
|
29
29
|
const tracing_1 = require("@sentry/tracing");
|
|
30
|
+
// @ts-expect-error missing types
|
|
31
|
+
const GaGtag = __importStar(require("ga-gtag"));
|
|
30
32
|
const utility_1 = require("./utility");
|
|
31
33
|
const package_json_1 = __importDefault(require("../package.json"));
|
|
32
34
|
utility_1.debug.log("package", `${package_json_1.default.name} v${package_json_1.default.version}`);
|
|
35
|
+
GaGtag.install("G-DV00Z0X5VP");
|
|
33
36
|
Sentry.init({
|
|
34
37
|
dsn: "https://f591e13196ad4d6bbcd8abbeb2e023db@o1280055.ingest.sentry.io/6482743",
|
|
35
38
|
integrations: [new tracing_1.BrowserTracing()],
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAwC;AACxC,6CAAiD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAwC;AACxC,6CAAiD;AACjD,iCAAiC;AACjC,gDAAkC;AAElC,uCAAkC;AAClC,mEAAkC;AAElC,eAAK,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,sBAAG,CAAC,IAAI,KAAK,sBAAG,CAAC,OAAO,EAAE,CAAC,CAAC;AAEpD,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;AAE/B,MAAM,CAAC,IAAI,CAAC;IACV,GAAG,EAAE,4EAA4E;IACjF,YAAY,EAAE,CAAC,IAAI,wBAAc,EAAE,CAAC;IACpC,gBAAgB,EAAE,GAAG;IACrB,OAAO,EAAE,sBAAG,CAAC,OAAO;IACpB,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;;QACpB,eAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACxC,kDAAkD;QAClD,MAAM,SAAS,GAAG,MAAA,MAAA,KAAK,CAAC,SAAS,0CAAE,MAAM,0CAAG,CAAC,CAAC,CAAC;QAC/C,KAAK,MAAM,KAAK,IAAI,MAAA,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,UAAU,0CAAE,MAAM,mCAAI,EAAE,EAAE;YACvD,IAAI,KAAK,CAAC,QAAQ,EAAE;gBAClB,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CACrC,kCAAkC,EAClC,GAAG,CACJ,CAAC;aACH;SACF;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IACD,gBAAgB,EAAE,CAAC,UAAU,EAAE,EAAE;;QAC/B,IAAI,MAAA,UAAU,CAAC,QAAQ,0CAAE,QAAQ,CAAC,iBAAiB,CAAC,EAAE;YACpD,eAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;SAC/C;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAC,CAAC;AAEH,+CAA6B;AAC7B,0CAAwB;AACxB,0CAAwB;AACxB,mDAAiC","sourcesContent":["import * as Sentry from \"@sentry/react\";\nimport { BrowserTracing } from \"@sentry/tracing\";\n// @ts-expect-error missing types\nimport * as GaGtag from \"ga-gtag\";\n\nimport { debug } from \"./utility\";\nimport pkg from \"../package.json\";\n\ndebug.log(\"package\", `${pkg.name} v${pkg.version}`);\n\nGaGtag.install(\"G-DV00Z0X5VP\");\n\nSentry.init({\n dsn: \"https://f591e13196ad4d6bbcd8abbeb2e023db@o1280055.ingest.sentry.io/6482743\",\n integrations: [new BrowserTracing()],\n tracesSampleRate: 1.0,\n release: pkg.version,\n beforeSend: (event) => {\n debug.log(\"sentry\", event.level, event);\n // rename stacktrace frames to point to sourcemaps\n const exception = event.exception?.values?.[0];\n for (const frame of exception?.stacktrace?.frames ?? []) {\n if (frame.filename) {\n frame.filename = frame.filename.replace(\n /^(.*?)@usereactify\\/search\\/dist/,\n \"~\"\n );\n }\n }\n\n return event;\n },\n beforeBreadcrumb: (breadcrumb) => {\n if (breadcrumb.category?.includes(\"reactify-search\")) {\n debug.log(\"sentry\", \"breadcrumb\", breadcrumb);\n }\n\n return breadcrumb;\n },\n});\n\nexport * from \"./components\";\nexport * from \"./hooks\";\nexport * from \"./types\";\nexport * from \"./utility/liquid\";\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.
|
|
4
|
+
"version": "5.16.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"types": "dist/src/index.d.ts",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"axios": "0.26.1",
|
|
36
36
|
"currency.js": "2.0.4",
|
|
37
37
|
"debug": "4.3.2",
|
|
38
|
+
"ga-gtag": "1.1.5",
|
|
38
39
|
"react-intersection-observer": "9.1.0",
|
|
39
40
|
"react-slider": "2.0.4"
|
|
40
41
|
},
|