@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.
Files changed (74) hide show
  1. package/dist/application/utils/elementObserver.d.cts +2 -2
  2. package/dist/atoms/app/index.d.cts +7 -7
  3. package/dist/atoms/app/index.d.ts +7 -7
  4. package/dist/atoms/app/variant.d.ts +6 -6
  5. package/dist/atoms/chat/chatState.d.cts +19 -19
  6. package/dist/atoms/chat/chatState.d.ts +19 -19
  7. package/dist/atoms/chat/form.d.cts +2 -2
  8. package/dist/atoms/chat/form.d.ts +3 -3
  9. package/dist/atoms/chat/index.cjs +1 -1
  10. package/dist/atoms/chat/index.d.cts +2 -2
  11. package/dist/atoms/chat/index.d.ts +2 -2
  12. package/dist/atoms/chat/index.js +1 -1
  13. package/dist/atoms/chat/lastMessage.d.cts +2 -2
  14. package/dist/atoms/chat/lastMessage.d.ts +2 -2
  15. package/dist/atoms/chat/messageQueue.d.cts +6 -6
  16. package/dist/atoms/chat/messageQueue.d.ts +7 -7
  17. package/dist/atoms/chat/performanceMetrics.d.cts +6 -6
  18. package/dist/atoms/chat/performanceMetrics.d.ts +6 -6
  19. package/dist/atoms/chat/renderedWidgetRefs.d.cts +2 -2
  20. package/dist/atoms/chat/renderedWidgetRefs.d.ts +3 -3
  21. package/dist/atoms/chat/replies.d.cts +3 -3
  22. package/dist/atoms/chat/replies.d.ts +3 -3
  23. package/dist/atoms/chat/suggestions.d.cts +2 -2
  24. package/dist/atoms/chat/suggestions.d.ts +3 -3
  25. package/dist/atoms/envive/enviveConfig.d.cts +14 -14
  26. package/dist/atoms/globalSearch/globalSearch.d.cts +5 -5
  27. package/dist/atoms/globalSearch/globalSearch.d.ts +5 -5
  28. package/dist/atoms/org/customerService.d.cts +6 -6
  29. package/dist/atoms/org/customerService.d.ts +6 -6
  30. package/dist/atoms/org/graphqlConfig.d.cts +4 -4
  31. package/dist/atoms/org/graphqlConfig.d.ts +4 -4
  32. package/dist/atoms/org/index.cjs +1 -1
  33. package/dist/atoms/org/index.js +1 -1
  34. package/dist/atoms/org/newOrgConfigAtom.d.cts +2 -2
  35. package/dist/atoms/org/newOrgConfigAtom.d.ts +2 -2
  36. package/dist/atoms/org/orgAnalyticsConfig.d.cts +4 -4
  37. package/dist/atoms/org/orgAnalyticsConfig.d.ts +4 -4
  38. package/dist/atoms/search/chatSearch.cjs +1 -1
  39. package/dist/atoms/search/chatSearch.d.ts +17 -17
  40. package/dist/atoms/search/chatSearch.js +1 -1
  41. package/dist/atoms/search/searchAPI.cjs +1 -1
  42. package/dist/atoms/search/searchAPI.d.cts +13 -13
  43. package/dist/atoms/search/searchAPI.d.ts +13 -13
  44. package/dist/atoms/search/searchAPI.js +1 -1
  45. package/dist/atoms/search/types.d.ts +1 -1
  46. package/dist/atoms/widget/chatPreviewLoading.d.ts +2 -2
  47. package/dist/contexts/salesAgentContext/chatAPI.cjs +2 -2
  48. package/dist/contexts/salesAgentContext/chatAPI.js +2 -2
  49. package/dist/contexts/salesAgentContext/salesAgentService.cjs +1 -1
  50. package/dist/contexts/salesAgentContext/salesAgentService.js +1 -1
  51. package/dist/contexts/searchContext/searchContext.cjs +1 -1
  52. package/dist/contexts/searchContext/searchContext.js +1 -1
  53. package/dist/contexts/types.d.cts +1 -1
  54. package/dist/contexts/types.d.ts +1 -1
  55. package/dist/contexts/typesV3.d.cts +1 -1
  56. package/dist/hooks/ChatToggle/useChatToggle.cjs +1 -1
  57. package/dist/hooks/ChatToggle/useChatToggle.js +1 -1
  58. package/dist/hooks/GrabAndScroll/useGrabAndScroll.d.cts +2 -2
  59. package/dist/hooks/Search/useSearch.cjs +13 -5
  60. package/dist/hooks/Search/useSearch.js +13 -5
  61. package/dist/hooks/WidgetInteraction/types.cjs +1 -1
  62. package/dist/hooks/WidgetInteraction/types.d.cts +8 -4
  63. package/dist/hooks/WidgetInteraction/types.d.ts +8 -4
  64. package/dist/hooks/WidgetInteraction/types.js +1 -1
  65. package/dist/hooks/utils.d.cts +1 -1
  66. package/dist/hooks/utils.d.ts +1 -1
  67. package/dist/services/amplitudeService/eventNames.cjs +1 -2
  68. package/dist/services/amplitudeService/eventNames.d.cts +1 -2
  69. package/dist/services/amplitudeService/eventNames.d.ts +1 -2
  70. package/dist/services/amplitudeService/eventNames.js +1 -2
  71. package/package.json +2 -2
  72. package/src/hooks/Search/useSearch.tsx +7 -1
  73. package/src/hooks/WidgetInteraction/types.ts +8 -2
  74. 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: Product;
173
+ add_to_cart_clicked: ProductWithLocation;
168
174
  };
169
175
 
170
176
  export type AddToCartFailed = {
171
- add_to_cart_failed: Product;
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',