@envive-ai/react-widgets-v3 0.3.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/CXIntegration/hooks/useUnifiedCXButton.cjs +23 -0
- package/dist/CXIntegration/hooks/useUnifiedCXButton.js +22 -0
- package/dist/CXIntegration/implementations/useDefaultUnifiedCXButton.cjs +11 -0
- package/dist/CXIntegration/implementations/useDefaultUnifiedCXButton.js +10 -0
- package/dist/CXIntegration/implementations/useGladlyUnifiedCXButton.cjs +20 -0
- package/dist/CXIntegration/implementations/useGladlyUnifiedCXButton.js +19 -0
- package/dist/CXIntegration/implementations/useGorgiasUnifiedCXButton.cjs +53 -0
- package/dist/CXIntegration/implementations/useGorgiasUnifiedCXButton.js +52 -0
- package/dist/CXIntegration/implementations/useGrooveUnifiedCXButton.cjs +45 -0
- package/dist/CXIntegration/implementations/useGrooveUnifiedCXButton.js +44 -0
- package/dist/CXIntegration/implementations/useKustomerUnifiedCXButton.cjs +70 -0
- package/dist/CXIntegration/implementations/useKustomerUnifiedCXButton.js +69 -0
- package/dist/CXIntegration/implementations/useReDoUnifiedCXButton.cjs +59 -0
- package/dist/CXIntegration/implementations/useReDoUnifiedCXButton.js +58 -0
- package/dist/CXIntegration/implementations/useRichpanelUnifiedCXButton.cjs +65 -0
- package/dist/CXIntegration/implementations/useRichpanelUnifiedCXButton.js +64 -0
- package/dist/CXIntegration/implementations/useShopifyChatUnifiedCXButton.cjs +53 -0
- package/dist/CXIntegration/implementations/useShopifyChatUnifiedCXButton.js +52 -0
- package/dist/CXIntegration/implementations/useTidioUnifiedCXButton.cjs +18 -0
- package/dist/CXIntegration/implementations/useTidioUnifiedCXButton.js +17 -0
- package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.cjs +54 -0
- package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.js +53 -0
- package/dist/CXIntegration/implementations/useZowieUnifiedCXButton.cjs +18 -0
- package/dist/CXIntegration/implementations/useZowieUnifiedCXButton.js +17 -0
- package/dist/CXIntegration/types.cjs +19 -0
- package/dist/CXIntegration/types.js +18 -0
- package/dist/CXIntegration/utils/functions.cjs +30 -0
- package/dist/CXIntegration/utils/functions.js +30 -0
- package/dist/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/hocs/withBaseWidget/index.cjs +3 -0
- package/dist/hocs/withBaseWidget/index.d.cts +3 -0
- package/dist/hocs/withBaseWidget/index.d.ts +3 -0
- package/dist/hocs/withBaseWidget/index.js +3 -0
- package/dist/hocs/withBaseWidget/types.d.cts +37 -0
- package/dist/hocs/withBaseWidget/types.d.ts +39 -0
- package/dist/hocs/withBaseWidget/withBaseWidget.cjs +101 -0
- package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +10 -0
- package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +10 -0
- package/dist/hocs/withBaseWidget/withBaseWidget.js +100 -0
- package/dist/hooks/dist/application/models/api/orgConfigResults.d.ts +1 -0
- package/dist/hooks/dist/application/models/frontendConfig.d.ts +1 -0
- package/dist/hooks/dist/contexts/amplitudeContext/amplitudeContext.d.ts +2 -0
- package/dist/hooks/dist/contexts/amplitudeContext/index.d.ts +2 -0
- package/dist/hooks/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.d.ts +2 -0
- package/dist/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.cts +8 -0
- package/dist/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.ts +11 -0
- package/dist/hooks/dist/contexts/hardcopyContext/index.d.ts +1 -0
- package/dist/hooks/dist/contexts/types.d.cts +44 -0
- package/dist/hooks/dist/contexts/types.d.ts +47 -0
- package/dist/hooks/dist/contexts/typesV3.d.cts +201 -0
- package/dist/hooks/dist/contexts/typesV3.d.ts +201 -0
- package/dist/hooks/dist/services/amplitudeService/amplitudeService.d.cts +36 -0
- package/dist/hooks/dist/services/amplitudeService/amplitudeService.d.ts +37 -0
- package/dist/hooks/dist/types/customerService.d.cts +18 -0
- package/dist/hooks/dist/types/customerService.d.ts +18 -0
- package/dist/stories/SalesAgentTest/index.cjs +0 -0
- package/dist/stories/SalesAgentTest/index.d.cts +1 -0
- package/dist/stories/SalesAgentTest/index.d.ts +1 -0
- package/dist/stories/SalesAgentTest/index.js +0 -0
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +98 -0
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +19 -0
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +19 -0
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +96 -0
- package/dist/widgets/ChatPreviewComparisonWidget/index.cjs +4 -0
- package/dist/widgets/ChatPreviewComparisonWidget/index.d.cts +2 -0
- package/dist/widgets/ChatPreviewComparisonWidget/index.d.ts +2 -0
- package/dist/widgets/ChatPreviewComparisonWidget/index.js +3 -0
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs +44 -0
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +16 -0
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +16 -0
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js +42 -0
- package/dist/widgets/ChatPreviewLoadingWidget/index.cjs +4 -0
- package/dist/widgets/ChatPreviewLoadingWidget/index.d.cts +2 -0
- package/dist/widgets/ChatPreviewLoadingWidget/index.d.ts +2 -0
- package/dist/widgets/ChatPreviewLoadingWidget/index.js +3 -0
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +86 -0
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +19 -0
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +19 -0
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +84 -0
- package/dist/widgets/ChatPreviewWidget/index.cjs +4 -0
- package/dist/widgets/ChatPreviewWidget/index.d.cts +2 -0
- package/dist/widgets/ChatPreviewWidget/index.d.ts +2 -0
- package/dist/widgets/ChatPreviewWidget/index.js +3 -0
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.cjs +66 -0
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.js +64 -0
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +70 -0
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +10 -0
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +10 -0
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +69 -0
- package/dist/widgets/FloatingChatWidget/constants.cjs +6 -0
- package/dist/widgets/FloatingChatWidget/constants.d.cts +4 -0
- package/dist/widgets/FloatingChatWidget/constants.d.ts +4 -0
- package/dist/widgets/FloatingChatWidget/constants.js +5 -0
- package/dist/widgets/FloatingChatWidget/index.cjs +5 -0
- package/dist/widgets/FloatingChatWidget/index.d.cts +3 -0
- package/dist/widgets/FloatingChatWidget/index.d.ts +3 -0
- package/dist/widgets/FloatingChatWidget/index.js +4 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +60 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +19 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +19 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +58 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/index.cjs +4 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/index.d.cts +2 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/index.d.ts +2 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/index.js +3 -0
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +64 -0
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +14 -0
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +14 -0
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +63 -0
- package/dist/widgets/PromptCarouselWidget/index.cjs +3 -0
- package/dist/widgets/PromptCarouselWidget/index.d.cts +2 -0
- package/dist/widgets/PromptCarouselWidget/index.d.ts +2 -0
- package/dist/widgets/PromptCarouselWidget/index.js +3 -0
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.cjs +35 -0
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +14 -0
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +14 -0
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +34 -0
- package/dist/widgets/SocialProofFlowWidget/index.cjs +3 -0
- package/dist/widgets/SocialProofFlowWidget/index.d.cts +2 -0
- package/dist/widgets/SocialProofFlowWidget/index.d.ts +2 -0
- package/dist/widgets/SocialProofFlowWidget/index.js +3 -0
- package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +118 -0
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +19 -0
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +19 -0
- package/dist/widgets/SocialProofWidget/SocialProofWidget.js +116 -0
- package/dist/widgets/SocialProofWidget/index.cjs +4 -0
- package/dist/widgets/SocialProofWidget/index.d.cts +2 -0
- package/dist/widgets/SocialProofWidget/index.d.ts +2 -0
- package/dist/widgets/SocialProofWidget/index.js +3 -0
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +67 -0
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +14 -0
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +14 -0
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +66 -0
- package/dist/widgets/TitledPromptCarouselWidget/index.cjs +3 -0
- package/dist/widgets/TitledPromptCarouselWidget/index.d.cts +2 -0
- package/dist/widgets/TitledPromptCarouselWidget/index.d.ts +2 -0
- package/dist/widgets/TitledPromptCarouselWidget/index.js +3 -0
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.cjs +35 -0
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +14 -0
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +14 -0
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +34 -0
- package/dist/widgets/TypingAnimationFlowWidget/index.cjs +3 -0
- package/dist/widgets/TypingAnimationFlowWidget/index.d.cts +2 -0
- package/dist/widgets/TypingAnimationFlowWidget/index.d.ts +2 -0
- package/dist/widgets/TypingAnimationFlowWidget/index.js +3 -0
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +90 -0
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +19 -0
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +19 -0
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +88 -0
- package/dist/widgets/TypingAnimationWidget/index.cjs +4 -0
- package/dist/widgets/TypingAnimationWidget/index.d.cts +2 -0
- package/dist/widgets/TypingAnimationWidget/index.d.ts +2 -0
- package/dist/widgets/TypingAnimationWidget/index.js +3 -0
- package/dist/widgets/dist/SearchResults/SearchResults.d.cts +15 -0
- package/dist/widgets/dist/SearchResults/SearchResults.d.ts +15 -0
- package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.cts +9 -0
- package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.ts +9 -0
- package/dist/widgets/dist/SearchResults/index.d.ts +2 -0
- package/dist/widgets/dist/SearchResults/types.d.cts +20 -0
- package/dist/widgets/dist/SearchResults/types.d.ts +20 -0
- package/dist/widgets/dist/SearchZeroState/SearchZeroState.d.cts +10 -0
- package/dist/widgets/dist/SearchZeroState/SearchZeroState.d.ts +10 -0
- package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.cts +18 -0
- package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.ts +18 -0
- package/dist/widgets/dist/SearchZeroState/index.d.ts +4 -0
- package/dist/widgets/dist/SearchZeroState/types.d.cts +13 -0
- package/dist/widgets/dist/SearchZeroState/types.d.ts +13 -0
- package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.cts +36 -0
- package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.ts +36 -0
- package/dist/widgets/dist/SuggestionBar/index.d.ts +2 -0
- package/dist/widgets/dist/SuggestionBar/types.d.cts +9 -0
- package/dist/widgets/dist/SuggestionBar/types.d.ts +9 -0
- package/dist/widgets/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.cts +9 -0
- package/dist/widgets/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.ts +9 -0
- package/dist/widgets/dist/SuggestionButtonContainer/types.d.cts +20 -0
- package/dist/widgets/dist/SuggestionButtonContainer/types.d.ts +20 -0
- package/dist/widgets/dist/config/BaseWidgetConfig.d.cts +13 -0
- package/dist/widgets/dist/config/BaseWidgetConfig.d.ts +13 -0
- package/dist/widgets/dist/config/WidgetType.d.cts +23 -0
- package/dist/widgets/dist/config/WidgetType.d.ts +23 -0
- 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/response.d.ts +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/api/search.d.ts +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/camelCase.d.ts +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/camelCasedPropertiesDeep.d.ts +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/internal.d.ts +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/splitWords.d.ts +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/trim.d.ts +32 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.cts +32 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.ts +32 -0
- package/dist/widgets/dist/packages/hooks/dist/atoms/search/searchAPI.d.cts +14 -0
- package/dist/widgets/dist/packages/hooks/dist/atoms/search/searchAPI.d.ts +15 -0
- package/dist/widgets/dist/packages/hooks/dist/contexts/types.d.cts +61 -0
- package/dist/widgets/dist/packages/hooks/dist/contexts/types.d.ts +61 -0
- package/dist/widgets/dist/packages/hooks/dist/hooks/Search/useSearch.d.cts +60 -0
- package/dist/widgets/dist/packages/hooks/dist/hooks/Search/useSearch.d.ts +60 -0
- package/dist/widgets/dist/packages/hooks/dist/hooks/utils.d.cts +11 -0
- package/dist/widgets/dist/packages/hooks/dist/hooks/utils.d.ts +11 -0
- package/dist/widgets/dist/packages/hooks/dist/types/search-filter-types.d.cts +28 -0
- package/dist/widgets/dist/packages/hooks/dist/types/search-filter-types.d.ts +28 -0
- package/dist/widgets/dist/packages/hooks/dist/types/test-types.d.cts +10 -0
- package/dist/widgets/dist/packages/hooks/dist/types/test-types.d.ts +10 -0
- package/dist/widgets/hooks/useGetWidgetStatus.cjs +27 -0
- package/dist/widgets/hooks/useGetWidgetStatus.js +26 -0
- package/dist/widgets/utils/functions.cjs +55 -0
- package/dist/widgets/utils/functions.js +48 -0
- package/dist/widgets-v2/SearchResults/index.cjs +5 -0
- package/dist/widgets-v2/SearchResults/index.d.cts +3 -0
- package/dist/widgets-v2/SearchResults/index.d.ts +4 -0
- package/dist/widgets-v2/SearchResults/index.js +3 -0
- package/dist/widgets-v2/SearchZeroState/index.cjs +8 -0
- package/dist/widgets-v2/SearchZeroState/index.d.cts +5 -0
- package/dist/widgets-v2/SearchZeroState/index.d.ts +6 -0
- package/dist/widgets-v2/SearchZeroState/index.js +3 -0
- package/dist/widgets-v2/SuggestionBar/index.cjs +5 -0
- package/dist/widgets-v2/SuggestionBar/index.d.cts +3 -0
- package/dist/widgets-v2/SuggestionBar/index.d.ts +4 -0
- package/dist/widgets-v2/SuggestionBar/index.js +3 -0
- package/dist/widgets-v2/SuggestionButtonContainer/index.cjs +5 -0
- package/dist/widgets-v2/SuggestionButtonContainer/index.d.cts +3 -0
- package/dist/widgets-v2/SuggestionButtonContainer/index.d.ts +3 -0
- package/dist/widgets-v2/SuggestionButtonContainer/index.js +3 -0
- package/package.json +158 -0
- package/src/CXIntegration/hooks/useUnifiedCXButton.ts +38 -0
- package/src/CXIntegration/implementations/useDefaultUnifiedCXButton.ts +8 -0
- package/src/CXIntegration/implementations/useGladlyUnifiedCXButton.ts +28 -0
- package/src/CXIntegration/implementations/useGorgiasUnifiedCXButton.ts +67 -0
- package/src/CXIntegration/implementations/useGrooveUnifiedCXButton.ts +83 -0
- package/src/CXIntegration/implementations/useKustomerUnifiedCXButton.ts +120 -0
- package/src/CXIntegration/implementations/useReDoUnifiedCXButton.ts +80 -0
- package/src/CXIntegration/implementations/useRichpanelUnifiedCXButton.ts +83 -0
- package/src/CXIntegration/implementations/useShopifyChatUnifiedCXButton.ts +78 -0
- package/src/CXIntegration/implementations/useTidioUnifiedCXButton.ts +34 -0
- package/src/CXIntegration/implementations/useZendeskUnifiedCXButton.ts +69 -0
- package/src/CXIntegration/implementations/useZowieUnifiedCXButton.ts +34 -0
- package/src/CXIntegration/types.ts +24 -0
- package/src/CXIntegration/utils/functions.ts +50 -0
- package/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.tsx +689 -0
- package/src/hocs/withBaseWidget/index.ts +2 -0
- package/src/hocs/withBaseWidget/types.ts +39 -0
- package/src/hocs/withBaseWidget/withBaseWidget.tsx +126 -0
- package/src/stories/FloatingChatWidget.stories.tsx +56 -0
- package/src/stories/PromptButtonCarouselWithImageWidget.stories.tsx +54 -0
- package/src/stories/PromptCarouselWidget.stories.tsx +54 -0
- package/src/stories/SalesAgentTest/SalesAgentTest.stories.tsx +18 -0
- package/src/stories/SalesAgentTest/SalesAgentTest.tsx +111 -0
- package/src/stories/SalesAgentTest/index.ts +0 -0
- package/src/stories/SearchResults.stories.tsx +29 -0
- package/src/stories/SearchZeroState.stories.tsx +52 -0
- package/src/stories/SocialProofFlowWidget.stories.tsx +77 -0
- package/src/stories/SuggestionBar.stories.tsx +45 -0
- package/src/stories/TitledPromptCarouselWidget.stories.tsx +71 -0
- package/src/stories/TypingAnimationFlowWidget.stories.tsx +67 -0
- package/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx +152 -0
- package/src/widgets/ChatPreviewComparisonWidget/index.ts +7 -0
- package/src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.tsx +82 -0
- package/src/widgets/ChatPreviewLoadingWidget/index.ts +7 -0
- package/src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx +119 -0
- package/src/widgets/ChatPreviewWidget/index.ts +4 -0
- package/src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx +115 -0
- package/src/widgets/FloatingChatWidget/FloatingChatWidget.tsx +110 -0
- package/src/widgets/FloatingChatWidget/constants.ts +1 -0
- package/src/widgets/FloatingChatWidget/index.ts +5 -0
- package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +87 -0
- package/src/widgets/PromptButtonCarouselWithImageWidget/index.ts +6 -0
- package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +83 -0
- package/src/widgets/PromptCarouselWidget/index.ts +2 -0
- package/src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.tsx +61 -0
- package/src/widgets/SocialProofFlowWidget/index.ts +4 -0
- package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +160 -0
- package/src/widgets/SocialProofWidget/index.ts +2 -0
- package/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx +93 -0
- package/src/widgets/TitledPromptCarouselWidget/index.ts +2 -0
- package/src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.tsx +61 -0
- package/src/widgets/TypingAnimationFlowWidget/index.ts +4 -0
- package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +115 -0
- package/src/widgets/TypingAnimationWidget/index.ts +2 -0
- package/src/widgets/hooks/useGetWidgetStatus.tsx +29 -0
- package/src/widgets/utils/functions.ts +104 -0
- package/src/widgets-v2/SearchResults/index.ts +3 -0
- package/src/widgets-v2/SearchZeroState/index.ts +15 -0
- package/src/widgets-v2/SuggestionBar/index.ts +6 -0
- package/src/widgets-v2/SuggestionButtonContainer/index.ts +6 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
|
+
import { PromptCarouselWidget } from "../PromptCarouselWidget/PromptCarouselWidget.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
5
|
+
import { useAtomValue } from "jotai";
|
|
6
|
+
import { ChatPreviewLoading } from "@envive-ai/react-toolkit-v3/ChatPreviewLoading";
|
|
7
|
+
import { chatPreviewLoadingDataAtom } from "@envive-ai/react-hooks/atoms/widget";
|
|
8
|
+
|
|
9
|
+
//#region src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.tsx
|
|
10
|
+
const ChatPreviewLoadingWidgetHandler = (props) => {
|
|
11
|
+
const { widgetConfig, isLoading, widgetConfigId, hardcopyContent, uiConfig } = props;
|
|
12
|
+
const chatPreviewLoadingWidgetConfig = widgetConfig;
|
|
13
|
+
const id = widgetConfig?.contentId;
|
|
14
|
+
const chatPreviewLoadingData = useAtomValue(chatPreviewLoadingDataAtom)[widgetConfigId] ?? void 0;
|
|
15
|
+
const isCacheEmpty = !chatPreviewLoadingData || Object.values(chatPreviewLoadingData).every((value) => value === void 0) || Object.keys(chatPreviewLoadingData).length === 0;
|
|
16
|
+
if (isLoading && isCacheEmpty) return /* @__PURE__ */ jsx(ChatPreviewLoading, { fullIsLoading: true });
|
|
17
|
+
const titleLabel = hardcopyContent?.values?.titleLabel ?? chatPreviewLoadingData?.titleLabel;
|
|
18
|
+
const textFieldPlaceholder = hardcopyContent?.values?.textFieldPlaceholderText ?? chatPreviewLoadingData?.textFieldPlaceholder;
|
|
19
|
+
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo ?? chatPreviewLoadingData?.hideLogo;
|
|
20
|
+
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc ?? chatPreviewLoadingData?.logoSrc;
|
|
21
|
+
return /* @__PURE__ */ jsx(ChatPreviewLoading, {
|
|
22
|
+
id,
|
|
23
|
+
variant: chatPreviewLoadingWidgetConfig?.variant ?? chatPreviewLoadingData?.variant,
|
|
24
|
+
hexCardColor: chatPreviewLoadingWidgetConfig?.hexCardColor ?? chatPreviewLoadingData?.hexCardColor,
|
|
25
|
+
hideTextField: chatPreviewLoadingWidgetConfig?.hideTextField ?? chatPreviewLoadingData?.hideTextField,
|
|
26
|
+
textFieldPlaceholder,
|
|
27
|
+
hideLogo,
|
|
28
|
+
logoSrc,
|
|
29
|
+
titleLabel
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
const ChatPreviewLoadingWidgetWithBaseWidget = withBaseWidget(ChatPreviewLoadingWidgetHandler);
|
|
33
|
+
const ChatPreviewLoadingWidget = ({ widgetConfigId }) => {
|
|
34
|
+
return /* @__PURE__ */ jsx(ChatPreviewLoadingWidgetWithBaseWidget, {
|
|
35
|
+
widgetConfigId,
|
|
36
|
+
widgetType: WidgetTypeV3.ChatPreviewLoadingV3
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
PromptCarouselWidget.displayName = "PromptCarouselWidget";
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetWithBaseWidget };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const require_ChatPreviewLoadingWidget = require('./ChatPreviewLoadingWidget.cjs');
|
|
2
|
+
|
|
3
|
+
exports.ChatPreviewLoadingWidget = require_ChatPreviewLoadingWidget.ChatPreviewLoadingWidget;
|
|
4
|
+
exports.ChatPreviewLoadingWidgetWithBaseWidget = require_ChatPreviewLoadingWidget.ChatPreviewLoadingWidgetWithBaseWidget;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget.cjs');
|
|
3
|
+
const require_functions = require('../utils/functions.cjs');
|
|
4
|
+
const require_ChatPreviewLoadingWidget = require('../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs');
|
|
5
|
+
let react = require("react");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
8
|
+
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
9
|
+
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
10
|
+
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
11
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
12
|
+
let jotai = require("jotai");
|
|
13
|
+
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
14
|
+
let __envive_ai_react_toolkit_v3_ChatPreview = require("@envive-ai/react-toolkit-v3/ChatPreview");
|
|
15
|
+
|
|
16
|
+
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx
|
|
17
|
+
const ChatPreviewWidgetHandler = (props) => {
|
|
18
|
+
const { onTypedMessageSubmitted } = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)();
|
|
19
|
+
const { openChat } = (0, __envive_ai_react_hooks_hooks_ChatToggle.useChatToggle)();
|
|
20
|
+
const lastAssistantMessage = (0, jotai.useAtomValue)(__envive_ai_react_hooks_atoms_chat.lastAssistantMessageAtom);
|
|
21
|
+
const { suggestions } = (0, jotai.useAtomValue)(__envive_ai_react_hooks_atoms_chat.chatAtom);
|
|
22
|
+
const promptButtonTexts = (0, react.useMemo)(() => {
|
|
23
|
+
return suggestions.map((suggestion) => suggestion.content);
|
|
24
|
+
}, [suggestions]);
|
|
25
|
+
const messageText = (0, react.useMemo)(() => require_functions.getMessageText(lastAssistantMessage), [lastAssistantMessage]);
|
|
26
|
+
const { hardcopyContent, widgetConfig, uiConfig, isLoading, widgetConfigId } = props;
|
|
27
|
+
const chatPreviewWidgetConfig = widgetConfig;
|
|
28
|
+
const id = widgetConfig?.contentId;
|
|
29
|
+
const hardCopyContent = {
|
|
30
|
+
titleLabel: hardcopyContent?.values?.titleLabel,
|
|
31
|
+
textFieldPlaceholderText: hardcopyContent?.values?.textFieldPlaceholderText,
|
|
32
|
+
messageText,
|
|
33
|
+
promptButtonTexts
|
|
34
|
+
};
|
|
35
|
+
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
36
|
+
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
37
|
+
const handlePromptButtonClick = (0, react.useCallback)((text) => {
|
|
38
|
+
onTypedMessageSubmitted({
|
|
39
|
+
query: text,
|
|
40
|
+
userTyped: false
|
|
41
|
+
});
|
|
42
|
+
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.CHAT_PREVIEW_PROMPT_BUTTON);
|
|
43
|
+
}, [onTypedMessageSubmitted, openChat]);
|
|
44
|
+
const handleTextFieldClick = (0, react.useCallback)(() => {
|
|
45
|
+
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.CHAT_PREVIEW_TEXT_FIELD);
|
|
46
|
+
}, [openChat]);
|
|
47
|
+
if (isLoading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewLoadingWidget.ChatPreviewLoadingWidgetWithBaseWidget, {
|
|
48
|
+
widgetConfigId,
|
|
49
|
+
widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewLoadingV3
|
|
50
|
+
});
|
|
51
|
+
const widgetStyleProps = {
|
|
52
|
+
theme: __envive_ai_react_toolkit_v3_Tokens.Theme.GLOBAL_CUSTOM,
|
|
53
|
+
variant: chatPreviewWidgetConfig?.variant,
|
|
54
|
+
hideTextField: chatPreviewWidgetConfig?.hideTextField,
|
|
55
|
+
hideLogo,
|
|
56
|
+
hexCardColor: chatPreviewWidgetConfig?.hexCardColor
|
|
57
|
+
};
|
|
58
|
+
const widgetContentProps = {
|
|
59
|
+
titleLabel: hardCopyContent?.titleLabel,
|
|
60
|
+
messageText: hardCopyContent?.messageText,
|
|
61
|
+
promptButtonTexts: hardCopyContent?.promptButtonTexts,
|
|
62
|
+
textFieldPlaceholderText: hardCopyContent?.textFieldPlaceholderText,
|
|
63
|
+
logoSrc: logoSrc ?? void 0
|
|
64
|
+
};
|
|
65
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_ChatPreview.ChatPreview, {
|
|
66
|
+
baseProps: { id },
|
|
67
|
+
widgetStyleProps,
|
|
68
|
+
widgetContentProps,
|
|
69
|
+
widgetEventProps: {
|
|
70
|
+
handlePromptButtonClick,
|
|
71
|
+
handleTextFieldClick
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
const ChatPreviewWidgetWithBaseWidget = require_withBaseWidget.withBaseWidget(ChatPreviewWidgetHandler);
|
|
76
|
+
const ChatPreviewWidget = ({ widgetConfigId }) => {
|
|
77
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChatPreviewWidgetWithBaseWidget, {
|
|
78
|
+
widgetConfigId,
|
|
79
|
+
widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewV3
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
ChatPreviewWidget.displayName = "ChatPreviewWidget";
|
|
83
|
+
|
|
84
|
+
//#endregion
|
|
85
|
+
exports.ChatPreviewWidget = ChatPreviewWidget;
|
|
86
|
+
exports.ChatPreviewWidgetWithBaseWidget = ChatPreviewWidgetWithBaseWidget;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts
|
|
5
|
+
declare const ChatPreviewWidgetWithBaseWidget: {
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime2.JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
interface ChatPreviewWidgetProps {
|
|
10
|
+
widgetConfigId: string;
|
|
11
|
+
}
|
|
12
|
+
declare const ChatPreviewWidget: {
|
|
13
|
+
({
|
|
14
|
+
widgetConfigId
|
|
15
|
+
}: ChatPreviewWidgetProps): react_jsx_runtime2.JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { ChatPreviewWidget, ChatPreviewWidgetProps, ChatPreviewWidgetWithBaseWidget };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
|
|
2
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts
|
|
5
|
+
declare const ChatPreviewWidgetWithBaseWidget: {
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime5.JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
interface ChatPreviewWidgetProps {
|
|
10
|
+
widgetConfigId: string;
|
|
11
|
+
}
|
|
12
|
+
declare const ChatPreviewWidget: {
|
|
13
|
+
({
|
|
14
|
+
widgetConfigId
|
|
15
|
+
}: ChatPreviewWidgetProps): react_jsx_runtime5.JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { ChatPreviewWidget, ChatPreviewWidgetProps, ChatPreviewWidgetWithBaseWidget };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
|
+
import { getMessageText } from "../utils/functions.js";
|
|
3
|
+
import { ChatPreviewLoadingWidgetWithBaseWidget } from "../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js";
|
|
4
|
+
import { useCallback, useMemo } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
7
|
+
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
8
|
+
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
9
|
+
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
10
|
+
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
11
|
+
import { useAtomValue } from "jotai";
|
|
12
|
+
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
13
|
+
import { ChatPreview } from "@envive-ai/react-toolkit-v3/ChatPreview";
|
|
14
|
+
|
|
15
|
+
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx
|
|
16
|
+
const ChatPreviewWidgetHandler = (props) => {
|
|
17
|
+
const { onTypedMessageSubmitted } = useSalesAgent();
|
|
18
|
+
const { openChat } = useChatToggle();
|
|
19
|
+
const lastAssistantMessage = useAtomValue(lastAssistantMessageAtom);
|
|
20
|
+
const { suggestions } = useAtomValue(chatAtom);
|
|
21
|
+
const promptButtonTexts = useMemo(() => {
|
|
22
|
+
return suggestions.map((suggestion) => suggestion.content);
|
|
23
|
+
}, [suggestions]);
|
|
24
|
+
const messageText = useMemo(() => getMessageText(lastAssistantMessage), [lastAssistantMessage]);
|
|
25
|
+
const { hardcopyContent, widgetConfig, uiConfig, isLoading, widgetConfigId } = props;
|
|
26
|
+
const chatPreviewWidgetConfig = widgetConfig;
|
|
27
|
+
const id = widgetConfig?.contentId;
|
|
28
|
+
const hardCopyContent = {
|
|
29
|
+
titleLabel: hardcopyContent?.values?.titleLabel,
|
|
30
|
+
textFieldPlaceholderText: hardcopyContent?.values?.textFieldPlaceholderText,
|
|
31
|
+
messageText,
|
|
32
|
+
promptButtonTexts
|
|
33
|
+
};
|
|
34
|
+
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
35
|
+
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
36
|
+
const handlePromptButtonClick = useCallback((text) => {
|
|
37
|
+
onTypedMessageSubmitted({
|
|
38
|
+
query: text,
|
|
39
|
+
userTyped: false
|
|
40
|
+
});
|
|
41
|
+
openChat(ChatElementDisplayLocationV3.CHAT_PREVIEW_PROMPT_BUTTON);
|
|
42
|
+
}, [onTypedMessageSubmitted, openChat]);
|
|
43
|
+
const handleTextFieldClick = useCallback(() => {
|
|
44
|
+
openChat(ChatElementDisplayLocationV3.CHAT_PREVIEW_TEXT_FIELD);
|
|
45
|
+
}, [openChat]);
|
|
46
|
+
if (isLoading) return /* @__PURE__ */ jsx(ChatPreviewLoadingWidgetWithBaseWidget, {
|
|
47
|
+
widgetConfigId,
|
|
48
|
+
widgetType: WidgetTypeV3.ChatPreviewLoadingV3
|
|
49
|
+
});
|
|
50
|
+
const widgetStyleProps = {
|
|
51
|
+
theme: Theme.GLOBAL_CUSTOM,
|
|
52
|
+
variant: chatPreviewWidgetConfig?.variant,
|
|
53
|
+
hideTextField: chatPreviewWidgetConfig?.hideTextField,
|
|
54
|
+
hideLogo,
|
|
55
|
+
hexCardColor: chatPreviewWidgetConfig?.hexCardColor
|
|
56
|
+
};
|
|
57
|
+
const widgetContentProps = {
|
|
58
|
+
titleLabel: hardCopyContent?.titleLabel,
|
|
59
|
+
messageText: hardCopyContent?.messageText,
|
|
60
|
+
promptButtonTexts: hardCopyContent?.promptButtonTexts,
|
|
61
|
+
textFieldPlaceholderText: hardCopyContent?.textFieldPlaceholderText,
|
|
62
|
+
logoSrc: logoSrc ?? void 0
|
|
63
|
+
};
|
|
64
|
+
return /* @__PURE__ */ jsx(ChatPreview, {
|
|
65
|
+
baseProps: { id },
|
|
66
|
+
widgetStyleProps,
|
|
67
|
+
widgetContentProps,
|
|
68
|
+
widgetEventProps: {
|
|
69
|
+
handlePromptButtonClick,
|
|
70
|
+
handleTextFieldClick
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
const ChatPreviewWidgetWithBaseWidget = withBaseWidget(ChatPreviewWidgetHandler);
|
|
75
|
+
const ChatPreviewWidget = ({ widgetConfigId }) => {
|
|
76
|
+
return /* @__PURE__ */ jsx(ChatPreviewWidgetWithBaseWidget, {
|
|
77
|
+
widgetConfigId,
|
|
78
|
+
widgetType: WidgetTypeV3.ChatPreviewV3
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
ChatPreviewWidget.displayName = "ChatPreviewWidget";
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
export { ChatPreviewWidget, ChatPreviewWidgetWithBaseWidget };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
|
+
let react_dom = require("react-dom");
|
|
4
|
+
let framer_motion = require("framer-motion");
|
|
5
|
+
let classnames = require("classnames");
|
|
6
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
7
|
+
|
|
8
|
+
//#region src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx
|
|
9
|
+
const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestId }) => {
|
|
10
|
+
const overlayClasses = (0, classnames.default)("envive-floating-chat-overlay", "envive-tw-fixed", "envive-tw-top-0", "envive-tw-left-0", "envive-tw-h-screen", "envive-tw-w-full", "envive-tw-z-[2147483647]", className);
|
|
11
|
+
const backdropClasses = (0, classnames.default)("envive-floating-chat-backdrop", "envive-tw-absolute", "envive-tw-top-0", "envive-tw-left-0", "envive-tw-h-full", "envive-tw-w-full", "envive-tw-bg-black", "envive-tw-opacity-50", "envive-tw-pointer-events-none", "envive-tw-z-0");
|
|
12
|
+
const overlayContentClasses = (0, classnames.default)("envive-floating-chat-overlay-content", "envive-tw-relative", "envive-tw-flex", "envive-tw-justify-end", "envive-tw-items-stretch", "envive-tw-h-full", "envive-tw-w-full", "envive-tw-pointer-events-auto", "envive-tw-cursor-pointer", "envive-tw-z-10");
|
|
13
|
+
const chatWrapper = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.AnimatePresence, { children: isOpened && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(framer_motion.motion.div, {
|
|
14
|
+
className: overlayClasses,
|
|
15
|
+
initial: { opacity: 0 },
|
|
16
|
+
animate: { opacity: 1 },
|
|
17
|
+
exit: { opacity: 0 },
|
|
18
|
+
transition: { duration: .3 },
|
|
19
|
+
"data-testid": dataTestId,
|
|
20
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
|
|
21
|
+
className: backdropClasses,
|
|
22
|
+
initial: { opacity: 0 },
|
|
23
|
+
animate: { opacity: .5 },
|
|
24
|
+
exit: { opacity: 0 },
|
|
25
|
+
transition: { duration: .3 },
|
|
26
|
+
"aria-label": "Close chat"
|
|
27
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
28
|
+
className: overlayContentClasses,
|
|
29
|
+
onClick: onClose,
|
|
30
|
+
onKeyDown: (e) => {
|
|
31
|
+
if (e.key === "Escape") onClose();
|
|
32
|
+
},
|
|
33
|
+
role: "button",
|
|
34
|
+
tabIndex: 0,
|
|
35
|
+
"aria-label": "Close floating chat",
|
|
36
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
|
|
37
|
+
initial: {
|
|
38
|
+
opacity: 0,
|
|
39
|
+
x: 512
|
|
40
|
+
},
|
|
41
|
+
animate: {
|
|
42
|
+
opacity: 1,
|
|
43
|
+
x: 0
|
|
44
|
+
},
|
|
45
|
+
exit: {
|
|
46
|
+
opacity: 0,
|
|
47
|
+
x: 512
|
|
48
|
+
},
|
|
49
|
+
transition: { duration: .3 },
|
|
50
|
+
style: {
|
|
51
|
+
height: "100dvh",
|
|
52
|
+
cursor: "default"
|
|
53
|
+
},
|
|
54
|
+
className: "envive-tw-shadow-md",
|
|
55
|
+
onClick: (e) => e.stopPropagation(),
|
|
56
|
+
children
|
|
57
|
+
})
|
|
58
|
+
})]
|
|
59
|
+
}, "floating-chat-overlay") });
|
|
60
|
+
if (typeof document !== "undefined") return (0, react_dom.createPortal)(chatWrapper, document.body);
|
|
61
|
+
return chatWrapper;
|
|
62
|
+
};
|
|
63
|
+
FloatingChatOverlay.displayName = "FloatingChatOverlay";
|
|
64
|
+
|
|
65
|
+
//#endregion
|
|
66
|
+
exports.FloatingChatOverlay = FloatingChatOverlay;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createPortal } from "react-dom";
|
|
3
|
+
import { AnimatePresence, motion } from "framer-motion";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
|
|
6
|
+
//#region src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx
|
|
7
|
+
const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestId }) => {
|
|
8
|
+
const overlayClasses = classNames("envive-floating-chat-overlay", "envive-tw-fixed", "envive-tw-top-0", "envive-tw-left-0", "envive-tw-h-screen", "envive-tw-w-full", "envive-tw-z-[2147483647]", className);
|
|
9
|
+
const backdropClasses = classNames("envive-floating-chat-backdrop", "envive-tw-absolute", "envive-tw-top-0", "envive-tw-left-0", "envive-tw-h-full", "envive-tw-w-full", "envive-tw-bg-black", "envive-tw-opacity-50", "envive-tw-pointer-events-none", "envive-tw-z-0");
|
|
10
|
+
const overlayContentClasses = classNames("envive-floating-chat-overlay-content", "envive-tw-relative", "envive-tw-flex", "envive-tw-justify-end", "envive-tw-items-stretch", "envive-tw-h-full", "envive-tw-w-full", "envive-tw-pointer-events-auto", "envive-tw-cursor-pointer", "envive-tw-z-10");
|
|
11
|
+
const chatWrapper = /* @__PURE__ */ jsx(AnimatePresence, { children: isOpened && /* @__PURE__ */ jsxs(motion.div, {
|
|
12
|
+
className: overlayClasses,
|
|
13
|
+
initial: { opacity: 0 },
|
|
14
|
+
animate: { opacity: 1 },
|
|
15
|
+
exit: { opacity: 0 },
|
|
16
|
+
transition: { duration: .3 },
|
|
17
|
+
"data-testid": dataTestId,
|
|
18
|
+
children: [/* @__PURE__ */ jsx(motion.div, {
|
|
19
|
+
className: backdropClasses,
|
|
20
|
+
initial: { opacity: 0 },
|
|
21
|
+
animate: { opacity: .5 },
|
|
22
|
+
exit: { opacity: 0 },
|
|
23
|
+
transition: { duration: .3 },
|
|
24
|
+
"aria-label": "Close chat"
|
|
25
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
26
|
+
className: overlayContentClasses,
|
|
27
|
+
onClick: onClose,
|
|
28
|
+
onKeyDown: (e) => {
|
|
29
|
+
if (e.key === "Escape") onClose();
|
|
30
|
+
},
|
|
31
|
+
role: "button",
|
|
32
|
+
tabIndex: 0,
|
|
33
|
+
"aria-label": "Close floating chat",
|
|
34
|
+
children: /* @__PURE__ */ jsx(motion.div, {
|
|
35
|
+
initial: {
|
|
36
|
+
opacity: 0,
|
|
37
|
+
x: 512
|
|
38
|
+
},
|
|
39
|
+
animate: {
|
|
40
|
+
opacity: 1,
|
|
41
|
+
x: 0
|
|
42
|
+
},
|
|
43
|
+
exit: {
|
|
44
|
+
opacity: 0,
|
|
45
|
+
x: 512
|
|
46
|
+
},
|
|
47
|
+
transition: { duration: .3 },
|
|
48
|
+
style: {
|
|
49
|
+
height: "100dvh",
|
|
50
|
+
cursor: "default"
|
|
51
|
+
},
|
|
52
|
+
className: "envive-tw-shadow-md",
|
|
53
|
+
onClick: (e) => e.stopPropagation(),
|
|
54
|
+
children
|
|
55
|
+
})
|
|
56
|
+
})]
|
|
57
|
+
}, "floating-chat-overlay") });
|
|
58
|
+
if (typeof document !== "undefined") return createPortal(chatWrapper, document.body);
|
|
59
|
+
return chatWrapper;
|
|
60
|
+
};
|
|
61
|
+
FloatingChatOverlay.displayName = "FloatingChatOverlay";
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
export { FloatingChatOverlay };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget.cjs');
|
|
3
|
+
require('../../hocs/withBaseWidget/index.cjs');
|
|
4
|
+
const require_FloatingChatOverlay = require('./FloatingChatOverlay.cjs');
|
|
5
|
+
const require_useGetWidgetStatus = require('../hooks/useGetWidgetStatus.cjs');
|
|
6
|
+
const require_types = require('../../CXIntegration/types.cjs');
|
|
7
|
+
const require_constants = require('./constants.cjs');
|
|
8
|
+
const require_useUnifiedCXButton = require('../../CXIntegration/hooks/useUnifiedCXButton.cjs');
|
|
9
|
+
let react = require("react");
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
12
|
+
let __envive_ai_react_toolkit_v3_FloatingChat = require("@envive-ai/react-toolkit-v3/FloatingChat");
|
|
13
|
+
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
14
|
+
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
15
|
+
let __envive_ai_react_toolkit_v3_FloatingButton = require("@envive-ai/react-toolkit-v3/FloatingButton");
|
|
16
|
+
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
17
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
18
|
+
|
|
19
|
+
//#region src/widgets/FloatingChatWidget/FloatingChatWidget.tsx
|
|
20
|
+
const FloatingChatWidgetHandler = (props) => {
|
|
21
|
+
const salesAgentData = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)();
|
|
22
|
+
const { userHasInteractedValue } = require_useGetWidgetStatus.default();
|
|
23
|
+
const { uiConfig, isUiConfigLoading } = props;
|
|
24
|
+
const { isSwitchEnabled, toggle } = require_useUnifiedCXButton.useUnifiedCXButton({
|
|
25
|
+
provider: require_types.CustomerServiceType.unsupported,
|
|
26
|
+
enabled: false,
|
|
27
|
+
suppressMerchantButton: false
|
|
28
|
+
}) ?? {};
|
|
29
|
+
const { isOpen, openChat, closeChat } = (0, __envive_ai_react_hooks_hooks_ChatToggle.useChatToggle)();
|
|
30
|
+
const theme = (0, react.useMemo)(() => {
|
|
31
|
+
if (isUiConfigLoading || !uiConfig) return __envive_ai_react_toolkit_v3_Tokens.Theme.STANDARD;
|
|
32
|
+
return uiConfig?.lookAndFeel?.theme ?? __envive_ai_react_toolkit_v3_Tokens.Theme.GLOBAL_CUSTOM;
|
|
33
|
+
}, [isUiConfigLoading, uiConfig]);
|
|
34
|
+
const { floatingButton } = uiConfig ?? {};
|
|
35
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FloatingChatOverlay.FloatingChatOverlay, {
|
|
36
|
+
isOpened: isOpen,
|
|
37
|
+
onClose: () => closeChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_OVERLAY),
|
|
38
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_FloatingChat.FloatingChat, {
|
|
39
|
+
theme,
|
|
40
|
+
salesAgentData,
|
|
41
|
+
floatingChatConfig: uiConfig?.floatingChat ?? {},
|
|
42
|
+
lookAndFeelConfig: uiConfig?.lookAndFeel ?? {},
|
|
43
|
+
isCXButtonSwitchEnabled: !!isSwitchEnabled?.(),
|
|
44
|
+
onToggleCXButton: toggle,
|
|
45
|
+
onClose: () => closeChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON)
|
|
46
|
+
})
|
|
47
|
+
}), !isOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_FloatingButton.FloatingButton, {
|
|
48
|
+
id: require_constants.FLOATING_BUTTON_ID,
|
|
49
|
+
variant: floatingButton?.style,
|
|
50
|
+
mode: floatingButton?.mode,
|
|
51
|
+
backgroundColor: floatingButton?.backgroundColor,
|
|
52
|
+
onClick: () => openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_BUTTON),
|
|
53
|
+
customIcon: floatingButton?.iconSVGSrc,
|
|
54
|
+
show: floatingButton?.showOption,
|
|
55
|
+
location: floatingButton?.position,
|
|
56
|
+
hasInteractionHappened: userHasInteractedValue,
|
|
57
|
+
ariaLabel: "Open chat"
|
|
58
|
+
})] });
|
|
59
|
+
};
|
|
60
|
+
const FloatingChatWidgetWithBaseWidget = require_withBaseWidget.withBaseWidget(FloatingChatWidgetHandler);
|
|
61
|
+
const FloatingChatWidget = () => {
|
|
62
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FloatingChatWidgetWithBaseWidget, {
|
|
63
|
+
widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.FloatingChatV3,
|
|
64
|
+
widgetConfigId: "fake-widget-config-id"
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
FloatingChatWidget.displayName = "FloatingChatWidget";
|
|
68
|
+
|
|
69
|
+
//#endregion
|
|
70
|
+
exports.FloatingChatWidget = FloatingChatWidget;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react_jsx_runtime13 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts
|
|
4
|
+
interface FloatingChatWidgetProps {}
|
|
5
|
+
declare const FloatingChatWidget: {
|
|
6
|
+
(): react_jsx_runtime13.JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { FloatingChatWidget, FloatingChatWidgetProps };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts
|
|
4
|
+
interface FloatingChatWidgetProps {}
|
|
5
|
+
declare const FloatingChatWidget: {
|
|
6
|
+
(): react_jsx_runtime9.JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { FloatingChatWidget, FloatingChatWidgetProps };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
|
+
import "../../hocs/withBaseWidget/index.js";
|
|
3
|
+
import { FloatingChatOverlay } from "./FloatingChatOverlay.js";
|
|
4
|
+
import useGetWidgetStatus_default from "../hooks/useGetWidgetStatus.js";
|
|
5
|
+
import { CustomerServiceType } from "../../CXIntegration/types.js";
|
|
6
|
+
import { FLOATING_BUTTON_ID } from "./constants.js";
|
|
7
|
+
import { useUnifiedCXButton } from "../../CXIntegration/hooks/useUnifiedCXButton.js";
|
|
8
|
+
import { useMemo } from "react";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
11
|
+
import { FloatingChat } from "@envive-ai/react-toolkit-v3/FloatingChat";
|
|
12
|
+
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
13
|
+
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
14
|
+
import { FloatingButton } from "@envive-ai/react-toolkit-v3/FloatingButton";
|
|
15
|
+
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
16
|
+
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
17
|
+
|
|
18
|
+
//#region src/widgets/FloatingChatWidget/FloatingChatWidget.tsx
|
|
19
|
+
const FloatingChatWidgetHandler = (props) => {
|
|
20
|
+
const salesAgentData = useSalesAgent();
|
|
21
|
+
const { userHasInteractedValue } = useGetWidgetStatus_default();
|
|
22
|
+
const { uiConfig, isUiConfigLoading } = props;
|
|
23
|
+
const { isSwitchEnabled, toggle } = useUnifiedCXButton({
|
|
24
|
+
provider: CustomerServiceType.unsupported,
|
|
25
|
+
enabled: false,
|
|
26
|
+
suppressMerchantButton: false
|
|
27
|
+
}) ?? {};
|
|
28
|
+
const { isOpen, openChat, closeChat } = useChatToggle();
|
|
29
|
+
const theme = useMemo(() => {
|
|
30
|
+
if (isUiConfigLoading || !uiConfig) return Theme.STANDARD;
|
|
31
|
+
return uiConfig?.lookAndFeel?.theme ?? Theme.GLOBAL_CUSTOM;
|
|
32
|
+
}, [isUiConfigLoading, uiConfig]);
|
|
33
|
+
const { floatingButton } = uiConfig ?? {};
|
|
34
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(FloatingChatOverlay, {
|
|
35
|
+
isOpened: isOpen,
|
|
36
|
+
onClose: () => closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_OVERLAY),
|
|
37
|
+
children: /* @__PURE__ */ jsx(FloatingChat, {
|
|
38
|
+
theme,
|
|
39
|
+
salesAgentData,
|
|
40
|
+
floatingChatConfig: uiConfig?.floatingChat ?? {},
|
|
41
|
+
lookAndFeelConfig: uiConfig?.lookAndFeel ?? {},
|
|
42
|
+
isCXButtonSwitchEnabled: !!isSwitchEnabled?.(),
|
|
43
|
+
onToggleCXButton: toggle,
|
|
44
|
+
onClose: () => closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON)
|
|
45
|
+
})
|
|
46
|
+
}), !isOpen && /* @__PURE__ */ jsx(FloatingButton, {
|
|
47
|
+
id: FLOATING_BUTTON_ID,
|
|
48
|
+
variant: floatingButton?.style,
|
|
49
|
+
mode: floatingButton?.mode,
|
|
50
|
+
backgroundColor: floatingButton?.backgroundColor,
|
|
51
|
+
onClick: () => openChat(ChatElementDisplayLocationV3.FLOATING_BUTTON),
|
|
52
|
+
customIcon: floatingButton?.iconSVGSrc,
|
|
53
|
+
show: floatingButton?.showOption,
|
|
54
|
+
location: floatingButton?.position,
|
|
55
|
+
hasInteractionHappened: userHasInteractedValue,
|
|
56
|
+
ariaLabel: "Open chat"
|
|
57
|
+
})] });
|
|
58
|
+
};
|
|
59
|
+
const FloatingChatWidgetWithBaseWidget = withBaseWidget(FloatingChatWidgetHandler);
|
|
60
|
+
const FloatingChatWidget = () => {
|
|
61
|
+
return /* @__PURE__ */ jsx(FloatingChatWidgetWithBaseWidget, {
|
|
62
|
+
widgetType: WidgetTypeV3.FloatingChatV3,
|
|
63
|
+
widgetConfigId: "fake-widget-config-id"
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
FloatingChatWidget.displayName = "FloatingChatWidget";
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
export { FloatingChatWidget };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const require_constants = require('./constants.cjs');
|
|
2
|
+
const require_FloatingChatWidget = require('./FloatingChatWidget.cjs');
|
|
3
|
+
|
|
4
|
+
exports.FLOATING_BUTTON_ID = require_constants.FLOATING_BUTTON_ID;
|
|
5
|
+
exports.FloatingChatWidget = require_FloatingChatWidget.FloatingChatWidget;
|