@envive-ai/react-widgets-v3 0.3.21 → 0.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/debug/chatEmbed.cjs +1 -1
- package/dist/debug/chatEmbed.js +1 -1
- package/dist/debug/reportIssue.cjs +1 -1
- package/dist/debug/reportIssue.js +1 -1
- package/dist/hocs/withBaseWidget/types.d.cts +5 -6
- package/dist/hocs/withBaseWidget/types.d.ts +5 -6
- 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/widgets/dist/SearchResults/SearchResultsWidget.d.ts +2 -2
- package/dist/packages/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.ts +2 -2
- package/dist/packages/widgets/dist/SuggestionBar/SuggestionBar.d.ts +2 -2
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +34 -8
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +35 -9
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs +13 -5
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js +13 -5
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +32 -15
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +35 -18
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +36 -32
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +37 -33
- package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.cjs +2 -2
- package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.js +2 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.cjs +7 -1
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.js +7 -1
- package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +31 -15
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.js +33 -17
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +33 -16
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +36 -19
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +3 -12
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +5 -14
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
- package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +34 -17
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.js +37 -20
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +2 -11
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +4 -13
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +31 -14
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +34 -17
- package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.cts +2 -2
- package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.cts +2 -2
- package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.cts +2 -2
- package/dist/widgets/hooks/useGetWidgetStatus.cjs +1 -1
- package/dist/widgets/hooks/useGetWidgetStatus.js +1 -1
- package/dist/widgets/utils/functions.cjs +1 -1
- package/dist/widgets/utils/functions.js +1 -1
- package/package.json +1 -1
- package/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.tsx +68 -302
- package/src/hocs/withBaseWidget/types.ts +6 -6
- package/src/hocs/withBaseWidget/withBaseWidget.tsx +46 -61
- package/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx +33 -0
- package/src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.tsx +9 -1
- package/src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx +34 -13
- package/src/widgets/ChatPreviewWidget/__tests__/ChatPreviewWidget.test.tsx +11 -5
- package/src/widgets/FloatingChatWidget/FloatingChatWidget.tsx +56 -38
- package/src/widgets/FloatingChatWidget/__tests__/FloatingChatWidget.test.tsx +11 -5
- package/src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.tsx +8 -0
- package/src/widgets/ProductCardWidget/ProductCardWidget.tsx +37 -15
- package/src/widgets/ProductCardWidget/__tests__/ProductCardWidget.test.tsx +12 -8
- package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +35 -13
- package/src/widgets/PromptButtonCarouselWithImageWidget/__tests__/PromptButtonCarouselWithImageWidget.test.tsx +19 -8
- package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +1 -12
- package/src/widgets/PromptCarouselWidget/__tests__/PromptCarouselWidget.test.tsx +21 -8
- package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +34 -12
- package/src/widgets/SocialProofWidget/__tests__/SocialProofWidget.test.tsx +19 -8
- package/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx +1 -12
- package/src/widgets/TitledPromptCarouselWidget/__tests__/TitledPromptCarouselWidget.test.tsx +19 -8
- package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +37 -14
- package/src/widgets/TypingAnimationWidget/__tests__/TypingAnimationWidget.test.tsx +19 -8
- package/src/widgets/__tests__/trackEventCanary.test.ts +1 -1
|
@@ -1,17 +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 { useCallback
|
|
5
|
-
import { EnviveMetricsEventName,
|
|
4
|
+
import { useCallback } from "react";
|
|
5
|
+
import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
8
7
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
9
|
-
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
10
8
|
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
9
|
+
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
10
|
+
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
11
11
|
import { WidgetInteractionComponent } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
12
12
|
import { PromptCarousel, usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
13
|
-
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
14
13
|
import { AnimationSpeed as AnimationSpeed$1 } from "@envive-ai/react-toolkit-v3/PromptCarousel/types/types";
|
|
14
|
+
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
15
15
|
|
|
16
16
|
//#region src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx
|
|
17
17
|
const mockButtonTexts = [
|
|
@@ -38,15 +38,6 @@ const PromptCarouselWidgetHandler = (props) => {
|
|
|
38
38
|
const promptCarouselRows = promptCarouselWidgetConfig?.promptCarouselRows;
|
|
39
39
|
const animationSpeed = isLoading ? AnimationSpeed$1.NONE : promptCarouselWidgetConfig?.animationSpeed;
|
|
40
40
|
const { trackEvent } = useAmplitude();
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
trackEvent({
|
|
43
|
-
eventName: SpiffyMetricsEventName.ChatComponentVisible,
|
|
44
|
-
eventProps: {
|
|
45
|
-
widget_config_id: widgetConfigId,
|
|
46
|
-
widget_type: WidgetTypeV3.PromptCarouselV3
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}, [trackEvent, widgetConfigId]);
|
|
50
41
|
const handleButtonClick = useCallback((text) => {
|
|
51
42
|
const rawValues = hardcopyContent?.rawValues;
|
|
52
43
|
const stringId = getStringIdForText(rawValues, text);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts
|
|
4
4
|
interface SocialProofFlowWidgetProps {
|
|
@@ -7,7 +7,7 @@ interface SocialProofFlowWidgetProps {
|
|
|
7
7
|
declare const SocialProofFlowWidget: {
|
|
8
8
|
({
|
|
9
9
|
widgetConfigId
|
|
10
|
-
}: SocialProofFlowWidgetProps):
|
|
10
|
+
}: SocialProofFlowWidgetProps): react_jsx_runtime9.JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts
|
|
4
4
|
interface SocialProofFlowWidgetProps {
|
|
@@ -7,7 +7,7 @@ interface SocialProofFlowWidgetProps {
|
|
|
7
7
|
declare const SocialProofFlowWidget: {
|
|
8
8
|
({
|
|
9
9
|
widgetConfigId
|
|
10
|
-
}: SocialProofFlowWidgetProps):
|
|
10
|
+
}: SocialProofFlowWidgetProps): react_jsx_runtime0.JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
@@ -4,18 +4,19 @@ const require_functions = require('../utils/functions.cjs');
|
|
|
4
4
|
let react = require("react");
|
|
5
5
|
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
-
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
8
7
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
9
|
-
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
10
8
|
let jotai = require("jotai");
|
|
9
|
+
let __envive_ai_react_hooks_contexts_featureFlagServiceContext = require("@envive-ai/react-hooks/contexts/featureFlagServiceContext");
|
|
11
10
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
12
|
-
let
|
|
13
|
-
let
|
|
11
|
+
let __envive_ai_react_hooks_atoms_widget = require("@envive-ai/react-hooks/atoms/widget");
|
|
12
|
+
let __envive_ai_react_toolkit_v3_ChatPreviewLoading = require("@envive-ai/react-toolkit-v3/ChatPreviewLoading");
|
|
13
|
+
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
14
|
+
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
14
15
|
let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
|
|
15
16
|
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
16
17
|
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
17
|
-
let
|
|
18
|
-
let
|
|
18
|
+
let __envive_ai_react_hooks_atoms_app = require("@envive-ai/react-hooks/atoms/app");
|
|
19
|
+
let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
|
|
19
20
|
let __envive_ai_react_toolkit_v3_SocialProof = require("@envive-ai/react-toolkit-v3/SocialProof");
|
|
20
21
|
let __envive_ai_react_hooks_hooks_ProductImageUrl = require("@envive-ai/react-hooks/hooks/ProductImageUrl");
|
|
21
22
|
|
|
@@ -54,21 +55,15 @@ const SocialProofWidgetHandler = (props) => {
|
|
|
54
55
|
};
|
|
55
56
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
56
57
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
58
|
+
const voiceInputEnabled = uiConfig?.lookAndFeel?.voiceInputEnabled;
|
|
59
|
+
const { featureFlagService } = (0, __envive_ai_react_hooks_contexts_featureFlagServiceContext.useFeatureFlagService)();
|
|
60
|
+
const isVoiceInputEnabled = featureFlagService?.isFeatureGateEnabled(__envive_ai_react_hooks_application_models.FeatureGates.IsVoiceInputEnabled) || voiceInputEnabled;
|
|
57
61
|
const dynamicImageUrl = (0, __envive_ai_react_hooks_hooks_ProductImageUrl.useProductImageUrl)(variantInfo.variant === __envive_ai_react_hooks_application_models.VariantTypeEnum.Pdp ? variantInfo.productId : void 0);
|
|
58
62
|
const images = socialProofWidgetConfig?.kind !== __envive_ai_react_toolkit_v3_SocialProof.WidgetKind.DYNAMIC ? socialProofWidgetConfig?.images : [{
|
|
59
63
|
src: dynamicImageUrl,
|
|
60
64
|
alt: "Product Image"
|
|
61
65
|
}];
|
|
62
66
|
const { trackEvent } = (0, __envive_ai_react_hooks_contexts_amplitudeContext.useAmplitude)();
|
|
63
|
-
(0, react.useEffect)(() => {
|
|
64
|
-
trackEvent({
|
|
65
|
-
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.SpiffyMetricsEventName.ChatComponentVisible,
|
|
66
|
-
eventProps: {
|
|
67
|
-
widget_config_id: widgetConfigId,
|
|
68
|
-
widget_type: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.SocialProofV3
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}, [trackEvent, widgetConfigId]);
|
|
72
67
|
const handlePrimaryButtonClick = (0, react.useCallback)((text) => {
|
|
73
68
|
const rawValues = hardcopyContent?.rawValues;
|
|
74
69
|
const stringId = require_functions.getStringIdForText(rawValues, text);
|
|
@@ -134,6 +129,25 @@ const SocialProofWidgetHandler = (props) => {
|
|
|
134
129
|
}
|
|
135
130
|
});
|
|
136
131
|
}, [openChat]);
|
|
132
|
+
const handleTranscriptionStarted = (0, react.useCallback)(() => {
|
|
133
|
+
trackWidgetInteraction({
|
|
134
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
135
|
+
trigger: {
|
|
136
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.SOCIAL_PROOF,
|
|
137
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.VOICE_TRANSCRIPTION_STARTED
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}, []);
|
|
141
|
+
const handleTranscriptionCompleted = (0, react.useCallback)((transcript) => {
|
|
142
|
+
trackWidgetInteraction({
|
|
143
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
144
|
+
trigger: {
|
|
145
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.SOCIAL_PROOF,
|
|
146
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.VOICE_TRANSCRIPTION_COMPLETED,
|
|
147
|
+
widget_interaction_data: { transcription: transcript }
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}, []);
|
|
137
151
|
if (isLoading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_ChatPreviewLoading.ChatPreviewLoading, { fullIsLoading: true });
|
|
138
152
|
setChatPreviewLoadingData({
|
|
139
153
|
widgetConfigId,
|
|
@@ -169,7 +183,8 @@ const SocialProofWidgetHandler = (props) => {
|
|
|
169
183
|
secondaryButtonTexts: hardCopyContent?.secondaryButtonTexts,
|
|
170
184
|
textFieldPlaceholderText: hardCopyContent?.textFieldPlaceholderText,
|
|
171
185
|
images: images ?? [],
|
|
172
|
-
logoSrc: logoSrc ?? void 0
|
|
186
|
+
logoSrc: logoSrc ?? void 0,
|
|
187
|
+
voiceInputEnabled: isVoiceInputEnabled
|
|
173
188
|
};
|
|
174
189
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_SocialProof.SocialProof, {
|
|
175
190
|
baseProps: {
|
|
@@ -189,7 +204,9 @@ const SocialProofWidgetHandler = (props) => {
|
|
|
189
204
|
handleSecondaryButtonMouseUp: onMouseUp,
|
|
190
205
|
handleSecondaryButtonTouchStart: onTouchStart,
|
|
191
206
|
handleSecondaryButtonTouchEnd: onTouchEnd,
|
|
192
|
-
handleTextFieldClick
|
|
207
|
+
handleTextFieldClick,
|
|
208
|
+
onTranscriptionStarted: handleTranscriptionStarted,
|
|
209
|
+
onTranscriptionCompleted: handleTranscriptionCompleted
|
|
193
210
|
}
|
|
194
211
|
});
|
|
195
212
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/SocialProofWidget/SocialProofWidget.d.ts
|
|
5
5
|
declare const SocialProofWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime6.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface SocialProofWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface SocialProofWidgetProps {
|
|
|
12
12
|
declare const SocialProofWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: SocialProofWidgetProps):
|
|
15
|
+
}: SocialProofWidgetProps): react_jsx_runtime6.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_runtime10 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/SocialProofWidget/SocialProofWidget.d.ts
|
|
5
5
|
declare const SocialProofWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime10.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface SocialProofWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface SocialProofWidgetProps {
|
|
|
12
12
|
declare const SocialProofWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: SocialProofWidgetProps):
|
|
15
|
+
}: SocialProofWidgetProps): react_jsx_runtime10.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
2
|
import { getStringIdForText } from "../utils/functions.js";
|
|
3
|
-
import { useCallback,
|
|
4
|
-
import { EnviveMetricsEventName,
|
|
3
|
+
import { useCallback, useMemo } from "react";
|
|
4
|
+
import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
7
6
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
8
|
-
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
9
7
|
import { useAtomValue, useSetAtom } from "jotai";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
8
|
+
import { useFeatureFlagService } from "@envive-ai/react-hooks/contexts/featureFlagServiceContext";
|
|
9
|
+
import { ChatElementDisplayLocationV3, FeatureGates, VariantTypeEnum } from "@envive-ai/react-hooks/application/models";
|
|
10
|
+
import { chatPreviewLoadingDataAtom } from "@envive-ai/react-hooks/atoms/widget";
|
|
11
|
+
import { ChatPreviewLoading } from "@envive-ai/react-toolkit-v3/ChatPreviewLoading";
|
|
12
|
+
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
13
|
+
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
13
14
|
import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
14
15
|
import { usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
15
16
|
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
17
|
+
import { variantInfoAtom } from "@envive-ai/react-hooks/atoms/app";
|
|
18
|
+
import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
|
|
18
19
|
import { PageVariant, SocialProof, WidgetKind } from "@envive-ai/react-toolkit-v3/SocialProof";
|
|
19
20
|
import { useProductImageUrl } from "@envive-ai/react-hooks/hooks/ProductImageUrl";
|
|
20
21
|
|
|
@@ -53,21 +54,15 @@ const SocialProofWidgetHandler = (props) => {
|
|
|
53
54
|
};
|
|
54
55
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
55
56
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
57
|
+
const voiceInputEnabled = uiConfig?.lookAndFeel?.voiceInputEnabled;
|
|
58
|
+
const { featureFlagService } = useFeatureFlagService();
|
|
59
|
+
const isVoiceInputEnabled = featureFlagService?.isFeatureGateEnabled(FeatureGates.IsVoiceInputEnabled) || voiceInputEnabled;
|
|
56
60
|
const dynamicImageUrl = useProductImageUrl(variantInfo.variant === VariantTypeEnum.Pdp ? variantInfo.productId : void 0);
|
|
57
61
|
const images = socialProofWidgetConfig?.kind !== WidgetKind.DYNAMIC ? socialProofWidgetConfig?.images : [{
|
|
58
62
|
src: dynamicImageUrl,
|
|
59
63
|
alt: "Product Image"
|
|
60
64
|
}];
|
|
61
65
|
const { trackEvent } = useAmplitude();
|
|
62
|
-
useEffect(() => {
|
|
63
|
-
trackEvent({
|
|
64
|
-
eventName: SpiffyMetricsEventName.ChatComponentVisible,
|
|
65
|
-
eventProps: {
|
|
66
|
-
widget_config_id: widgetConfigId,
|
|
67
|
-
widget_type: WidgetTypeV3.SocialProofV3
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
}, [trackEvent, widgetConfigId]);
|
|
71
66
|
const handlePrimaryButtonClick = useCallback((text) => {
|
|
72
67
|
const rawValues = hardcopyContent?.rawValues;
|
|
73
68
|
const stringId = getStringIdForText(rawValues, text);
|
|
@@ -133,6 +128,25 @@ const SocialProofWidgetHandler = (props) => {
|
|
|
133
128
|
}
|
|
134
129
|
});
|
|
135
130
|
}, [openChat]);
|
|
131
|
+
const handleTranscriptionStarted = useCallback(() => {
|
|
132
|
+
trackWidgetInteraction({
|
|
133
|
+
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
134
|
+
trigger: {
|
|
135
|
+
widget: WidgetInteractionComponent.SOCIAL_PROOF,
|
|
136
|
+
widget_interaction: WidgetInteractionType.VOICE_TRANSCRIPTION_STARTED
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}, []);
|
|
140
|
+
const handleTranscriptionCompleted = useCallback((transcript) => {
|
|
141
|
+
trackWidgetInteraction({
|
|
142
|
+
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
143
|
+
trigger: {
|
|
144
|
+
widget: WidgetInteractionComponent.SOCIAL_PROOF,
|
|
145
|
+
widget_interaction: WidgetInteractionType.VOICE_TRANSCRIPTION_COMPLETED,
|
|
146
|
+
widget_interaction_data: { transcription: transcript }
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}, []);
|
|
136
150
|
if (isLoading) return /* @__PURE__ */ jsx(ChatPreviewLoading, { fullIsLoading: true });
|
|
137
151
|
setChatPreviewLoadingData({
|
|
138
152
|
widgetConfigId,
|
|
@@ -168,7 +182,8 @@ const SocialProofWidgetHandler = (props) => {
|
|
|
168
182
|
secondaryButtonTexts: hardCopyContent?.secondaryButtonTexts,
|
|
169
183
|
textFieldPlaceholderText: hardCopyContent?.textFieldPlaceholderText,
|
|
170
184
|
images: images ?? [],
|
|
171
|
-
logoSrc: logoSrc ?? void 0
|
|
185
|
+
logoSrc: logoSrc ?? void 0,
|
|
186
|
+
voiceInputEnabled: isVoiceInputEnabled
|
|
172
187
|
};
|
|
173
188
|
return /* @__PURE__ */ jsx(SocialProof, {
|
|
174
189
|
baseProps: {
|
|
@@ -188,7 +203,9 @@ const SocialProofWidgetHandler = (props) => {
|
|
|
188
203
|
handleSecondaryButtonMouseUp: onMouseUp,
|
|
189
204
|
handleSecondaryButtonTouchStart: onTouchStart,
|
|
190
205
|
handleSecondaryButtonTouchEnd: onTouchEnd,
|
|
191
|
-
handleTextFieldClick
|
|
206
|
+
handleTextFieldClick,
|
|
207
|
+
onTranscriptionStarted: handleTranscriptionStarted,
|
|
208
|
+
onTranscriptionCompleted: handleTranscriptionCompleted
|
|
192
209
|
}
|
|
193
210
|
});
|
|
194
211
|
};
|
|
@@ -5,10 +5,10 @@ const require_functions = require('../utils/functions.cjs');
|
|
|
5
5
|
let react = require("react");
|
|
6
6
|
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
-
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
9
8
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
10
|
-
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
11
9
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
10
|
+
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
11
|
+
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
12
12
|
let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
|
|
13
13
|
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
14
14
|
let __envive_ai_react_toolkit_v3_TitledPromptCarousel = require("@envive-ai/react-toolkit-v3/TitledPromptCarousel");
|
|
@@ -40,15 +40,6 @@ const TitledPromptCarouselWidgetHandler = (props) => {
|
|
|
40
40
|
const promptCarouselRows = titledPromptCarouselWidgetConfig?.promptCarouselRows;
|
|
41
41
|
const animationSpeed = isLoading ? __envive_ai_react_toolkit_v3_PromptCarousel.AnimationSpeed.NONE : titledPromptCarouselWidgetConfig?.animationSpeed;
|
|
42
42
|
const { trackEvent } = (0, __envive_ai_react_hooks_contexts_amplitudeContext.useAmplitude)();
|
|
43
|
-
(0, react.useEffect)(() => {
|
|
44
|
-
trackEvent({
|
|
45
|
-
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.SpiffyMetricsEventName.ChatComponentVisible,
|
|
46
|
-
eventProps: {
|
|
47
|
-
widget_config_id: widgetConfigId,
|
|
48
|
-
widget_type: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.TitledPromptCarouselV3
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}, [trackEvent, widgetConfigId]);
|
|
52
43
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_TitledPromptCarousel.TitledPromptCarousel, {
|
|
53
44
|
id,
|
|
54
45
|
titleLabel,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime19 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_runtime19.JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime7 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_runtime7.JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
@@ -1,13 +1,13 @@
|
|
|
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
|
|
5
|
-
import { EnviveMetricsEventName,
|
|
4
|
+
import { useCallback } from "react";
|
|
5
|
+
import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
8
7
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
9
|
-
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
10
8
|
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
9
|
+
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
10
|
+
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
11
11
|
import { WidgetInteractionComponent } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
12
12
|
import { AnimationSpeed, usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
13
13
|
import { TitledPromptCarousel } from "@envive-ai/react-toolkit-v3/TitledPromptCarousel";
|
|
@@ -39,15 +39,6 @@ const TitledPromptCarouselWidgetHandler = (props) => {
|
|
|
39
39
|
const promptCarouselRows = titledPromptCarouselWidgetConfig?.promptCarouselRows;
|
|
40
40
|
const animationSpeed = isLoading ? AnimationSpeed.NONE : titledPromptCarouselWidgetConfig?.animationSpeed;
|
|
41
41
|
const { trackEvent } = useAmplitude();
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
trackEvent({
|
|
44
|
-
eventName: SpiffyMetricsEventName.ChatComponentVisible,
|
|
45
|
-
eventProps: {
|
|
46
|
-
widget_config_id: widgetConfigId,
|
|
47
|
-
widget_type: WidgetTypeV3.TitledPromptCarouselV3
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}, [trackEvent, widgetConfigId]);
|
|
51
42
|
return /* @__PURE__ */ jsx(TitledPromptCarousel, {
|
|
52
43
|
id,
|
|
53
44
|
titleLabel,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime5 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_runtime5.JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime3 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_runtime3.JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
@@ -5,13 +5,14 @@ const require_functions = require('../utils/functions.cjs');
|
|
|
5
5
|
let react = require("react");
|
|
6
6
|
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
-
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
9
8
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
10
9
|
let jotai = require("jotai");
|
|
10
|
+
let __envive_ai_react_hooks_contexts_featureFlagServiceContext = require("@envive-ai/react-hooks/contexts/featureFlagServiceContext");
|
|
11
11
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
12
|
-
let
|
|
12
|
+
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
13
13
|
let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
|
|
14
14
|
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
15
|
+
let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
|
|
15
16
|
let __envive_ai_react_hooks_atoms_chat_chatState = require("@envive-ai/react-hooks/atoms/chat/chatState");
|
|
16
17
|
let __envive_ai_react_toolkit_v3_PromptButton_types = require("@envive-ai/react-toolkit-v3/PromptButton/types");
|
|
17
18
|
let __envive_ai_react_toolkit_v3_TypingAnimation = require("@envive-ai/react-toolkit-v3/TypingAnimation");
|
|
@@ -31,7 +32,7 @@ const mockHintText = "Ask me anything";
|
|
|
31
32
|
const TypingAnimationWidgetHandler = (props) => {
|
|
32
33
|
const { onTypedMessageSubmitted } = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)();
|
|
33
34
|
const onToggle = (0, jotai.useSetAtom)(__envive_ai_react_hooks_atoms_chat_chatState.chatOnToggleAtom);
|
|
34
|
-
const { hardcopyContent, widgetConfig, uiConfig, isLoading
|
|
35
|
+
const { hardcopyContent, widgetConfig, uiConfig, isLoading } = props;
|
|
35
36
|
const titleLabel = hardcopyContent?.values?.titleLabel || "";
|
|
36
37
|
const headlineText = hardcopyContent?.values?.headlineText || "";
|
|
37
38
|
const animatedTextSequence = hardcopyContent?.values?.animatedTextSequence || [];
|
|
@@ -48,21 +49,15 @@ const TypingAnimationWidgetHandler = (props) => {
|
|
|
48
49
|
const showTextField = typingAnimationWidgetConfig?.showTextField !== false;
|
|
49
50
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
50
51
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
52
|
+
const voiceInputEnabled = uiConfig?.lookAndFeel?.voiceInputEnabled;
|
|
53
|
+
const { featureFlagService } = (0, __envive_ai_react_hooks_contexts_featureFlagServiceContext.useFeatureFlagService)();
|
|
54
|
+
const isVoiceInputEnabled = featureFlagService?.isFeatureGateEnabled(__envive_ai_react_hooks_application_models.FeatureGates.IsVoiceInputEnabled) || voiceInputEnabled;
|
|
51
55
|
const { trackEvent } = (0, __envive_ai_react_hooks_contexts_amplitudeContext.useAmplitude)();
|
|
52
56
|
const { trackWidgetInteraction } = (0, __envive_ai_react_hooks_hooks_WidgetInteraction.useWidgetInteraction)();
|
|
53
57
|
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.EMBEDDED_WIDGET, (text) => {
|
|
54
58
|
const rawValues = hardcopyContent?.rawValues;
|
|
55
59
|
return require_functions.getStringIdForText(rawValues, text);
|
|
56
60
|
});
|
|
57
|
-
(0, react.useEffect)(() => {
|
|
58
|
-
trackEvent({
|
|
59
|
-
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.SpiffyMetricsEventName.ChatComponentVisible,
|
|
60
|
-
eventProps: {
|
|
61
|
-
widget_config_id: widgetConfigId,
|
|
62
|
-
widget_type: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.TypingAnimationV3
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}, [trackEvent, widgetConfigId]);
|
|
66
61
|
const handleButtonClick = (0, react.useCallback)((text) => {
|
|
67
62
|
const rawValues = hardcopyContent?.rawValues;
|
|
68
63
|
const stringId = require_functions.getStringIdForText(rawValues, text);
|
|
@@ -97,6 +92,25 @@ const TypingAnimationWidgetHandler = (props) => {
|
|
|
97
92
|
}
|
|
98
93
|
});
|
|
99
94
|
}, [onToggle]);
|
|
95
|
+
const handleTranscriptionStarted = (0, react.useCallback)(() => {
|
|
96
|
+
trackWidgetInteraction({
|
|
97
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
98
|
+
trigger: {
|
|
99
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.EMBEDDED_WIDGET,
|
|
100
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.VOICE_TRANSCRIPTION_STARTED
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}, []);
|
|
104
|
+
const handleTranscriptionCompleted = (0, react.useCallback)((transcript) => {
|
|
105
|
+
trackWidgetInteraction({
|
|
106
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
107
|
+
trigger: {
|
|
108
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.EMBEDDED_WIDGET,
|
|
109
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.VOICE_TRANSCRIPTION_COMPLETED,
|
|
110
|
+
widget_interaction_data: { transcription: transcript }
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}, []);
|
|
100
114
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_TypingAnimation.TypingAnimation, {
|
|
101
115
|
baseProps: { id },
|
|
102
116
|
widgetContentProps: {
|
|
@@ -107,7 +121,8 @@ const TypingAnimationWidgetHandler = (props) => {
|
|
|
107
121
|
hintText: isLoading ? mockHintText : hintText,
|
|
108
122
|
textFieldAriaLabel,
|
|
109
123
|
logoSrc: logoSrc ?? void 0,
|
|
110
|
-
hideLogo: hideLogo ?? false
|
|
124
|
+
hideLogo: hideLogo ?? false,
|
|
125
|
+
voiceInputEnabled: isVoiceInputEnabled
|
|
111
126
|
},
|
|
112
127
|
widgetStyleProps: {
|
|
113
128
|
widgetVariant,
|
|
@@ -125,7 +140,9 @@ const TypingAnimationWidgetHandler = (props) => {
|
|
|
125
140
|
handleButtonMouseUp: onMouseUp,
|
|
126
141
|
handleButtonTouchStart: onTouchStart,
|
|
127
142
|
handleButtonTouchEnd: onTouchEnd,
|
|
128
|
-
handleTextFieldClick
|
|
143
|
+
handleTextFieldClick,
|
|
144
|
+
onTranscriptionStarted: handleTranscriptionStarted,
|
|
145
|
+
onTranscriptionCompleted: handleTranscriptionCompleted
|
|
129
146
|
}
|
|
130
147
|
});
|
|
131
148
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
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,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime1 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_runtime1.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_runtime1.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|