@envive-ai/react-widgets-v3 0.3.23 → 0.3.25
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 +1 -1
- package/dist/CXIntegration/hooks/useUnifiedCXButton.js +1 -1
- package/dist/debug/MessageContent.cjs +1 -1
- package/dist/debug/MessageContent.js +1 -1
- package/dist/debug/chatEmbed.cjs +4 -4
- package/dist/debug/chatEmbed.js +3 -3
- package/dist/debug/reportIssue.cjs +3 -3
- package/dist/debug/reportIssue.js +3 -3
- package/dist/hocs/withBaseWidget/types.d.ts +1 -1
- package/dist/hocs/withBaseWidget/withBaseWidget.cjs +1 -1
- package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +2 -2
- package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
- package/dist/hocs/withBaseWidget/withBaseWidget.js +1 -1
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +9 -9
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +9 -9
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs +1 -1
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js +1 -1
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +7 -7
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +7 -7
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +13 -11
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +7 -3
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +7 -3
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +13 -11
- package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.cjs +2 -2
- package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.js +2 -2
- package/dist/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.cjs +2 -3
- package/dist/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.js +3 -4
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.cjs +1 -1
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +2 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.js +1 -1
- package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +6 -6
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.js +6 -6
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +8 -8
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +8 -8
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +6 -6
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +6 -6
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.cjs +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +2 -2
- package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +9 -9
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.js +9 -9
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +5 -5
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +5 -5
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.cjs +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +2 -2
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +11 -12
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +11 -12
- package/dist/widgets/hooks/useGetWidgetStatus.cjs +2 -2
- package/dist/widgets/hooks/useGetWidgetStatus.js +2 -2
- package/dist/widgets/utils/functions.cjs +1 -1
- package/dist/widgets/utils/functions.js +1 -1
- package/package.json +1 -1
- package/src/widgets/FloatingChatWidget/FloatingChatWidget.tsx +11 -2
- package/src/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.ts +2 -2
- package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +6 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts
|
|
4
4
|
interface TitledPromptCarouselWidgetProps {
|
|
@@ -7,7 +7,7 @@ interface TitledPromptCarouselWidgetProps {
|
|
|
7
7
|
declare const TitledPromptCarouselWidget: {
|
|
8
8
|
({
|
|
9
9
|
widgetConfigId
|
|
10
|
-
}: TitledPromptCarouselWidgetProps):
|
|
10
|
+
}: TitledPromptCarouselWidgetProps): react_jsx_runtime5.JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
2
|
import "../../hocs/withBaseWidget/index.js";
|
|
3
3
|
import { getStringIdForText } from "../utils/functions.js";
|
|
4
|
-
import { useCallback } from "react";
|
|
5
|
-
import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
6
|
-
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
8
|
-
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
9
4
|
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
5
|
+
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
10
6
|
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
7
|
+
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
8
|
+
import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
11
9
|
import { WidgetInteractionComponent } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
12
10
|
import { AnimationSpeed, usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
11
|
+
import { useCallback } from "react";
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
13
|
import { TitledPromptCarousel } from "@envive-ai/react-toolkit-v3/TitledPromptCarousel";
|
|
14
14
|
|
|
15
15
|
//#region src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_ChatPreviewLoadingWidget = require('../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs');
|
|
3
3
|
const require_ChatPreviewComparisonWidget = require('../ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs');
|
|
4
|
-
const require_ChatPreviewWidget = require('../ChatPreviewWidget/ChatPreviewWidget.cjs');
|
|
5
4
|
const require_useGetWidgetStatus = require('../hooks/useGetWidgetStatus.cjs');
|
|
5
|
+
const require_ChatPreviewWidget = require('../ChatPreviewWidget/ChatPreviewWidget.cjs');
|
|
6
6
|
const require_TypingAnimationWidget = require('../TypingAnimationWidget/TypingAnimationWidget.cjs');
|
|
7
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
7
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
let __envive_ai_react_toolkit_v3_ChatPreviewLoading = require("@envive-ai/react-toolkit-v3/ChatPreviewLoading");
|
|
10
10
|
|
|
11
11
|
//#region src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.tsx
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime17 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts
|
|
4
4
|
interface TypingAnimationFlowWidgetProps {
|
|
@@ -7,7 +7,7 @@ interface TypingAnimationFlowWidgetProps {
|
|
|
7
7
|
declare const TypingAnimationFlowWidget: {
|
|
8
8
|
({
|
|
9
9
|
widgetConfigId
|
|
10
|
-
}: TypingAnimationFlowWidgetProps):
|
|
10
|
+
}: TypingAnimationFlowWidgetProps): react_jsx_runtime17.JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime19 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts
|
|
4
4
|
interface TypingAnimationFlowWidgetProps {
|
|
@@ -7,7 +7,7 @@ interface TypingAnimationFlowWidgetProps {
|
|
|
7
7
|
declare const TypingAnimationFlowWidget: {
|
|
8
8
|
({
|
|
9
9
|
widgetConfigId
|
|
10
|
-
}: TypingAnimationFlowWidgetProps):
|
|
10
|
+
}: TypingAnimationFlowWidgetProps): react_jsx_runtime19.JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ChatPreviewLoadingWidgetWithBaseWidget } from "../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js";
|
|
2
2
|
import { ChatPreviewComparisonWidgetWithBaseWidget } from "../ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js";
|
|
3
|
-
import { ChatPreviewWidgetWithBaseWidget } from "../ChatPreviewWidget/ChatPreviewWidget.js";
|
|
4
3
|
import useGetWidgetStatus_default from "../hooks/useGetWidgetStatus.js";
|
|
4
|
+
import { ChatPreviewWidgetWithBaseWidget } from "../ChatPreviewWidget/ChatPreviewWidget.js";
|
|
5
5
|
import { TypingAnimationWithBaseWidget } from "../TypingAnimationWidget/TypingAnimationWidget.js";
|
|
6
|
-
import { jsx } from "react/jsx-runtime";
|
|
7
6
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
import { ChatPreviewLoading } from "@envive-ai/react-toolkit-v3/ChatPreviewLoading";
|
|
9
9
|
|
|
10
10
|
//#region src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.tsx
|
|
@@ -2,18 +2,17 @@ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
|
2
2
|
const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget.cjs');
|
|
3
3
|
require('../../hocs/withBaseWidget/index.cjs');
|
|
4
4
|
const require_functions = require('../utils/functions.cjs');
|
|
5
|
-
let
|
|
6
|
-
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
7
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
8
6
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
9
|
-
let
|
|
7
|
+
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
10
8
|
let __envive_ai_react_hooks_contexts_featureFlagServiceContext = require("@envive-ai/react-hooks/contexts/featureFlagServiceContext");
|
|
11
9
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
12
|
-
let
|
|
10
|
+
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
11
|
+
let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
|
|
13
12
|
let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
|
|
14
13
|
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
15
|
-
let
|
|
16
|
-
let
|
|
14
|
+
let react = require("react");
|
|
15
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
17
16
|
let __envive_ai_react_toolkit_v3_PromptButton_types = require("@envive-ai/react-toolkit-v3/PromptButton/types");
|
|
18
17
|
let __envive_ai_react_toolkit_v3_TypingAnimation = require("@envive-ai/react-toolkit-v3/TypingAnimation");
|
|
19
18
|
let __envive_ai_react_toolkit_v3_WidgetWrapper = require("@envive-ai/react-toolkit-v3/WidgetWrapper");
|
|
@@ -31,7 +30,7 @@ const mockAnimatedTextSequence = ["..."];
|
|
|
31
30
|
const mockHintText = "Ask me anything";
|
|
32
31
|
const TypingAnimationWidgetHandler = (props) => {
|
|
33
32
|
const { onTypedMessageSubmitted } = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)();
|
|
34
|
-
const
|
|
33
|
+
const { openChat } = (0, __envive_ai_react_hooks_hooks_ChatToggle.useChatToggle)();
|
|
35
34
|
const { hardcopyContent, widgetConfig, uiConfig, isLoading } = props;
|
|
36
35
|
const titleLabel = hardcopyContent?.values?.titleLabel || "";
|
|
37
36
|
const headlineText = hardcopyContent?.values?.headlineText || "";
|
|
@@ -74,16 +73,16 @@ const TypingAnimationWidgetHandler = (props) => {
|
|
|
74
73
|
userTyped: false,
|
|
75
74
|
displayLocation: __envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.TYPING_ANIMATION
|
|
76
75
|
});
|
|
77
|
-
|
|
76
|
+
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.TYPING_ANIMATION);
|
|
78
77
|
onPromptClicked(text);
|
|
79
78
|
}, [
|
|
80
79
|
hardcopyContent,
|
|
81
80
|
trackEvent,
|
|
82
81
|
onTypedMessageSubmitted,
|
|
83
|
-
|
|
82
|
+
openChat
|
|
84
83
|
]);
|
|
85
84
|
const handleTextFieldClick = (0, react.useCallback)(() => {
|
|
86
|
-
|
|
85
|
+
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.TYPING_ANIMATION);
|
|
87
86
|
trackWidgetInteraction({
|
|
88
87
|
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
89
88
|
trigger: {
|
|
@@ -91,7 +90,7 @@ const TypingAnimationWidgetHandler = (props) => {
|
|
|
91
90
|
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.QUERY_INPUT_CLICKED
|
|
92
91
|
}
|
|
93
92
|
});
|
|
94
|
-
}, [
|
|
93
|
+
}, [openChat]);
|
|
95
94
|
const handleTranscriptionStarted = (0, react.useCallback)(() => {
|
|
96
95
|
trackWidgetInteraction({
|
|
97
96
|
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime18 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts
|
|
5
5
|
declare const TypingAnimationWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime18.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface TypingAnimationWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface TypingAnimationWidgetProps {
|
|
|
12
12
|
declare const TypingAnimationWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: TypingAnimationWidgetProps):
|
|
15
|
+
}: TypingAnimationWidgetProps): react_jsx_runtime18.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_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts
|
|
5
5
|
declare const TypingAnimationWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime0.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface TypingAnimationWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface TypingAnimationWidgetProps {
|
|
|
12
12
|
declare const TypingAnimationWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: TypingAnimationWidgetProps):
|
|
15
|
+
}: TypingAnimationWidgetProps): react_jsx_runtime0.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
2
|
import "../../hocs/withBaseWidget/index.js";
|
|
3
3
|
import { getStringIdForText } from "../utils/functions.js";
|
|
4
|
-
import {
|
|
5
|
-
import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
6
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
7
5
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
8
|
-
import {
|
|
6
|
+
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
9
7
|
import { useFeatureFlagService } from "@envive-ai/react-hooks/contexts/featureFlagServiceContext";
|
|
10
8
|
import { ChatElementDisplayLocationV3, FeatureGates } from "@envive-ai/react-hooks/application/models";
|
|
11
|
-
import {
|
|
9
|
+
import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
10
|
+
import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
|
|
12
11
|
import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
13
12
|
import { PromptCarouselRows, usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
13
|
+
import { useCallback } from "react";
|
|
14
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
15
|
import { PromptButtonVariant } from "@envive-ai/react-toolkit-v3/PromptButton/types";
|
|
17
16
|
import { TypingAnimation } from "@envive-ai/react-toolkit-v3/TypingAnimation";
|
|
18
17
|
import { WidgetWrapperVariant } from "@envive-ai/react-toolkit-v3/WidgetWrapper";
|
|
@@ -30,7 +29,7 @@ const mockAnimatedTextSequence = ["..."];
|
|
|
30
29
|
const mockHintText = "Ask me anything";
|
|
31
30
|
const TypingAnimationWidgetHandler = (props) => {
|
|
32
31
|
const { onTypedMessageSubmitted } = useSalesAgent();
|
|
33
|
-
const
|
|
32
|
+
const { openChat } = useChatToggle();
|
|
34
33
|
const { hardcopyContent, widgetConfig, uiConfig, isLoading } = props;
|
|
35
34
|
const titleLabel = hardcopyContent?.values?.titleLabel || "";
|
|
36
35
|
const headlineText = hardcopyContent?.values?.headlineText || "";
|
|
@@ -73,16 +72,16 @@ const TypingAnimationWidgetHandler = (props) => {
|
|
|
73
72
|
userTyped: false,
|
|
74
73
|
displayLocation: ChatElementDisplayLocationV3.TYPING_ANIMATION
|
|
75
74
|
});
|
|
76
|
-
|
|
75
|
+
openChat(ChatElementDisplayLocationV3.TYPING_ANIMATION);
|
|
77
76
|
onPromptClicked(text);
|
|
78
77
|
}, [
|
|
79
78
|
hardcopyContent,
|
|
80
79
|
trackEvent,
|
|
81
80
|
onTypedMessageSubmitted,
|
|
82
|
-
|
|
81
|
+
openChat
|
|
83
82
|
]);
|
|
84
83
|
const handleTextFieldClick = useCallback(() => {
|
|
85
|
-
|
|
84
|
+
openChat(ChatElementDisplayLocationV3.TYPING_ANIMATION);
|
|
86
85
|
trackWidgetInteraction({
|
|
87
86
|
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
88
87
|
trigger: {
|
|
@@ -90,7 +89,7 @@ const TypingAnimationWidgetHandler = (props) => {
|
|
|
90
89
|
widget_interaction: WidgetInteractionType.QUERY_INPUT_CLICKED
|
|
91
90
|
}
|
|
92
91
|
});
|
|
93
|
-
}, [
|
|
92
|
+
}, [openChat]);
|
|
94
93
|
const handleTranscriptionStarted = useCallback(() => {
|
|
95
94
|
trackWidgetInteraction({
|
|
96
95
|
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_functions = require('../utils/functions.cjs');
|
|
3
|
-
let react = require("react");
|
|
4
|
-
let jotai = require("jotai");
|
|
5
3
|
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
4
|
+
let jotai = require("jotai");
|
|
5
|
+
let react = require("react");
|
|
6
6
|
let __envive_ai_react_hooks_atoms_chat_chatState = require("@envive-ai/react-hooks/atoms/chat/chatState");
|
|
7
7
|
|
|
8
8
|
//#region src/widgets/hooks/useGetWidgetStatus.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isLoading, isProductComparison, userHasInteracted, userHasNotInteracted } from "../utils/functions.js";
|
|
2
|
-
import { useMemo } from "react";
|
|
3
|
-
import { useAtomValue } from "jotai";
|
|
4
2
|
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
3
|
+
import { useAtomValue } from "jotai";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
5
|
import { responseStreamingAtom } from "@envive-ai/react-hooks/atoms/chat/chatState";
|
|
6
6
|
|
|
7
7
|
//#region src/widgets/hooks/useGetWidgetStatus.tsx
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
3
2
|
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
3
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
4
4
|
let __envive_ai_react_hooks_atoms_atomStore = require("@envive-ai/react-hooks/atoms/atomStore");
|
|
5
5
|
|
|
6
6
|
//#region src/widgets/utils/functions.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MessageRole, MessageType } from "@envive-ai/react-hooks/application/models";
|
|
2
1
|
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
2
|
+
import { MessageRole, MessageType } from "@envive-ai/react-hooks/application/models";
|
|
3
3
|
import { getAtomStore } from "@envive-ai/react-hooks/atoms/atomStore";
|
|
4
4
|
|
|
5
5
|
//#region src/widgets/utils/functions.ts
|
package/package.json
CHANGED
|
@@ -80,10 +80,13 @@ const CXButtonProvider = ({
|
|
|
80
80
|
interface FloatingChatWidgetHandlerProps extends BaseWidgetProps {
|
|
81
81
|
previewButtonOnly?: boolean;
|
|
82
82
|
previewChatAlwaysOpen?: boolean;
|
|
83
|
+
previewCXButtonsEnabled?: boolean;
|
|
84
|
+
previewDisclaimer?: boolean;
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
const FloatingChatWidgetHandler = (props: FloatingChatWidgetHandlerProps) => {
|
|
86
|
-
const { previewButtonOnly, previewChatAlwaysOpen } =
|
|
88
|
+
const { previewButtonOnly, previewChatAlwaysOpen, previewCXButtonsEnabled, previewDisclaimer } =
|
|
89
|
+
props;
|
|
87
90
|
const salesAgentData = useSalesAgent();
|
|
88
91
|
const { trackWidgetInteraction } = useWidgetInteraction();
|
|
89
92
|
const { userHasInteractedValue } = useGetWidgetStatus();
|
|
@@ -205,7 +208,7 @@ const FloatingChatWidgetHandler = (props: FloatingChatWidgetHandlerProps) => {
|
|
|
205
208
|
hardcopyContent={hardcopyContent}
|
|
206
209
|
floatingChatConfig={uiConfig?.floatingChat ?? ({} as FloatingChatConfig)}
|
|
207
210
|
lookAndFeelConfig={modifiedLookAndFeelConfig ?? ({} as LookAndFeelConfig)}
|
|
208
|
-
isCXButtonSwitchEnabled={!!isSwitchEnabled?.()}
|
|
211
|
+
isCXButtonSwitchEnabled={previewCXButtonsEnabled ? true : !!isSwitchEnabled?.()}
|
|
209
212
|
isFloatingChatOpen={effectiveIsOpen}
|
|
210
213
|
onToggleCXButton={toggle}
|
|
211
214
|
debugBar={<DebugBar />}
|
|
@@ -271,11 +274,15 @@ const FloatingChatWidgetWithBaseWidget = withBaseWidget<FloatingChatWidgetHandle
|
|
|
271
274
|
export interface FloatingChatWidgetProps {
|
|
272
275
|
previewButtonOnly?: boolean;
|
|
273
276
|
previewChatAlwaysOpen?: boolean;
|
|
277
|
+
previewCXButtonsEnabled?: boolean;
|
|
278
|
+
previewDisclaimer?: boolean;
|
|
274
279
|
}
|
|
275
280
|
|
|
276
281
|
export const FloatingChatWidget = ({
|
|
277
282
|
previewButtonOnly,
|
|
278
283
|
previewChatAlwaysOpen,
|
|
284
|
+
previewCXButtonsEnabled,
|
|
285
|
+
previewDisclaimer,
|
|
279
286
|
}: FloatingChatWidgetProps = {}) => {
|
|
280
287
|
return (
|
|
281
288
|
<FloatingChatWidgetWithBaseWidget
|
|
@@ -283,6 +290,8 @@ export const FloatingChatWidget = ({
|
|
|
283
290
|
widgetConfigId="fake-widget-config-id"
|
|
284
291
|
previewButtonOnly={previewButtonOnly}
|
|
285
292
|
previewChatAlwaysOpen={previewChatAlwaysOpen}
|
|
293
|
+
previewCXButtonsEnabled={previewCXButtonsEnabled}
|
|
294
|
+
previewDisclaimer={previewDisclaimer}
|
|
286
295
|
/>
|
|
287
296
|
);
|
|
288
297
|
};
|
|
@@ -2,7 +2,7 @@ import { FeatureGates } from '@envive-ai/react-hooks/application/models';
|
|
|
2
2
|
import { variantInfoAtom } from '@envive-ai/react-hooks/atoms/app';
|
|
3
3
|
import { featureFlagServiceAtom } from '@envive-ai/react-hooks/atoms/org';
|
|
4
4
|
import { FloatingButtonShow } from '@envive-ai/react-toolkit-v3/FloatingButton';
|
|
5
|
-
import {
|
|
5
|
+
import { useAtomValue } from 'jotai';
|
|
6
6
|
import { useMemo } from 'react';
|
|
7
7
|
|
|
8
8
|
export interface UseFloatingButtonVisibilityProps {
|
|
@@ -22,7 +22,7 @@ export const useFloatingButtonVisibility = ({
|
|
|
22
22
|
userHasInteracted,
|
|
23
23
|
}: UseFloatingButtonVisibilityProps): UseFloatingButtonVisibilityReturn => {
|
|
24
24
|
const featureFlagService = useAtomValue(featureFlagServiceAtom);
|
|
25
|
-
const
|
|
25
|
+
const variantInfo = useAtomValue(variantInfoAtom);
|
|
26
26
|
|
|
27
27
|
const internalfloatingButtonShowConfig =
|
|
28
28
|
variantInfo.floatingButtonOverride ?? floatingButtonShowConfig;
|
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
ChatElementDisplayLocationV3,
|
|
3
3
|
FeatureGates,
|
|
4
4
|
} from '@envive-ai/react-hooks/application/models';
|
|
5
|
-
import { chatOnToggleAtom } from '@envive-ai/react-hooks/atoms/chat/chatState';
|
|
6
5
|
import {
|
|
7
6
|
EnviveMetricsEventName,
|
|
8
7
|
useAmplitude,
|
|
@@ -25,7 +24,7 @@ import {
|
|
|
25
24
|
} from '@envive-ai/react-toolkit-v3/PromptCarousel';
|
|
26
25
|
import { TypingAnimation } from '@envive-ai/react-toolkit-v3/TypingAnimation';
|
|
27
26
|
import { WidgetWrapperVariant } from '@envive-ai/react-toolkit-v3/WidgetWrapper';
|
|
28
|
-
import {
|
|
27
|
+
import { useChatToggle } from '@envive-ai/react-hooks/hooks/ChatToggle';
|
|
29
28
|
import { useCallback } from 'react';
|
|
30
29
|
import { BaseWidgetProps, withBaseWidget } from '../../hocs/withBaseWidget';
|
|
31
30
|
import { RawValues, getStringIdForText } from '../utils/functions';
|
|
@@ -44,7 +43,7 @@ const mockHintText = 'Ask me anything';
|
|
|
44
43
|
|
|
45
44
|
const TypingAnimationWidgetHandler = (props: BaseWidgetProps) => {
|
|
46
45
|
const { onTypedMessageSubmitted } = useSalesAgent();
|
|
47
|
-
const
|
|
46
|
+
const { openChat } = useChatToggle();
|
|
48
47
|
|
|
49
48
|
const { hardcopyContent, widgetConfig, uiConfig, isLoading } = props;
|
|
50
49
|
|
|
@@ -110,14 +109,14 @@ const TypingAnimationWidgetHandler = (props: BaseWidgetProps) => {
|
|
|
110
109
|
userTyped: false,
|
|
111
110
|
displayLocation: ChatElementDisplayLocationV3.TYPING_ANIMATION,
|
|
112
111
|
});
|
|
113
|
-
|
|
112
|
+
openChat(ChatElementDisplayLocationV3.TYPING_ANIMATION);
|
|
114
113
|
onPromptClicked(text);
|
|
115
114
|
},
|
|
116
|
-
[hardcopyContent, trackEvent, onTypedMessageSubmitted,
|
|
115
|
+
[hardcopyContent, trackEvent, onTypedMessageSubmitted, openChat],
|
|
117
116
|
);
|
|
118
117
|
|
|
119
118
|
const handleTextFieldClick = useCallback(() => {
|
|
120
|
-
|
|
119
|
+
openChat(ChatElementDisplayLocationV3.TYPING_ANIMATION);
|
|
121
120
|
trackWidgetInteraction({
|
|
122
121
|
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
123
122
|
trigger: {
|
|
@@ -125,7 +124,7 @@ const TypingAnimationWidgetHandler = (props: BaseWidgetProps) => {
|
|
|
125
124
|
widget_interaction: WidgetInteractionType.QUERY_INPUT_CLICKED,
|
|
126
125
|
},
|
|
127
126
|
});
|
|
128
|
-
}, [
|
|
127
|
+
}, [openChat]);
|
|
129
128
|
|
|
130
129
|
const handleTranscriptionStarted = useCallback(() => {
|
|
131
130
|
trackWidgetInteraction({
|