@envive-ai/react-hooks 0.3.48 → 0.3.50
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/dist/application/utils/elementObserver.d.cts +2 -2
- package/dist/atoms/app/index.d.cts +7 -7
- package/dist/atoms/app/index.d.ts +7 -7
- package/dist/atoms/app/variant.d.ts +6 -6
- package/dist/atoms/chat/chatState.d.cts +19 -19
- package/dist/atoms/chat/chatState.d.ts +19 -19
- package/dist/atoms/chat/form.d.cts +2 -2
- package/dist/atoms/chat/form.d.ts +3 -3
- package/dist/atoms/chat/index.cjs +1 -1
- package/dist/atoms/chat/index.d.cts +2 -2
- package/dist/atoms/chat/index.d.ts +2 -2
- package/dist/atoms/chat/index.js +1 -1
- package/dist/atoms/chat/lastMessage.d.cts +2 -2
- package/dist/atoms/chat/lastMessage.d.ts +2 -2
- package/dist/atoms/chat/messageQueue.d.cts +6 -6
- package/dist/atoms/chat/messageQueue.d.ts +7 -7
- package/dist/atoms/chat/performanceMetrics.d.cts +6 -6
- package/dist/atoms/chat/performanceMetrics.d.ts +6 -6
- package/dist/atoms/chat/renderedWidgetRefs.d.cts +2 -2
- package/dist/atoms/chat/renderedWidgetRefs.d.ts +3 -3
- package/dist/atoms/chat/replies.d.cts +3 -3
- package/dist/atoms/chat/replies.d.ts +3 -3
- package/dist/atoms/chat/suggestions.d.cts +2 -2
- package/dist/atoms/chat/suggestions.d.ts +3 -3
- package/dist/atoms/envive/enviveConfig.d.cts +14 -14
- package/dist/atoms/globalSearch/globalSearch.d.cts +5 -5
- package/dist/atoms/globalSearch/globalSearch.d.ts +5 -5
- package/dist/atoms/org/customerService.d.cts +6 -6
- package/dist/atoms/org/customerService.d.ts +6 -6
- package/dist/atoms/org/graphqlConfig.d.cts +4 -4
- package/dist/atoms/org/graphqlConfig.d.ts +4 -4
- package/dist/atoms/org/index.cjs +1 -1
- package/dist/atoms/org/index.js +1 -1
- package/dist/atoms/org/newOrgConfigAtom.d.cts +2 -2
- package/dist/atoms/org/newOrgConfigAtom.d.ts +2 -2
- package/dist/atoms/org/orgAnalyticsConfig.d.cts +4 -4
- package/dist/atoms/org/orgAnalyticsConfig.d.ts +4 -4
- package/dist/atoms/search/chatSearch.cjs +1 -1
- package/dist/atoms/search/chatSearch.d.ts +17 -17
- package/dist/atoms/search/chatSearch.js +1 -1
- package/dist/atoms/search/searchAPI.cjs +1 -1
- package/dist/atoms/search/searchAPI.d.cts +13 -13
- package/dist/atoms/search/searchAPI.d.ts +13 -13
- package/dist/atoms/search/searchAPI.js +1 -1
- package/dist/atoms/search/types.d.ts +1 -1
- package/dist/atoms/widget/chatPreviewLoading.d.ts +2 -2
- package/dist/contexts/salesAgentContext/chatAPI.cjs +2 -2
- package/dist/contexts/salesAgentContext/chatAPI.js +2 -2
- package/dist/contexts/salesAgentContext/salesAgentService.cjs +1 -1
- package/dist/contexts/salesAgentContext/salesAgentService.js +1 -1
- package/dist/contexts/searchContext/searchContext.cjs +1 -1
- package/dist/contexts/searchContext/searchContext.js +1 -1
- package/dist/contexts/types.d.cts +1 -1
- package/dist/contexts/types.d.ts +1 -1
- package/dist/contexts/typesV3.d.cts +1 -1
- package/dist/hooks/ChatToggle/useChatToggle.cjs +1 -1
- package/dist/hooks/ChatToggle/useChatToggle.js +1 -1
- package/dist/hooks/GrabAndScroll/useGrabAndScroll.d.cts +2 -2
- package/dist/hooks/Search/useSearch.cjs +13 -5
- package/dist/hooks/Search/useSearch.js +13 -5
- package/dist/hooks/WidgetInteraction/types.cjs +1 -1
- package/dist/hooks/WidgetInteraction/types.d.cts +8 -4
- package/dist/hooks/WidgetInteraction/types.d.ts +8 -4
- package/dist/hooks/WidgetInteraction/types.js +1 -1
- package/dist/hooks/utils.d.cts +1 -1
- package/dist/hooks/utils.d.ts +1 -1
- package/dist/services/amplitudeService/eventNames.cjs +1 -2
- package/dist/services/amplitudeService/eventNames.d.cts +1 -2
- package/dist/services/amplitudeService/eventNames.d.ts +1 -2
- package/dist/services/amplitudeService/eventNames.js +1 -2
- package/package.json +2 -2
- package/src/hooks/Search/useSearch.tsx +7 -1
- package/src/hooks/WidgetInteraction/types.ts +8 -2
- package/src/services/amplitudeService/eventNames.ts +0 -1
|
@@ -93,6 +93,7 @@ export const useSearch = ({
|
|
|
93
93
|
const { data: searchData, loading: isLoadingSearch } = useAtomValue(searchAtom);
|
|
94
94
|
const productList = useAtomValue(filteredSearchProductsAtom);
|
|
95
95
|
const performSearch = useSetAtom(performSearchAtom);
|
|
96
|
+
const setSearchParams = useSetAtom(searchParamsAtom);
|
|
96
97
|
const [{ query }] = useAtom(searchParamsAtom);
|
|
97
98
|
const [isFilterOpen, setIsFilterOpen] = useAtom(isFilterOpenAtom);
|
|
98
99
|
const [selectedFilterOptions] = useAtom(searchSelectedFiltersAtom);
|
|
@@ -138,8 +139,13 @@ export const useSearch = ({
|
|
|
138
139
|
handleAutocompleteSelect,
|
|
139
140
|
handleSubmitSearch,
|
|
140
141
|
setSearchText,
|
|
141
|
-
resetSearch,
|
|
142
|
+
resetSearch: resetSearchInput,
|
|
142
143
|
} = searchInput;
|
|
144
|
+
|
|
145
|
+
const resetSearch = useCallback(() => {
|
|
146
|
+
resetSearchInput();
|
|
147
|
+
setSearchParams({ id: null, query: null });
|
|
148
|
+
}, [resetSearchInput, setSearchParams]);
|
|
143
149
|
const searchResultsState = getSearchResultsState(isLoadingSearch, searchData);
|
|
144
150
|
|
|
145
151
|
const dynamicFilters = searchData?.filters || [];
|
|
@@ -115,6 +115,12 @@ export type Product = {
|
|
|
115
115
|
product_id: string;
|
|
116
116
|
};
|
|
117
117
|
|
|
118
|
+
export type WidgetLocation = 'chat' | 'overlay' | 'variant_selector';
|
|
119
|
+
|
|
120
|
+
export type ProductWithLocation = Product & {
|
|
121
|
+
widget_location: WidgetLocation;
|
|
122
|
+
};
|
|
123
|
+
|
|
118
124
|
export type Review = {
|
|
119
125
|
review_id: string;
|
|
120
126
|
};
|
|
@@ -164,11 +170,11 @@ export type ProductCardClicked = {
|
|
|
164
170
|
};
|
|
165
171
|
|
|
166
172
|
export type AddToCartClicked = {
|
|
167
|
-
add_to_cart_clicked:
|
|
173
|
+
add_to_cart_clicked: ProductWithLocation;
|
|
168
174
|
};
|
|
169
175
|
|
|
170
176
|
export type AddToCartFailed = {
|
|
171
|
-
add_to_cart_failed:
|
|
177
|
+
add_to_cart_failed: ProductWithLocation;
|
|
172
178
|
};
|
|
173
179
|
|
|
174
180
|
export type ReviewCardClicked = {
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
|
|
10
10
|
export enum SpiffyMetricsEventName {
|
|
11
11
|
BundleLoaded = 'Bundle Loaded',
|
|
12
|
-
EnvironmentInitialized = 'Environment Initialized',
|
|
13
12
|
ChatLiveAgentBtnClick = 'Chat Live Agent Btn Click',
|
|
14
13
|
ChatFloatingButtonVisible = 'Chat Floating Button Visible',
|
|
15
14
|
ChatComponentVisible = 'Chat Component Visible',
|