@envive-ai/react-widgets-v3 0.3.15-alpha.1 → 0.3.15-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hocs/withBaseWidget/types.d.cts +5 -6
- package/dist/hocs/withBaseWidget/types.d.ts +5 -7
- package/dist/hocs/withBaseWidget/withBaseWidget.cjs +37 -43
- package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +2 -2
- package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
- package/dist/hocs/withBaseWidget/withBaseWidget.js +39 -45
- package/dist/packages/hooks/dist/application/models/api/orgConfigResults.d.ts +2 -1
- package/dist/packages/hooks/dist/application/models/api/userEvent.d.ts +1 -0
- package/dist/packages/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.ts +1 -0
- package/dist/packages/hooks/dist/contexts/types.d.ts +3 -1
- package/dist/packages/hooks/dist/contexts/typesV3.d.ts +1 -1
- package/dist/packages/hooks/dist/types/custservice-types.d.ts +1 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/variantInfo/pageVisitInfo.d.ts +1 -0
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/variantInfo/variantInfo.d.ts +2 -1
- package/dist/packages/widgets/dist/packages/hooks/dist/contexts/types.d.ts +1 -0
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +2 -11
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +4 -13
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.cjs +44 -21
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.js +44 -21
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +34 -34
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +3 -1
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +5 -3
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +35 -35
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +2 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +1 -11
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.js +3 -13
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +2 -11
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +4 -13
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +1 -10
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +3 -12
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.cjs +1 -1
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +1 -1
- package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +2 -11
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.js +4 -13
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +0 -9
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +2 -11
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.cjs +1 -1
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +1 -1
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +1 -10
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +3 -12
- package/package.json +1 -1
- package/dist/hooks/dist/services/amplitudeService/eventNames.d.cts +0 -43
- package/dist/packages/hooks/dist/contexts/amplitudeContext/amplitudeContext.d.ts +0 -2
- package/dist/packages/hooks/dist/contexts/amplitudeContext/index.d.ts +0 -2
- package/dist/packages/hooks/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.d.ts +0 -2
- package/dist/packages/hooks/dist/services/amplitudeService/amplitudeService.d.ts +0 -1
- package/dist/packages/hooks/dist/services/amplitudeService/eventNames.d.ts +0 -43
- package/dist/src/CXIntegration/hooks/useUnifiedCXButton.d.ts +0 -10
- package/dist/src/CXIntegration/hooks/useUnifiedCXButton.js +0 -29
- package/dist/src/CXIntegration/implementations/useDefaultUnifiedCXButton.d.ts +0 -2
- package/dist/src/CXIntegration/implementations/useDefaultUnifiedCXButton.js +0 -6
- package/dist/src/CXIntegration/implementations/useEightByEightUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useEightByEightUnifiedCXButton.js +0 -63
- package/dist/src/CXIntegration/implementations/useGladlyUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useGladlyUnifiedCXButton.js +0 -23
- package/dist/src/CXIntegration/implementations/useGorgiasUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useGorgiasUnifiedCXButton.js +0 -54
- package/dist/src/CXIntegration/implementations/useGrooveUnifiedCXButton.d.ts +0 -18
- package/dist/src/CXIntegration/implementations/useGrooveUnifiedCXButton.js +0 -48
- package/dist/src/CXIntegration/implementations/useHelpScoutUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useHelpScoutUnifiedCXButton.js +0 -84
- package/dist/src/CXIntegration/implementations/useKustomerUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useKustomerUnifiedCXButton.js +0 -86
- package/dist/src/CXIntegration/implementations/useReDoUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useReDoUnifiedCXButton.js +0 -59
- package/dist/src/CXIntegration/implementations/useRichpanelUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useRichpanelUnifiedCXButton.js +0 -62
- package/dist/src/CXIntegration/implementations/useShopifyChatUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useShopifyChatUnifiedCXButton.js +0 -49
- package/dist/src/CXIntegration/implementations/useTalkdeskUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useTalkdeskUnifiedCXButton.js +0 -77
- package/dist/src/CXIntegration/implementations/useTidioUnifiedCXButton.d.ts +0 -13
- package/dist/src/CXIntegration/implementations/useTidioUnifiedCXButton.js +0 -20
- package/dist/src/CXIntegration/implementations/useZendeskUnifiedCXButton.d.ts +0 -5
- package/dist/src/CXIntegration/implementations/useZendeskUnifiedCXButton.js +0 -55
- package/dist/src/CXIntegration/implementations/useZowieUnifiedCXButton.d.ts +0 -13
- package/dist/src/CXIntegration/implementations/useZowieUnifiedCXButton.js +0 -20
- package/dist/src/CXIntegration/types.d.ts +0 -26
- package/dist/src/CXIntegration/types.js +0 -17
- package/dist/src/CXIntegration/utils/functions.d.ts +0 -2
- package/dist/src/CXIntegration/utils/functions.js +0 -57
- package/dist/src/debug/GenericSelect.d.ts +0 -11
- package/dist/src/debug/GenericSelect.js +0 -151
- package/dist/src/debug/MessageContent.d.ts +0 -4
- package/dist/src/debug/MessageContent.js +0 -87
- package/dist/src/debug/chatEmbed.d.ts +0 -2
- package/dist/src/debug/chatEmbed.js +0 -58
- package/dist/src/debug/debugBar.d.ts +0 -1
- package/dist/src/debug/debugBar.js +0 -9
- package/dist/src/debug/reportIssue.d.ts +0 -1
- package/dist/src/debug/reportIssue.js +0 -322
- package/dist/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.d.ts +0 -1
- package/dist/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.js +0 -452
- package/dist/src/hocs/withBaseWidget/index.d.ts +0 -2
- package/dist/src/hocs/withBaseWidget/index.js +0 -1
- package/dist/src/hocs/withBaseWidget/types.d.ts +0 -33
- package/dist/src/hocs/withBaseWidget/types.js +0 -0
- package/dist/src/hocs/withBaseWidget/withBaseWidget.d.ts +0 -5
- package/dist/src/hocs/withBaseWidget/withBaseWidget.js +0 -80
- package/dist/src/stories/FloatingChatWidget.stories.d.ts +0 -25
- package/dist/src/stories/FloatingChatWidget.stories.js +0 -44
- package/dist/src/stories/FullPageSalesAgentWidget.stories.d.ts +0 -31
- package/dist/src/stories/FullPageSalesAgentWidget.stories.js +0 -51
- package/dist/src/stories/ProductCardWidget.stories.d.ts +0 -31
- package/dist/src/stories/ProductCardWidget.stories.js +0 -44
- package/dist/src/stories/PromptButtonCarouselWithImageWidget.stories.d.ts +0 -31
- package/dist/src/stories/PromptButtonCarouselWithImageWidget.stories.js +0 -40
- package/dist/src/stories/PromptCarouselWidget.stories.d.ts +0 -31
- package/dist/src/stories/PromptCarouselWidget.stories.js +0 -40
- package/dist/src/stories/SalesAgentTest/SalesAgentTest.d.ts +0 -1
- package/dist/src/stories/SalesAgentTest/SalesAgentTest.js +0 -40
- package/dist/src/stories/SalesAgentTest/SalesAgentTest.stories.d.ts +0 -12
- package/dist/src/stories/SalesAgentTest/SalesAgentTest.stories.js +0 -12
- package/dist/src/stories/SalesAgentTest/index.d.ts +0 -0
- package/dist/src/stories/SalesAgentTest/index.js +0 -0
- package/dist/src/stories/SearchResults.stories.d.ts +0 -6
- package/dist/src/stories/SearchResults.stories.js +0 -23
- package/dist/src/stories/SearchZeroState.stories.d.ts +0 -38
- package/dist/src/stories/SearchZeroState.stories.js +0 -42
- package/dist/src/stories/SocialProofFlowWidget.stories.d.ts +0 -35
- package/dist/src/stories/SocialProofFlowWidget.stories.js +0 -60
- package/dist/src/stories/SuggestionBar.stories.d.ts +0 -7
- package/dist/src/stories/SuggestionBar.stories.js +0 -36
- package/dist/src/stories/TitledPromptCarouselWidget.stories.d.ts +0 -32
- package/dist/src/stories/TitledPromptCarouselWidget.stories.js +0 -55
- package/dist/src/stories/TypingAnimationFlowWidget.stories.d.ts +0 -34
- package/dist/src/stories/TypingAnimationFlowWidget.stories.js +0 -51
- package/dist/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +0 -12
- package/dist/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +0 -112
- package/dist/src/widgets/ChatPreviewComparisonWidget/index.d.ts +0 -3
- package/dist/src/widgets/ChatPreviewComparisonWidget/index.js +0 -2
- package/dist/src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +0 -9
- package/dist/src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js +0 -34
- package/dist/src/widgets/ChatPreviewLoadingWidget/index.d.ts +0 -3
- package/dist/src/widgets/ChatPreviewLoadingWidget/index.js +0 -2
- package/dist/src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +0 -12
- package/dist/src/widgets/ChatPreviewWidget/ChatPreviewWidget.js +0 -111
- package/dist/src/widgets/ChatPreviewWidget/__tests__/ChatPreviewWidget.test.d.ts +0 -1
- package/dist/src/widgets/ChatPreviewWidget/__tests__/ChatPreviewWidget.test.js +0 -97
- package/dist/src/widgets/ChatPreviewWidget/index.d.ts +0 -3
- package/dist/src/widgets/ChatPreviewWidget/index.js +0 -2
- package/dist/src/widgets/FloatingChatWidget/FloatingChatOverlay.d.ts +0 -14
- package/dist/src/widgets/FloatingChatWidget/FloatingChatOverlay.js +0 -44
- package/dist/src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +0 -8
- package/dist/src/widgets/FloatingChatWidget/FloatingChatWidget.js +0 -134
- package/dist/src/widgets/FloatingChatWidget/__tests__/FloatingChatWidget.test.d.ts +0 -1
- package/dist/src/widgets/FloatingChatWidget/__tests__/FloatingChatWidget.test.js +0 -100
- package/dist/src/widgets/FloatingChatWidget/constants.d.ts +0 -1
- package/dist/src/widgets/FloatingChatWidget/constants.js +0 -1
- package/dist/src/widgets/FloatingChatWidget/hooks/useAutoPopup.d.ts +0 -4
- package/dist/src/widgets/FloatingChatWidget/hooks/useAutoPopup.js +0 -51
- package/dist/src/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.d.ts +0 -11
- package/dist/src/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.js +0 -21
- package/dist/src/widgets/FloatingChatWidget/index.d.ts +0 -4
- package/dist/src/widgets/FloatingChatWidget/index.js +0 -3
- package/dist/src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +0 -12
- package/dist/src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.js +0 -14
- package/dist/src/widgets/FullPageSalesAgentWidget/index.d.ts +0 -1
- package/dist/src/widgets/FullPageSalesAgentWidget/index.js +0 -1
- package/dist/src/widgets/ProductCardWidget/ProductCardWidget.d.ts +0 -7
- package/dist/src/widgets/ProductCardWidget/ProductCardWidget.js +0 -94
- package/dist/src/widgets/ProductCardWidget/__tests__/ProductCardWidget.test.d.ts +0 -1
- package/dist/src/widgets/ProductCardWidget/__tests__/ProductCardWidget.test.js +0 -106
- package/dist/src/widgets/ProductCardWidget/index.d.ts +0 -2
- package/dist/src/widgets/ProductCardWidget/index.js +0 -1
- package/dist/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +0 -12
- package/dist/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +0 -88
- package/dist/src/widgets/PromptButtonCarouselWithImageWidget/__tests__/PromptButtonCarouselWithImageWidget.test.d.ts +0 -1
- package/dist/src/widgets/PromptButtonCarouselWithImageWidget/__tests__/PromptButtonCarouselWithImageWidget.test.js +0 -132
- package/dist/src/widgets/PromptButtonCarouselWithImageWidget/index.d.ts +0 -2
- package/dist/src/widgets/PromptButtonCarouselWithImageWidget/index.js +0 -2
- package/dist/src/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +0 -7
- package/dist/src/widgets/PromptCarouselWidget/PromptCarouselWidget.js +0 -74
- package/dist/src/widgets/PromptCarouselWidget/__tests__/PromptCarouselWidget.test.d.ts +0 -1
- package/dist/src/widgets/PromptCarouselWidget/__tests__/PromptCarouselWidget.test.js +0 -106
- package/dist/src/widgets/PromptCarouselWidget/index.d.ts +0 -2
- package/dist/src/widgets/PromptCarouselWidget/index.js +0 -1
- package/dist/src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +0 -7
- package/dist/src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +0 -25
- package/dist/src/widgets/SocialProofFlowWidget/index.d.ts +0 -3
- package/dist/src/widgets/SocialProofFlowWidget/index.js +0 -2
- package/dist/src/widgets/SocialProofWidget/SocialProofWidget.d.ts +0 -12
- package/dist/src/widgets/SocialProofWidget/SocialProofWidget.js +0 -203
- package/dist/src/widgets/SocialProofWidget/__tests__/SocialProofWidget.test.d.ts +0 -1
- package/dist/src/widgets/SocialProofWidget/__tests__/SocialProofWidget.test.js +0 -135
- package/dist/src/widgets/SocialProofWidget/index.d.ts +0 -2
- package/dist/src/widgets/SocialProofWidget/index.js +0 -1
- package/dist/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +0 -7
- package/dist/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +0 -75
- package/dist/src/widgets/TitledPromptCarouselWidget/__tests__/TitledPromptCarouselWidget.test.d.ts +0 -1
- package/dist/src/widgets/TitledPromptCarouselWidget/__tests__/TitledPromptCarouselWidget.test.js +0 -106
- package/dist/src/widgets/TitledPromptCarouselWidget/index.d.ts +0 -2
- package/dist/src/widgets/TitledPromptCarouselWidget/index.js +0 -1
- package/dist/src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +0 -7
- package/dist/src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +0 -25
- package/dist/src/widgets/TypingAnimationFlowWidget/index.d.ts +0 -3
- package/dist/src/widgets/TypingAnimationFlowWidget/index.js +0 -2
- package/dist/src/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +0 -12
- package/dist/src/widgets/TypingAnimationWidget/TypingAnimationWidget.js +0 -126
- package/dist/src/widgets/TypingAnimationWidget/__tests__/TypingAnimationWidget.test.d.ts +0 -1
- package/dist/src/widgets/TypingAnimationWidget/__tests__/TypingAnimationWidget.test.js +0 -118
- package/dist/src/widgets/TypingAnimationWidget/index.d.ts +0 -2
- package/dist/src/widgets/TypingAnimationWidget/index.js +0 -1
- package/dist/src/widgets/__tests__/testUtils.d.ts +0 -60
- package/dist/src/widgets/__tests__/testUtils.js +0 -46
- package/dist/src/widgets/__tests__/trackEventCanary.test.d.ts +0 -1
- package/dist/src/widgets/__tests__/trackEventCanary.test.js +0 -37
- package/dist/src/widgets/hooks/useGetWidgetStatus.d.ts +0 -7
- package/dist/src/widgets/hooks/useGetWidgetStatus.js +0 -17
- package/dist/src/widgets/utils/functions.d.ts +0 -16
- package/dist/src/widgets/utils/functions.js +0 -87
- package/dist/src/widgets-v2/SearchResults/index.d.ts +0 -2
- package/dist/src/widgets-v2/SearchResults/index.js +0 -2
- package/dist/src/widgets-v2/SearchZeroState/index.d.ts +0 -2
- package/dist/src/widgets-v2/SearchZeroState/index.js +0 -2
- package/dist/src/widgets-v2/SuggestionBar/index.d.ts +0 -2
- package/dist/src/widgets-v2/SuggestionBar/index.js +0 -2
- package/dist/src/widgets-v2/SuggestionButtonContainer/index.d.ts +0 -2
- package/dist/src/widgets-v2/SuggestionButtonContainer/index.js +0 -2
- package/dist/tsdown.config.d.ts +0 -2
- package/dist/tsdown.config.js +0 -12
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SpiffyMetricsEventName } from "../../hooks/dist/services/amplitudeService/eventNames.cjs";
|
|
2
1
|
import { OrgUIConfigV3, WidgetConfigV3, WidgetTypeV3 } from "../../hooks/dist/contexts/typesV3.cjs";
|
|
3
2
|
import { HardcopyResponse } from "../../hooks/dist/contexts/hardcopyContext/hardcopyContext.cjs";
|
|
4
3
|
import { RefObject } from "react";
|
|
@@ -18,11 +17,6 @@ interface BaseWidgetProps {
|
|
|
18
17
|
isUiConfigLoading?: boolean;
|
|
19
18
|
}
|
|
20
19
|
interface WithBaseWidgetOptions {
|
|
21
|
-
/**
|
|
22
|
-
* The Amplitude event name to track when the widget becomes visible.
|
|
23
|
-
* Defaults to a generic component visible event if not provided.
|
|
24
|
-
*/
|
|
25
|
-
visibilityEventName?: SpiffyMetricsEventName;
|
|
26
20
|
/**
|
|
27
21
|
* Additional properties to include with the visibility event.
|
|
28
22
|
*/
|
|
@@ -32,6 +26,11 @@ interface WithBaseWidgetOptions {
|
|
|
32
26
|
* Defaults to '0px'.
|
|
33
27
|
*/
|
|
34
28
|
rootMargin?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Whether to defer loading of the widget until it is visible.
|
|
31
|
+
* Defaults to true
|
|
32
|
+
*/
|
|
33
|
+
deferLoading?: boolean;
|
|
35
34
|
}
|
|
36
35
|
//#endregion
|
|
37
36
|
export { BaseWidgetProps, WithBaseWidgetOptions };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { SpiffyMetricsEventName } from "../../packages/hooks/dist/services/amplitudeService/eventNames.js";
|
|
2
1
|
import { OrgUIConfigV3, WidgetConfigV3, WidgetTypeV3 } from "../../packages/hooks/dist/contexts/typesV3.js";
|
|
3
2
|
import { HardcopyResponse } from "../../packages/hooks/dist/contexts/hardcopyContext/hardcopyContext.js";
|
|
4
|
-
import "../../packages/hooks/dist/contexts/amplitudeContext/index.js";
|
|
5
3
|
import "../../packages/hooks/dist/contexts/hardcopyContext/index.js";
|
|
6
4
|
import { RefObject } from "react";
|
|
7
5
|
|
|
@@ -20,11 +18,6 @@ interface BaseWidgetProps {
|
|
|
20
18
|
isUiConfigLoading?: boolean;
|
|
21
19
|
}
|
|
22
20
|
interface WithBaseWidgetOptions {
|
|
23
|
-
/**
|
|
24
|
-
* The Amplitude event name to track when the widget becomes visible.
|
|
25
|
-
* Defaults to a generic component visible event if not provided.
|
|
26
|
-
*/
|
|
27
|
-
visibilityEventName?: SpiffyMetricsEventName;
|
|
28
21
|
/**
|
|
29
22
|
* Additional properties to include with the visibility event.
|
|
30
23
|
*/
|
|
@@ -34,6 +27,11 @@ interface WithBaseWidgetOptions {
|
|
|
34
27
|
* Defaults to '0px'.
|
|
35
28
|
*/
|
|
36
29
|
rootMargin?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Whether to defer loading of the widget until it is visible.
|
|
32
|
+
* Defaults to true
|
|
33
|
+
*/
|
|
34
|
+
deferLoading?: boolean;
|
|
37
35
|
}
|
|
38
36
|
//#endregion
|
|
39
37
|
export { BaseWidgetProps, WithBaseWidgetOptions };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
let react = require("react");
|
|
3
3
|
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
4
|
+
let __envive_ai_react_hooks_hooks_TrackComponentVisibleEvent = require("@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent");
|
|
4
5
|
let __envive_ai_react_hooks_contexts_hardcopyContext = require("@envive-ai/react-hooks/contexts/hardcopyContext");
|
|
5
6
|
let __envive_ai_react_hooks_contexts_pageContext = require("@envive-ai/react-hooks/contexts/pageContext");
|
|
6
7
|
let __envive_ai_react_hooks_contexts_widgetConfigContext = require("@envive-ai/react-hooks/contexts/widgetConfigContext");
|
|
@@ -12,9 +13,9 @@ function withBaseWidget(Widget, options) {
|
|
|
12
13
|
const WrappedWidget = (props) => {
|
|
13
14
|
const { widgetConfigId, widgetType } = props;
|
|
14
15
|
const widgetRef = (0, react.useRef)(null);
|
|
15
|
-
const
|
|
16
|
-
const { trackEvent, isReady } = (0, __envive_ai_react_hooks_contexts_amplitudeContext.useAmplitude)();
|
|
16
|
+
const { isReady } = (0, __envive_ai_react_hooks_contexts_amplitudeContext.useAmplitude)();
|
|
17
17
|
const [hardcopyContent, setHardcopyContent] = (0, react.useState)(void 0);
|
|
18
|
+
const hardcopyFetchedRef = (0, react.useRef)(false);
|
|
18
19
|
const { getHardcopy, isLoading: isHardcopyLoading } = (0, __envive_ai_react_hooks_contexts_hardcopyContext.useHardcopy)();
|
|
19
20
|
const { userEvent, isLoading: isPageLoading } = (0, __envive_ai_react_hooks_contexts_pageContext.usePage)();
|
|
20
21
|
const [widgetConfig, setWidgetConfig] = (0, react.useState)(void 0);
|
|
@@ -22,75 +23,68 @@ function withBaseWidget(Widget, options) {
|
|
|
22
23
|
const [uiConfig, setUiConfig] = (0, react.useState)(void 0);
|
|
23
24
|
const { getUiConfig, isLoading: isUiConfigLoading } = (0, __envive_ai_react_hooks_contexts_uiConfigContext.useUiConfig)();
|
|
24
25
|
const isLoading = isHardcopyLoading || isPageLoading || isWidgetConfigLoading || isUiConfigLoading;
|
|
25
|
-
(0,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
widget_type: widgetType,
|
|
34
|
-
...options?.visibilityEventProps
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
hasTrackedEvent.current = true;
|
|
38
|
-
observer.disconnect();
|
|
39
|
-
}
|
|
40
|
-
}, { rootMargin: options?.rootMargin || "0px" });
|
|
41
|
-
observer.observe(widgetRef.current);
|
|
42
|
-
return () => {
|
|
43
|
-
observer.disconnect();
|
|
44
|
-
};
|
|
26
|
+
const { isVisible } = (0, __envive_ai_react_hooks_hooks_TrackComponentVisibleEvent.useTrackComponentVisibleEvent)(widgetRef, {
|
|
27
|
+
widget_config_id: widgetConfigId,
|
|
28
|
+
widget_type: widgetType,
|
|
29
|
+
...options?.visibilityEventProps
|
|
30
|
+
}, options?.rootMargin || "0px", isReady);
|
|
31
|
+
const startLoading = (0, react.useMemo)(() => {
|
|
32
|
+
if (options?.deferLoading === false) return true;
|
|
33
|
+
return isVisible && !!widgetConfigId && !!widgetType;
|
|
45
34
|
}, [
|
|
46
|
-
|
|
35
|
+
isVisible,
|
|
47
36
|
widgetConfigId,
|
|
48
|
-
widgetType
|
|
49
|
-
trackEvent
|
|
37
|
+
widgetType
|
|
50
38
|
]);
|
|
51
39
|
(0, react.useEffect)(() => {
|
|
52
|
-
if (!
|
|
40
|
+
if (!startLoading || hardcopyFetchedRef.current) return;
|
|
41
|
+
hardcopyFetchedRef.current = true;
|
|
53
42
|
getHardcopy({
|
|
54
43
|
widgetType,
|
|
55
44
|
userEvent
|
|
56
45
|
}).then(setHardcopyContent).catch(() => {});
|
|
57
46
|
}, [
|
|
58
|
-
|
|
47
|
+
startLoading,
|
|
59
48
|
widgetType,
|
|
60
49
|
getHardcopy,
|
|
61
|
-
userEvent
|
|
50
|
+
userEvent,
|
|
51
|
+
widgetConfigId
|
|
62
52
|
]);
|
|
63
53
|
(0, react.useEffect)(() => {
|
|
54
|
+
if (!startLoading) return;
|
|
64
55
|
getUiConfig().then(setUiConfig).catch(() => {});
|
|
65
56
|
}, [
|
|
57
|
+
startLoading,
|
|
66
58
|
getUiConfig,
|
|
67
59
|
widgetConfigId,
|
|
68
60
|
widgetType
|
|
69
61
|
]);
|
|
70
62
|
(0, react.useEffect)(() => {
|
|
71
|
-
if (!
|
|
63
|
+
if (!startLoading) return;
|
|
72
64
|
getWidgetConfig({
|
|
73
65
|
widgetConfigId,
|
|
74
66
|
widgetType
|
|
75
|
-
}).then(setWidgetConfig).catch((
|
|
76
|
-
console.error("Error getting widget config", widgetConfigId, widgetType, e);
|
|
77
|
-
});
|
|
67
|
+
}).then(setWidgetConfig).catch(() => {});
|
|
78
68
|
}, [
|
|
69
|
+
startLoading,
|
|
79
70
|
widgetConfigId,
|
|
80
71
|
widgetType,
|
|
81
72
|
getWidgetConfig
|
|
82
73
|
]);
|
|
83
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
74
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
75
|
+
ref: widgetRef,
|
|
76
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Widget, {
|
|
77
|
+
...props,
|
|
78
|
+
isLoading,
|
|
79
|
+
isHardcopyLoading,
|
|
80
|
+
isPageLoading,
|
|
81
|
+
isWidgetConfigLoading,
|
|
82
|
+
isUiConfigLoading,
|
|
83
|
+
uiConfig,
|
|
84
|
+
widgetConfig,
|
|
85
|
+
hardcopyContent,
|
|
86
|
+
observedWidget: widgetRef
|
|
87
|
+
})
|
|
94
88
|
});
|
|
95
89
|
};
|
|
96
90
|
WrappedWidget.displayName = `withBaseWidget(${Widget.displayName || Widget.name || "Component"})`;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps, WithBaseWidgetOptions } from "./types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/hocs/withBaseWidget/withBaseWidget.d.ts
|
|
5
5
|
declare function withBaseWidget<P extends BaseWidgetProps>(Widget: React.ComponentType<P>, options?: WithBaseWidgetOptions): {
|
|
6
|
-
(props: P):
|
|
6
|
+
(props: P): react_jsx_runtime11.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps, WithBaseWidgetOptions } from "./types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime13 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/hocs/withBaseWidget/withBaseWidget.d.ts
|
|
5
5
|
declare function withBaseWidget<P extends BaseWidgetProps>(Widget: React.ComponentType<P>, options?: WithBaseWidgetOptions): {
|
|
6
|
-
(props: P):
|
|
6
|
+
(props: P): react_jsx_runtime13.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
//#endregion
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from "react";
|
|
2
|
-
import {
|
|
1
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
+
import { useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
3
|
+
import { useTrackComponentVisibleEvent } from "@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent";
|
|
3
4
|
import { useHardcopy } from "@envive-ai/react-hooks/contexts/hardcopyContext";
|
|
4
5
|
import { usePage } from "@envive-ai/react-hooks/contexts/pageContext";
|
|
5
6
|
import { useWidgetConfig } from "@envive-ai/react-hooks/contexts/widgetConfigContext";
|
|
@@ -11,9 +12,9 @@ function withBaseWidget(Widget, options) {
|
|
|
11
12
|
const WrappedWidget = (props) => {
|
|
12
13
|
const { widgetConfigId, widgetType } = props;
|
|
13
14
|
const widgetRef = useRef(null);
|
|
14
|
-
const
|
|
15
|
-
const { trackEvent, isReady } = useAmplitude();
|
|
15
|
+
const { isReady } = useAmplitude();
|
|
16
16
|
const [hardcopyContent, setHardcopyContent] = useState(void 0);
|
|
17
|
+
const hardcopyFetchedRef = useRef(false);
|
|
17
18
|
const { getHardcopy, isLoading: isHardcopyLoading } = useHardcopy();
|
|
18
19
|
const { userEvent, isLoading: isPageLoading } = usePage();
|
|
19
20
|
const [widgetConfig, setWidgetConfig] = useState(void 0);
|
|
@@ -21,75 +22,68 @@ function withBaseWidget(Widget, options) {
|
|
|
21
22
|
const [uiConfig, setUiConfig] = useState(void 0);
|
|
22
23
|
const { getUiConfig, isLoading: isUiConfigLoading } = useUiConfig();
|
|
23
24
|
const isLoading = isHardcopyLoading || isPageLoading || isWidgetConfigLoading || isUiConfigLoading;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
widget_type: widgetType,
|
|
33
|
-
...options?.visibilityEventProps
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
hasTrackedEvent.current = true;
|
|
37
|
-
observer.disconnect();
|
|
38
|
-
}
|
|
39
|
-
}, { rootMargin: options?.rootMargin || "0px" });
|
|
40
|
-
observer.observe(widgetRef.current);
|
|
41
|
-
return () => {
|
|
42
|
-
observer.disconnect();
|
|
43
|
-
};
|
|
25
|
+
const { isVisible } = useTrackComponentVisibleEvent(widgetRef, {
|
|
26
|
+
widget_config_id: widgetConfigId,
|
|
27
|
+
widget_type: widgetType,
|
|
28
|
+
...options?.visibilityEventProps
|
|
29
|
+
}, options?.rootMargin || "0px", isReady);
|
|
30
|
+
const startLoading = useMemo(() => {
|
|
31
|
+
if (options?.deferLoading === false) return true;
|
|
32
|
+
return isVisible && !!widgetConfigId && !!widgetType;
|
|
44
33
|
}, [
|
|
45
|
-
|
|
34
|
+
isVisible,
|
|
46
35
|
widgetConfigId,
|
|
47
|
-
widgetType
|
|
48
|
-
trackEvent
|
|
36
|
+
widgetType
|
|
49
37
|
]);
|
|
50
38
|
useEffect(() => {
|
|
51
|
-
if (!
|
|
39
|
+
if (!startLoading || hardcopyFetchedRef.current) return;
|
|
40
|
+
hardcopyFetchedRef.current = true;
|
|
52
41
|
getHardcopy({
|
|
53
42
|
widgetType,
|
|
54
43
|
userEvent
|
|
55
44
|
}).then(setHardcopyContent).catch(() => {});
|
|
56
45
|
}, [
|
|
57
|
-
|
|
46
|
+
startLoading,
|
|
58
47
|
widgetType,
|
|
59
48
|
getHardcopy,
|
|
60
|
-
userEvent
|
|
49
|
+
userEvent,
|
|
50
|
+
widgetConfigId
|
|
61
51
|
]);
|
|
62
52
|
useEffect(() => {
|
|
53
|
+
if (!startLoading) return;
|
|
63
54
|
getUiConfig().then(setUiConfig).catch(() => {});
|
|
64
55
|
}, [
|
|
56
|
+
startLoading,
|
|
65
57
|
getUiConfig,
|
|
66
58
|
widgetConfigId,
|
|
67
59
|
widgetType
|
|
68
60
|
]);
|
|
69
61
|
useEffect(() => {
|
|
70
|
-
if (!
|
|
62
|
+
if (!startLoading) return;
|
|
71
63
|
getWidgetConfig({
|
|
72
64
|
widgetConfigId,
|
|
73
65
|
widgetType
|
|
74
|
-
}).then(setWidgetConfig).catch((
|
|
75
|
-
console.error("Error getting widget config", widgetConfigId, widgetType, e);
|
|
76
|
-
});
|
|
66
|
+
}).then(setWidgetConfig).catch(() => {});
|
|
77
67
|
}, [
|
|
68
|
+
startLoading,
|
|
78
69
|
widgetConfigId,
|
|
79
70
|
widgetType,
|
|
80
71
|
getWidgetConfig
|
|
81
72
|
]);
|
|
82
|
-
return /* @__PURE__ */ jsx(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
73
|
+
return /* @__PURE__ */ jsx("span", {
|
|
74
|
+
ref: widgetRef,
|
|
75
|
+
children: /* @__PURE__ */ jsx(Widget, {
|
|
76
|
+
...props,
|
|
77
|
+
isLoading,
|
|
78
|
+
isHardcopyLoading,
|
|
79
|
+
isPageLoading,
|
|
80
|
+
isWidgetConfigLoading,
|
|
81
|
+
isUiConfigLoading,
|
|
82
|
+
uiConfig,
|
|
83
|
+
widgetConfig,
|
|
84
|
+
hardcopyContent,
|
|
85
|
+
observedWidget: widgetRef
|
|
86
|
+
})
|
|
93
87
|
});
|
|
94
88
|
};
|
|
95
89
|
WrappedWidget.displayName = `withBaseWidget(${Widget.displayName || Widget.name || "Component"})`;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import "../frontendConfig.js";
|
|
1
|
+
import "../frontendConfig.js";
|
|
2
|
+
import "@spiffy-ai/commerce-api-client";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@spiffy-ai/commerce-api-client";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import "../types/custservice-types.js";
|
|
2
|
+
import "../application/models/api/orgConfigResults.js";
|
|
1
3
|
import "./typesV3.js";
|
|
2
4
|
import "./hardcopyContext/hardcopyContext.js";
|
|
3
|
-
import "
|
|
5
|
+
import "@spiffy-ai/commerce-api-client";
|
|
4
6
|
|
|
5
7
|
//#region ../hooks/dist/contexts/types.d.ts
|
|
6
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CustomerServiceType } from "../types/customerService.js";
|
|
2
2
|
import { SearchConfig } from "./types.js";
|
|
3
|
-
import { AnimationSpeed, PromptCarouselRows } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
4
3
|
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
4
|
+
import { AnimationSpeed, PromptCarouselRows } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
5
5
|
import { FloatingButtonLocation } from "@envive-ai/react-toolkit-v3/FloatingButton";
|
|
6
6
|
import { DynamicLayout, WidgetKind } from "@envive-ai/react-toolkit-v3/SocialProof";
|
|
7
7
|
import { WidgetWrapperVariant } from "@envive-ai/react-toolkit-v3/WidgetWrapper";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@spiffy-ai/commerce-api-client";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@spiffy-ai/commerce-api-client";
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import "../../../contexts/types.js";
|
|
1
|
+
import "../../../contexts/types.js";
|
|
2
|
+
import "./pageVisitInfo.js";
|
|
@@ -10,13 +10,13 @@ let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/rea
|
|
|
10
10
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
11
11
|
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
12
12
|
let jotai = require("jotai");
|
|
13
|
+
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
13
14
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
14
|
-
let __envive_ai_react_hooks_atoms_app = require("@envive-ai/react-hooks/atoms/app");
|
|
15
15
|
let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
|
|
16
16
|
let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
|
|
17
|
-
let __envive_ai_react_toolkit_v3_ChatPreviewComparison = require("@envive-ai/react-toolkit-v3/ChatPreviewComparison");
|
|
18
17
|
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
19
|
-
let
|
|
18
|
+
let __envive_ai_react_hooks_atoms_app = require("@envive-ai/react-hooks/atoms/app");
|
|
19
|
+
let __envive_ai_react_toolkit_v3_ChatPreviewComparison = require("@envive-ai/react-toolkit-v3/ChatPreviewComparison");
|
|
20
20
|
|
|
21
21
|
//#region src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx
|
|
22
22
|
const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts
|
|
5
5
|
declare const ChatPreviewComparisonWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime1.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface ChatPreviewComparisonWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface ChatPreviewComparisonWidgetProps {
|
|
|
12
12
|
declare const ChatPreviewComparisonWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: ChatPreviewComparisonWidgetProps):
|
|
15
|
+
}: ChatPreviewComparisonWidgetProps): react_jsx_runtime1.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime16 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts
|
|
5
5
|
declare const ChatPreviewComparisonWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime16.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface ChatPreviewComparisonWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface ChatPreviewComparisonWidgetProps {
|
|
|
12
12
|
declare const ChatPreviewComparisonWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: ChatPreviewComparisonWidgetProps):
|
|
15
|
+
}: ChatPreviewComparisonWidgetProps): react_jsx_runtime16.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -9,13 +9,13 @@ import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext
|
|
|
9
9
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
10
10
|
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
11
11
|
import { useAtomValue } from "jotai";
|
|
12
|
+
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
12
13
|
import { ChatElementDisplayLocationV3, VariantTypeEnum } from "@envive-ai/react-hooks/application/models";
|
|
13
|
-
import { variantInfoAtom } from "@envive-ai/react-hooks/atoms/app";
|
|
14
14
|
import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
|
|
15
15
|
import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
16
|
-
import { ChatPreviewComparison } from "@envive-ai/react-toolkit-v3/ChatPreviewComparison";
|
|
17
16
|
import { usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
18
|
-
import {
|
|
17
|
+
import { variantInfoAtom } from "@envive-ai/react-hooks/atoms/app";
|
|
18
|
+
import { ChatPreviewComparison } from "@envive-ai/react-toolkit-v3/ChatPreviewComparison";
|
|
19
19
|
|
|
20
20
|
//#region src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx
|
|
21
21
|
const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts
|
|
5
5
|
declare const ChatPreviewLoadingWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime12.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface ChatPreviewLoadingWidgetProps {
|
|
@@ -11,6 +11,6 @@ interface ChatPreviewLoadingWidgetProps {
|
|
|
11
11
|
}
|
|
12
12
|
declare const ChatPreviewLoadingWidget: ({
|
|
13
13
|
widgetConfigId
|
|
14
|
-
}: ChatPreviewLoadingWidgetProps) =>
|
|
14
|
+
}: ChatPreviewLoadingWidgetProps) => react_jsx_runtime12.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetProps, ChatPreviewLoadingWidgetWithBaseWidget };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts
|
|
5
5
|
declare const ChatPreviewLoadingWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime0.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface ChatPreviewLoadingWidgetProps {
|
|
@@ -11,6 +11,6 @@ interface ChatPreviewLoadingWidgetProps {
|
|
|
11
11
|
}
|
|
12
12
|
declare const ChatPreviewLoadingWidget: ({
|
|
13
13
|
widgetConfigId
|
|
14
|
-
}: ChatPreviewLoadingWidgetProps) =>
|
|
14
|
+
}: ChatPreviewLoadingWidgetProps) => react_jsx_runtime0.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetProps, ChatPreviewLoadingWidgetWithBaseWidget };
|
|
@@ -10,12 +10,12 @@ let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/rea
|
|
|
10
10
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
11
11
|
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
12
12
|
let jotai = require("jotai");
|
|
13
|
+
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
13
14
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
14
15
|
let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
|
|
15
16
|
let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
|
|
16
|
-
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
17
|
-
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
18
17
|
let __envive_ai_react_toolkit_v3_ChatPreview = require("@envive-ai/react-toolkit-v3/ChatPreview");
|
|
18
|
+
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
19
19
|
|
|
20
20
|
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx
|
|
21
21
|
const ChatPreviewWidgetHandler = (props) => {
|
|
@@ -36,15 +36,6 @@ const ChatPreviewWidgetHandler = (props) => {
|
|
|
36
36
|
const { trackEvent } = (0, __envive_ai_react_hooks_contexts_amplitudeContext.useAmplitude)();
|
|
37
37
|
const { trackWidgetInteraction } = (0, __envive_ai_react_hooks_hooks_WidgetInteraction.useWidgetInteraction)();
|
|
38
38
|
const { onClick: onPromptClicked, onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = (0, __envive_ai_react_toolkit_v3_PromptCarousel.usePromptCarouselAnalytics)(__envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.CHAT_PREVIEW, (text) => text);
|
|
39
|
-
(0, react.useEffect)(() => {
|
|
40
|
-
trackEvent({
|
|
41
|
-
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.SpiffyMetricsEventName.ChatComponentVisible,
|
|
42
|
-
eventProps: {
|
|
43
|
-
widget_config_id: widgetConfigId,
|
|
44
|
-
widget_type: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewV3
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}, [trackEvent, widgetConfigId]);
|
|
48
39
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
49
40
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
50
41
|
const handlePromptButtonClick = (0, react.useCallback)((suggestion) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts
|
|
5
5
|
declare const ChatPreviewWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime7.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface ChatPreviewWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface ChatPreviewWidgetProps {
|
|
|
12
12
|
declare const ChatPreviewWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: ChatPreviewWidgetProps):
|
|
15
|
+
}: ChatPreviewWidgetProps): react_jsx_runtime7.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts
|
|
5
5
|
declare const ChatPreviewWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime9.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface ChatPreviewWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface ChatPreviewWidgetProps {
|
|
|
12
12
|
declare const ChatPreviewWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: ChatPreviewWidgetProps):
|
|
15
|
+
}: ChatPreviewWidgetProps): react_jsx_runtime9.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
2
|
import { getMessageText } from "../utils/functions.js";
|
|
3
3
|
import { ChatPreviewLoadingWidgetWithBaseWidget } from "../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js";
|
|
4
|
-
import { useCallback,
|
|
5
|
-
import { EnviveMetricsEventName,
|
|
4
|
+
import { useCallback, useMemo } from "react";
|
|
5
|
+
import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
8
8
|
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
9
9
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
10
10
|
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
11
11
|
import { useAtomValue } from "jotai";
|
|
12
|
+
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
12
13
|
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
13
14
|
import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
|
|
14
15
|
import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
15
|
-
import { usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
16
|
-
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
17
16
|
import { ChatPreview } from "@envive-ai/react-toolkit-v3/ChatPreview";
|
|
17
|
+
import { usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
18
18
|
|
|
19
19
|
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx
|
|
20
20
|
const ChatPreviewWidgetHandler = (props) => {
|
|
@@ -35,15 +35,6 @@ const ChatPreviewWidgetHandler = (props) => {
|
|
|
35
35
|
const { trackEvent } = useAmplitude();
|
|
36
36
|
const { trackWidgetInteraction } = useWidgetInteraction();
|
|
37
37
|
const { onClick: onPromptClicked, onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = usePromptCarouselAnalytics(WidgetInteractionComponent.CHAT_PREVIEW, (text) => text);
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
trackEvent({
|
|
40
|
-
eventName: SpiffyMetricsEventName.ChatComponentVisible,
|
|
41
|
-
eventProps: {
|
|
42
|
-
widget_config_id: widgetConfigId,
|
|
43
|
-
widget_type: WidgetTypeV3.ChatPreviewV3
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}, [trackEvent, widgetConfigId]);
|
|
47
38
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
48
39
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
49
40
|
const handlePromptButtonClick = useCallback((suggestion) => {
|