@envive-ai/react-hooks 0.3.49 → 0.3.51
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/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 +2 -2
- package/dist/atoms/chat/index.d.cts +2 -2
- package/dist/atoms/chat/index.d.ts +2 -2
- 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 +6 -6
- 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 +2 -2
- package/dist/atoms/chat/suggestions.d.cts +2 -2
- package/dist/atoms/chat/suggestions.d.ts +2 -2
- package/dist/atoms/envive/enviveConfig.d.cts +14 -14
- package/dist/atoms/envive/enviveConfig.d.ts +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 +7 -7
- package/dist/atoms/org/graphqlConfig.d.cts +4 -4
- package/dist/atoms/org/graphqlConfig.d.ts +4 -4
- package/dist/atoms/org/newOrgConfigAtom.d.cts +2 -2
- package/dist/atoms/org/newOrgConfigAtom.d.ts +3 -3
- package/dist/atoms/org/orgAnalyticsConfig.d.cts +4 -4
- package/dist/atoms/org/orgAnalyticsConfig.d.ts +5 -5
- package/dist/atoms/search/chatSearch.d.cts +17 -17
- package/dist/atoms/search/chatSearch.d.ts +17 -17
- package/dist/atoms/search/searchAPI.d.cts +13 -13
- package/dist/atoms/search/searchAPI.d.ts +13 -13
- package/dist/atoms/search/types.d.cts +1 -1
- package/dist/atoms/search/utils.d.cts +1 -1
- package/dist/atoms/widget/chatPreviewLoading.d.cts +2 -2
- package/dist/atoms/widget/chatPreviewLoading.d.ts +2 -2
- package/dist/contexts/types.d.cts +1 -1
- package/dist/contexts/types.d.ts +1 -1
- package/dist/contexts/typesV3.cjs +9 -1
- package/dist/contexts/typesV3.d.cts +9 -2
- package/dist/contexts/typesV3.d.ts +9 -2
- package/dist/contexts/typesV3.js +9 -2
- package/dist/hooks/Search/useSearch.cjs +10 -2
- package/dist/hooks/Search/useSearch.js +10 -2
- package/dist/hooks/Search/useSearchInput.cjs +1 -1
- package/dist/hooks/Search/useSearchInput.js +1 -1
- package/dist/hooks/WidgetInteraction/types.cjs +2 -1
- package/dist/hooks/WidgetInteraction/types.d.cts +9 -4
- package/dist/hooks/WidgetInteraction/types.d.ts +9 -4
- package/dist/hooks/WidgetInteraction/types.js +2 -1
- package/dist/hooks/utils.d.cts +1 -1
- package/package.json +1 -1
- package/src/contexts/typesV3.ts +8 -0
- package/src/hooks/Search/useSearch.tsx +7 -1
- package/src/hooks/WidgetInteraction/types.ts +13 -2
package/dist/hooks/utils.d.cts
CHANGED
|
@@ -19,4 +19,4 @@ declare enum SearchResultsState {
|
|
|
19
19
|
declare const getSearchResultsState: (isLoadingSearch: boolean, searchData: SearchResult | null) => SearchResultsState;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { SearchResultsState, createAppLoadedEvent, createVisitUserEvent, getSearchResultsState, isElementPartiallyVisible, isWithinBusinessHours };
|
|
22
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
22
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC5jdHMiLCJuYW1lcyI6W10sInNvdXJj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cHBpbmdzIjoiOzs7OztBQUVBLElBQVcsNEJBQTRCLENBQUMsU0FBUyxlQUFlO0FBQ2hFLElBQVcsdUJBQXVCLENBQUMsU0FBUyxVQUFVO0FBQ3RELElBQVcsdUJBQXVCO0NBQUM7T0FBUztPQUFrQjtPQUFBO0NBQUE7QUFDOUQsSUFBVyx3QkFBaUIsQ0FBQSxFQUFBO0FBQzVCLElBQVcscUJBQWdCLENBQUEsRUFBQTtBQUMzQixJQUFXLHdCQUF3QjtDQUFDO09BQVM7T0FBb0I7Q0FBbUIifQ==
|
package/package.json
CHANGED
package/src/contexts/typesV3.ts
CHANGED
|
@@ -389,6 +389,13 @@ interface ProductCardWidgetV3Config extends BaseWidgetConfig<WidgetTypeV3.Produc
|
|
|
389
389
|
mode?: Mode;
|
|
390
390
|
}
|
|
391
391
|
|
|
392
|
+
export enum ProductCarouselLayoutV3 {
|
|
393
|
+
HORIZONTAL = 'horizontal',
|
|
394
|
+
GRID = 'grid',
|
|
395
|
+
/** Grid on mobile, horizontal carousel on desktop. */
|
|
396
|
+
GRID_MOBILE_HORIZONTAL_DESKTOP = 'grid-mobile-horizontal-desktop',
|
|
397
|
+
}
|
|
398
|
+
|
|
392
399
|
interface FullPageSalesAgentWidgetV3Config extends BaseWidgetConfig<WidgetTypeV3.FullPageSalesAgentV3> {
|
|
393
400
|
headerContainer?: string;
|
|
394
401
|
autoHeight?: boolean;
|
|
@@ -399,6 +406,7 @@ interface FullPageSalesAgentWidgetV3Config extends BaseWidgetConfig<WidgetTypeV3
|
|
|
399
406
|
backgroundColor?: string;
|
|
400
407
|
chatBackgroundColor?: string;
|
|
401
408
|
suggestionButtonType?: PromptButtonVariant;
|
|
409
|
+
productCarouselLayout?: ProductCarouselLayoutV3;
|
|
402
410
|
}
|
|
403
411
|
|
|
404
412
|
type WidgetConfigV3 =
|
|
@@ -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 || [];
|
|
@@ -42,6 +42,11 @@ export enum WidgetInteractionComponent {
|
|
|
42
42
|
// Storefront. Distinct from FULL_PAGE_SALES_AGENT (in-chat product cards) so analytics can
|
|
43
43
|
// separate the static suggestion surface from the conversational recommender.
|
|
44
44
|
FULL_PAGE_SALES_AGENT_RECOMMENDATIONS = 'full_page_sales_agent_recommendations',
|
|
45
|
+
// A click on the Add to Cart button of a FULL_PAGE_SALES_AGENT_RECOMMENDATIONS card that
|
|
46
|
+
// falls back to the PDP because no merchant Add to Cart integration is available. Still
|
|
47
|
+
// fires as a PRODUCT_CARD_CLICKED event, but tagged distinctly from a direct card-body
|
|
48
|
+
// click so analytics can tell the two apart.
|
|
49
|
+
FULL_PAGE_SALES_AGENT_RECOMMENDATIONS_ATC_FALLBACK = 'full_page_sales_agent_recommendations_atc_fallback',
|
|
45
50
|
SOCIAL_PROOF = 'social_proof',
|
|
46
51
|
CHAT_PREVIEW = 'chat_preview',
|
|
47
52
|
FLOATING_CHAT = 'floating_chat',
|
|
@@ -115,6 +120,12 @@ export type Product = {
|
|
|
115
120
|
product_id: string;
|
|
116
121
|
};
|
|
117
122
|
|
|
123
|
+
export type WidgetLocation = 'chat' | 'overlay' | 'variant_selector';
|
|
124
|
+
|
|
125
|
+
export type ProductWithLocation = Product & {
|
|
126
|
+
widget_location: WidgetLocation;
|
|
127
|
+
};
|
|
128
|
+
|
|
118
129
|
export type Review = {
|
|
119
130
|
review_id: string;
|
|
120
131
|
};
|
|
@@ -164,11 +175,11 @@ export type ProductCardClicked = {
|
|
|
164
175
|
};
|
|
165
176
|
|
|
166
177
|
export type AddToCartClicked = {
|
|
167
|
-
add_to_cart_clicked:
|
|
178
|
+
add_to_cart_clicked: ProductWithLocation;
|
|
168
179
|
};
|
|
169
180
|
|
|
170
181
|
export type AddToCartFailed = {
|
|
171
|
-
add_to_cart_failed:
|
|
182
|
+
add_to_cart_failed: ProductWithLocation;
|
|
172
183
|
};
|
|
173
184
|
|
|
174
185
|
export type ReviewCardClicked = {
|