@envive-ai/react-widgets-v3 0.3.10 → 0.3.12
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/CXIntegration/hooks/useUnifiedCXButton.cjs +2 -1
- package/dist/CXIntegration/hooks/useUnifiedCXButton.js +2 -1
- package/dist/CXIntegration/implementations/useGladlyUnifiedCXButton.cjs +6 -0
- package/dist/CXIntegration/implementations/useGladlyUnifiedCXButton.js +6 -0
- package/dist/CXIntegration/implementations/useGorgiasUnifiedCXButton.cjs +7 -6
- package/dist/CXIntegration/implementations/useGorgiasUnifiedCXButton.js +7 -6
- package/dist/CXIntegration/implementations/useGrooveUnifiedCXButton.cjs +10 -11
- package/dist/CXIntegration/implementations/useGrooveUnifiedCXButton.js +10 -11
- package/dist/CXIntegration/implementations/useKustomerUnifiedCXButton.cjs +10 -7
- package/dist/CXIntegration/implementations/useKustomerUnifiedCXButton.js +10 -7
- package/dist/CXIntegration/implementations/useReDoUnifiedCXButton.cjs +2 -2
- package/dist/CXIntegration/implementations/useReDoUnifiedCXButton.js +2 -2
- package/dist/CXIntegration/implementations/useRichpanelUnifiedCXButton.cjs +9 -7
- package/dist/CXIntegration/implementations/useRichpanelUnifiedCXButton.js +9 -7
- package/dist/CXIntegration/implementations/useShopifyChatUnifiedCXButton.cjs +13 -16
- package/dist/CXIntegration/implementations/useShopifyChatUnifiedCXButton.js +13 -16
- package/dist/CXIntegration/implementations/useTidioUnifiedCXButton.cjs +6 -0
- package/dist/CXIntegration/implementations/useTidioUnifiedCXButton.js +6 -0
- package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.cjs +7 -5
- package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.js +7 -5
- package/dist/CXIntegration/implementations/useZowieUnifiedCXButton.cjs +6 -0
- package/dist/CXIntegration/implementations/useZowieUnifiedCXButton.js +6 -0
- package/dist/_virtual/rolldown_runtime.cjs +2 -0
- package/dist/debug/GenericSelect.cjs +167 -0
- package/dist/debug/GenericSelect.js +165 -0
- package/dist/debug/MessageContent.cjs +151 -0
- package/dist/debug/MessageContent.js +149 -0
- package/dist/debug/chatEmbed.cjs +95 -0
- package/dist/debug/chatEmbed.js +92 -0
- package/dist/debug/debugBar.cjs +17 -0
- package/dist/debug/debugBar.js +16 -0
- package/dist/debug/reportIssue.cjs +528 -0
- package/dist/debug/reportIssue.js +524 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/CustomerServiceApi.cjs +265 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/DefaultApi.cjs +591 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/InferenceApi.cjs +265 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/ProductsApi.cjs +105 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/SearchApi.cjs +229 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/index.cjs +43 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/index.cjs +39 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AddNoteToLatestConversationRequest.cjs +68 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AddNoteToLatestConversationResponse.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AddToCartAttributes.cjs +53 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AnalyticsIdentifyRequest.cjs +86 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AnalyticsTrackEventRequest.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AttachmentRequest.cjs +63 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AutoForm.cjs +55 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/Context.cjs +89 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ConversationStatus.cjs +63 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CreateConversationRequest.cjs +68 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CreateConversationResponse.cjs +64 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceAttachment.cjs +68 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceConversation.cjs +69 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceConversationMessages.cjs +67 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceCustomer.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceMessage.cjs +85 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustomerServiceProvider.cjs +63 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FormResponseAttributes.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FormResponseAttributesFormCategory.cjs +55 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FormSubmittedAttributes.cjs +65 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FormType.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FulfillmentDisplayStatus.cjs +84 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/GenerationParams.cjs +74 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/GetConversationMessagesRequest.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/IsBusinessHoursRequest.cjs +54 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/IsBusinessHoursResponse.cjs +59 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/LabelValue.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ManualForm.cjs +55 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRule.cjs +70 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleAction.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleActionAttribute.cjs +58 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleActionType.cjs +64 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleCondition.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleOp.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleStatus.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/NextMessageRequest.cjs +78 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrderItemInfo.cjs +78 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrderResponseAttributes.cjs +71 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/Organization.cjs +83 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrganizationConfig.cjs +82 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrganizationConfigResults.cjs +70 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrganizationSettings.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PDPAttributes.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPAttributeCategory.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPAttributes.cjs +64 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPAttributesAttributes.cjs +55 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPIdAttributes.cjs +53 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPUrlAttributes.cjs +53 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PageVisitAttributes.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PageVisitCategory.cjs +65 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductRetrievalRequest.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductRetrievalResponse.cjs +55 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchFilterResponseAttributes.cjs +53 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchRequest.cjs +71 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchResponse.cjs +64 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchResponseAttributes.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchResponseV2.cjs +64 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/QueryTypedAttributes.cjs +53 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ReportContent.cjs +59 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ReportSessionRequest.cjs +99 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/Response.cjs +68 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ResponseCategory.cjs +69 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ResponseProductAttributes.cjs +91 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SearchAttributes.cjs +65 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SearchResponseProduct.cjs +93 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SearchSuggestionsResponse.cjs +58 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SendMessageRequest.cjs +71 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SendMessageResponse.cjs +55 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/StatsigExperiment.cjs +64 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/StatsigFeatureGate.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/Suggestion.cjs +70 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SuggestionCategory.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SuggestionClickedAttributes.cjs +53 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SupportedEventProductCategory.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SupportedEventRequest.cjs +67 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SupportedEventResponse.cjs +78 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/TurnInfo.cjs +70 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/TurnInfoPrevUserEvent.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingGenericConfig.cjs +52 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingPDPConfig.cjs +65 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingPLPConfig.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingRequest.cjs +69 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingResponse.cjs +73 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingResponseSpecificDetails.cjs +59 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingType.cjs +67 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UserEvent.cjs +69 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UserEventAttributes.cjs +75 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UserEventCategory.cjs +70 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/V1GetSessionMessages200Response.cjs +67 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/V1SearchExplainGet200Response.cjs +63 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/WidgetString.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/WidgetTextRequest.cjs +75 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/WidgetTextResponse.cjs +66 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/WidgetType.cjs +69 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/index.cjs +221 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/runtime.cjs +324 -0
- package/dist/node_modules/react-icons/fa/index.cjs +65 -0
- package/dist/node_modules/react-icons/fa/index.js +61 -0
- package/dist/node_modules/react-icons/lib/iconBase.cjs +121 -0
- package/dist/node_modules/react-icons/lib/iconBase.js +119 -0
- package/dist/node_modules/react-icons/lib/iconContext.cjs +17 -0
- package/dist/node_modules/react-icons/lib/iconContext.js +14 -0
- package/dist/packages/icons/dist/IconCloseVariant.cjs +22 -0
- package/dist/packages/icons/dist/IconCloseVariant.js +22 -0
- package/dist/packages/icons/dist/_virtual/rolldown_runtime.cjs +27 -0
- package/dist/packages/icons/dist/_virtual/rolldown_runtime.js +25 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs +696 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.js +696 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.cjs +43 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js +43 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.development.cjs +1528 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.development.js +1528 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.cjs +329 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.js +329 -0
- package/dist/packages/icons/dist/node_modules/react/index.cjs +13 -0
- package/dist/packages/icons/dist/node_modules/react/index.js +13 -0
- package/dist/packages/icons/dist/node_modules/react/jsx-runtime.cjs +13 -0
- package/dist/packages/icons/dist/node_modules/react/jsx-runtime.js +13 -0
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +3 -3
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.cjs +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.js +1 -1
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +66 -36
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +67 -37
- package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.cjs +50 -0
- package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.js +49 -0
- package/dist/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.cjs +4 -1
- package/dist/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.js +5 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.cjs +31 -0
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +15 -0
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +15 -0
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.js +30 -0
- package/dist/widgets/FullPageSalesAgentWidget/index.cjs +3 -0
- package/dist/widgets/FullPageSalesAgentWidget/index.d.cts +2 -0
- package/dist/widgets/FullPageSalesAgentWidget/index.d.ts +2 -0
- package/dist/widgets/FullPageSalesAgentWidget/index.js +3 -0
- package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +3 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.js +3 -2
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +4 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +4 -3
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +29 -5
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +30 -6
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
- package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +8 -6
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.js +8 -6
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +4 -3
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +4 -3
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +3 -2
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +3 -2
- package/dist/widgets/utils/functions.cjs +1 -1
- package/dist/widgets/utils/functions.js +1 -1
- package/dist/widgets-v2/SearchResults/index.d.ts +3 -3
- package/dist/widgets-v2/SearchZeroState/index.d.ts +4 -4
- package/dist/widgets-v2/SuggestionBar/index.d.ts +3 -3
- package/dist/widgets-v2/SuggestionButtonContainer/index.d.ts +2 -2
- package/package.json +5 -1
- package/src/CXIntegration/hooks/useUnifiedCXButton.ts +4 -1
- package/src/CXIntegration/implementations/useGladlyUnifiedCXButton.ts +5 -0
- package/src/CXIntegration/implementations/useGorgiasUnifiedCXButton.ts +11 -8
- package/src/CXIntegration/implementations/useGrooveUnifiedCXButton.ts +12 -15
- package/src/CXIntegration/implementations/useKustomerUnifiedCXButton.ts +11 -11
- package/src/CXIntegration/implementations/useReDoUnifiedCXButton.ts +2 -4
- package/src/CXIntegration/implementations/useRichpanelUnifiedCXButton.ts +9 -10
- package/src/CXIntegration/implementations/useShopifyChatUnifiedCXButton.ts +18 -28
- package/src/CXIntegration/implementations/useTidioUnifiedCXButton.ts +5 -0
- package/src/CXIntegration/implementations/useZendeskUnifiedCXButton.ts +11 -6
- package/src/CXIntegration/implementations/useZowieUnifiedCXButton.ts +5 -0
- package/src/CXIntegration/types.ts +1 -0
- package/src/debug/GenericSelect.tsx +236 -0
- package/src/debug/MessageContent.tsx +248 -0
- package/src/debug/chatEmbed.tsx +119 -0
- package/src/debug/debugBar.tsx +12 -0
- package/src/debug/reportIssue.tsx +649 -0
- package/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.tsx +6 -0
- package/src/stories/FullPageSalesAgentWidget.stories.tsx +68 -0
- package/src/stories/SalesAgentTest/SalesAgentTest.tsx +10 -2
- package/src/widgets/FloatingChatWidget/FloatingChatWidget.tsx +110 -65
- package/src/widgets/FloatingChatWidget/hooks/useAutoPopup.ts +65 -0
- package/src/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.ts +11 -5
- package/src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.tsx +46 -0
- package/src/widgets/FullPageSalesAgentWidget/index.ts +1 -0
- package/src/widgets/ProductCardWidget/ProductCardWidget.tsx +5 -1
- package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +6 -1
- package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +32 -3
- package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +10 -2
- package/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx +6 -2
- package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +5 -1
- /package/dist/{widgets → packages/widgets}/dist/SearchResults/SearchResults.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchResults/SearchResultsWidget.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchResults/index.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchResults/types.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchZeroState/SearchZeroState.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchZeroState/SearchZeroStateWidget.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchZeroState/index.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchZeroState/types.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SuggestionBar/SuggestionBar.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SuggestionBar/index.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SuggestionBar/types.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SuggestionButtonContainer/types.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/config/BaseWidgetConfig.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/config/WidgetType.d.ts +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PageVisitCategory,
|
|
3
|
+
useSalesAgent,
|
|
4
|
+
} from '@envive-ai/react-hooks/contexts/salesAgentContext';
|
|
5
|
+
import { UserEventCategory } from '@spiffy-ai/commerce-api-client';
|
|
6
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
7
|
+
import { useEffect } from 'react';
|
|
8
|
+
import { v4 as uuid } from 'uuid';
|
|
9
|
+
import { FullPageSalesAgentWidget } from '../widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget';
|
|
10
|
+
|
|
11
|
+
const meta = {
|
|
12
|
+
title: 'Widgets V3/FullPageSalesAgentWidget',
|
|
13
|
+
component: FullPageSalesAgentWidget,
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
args: {
|
|
16
|
+
widgetConfigId: 'full-page-sales-agent-widget',
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
widgetConfigId: {
|
|
20
|
+
control: 'text',
|
|
21
|
+
description:
|
|
22
|
+
'Unique identifier for the widget configuration. The widget will fetch the widget config and hardcopy content based on this ID.',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
parameters: {
|
|
26
|
+
docs: {
|
|
27
|
+
description: {
|
|
28
|
+
component:
|
|
29
|
+
'FullPageSalesAgentWidget is a widget wrapper around the FullPageSalesAgent component that includes base widget functionality such as visibility tracking, widget config fetching and hardcopy content fetching. The widget renders a full-page sales agent experience.',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
decorators: [
|
|
34
|
+
Story => {
|
|
35
|
+
const { logPageVisit, logUserEvent } = useSalesAgent();
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
logUserEvent({
|
|
39
|
+
eventId: uuid(),
|
|
40
|
+
category: UserEventCategory.AppLoaded,
|
|
41
|
+
createdAt: new Date().toISOString(),
|
|
42
|
+
});
|
|
43
|
+
logPageVisit({ pageVisitCategory: PageVisitCategory.Homepage });
|
|
44
|
+
}, []);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<div style={{ height: '100vh' }}>
|
|
48
|
+
<Story />
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
} satisfies Meta<typeof FullPageSalesAgentWidget>;
|
|
54
|
+
|
|
55
|
+
export default meta;
|
|
56
|
+
|
|
57
|
+
type Story = StoryObj<typeof meta>;
|
|
58
|
+
|
|
59
|
+
export const Playground: Story = {
|
|
60
|
+
parameters: {
|
|
61
|
+
docs: {
|
|
62
|
+
description: {
|
|
63
|
+
story:
|
|
64
|
+
'Experiment with different widgetConfigId values. The widget will fetch configuration from the widget config based on the widgetConfigId.',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
};
|
|
@@ -61,7 +61,11 @@ export const SalesAgentTest = () => {
|
|
|
61
61
|
onChange={e => setQuery(e.target.value)}
|
|
62
62
|
onKeyDown={e => {
|
|
63
63
|
if (e.key === 'Enter') {
|
|
64
|
-
onTypedMessageSubmitted({
|
|
64
|
+
onTypedMessageSubmitted({
|
|
65
|
+
query,
|
|
66
|
+
userTyped: true,
|
|
67
|
+
displayLocation: ChatElementDisplayLocationV3.FLOATING_CHAT_TEXT_INPUT,
|
|
68
|
+
});
|
|
65
69
|
setQuery('');
|
|
66
70
|
}
|
|
67
71
|
}}
|
|
@@ -70,7 +74,11 @@ export const SalesAgentTest = () => {
|
|
|
70
74
|
<button
|
|
71
75
|
type="button"
|
|
72
76
|
onClick={() => {
|
|
73
|
-
onTypedMessageSubmitted({
|
|
77
|
+
onTypedMessageSubmitted({
|
|
78
|
+
query,
|
|
79
|
+
userTyped: true,
|
|
80
|
+
displayLocation: ChatElementDisplayLocationV3.FLOATING_CHAT_TEXT_INPUT,
|
|
81
|
+
});
|
|
74
82
|
setQuery('');
|
|
75
83
|
}}
|
|
76
84
|
>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Suspense, lazy, useEffect, useMemo, useRef } from 'react';
|
|
1
|
+
import { ReactNode, Suspense, lazy, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
FloatingChatConfig,
|
|
4
4
|
LookAndFeelConfig,
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
} from '@envive-ai/react-toolkit-v3/FloatingButton';
|
|
21
21
|
import { useChatToggle } from '@envive-ai/react-hooks/hooks/ChatToggle';
|
|
22
22
|
import { ChatElementDisplayLocationV3 } from '@envive-ai/react-hooks/application/models';
|
|
23
|
+
import { DebugBar } from 'src/debug/debugBar';
|
|
23
24
|
import { BaseWidgetProps, withBaseWidget } from '../../hocs/withBaseWidget';
|
|
24
25
|
import { FloatingChatOverlay } from './FloatingChatOverlay';
|
|
25
26
|
import useGetWidgetStatus from '../hooks/useGetWidgetStatus';
|
|
@@ -27,11 +28,44 @@ import { useUnifiedCXButton } from '../../CXIntegration/hooks/useUnifiedCXButton
|
|
|
27
28
|
import { FLOATING_BUTTON_ID } from './constants';
|
|
28
29
|
import { CustomerServiceType } from '../../CXIntegration/types';
|
|
29
30
|
import { useFloatingButtonVisibility } from './hooks/useFloatingButtonVisibility';
|
|
31
|
+
import { useAutoPopup } from './hooks/useAutoPopup';
|
|
30
32
|
|
|
31
33
|
const FloatingChat = lazy(async () => ({
|
|
32
34
|
default: (await import('@envive-ai/react-toolkit-v3/FloatingChat')).FloatingChat,
|
|
33
35
|
}));
|
|
34
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Wrapper component that isolates the useUnifiedCXButton hook call.
|
|
39
|
+
* Provider implementations use different React hooks internally, so the
|
|
40
|
+
* provider value must be stable across renders. Use a `key` prop based on
|
|
41
|
+
* provider to force a clean remount when the provider changes.
|
|
42
|
+
*/
|
|
43
|
+
const CXButtonProvider = ({
|
|
44
|
+
provider,
|
|
45
|
+
enabled,
|
|
46
|
+
suppressMerchantButton,
|
|
47
|
+
onSwitchToAgent,
|
|
48
|
+
onCXClose,
|
|
49
|
+
children,
|
|
50
|
+
}: {
|
|
51
|
+
provider: CustomerServiceType;
|
|
52
|
+
enabled: boolean;
|
|
53
|
+
suppressMerchantButton: boolean;
|
|
54
|
+
onSwitchToAgent: () => void;
|
|
55
|
+
onCXClose: () => void;
|
|
56
|
+
children: (cxButton: { isSwitchEnabled?: () => boolean; toggle?: () => void }) => ReactNode;
|
|
57
|
+
}) => {
|
|
58
|
+
const unifiedCXButton = useUnifiedCXButton({
|
|
59
|
+
provider,
|
|
60
|
+
enabled,
|
|
61
|
+
suppressMerchantButton,
|
|
62
|
+
onSwitchToAgent,
|
|
63
|
+
onCXClose,
|
|
64
|
+
});
|
|
65
|
+
const { isSwitchEnabled, toggle } = unifiedCXButton ?? {};
|
|
66
|
+
return <>{children({ isSwitchEnabled, toggle })}</>;
|
|
67
|
+
};
|
|
68
|
+
|
|
35
69
|
interface FloatingChatWidgetHandlerProps extends BaseWidgetProps {
|
|
36
70
|
previewButtonOnly?: boolean;
|
|
37
71
|
previewChatAlwaysOpen?: boolean;
|
|
@@ -46,26 +80,21 @@ const FloatingChatWidgetHandler = (props: FloatingChatWidgetHandlerProps) => {
|
|
|
46
80
|
// TODO: Get hardcopy
|
|
47
81
|
const { uiConfig, isUiConfigLoading, hardcopyContent } = props;
|
|
48
82
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// enabled: customerServiceIntegration?.enabled,
|
|
54
|
-
// suppressMerchantButton: customerServiceIntegration?.suppressMerchantButton,
|
|
55
|
-
// });
|
|
56
|
-
const unifiedCXButton = useUnifiedCXButton({
|
|
57
|
-
provider: CustomerServiceType.unsupported,
|
|
58
|
-
enabled: false,
|
|
59
|
-
suppressMerchantButton: false,
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
const { isSwitchEnabled, toggle } = unifiedCXButton ?? {};
|
|
63
|
-
|
|
64
|
-
const { floatingButton } = uiConfig ?? {};
|
|
83
|
+
const { customerServiceIntegration, floatingButton, floatingChat } = uiConfig ?? {};
|
|
84
|
+
const cxProvider =
|
|
85
|
+
(customerServiceIntegration?.provider as CustomerServiceType) ??
|
|
86
|
+
CustomerServiceType.unsupported;
|
|
65
87
|
|
|
66
88
|
// TODO: Get hardcopy content
|
|
67
89
|
const { isOpen, openChat, closeChat } = useChatToggle();
|
|
68
90
|
|
|
91
|
+
const [isCXOpen, setIsCXOpen] = useState(false);
|
|
92
|
+
|
|
93
|
+
// Reset CX open state when the envive widget is reopened
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (isOpen) setIsCXOpen(false);
|
|
96
|
+
}, [isOpen]);
|
|
97
|
+
|
|
69
98
|
const { shouldShowFloatingButton } = useFloatingButtonVisibility({
|
|
70
99
|
floatingButtonShowConfig: floatingButton?.showOption as FloatingButtonShow,
|
|
71
100
|
isChatOpen: isOpen,
|
|
@@ -75,7 +104,9 @@ const FloatingChatWidgetHandler = (props: FloatingChatWidgetHandlerProps) => {
|
|
|
75
104
|
// Override isOpen for preview modes
|
|
76
105
|
const effectiveIsOpen = previewChatAlwaysOpen ? true : isOpen;
|
|
77
106
|
const effectiveShouldRenderFloatingButton = !effectiveIsOpen && shouldShowFloatingButton;
|
|
78
|
-
const buttonShouldRender = previewButtonOnly
|
|
107
|
+
const buttonShouldRender = previewButtonOnly
|
|
108
|
+
? true
|
|
109
|
+
: effectiveShouldRenderFloatingButton && !isCXOpen;
|
|
79
110
|
|
|
80
111
|
const theme = useMemo(() => {
|
|
81
112
|
if (isUiConfigLoading || !uiConfig) {
|
|
@@ -85,6 +116,8 @@ const FloatingChatWidgetHandler = (props: FloatingChatWidgetHandlerProps) => {
|
|
|
85
116
|
return (uiConfig?.lookAndFeel?.theme as Theme) ?? Theme.GLOBAL_CUSTOM;
|
|
86
117
|
}, [isUiConfigLoading, uiConfig]);
|
|
87
118
|
|
|
119
|
+
useAutoPopup({ autoPopupConfig: floatingChat?.autoPopupConfig });
|
|
120
|
+
|
|
88
121
|
const { trackEvent } = useAmplitude();
|
|
89
122
|
const hasTrackedEvent = useRef(false);
|
|
90
123
|
// When we add support for initially hidden floating buttons, we will need to update this to handle that case
|
|
@@ -102,59 +135,71 @@ const FloatingChatWidgetHandler = (props: FloatingChatWidgetHandlerProps) => {
|
|
|
102
135
|
}, [trackEvent, buttonShouldRender]);
|
|
103
136
|
|
|
104
137
|
return (
|
|
105
|
-
|
|
106
|
-
{
|
|
107
|
-
{
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
theme={theme}
|
|
120
|
-
salesAgentData={salesAgentData}
|
|
121
|
-
hardcopyContent={hardcopyContent}
|
|
122
|
-
floatingChatConfig={uiConfig?.floatingChat ?? ({} as FloatingChatConfig)}
|
|
123
|
-
lookAndFeelConfig={uiConfig?.lookAndFeel ?? ({} as LookAndFeelConfig)}
|
|
124
|
-
isCXButtonSwitchEnabled={!!isSwitchEnabled?.()}
|
|
125
|
-
isFloatingChatOpen={effectiveIsOpen}
|
|
126
|
-
onToggleCXButton={toggle}
|
|
138
|
+
<CXButtonProvider
|
|
139
|
+
key={cxProvider}
|
|
140
|
+
provider={cxProvider}
|
|
141
|
+
enabled={customerServiceIntegration?.enabled ?? false}
|
|
142
|
+
suppressMerchantButton={customerServiceIntegration?.suppressMerchantButton ?? false}
|
|
143
|
+
onSwitchToAgent={() => setIsCXOpen(true)}
|
|
144
|
+
onCXClose={() => setIsCXOpen(false)}
|
|
145
|
+
>
|
|
146
|
+
{({ isSwitchEnabled, toggle }) => (
|
|
147
|
+
<>
|
|
148
|
+
{/* Render chat when always open preview OR when normally open */}
|
|
149
|
+
{(previewChatAlwaysOpen || effectiveIsOpen) && !previewButtonOnly && (
|
|
150
|
+
<FloatingChatOverlay
|
|
151
|
+
isOpened={effectiveIsOpen}
|
|
127
152
|
onClose={
|
|
128
153
|
previewChatAlwaysOpen
|
|
129
154
|
? () => {}
|
|
130
|
-
: () => closeChat(ChatElementDisplayLocationV3.
|
|
155
|
+
: () => closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_OVERLAY)
|
|
131
156
|
}
|
|
157
|
+
previewMode={!!previewChatAlwaysOpen}
|
|
158
|
+
>
|
|
159
|
+
<Suspense>
|
|
160
|
+
<FloatingChat
|
|
161
|
+
theme={theme}
|
|
162
|
+
salesAgentData={salesAgentData}
|
|
163
|
+
hardcopyContent={hardcopyContent}
|
|
164
|
+
floatingChatConfig={uiConfig?.floatingChat ?? ({} as FloatingChatConfig)}
|
|
165
|
+
lookAndFeelConfig={uiConfig?.lookAndFeel ?? ({} as LookAndFeelConfig)}
|
|
166
|
+
isCXButtonSwitchEnabled={!!isSwitchEnabled?.()}
|
|
167
|
+
isFloatingChatOpen={effectiveIsOpen}
|
|
168
|
+
onToggleCXButton={toggle}
|
|
169
|
+
debugBar={<DebugBar />}
|
|
170
|
+
onClose={
|
|
171
|
+
previewChatAlwaysOpen
|
|
172
|
+
? () => {}
|
|
173
|
+
: () => closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON)
|
|
174
|
+
}
|
|
175
|
+
/>
|
|
176
|
+
</Suspense>
|
|
177
|
+
</FloatingChatOverlay>
|
|
178
|
+
)}
|
|
179
|
+
|
|
180
|
+
{/* Render button when preview button only OR when chat is closed */}
|
|
181
|
+
{buttonShouldRender && (
|
|
182
|
+
<FloatingButton
|
|
183
|
+
id={FLOATING_BUTTON_ID}
|
|
184
|
+
variant={floatingButton?.style as FloatingButtonVariant}
|
|
185
|
+
mode={floatingButton?.mode as FloatingButtonMode}
|
|
186
|
+
backgroundColor={floatingButton?.backgroundColor as FloatingButtonBackgroundColor}
|
|
187
|
+
onClick={
|
|
188
|
+
previewButtonOnly
|
|
189
|
+
? () => {}
|
|
190
|
+
: () => openChat(ChatElementDisplayLocationV3.FLOATING_BUTTON)
|
|
191
|
+
}
|
|
192
|
+
customIcon={floatingButton?.iconSVGSrc}
|
|
193
|
+
show={floatingButton?.showOption as FloatingButtonShow}
|
|
194
|
+
location={floatingButton?.position as FloatingButtonLocation}
|
|
195
|
+
hasInteractionHappened={userHasInteractedValue}
|
|
196
|
+
ariaLabel="Open chat"
|
|
197
|
+
previewMode={!!previewButtonOnly}
|
|
132
198
|
/>
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
)}
|
|
136
|
-
|
|
137
|
-
{/* Render button when preview button only OR when chat is closed */}
|
|
138
|
-
{buttonShouldRender && (
|
|
139
|
-
<FloatingButton
|
|
140
|
-
id={FLOATING_BUTTON_ID}
|
|
141
|
-
variant={floatingButton?.style as FloatingButtonVariant}
|
|
142
|
-
mode={floatingButton?.mode as FloatingButtonMode}
|
|
143
|
-
backgroundColor={floatingButton?.backgroundColor as FloatingButtonBackgroundColor}
|
|
144
|
-
onClick={
|
|
145
|
-
previewButtonOnly
|
|
146
|
-
? () => {}
|
|
147
|
-
: () => openChat(ChatElementDisplayLocationV3.FLOATING_BUTTON)
|
|
148
|
-
}
|
|
149
|
-
customIcon={floatingButton?.iconSVGSrc}
|
|
150
|
-
show={floatingButton?.showOption as FloatingButtonShow}
|
|
151
|
-
location={floatingButton?.position as FloatingButtonLocation}
|
|
152
|
-
hasInteractionHappened={userHasInteractedValue}
|
|
153
|
-
ariaLabel="Open chat"
|
|
154
|
-
previewMode={!!previewButtonOnly}
|
|
155
|
-
/>
|
|
199
|
+
)}
|
|
200
|
+
</>
|
|
156
201
|
)}
|
|
157
|
-
|
|
202
|
+
</CXButtonProvider>
|
|
158
203
|
);
|
|
159
204
|
};
|
|
160
205
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
2
|
+
import { useFeatureFlagService } from '@envive-ai/react-hooks/contexts/featureFlagServiceContext';
|
|
3
|
+
import { AutoPopupConfig } from '@envive-ai/react-hooks/contexts/typesV3';
|
|
4
|
+
import { useChatToggle } from '@envive-ai/react-hooks/hooks/ChatToggle';
|
|
5
|
+
import {
|
|
6
|
+
ChatElementDisplayLocationV3,
|
|
7
|
+
FeatureGates,
|
|
8
|
+
} from '@envive-ai/react-hooks/application/models';
|
|
9
|
+
|
|
10
|
+
export const useAutoPopup = ({ autoPopupConfig }: { autoPopupConfig?: AutoPopupConfig }) => {
|
|
11
|
+
const { isOpen, openChat } = useChatToggle();
|
|
12
|
+
const { featureFlagService } = useFeatureFlagService();
|
|
13
|
+
const hasBeenOpenedRef = useRef(false);
|
|
14
|
+
const autoPopupTimerRef = useRef<NodeJS.Timeout | null>(null);
|
|
15
|
+
|
|
16
|
+
const isReferrerBasedPromptEnabled = useMemo(
|
|
17
|
+
() => featureFlagService.isFeatureGateEnabled(FeatureGates.IsReferrerBasedPromptEnabled),
|
|
18
|
+
[featureFlagService],
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (!hasBeenOpenedRef.current && isOpen) {
|
|
23
|
+
hasBeenOpenedRef.current = true;
|
|
24
|
+
}
|
|
25
|
+
}, [isOpen]);
|
|
26
|
+
|
|
27
|
+
const openChatSafely = useCallback(
|
|
28
|
+
(triggerLocation: ChatElementDisplayLocationV3) => {
|
|
29
|
+
if (!hasBeenOpenedRef.current) {
|
|
30
|
+
hasBeenOpenedRef.current = true;
|
|
31
|
+
openChat(triggerLocation);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
[openChat],
|
|
35
|
+
);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
const cleanup = () => {
|
|
38
|
+
if (autoPopupTimerRef.current) {
|
|
39
|
+
clearTimeout(autoPopupTimerRef.current);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
if (!autoPopupConfig || hasBeenOpenedRef.current) {
|
|
43
|
+
return cleanup;
|
|
44
|
+
}
|
|
45
|
+
for (const trigger of autoPopupConfig.triggers) {
|
|
46
|
+
if (trigger.trigger.type === 'referrer') {
|
|
47
|
+
if (!isReferrerBasedPromptEnabled) {
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
const utmSource = new URLSearchParams(window.location.search).get('utm_source');
|
|
51
|
+
if (trigger.trigger.referrers.includes(utmSource)) {
|
|
52
|
+
autoPopupTimerRef.current = setTimeout(() => {
|
|
53
|
+
openChatSafely(ChatElementDisplayLocationV3.REFERRER_BASED_PROMPT);
|
|
54
|
+
}, trigger.delay);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (trigger.trigger.type === 'automatic') {
|
|
58
|
+
autoPopupTimerRef.current = setTimeout(() => {
|
|
59
|
+
openChatSafely(ChatElementDisplayLocationV3.AUTOMATIC_PROMPT);
|
|
60
|
+
}, trigger.delay);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return cleanup;
|
|
64
|
+
}, [autoPopupConfig, isOpen, isReferrerBasedPromptEnabled, openChatSafely]);
|
|
65
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import { useAtomValue } from 'jotai';
|
|
3
|
-
import { featureFlagServiceAtom } from '@envive-ai/react-hooks/atoms/org';
|
|
4
1
|
import { FeatureGates } from '@envive-ai/react-hooks/application/models';
|
|
2
|
+
import { variantInfoAtom } from '@envive-ai/react-hooks/atoms/app';
|
|
3
|
+
import { featureFlagServiceAtom } from '@envive-ai/react-hooks/atoms/org';
|
|
5
4
|
import { FloatingButtonShow } from '@envive-ai/react-toolkit-v3/FloatingButton';
|
|
5
|
+
import { useAtom, useAtomValue } from 'jotai';
|
|
6
|
+
import { useMemo } from 'react';
|
|
6
7
|
|
|
7
8
|
export interface UseFloatingButtonVisibilityProps {
|
|
8
9
|
floatingButtonShowConfig?: FloatingButtonShow;
|
|
@@ -21,6 +22,10 @@ export const useFloatingButtonVisibility = ({
|
|
|
21
22
|
userHasInteracted,
|
|
22
23
|
}: UseFloatingButtonVisibilityProps): UseFloatingButtonVisibilityReturn => {
|
|
23
24
|
const featureFlagService = useAtomValue(featureFlagServiceAtom);
|
|
25
|
+
const [variantInfo] = useAtom(variantInfoAtom);
|
|
26
|
+
|
|
27
|
+
const internalfloatingButtonShowConfig =
|
|
28
|
+
variantInfo.floatingButtonOverride ?? floatingButtonShowConfig;
|
|
24
29
|
|
|
25
30
|
const isSalesAgentEnabled = useMemo(
|
|
26
31
|
() =>
|
|
@@ -33,8 +38,9 @@ export const useFloatingButtonVisibility = ({
|
|
|
33
38
|
const shouldShowFloatingButton =
|
|
34
39
|
(isSalesAgentEnabled || isSalesAgentEnabled === undefined) &&
|
|
35
40
|
!isChatOpen &&
|
|
36
|
-
(
|
|
37
|
-
(
|
|
41
|
+
(internalfloatingButtonShowConfig === FloatingButtonShow.ALWAYS ||
|
|
42
|
+
(internalfloatingButtonShowConfig === FloatingButtonShow.POST_INTERACTION &&
|
|
43
|
+
userHasInteracted));
|
|
38
44
|
|
|
39
45
|
return {
|
|
40
46
|
shouldShowFloatingButton,
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FloatingChatConfig,
|
|
3
|
+
FullPageSalesAgentWidgetV3Config,
|
|
4
|
+
LookAndFeelConfig,
|
|
5
|
+
WidgetTypeV3,
|
|
6
|
+
} from '@envive-ai/react-hooks/contexts/typesV3';
|
|
7
|
+
import { FullPageSalesAgent } from '@envive-ai/react-toolkit-v3/FullPageSalesAgent';
|
|
8
|
+
import { Theme } from '@envive-ai/react-toolkit-v3/Tokens';
|
|
9
|
+
import { BaseWidgetProps, withBaseWidget } from 'src/hocs/withBaseWidget';
|
|
10
|
+
|
|
11
|
+
const FullPageSalesAgentHandler = ({
|
|
12
|
+
uiConfig,
|
|
13
|
+
hardcopyContent,
|
|
14
|
+
widgetConfig,
|
|
15
|
+
}: BaseWidgetProps) => {
|
|
16
|
+
const { headerContainer, autoHeight } = (widgetConfig as FullPageSalesAgentWidgetV3Config) || {};
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<FullPageSalesAgent
|
|
20
|
+
theme={Theme.STANDARD}
|
|
21
|
+
floatingChatConfig={uiConfig?.floatingChat ?? ({} as FloatingChatConfig)}
|
|
22
|
+
lookAndFeelConfig={uiConfig?.lookAndFeel ?? ({} as LookAndFeelConfig)}
|
|
23
|
+
hardcopyContent={hardcopyContent}
|
|
24
|
+
headerContainer={headerContainer}
|
|
25
|
+
autoHeight={autoHeight}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const FullPageSalesAgentBaseWidget =
|
|
31
|
+
withBaseWidget<BaseWidgetProps>(FullPageSalesAgentHandler);
|
|
32
|
+
|
|
33
|
+
export interface FullPageSalesAgentBaseWidgetProps {
|
|
34
|
+
widgetConfigId: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const FullPageSalesAgentWidget = ({ widgetConfigId }: FullPageSalesAgentBaseWidgetProps) => {
|
|
38
|
+
return (
|
|
39
|
+
<FullPageSalesAgentBaseWidget
|
|
40
|
+
widgetConfigId={widgetConfigId}
|
|
41
|
+
widgetType={WidgetTypeV3.FullPageSalesAgentV3}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
FullPageSalesAgentWidget.displayName = 'FullPageSalesAgentWidget';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FullPageSalesAgentWidget } from './FullPageSalesAgentWidget';
|
|
@@ -64,7 +64,11 @@ const ProductCardWidgetHandler = (props: BaseWidgetProps) => {
|
|
|
64
64
|
|
|
65
65
|
const handleSelect = useCallback(
|
|
66
66
|
(prompt: string) => {
|
|
67
|
-
onTypedMessageSubmitted({
|
|
67
|
+
onTypedMessageSubmitted({
|
|
68
|
+
query: prompt,
|
|
69
|
+
userTyped: false,
|
|
70
|
+
displayLocation: ChatElementDisplayLocationV3.PRODUCT_CARD_PROMPT_BUTTON,
|
|
71
|
+
});
|
|
68
72
|
openChat(ChatElementDisplayLocationV3.PRODUCT_CARD_PROMPT_BUTTON);
|
|
69
73
|
},
|
|
70
74
|
[onTypedMessageSubmitted, openChat],
|
package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx
CHANGED
|
@@ -60,7 +60,12 @@ const PromptButtonCarouselWithImageWidgetHandler = (props: BaseWidgetProps) => {
|
|
|
60
60
|
|
|
61
61
|
const handlePromptButtonClick = useCallback(
|
|
62
62
|
(text: string) => {
|
|
63
|
-
onTypedMessageSubmitted({
|
|
63
|
+
onTypedMessageSubmitted({
|
|
64
|
+
query: text,
|
|
65
|
+
userTyped: false,
|
|
66
|
+
displayLocation:
|
|
67
|
+
ChatElementDisplayLocationV3.PROMPT_BUTTON_CAROUSEL_WITH_IMAGE_PROMPT_BUTTON,
|
|
68
|
+
});
|
|
64
69
|
openChat(ChatElementDisplayLocationV3.PROMPT_BUTTON_CAROUSEL_WITH_IMAGE_PROMPT_BUTTON);
|
|
65
70
|
},
|
|
66
71
|
[onTypedMessageSubmitted, openChat],
|
|
@@ -7,6 +7,7 @@ import { ChatElementDisplayLocationV3 } from '@envive-ai/react-hooks/application
|
|
|
7
7
|
import { useSalesAgent } from '@envive-ai/react-hooks/contexts/salesAgentContext';
|
|
8
8
|
import { useCallback, useEffect } from 'react';
|
|
9
9
|
import {
|
|
10
|
+
EnviveMetricsEventName,
|
|
10
11
|
SpiffyMetricsEventName,
|
|
11
12
|
useAmplitude,
|
|
12
13
|
} from '@envive-ai/react-hooks/contexts/amplitudeContext';
|
|
@@ -17,6 +18,20 @@ import { Theme } from '@envive-ai/react-toolkit-v3/Tokens';
|
|
|
17
18
|
import { PromptCarousel } from '@envive-ai/react-toolkit-v3/PromptCarousel';
|
|
18
19
|
import { BaseWidgetProps, withBaseWidget } from '../../hocs/withBaseWidget';
|
|
19
20
|
|
|
21
|
+
type RawWidgetString = { id: string; value: string };
|
|
22
|
+
type RawValues = Record<string, RawWidgetString | RawWidgetString[]>;
|
|
23
|
+
|
|
24
|
+
/** Finds the string_id (id) from raw widget text values for the given display text */
|
|
25
|
+
function getStringIdForText(rawValues: RawValues | undefined, text: string): string | undefined {
|
|
26
|
+
if (!rawValues) return undefined;
|
|
27
|
+
for (const raw of Object.values(rawValues)) {
|
|
28
|
+
const list = Array.isArray(raw) ? raw : [raw];
|
|
29
|
+
const found = list.find((s: RawWidgetString) => s.value === text);
|
|
30
|
+
if (found) return found.id;
|
|
31
|
+
}
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
|
|
20
35
|
const mockButtonTexts = [
|
|
21
36
|
'Loading button 1',
|
|
22
37
|
'Loading button 2',
|
|
@@ -41,7 +56,7 @@ const PromptCarouselWidgetHandler = (props: BaseWidgetProps) => {
|
|
|
41
56
|
const promptButtonType = promptCarouselWidgetConfig?.promptButtonType as PromptButtonVariant;
|
|
42
57
|
const promptCarouselRows = promptCarouselWidgetConfig?.promptCarouselRows;
|
|
43
58
|
const animationSpeed = isLoading
|
|
44
|
-
? AnimationSpeed.
|
|
59
|
+
? AnimationSpeed.NONE
|
|
45
60
|
: promptCarouselWidgetConfig?.animationSpeed;
|
|
46
61
|
|
|
47
62
|
const { trackEvent } = useAmplitude();
|
|
@@ -58,10 +73,24 @@ const PromptCarouselWidgetHandler = (props: BaseWidgetProps) => {
|
|
|
58
73
|
|
|
59
74
|
const handleButtonClick = useCallback(
|
|
60
75
|
(text: string) => {
|
|
61
|
-
|
|
76
|
+
const rawValues = (hardcopyContent as { rawValues?: RawValues } | undefined)?.rawValues;
|
|
77
|
+
const stringId = getStringIdForText(rawValues, text);
|
|
78
|
+
trackEvent({
|
|
79
|
+
eventName: EnviveMetricsEventName.WidgetTextClicked,
|
|
80
|
+
eventProps: {
|
|
81
|
+
response_id: hardcopyContent?.responseId,
|
|
82
|
+
string_id: stringId,
|
|
83
|
+
text,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
onTypedMessageSubmitted({
|
|
87
|
+
query: text,
|
|
88
|
+
userTyped: false,
|
|
89
|
+
displayLocation: ChatElementDisplayLocationV3.PROMPT_CAROUSEL,
|
|
90
|
+
});
|
|
62
91
|
openChat(ChatElementDisplayLocationV3.PROMPT_CAROUSEL);
|
|
63
92
|
},
|
|
64
|
-
[onTypedMessageSubmitted, openChat],
|
|
93
|
+
[trackEvent, hardcopyContent, onTypedMessageSubmitted, openChat],
|
|
65
94
|
);
|
|
66
95
|
|
|
67
96
|
return (
|
|
@@ -102,7 +102,11 @@ const SocialProofWidgetHandler = (props: BaseWidgetProps) => {
|
|
|
102
102
|
|
|
103
103
|
const handlePrimaryButtonClick = useCallback(
|
|
104
104
|
(text: string) => {
|
|
105
|
-
onTypedMessageSubmitted({
|
|
105
|
+
onTypedMessageSubmitted({
|
|
106
|
+
query: text,
|
|
107
|
+
userTyped: false,
|
|
108
|
+
displayLocation: ChatElementDisplayLocationV3.SOCIAL_PROOF_PRIMARY_BUTTON,
|
|
109
|
+
});
|
|
106
110
|
openChat(ChatElementDisplayLocationV3.SOCIAL_PROOF_PRIMARY_BUTTON);
|
|
107
111
|
},
|
|
108
112
|
[onTypedMessageSubmitted, openChat],
|
|
@@ -110,7 +114,11 @@ const SocialProofWidgetHandler = (props: BaseWidgetProps) => {
|
|
|
110
114
|
|
|
111
115
|
const handleSecondaryButtonClick = useCallback(
|
|
112
116
|
(text: string) => {
|
|
113
|
-
onTypedMessageSubmitted({
|
|
117
|
+
onTypedMessageSubmitted({
|
|
118
|
+
query: text,
|
|
119
|
+
userTyped: false,
|
|
120
|
+
displayLocation: ChatElementDisplayLocationV3.SOCIAL_PROOF_SECONDARY_BUTTON,
|
|
121
|
+
});
|
|
114
122
|
openChat(ChatElementDisplayLocationV3.SOCIAL_PROOF_SECONDARY_BUTTON);
|
|
115
123
|
},
|
|
116
124
|
[onTypedMessageSubmitted, openChat],
|
|
@@ -50,7 +50,7 @@ const TitledPromptCarouselWidgetHandler = (props: BaseWidgetProps) => {
|
|
|
50
50
|
titledPromptCarouselWidgetConfig?.promptButtonType as PromptButtonVariant;
|
|
51
51
|
const promptCarouselRows = titledPromptCarouselWidgetConfig?.promptCarouselRows;
|
|
52
52
|
const animationSpeed = isLoading
|
|
53
|
-
? AnimationSpeed.
|
|
53
|
+
? AnimationSpeed.NONE
|
|
54
54
|
: titledPromptCarouselWidgetConfig?.animationSpeed;
|
|
55
55
|
|
|
56
56
|
const { trackEvent } = useAmplitude();
|
|
@@ -67,7 +67,11 @@ const TitledPromptCarouselWidgetHandler = (props: BaseWidgetProps) => {
|
|
|
67
67
|
|
|
68
68
|
const handleButtonClick = useCallback(
|
|
69
69
|
(text: string) => {
|
|
70
|
-
onTypedMessageSubmitted({
|
|
70
|
+
onTypedMessageSubmitted({
|
|
71
|
+
query: text,
|
|
72
|
+
userTyped: false,
|
|
73
|
+
displayLocation: ChatElementDisplayLocationV3.TITLED_PROMPT_CAROUSEL,
|
|
74
|
+
});
|
|
71
75
|
openChat(ChatElementDisplayLocationV3.TITLED_PROMPT_CAROUSEL);
|
|
72
76
|
},
|
|
73
77
|
[onTypedMessageSubmitted, openChat],
|
|
@@ -72,7 +72,11 @@ const TypingAnimationWidgetHandler = (props: BaseWidgetProps) => {
|
|
|
72
72
|
|
|
73
73
|
const handleButtonClick = useCallback(
|
|
74
74
|
(text: string) => {
|
|
75
|
-
onTypedMessageSubmitted({
|
|
75
|
+
onTypedMessageSubmitted({
|
|
76
|
+
query: text,
|
|
77
|
+
userTyped: false,
|
|
78
|
+
displayLocation: ChatElementDisplayLocationV3.TYPING_ANIMATION,
|
|
79
|
+
});
|
|
76
80
|
onToggle(ChatElementDisplayLocationV3.TYPING_ANIMATION);
|
|
77
81
|
},
|
|
78
82
|
[onTypedMessageSubmitted, onToggle],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|