@envive-ai/react-widgets-v3 0.3.15-alpha.1 → 0.3.15-alpha.2
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/hocs/withBaseWidget/types.d.cts +5 -6
- package/dist/hocs/withBaseWidget/types.d.ts +5 -7
- package/dist/hocs/withBaseWidget/withBaseWidget.cjs +37 -43
- package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +2 -2
- package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
- package/dist/hocs/withBaseWidget/withBaseWidget.js +39 -45
- package/dist/packages/hooks/dist/application/models/api/orgConfigResults.d.ts +2 -1
- package/dist/packages/hooks/dist/application/models/api/userEvent.d.ts +1 -0
- package/dist/packages/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.ts +1 -0
- package/dist/packages/hooks/dist/contexts/types.d.ts +3 -1
- package/dist/packages/hooks/dist/contexts/typesV3.d.ts +1 -1
- package/dist/packages/hooks/dist/types/custservice-types.d.ts +1 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/variantInfo/pageVisitInfo.d.ts +1 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/variantInfo/variantInfo.d.ts +2 -1
- package/dist/packages/widgets/dist/packages/hooks/dist/contexts/types.d.ts +1 -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 +2 -11
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +4 -13
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.cjs +44 -21
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.js +44 -21
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +34 -34
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +3 -1
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +5 -3
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +35 -35
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +2 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +1 -11
- 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 -13
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +2 -11
- 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 -13
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +1 -10
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +3 -12
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.cjs +1 -1
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +1 -1
- package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +2 -11
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.js +4 -13
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +0 -9
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +2 -11
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.cjs +1 -1
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +1 -1
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +1 -10
- 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 -12
- package/package.json +1 -1
- package/dist/hooks/dist/services/amplitudeService/eventNames.d.cts +0 -43
- package/dist/packages/hooks/dist/contexts/amplitudeContext/amplitudeContext.d.ts +0 -2
- package/dist/packages/hooks/dist/contexts/amplitudeContext/index.d.ts +0 -2
- package/dist/packages/hooks/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.d.ts +0 -2
- package/dist/packages/hooks/dist/services/amplitudeService/amplitudeService.d.ts +0 -1
- package/dist/packages/hooks/dist/services/amplitudeService/eventNames.d.ts +0 -43
- package/dist/src/CXIntegration/hooks/useUnifiedCXButton.d.ts +0 -10
- package/dist/src/CXIntegration/hooks/useUnifiedCXButton.js +0 -29
- package/dist/src/CXIntegration/implementations/useDefaultUnifiedCXButton.d.ts +0 -2
- package/dist/src/CXIntegration/implementations/useDefaultUnifiedCXButton.js +0 -6
- package/dist/src/CXIntegration/implementations/useEightByEightUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useEightByEightUnifiedCXButton.js +0 -63
- package/dist/src/CXIntegration/implementations/useGladlyUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useGladlyUnifiedCXButton.js +0 -23
- package/dist/src/CXIntegration/implementations/useGorgiasUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useGorgiasUnifiedCXButton.js +0 -54
- package/dist/src/CXIntegration/implementations/useGrooveUnifiedCXButton.d.ts +0 -18
- package/dist/src/CXIntegration/implementations/useGrooveUnifiedCXButton.js +0 -48
- package/dist/src/CXIntegration/implementations/useHelpScoutUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useHelpScoutUnifiedCXButton.js +0 -84
- package/dist/src/CXIntegration/implementations/useKustomerUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useKustomerUnifiedCXButton.js +0 -86
- package/dist/src/CXIntegration/implementations/useReDoUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useReDoUnifiedCXButton.js +0 -59
- package/dist/src/CXIntegration/implementations/useRichpanelUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useRichpanelUnifiedCXButton.js +0 -62
- package/dist/src/CXIntegration/implementations/useShopifyChatUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useShopifyChatUnifiedCXButton.js +0 -49
- package/dist/src/CXIntegration/implementations/useTalkdeskUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useTalkdeskUnifiedCXButton.js +0 -77
- package/dist/src/CXIntegration/implementations/useTidioUnifiedCXButton.d.ts +0 -13
- package/dist/src/CXIntegration/implementations/useTidioUnifiedCXButton.js +0 -20
- package/dist/src/CXIntegration/implementations/useZendeskUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useZendeskUnifiedCXButton.js +0 -55
- package/dist/src/CXIntegration/implementations/useZowieUnifiedCXButton.d.ts +0 -13
- package/dist/src/CXIntegration/implementations/useZowieUnifiedCXButton.js +0 -20
- package/dist/src/CXIntegration/types.d.ts +0 -26
- package/dist/src/CXIntegration/types.js +0 -17
- package/dist/src/CXIntegration/utils/functions.d.ts +0 -2
- package/dist/src/CXIntegration/utils/functions.js +0 -57
- package/dist/src/debug/GenericSelect.d.ts +0 -11
- package/dist/src/debug/GenericSelect.js +0 -151
- package/dist/src/debug/MessageContent.d.ts +0 -4
- package/dist/src/debug/MessageContent.js +0 -87
- package/dist/src/debug/chatEmbed.d.ts +0 -2
- package/dist/src/debug/chatEmbed.js +0 -58
- package/dist/src/debug/debugBar.d.ts +0 -1
- package/dist/src/debug/debugBar.js +0 -9
- package/dist/src/debug/reportIssue.d.ts +0 -1
- package/dist/src/debug/reportIssue.js +0 -322
- package/dist/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.d.ts +0 -1
- package/dist/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.js +0 -452
- package/dist/src/hocs/withBaseWidget/index.d.ts +0 -2
- package/dist/src/hocs/withBaseWidget/index.js +0 -1
- package/dist/src/hocs/withBaseWidget/types.d.ts +0 -33
- package/dist/src/hocs/withBaseWidget/types.js +0 -0
- package/dist/src/hocs/withBaseWidget/withBaseWidget.d.ts +0 -5
- package/dist/src/hocs/withBaseWidget/withBaseWidget.js +0 -80
- package/dist/src/stories/FloatingChatWidget.stories.d.ts +0 -25
- package/dist/src/stories/FloatingChatWidget.stories.js +0 -44
- package/dist/src/stories/FullPageSalesAgentWidget.stories.d.ts +0 -31
- package/dist/src/stories/FullPageSalesAgentWidget.stories.js +0 -51
- package/dist/src/stories/ProductCardWidget.stories.d.ts +0 -31
- package/dist/src/stories/ProductCardWidget.stories.js +0 -44
- package/dist/src/stories/PromptButtonCarouselWithImageWidget.stories.d.ts +0 -31
- package/dist/src/stories/PromptButtonCarouselWithImageWidget.stories.js +0 -40
- package/dist/src/stories/PromptCarouselWidget.stories.d.ts +0 -31
- package/dist/src/stories/PromptCarouselWidget.stories.js +0 -40
- package/dist/src/stories/SalesAgentTest/SalesAgentTest.d.ts +0 -1
- package/dist/src/stories/SalesAgentTest/SalesAgentTest.js +0 -40
- package/dist/src/stories/SalesAgentTest/SalesAgentTest.stories.d.ts +0 -12
- package/dist/src/stories/SalesAgentTest/SalesAgentTest.stories.js +0 -12
- package/dist/src/stories/SalesAgentTest/index.d.ts +0 -0
- package/dist/src/stories/SalesAgentTest/index.js +0 -0
- package/dist/src/stories/SearchResults.stories.d.ts +0 -6
- package/dist/src/stories/SearchResults.stories.js +0 -23
- package/dist/src/stories/SearchZeroState.stories.d.ts +0 -38
- package/dist/src/stories/SearchZeroState.stories.js +0 -42
- package/dist/src/stories/SocialProofFlowWidget.stories.d.ts +0 -35
- package/dist/src/stories/SocialProofFlowWidget.stories.js +0 -60
- package/dist/src/stories/SuggestionBar.stories.d.ts +0 -7
- package/dist/src/stories/SuggestionBar.stories.js +0 -36
- package/dist/src/stories/TitledPromptCarouselWidget.stories.d.ts +0 -32
- package/dist/src/stories/TitledPromptCarouselWidget.stories.js +0 -55
- package/dist/src/stories/TypingAnimationFlowWidget.stories.d.ts +0 -34
- package/dist/src/stories/TypingAnimationFlowWidget.stories.js +0 -51
- package/dist/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +0 -12
- package/dist/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +0 -112
- package/dist/src/widgets/ChatPreviewComparisonWidget/index.d.ts +0 -3
- package/dist/src/widgets/ChatPreviewComparisonWidget/index.js +0 -2
- package/dist/src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +0 -9
- package/dist/src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js +0 -34
- package/dist/src/widgets/ChatPreviewLoadingWidget/index.d.ts +0 -3
- package/dist/src/widgets/ChatPreviewLoadingWidget/index.js +0 -2
- package/dist/src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +0 -12
- package/dist/src/widgets/ChatPreviewWidget/ChatPreviewWidget.js +0 -111
- package/dist/src/widgets/ChatPreviewWidget/__tests__/ChatPreviewWidget.test.d.ts +0 -1
- package/dist/src/widgets/ChatPreviewWidget/__tests__/ChatPreviewWidget.test.js +0 -97
- package/dist/src/widgets/ChatPreviewWidget/index.d.ts +0 -3
- package/dist/src/widgets/ChatPreviewWidget/index.js +0 -2
- package/dist/src/widgets/FloatingChatWidget/FloatingChatOverlay.d.ts +0 -14
- package/dist/src/widgets/FloatingChatWidget/FloatingChatOverlay.js +0 -44
- package/dist/src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +0 -8
- package/dist/src/widgets/FloatingChatWidget/FloatingChatWidget.js +0 -134
- package/dist/src/widgets/FloatingChatWidget/__tests__/FloatingChatWidget.test.d.ts +0 -1
- package/dist/src/widgets/FloatingChatWidget/__tests__/FloatingChatWidget.test.js +0 -100
- package/dist/src/widgets/FloatingChatWidget/constants.d.ts +0 -1
- package/dist/src/widgets/FloatingChatWidget/constants.js +0 -1
- package/dist/src/widgets/FloatingChatWidget/hooks/useAutoPopup.d.ts +0 -4
- package/dist/src/widgets/FloatingChatWidget/hooks/useAutoPopup.js +0 -51
- package/dist/src/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.d.ts +0 -11
- package/dist/src/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.js +0 -21
- package/dist/src/widgets/FloatingChatWidget/index.d.ts +0 -4
- package/dist/src/widgets/FloatingChatWidget/index.js +0 -3
- package/dist/src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +0 -12
- package/dist/src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.js +0 -14
- package/dist/src/widgets/FullPageSalesAgentWidget/index.d.ts +0 -1
- package/dist/src/widgets/FullPageSalesAgentWidget/index.js +0 -1
- package/dist/src/widgets/ProductCardWidget/ProductCardWidget.d.ts +0 -7
- package/dist/src/widgets/ProductCardWidget/ProductCardWidget.js +0 -94
- package/dist/src/widgets/ProductCardWidget/__tests__/ProductCardWidget.test.d.ts +0 -1
- package/dist/src/widgets/ProductCardWidget/__tests__/ProductCardWidget.test.js +0 -106
- package/dist/src/widgets/ProductCardWidget/index.d.ts +0 -2
- package/dist/src/widgets/ProductCardWidget/index.js +0 -1
- package/dist/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +0 -12
- package/dist/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +0 -88
- package/dist/src/widgets/PromptButtonCarouselWithImageWidget/__tests__/PromptButtonCarouselWithImageWidget.test.d.ts +0 -1
- package/dist/src/widgets/PromptButtonCarouselWithImageWidget/__tests__/PromptButtonCarouselWithImageWidget.test.js +0 -132
- package/dist/src/widgets/PromptButtonCarouselWithImageWidget/index.d.ts +0 -2
- package/dist/src/widgets/PromptButtonCarouselWithImageWidget/index.js +0 -2
- package/dist/src/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +0 -7
- package/dist/src/widgets/PromptCarouselWidget/PromptCarouselWidget.js +0 -74
- package/dist/src/widgets/PromptCarouselWidget/__tests__/PromptCarouselWidget.test.d.ts +0 -1
- package/dist/src/widgets/PromptCarouselWidget/__tests__/PromptCarouselWidget.test.js +0 -106
- package/dist/src/widgets/PromptCarouselWidget/index.d.ts +0 -2
- package/dist/src/widgets/PromptCarouselWidget/index.js +0 -1
- package/dist/src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +0 -7
- package/dist/src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +0 -25
- package/dist/src/widgets/SocialProofFlowWidget/index.d.ts +0 -3
- package/dist/src/widgets/SocialProofFlowWidget/index.js +0 -2
- package/dist/src/widgets/SocialProofWidget/SocialProofWidget.d.ts +0 -12
- package/dist/src/widgets/SocialProofWidget/SocialProofWidget.js +0 -203
- package/dist/src/widgets/SocialProofWidget/__tests__/SocialProofWidget.test.d.ts +0 -1
- package/dist/src/widgets/SocialProofWidget/__tests__/SocialProofWidget.test.js +0 -135
- package/dist/src/widgets/SocialProofWidget/index.d.ts +0 -2
- package/dist/src/widgets/SocialProofWidget/index.js +0 -1
- package/dist/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +0 -7
- package/dist/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +0 -75
- package/dist/src/widgets/TitledPromptCarouselWidget/__tests__/TitledPromptCarouselWidget.test.d.ts +0 -1
- package/dist/src/widgets/TitledPromptCarouselWidget/__tests__/TitledPromptCarouselWidget.test.js +0 -106
- package/dist/src/widgets/TitledPromptCarouselWidget/index.d.ts +0 -2
- package/dist/src/widgets/TitledPromptCarouselWidget/index.js +0 -1
- package/dist/src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +0 -7
- package/dist/src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +0 -25
- package/dist/src/widgets/TypingAnimationFlowWidget/index.d.ts +0 -3
- package/dist/src/widgets/TypingAnimationFlowWidget/index.js +0 -2
- package/dist/src/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +0 -12
- package/dist/src/widgets/TypingAnimationWidget/TypingAnimationWidget.js +0 -126
- package/dist/src/widgets/TypingAnimationWidget/__tests__/TypingAnimationWidget.test.d.ts +0 -1
- package/dist/src/widgets/TypingAnimationWidget/__tests__/TypingAnimationWidget.test.js +0 -118
- package/dist/src/widgets/TypingAnimationWidget/index.d.ts +0 -2
- package/dist/src/widgets/TypingAnimationWidget/index.js +0 -1
- package/dist/src/widgets/__tests__/testUtils.d.ts +0 -60
- package/dist/src/widgets/__tests__/testUtils.js +0 -46
- package/dist/src/widgets/__tests__/trackEventCanary.test.d.ts +0 -1
- package/dist/src/widgets/__tests__/trackEventCanary.test.js +0 -37
- package/dist/src/widgets/hooks/useGetWidgetStatus.d.ts +0 -7
- package/dist/src/widgets/hooks/useGetWidgetStatus.js +0 -17
- package/dist/src/widgets/utils/functions.d.ts +0 -16
- package/dist/src/widgets/utils/functions.js +0 -87
- package/dist/src/widgets-v2/SearchResults/index.d.ts +0 -2
- package/dist/src/widgets-v2/SearchResults/index.js +0 -2
- package/dist/src/widgets-v2/SearchZeroState/index.d.ts +0 -2
- package/dist/src/widgets-v2/SearchZeroState/index.js +0 -2
- package/dist/src/widgets-v2/SuggestionBar/index.d.ts +0 -2
- package/dist/src/widgets-v2/SuggestionBar/index.js +0 -2
- package/dist/src/widgets-v2/SuggestionButtonContainer/index.d.ts +0 -2
- package/dist/src/widgets-v2/SuggestionButtonContainer/index.js +0 -2
- package/dist/tsdown.config.d.ts +0 -2
- package/dist/tsdown.config.js +0 -12
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
//#region ../hooks/dist/services/amplitudeService/eventNames.d.ts
|
|
2
|
-
//#region src/services/amplitudeService/eventNames.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Event name enums for Amplitude tracking.
|
|
5
|
-
*
|
|
6
|
-
* NOTE: This file exists separately to avoid circular dependency issues.
|
|
7
|
-
* The amplitudeService imports from ga4ProjectionService, which needs these enums.
|
|
8
|
-
* By keeping the enums in a separate file, ga4ProjectionService can import them
|
|
9
|
-
* without creating a circular dependency with amplitudeService.
|
|
10
|
-
*/
|
|
11
|
-
declare enum SpiffyMetricsEventName {
|
|
12
|
-
BundleLoaded = "Bundle Loaded",
|
|
13
|
-
EnvironmentInitialized = "Environment Initialized",
|
|
14
|
-
ChatLiveAgentBtnClick = "Chat Live Agent Btn Click",
|
|
15
|
-
ChatFloatingButtonVisible = "Chat Floating Button Visible",
|
|
16
|
-
ChatComponentVisible = "Chat Component Visible",
|
|
17
|
-
ChatComponentExpanded = "Chat Component Expanded",
|
|
18
|
-
ChatComponentCollapsed = "Chat Component Collapsed",
|
|
19
|
-
ChatUserMessageInput = "Chat User Message Input",
|
|
20
|
-
ChatSuggestionClicked = "Chat Suggestion Clicked",
|
|
21
|
-
ChatAssistantResponse = "Chat Assistant Response",
|
|
22
|
-
ProductCardClicked = "Product Card Clicked",
|
|
23
|
-
ProductReviewCardClicked = "Product Review Card Clicked",
|
|
24
|
-
AddToCartClicked = "Add To Cart Clicked",
|
|
25
|
-
PromptCardClicked = "Prompt Card Clicked",
|
|
26
|
-
SupportedEvent = "Supported Event",
|
|
27
|
-
SearchBackToResponseClicked = "Search Back to Response Clicked",
|
|
28
|
-
PerformanceMetrics = "Performance Metrics",
|
|
29
|
-
SearchBarClicked = "Search Bar Clicked",
|
|
30
|
-
OrderLookupStarted = "Order Lookup Started",
|
|
31
|
-
OrderLookupFormSubmitted = "Order Lookup Form Submitted",
|
|
32
|
-
SearchComponentVisible = "Search Component Visible",
|
|
33
|
-
SearchZeroStateSuggestionClicked = "Search Zero State Suggestion Clicked",
|
|
34
|
-
SearchInputStarted = "Search Input Started",
|
|
35
|
-
SearchQuerySubmitted = "Search Query Submitted",
|
|
36
|
-
SearchResultsViewed = "Search Results Viewed",
|
|
37
|
-
SearchTimeToFirstClick = "Search Time to First Click",
|
|
38
|
-
SearchZeroResultsRate = "Search Zero Results Rate",
|
|
39
|
-
SearchFilterClicked = "Search Filter Clicked",
|
|
40
|
-
SearchSortClicked = "Search Sort Clicked",
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
export { SpiffyMetricsEventName };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../../contexts/featureFlagServiceContext/featureFlagServiceContext.js";
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
//#region ../hooks/dist/services/amplitudeService/eventNames.d.ts
|
|
2
|
-
//#region src/services/amplitudeService/eventNames.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Event name enums for Amplitude tracking.
|
|
5
|
-
*
|
|
6
|
-
* NOTE: This file exists separately to avoid circular dependency issues.
|
|
7
|
-
* The amplitudeService imports from ga4ProjectionService, which needs these enums.
|
|
8
|
-
* By keeping the enums in a separate file, ga4ProjectionService can import them
|
|
9
|
-
* without creating a circular dependency with amplitudeService.
|
|
10
|
-
*/
|
|
11
|
-
declare enum SpiffyMetricsEventName {
|
|
12
|
-
BundleLoaded = "Bundle Loaded",
|
|
13
|
-
EnvironmentInitialized = "Environment Initialized",
|
|
14
|
-
ChatLiveAgentBtnClick = "Chat Live Agent Btn Click",
|
|
15
|
-
ChatFloatingButtonVisible = "Chat Floating Button Visible",
|
|
16
|
-
ChatComponentVisible = "Chat Component Visible",
|
|
17
|
-
ChatComponentExpanded = "Chat Component Expanded",
|
|
18
|
-
ChatComponentCollapsed = "Chat Component Collapsed",
|
|
19
|
-
ChatUserMessageInput = "Chat User Message Input",
|
|
20
|
-
ChatSuggestionClicked = "Chat Suggestion Clicked",
|
|
21
|
-
ChatAssistantResponse = "Chat Assistant Response",
|
|
22
|
-
ProductCardClicked = "Product Card Clicked",
|
|
23
|
-
ProductReviewCardClicked = "Product Review Card Clicked",
|
|
24
|
-
AddToCartClicked = "Add To Cart Clicked",
|
|
25
|
-
PromptCardClicked = "Prompt Card Clicked",
|
|
26
|
-
SupportedEvent = "Supported Event",
|
|
27
|
-
SearchBackToResponseClicked = "Search Back to Response Clicked",
|
|
28
|
-
PerformanceMetrics = "Performance Metrics",
|
|
29
|
-
SearchBarClicked = "Search Bar Clicked",
|
|
30
|
-
OrderLookupStarted = "Order Lookup Started",
|
|
31
|
-
OrderLookupFormSubmitted = "Order Lookup Form Submitted",
|
|
32
|
-
SearchComponentVisible = "Search Component Visible",
|
|
33
|
-
SearchZeroStateSuggestionClicked = "Search Zero State Suggestion Clicked",
|
|
34
|
-
SearchInputStarted = "Search Input Started",
|
|
35
|
-
SearchQuerySubmitted = "Search Query Submitted",
|
|
36
|
-
SearchResultsViewed = "Search Results Viewed",
|
|
37
|
-
SearchTimeToFirstClick = "Search Time to First Click",
|
|
38
|
-
SearchZeroResultsRate = "Search Zero Results Rate",
|
|
39
|
-
SearchFilterClicked = "Search Filter Clicked",
|
|
40
|
-
SearchSortClicked = "Search Sort Clicked",
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
export { SpiffyMetricsEventName };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CustomerServiceType, UnifiedCXButton } from '../types';
|
|
2
|
-
interface UseUnifiedCXButtonProps {
|
|
3
|
-
enabled: boolean;
|
|
4
|
-
provider: CustomerServiceType;
|
|
5
|
-
suppressMerchantButton?: boolean;
|
|
6
|
-
onSwitchToAgent: () => void;
|
|
7
|
-
onCXClose?: () => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const useUnifiedCXButton: ({ enabled, provider, suppressMerchantButton, onSwitchToAgent, onCXClose, }: UseUnifiedCXButtonProps) => UnifiedCXButton | undefined;
|
|
10
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useAtomValue } from 'jotai';
|
|
2
|
-
import { hasParsedVariantInfoAtom } from '@envive-ai/react-hooks/atoms/app';
|
|
3
|
-
import { usePage } from '@envive-ai/react-hooks/contexts/pageContext';
|
|
4
|
-
import { findCustomerServiceImpl } from '../utils/functions';
|
|
5
|
-
import { CustomerServiceType } from '../types';
|
|
6
|
-
export const useUnifiedCXButton = ({ enabled = false, provider = CustomerServiceType.unsupported, suppressMerchantButton = false, onSwitchToAgent, onCXClose, }) => {
|
|
7
|
-
const { isSupported } = usePage();
|
|
8
|
-
const hasParsedVariantInfo = useAtomValue(hasParsedVariantInfoAtom);
|
|
9
|
-
const customerService = findCustomerServiceImpl(provider);
|
|
10
|
-
const selectedCustomerService = customerService({
|
|
11
|
-
onSwitchToAgent,
|
|
12
|
-
onCXClose,
|
|
13
|
-
suppressMerchantButton,
|
|
14
|
-
});
|
|
15
|
-
if (!enabled)
|
|
16
|
-
return undefined;
|
|
17
|
-
if (suppressMerchantButton) {
|
|
18
|
-
const showUnifiedButton = hasParsedVariantInfo && isSupported;
|
|
19
|
-
if (!showUnifiedButton)
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
if (!selectedCustomerService.isSwitchEnabled() && !window?._spiffy?.selectedCustomizeOption) {
|
|
23
|
-
return undefined;
|
|
24
|
-
}
|
|
25
|
-
if (window?._spiffy?.selectedCustomizeOption && provider === CustomerServiceType.unsupported) {
|
|
26
|
-
return undefined;
|
|
27
|
-
}
|
|
28
|
-
return selectedCustomerService;
|
|
29
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
-
interface UseEightByEightUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
3
|
-
}
|
|
4
|
-
export declare const useEightByEightUnifiedCXButton: ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }: UseEightByEightUnifiedCXButtonProps) => UnifiedCXButton;
|
|
5
|
-
export {};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { SelectorFactory } from '@envive-ai/react-hooks/application/utils';
|
|
2
|
-
import { useElementObserver } from '@envive-ai/react-hooks/hooks/ElementObserver';
|
|
3
|
-
import { FLOATING_BUTTON_ID } from '../../widgets/FloatingChatWidget/constants';
|
|
4
|
-
const EIGHT_BY_EIGHT_BUBBLE_SELECTOR = 'div[id^="__8x8-chat-button-container-script"]';
|
|
5
|
-
const EIGHT_BY_EIGHT_BUTTON_SELECTOR = `${EIGHT_BY_EIGHT_BUBBLE_SELECTOR} a[data-type="online"], ${EIGHT_BY_EIGHT_BUBBLE_SELECTOR} a[data-type="offline"]`;
|
|
6
|
-
const EIGHT_BY_EIGHT_CHAT_WINDOW_SELECTOR = 'div.__8x8Chat-Container';
|
|
7
|
-
export const useEightByEightUnifiedCXButton = ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }) => {
|
|
8
|
-
const eightByEightBubble = useElementObserver(SelectorFactory.query(EIGHT_BY_EIGHT_BUBBLE_SELECTOR));
|
|
9
|
-
const eightByEightChatWindow = useElementObserver(SelectorFactory.query(EIGHT_BY_EIGHT_CHAT_WINDOW_SELECTOR));
|
|
10
|
-
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
11
|
-
const isEightByEightEnabled = () => !!document.querySelector(EIGHT_BY_EIGHT_BUTTON_SELECTOR);
|
|
12
|
-
const toggle = () => {
|
|
13
|
-
const button = document.querySelector(EIGHT_BY_EIGHT_BUTTON_SELECTOR);
|
|
14
|
-
if (!button) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
onSwitchToAgent();
|
|
18
|
-
enviveFloatingButton.hide();
|
|
19
|
-
button.click();
|
|
20
|
-
};
|
|
21
|
-
const isSwitchEnabled = () => isEightByEightEnabled();
|
|
22
|
-
eightByEightBubble.onAdd(el => {
|
|
23
|
-
if (suppressMerchantButton && el) {
|
|
24
|
-
eightByEightBubble.hide();
|
|
25
|
-
}
|
|
26
|
-
enviveFloatingButton.show();
|
|
27
|
-
});
|
|
28
|
-
eightByEightBubble.onChange(el => {
|
|
29
|
-
if (!el || !suppressMerchantButton)
|
|
30
|
-
return;
|
|
31
|
-
const styles = window.getComputedStyle(el);
|
|
32
|
-
const display = styles.getPropertyValue('display');
|
|
33
|
-
if (display !== 'none') {
|
|
34
|
-
eightByEightBubble.hide();
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
eightByEightChatWindow.onChange(el => {
|
|
38
|
-
if (!el)
|
|
39
|
-
return;
|
|
40
|
-
const rect = el.getBoundingClientRect();
|
|
41
|
-
const isOpen = rect.width > 50 && rect.height > 50;
|
|
42
|
-
if (isOpen) {
|
|
43
|
-
enviveFloatingButton.hide();
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
onCXClose?.();
|
|
47
|
-
if (suppressMerchantButton) {
|
|
48
|
-
eightByEightBubble.hide();
|
|
49
|
-
}
|
|
50
|
-
enviveFloatingButton.show();
|
|
51
|
-
});
|
|
52
|
-
eightByEightChatWindow.onRemove(() => {
|
|
53
|
-
onCXClose?.();
|
|
54
|
-
if (suppressMerchantButton) {
|
|
55
|
-
eightByEightBubble.hide();
|
|
56
|
-
}
|
|
57
|
-
enviveFloatingButton.show();
|
|
58
|
-
});
|
|
59
|
-
return {
|
|
60
|
-
toggle,
|
|
61
|
-
isSwitchEnabled,
|
|
62
|
-
};
|
|
63
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
-
interface UseGladlyUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
3
|
-
}
|
|
4
|
-
export declare const useGladlyUnifiedCXButton: ({ onSwitchToAgent, }: UseGladlyUnifiedCXButtonProps) => UnifiedCXButton;
|
|
5
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { SelectorFactory } from '@envive-ai/react-hooks/application/utils';
|
|
2
|
-
import { useElementObserver } from '@envive-ai/react-hooks/hooks/ElementObserver';
|
|
3
|
-
import { FLOATING_BUTTON_ID } from '../../widgets/FloatingChatWidget/constants';
|
|
4
|
-
export const useGladlyUnifiedCXButton = ({ onSwitchToAgent, }) => {
|
|
5
|
-
const gladlyButton = document.querySelector('[data-aid*="gladlyChatChatButton"]');
|
|
6
|
-
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
7
|
-
const toggle = () => {
|
|
8
|
-
onSwitchToAgent();
|
|
9
|
-
enviveFloatingButton.hide();
|
|
10
|
-
if (gladlyButton && gladlyButton instanceof HTMLElement) {
|
|
11
|
-
gladlyButton.click();
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
const isGladlyButtonEnabled = () => {
|
|
15
|
-
const gladlyButtonElement = document.getElementById('gladlyChat_container');
|
|
16
|
-
return !!gladlyButtonElement;
|
|
17
|
-
};
|
|
18
|
-
const isSwitchEnabled = () => isGladlyButtonEnabled();
|
|
19
|
-
return {
|
|
20
|
-
toggle,
|
|
21
|
-
isSwitchEnabled,
|
|
22
|
-
};
|
|
23
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
-
interface UseGorgiasUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
3
|
-
}
|
|
4
|
-
export declare const useGorgiasUnifiedCXButton: ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }: UseGorgiasUnifiedCXButtonProps) => UnifiedCXButton;
|
|
5
|
-
export {};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { SelectorFactory } from '@envive-ai/react-hooks/application/utils';
|
|
2
|
-
import { useElementObserver } from '@envive-ai/react-hooks/hooks/ElementObserver';
|
|
3
|
-
import { FLOATING_BUTTON_ID } from '../../widgets/FloatingChatWidget/constants';
|
|
4
|
-
const CHAT_WINDOW_ID = 'chat-window';
|
|
5
|
-
const CHAT_BUTTON_ID = 'chat-button';
|
|
6
|
-
const GORGIAS_BUTTON_SELECTOR = 'id|chat-button @ id|gorgias-chat-messenger-button';
|
|
7
|
-
export const useGorgiasUnifiedCXButton = ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }) => {
|
|
8
|
-
const chatWindow = useElementObserver(SelectorFactory.id(CHAT_WINDOW_ID));
|
|
9
|
-
const chatButton = useElementObserver(SelectorFactory.id(CHAT_BUTTON_ID));
|
|
10
|
-
const trigger = useElementObserver(SelectorFactory.chain(GORGIAS_BUTTON_SELECTOR));
|
|
11
|
-
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
12
|
-
const toggle = () => {
|
|
13
|
-
onSwitchToAgent();
|
|
14
|
-
chatButton.show();
|
|
15
|
-
trigger.fire('click');
|
|
16
|
-
enviveFloatingButton.hide();
|
|
17
|
-
};
|
|
18
|
-
const isSwitchEnabled = () => !!SelectorFactory.chain(GORGIAS_BUTTON_SELECTOR).parse();
|
|
19
|
-
chatButton.onAdd(() => {
|
|
20
|
-
if (suppressMerchantButton) {
|
|
21
|
-
chatButton.hide();
|
|
22
|
-
enviveFloatingButton.show();
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
chatWindow.onAdd(el => {
|
|
26
|
-
if (el) {
|
|
27
|
-
const styles = window.getComputedStyle(el);
|
|
28
|
-
const chatWindowDisplay = styles.getPropertyValue('display');
|
|
29
|
-
const chatButtonDisplay = chatButton.targetNode?.style.display;
|
|
30
|
-
if (chatWindowDisplay === 'block' && chatButtonDisplay === 'none') {
|
|
31
|
-
if (suppressMerchantButton) {
|
|
32
|
-
chatButton.show();
|
|
33
|
-
}
|
|
34
|
-
enviveFloatingButton.hide();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
chatWindow.onChange(el => {
|
|
39
|
-
if (el) {
|
|
40
|
-
const styles = window.getComputedStyle(el);
|
|
41
|
-
if (styles.getPropertyValue('display') === 'none') {
|
|
42
|
-
onCXClose?.();
|
|
43
|
-
if (suppressMerchantButton) {
|
|
44
|
-
chatButton.hide();
|
|
45
|
-
}
|
|
46
|
-
enviveFloatingButton.show();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
return {
|
|
51
|
-
toggle,
|
|
52
|
-
isSwitchEnabled,
|
|
53
|
-
};
|
|
54
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
-
declare global {
|
|
3
|
-
interface Window {
|
|
4
|
-
groove?: {
|
|
5
|
-
widget: {
|
|
6
|
-
open: () => void;
|
|
7
|
-
close: () => void;
|
|
8
|
-
shim: {
|
|
9
|
-
isOpen: boolean;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
interface UseGrooveUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
16
|
-
}
|
|
17
|
-
export declare const useGrooveUnifiedCXButton: ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }: UseGrooveUnifiedCXButtonProps) => UnifiedCXButton;
|
|
18
|
-
export {};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { SelectorFactory } from '@envive-ai/react-hooks/application/utils';
|
|
2
|
-
import { useElementObserver } from '@envive-ai/react-hooks/hooks/ElementObserver';
|
|
3
|
-
import { useRef } from 'react';
|
|
4
|
-
import { FLOATING_BUTTON_ID } from '../../widgets/FloatingChatWidget/constants';
|
|
5
|
-
export const useGrooveUnifiedCXButton = ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }) => {
|
|
6
|
-
const grooveChatContainer = useElementObserver(SelectorFactory.query('div[id*="groove-container"]'));
|
|
7
|
-
const windowGrooveWidget = window.groove?.widget;
|
|
8
|
-
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
9
|
-
const previousIsOpenRef = useRef(undefined);
|
|
10
|
-
const toggle = () => {
|
|
11
|
-
enviveFloatingButton.hide();
|
|
12
|
-
onSwitchToAgent();
|
|
13
|
-
if (windowGrooveWidget) {
|
|
14
|
-
windowGrooveWidget.open();
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
const isGrooveWidgetEnabled = () => !!windowGrooveWidget;
|
|
18
|
-
const isSwitchEnabled = () => isGrooveWidgetEnabled();
|
|
19
|
-
const hideEnviveFloatingButton = () => {
|
|
20
|
-
enviveFloatingButton.hide();
|
|
21
|
-
if (suppressMerchantButton && windowGrooveWidget) {
|
|
22
|
-
windowGrooveWidget.open();
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
const showEnviveFloatingButton = () => {
|
|
26
|
-
onCXClose?.();
|
|
27
|
-
enviveFloatingButton.show();
|
|
28
|
-
if (suppressMerchantButton && windowGrooveWidget) {
|
|
29
|
-
windowGrooveWidget.close();
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
grooveChatContainer.onChange(() => {
|
|
33
|
-
const isOpen = windowGrooveWidget?.shim.isOpen;
|
|
34
|
-
if (isOpen !== previousIsOpenRef.current) {
|
|
35
|
-
previousIsOpenRef.current = isOpen;
|
|
36
|
-
if (isOpen) {
|
|
37
|
-
hideEnviveFloatingButton();
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
showEnviveFloatingButton();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
return {
|
|
45
|
-
toggle,
|
|
46
|
-
isSwitchEnabled,
|
|
47
|
-
};
|
|
48
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
-
interface UseHelpScoutUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
3
|
-
}
|
|
4
|
-
export declare const useHelpScoutUnifiedCXButton: ({ onSwitchToAgent, suppressMerchantButton, }: UseHelpScoutUnifiedCXButtonProps) => UnifiedCXButton;
|
|
5
|
-
export {};
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { SelectorFactory } from '@envive-ai/react-hooks/application/utils';
|
|
2
|
-
import { useElementObserver } from '@envive-ai/react-hooks/hooks/ElementObserver';
|
|
3
|
-
import { FLOATING_BUTTON_ID } from '../../widgets/FloatingChatWidget/constants';
|
|
4
|
-
const BEACON_CONTAINER_ID = 'beacon-container';
|
|
5
|
-
export const useHelpScoutUnifiedCXButton = ({ onSwitchToAgent, suppressMerchantButton, }) => {
|
|
6
|
-
const beaconContainer = useElementObserver(SelectorFactory.id(BEACON_CONTAINER_ID));
|
|
7
|
-
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
8
|
-
const toggle = () => {
|
|
9
|
-
onSwitchToAgent();
|
|
10
|
-
// Try using the Help Scout Beacon API first
|
|
11
|
-
if (typeof window.Beacon !== 'undefined') {
|
|
12
|
-
window.Beacon('open');
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
// Fallback: Find and click the FAB button
|
|
16
|
-
const container = document.getElementById(BEACON_CONTAINER_ID);
|
|
17
|
-
const fabButton = container?.querySelector('.BeaconFabButtonFrame');
|
|
18
|
-
if (fabButton) {
|
|
19
|
-
fabButton.style.display = '';
|
|
20
|
-
fabButton.click();
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
if (suppressMerchantButton) {
|
|
24
|
-
enviveFloatingButton.hide();
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
const isHelpScoutButtonEnabled = () => {
|
|
28
|
-
// Check for the main Help Scout Beacon container
|
|
29
|
-
const beaconContainerEl = document.getElementById('beacon-container');
|
|
30
|
-
if (!beaconContainerEl)
|
|
31
|
-
return false;
|
|
32
|
-
// Check for the FAB button (Floating Action Button) or the global Beacon API
|
|
33
|
-
const fabButton = beaconContainerEl.querySelector('.BeaconFabButtonFrame');
|
|
34
|
-
const hasBeaconAPI = typeof window.Beacon !== 'undefined';
|
|
35
|
-
return !!(fabButton || hasBeaconAPI);
|
|
36
|
-
};
|
|
37
|
-
const isSwitchEnabled = () => isHelpScoutButtonEnabled();
|
|
38
|
-
// Hide Help Scout FAB button when beacon container is added
|
|
39
|
-
beaconContainer.onAdd(() => {
|
|
40
|
-
if (suppressMerchantButton) {
|
|
41
|
-
const fabButton = document
|
|
42
|
-
.getElementById(BEACON_CONTAINER_ID)
|
|
43
|
-
?.querySelector('.BeaconFabButtonFrame');
|
|
44
|
-
if (fabButton) {
|
|
45
|
-
fabButton.style.display = 'none';
|
|
46
|
-
}
|
|
47
|
-
enviveFloatingButton.show();
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
// Observe the beacon container for visibility changes
|
|
51
|
-
// Help Scout Beacon adds/removes classes to show/hide the widget
|
|
52
|
-
beaconContainer.onChange(el => {
|
|
53
|
-
if (el && suppressMerchantButton) {
|
|
54
|
-
// Check if the BeaconContainer widget is open
|
|
55
|
-
const beaconWidget = el.querySelector('.BeaconContainer');
|
|
56
|
-
const fabButton = el.querySelector('.BeaconFabButtonFrame');
|
|
57
|
-
if (beaconWidget && fabButton) {
|
|
58
|
-
const { classList } = beaconWidget;
|
|
59
|
-
// When beacon is open (has enter-done class)
|
|
60
|
-
if (classList.contains('BeaconContainer-enter-done') ||
|
|
61
|
-
classList.contains('BeaconContainer-enter-active')) {
|
|
62
|
-
fabButton.style.display = '';
|
|
63
|
-
enviveFloatingButton.hide();
|
|
64
|
-
}
|
|
65
|
-
// When beacon is closed (has exit class)
|
|
66
|
-
if (classList.contains('BeaconContainer-exit') ||
|
|
67
|
-
classList.contains('BeaconContainer-exit-active')) {
|
|
68
|
-
fabButton.style.display = 'none';
|
|
69
|
-
enviveFloatingButton.show();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
// Cleanup when container is removed
|
|
75
|
-
beaconContainer.onRemove(() => {
|
|
76
|
-
if (suppressMerchantButton) {
|
|
77
|
-
enviveFloatingButton.show();
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
return {
|
|
81
|
-
toggle,
|
|
82
|
-
isSwitchEnabled,
|
|
83
|
-
};
|
|
84
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
-
interface UseKustomerUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
3
|
-
}
|
|
4
|
-
export declare const useKustomerUnifiedCXButton: ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }: UseKustomerUnifiedCXButtonProps) => UnifiedCXButton;
|
|
5
|
-
export {};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { SelectorFactory } from '@envive-ai/react-hooks/application/utils';
|
|
2
|
-
import { useElementObserver } from '@envive-ai/react-hooks/hooks/ElementObserver';
|
|
3
|
-
import { FLOATING_BUTTON_ID } from '../../widgets/FloatingChatWidget/constants';
|
|
4
|
-
export const useKustomerUnifiedCXButton = ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }) => {
|
|
5
|
-
const kustomerButton = useElementObserver(SelectorFactory.chain('id|kustomer-ui-sdk-iframe @ query|div[role="button"]'));
|
|
6
|
-
const kustomerNotification = useElementObserver(SelectorFactory.chain('id|kustomer-ui-sdk-iframe @ query|div[class^="unread__unread"]'));
|
|
7
|
-
const kustomerWidgetRoot = useElementObserver(SelectorFactory.chain('id|kustomer-ui-sdk-iframe @ id|root'));
|
|
8
|
-
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
9
|
-
const toggle = () => {
|
|
10
|
-
onSwitchToAgent();
|
|
11
|
-
enviveFloatingButton.hide();
|
|
12
|
-
kustomerButton.show();
|
|
13
|
-
kustomerButton.fire('click');
|
|
14
|
-
};
|
|
15
|
-
const isKustomerButtonEnabled = () => {
|
|
16
|
-
const kustomerButtonElement = document.getElementById('kustomer-ui-sdk-iframe')?.contentWindow?.document.getElementById('root')?.children?.length;
|
|
17
|
-
return !!kustomerButtonElement;
|
|
18
|
-
};
|
|
19
|
-
const isSwitchEnabled = () => isKustomerButtonEnabled();
|
|
20
|
-
kustomerButton.onAdd(() => {
|
|
21
|
-
if (suppressMerchantButton) {
|
|
22
|
-
kustomerButton.hide();
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
kustomerNotification.onAdd(() => {
|
|
26
|
-
if (suppressMerchantButton) {
|
|
27
|
-
kustomerNotification.hide();
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
kustomerWidgetRoot.onChange(async (el) => {
|
|
31
|
-
for (const child of el?.children || []) {
|
|
32
|
-
if ([...child.classList].some(cls => cls.includes('widget__widgetWrapper'))) {
|
|
33
|
-
enviveFloatingButton.hide();
|
|
34
|
-
if (suppressMerchantButton) {
|
|
35
|
-
kustomerButton.show();
|
|
36
|
-
kustomerNotification.show();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
else if ([...child.classList].some(cls => cls.includes('chatRootIcon__chatIconWrapper'))) {
|
|
40
|
-
onCXClose?.();
|
|
41
|
-
enviveFloatingButton.show();
|
|
42
|
-
if (suppressMerchantButton) {
|
|
43
|
-
kustomerButton.hide();
|
|
44
|
-
kustomerNotification.hide();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
const observer = new MutationObserver(() => {
|
|
50
|
-
const iframe = document.getElementById('kustomer-ui-sdk-iframe');
|
|
51
|
-
const button = iframe.contentWindow?.document.querySelector('div[role="button"]');
|
|
52
|
-
const notification = iframe.contentWindow?.document.querySelector('div[class^="unread__unread"]');
|
|
53
|
-
if (button && suppressMerchantButton) {
|
|
54
|
-
button.setAttribute('style', 'display: none;');
|
|
55
|
-
}
|
|
56
|
-
if (notification && suppressMerchantButton) {
|
|
57
|
-
notification.setAttribute('style', 'display: none;');
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
const kustomerIframe = document.getElementById('kustomer-ui-sdk-iframe');
|
|
61
|
-
if (kustomerIframe?.contentWindow?.document) {
|
|
62
|
-
observer.observe(kustomerIframe.contentWindow?.document, {
|
|
63
|
-
childList: true,
|
|
64
|
-
subtree: true,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
const removeUnifiedCXButton = () => {
|
|
68
|
-
kustomerButton.show();
|
|
69
|
-
kustomerNotification.show();
|
|
70
|
-
// Ensure that we are displaying the buttons when we are removing the unified CX button
|
|
71
|
-
const iframe = document.getElementById('kustomer-ui-sdk-iframe');
|
|
72
|
-
const button = iframe.contentWindow?.document.querySelector('div[role="button"]');
|
|
73
|
-
const notification = iframe.contentWindow?.document.querySelector('div[class^="unread__unread"]');
|
|
74
|
-
if (button) {
|
|
75
|
-
button.setAttribute('style', 'display: block;');
|
|
76
|
-
}
|
|
77
|
-
if (notification) {
|
|
78
|
-
notification.setAttribute('style', 'display: block;');
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
return {
|
|
82
|
-
toggle,
|
|
83
|
-
removeUnifiedCXButton,
|
|
84
|
-
isSwitchEnabled,
|
|
85
|
-
};
|
|
86
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
-
interface UseReDoUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
3
|
-
}
|
|
4
|
-
export declare const useReDoUnifiedCXButton: ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }: UseReDoUnifiedCXButtonProps) => UnifiedCXButton;
|
|
5
|
-
export {};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { useRef } from 'react';
|
|
2
|
-
import { SelectorFactory } from '@envive-ai/react-hooks/application/utils';
|
|
3
|
-
import { useElementObserver } from '@envive-ai/react-hooks/hooks/ElementObserver';
|
|
4
|
-
import { FLOATING_BUTTON_ID } from '../../widgets/FloatingChatWidget/constants';
|
|
5
|
-
const TIMEOUT = 700;
|
|
6
|
-
const REDO_CHAT_CONTAINER_SELECTOR = 'redo-chat-widget';
|
|
7
|
-
const REDO_CHAT_MODAL_SELECTOR = 'id|redo-chat-widget @ query|div > div';
|
|
8
|
-
const REDO_BUTTON_SELECTOR = 'id|redo-chat-widget @ query|div[data-target=supp-chat-bubble]';
|
|
9
|
-
export const useReDoUnifiedCXButton = ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }) => {
|
|
10
|
-
const chatContainer = useElementObserver(SelectorFactory.id(REDO_CHAT_CONTAINER_SELECTOR));
|
|
11
|
-
const chatModal = useElementObserver(SelectorFactory.chain(REDO_CHAT_MODAL_SELECTOR));
|
|
12
|
-
const chatButton = useElementObserver(SelectorFactory.chain(REDO_BUTTON_SELECTOR));
|
|
13
|
-
const applyCSSTimeout = useRef(undefined);
|
|
14
|
-
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
15
|
-
const toggle = () => {
|
|
16
|
-
onSwitchToAgent();
|
|
17
|
-
chatButton.show();
|
|
18
|
-
chatButton.fire('click');
|
|
19
|
-
enviveFloatingButton.hide();
|
|
20
|
-
};
|
|
21
|
-
const isReDoButtonEnabled = () => !!SelectorFactory.chain(REDO_BUTTON_SELECTOR).parse();
|
|
22
|
-
const isSwitchEnabled = () => isReDoButtonEnabled();
|
|
23
|
-
const hideReDoButtonCSS = (el) => {
|
|
24
|
-
const shadowRootEl = el?.shadowRoot;
|
|
25
|
-
if (!shadowRootEl) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const sheet = new CSSStyleSheet();
|
|
29
|
-
sheet.replaceSync(`
|
|
30
|
-
div[data-target=supp-chat-bubble] {
|
|
31
|
-
display: none;
|
|
32
|
-
}
|
|
33
|
-
`);
|
|
34
|
-
shadowRootEl.adoptedStyleSheets.push(sheet);
|
|
35
|
-
enviveFloatingButton.show();
|
|
36
|
-
};
|
|
37
|
-
chatButton.onAdd(() => {
|
|
38
|
-
if (suppressMerchantButton) {
|
|
39
|
-
hideReDoButtonCSS(chatContainer.targetNode);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
chatContainer.onAdd(el => {
|
|
43
|
-
if (suppressMerchantButton) {
|
|
44
|
-
hideReDoButtonCSS(el);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
chatModal.onChange(() => {
|
|
48
|
-
if (suppressMerchantButton) {
|
|
49
|
-
clearTimeout(applyCSSTimeout.current);
|
|
50
|
-
applyCSSTimeout.current = setTimeout(() => {
|
|
51
|
-
hideReDoButtonCSS(chatContainer.targetNode);
|
|
52
|
-
}, TIMEOUT);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
return {
|
|
56
|
-
toggle,
|
|
57
|
-
isSwitchEnabled,
|
|
58
|
-
};
|
|
59
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
-
interface UseRichpanelUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
3
|
-
}
|
|
4
|
-
export declare const useRichpanelUnifiedCXButton: ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }: UseRichpanelUnifiedCXButtonProps) => UnifiedCXButton;
|
|
5
|
-
export {};
|