@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,116 @@
|
|
|
1
|
+
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
|
+
import { getProductImageUrl } from "../utils/functions.js";
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { SocialProofWidgetKind, WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
6
|
+
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
7
|
+
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
8
|
+
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
9
|
+
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
10
|
+
import { useAtomValue, useSetAtom } from "jotai";
|
|
11
|
+
import { lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
12
|
+
import { ChatPreviewLoading } from "@envive-ai/react-toolkit-v3/ChatPreviewLoading";
|
|
13
|
+
import { chatPreviewLoadingDataAtom } from "@envive-ai/react-hooks/atoms/widget";
|
|
14
|
+
import { SocialProof } from "@envive-ai/react-toolkit-v3/SocialProof";
|
|
15
|
+
|
|
16
|
+
//#region src/widgets/SocialProofWidget/SocialProofWidget.tsx
|
|
17
|
+
const SocialProofWidgetHandler = (props) => {
|
|
18
|
+
const setChatPreviewLoadingData = useSetAtom(chatPreviewLoadingDataAtom);
|
|
19
|
+
const { onTypedMessageSubmitted } = useSalesAgent();
|
|
20
|
+
const { openChat } = useChatToggle();
|
|
21
|
+
const lastAssistantMessage = useAtomValue(lastAssistantMessageAtom);
|
|
22
|
+
const { hardcopyContent, widgetConfig, uiConfig, isLoading, widgetConfigId } = props;
|
|
23
|
+
const socialProofWidgetConfig = widgetConfig;
|
|
24
|
+
const id = widgetConfig?.contentId;
|
|
25
|
+
const hardCopyContent = {
|
|
26
|
+
titleLabel: hardcopyContent?.values?.titleLabel,
|
|
27
|
+
numberOfCustomersText: hardcopyContent?.values?.numberOfCustomersText,
|
|
28
|
+
customerQueryText: hardcopyContent?.values?.customerQueryText,
|
|
29
|
+
primaryButtonText: hardcopyContent?.values?.primaryButtonText,
|
|
30
|
+
secondaryButtonTitleText: hardcopyContent?.values?.secondaryButtonTitleText,
|
|
31
|
+
secondaryButtonTexts: hardcopyContent?.values?.secondaryButtonTexts,
|
|
32
|
+
textFieldPlaceholderText: hardcopyContent?.values?.textFieldPlaceholderText
|
|
33
|
+
};
|
|
34
|
+
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
35
|
+
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
36
|
+
const dynamicImageUrl = getProductImageUrl(lastAssistantMessage);
|
|
37
|
+
const images = socialProofWidgetConfig?.kind !== SocialProofWidgetKind.DYNAMIC ? socialProofWidgetConfig?.images : [{
|
|
38
|
+
src: dynamicImageUrl,
|
|
39
|
+
alt: "Product Image"
|
|
40
|
+
}];
|
|
41
|
+
const handlePrimaryButtonClick = useCallback((text) => {
|
|
42
|
+
onTypedMessageSubmitted({
|
|
43
|
+
query: text,
|
|
44
|
+
userTyped: false
|
|
45
|
+
});
|
|
46
|
+
openChat(ChatElementDisplayLocationV3.SOCIAL_PROOF_PRIMARY_BUTTON);
|
|
47
|
+
}, [onTypedMessageSubmitted, openChat]);
|
|
48
|
+
const handleSecondaryButtonClick = useCallback((text) => {
|
|
49
|
+
onTypedMessageSubmitted({
|
|
50
|
+
query: text,
|
|
51
|
+
userTyped: false
|
|
52
|
+
});
|
|
53
|
+
openChat(ChatElementDisplayLocationV3.SOCIAL_PROOF_SECONDARY_BUTTON);
|
|
54
|
+
}, [onTypedMessageSubmitted, openChat]);
|
|
55
|
+
const handleTextFieldClick = useCallback(() => {
|
|
56
|
+
openChat(ChatElementDisplayLocationV3.SOCIAL_PROOF_TEXT_FIELD);
|
|
57
|
+
}, [openChat]);
|
|
58
|
+
if (isLoading) return /* @__PURE__ */ jsx(ChatPreviewLoading, { fullIsLoading: true });
|
|
59
|
+
setChatPreviewLoadingData({
|
|
60
|
+
widgetConfigId,
|
|
61
|
+
data: {
|
|
62
|
+
titleLabel: hardcopyContent?.values?.titleLabel,
|
|
63
|
+
textFieldPlaceholder: hardcopyContent?.values?.textFieldPlaceholderText,
|
|
64
|
+
logoSrc,
|
|
65
|
+
hideLogo: hideLogo ?? false,
|
|
66
|
+
variant: socialProofWidgetConfig?.variant,
|
|
67
|
+
hexCardColor: socialProofWidgetConfig?.hexCardColor,
|
|
68
|
+
hideTextField: socialProofWidgetConfig?.hideTextField ?? false
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
const widgetStyleProps = {
|
|
72
|
+
theme: Theme.GLOBAL_CUSTOM,
|
|
73
|
+
variant: socialProofWidgetConfig?.variant,
|
|
74
|
+
primaryButtonVariant: socialProofWidgetConfig?.primaryButtonVariant,
|
|
75
|
+
secondaryButtonVariant: socialProofWidgetConfig?.secondaryButtonVariant,
|
|
76
|
+
promptCarouselRows: socialProofWidgetConfig?.promptCarouselRows,
|
|
77
|
+
imageGalleryLayout: socialProofWidgetConfig?.imageGalleryLayout,
|
|
78
|
+
hideImage: images?.length === 0 || images === void 0 ? true : socialProofWidgetConfig?.hideImage,
|
|
79
|
+
hideTextField: socialProofWidgetConfig?.hideTextField,
|
|
80
|
+
hideLogo,
|
|
81
|
+
hexCardColor: socialProofWidgetConfig?.hexCardColor,
|
|
82
|
+
dynamicLayout: socialProofWidgetConfig?.dynamicLayout ?? void 0
|
|
83
|
+
};
|
|
84
|
+
const widgetContentProps = {
|
|
85
|
+
titleLabel: hardCopyContent?.titleLabel,
|
|
86
|
+
numberOfCustomersText: hardCopyContent?.numberOfCustomersText,
|
|
87
|
+
customerQueryText: hardCopyContent?.customerQueryText,
|
|
88
|
+
primaryButtonText: hardCopyContent?.primaryButtonText,
|
|
89
|
+
secondaryButtonTitleText: hardCopyContent?.secondaryButtonTitleText,
|
|
90
|
+
secondaryButtonTexts: hardCopyContent?.secondaryButtonTexts,
|
|
91
|
+
textFieldPlaceholderText: hardCopyContent?.textFieldPlaceholderText,
|
|
92
|
+
images: images ?? [],
|
|
93
|
+
logoSrc: logoSrc ?? void 0
|
|
94
|
+
};
|
|
95
|
+
return /* @__PURE__ */ jsx(SocialProof, {
|
|
96
|
+
baseProps: { id },
|
|
97
|
+
widgetStyleProps,
|
|
98
|
+
widgetContentProps,
|
|
99
|
+
widgetEventProps: {
|
|
100
|
+
handlePrimaryButtonClick,
|
|
101
|
+
handleSecondaryButtonClick,
|
|
102
|
+
handleTextFieldClick
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
const SocialProofWidgetWithBaseWidget = withBaseWidget(SocialProofWidgetHandler);
|
|
107
|
+
const SocialProofWidget = ({ widgetConfigId }) => {
|
|
108
|
+
return /* @__PURE__ */ jsx(SocialProofWidgetWithBaseWidget, {
|
|
109
|
+
widgetConfigId,
|
|
110
|
+
widgetType: WidgetTypeV3.SocialProofV3
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
SocialProofWidget.displayName = "SocialProofWidget";
|
|
114
|
+
|
|
115
|
+
//#endregion
|
|
116
|
+
export { SocialProofWidget, SocialProofWidgetWithBaseWidget };
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
let react = require("react");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
7
|
+
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
8
|
+
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
9
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
10
|
+
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
11
|
+
let __envive_ai_react_toolkit_v3_TitledPromptCarousel = require("@envive-ai/react-toolkit-v3/TitledPromptCarousel");
|
|
12
|
+
|
|
13
|
+
//#region src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx
|
|
14
|
+
const mockButtonTexts = [
|
|
15
|
+
"Loading button 1",
|
|
16
|
+
"Loading button 2",
|
|
17
|
+
"Loading button 3",
|
|
18
|
+
"Loading button 4",
|
|
19
|
+
"Loading button 5"
|
|
20
|
+
];
|
|
21
|
+
const mockTitleLabel = "Loading...";
|
|
22
|
+
const TitledPromptCarouselWidgetHandler = (props) => {
|
|
23
|
+
const { onTypedMessageSubmitted } = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)();
|
|
24
|
+
const { openChat } = (0, __envive_ai_react_hooks_hooks_ChatToggle.useChatToggle)();
|
|
25
|
+
const { hardcopyContent, widgetConfig, isLoading } = props;
|
|
26
|
+
const hardCopyTitleLabel = hardcopyContent?.values?.titleLabel;
|
|
27
|
+
const titleLabel = isLoading ? mockTitleLabel : hardCopyTitleLabel;
|
|
28
|
+
const titleAriaLabel = hardcopyContent?.values?.titleAriaLabel;
|
|
29
|
+
const promptCarouselAriaLabel = hardcopyContent?.values?.promptCarouselAriaLabel;
|
|
30
|
+
const promptButtonTexts = hardcopyContent?.values?.promptButtonTexts || [];
|
|
31
|
+
const buttonTexts = isLoading ? mockButtonTexts : promptButtonTexts;
|
|
32
|
+
const titledPromptCarouselWidgetConfig = widgetConfig;
|
|
33
|
+
const id = titledPromptCarouselWidgetConfig?.contentId;
|
|
34
|
+
const boldFirstButton = titledPromptCarouselWidgetConfig?.boldFirstButton;
|
|
35
|
+
const promptButtonType = titledPromptCarouselWidgetConfig?.promptButtonType;
|
|
36
|
+
const promptCarouselRows = titledPromptCarouselWidgetConfig?.promptCarouselRows;
|
|
37
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_TitledPromptCarousel.TitledPromptCarousel, {
|
|
38
|
+
id,
|
|
39
|
+
titleLabel,
|
|
40
|
+
titleAriaLabel,
|
|
41
|
+
isLoading,
|
|
42
|
+
boldFirstButton,
|
|
43
|
+
promptButtonType,
|
|
44
|
+
promptCarouselRows,
|
|
45
|
+
animationSpeed: isLoading ? __envive_ai_react_toolkit_v3_PromptCarousel.AnimationSpeed.FAST : titledPromptCarouselWidgetConfig?.animationSpeed,
|
|
46
|
+
handleButtonClick: (0, react.useCallback)((text) => {
|
|
47
|
+
onTypedMessageSubmitted({
|
|
48
|
+
query: text,
|
|
49
|
+
userTyped: false
|
|
50
|
+
});
|
|
51
|
+
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.TITLED_PROMPT_CAROUSEL);
|
|
52
|
+
}, [onTypedMessageSubmitted, openChat]),
|
|
53
|
+
promptButtonTexts: buttonTexts,
|
|
54
|
+
promptCarouselAriaLabel
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
const TitledPromptCarouselWidgetWithBaseWidget = require_withBaseWidget.withBaseWidget(TitledPromptCarouselWidgetHandler);
|
|
58
|
+
const TitledPromptCarouselWidget = ({ widgetConfigId }) => {
|
|
59
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TitledPromptCarouselWidgetWithBaseWidget, {
|
|
60
|
+
widgetConfigId,
|
|
61
|
+
widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.TitledPromptCarouselV3
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
TitledPromptCarouselWidget.displayName = "TitledPromptCarouselWidget";
|
|
65
|
+
|
|
66
|
+
//#endregion
|
|
67
|
+
exports.TitledPromptCarouselWidget = TitledPromptCarouselWidget;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts
|
|
4
|
+
interface TitledPromptCarouselWidgetProps {
|
|
5
|
+
widgetConfigId: string;
|
|
6
|
+
}
|
|
7
|
+
declare const TitledPromptCarouselWidget: {
|
|
8
|
+
({
|
|
9
|
+
widgetConfigId
|
|
10
|
+
}: TitledPromptCarouselWidgetProps): react_jsx_runtime12.JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { TitledPromptCarouselWidget, TitledPromptCarouselWidgetProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime10 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts
|
|
4
|
+
interface TitledPromptCarouselWidgetProps {
|
|
5
|
+
widgetConfigId: string;
|
|
6
|
+
}
|
|
7
|
+
declare const TitledPromptCarouselWidget: {
|
|
8
|
+
({
|
|
9
|
+
widgetConfigId
|
|
10
|
+
}: TitledPromptCarouselWidgetProps): react_jsx_runtime10.JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { TitledPromptCarouselWidget, TitledPromptCarouselWidgetProps };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
|
+
import "../../hocs/withBaseWidget/index.js";
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
6
|
+
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
7
|
+
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
8
|
+
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
9
|
+
import { AnimationSpeed } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
10
|
+
import { TitledPromptCarousel } from "@envive-ai/react-toolkit-v3/TitledPromptCarousel";
|
|
11
|
+
|
|
12
|
+
//#region src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx
|
|
13
|
+
const mockButtonTexts = [
|
|
14
|
+
"Loading button 1",
|
|
15
|
+
"Loading button 2",
|
|
16
|
+
"Loading button 3",
|
|
17
|
+
"Loading button 4",
|
|
18
|
+
"Loading button 5"
|
|
19
|
+
];
|
|
20
|
+
const mockTitleLabel = "Loading...";
|
|
21
|
+
const TitledPromptCarouselWidgetHandler = (props) => {
|
|
22
|
+
const { onTypedMessageSubmitted } = useSalesAgent();
|
|
23
|
+
const { openChat } = useChatToggle();
|
|
24
|
+
const { hardcopyContent, widgetConfig, isLoading } = props;
|
|
25
|
+
const hardCopyTitleLabel = hardcopyContent?.values?.titleLabel;
|
|
26
|
+
const titleLabel = isLoading ? mockTitleLabel : hardCopyTitleLabel;
|
|
27
|
+
const titleAriaLabel = hardcopyContent?.values?.titleAriaLabel;
|
|
28
|
+
const promptCarouselAriaLabel = hardcopyContent?.values?.promptCarouselAriaLabel;
|
|
29
|
+
const promptButtonTexts = hardcopyContent?.values?.promptButtonTexts || [];
|
|
30
|
+
const buttonTexts = isLoading ? mockButtonTexts : promptButtonTexts;
|
|
31
|
+
const titledPromptCarouselWidgetConfig = widgetConfig;
|
|
32
|
+
const id = titledPromptCarouselWidgetConfig?.contentId;
|
|
33
|
+
const boldFirstButton = titledPromptCarouselWidgetConfig?.boldFirstButton;
|
|
34
|
+
const promptButtonType = titledPromptCarouselWidgetConfig?.promptButtonType;
|
|
35
|
+
const promptCarouselRows = titledPromptCarouselWidgetConfig?.promptCarouselRows;
|
|
36
|
+
return /* @__PURE__ */ jsx(TitledPromptCarousel, {
|
|
37
|
+
id,
|
|
38
|
+
titleLabel,
|
|
39
|
+
titleAriaLabel,
|
|
40
|
+
isLoading,
|
|
41
|
+
boldFirstButton,
|
|
42
|
+
promptButtonType,
|
|
43
|
+
promptCarouselRows,
|
|
44
|
+
animationSpeed: isLoading ? AnimationSpeed.FAST : titledPromptCarouselWidgetConfig?.animationSpeed,
|
|
45
|
+
handleButtonClick: useCallback((text) => {
|
|
46
|
+
onTypedMessageSubmitted({
|
|
47
|
+
query: text,
|
|
48
|
+
userTyped: false
|
|
49
|
+
});
|
|
50
|
+
openChat(ChatElementDisplayLocationV3.TITLED_PROMPT_CAROUSEL);
|
|
51
|
+
}, [onTypedMessageSubmitted, openChat]),
|
|
52
|
+
promptButtonTexts: buttonTexts,
|
|
53
|
+
promptCarouselAriaLabel
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
const TitledPromptCarouselWidgetWithBaseWidget = withBaseWidget(TitledPromptCarouselWidgetHandler);
|
|
57
|
+
const TitledPromptCarouselWidget = ({ widgetConfigId }) => {
|
|
58
|
+
return /* @__PURE__ */ jsx(TitledPromptCarouselWidgetWithBaseWidget, {
|
|
59
|
+
widgetConfigId,
|
|
60
|
+
widgetType: WidgetTypeV3.TitledPromptCarouselV3
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
TitledPromptCarouselWidget.displayName = "TitledPromptCarouselWidget";
|
|
64
|
+
|
|
65
|
+
//#endregion
|
|
66
|
+
export { TitledPromptCarouselWidget };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_useGetWidgetStatus = require('../hooks/useGetWidgetStatus.cjs');
|
|
3
|
+
const require_ChatPreviewLoadingWidget = require('../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs');
|
|
4
|
+
const require_ChatPreviewWidget = require('../ChatPreviewWidget/ChatPreviewWidget.cjs');
|
|
5
|
+
const require_ChatPreviewComparisonWidget = require('../ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs');
|
|
6
|
+
const require_TypingAnimationWidget = require('../TypingAnimationWidget/TypingAnimationWidget.cjs');
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
9
|
+
let __envive_ai_react_toolkit_v3_ChatPreviewLoading = require("@envive-ai/react-toolkit-v3/ChatPreviewLoading");
|
|
10
|
+
|
|
11
|
+
//#region src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.tsx
|
|
12
|
+
const TypingAnimationFlowWidget = ({ widgetConfigId }) => {
|
|
13
|
+
const { userHasInteractedValue, userHasNotInteractedValue, isLoadingValue, isProductComparisonValue } = require_useGetWidgetStatus.default();
|
|
14
|
+
if (userHasInteractedValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewWidget.ChatPreviewWidgetWithBaseWidget, {
|
|
15
|
+
widgetConfigId,
|
|
16
|
+
widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewV3
|
|
17
|
+
});
|
|
18
|
+
if (userHasNotInteractedValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TypingAnimationWidget.TypingAnimationWithBaseWidget, {
|
|
19
|
+
widgetConfigId,
|
|
20
|
+
widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.TypingAnimationV3
|
|
21
|
+
});
|
|
22
|
+
if (isLoadingValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewLoadingWidget.ChatPreviewLoadingWidgetWithBaseWidget, {
|
|
23
|
+
widgetConfigId,
|
|
24
|
+
widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewLoadingV3
|
|
25
|
+
});
|
|
26
|
+
if (isProductComparisonValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewComparisonWidget.ChatPreviewComparisonWidgetWithBaseWidget, {
|
|
27
|
+
widgetConfigId,
|
|
28
|
+
widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewComparisonV3
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_ChatPreviewLoading.ChatPreviewLoading, { fullIsLoading: true });
|
|
31
|
+
};
|
|
32
|
+
TypingAnimationFlowWidget.displayName = "TypingAnimationFlowWidget";
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
exports.TypingAnimationFlowWidget = TypingAnimationFlowWidget;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime16 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts
|
|
4
|
+
interface TypingAnimationFlowWidgetProps {
|
|
5
|
+
widgetConfigId: string;
|
|
6
|
+
}
|
|
7
|
+
declare const TypingAnimationFlowWidget: {
|
|
8
|
+
({
|
|
9
|
+
widgetConfigId
|
|
10
|
+
}: TypingAnimationFlowWidgetProps): react_jsx_runtime16.JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { TypingAnimationFlowWidget, TypingAnimationFlowWidgetProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime16 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts
|
|
4
|
+
interface TypingAnimationFlowWidgetProps {
|
|
5
|
+
widgetConfigId: string;
|
|
6
|
+
}
|
|
7
|
+
declare const TypingAnimationFlowWidget: {
|
|
8
|
+
({
|
|
9
|
+
widgetConfigId
|
|
10
|
+
}: TypingAnimationFlowWidgetProps): react_jsx_runtime16.JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { TypingAnimationFlowWidget, TypingAnimationFlowWidgetProps };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import useGetWidgetStatus_default from "../hooks/useGetWidgetStatus.js";
|
|
2
|
+
import { ChatPreviewLoadingWidgetWithBaseWidget } from "../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js";
|
|
3
|
+
import { ChatPreviewWidgetWithBaseWidget } from "../ChatPreviewWidget/ChatPreviewWidget.js";
|
|
4
|
+
import { ChatPreviewComparisonWidgetWithBaseWidget } from "../ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js";
|
|
5
|
+
import { TypingAnimationWithBaseWidget } from "../TypingAnimationWidget/TypingAnimationWidget.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
8
|
+
import { ChatPreviewLoading } from "@envive-ai/react-toolkit-v3/ChatPreviewLoading";
|
|
9
|
+
|
|
10
|
+
//#region src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.tsx
|
|
11
|
+
const TypingAnimationFlowWidget = ({ widgetConfigId }) => {
|
|
12
|
+
const { userHasInteractedValue, userHasNotInteractedValue, isLoadingValue, isProductComparisonValue } = useGetWidgetStatus_default();
|
|
13
|
+
if (userHasInteractedValue) return /* @__PURE__ */ jsx(ChatPreviewWidgetWithBaseWidget, {
|
|
14
|
+
widgetConfigId,
|
|
15
|
+
widgetType: WidgetTypeV3.ChatPreviewV3
|
|
16
|
+
});
|
|
17
|
+
if (userHasNotInteractedValue) return /* @__PURE__ */ jsx(TypingAnimationWithBaseWidget, {
|
|
18
|
+
widgetConfigId,
|
|
19
|
+
widgetType: WidgetTypeV3.TypingAnimationV3
|
|
20
|
+
});
|
|
21
|
+
if (isLoadingValue) return /* @__PURE__ */ jsx(ChatPreviewLoadingWidgetWithBaseWidget, {
|
|
22
|
+
widgetConfigId,
|
|
23
|
+
widgetType: WidgetTypeV3.ChatPreviewLoadingV3
|
|
24
|
+
});
|
|
25
|
+
if (isProductComparisonValue) return /* @__PURE__ */ jsx(ChatPreviewComparisonWidgetWithBaseWidget, {
|
|
26
|
+
widgetConfigId,
|
|
27
|
+
widgetType: WidgetTypeV3.ChatPreviewComparisonV3
|
|
28
|
+
});
|
|
29
|
+
return /* @__PURE__ */ jsx(ChatPreviewLoading, { fullIsLoading: true });
|
|
30
|
+
};
|
|
31
|
+
TypingAnimationFlowWidget.displayName = "TypingAnimationFlowWidget";
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { TypingAnimationFlowWidget };
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
let react = require("react");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
7
|
+
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
8
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
9
|
+
let jotai = require("jotai");
|
|
10
|
+
let __envive_ai_react_hooks_atoms_chat_chatState = require("@envive-ai/react-hooks/atoms/chat/chatState");
|
|
11
|
+
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
12
|
+
let __envive_ai_react_toolkit_v3_PromptButton_types = require("@envive-ai/react-toolkit-v3/PromptButton/types");
|
|
13
|
+
let __envive_ai_react_toolkit_v3_WidgetWrapper = require("@envive-ai/react-toolkit-v3/WidgetWrapper");
|
|
14
|
+
let __envive_ai_react_toolkit_v3_TypingAnimation = require("@envive-ai/react-toolkit-v3/TypingAnimation");
|
|
15
|
+
|
|
16
|
+
//#region src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx
|
|
17
|
+
const mockButtonTexts = [
|
|
18
|
+
"Loading button 1",
|
|
19
|
+
"Loading button 2",
|
|
20
|
+
"Loading button 3",
|
|
21
|
+
"Loading button 4"
|
|
22
|
+
];
|
|
23
|
+
const mockTitleLabel = "Loading...";
|
|
24
|
+
const mockHeadlineText = "Loading";
|
|
25
|
+
const mockAnimatedTextSequence = ["..."];
|
|
26
|
+
const mockHintText = "Ask me anything";
|
|
27
|
+
const TypingAnimationWidgetHandler = (props) => {
|
|
28
|
+
const { onTypedMessageSubmitted } = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)();
|
|
29
|
+
const onToggle = (0, jotai.useSetAtom)(__envive_ai_react_hooks_atoms_chat_chatState.chatOnToggleAtom);
|
|
30
|
+
const { hardcopyContent, widgetConfig, isLoading } = props;
|
|
31
|
+
const titleLabel = hardcopyContent?.values?.titleLabel || "";
|
|
32
|
+
const headlineText = hardcopyContent?.values?.headlineText || "";
|
|
33
|
+
const animatedTextSequence = hardcopyContent?.values?.animatedTextSequence || [];
|
|
34
|
+
const hintText = hardcopyContent?.values?.hintText;
|
|
35
|
+
const textFieldAriaLabel = hardcopyContent?.values?.textFieldAriaLabel;
|
|
36
|
+
const promptButtonTexts = hardcopyContent?.values?.promptButtonTexts || [];
|
|
37
|
+
const buttonTexts = isLoading ? mockButtonTexts : promptButtonTexts;
|
|
38
|
+
const typingAnimationWidgetConfig = widgetConfig;
|
|
39
|
+
const id = typingAnimationWidgetConfig?.contentId;
|
|
40
|
+
const widgetVariant = typingAnimationWidgetConfig?.widgetVariant || __envive_ai_react_toolkit_v3_WidgetWrapper.WidgetWrapperVariant.CARD_WITH_BORDER;
|
|
41
|
+
const cardColor = typingAnimationWidgetConfig?.cardColor;
|
|
42
|
+
const promptButtonType = typingAnimationWidgetConfig?.promptButtonType || __envive_ai_react_toolkit_v3_PromptButton_types.PromptButtonVariant.LIGHT;
|
|
43
|
+
const promptCarouselRows = typingAnimationWidgetConfig?.promptCarouselRows || __envive_ai_react_toolkit_v3_PromptCarousel.PromptCarouselRows.ALWAYS_ONE;
|
|
44
|
+
const showTextField = typingAnimationWidgetConfig?.showTextField !== false;
|
|
45
|
+
const handleButtonClick = (0, react.useCallback)((text) => {
|
|
46
|
+
onTypedMessageSubmitted({
|
|
47
|
+
query: text,
|
|
48
|
+
userTyped: false
|
|
49
|
+
});
|
|
50
|
+
onToggle(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.TYPING_ANIMATION);
|
|
51
|
+
}, [onTypedMessageSubmitted, onToggle]);
|
|
52
|
+
const handleTextFieldClick = (0, react.useCallback)(() => {
|
|
53
|
+
onToggle(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.TYPING_ANIMATION);
|
|
54
|
+
}, [onToggle]);
|
|
55
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_TypingAnimation.TypingAnimation, {
|
|
56
|
+
baseProps: { id },
|
|
57
|
+
widgetContentProps: {
|
|
58
|
+
titleLabel: isLoading ? mockTitleLabel : titleLabel,
|
|
59
|
+
headlineText: isLoading ? mockHeadlineText : headlineText,
|
|
60
|
+
animatedTextSequence: isLoading ? mockAnimatedTextSequence : animatedTextSequence,
|
|
61
|
+
promptButtonTexts: buttonTexts,
|
|
62
|
+
hintText: isLoading ? mockHintText : hintText,
|
|
63
|
+
textFieldAriaLabel
|
|
64
|
+
},
|
|
65
|
+
widgetStyleProps: {
|
|
66
|
+
widgetVariant,
|
|
67
|
+
cardColor,
|
|
68
|
+
promptButtonType,
|
|
69
|
+
promptCarouselRows,
|
|
70
|
+
showTextField,
|
|
71
|
+
isLoading
|
|
72
|
+
},
|
|
73
|
+
widgetEventProps: {
|
|
74
|
+
handleButtonClick,
|
|
75
|
+
handleTextFieldClick
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
const TypingAnimationWithBaseWidget = require_withBaseWidget.withBaseWidget(TypingAnimationWidgetHandler);
|
|
80
|
+
const TypingAnimationWidget = ({ widgetConfigId }) => {
|
|
81
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TypingAnimationWithBaseWidget, {
|
|
82
|
+
widgetConfigId,
|
|
83
|
+
widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.TypingAnimationV3
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
TypingAnimationWidget.displayName = "TypingAnimationWidget";
|
|
87
|
+
|
|
88
|
+
//#endregion
|
|
89
|
+
exports.TypingAnimationWidget = TypingAnimationWidget;
|
|
90
|
+
exports.TypingAnimationWithBaseWidget = TypingAnimationWithBaseWidget;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts
|
|
5
|
+
declare const TypingAnimationWithBaseWidget: {
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime0.JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
interface TypingAnimationWidgetProps {
|
|
10
|
+
widgetConfigId: string;
|
|
11
|
+
}
|
|
12
|
+
declare const TypingAnimationWidget: {
|
|
13
|
+
({
|
|
14
|
+
widgetConfigId
|
|
15
|
+
}: TypingAnimationWidgetProps): react_jsx_runtime0.JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { TypingAnimationWidget, TypingAnimationWidgetProps, TypingAnimationWithBaseWidget };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts
|
|
5
|
+
declare const TypingAnimationWithBaseWidget: {
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime0.JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
interface TypingAnimationWidgetProps {
|
|
10
|
+
widgetConfigId: string;
|
|
11
|
+
}
|
|
12
|
+
declare const TypingAnimationWidget: {
|
|
13
|
+
({
|
|
14
|
+
widgetConfigId
|
|
15
|
+
}: TypingAnimationWidgetProps): react_jsx_runtime0.JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { TypingAnimationWidget, TypingAnimationWidgetProps, TypingAnimationWithBaseWidget };
|