@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,62 +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 useRichpanelUnifiedCXButton = ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }) => {
|
|
5
|
-
const chatWindow = useElementObserver(SelectorFactory.chain('id|richpanel_messenger_iframe @ query|.rp-messenger-container'));
|
|
6
|
-
const chatButton = useElementObserver(SelectorFactory.query('.rp-messenger-trigger'));
|
|
7
|
-
const chatAlternativeButton = useElementObserver(SelectorFactory.query('.rp-micro-app-dummy-icon'));
|
|
8
|
-
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
9
|
-
const toggle = () => {
|
|
10
|
-
chatWindow.show();
|
|
11
|
-
onSwitchToAgent();
|
|
12
|
-
enviveFloatingButton.hide();
|
|
13
|
-
if (chatButton) {
|
|
14
|
-
chatButton.show();
|
|
15
|
-
chatButton.fire('click');
|
|
16
|
-
}
|
|
17
|
-
if (chatAlternativeButton) {
|
|
18
|
-
chatAlternativeButton.show();
|
|
19
|
-
chatAlternativeButton.fire('click');
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
const isRichpanelButtonEnabled = () => {
|
|
23
|
-
return !!chatButton || !!chatAlternativeButton;
|
|
24
|
-
};
|
|
25
|
-
const isSwitchEnabled = () => isRichpanelButtonEnabled();
|
|
26
|
-
chatButton.onAdd(() => {
|
|
27
|
-
if (suppressMerchantButton) {
|
|
28
|
-
chatButton.hide();
|
|
29
|
-
chatWindow.hide();
|
|
30
|
-
}
|
|
31
|
-
enviveFloatingButton.show();
|
|
32
|
-
});
|
|
33
|
-
chatAlternativeButton.onAdd(() => {
|
|
34
|
-
if (suppressMerchantButton) {
|
|
35
|
-
chatAlternativeButton.hide();
|
|
36
|
-
chatWindow.hide();
|
|
37
|
-
}
|
|
38
|
-
enviveFloatingButton.show();
|
|
39
|
-
});
|
|
40
|
-
chatWindow.onChange(el => {
|
|
41
|
-
if (el) {
|
|
42
|
-
const { classList } = el;
|
|
43
|
-
if (classList.contains('opened')) {
|
|
44
|
-
enviveFloatingButton.hide();
|
|
45
|
-
chatWindow.show();
|
|
46
|
-
}
|
|
47
|
-
else if (classList.length === 1 && classList.contains('rp-messenger-container')) {
|
|
48
|
-
onCXClose?.();
|
|
49
|
-
enviveFloatingButton.show();
|
|
50
|
-
if (suppressMerchantButton) {
|
|
51
|
-
chatButton.hide();
|
|
52
|
-
chatAlternativeButton.hide();
|
|
53
|
-
chatWindow.hide();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
return {
|
|
59
|
-
toggle,
|
|
60
|
-
isSwitchEnabled,
|
|
61
|
-
};
|
|
62
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
-
interface UseShopifyChatUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
3
|
-
}
|
|
4
|
-
export declare const useShopifyChatUnifiedCXButton: ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }: UseShopifyChatUnifiedCXButtonProps) => UnifiedCXButton;
|
|
5
|
-
export {};
|
|
@@ -1,49 +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 useShopifyChatUnifiedCXButton = ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }) => {
|
|
5
|
-
const shopifyChatContainer = useElementObserver(SelectorFactory.id('ShopifyChat'));
|
|
6
|
-
const shopifyButton = useElementObserver(SelectorFactory.chain('id|ShopifyChat @ query|.chat-app > button'));
|
|
7
|
-
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
8
|
-
const toggle = () => {
|
|
9
|
-
enviveFloatingButton.hide();
|
|
10
|
-
shopifyButton.show();
|
|
11
|
-
onSwitchToAgent();
|
|
12
|
-
shopifyButton.fire('click');
|
|
13
|
-
};
|
|
14
|
-
const isShopifyButtonEnabled = () => {
|
|
15
|
-
return !!shopifyButton;
|
|
16
|
-
};
|
|
17
|
-
const isSwitchEnabled = () => isShopifyButtonEnabled();
|
|
18
|
-
const handleChatStateChange = async (isOpen) => {
|
|
19
|
-
if (isOpen) {
|
|
20
|
-
enviveFloatingButton.hide();
|
|
21
|
-
if (suppressMerchantButton) {
|
|
22
|
-
shopifyButton.show();
|
|
23
|
-
}
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
onCXClose?.();
|
|
27
|
-
enviveFloatingButton.show();
|
|
28
|
-
if (suppressMerchantButton) {
|
|
29
|
-
shopifyButton.hide();
|
|
30
|
-
shopifyChatContainer.hide();
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
shopifyButton.onAdd(() => {
|
|
34
|
-
const isOpen = shopifyChatContainer.targetNode?.getAttribute('is-open') === 'true';
|
|
35
|
-
handleChatStateChange(isOpen);
|
|
36
|
-
});
|
|
37
|
-
shopifyChatContainer.onAdd(el => {
|
|
38
|
-
const isOpen = el?.getAttribute('is-open') === 'true';
|
|
39
|
-
handleChatStateChange(isOpen);
|
|
40
|
-
});
|
|
41
|
-
shopifyChatContainer.onChange(el => {
|
|
42
|
-
const isOpen = el?.getAttribute('is-open') === 'true';
|
|
43
|
-
handleChatStateChange(isOpen);
|
|
44
|
-
});
|
|
45
|
-
return {
|
|
46
|
-
toggle,
|
|
47
|
-
isSwitchEnabled,
|
|
48
|
-
};
|
|
49
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
-
interface UseTalkdeskUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
3
|
-
}
|
|
4
|
-
export declare const useTalkdeskUnifiedCXButton: ({ onSwitchToAgent, suppressMerchantButton, }: UseTalkdeskUnifiedCXButtonProps) => UnifiedCXButton;
|
|
5
|
-
export {};
|
|
@@ -1,77 +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 useTalkdeskUnifiedCXButton = ({ onSwitchToAgent, suppressMerchantButton, }) => {
|
|
5
|
-
const talkdeskButton = useElementObserver(SelectorFactory.id('talkdesk-chat-widget-trigger'));
|
|
6
|
-
const talkdeskWidget = useElementObserver(SelectorFactory.id('talkdesk-chat-widget'));
|
|
7
|
-
const talkdeskContainer = useElementObserver(SelectorFactory.id('tdWebchat'));
|
|
8
|
-
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
9
|
-
const toggle = () => {
|
|
10
|
-
onSwitchToAgent();
|
|
11
|
-
if (suppressMerchantButton) {
|
|
12
|
-
enviveFloatingButton.hide();
|
|
13
|
-
}
|
|
14
|
-
talkdeskButton.show();
|
|
15
|
-
talkdeskButton.fire('click');
|
|
16
|
-
};
|
|
17
|
-
const isTalkdeskButtonEnabled = () => {
|
|
18
|
-
// Check for the main Talkdesk container
|
|
19
|
-
const talkdeskMainContainer = document.getElementById('tdWebchat');
|
|
20
|
-
if (!talkdeskMainContainer)
|
|
21
|
-
return false;
|
|
22
|
-
// Check for the trigger button (it's directly in the DOM, not inside an iframe)
|
|
23
|
-
const talkdeskTriggerButton = document.getElementById('talkdesk-chat-widget-trigger');
|
|
24
|
-
return !!talkdeskTriggerButton;
|
|
25
|
-
};
|
|
26
|
-
const isSwitchEnabled = () => isTalkdeskButtonEnabled();
|
|
27
|
-
// Hide Talkdesk button when it's added to DOM (if suppressMerchantButton is enabled)
|
|
28
|
-
talkdeskButton.onAdd(() => {
|
|
29
|
-
if (suppressMerchantButton) {
|
|
30
|
-
talkdeskButton.hide();
|
|
31
|
-
enviveFloatingButton.show();
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
// Observe the widget container (NOT the button) to avoid infinite loops
|
|
35
|
-
talkdeskWidget.onAdd(el => {
|
|
36
|
-
if (el && suppressMerchantButton) {
|
|
37
|
-
const ariaHidden = el.getAttribute('aria-hidden');
|
|
38
|
-
// Widget is open initially (aria-hidden="false")
|
|
39
|
-
if (ariaHidden === 'false') {
|
|
40
|
-
talkdeskButton.show();
|
|
41
|
-
enviveFloatingButton.hide();
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
// Widget is closed initially
|
|
45
|
-
talkdeskButton.hide();
|
|
46
|
-
enviveFloatingButton.show();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
// Track widget visibility changes
|
|
51
|
-
talkdeskWidget.onChange(el => {
|
|
52
|
-
if (el && suppressMerchantButton) {
|
|
53
|
-
const ariaHidden = el.getAttribute('aria-hidden');
|
|
54
|
-
// Widget is open (aria-hidden="false")
|
|
55
|
-
if (ariaHidden === 'false') {
|
|
56
|
-
talkdeskButton.show();
|
|
57
|
-
enviveFloatingButton.hide();
|
|
58
|
-
}
|
|
59
|
-
// Widget is closed (aria-hidden="true")
|
|
60
|
-
if (ariaHidden === 'true') {
|
|
61
|
-
talkdeskButton.hide();
|
|
62
|
-
enviveFloatingButton.show();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
// Cleanup when container is removed
|
|
67
|
-
talkdeskContainer.onRemove(() => {
|
|
68
|
-
if (suppressMerchantButton) {
|
|
69
|
-
talkdeskButton.hide();
|
|
70
|
-
enviveFloatingButton.show();
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
return {
|
|
74
|
-
toggle,
|
|
75
|
-
isSwitchEnabled,
|
|
76
|
-
};
|
|
77
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
-
declare global {
|
|
3
|
-
interface Window {
|
|
4
|
-
tidioChatApi?: {
|
|
5
|
-
open: () => void;
|
|
6
|
-
close: () => void;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
interface UseTidioUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
11
|
-
}
|
|
12
|
-
export declare const useTidioUnifiedCXButton: ({ onSwitchToAgent, }: UseTidioUnifiedCXButtonProps) => UnifiedCXButton;
|
|
13
|
-
export {};
|
|
@@ -1,20 +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 useTidioUnifiedCXButton = ({ onSwitchToAgent, }) => {
|
|
5
|
-
const tidioButton = window.tidioChatApi;
|
|
6
|
-
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
7
|
-
const toggle = () => {
|
|
8
|
-
onSwitchToAgent();
|
|
9
|
-
enviveFloatingButton.hide();
|
|
10
|
-
if (tidioButton) {
|
|
11
|
-
tidioButton.open();
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
const isTidioButtonEnabled = () => !!document.getElementById('tidio-chat-iframe');
|
|
15
|
-
const isSwitchEnabled = () => isTidioButtonEnabled();
|
|
16
|
-
return {
|
|
17
|
-
toggle,
|
|
18
|
-
isSwitchEnabled,
|
|
19
|
-
};
|
|
20
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
-
interface UseZendeskUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
3
|
-
}
|
|
4
|
-
export declare const useZendeskUnifiedCXButton: ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }: UseZendeskUnifiedCXButtonProps) => UnifiedCXButton;
|
|
5
|
-
export {};
|
|
@@ -1,55 +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 useZendeskUnifiedCXButton = ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }) => {
|
|
5
|
-
const zendeskButton = useElementObserver(SelectorFactory.chain('query|iframe#launcher @ query|button'));
|
|
6
|
-
const zendeskAlternativeIframe = useElementObserver(SelectorFactory.chain('id|webWidget'));
|
|
7
|
-
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
8
|
-
const zendeskIframe = useElementObserver(SelectorFactory.query('iframe#launcher'));
|
|
9
|
-
const toggle = () => {
|
|
10
|
-
zendeskIframe.hide();
|
|
11
|
-
onSwitchToAgent();
|
|
12
|
-
zendeskButton.fire('click');
|
|
13
|
-
enviveFloatingButton.hide();
|
|
14
|
-
};
|
|
15
|
-
const isZendeskButtonEnabled = () => {
|
|
16
|
-
const zendeskMainButton = document?.getElementById('launcher')?.contentWindow?.document?.querySelector('button');
|
|
17
|
-
return !!zendeskMainButton;
|
|
18
|
-
};
|
|
19
|
-
const isSwitchEnabled = () => isZendeskButtonEnabled();
|
|
20
|
-
zendeskIframe.onAdd(() => {
|
|
21
|
-
if (suppressMerchantButton) {
|
|
22
|
-
enviveFloatingButton.show();
|
|
23
|
-
zendeskIframe.hide();
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
zendeskButton.onChange(el => {
|
|
27
|
-
if (el) {
|
|
28
|
-
const ariaLabel = el.getAttribute('aria-label');
|
|
29
|
-
if (ariaLabel === 'Open messaging window') {
|
|
30
|
-
onCXClose?.();
|
|
31
|
-
enviveFloatingButton.show();
|
|
32
|
-
if (suppressMerchantButton) {
|
|
33
|
-
zendeskIframe.hide();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
if (ariaLabel === 'Close messaging window') {
|
|
37
|
-
enviveFloatingButton.hide();
|
|
38
|
-
if (suppressMerchantButton) {
|
|
39
|
-
zendeskIframe.show();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
zendeskAlternativeIframe.onRemove(() => {
|
|
45
|
-
onCXClose?.();
|
|
46
|
-
if (suppressMerchantButton) {
|
|
47
|
-
enviveFloatingButton.show();
|
|
48
|
-
zendeskIframe.hide();
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
return {
|
|
52
|
-
toggle,
|
|
53
|
-
isSwitchEnabled,
|
|
54
|
-
};
|
|
55
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
-
declare global {
|
|
3
|
-
interface Window {
|
|
4
|
-
Zowie?: {
|
|
5
|
-
open: () => void;
|
|
6
|
-
close: () => void;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
interface UseZowieUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
11
|
-
}
|
|
12
|
-
export declare const useZowieUnifiedCXButton: ({ onSwitchToAgent, }: UseZowieUnifiedCXButtonProps) => UnifiedCXButton;
|
|
13
|
-
export {};
|
|
@@ -1,20 +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 useZowieUnifiedCXButton = ({ onSwitchToAgent, }) => {
|
|
5
|
-
const zowieButton = window?.Zowie;
|
|
6
|
-
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
7
|
-
const toggle = () => {
|
|
8
|
-
onSwitchToAgent();
|
|
9
|
-
enviveFloatingButton.hide();
|
|
10
|
-
if (zowieButton) {
|
|
11
|
-
zowieButton?.open();
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
const isZowieButtonEnabled = () => !!zowieButton;
|
|
15
|
-
const isSwitchEnabled = () => isZowieButtonEnabled();
|
|
16
|
-
return {
|
|
17
|
-
toggle,
|
|
18
|
-
isSwitchEnabled,
|
|
19
|
-
};
|
|
20
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export declare enum CustomerServiceType {
|
|
2
|
-
shopify = "shopify",
|
|
3
|
-
gorgias = "gorgias",
|
|
4
|
-
kustomer = "kustomer",
|
|
5
|
-
groove = "groove",
|
|
6
|
-
tidio = "tidio",
|
|
7
|
-
zowie = "zowie",
|
|
8
|
-
redo = "redo",
|
|
9
|
-
gladly = "gladly",
|
|
10
|
-
richpanel = "richpanel",
|
|
11
|
-
zendesk = "zendesk",
|
|
12
|
-
helpscout = "helpscout",
|
|
13
|
-
talkdesk = "talkdesk",
|
|
14
|
-
eightByEight = "8x8",
|
|
15
|
-
unsupported = "unsupported"
|
|
16
|
-
}
|
|
17
|
-
export interface UnifiedCXButton {
|
|
18
|
-
isSwitchEnabled: () => boolean;
|
|
19
|
-
toggle: () => void;
|
|
20
|
-
removeUnifiedCXButton?: () => void;
|
|
21
|
-
}
|
|
22
|
-
export interface CustomerServiceImplProps {
|
|
23
|
-
onSwitchToAgent: () => void;
|
|
24
|
-
onCXClose?: () => void;
|
|
25
|
-
suppressMerchantButton?: boolean;
|
|
26
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export var CustomerServiceType;
|
|
2
|
-
(function (CustomerServiceType) {
|
|
3
|
-
CustomerServiceType["shopify"] = "shopify";
|
|
4
|
-
CustomerServiceType["gorgias"] = "gorgias";
|
|
5
|
-
CustomerServiceType["kustomer"] = "kustomer";
|
|
6
|
-
CustomerServiceType["groove"] = "groove";
|
|
7
|
-
CustomerServiceType["tidio"] = "tidio";
|
|
8
|
-
CustomerServiceType["zowie"] = "zowie";
|
|
9
|
-
CustomerServiceType["redo"] = "redo";
|
|
10
|
-
CustomerServiceType["gladly"] = "gladly";
|
|
11
|
-
CustomerServiceType["richpanel"] = "richpanel";
|
|
12
|
-
CustomerServiceType["zendesk"] = "zendesk";
|
|
13
|
-
CustomerServiceType["helpscout"] = "helpscout";
|
|
14
|
-
CustomerServiceType["talkdesk"] = "talkdesk";
|
|
15
|
-
CustomerServiceType["eightByEight"] = "8x8";
|
|
16
|
-
CustomerServiceType["unsupported"] = "unsupported";
|
|
17
|
-
})(CustomerServiceType || (CustomerServiceType = {}));
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { CustomerServiceType } from '../types';
|
|
2
|
-
import { useGrooveUnifiedCXButton } from '../implementations/useGrooveUnifiedCXButton';
|
|
3
|
-
import { useShopifyChatUnifiedCXButton } from '../implementations/useShopifyChatUnifiedCXButton';
|
|
4
|
-
import { useGladlyUnifiedCXButton } from '../implementations/useGladlyUnifiedCXButton';
|
|
5
|
-
import { useGorgiasUnifiedCXButton } from '../implementations/useGorgiasUnifiedCXButton';
|
|
6
|
-
import { useTidioUnifiedCXButton } from '../implementations/useTidioUnifiedCXButton';
|
|
7
|
-
import { useZowieUnifiedCXButton } from '../implementations/useZowieUnifiedCXButton';
|
|
8
|
-
import { useReDoUnifiedCXButton } from '../implementations/useReDoUnifiedCXButton';
|
|
9
|
-
import { useRichpanelUnifiedCXButton } from '../implementations/useRichpanelUnifiedCXButton';
|
|
10
|
-
import { useZendeskUnifiedCXButton } from '../implementations/useZendeskUnifiedCXButton';
|
|
11
|
-
import { useKustomerUnifiedCXButton } from '../implementations/useKustomerUnifiedCXButton';
|
|
12
|
-
import { useHelpScoutUnifiedCXButton } from '../implementations/useHelpScoutUnifiedCXButton';
|
|
13
|
-
import { useTalkdeskUnifiedCXButton } from '../implementations/useTalkdeskUnifiedCXButton';
|
|
14
|
-
import { useEightByEightUnifiedCXButton } from '../implementations/useEightByEightUnifiedCXButton';
|
|
15
|
-
import { useDefaultUnifiedCXButton } from '../implementations/useDefaultUnifiedCXButton';
|
|
16
|
-
export const findCustomerServiceImpl = (provider) => {
|
|
17
|
-
if (provider === CustomerServiceType.kustomer) {
|
|
18
|
-
return useKustomerUnifiedCXButton;
|
|
19
|
-
}
|
|
20
|
-
if (provider === CustomerServiceType.groove) {
|
|
21
|
-
return useGrooveUnifiedCXButton;
|
|
22
|
-
}
|
|
23
|
-
if (provider === CustomerServiceType.gladly) {
|
|
24
|
-
return useGladlyUnifiedCXButton;
|
|
25
|
-
}
|
|
26
|
-
if (provider === CustomerServiceType.shopify) {
|
|
27
|
-
return useShopifyChatUnifiedCXButton;
|
|
28
|
-
}
|
|
29
|
-
if (provider === CustomerServiceType.gorgias) {
|
|
30
|
-
return useGorgiasUnifiedCXButton;
|
|
31
|
-
}
|
|
32
|
-
if (provider === CustomerServiceType.tidio) {
|
|
33
|
-
return useTidioUnifiedCXButton;
|
|
34
|
-
}
|
|
35
|
-
if (provider === CustomerServiceType.zowie) {
|
|
36
|
-
return useZowieUnifiedCXButton;
|
|
37
|
-
}
|
|
38
|
-
if (provider === CustomerServiceType.redo) {
|
|
39
|
-
return useReDoUnifiedCXButton;
|
|
40
|
-
}
|
|
41
|
-
if (provider === CustomerServiceType.richpanel) {
|
|
42
|
-
return useRichpanelUnifiedCXButton;
|
|
43
|
-
}
|
|
44
|
-
if (provider === CustomerServiceType.zendesk) {
|
|
45
|
-
return useZendeskUnifiedCXButton;
|
|
46
|
-
}
|
|
47
|
-
if (provider === CustomerServiceType.helpscout) {
|
|
48
|
-
return useHelpScoutUnifiedCXButton;
|
|
49
|
-
}
|
|
50
|
-
if (provider === CustomerServiceType.talkdesk) {
|
|
51
|
-
return useTalkdeskUnifiedCXButton;
|
|
52
|
-
}
|
|
53
|
-
if (provider === CustomerServiceType.eightByEight) {
|
|
54
|
-
return useEightByEightUnifiedCXButton;
|
|
55
|
-
}
|
|
56
|
-
return useDefaultUnifiedCXButton;
|
|
57
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
|
-
type SelectType = 'priority';
|
|
3
|
-
interface SelectProps {
|
|
4
|
-
type: SelectType;
|
|
5
|
-
selectedKey: string;
|
|
6
|
-
onSelect?: (key: string) => void;
|
|
7
|
-
buttonStyle?: CSSProperties;
|
|
8
|
-
menuStyle?: CSSProperties;
|
|
9
|
-
}
|
|
10
|
-
export declare function GenericSelect({ type, selectedKey, onSelect, buttonStyle, menuStyle, }: Readonly<SelectProps>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useRef, useState } from 'react';
|
|
3
|
-
const dictionaries = {
|
|
4
|
-
priority: {
|
|
5
|
-
p0: { label: 'Urgent' },
|
|
6
|
-
p1: { label: 'High' },
|
|
7
|
-
p2: { label: 'Medium' },
|
|
8
|
-
p3: { label: 'Low' },
|
|
9
|
-
'no priority': { label: 'No Priority' },
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
// Inline styles for Shadow DOM compatibility
|
|
13
|
-
const styles = {
|
|
14
|
-
button: {
|
|
15
|
-
display: 'flex',
|
|
16
|
-
alignItems: 'center',
|
|
17
|
-
gap: '0.5rem',
|
|
18
|
-
fontSize: '0.75rem',
|
|
19
|
-
backgroundColor: 'transparent',
|
|
20
|
-
padding: '0.375rem 0.75rem',
|
|
21
|
-
borderRadius: '0.375rem',
|
|
22
|
-
cursor: 'pointer',
|
|
23
|
-
outline: 'none',
|
|
24
|
-
border: 'none',
|
|
25
|
-
},
|
|
26
|
-
buttonHover: {
|
|
27
|
-
backgroundColor: '#f9fafb',
|
|
28
|
-
},
|
|
29
|
-
dropdown: {
|
|
30
|
-
position: 'absolute',
|
|
31
|
-
left: '0',
|
|
32
|
-
zIndex: 10,
|
|
33
|
-
marginTop: '4px',
|
|
34
|
-
borderRadius: '8px',
|
|
35
|
-
width: '125px',
|
|
36
|
-
backgroundColor: 'white',
|
|
37
|
-
boxShadow: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',
|
|
38
|
-
border: '1px solid rgba(0, 0, 0, 0.05)',
|
|
39
|
-
},
|
|
40
|
-
dropdownItem: {
|
|
41
|
-
display: 'flex',
|
|
42
|
-
width: '100%',
|
|
43
|
-
alignItems: 'center',
|
|
44
|
-
padding: '4px 8px',
|
|
45
|
-
fontSize: '12px',
|
|
46
|
-
cursor: 'pointer',
|
|
47
|
-
border: 'none',
|
|
48
|
-
backgroundColor: 'transparent',
|
|
49
|
-
textAlign: 'left',
|
|
50
|
-
},
|
|
51
|
-
dropdownItemHover: {
|
|
52
|
-
backgroundColor: '#EBEEF6',
|
|
53
|
-
},
|
|
54
|
-
container: {
|
|
55
|
-
marginLeft: '-1rem',
|
|
56
|
-
position: 'relative',
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
// Badge style generator function
|
|
60
|
-
const getBadgeStyles = (variant) => {
|
|
61
|
-
let backgroundColor;
|
|
62
|
-
let textColor;
|
|
63
|
-
switch (variant) {
|
|
64
|
-
case 'p0':
|
|
65
|
-
backgroundColor = '#940F24';
|
|
66
|
-
textColor = '#F9E8EA';
|
|
67
|
-
break;
|
|
68
|
-
case 'p1':
|
|
69
|
-
backgroundColor = '#F9E8EA';
|
|
70
|
-
textColor = '#940F24';
|
|
71
|
-
break;
|
|
72
|
-
case 'p2':
|
|
73
|
-
backgroundColor = '#FEEBCB';
|
|
74
|
-
textColor = '#C05621';
|
|
75
|
-
break;
|
|
76
|
-
case 'p3':
|
|
77
|
-
backgroundColor = '#E6F6F4';
|
|
78
|
-
textColor = '#007F6D';
|
|
79
|
-
break;
|
|
80
|
-
default:
|
|
81
|
-
backgroundColor = '#EBEEF6';
|
|
82
|
-
textColor = '#3C57AA';
|
|
83
|
-
}
|
|
84
|
-
// Using fixed medium size values
|
|
85
|
-
return {
|
|
86
|
-
display: 'inline-flex',
|
|
87
|
-
borderRadius: '4px',
|
|
88
|
-
backgroundColor,
|
|
89
|
-
color: textColor,
|
|
90
|
-
fontSize: '0.875rem',
|
|
91
|
-
paddingLeft: '0.625rem',
|
|
92
|
-
paddingRight: '0.625rem',
|
|
93
|
-
paddingTop: '0.25rem',
|
|
94
|
-
paddingBottom: '0.25rem',
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
export function GenericSelect({ type, selectedKey, onSelect, buttonStyle = {}, menuStyle = {}, }) {
|
|
98
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
99
|
-
const [isHovering, setIsHovering] = useState(null);
|
|
100
|
-
const menuRef = useRef(null);
|
|
101
|
-
const dictionary = dictionaries[type];
|
|
102
|
-
const renderItem = (key, item) => {
|
|
103
|
-
const chipItem = item;
|
|
104
|
-
const badgeStyles = getBadgeStyles(key);
|
|
105
|
-
return _jsx("span", { style: badgeStyles, children: chipItem.label });
|
|
106
|
-
};
|
|
107
|
-
// Close menu when clicking outside
|
|
108
|
-
React.useEffect(() => {
|
|
109
|
-
const handleClickOutside = (event) => {
|
|
110
|
-
// Check if the click target is within our menu ref
|
|
111
|
-
const isOutside = menuRef.current && !menuRef.current.contains(event.target);
|
|
112
|
-
// Also check the event path (for Shadow DOM compatibility)
|
|
113
|
-
const path = event.composedPath ? event.composedPath() : [];
|
|
114
|
-
const isInPath = menuRef.current && path.includes(menuRef.current);
|
|
115
|
-
// Only close if truly outside (not in the path)
|
|
116
|
-
if (isOutside && !isInPath) {
|
|
117
|
-
setIsOpen(false);
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
document.addEventListener('mouseup', handleClickOutside, true);
|
|
121
|
-
return () => {
|
|
122
|
-
document.removeEventListener('mouseup', handleClickOutside, true);
|
|
123
|
-
};
|
|
124
|
-
}, [isOpen]);
|
|
125
|
-
if (!dictionary) {
|
|
126
|
-
console.error(`Invalid type "${type}".`);
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
return (_jsxs("div", { style: styles.container, ref: menuRef, children: [_jsx("button", { type: "button", style: {
|
|
130
|
-
...styles.button,
|
|
131
|
-
...(isHovering === 'button' ? styles.buttonHover : {}),
|
|
132
|
-
...buttonStyle,
|
|
133
|
-
}, onClick: () => {
|
|
134
|
-
setIsOpen(!isOpen);
|
|
135
|
-
}, onMouseEnter: () => setIsHovering('button'), onMouseLeave: () => setIsHovering(null), children: dictionary[selectedKey] ? (renderItem(selectedKey, dictionary[selectedKey])) : (_jsx("span", { style: { color: '#6b7280' }, children: `Select ${type.charAt(0).toUpperCase() + type.slice(1)}` })) }), isOpen && (_jsx("div", { style: {
|
|
136
|
-
...styles.dropdown,
|
|
137
|
-
...menuStyle,
|
|
138
|
-
}, children: _jsx("div", { style: { padding: '0.25rem 0' }, children: Object.entries(dictionary)
|
|
139
|
-
.filter(([key]) => key !== selectedKey)
|
|
140
|
-
.map(([key, item]) => (_jsx("button", { type: "button", style: {
|
|
141
|
-
...styles.dropdownItem,
|
|
142
|
-
...(isHovering === key ? styles.dropdownItemHover : {}),
|
|
143
|
-
}, onMouseEnter: () => setIsHovering(key), onMouseLeave: () => setIsHovering(null), onClick: e => {
|
|
144
|
-
// Stop event propagation to prevent handleClickOutside from firing
|
|
145
|
-
e.stopPropagation();
|
|
146
|
-
if (onSelect) {
|
|
147
|
-
onSelect(key);
|
|
148
|
-
}
|
|
149
|
-
setIsOpen(false);
|
|
150
|
-
}, children: renderItem(key, item) }, key))) }) }))] }));
|
|
151
|
-
}
|