@envive-ai/react-widgets-v3 0.3.14 → 0.3.15-alpha.1
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/debug/chatEmbed.cjs +1 -1
- package/dist/debug/chatEmbed.js +1 -1
- package/dist/debug/reportIssue.cjs +1 -1
- package/dist/debug/reportIssue.js +1 -1
- package/dist/hocs/withBaseWidget/types.d.cts +3 -3
- package/dist/hocs/withBaseWidget/types.d.ts +5 -3
- package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +2 -2
- package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
- package/dist/hooks/dist/application/models/api/widgetText.d.cts +8 -0
- package/dist/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.cts +12 -0
- package/dist/hooks/dist/contexts/types.d.cts +38 -0
- package/dist/hooks/dist/contexts/typesV3.d.cts +230 -0
- package/dist/hooks/dist/services/amplitudeService/eventNames.d.cts +43 -0
- package/dist/hooks/dist/types/customerService.d.cts +21 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/WidgetType.cjs +1 -0
- package/dist/packages/hooks/dist/application/models/api/orgConfigResults.d.ts +1 -0
- package/dist/packages/hooks/dist/application/models/api/widgetText.d.ts +8 -0
- package/dist/packages/hooks/dist/application/models/frontendConfig.d.ts +1 -0
- package/dist/packages/hooks/dist/contexts/amplitudeContext/amplitudeContext.d.ts +2 -0
- package/dist/packages/hooks/dist/contexts/amplitudeContext/index.d.ts +2 -0
- package/dist/packages/hooks/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.d.ts +2 -0
- package/dist/packages/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.ts +14 -0
- package/dist/packages/hooks/dist/contexts/hardcopyContext/index.d.ts +1 -0
- package/dist/packages/hooks/dist/contexts/types.d.ts +42 -0
- package/dist/packages/hooks/dist/contexts/typesV3.d.ts +230 -0
- package/dist/packages/hooks/dist/services/amplitudeService/amplitudeService.d.ts +1 -0
- package/dist/packages/hooks/dist/services/amplitudeService/eventNames.d.ts +43 -0
- package/dist/packages/hooks/dist/types/customerService.d.ts +21 -0
- package/dist/packages/icons/dist/IconCloseVariant.cjs +5 -6
- package/dist/packages/icons/dist/IconCloseVariant.js +4 -6
- package/dist/packages/widgets/dist/SearchResults/SearchResults.d.ts +4 -3
- package/dist/packages/widgets/dist/SearchResults/SearchResultsWidget.d.ts +2 -2
- package/dist/packages/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.ts +2 -2
- package/dist/packages/widgets/dist/SearchZeroState/index.d.ts +2 -1
- package/dist/packages/widgets/dist/SearchZeroState/types.d.ts +2 -2
- package/dist/packages/widgets/dist/SuggestionBar/SuggestionBar.d.ts +3 -3
- package/dist/packages/widgets/dist/SuggestionButtonContainer/index.d.ts +2 -0
- package/dist/packages/widgets/dist/SuggestionButtonContainer/types.d.ts +3 -2
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/api/response.d.ts +14 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/api/search.d.ts +15 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCase.d.ts +73 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts +61 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/utilityTypes/internal.d.ts +25 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/utilityTypes/splitWords.d.ts +35 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/utilityTypes/trim.d.ts +32 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.ts +32 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/variantInfo/variantInfo.d.ts +1 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/atoms/search/searchAPI.d.ts +15 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.ts +1 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/contexts/types.d.ts +63 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/hooks/Search/useSearch.d.ts +60 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/hooks/utils.d.ts +13 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/types/OrgInfo.d.ts +1 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/types/index.d.ts +1 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/types/search-filter-types.d.ts +28 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/types/test-types.d.ts +10 -0
- package/dist/src/CXIntegration/hooks/useUnifiedCXButton.d.ts +10 -0
- package/dist/src/CXIntegration/hooks/useUnifiedCXButton.js +29 -0
- package/dist/src/CXIntegration/implementations/useDefaultUnifiedCXButton.d.ts +2 -0
- package/dist/src/CXIntegration/implementations/useDefaultUnifiedCXButton.js +6 -0
- package/dist/src/CXIntegration/implementations/useEightByEightUnifiedCXButton.d.ts +5 -0
- package/dist/src/CXIntegration/implementations/useEightByEightUnifiedCXButton.js +63 -0
- package/dist/src/CXIntegration/implementations/useGladlyUnifiedCXButton.d.ts +5 -0
- package/dist/src/CXIntegration/implementations/useGladlyUnifiedCXButton.js +23 -0
- package/dist/src/CXIntegration/implementations/useGorgiasUnifiedCXButton.d.ts +5 -0
- package/dist/src/CXIntegration/implementations/useGorgiasUnifiedCXButton.js +54 -0
- package/dist/src/CXIntegration/implementations/useGrooveUnifiedCXButton.d.ts +18 -0
- package/dist/src/CXIntegration/implementations/useGrooveUnifiedCXButton.js +48 -0
- package/dist/src/CXIntegration/implementations/useHelpScoutUnifiedCXButton.d.ts +5 -0
- package/dist/src/CXIntegration/implementations/useHelpScoutUnifiedCXButton.js +84 -0
- package/dist/src/CXIntegration/implementations/useKustomerUnifiedCXButton.d.ts +5 -0
- package/dist/src/CXIntegration/implementations/useKustomerUnifiedCXButton.js +86 -0
- package/dist/src/CXIntegration/implementations/useReDoUnifiedCXButton.d.ts +5 -0
- package/dist/src/CXIntegration/implementations/useReDoUnifiedCXButton.js +59 -0
- package/dist/src/CXIntegration/implementations/useRichpanelUnifiedCXButton.d.ts +5 -0
- package/dist/src/CXIntegration/implementations/useRichpanelUnifiedCXButton.js +62 -0
- package/dist/src/CXIntegration/implementations/useShopifyChatUnifiedCXButton.d.ts +5 -0
- package/dist/src/CXIntegration/implementations/useShopifyChatUnifiedCXButton.js +49 -0
- package/dist/src/CXIntegration/implementations/useTalkdeskUnifiedCXButton.d.ts +5 -0
- package/dist/src/CXIntegration/implementations/useTalkdeskUnifiedCXButton.js +77 -0
- package/dist/src/CXIntegration/implementations/useTidioUnifiedCXButton.d.ts +13 -0
- package/dist/src/CXIntegration/implementations/useTidioUnifiedCXButton.js +20 -0
- package/dist/src/CXIntegration/implementations/useZendeskUnifiedCXButton.d.ts +5 -0
- package/dist/src/CXIntegration/implementations/useZendeskUnifiedCXButton.js +55 -0
- package/dist/src/CXIntegration/implementations/useZowieUnifiedCXButton.d.ts +13 -0
- package/dist/src/CXIntegration/implementations/useZowieUnifiedCXButton.js +20 -0
- package/dist/src/CXIntegration/types.d.ts +26 -0
- package/dist/src/CXIntegration/types.js +17 -0
- package/dist/src/CXIntegration/utils/functions.d.ts +2 -0
- package/dist/src/CXIntegration/utils/functions.js +57 -0
- package/dist/src/debug/GenericSelect.d.ts +11 -0
- package/dist/src/debug/GenericSelect.js +151 -0
- package/dist/src/debug/MessageContent.d.ts +4 -0
- package/dist/src/debug/MessageContent.js +87 -0
- package/dist/src/debug/chatEmbed.d.ts +2 -0
- package/dist/src/debug/chatEmbed.js +58 -0
- package/dist/src/debug/debugBar.d.ts +1 -0
- package/dist/src/debug/debugBar.js +9 -0
- package/dist/src/debug/reportIssue.d.ts +1 -0
- package/dist/src/debug/reportIssue.js +322 -0
- package/dist/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.d.ts +1 -0
- package/dist/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.js +452 -0
- package/dist/src/hocs/withBaseWidget/index.d.ts +2 -0
- package/dist/src/hocs/withBaseWidget/index.js +1 -0
- package/dist/src/hocs/withBaseWidget/types.d.ts +33 -0
- package/dist/src/hocs/withBaseWidget/types.js +0 -0
- package/dist/src/hocs/withBaseWidget/withBaseWidget.d.ts +5 -0
- package/dist/src/hocs/withBaseWidget/withBaseWidget.js +80 -0
- package/dist/src/stories/FloatingChatWidget.stories.d.ts +25 -0
- package/dist/src/stories/FloatingChatWidget.stories.js +44 -0
- package/dist/src/stories/FullPageSalesAgentWidget.stories.d.ts +31 -0
- package/dist/src/stories/FullPageSalesAgentWidget.stories.js +51 -0
- package/dist/src/stories/ProductCardWidget.stories.d.ts +31 -0
- package/dist/src/stories/ProductCardWidget.stories.js +44 -0
- package/dist/src/stories/PromptButtonCarouselWithImageWidget.stories.d.ts +31 -0
- package/dist/src/stories/PromptButtonCarouselWithImageWidget.stories.js +40 -0
- package/dist/src/stories/PromptCarouselWidget.stories.d.ts +31 -0
- package/dist/src/stories/PromptCarouselWidget.stories.js +40 -0
- package/dist/src/stories/SalesAgentTest/SalesAgentTest.d.ts +1 -0
- package/dist/src/stories/SalesAgentTest/SalesAgentTest.js +40 -0
- package/dist/src/stories/SalesAgentTest/SalesAgentTest.stories.d.ts +12 -0
- package/dist/src/stories/SalesAgentTest/SalesAgentTest.stories.js +12 -0
- 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 +6 -0
- package/dist/src/stories/SearchResults.stories.js +23 -0
- package/dist/src/stories/SearchZeroState.stories.d.ts +38 -0
- package/dist/src/stories/SearchZeroState.stories.js +42 -0
- package/dist/src/stories/SocialProofFlowWidget.stories.d.ts +35 -0
- package/dist/src/stories/SocialProofFlowWidget.stories.js +60 -0
- package/dist/src/stories/SuggestionBar.stories.d.ts +7 -0
- package/dist/src/stories/SuggestionBar.stories.js +36 -0
- package/dist/src/stories/TitledPromptCarouselWidget.stories.d.ts +32 -0
- package/dist/src/stories/TitledPromptCarouselWidget.stories.js +55 -0
- package/dist/src/stories/TypingAnimationFlowWidget.stories.d.ts +34 -0
- package/dist/src/stories/TypingAnimationFlowWidget.stories.js +51 -0
- package/dist/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +12 -0
- package/dist/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +112 -0
- package/dist/src/widgets/ChatPreviewComparisonWidget/index.d.ts +3 -0
- package/dist/src/widgets/ChatPreviewComparisonWidget/index.js +2 -0
- package/dist/src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +9 -0
- package/dist/src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js +34 -0
- package/dist/src/widgets/ChatPreviewLoadingWidget/index.d.ts +3 -0
- package/dist/src/widgets/ChatPreviewLoadingWidget/index.js +2 -0
- package/dist/src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +12 -0
- package/dist/src/widgets/ChatPreviewWidget/ChatPreviewWidget.js +111 -0
- package/dist/src/widgets/ChatPreviewWidget/__tests__/ChatPreviewWidget.test.d.ts +1 -0
- package/dist/src/widgets/ChatPreviewWidget/__tests__/ChatPreviewWidget.test.js +97 -0
- package/dist/src/widgets/ChatPreviewWidget/index.d.ts +3 -0
- package/dist/src/widgets/ChatPreviewWidget/index.js +2 -0
- package/dist/src/widgets/FloatingChatWidget/FloatingChatOverlay.d.ts +14 -0
- package/dist/src/widgets/FloatingChatWidget/FloatingChatOverlay.js +44 -0
- package/dist/src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +8 -0
- package/dist/src/widgets/FloatingChatWidget/FloatingChatWidget.js +134 -0
- package/dist/src/widgets/FloatingChatWidget/__tests__/FloatingChatWidget.test.d.ts +1 -0
- package/dist/src/widgets/FloatingChatWidget/__tests__/FloatingChatWidget.test.js +100 -0
- package/dist/src/widgets/FloatingChatWidget/constants.d.ts +1 -0
- package/dist/src/widgets/FloatingChatWidget/constants.js +1 -0
- package/dist/src/widgets/FloatingChatWidget/hooks/useAutoPopup.d.ts +4 -0
- package/dist/src/widgets/FloatingChatWidget/hooks/useAutoPopup.js +51 -0
- package/dist/src/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.d.ts +11 -0
- package/dist/src/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.js +21 -0
- package/dist/src/widgets/FloatingChatWidget/index.d.ts +4 -0
- package/dist/src/widgets/FloatingChatWidget/index.js +3 -0
- package/dist/src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +12 -0
- package/dist/src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.js +14 -0
- package/dist/src/widgets/FullPageSalesAgentWidget/index.d.ts +1 -0
- package/dist/src/widgets/FullPageSalesAgentWidget/index.js +1 -0
- package/dist/src/widgets/ProductCardWidget/ProductCardWidget.d.ts +7 -0
- package/dist/src/widgets/ProductCardWidget/ProductCardWidget.js +94 -0
- package/dist/src/widgets/ProductCardWidget/__tests__/ProductCardWidget.test.d.ts +1 -0
- package/dist/src/widgets/ProductCardWidget/__tests__/ProductCardWidget.test.js +106 -0
- package/dist/src/widgets/ProductCardWidget/index.d.ts +2 -0
- package/dist/src/widgets/ProductCardWidget/index.js +1 -0
- package/dist/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +12 -0
- package/dist/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +88 -0
- package/dist/src/widgets/PromptButtonCarouselWithImageWidget/__tests__/PromptButtonCarouselWithImageWidget.test.d.ts +1 -0
- package/dist/src/widgets/PromptButtonCarouselWithImageWidget/__tests__/PromptButtonCarouselWithImageWidget.test.js +132 -0
- package/dist/src/widgets/PromptButtonCarouselWithImageWidget/index.d.ts +2 -0
- package/dist/src/widgets/PromptButtonCarouselWithImageWidget/index.js +2 -0
- package/dist/src/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +7 -0
- package/dist/src/widgets/PromptCarouselWidget/PromptCarouselWidget.js +74 -0
- package/dist/src/widgets/PromptCarouselWidget/__tests__/PromptCarouselWidget.test.d.ts +1 -0
- package/dist/src/widgets/PromptCarouselWidget/__tests__/PromptCarouselWidget.test.js +106 -0
- package/dist/src/widgets/PromptCarouselWidget/index.d.ts +2 -0
- package/dist/src/widgets/PromptCarouselWidget/index.js +1 -0
- package/dist/src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +7 -0
- package/dist/src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +25 -0
- package/dist/src/widgets/SocialProofFlowWidget/index.d.ts +3 -0
- package/dist/src/widgets/SocialProofFlowWidget/index.js +2 -0
- package/dist/src/widgets/SocialProofWidget/SocialProofWidget.d.ts +12 -0
- package/dist/src/widgets/SocialProofWidget/SocialProofWidget.js +203 -0
- package/dist/src/widgets/SocialProofWidget/__tests__/SocialProofWidget.test.d.ts +1 -0
- package/dist/src/widgets/SocialProofWidget/__tests__/SocialProofWidget.test.js +135 -0
- package/dist/src/widgets/SocialProofWidget/index.d.ts +2 -0
- package/dist/src/widgets/SocialProofWidget/index.js +1 -0
- package/dist/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +7 -0
- package/dist/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +75 -0
- package/dist/src/widgets/TitledPromptCarouselWidget/__tests__/TitledPromptCarouselWidget.test.d.ts +1 -0
- package/dist/src/widgets/TitledPromptCarouselWidget/__tests__/TitledPromptCarouselWidget.test.js +106 -0
- package/dist/src/widgets/TitledPromptCarouselWidget/index.d.ts +2 -0
- package/dist/src/widgets/TitledPromptCarouselWidget/index.js +1 -0
- package/dist/src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +7 -0
- package/dist/src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +25 -0
- package/dist/src/widgets/TypingAnimationFlowWidget/index.d.ts +3 -0
- package/dist/src/widgets/TypingAnimationFlowWidget/index.js +2 -0
- package/dist/src/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +12 -0
- package/dist/src/widgets/TypingAnimationWidget/TypingAnimationWidget.js +126 -0
- package/dist/src/widgets/TypingAnimationWidget/__tests__/TypingAnimationWidget.test.d.ts +1 -0
- package/dist/src/widgets/TypingAnimationWidget/__tests__/TypingAnimationWidget.test.js +118 -0
- package/dist/src/widgets/TypingAnimationWidget/index.d.ts +2 -0
- package/dist/src/widgets/TypingAnimationWidget/index.js +1 -0
- package/dist/src/widgets/__tests__/testUtils.d.ts +60 -0
- package/dist/src/widgets/__tests__/testUtils.js +46 -0
- package/dist/src/widgets/__tests__/trackEventCanary.test.d.ts +1 -0
- package/dist/src/widgets/__tests__/trackEventCanary.test.js +37 -0
- package/dist/src/widgets/hooks/useGetWidgetStatus.d.ts +7 -0
- package/dist/src/widgets/hooks/useGetWidgetStatus.js +17 -0
- package/dist/src/widgets/utils/functions.d.ts +16 -0
- package/dist/src/widgets/utils/functions.js +87 -0
- package/dist/src/widgets-v2/SearchResults/index.d.ts +2 -0
- package/dist/src/widgets-v2/SearchResults/index.js +2 -0
- package/dist/src/widgets-v2/SearchZeroState/index.d.ts +2 -0
- package/dist/src/widgets-v2/SearchZeroState/index.js +2 -0
- package/dist/src/widgets-v2/SuggestionBar/index.d.ts +2 -0
- package/dist/src/widgets-v2/SuggestionBar/index.js +2 -0
- package/dist/src/widgets-v2/SuggestionButtonContainer/index.d.ts +2 -0
- package/dist/src/widgets-v2/SuggestionButtonContainer/index.js +2 -0
- package/dist/tsdown.config.d.ts +2 -0
- package/dist/tsdown.config.js +12 -0
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +36 -5
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +36 -5
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +34 -4
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +35 -5
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.cjs +0 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.js +0 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +31 -7
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +32 -8
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +2 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +25 -3
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.js +25 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +23 -4
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +23 -4
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +15 -3
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +17 -5
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
- package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +53 -6
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.js +54 -7
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +10 -1
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +11 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +24 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +25 -4
- package/dist/widgets/dist/SearchResults/SearchResults.d.cts +4 -3
- package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.cts +2 -2
- package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.cts +2 -2
- package/dist/widgets/dist/SearchZeroState/types.d.cts +2 -2
- package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.cts +3 -3
- package/dist/widgets/dist/SuggestionButtonContainer/types.d.cts +3 -2
- package/dist/widgets/dist/packages/hooks/dist/application/models/api/response.d.cts +14 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/api/search.d.cts +15 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCase.d.cts +73 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.cts +61 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/internal.d.cts +25 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/splitWords.d.cts +35 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/trim.d.cts +32 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.cts +32 -0
- package/dist/widgets/dist/packages/hooks/dist/atoms/search/searchAPI.d.cts +14 -0
- package/dist/widgets/dist/packages/hooks/dist/contexts/types.d.cts +61 -0
- package/dist/widgets/dist/packages/hooks/dist/hooks/Search/useSearch.d.cts +60 -0
- package/dist/widgets/dist/packages/hooks/dist/hooks/utils.d.cts +12 -0
- package/dist/widgets/dist/packages/hooks/dist/types/search-filter-types.d.cts +28 -0
- package/dist/widgets/dist/packages/hooks/dist/types/test-types.d.cts +10 -0
- package/dist/widgets/hooks/useGetWidgetStatus.cjs +1 -1
- package/dist/widgets/hooks/useGetWidgetStatus.js +1 -1
- package/dist/widgets/utils/functions.cjs +0 -14
- package/dist/widgets/utils/functions.js +1 -14
- package/dist/widgets-v2/SearchZeroState/index.d.cts +2 -1
- package/dist/widgets-v2/SearchZeroState/index.d.ts +2 -1
- package/dist/widgets-v2/SuggestionButtonContainer/index.d.ts +1 -0
- package/package.json +4 -4
- package/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.tsx +68 -302
- package/src/hocs/withBaseWidget/types.ts +6 -6
- package/src/hocs/withBaseWidget/withBaseWidget.tsx +46 -61
- package/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx +59 -8
- package/src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx +54 -18
- package/src/widgets/ChatPreviewWidget/__tests__/ChatPreviewWidget.test.tsx +11 -5
- package/src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx +48 -19
- package/src/widgets/FloatingChatWidget/FloatingChatWidget.tsx +100 -52
- package/src/widgets/FloatingChatWidget/__tests__/FloatingChatWidget.test.tsx +11 -5
- package/src/widgets/ProductCardWidget/ProductCardWidget.tsx +37 -16
- package/src/widgets/ProductCardWidget/__tests__/ProductCardWidget.test.tsx +12 -8
- package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +38 -19
- package/src/widgets/PromptButtonCarouselWithImageWidget/__tests__/PromptButtonCarouselWithImageWidget.test.tsx +19 -8
- package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +32 -19
- package/src/widgets/PromptCarouselWidget/__tests__/PromptCarouselWidget.test.tsx +21 -8
- package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +77 -18
- package/src/widgets/SocialProofWidget/__tests__/SocialProofWidget.test.tsx +19 -8
- package/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx +23 -19
- package/src/widgets/TitledPromptCarouselWidget/__tests__/TitledPromptCarouselWidget.test.tsx +19 -8
- package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +45 -21
- package/src/widgets/TypingAnimationWidget/__tests__/TypingAnimationWidget.test.tsx +19 -8
- package/src/widgets/__tests__/trackEventCanary.test.ts +1 -1
- package/dist/packages/icons/dist/_virtual/rolldown_runtime.cjs +0 -27
- package/dist/packages/icons/dist/_virtual/rolldown_runtime.js +0 -25
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs +0 -696
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.js +0 -696
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.cjs +0 -43
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -43
- package/dist/packages/icons/dist/node_modules/react/cjs/react.development.cjs +0 -1528
- package/dist/packages/icons/dist/node_modules/react/cjs/react.development.js +0 -1528
- package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.cjs +0 -329
- package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.js +0 -329
- package/dist/packages/icons/dist/node_modules/react/index.cjs +0 -13
- package/dist/packages/icons/dist/node_modules/react/index.js +0 -13
- package/dist/packages/icons/dist/node_modules/react/jsx-runtime.cjs +0 -13
- package/dist/packages/icons/dist/node_modules/react/jsx-runtime.js +0 -13
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
+
interface UseKustomerUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
3
|
+
}
|
|
4
|
+
export declare const useKustomerUnifiedCXButton: ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }: UseKustomerUnifiedCXButtonProps) => UnifiedCXButton;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
+
interface UseReDoUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
3
|
+
}
|
|
4
|
+
export declare const useReDoUnifiedCXButton: ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }: UseReDoUnifiedCXButtonProps) => UnifiedCXButton;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
+
interface UseRichpanelUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
3
|
+
}
|
|
4
|
+
export declare const useRichpanelUnifiedCXButton: ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }: UseRichpanelUnifiedCXButtonProps) => UnifiedCXButton;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
+
interface UseShopifyChatUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
3
|
+
}
|
|
4
|
+
export declare const useShopifyChatUnifiedCXButton: ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }: UseShopifyChatUnifiedCXButtonProps) => UnifiedCXButton;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
+
interface UseTalkdeskUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
3
|
+
}
|
|
4
|
+
export declare const useTalkdeskUnifiedCXButton: ({ onSwitchToAgent, suppressMerchantButton, }: UseTalkdeskUnifiedCXButtonProps) => UnifiedCXButton;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
2
|
+
interface UseZendeskUnifiedCXButtonProps extends CustomerServiceImplProps {
|
|
3
|
+
}
|
|
4
|
+
export declare const useZendeskUnifiedCXButton: ({ onSwitchToAgent, onCXClose, suppressMerchantButton, }: UseZendeskUnifiedCXButtonProps) => UnifiedCXButton;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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 = {}));
|