@envive-ai/react-widgets-v3 0.3.22 → 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/withBaseWidget.d.cts +2 -2
- package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
- 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 -6
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +33 -7
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +12 -4
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +12 -4
- 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.d.cts +2 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.js +7 -1
- package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +31 -5
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.js +31 -5
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +33 -7
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +34 -8
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +3 -3
- 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 -3
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
- package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +34 -8
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.js +35 -9
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +2 -2
- 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 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +31 -5
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +32 -6
- 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/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx +33 -0
- package/src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.tsx +9 -1
- package/src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx +33 -0
- package/src/widgets/FloatingChatWidget/FloatingChatWidget.tsx +20 -2
- package/src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.tsx +8 -0
- package/src/widgets/ProductCardWidget/ProductCardWidget.tsx +36 -2
- package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +34 -1
- package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +33 -0
- package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +36 -2
package/dist/debug/chatEmbed.cjs
CHANGED
|
@@ -3,10 +3,10 @@ const require_MessageContent = require('./MessageContent.cjs');
|
|
|
3
3
|
let react = require("react");
|
|
4
4
|
react = require_rolldown_runtime.__toESM(react);
|
|
5
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
-
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
7
6
|
let jotai = require("jotai");
|
|
8
7
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
9
8
|
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
9
|
+
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
10
10
|
let classnames = require("classnames");
|
|
11
11
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
12
12
|
|
package/dist/debug/chatEmbed.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { MessageContent } from "./MessageContent.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { chatAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
5
4
|
import { useAtomValue } from "jotai";
|
|
6
5
|
import { MessageType } from "@envive-ai/react-hooks/application/models";
|
|
7
6
|
import { PromptCarousel, PromptCarouselRows } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
7
|
+
import { chatAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
8
8
|
import classNames from "classnames";
|
|
9
9
|
|
|
10
10
|
//#region src/debug/chatEmbed.tsx
|
|
@@ -5,9 +5,9 @@ const require_GenericSelect = require('./GenericSelect.cjs');
|
|
|
5
5
|
const require_chatEmbed = require('./chatEmbed.cjs');
|
|
6
6
|
let react = require("react");
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
-
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
9
8
|
let jotai = require("jotai");
|
|
10
9
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
10
|
+
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
11
11
|
let __envive_ai_react_hooks_atoms_app = require("@envive-ai/react-hooks/atoms/app");
|
|
12
12
|
let classnames = require("classnames");
|
|
13
13
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
@@ -3,9 +3,9 @@ import { GenericSelect } from "./GenericSelect.js";
|
|
|
3
3
|
import chatEmbed_default from "./chatEmbed.js";
|
|
4
4
|
import { useCallback, useEffect, useState } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
7
6
|
import { useAtomValue } from "jotai";
|
|
8
7
|
import { MessageType } from "@envive-ai/react-hooks/application/models";
|
|
8
|
+
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
9
9
|
import { userIdAtom } from "@envive-ai/react-hooks/atoms/app";
|
|
10
10
|
import { ReportSessionRequestReportPriorityEnum, ReportSessionRequestReportTypeEnum } from "@spiffy-ai/commerce-api-client";
|
|
11
11
|
import classNames from "classnames";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps, WithBaseWidgetOptions } from "./types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime18 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_runtime18.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_runtime17 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_runtime17.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region ../widgets/dist/SearchResults/SearchResultsWidget.d.ts
|
|
4
4
|
//#region src/SearchResults/SearchResultsWidget.d.ts
|
|
5
|
-
declare const SearchResultsWidget: () =>
|
|
5
|
+
declare const SearchResultsWidget: () => react_jsx_runtime1.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region ../widgets/dist/SearchZeroState/SearchZeroStateWidget.d.ts
|
|
4
4
|
//#region src/SearchZeroState/SearchZeroStateWidget.d.ts
|
|
@@ -11,7 +11,7 @@ declare const SearchZeroStateWidget: ({
|
|
|
11
11
|
initialIsOpen,
|
|
12
12
|
widgetConfigId,
|
|
13
13
|
entryPointRef
|
|
14
|
-
}: SearchZeroStateWidgetProps) =>
|
|
14
|
+
}: SearchZeroStateWidgetProps) => react_jsx_runtime3.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
|
|
17
17
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SuggestionBarLocationForMetrics } from "./types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
3
|
import { SuggestionButtonVariant } from "@envive-ai/react-hooks/contexts/types";
|
|
4
4
|
import { Message } from "postcss";
|
|
5
5
|
|
|
@@ -30,7 +30,7 @@ declare function SuggestionBar({
|
|
|
30
30
|
buttonBorderRadius,
|
|
31
31
|
handleReply,
|
|
32
32
|
dataTestId
|
|
33
|
-
}: Readonly<SuggestionBarProps>):
|
|
33
|
+
}: Readonly<SuggestionBarProps>): react_jsx_runtime2.JSX.Element;
|
|
34
34
|
//#endregion
|
|
35
35
|
//#endregion
|
|
36
36
|
export { SuggestionBar };
|
|
@@ -5,18 +5,19 @@ const require_ChatPreviewLoadingWidget = require('../ChatPreviewLoadingWidget/Ch
|
|
|
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_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
9
|
-
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
10
8
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
11
|
-
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
12
9
|
let jotai = require("jotai");
|
|
10
|
+
let __envive_ai_react_hooks_contexts_featureFlagServiceContext = require("@envive-ai/react-hooks/contexts/featureFlagServiceContext");
|
|
13
11
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
14
|
-
let
|
|
15
|
-
let
|
|
12
|
+
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
13
|
+
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
16
14
|
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
15
|
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
19
16
|
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
17
|
+
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
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");
|
|
20
|
+
let __envive_ai_react_toolkit_v3_ChatPreviewComparison = require("@envive-ai/react-toolkit-v3/ChatPreviewComparison");
|
|
20
21
|
|
|
21
22
|
//#region src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx
|
|
22
23
|
const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
@@ -45,6 +46,9 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
45
46
|
};
|
|
46
47
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
47
48
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
49
|
+
const voiceInputEnabled = uiConfig?.lookAndFeel?.voiceInputEnabled;
|
|
50
|
+
const { featureFlagService } = (0, __envive_ai_react_hooks_contexts_featureFlagServiceContext.useFeatureFlagService)();
|
|
51
|
+
const isVoiceInputEnabled = featureFlagService?.isFeatureGateEnabled(__envive_ai_react_hooks_application_models.FeatureGates.IsVoiceInputEnabled) || voiceInputEnabled;
|
|
48
52
|
const handlePromptButtonClick = (0, react.useCallback)((suggestion) => {
|
|
49
53
|
onSuggestionClicked(suggestion, __envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.CHAT_PREVIEW_COMPARISON_PROMPT_BUTTON);
|
|
50
54
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.CHAT_PREVIEW_COMPARISON_PROMPT_BUTTON);
|
|
@@ -60,6 +64,25 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
60
64
|
}
|
|
61
65
|
});
|
|
62
66
|
}, [openChat]);
|
|
67
|
+
const handleTranscriptionStarted = (0, react.useCallback)(() => {
|
|
68
|
+
trackWidgetInteraction({
|
|
69
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
70
|
+
trigger: {
|
|
71
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.POST_INTERACTION_COMPARISON,
|
|
72
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.VOICE_TRANSCRIPTION_STARTED
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}, []);
|
|
76
|
+
const handleTranscriptionCompleted = (0, react.useCallback)((transcript) => {
|
|
77
|
+
trackWidgetInteraction({
|
|
78
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
79
|
+
trigger: {
|
|
80
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.POST_INTERACTION_COMPARISON,
|
|
81
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.VOICE_TRANSCRIPTION_COMPLETED,
|
|
82
|
+
widget_interaction_data: { transcription: transcript }
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}, []);
|
|
63
86
|
const handleLinkClick = (url) => {
|
|
64
87
|
trackWidgetInteraction({
|
|
65
88
|
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
@@ -89,7 +112,8 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
89
112
|
promptButtons: suggestions,
|
|
90
113
|
textFieldPlaceholderText: hardCopyContent?.textFieldPlaceholderText,
|
|
91
114
|
images: images ?? [],
|
|
92
|
-
logoSrc: logoSrc ?? void 0
|
|
115
|
+
logoSrc: logoSrc ?? void 0,
|
|
116
|
+
voiceInputEnabled: isVoiceInputEnabled
|
|
93
117
|
};
|
|
94
118
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_ChatPreviewComparison.ChatPreviewComparison, {
|
|
95
119
|
baseProps: { id },
|
|
@@ -104,7 +128,9 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
104
128
|
handlePromptButtonTouchStart: onTouchStart,
|
|
105
129
|
handlePromptButtonTouchEnd: onTouchEnd,
|
|
106
130
|
handleLinkClick,
|
|
107
|
-
handleTextFieldClick
|
|
131
|
+
handleTextFieldClick,
|
|
132
|
+
onTranscriptionStarted: handleTranscriptionStarted,
|
|
133
|
+
onTranscriptionCompleted: handleTranscriptionCompleted
|
|
108
134
|
}
|
|
109
135
|
});
|
|
110
136
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime15 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_runtime15.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_runtime15.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_runtime8 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_runtime8.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_runtime8.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -4,18 +4,19 @@ import { ChatPreviewLoadingWidgetWithBaseWidget } from "../ChatPreviewLoadingWid
|
|
|
4
4
|
import { useCallback, useMemo } from "react";
|
|
5
5
|
import { EnviveMetricsEventName } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
8
|
-
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
9
7
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
10
|
-
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
11
8
|
import { useAtomValue } from "jotai";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
9
|
+
import { useFeatureFlagService } from "@envive-ai/react-hooks/contexts/featureFlagServiceContext";
|
|
10
|
+
import { ChatElementDisplayLocationV3, FeatureGates, VariantTypeEnum } from "@envive-ai/react-hooks/application/models";
|
|
11
|
+
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
12
|
+
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
15
13
|
import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
16
|
-
import { ChatPreviewComparison } from "@envive-ai/react-toolkit-v3/ChatPreviewComparison";
|
|
17
14
|
import { usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
18
15
|
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
16
|
+
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
17
|
+
import { variantInfoAtom } from "@envive-ai/react-hooks/atoms/app";
|
|
18
|
+
import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
|
|
19
|
+
import { ChatPreviewComparison } from "@envive-ai/react-toolkit-v3/ChatPreviewComparison";
|
|
19
20
|
|
|
20
21
|
//#region src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx
|
|
21
22
|
const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
@@ -44,6 +45,9 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
44
45
|
};
|
|
45
46
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
46
47
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
48
|
+
const voiceInputEnabled = uiConfig?.lookAndFeel?.voiceInputEnabled;
|
|
49
|
+
const { featureFlagService } = useFeatureFlagService();
|
|
50
|
+
const isVoiceInputEnabled = featureFlagService?.isFeatureGateEnabled(FeatureGates.IsVoiceInputEnabled) || voiceInputEnabled;
|
|
47
51
|
const handlePromptButtonClick = useCallback((suggestion) => {
|
|
48
52
|
onSuggestionClicked(suggestion, ChatElementDisplayLocationV3.CHAT_PREVIEW_COMPARISON_PROMPT_BUTTON);
|
|
49
53
|
openChat(ChatElementDisplayLocationV3.CHAT_PREVIEW_COMPARISON_PROMPT_BUTTON);
|
|
@@ -59,6 +63,25 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
59
63
|
}
|
|
60
64
|
});
|
|
61
65
|
}, [openChat]);
|
|
66
|
+
const handleTranscriptionStarted = useCallback(() => {
|
|
67
|
+
trackWidgetInteraction({
|
|
68
|
+
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
69
|
+
trigger: {
|
|
70
|
+
widget: WidgetInteractionComponent.POST_INTERACTION_COMPARISON,
|
|
71
|
+
widget_interaction: WidgetInteractionType.VOICE_TRANSCRIPTION_STARTED
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}, []);
|
|
75
|
+
const handleTranscriptionCompleted = useCallback((transcript) => {
|
|
76
|
+
trackWidgetInteraction({
|
|
77
|
+
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
78
|
+
trigger: {
|
|
79
|
+
widget: WidgetInteractionComponent.POST_INTERACTION_COMPARISON,
|
|
80
|
+
widget_interaction: WidgetInteractionType.VOICE_TRANSCRIPTION_COMPLETED,
|
|
81
|
+
widget_interaction_data: { transcription: transcript }
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}, []);
|
|
62
85
|
const handleLinkClick = (url) => {
|
|
63
86
|
trackWidgetInteraction({
|
|
64
87
|
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
@@ -88,7 +111,8 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
88
111
|
promptButtons: suggestions,
|
|
89
112
|
textFieldPlaceholderText: hardCopyContent?.textFieldPlaceholderText,
|
|
90
113
|
images: images ?? [],
|
|
91
|
-
logoSrc: logoSrc ?? void 0
|
|
114
|
+
logoSrc: logoSrc ?? void 0,
|
|
115
|
+
voiceInputEnabled: isVoiceInputEnabled
|
|
92
116
|
};
|
|
93
117
|
return /* @__PURE__ */ jsx(ChatPreviewComparison, {
|
|
94
118
|
baseProps: { id },
|
|
@@ -103,7 +127,9 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
103
127
|
handlePromptButtonTouchStart: onTouchStart,
|
|
104
128
|
handlePromptButtonTouchEnd: onTouchEnd,
|
|
105
129
|
handleLinkClick,
|
|
106
|
-
handleTextFieldClick
|
|
130
|
+
handleTextFieldClick,
|
|
131
|
+
onTranscriptionStarted: handleTranscriptionStarted,
|
|
132
|
+
onTranscriptionCompleted: handleTranscriptionCompleted
|
|
107
133
|
}
|
|
108
134
|
});
|
|
109
135
|
};
|
|
@@ -4,8 +4,10 @@ const require_PromptCarouselWidget = require('../PromptCarouselWidget/PromptCaro
|
|
|
4
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
5
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
6
6
|
let jotai = require("jotai");
|
|
7
|
-
let
|
|
7
|
+
let __envive_ai_react_hooks_contexts_featureFlagServiceContext = require("@envive-ai/react-hooks/contexts/featureFlagServiceContext");
|
|
8
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
8
9
|
let __envive_ai_react_hooks_atoms_widget = require("@envive-ai/react-hooks/atoms/widget");
|
|
10
|
+
let __envive_ai_react_toolkit_v3_ChatPreviewLoading = require("@envive-ai/react-toolkit-v3/ChatPreviewLoading");
|
|
9
11
|
|
|
10
12
|
//#region src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.tsx
|
|
11
13
|
const ChatPreviewLoadingWidgetHandler = (props) => {
|
|
@@ -13,21 +15,27 @@ const ChatPreviewLoadingWidgetHandler = (props) => {
|
|
|
13
15
|
const chatPreviewLoadingWidgetConfig = widgetConfig;
|
|
14
16
|
const id = widgetConfig?.contentId;
|
|
15
17
|
const chatPreviewLoadingData = (0, jotai.useAtomValue)(__envive_ai_react_hooks_atoms_widget.chatPreviewLoadingDataAtom)[widgetConfigId] ?? void 0;
|
|
18
|
+
const { featureFlagService } = (0, __envive_ai_react_hooks_contexts_featureFlagServiceContext.useFeatureFlagService)();
|
|
16
19
|
const isCacheEmpty = !chatPreviewLoadingData || Object.values(chatPreviewLoadingData).every((value) => value === void 0) || Object.keys(chatPreviewLoadingData).length === 0;
|
|
17
20
|
if (isLoading && isCacheEmpty) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_ChatPreviewLoading.ChatPreviewLoading, { fullIsLoading: true });
|
|
18
21
|
const titleLabel = hardcopyContent?.values?.titleLabel ?? chatPreviewLoadingData?.titleLabel;
|
|
19
22
|
const textFieldPlaceholder = hardcopyContent?.values?.textFieldPlaceholderText ?? chatPreviewLoadingData?.textFieldPlaceholder;
|
|
20
23
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo ?? chatPreviewLoadingData?.hideLogo;
|
|
21
24
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc ?? chatPreviewLoadingData?.logoSrc;
|
|
25
|
+
const variant = chatPreviewLoadingWidgetConfig?.variant ?? chatPreviewLoadingData?.variant;
|
|
26
|
+
const hexCardColor = chatPreviewLoadingWidgetConfig?.hexCardColor ?? chatPreviewLoadingData?.hexCardColor;
|
|
27
|
+
const hideTextField = chatPreviewLoadingWidgetConfig?.hideTextField ?? chatPreviewLoadingData?.hideTextField;
|
|
28
|
+
const voiceInputEnabled = uiConfig?.lookAndFeel?.voiceInputEnabled;
|
|
22
29
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_ChatPreviewLoading.ChatPreviewLoading, {
|
|
23
30
|
id,
|
|
24
|
-
variant
|
|
25
|
-
hexCardColor
|
|
26
|
-
hideTextField
|
|
31
|
+
variant,
|
|
32
|
+
hexCardColor,
|
|
33
|
+
hideTextField,
|
|
27
34
|
textFieldPlaceholder,
|
|
28
35
|
hideLogo,
|
|
29
36
|
logoSrc,
|
|
30
|
-
titleLabel
|
|
37
|
+
titleLabel,
|
|
38
|
+
voiceInputEnabled: featureFlagService?.isFeatureGateEnabled(__envive_ai_react_hooks_application_models.FeatureGates.IsVoiceInputEnabled) || voiceInputEnabled
|
|
31
39
|
});
|
|
32
40
|
};
|
|
33
41
|
const ChatPreviewLoadingWidgetWithBaseWidget = require_withBaseWidget.withBaseWidget(ChatPreviewLoadingWidgetHandler);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime13 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_runtime13.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_runtime13.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_runtime15 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_runtime15.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_runtime15.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetProps, ChatPreviewLoadingWidgetWithBaseWidget };
|
|
@@ -3,8 +3,10 @@ import { PromptCarouselWidget } from "../PromptCarouselWidget/PromptCarouselWidg
|
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
5
5
|
import { useAtomValue } from "jotai";
|
|
6
|
-
import {
|
|
6
|
+
import { useFeatureFlagService } from "@envive-ai/react-hooks/contexts/featureFlagServiceContext";
|
|
7
|
+
import { FeatureGates } from "@envive-ai/react-hooks/application/models";
|
|
7
8
|
import { chatPreviewLoadingDataAtom } from "@envive-ai/react-hooks/atoms/widget";
|
|
9
|
+
import { ChatPreviewLoading } from "@envive-ai/react-toolkit-v3/ChatPreviewLoading";
|
|
8
10
|
|
|
9
11
|
//#region src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.tsx
|
|
10
12
|
const ChatPreviewLoadingWidgetHandler = (props) => {
|
|
@@ -12,21 +14,27 @@ const ChatPreviewLoadingWidgetHandler = (props) => {
|
|
|
12
14
|
const chatPreviewLoadingWidgetConfig = widgetConfig;
|
|
13
15
|
const id = widgetConfig?.contentId;
|
|
14
16
|
const chatPreviewLoadingData = useAtomValue(chatPreviewLoadingDataAtom)[widgetConfigId] ?? void 0;
|
|
17
|
+
const { featureFlagService } = useFeatureFlagService();
|
|
15
18
|
const isCacheEmpty = !chatPreviewLoadingData || Object.values(chatPreviewLoadingData).every((value) => value === void 0) || Object.keys(chatPreviewLoadingData).length === 0;
|
|
16
19
|
if (isLoading && isCacheEmpty) return /* @__PURE__ */ jsx(ChatPreviewLoading, { fullIsLoading: true });
|
|
17
20
|
const titleLabel = hardcopyContent?.values?.titleLabel ?? chatPreviewLoadingData?.titleLabel;
|
|
18
21
|
const textFieldPlaceholder = hardcopyContent?.values?.textFieldPlaceholderText ?? chatPreviewLoadingData?.textFieldPlaceholder;
|
|
19
22
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo ?? chatPreviewLoadingData?.hideLogo;
|
|
20
23
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc ?? chatPreviewLoadingData?.logoSrc;
|
|
24
|
+
const variant = chatPreviewLoadingWidgetConfig?.variant ?? chatPreviewLoadingData?.variant;
|
|
25
|
+
const hexCardColor = chatPreviewLoadingWidgetConfig?.hexCardColor ?? chatPreviewLoadingData?.hexCardColor;
|
|
26
|
+
const hideTextField = chatPreviewLoadingWidgetConfig?.hideTextField ?? chatPreviewLoadingData?.hideTextField;
|
|
27
|
+
const voiceInputEnabled = uiConfig?.lookAndFeel?.voiceInputEnabled;
|
|
21
28
|
return /* @__PURE__ */ jsx(ChatPreviewLoading, {
|
|
22
29
|
id,
|
|
23
|
-
variant
|
|
24
|
-
hexCardColor
|
|
25
|
-
hideTextField
|
|
30
|
+
variant,
|
|
31
|
+
hexCardColor,
|
|
32
|
+
hideTextField,
|
|
26
33
|
textFieldPlaceholder,
|
|
27
34
|
hideLogo,
|
|
28
35
|
logoSrc,
|
|
29
|
-
titleLabel
|
|
36
|
+
titleLabel,
|
|
37
|
+
voiceInputEnabled: featureFlagService?.isFeatureGateEnabled(FeatureGates.IsVoiceInputEnabled) || voiceInputEnabled
|
|
30
38
|
});
|
|
31
39
|
};
|
|
32
40
|
const ChatPreviewLoadingWidgetWithBaseWidget = withBaseWidget(ChatPreviewLoadingWidgetHandler);
|
|
@@ -5,16 +5,17 @@ const require_ChatPreviewLoadingWidget = require('../ChatPreviewLoadingWidget/Ch
|
|
|
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_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
9
|
-
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
10
8
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
11
|
-
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
12
9
|
let jotai = require("jotai");
|
|
10
|
+
let __envive_ai_react_hooks_contexts_featureFlagServiceContext = require("@envive-ai/react-hooks/contexts/featureFlagServiceContext");
|
|
13
11
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
14
|
-
let
|
|
12
|
+
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
13
|
+
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
15
14
|
let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
|
|
16
15
|
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
17
16
|
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
17
|
+
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
18
|
+
let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
|
|
18
19
|
let __envive_ai_react_toolkit_v3_ChatPreview = require("@envive-ai/react-toolkit-v3/ChatPreview");
|
|
19
20
|
|
|
20
21
|
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx
|
|
@@ -38,6 +39,9 @@ const ChatPreviewWidgetHandler = (props) => {
|
|
|
38
39
|
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
40
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
40
41
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
42
|
+
const voiceInputEnabled = uiConfig?.lookAndFeel?.voiceInputEnabled;
|
|
43
|
+
const { featureFlagService } = (0, __envive_ai_react_hooks_contexts_featureFlagServiceContext.useFeatureFlagService)();
|
|
44
|
+
const isVoiceInputEnabled = featureFlagService?.isFeatureGateEnabled(__envive_ai_react_hooks_application_models.FeatureGates.IsVoiceInputEnabled) || voiceInputEnabled;
|
|
41
45
|
const handlePromptButtonClick = (0, react.useCallback)((suggestion) => {
|
|
42
46
|
onSuggestionClicked(suggestion, __envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.CHAT_PREVIEW_PROMPT_BUTTON);
|
|
43
47
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.CHAT_PREVIEW_PROMPT_BUTTON);
|
|
@@ -53,6 +57,25 @@ const ChatPreviewWidgetHandler = (props) => {
|
|
|
53
57
|
}
|
|
54
58
|
});
|
|
55
59
|
}, [openChat]);
|
|
60
|
+
const handleTranscriptionStarted = (0, react.useCallback)(() => {
|
|
61
|
+
trackWidgetInteraction({
|
|
62
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
63
|
+
trigger: {
|
|
64
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.CHAT_PREVIEW,
|
|
65
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.VOICE_TRANSCRIPTION_STARTED
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}, []);
|
|
69
|
+
const handleTranscriptionCompleted = (0, react.useCallback)((transcript) => {
|
|
70
|
+
trackWidgetInteraction({
|
|
71
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
72
|
+
trigger: {
|
|
73
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.CHAT_PREVIEW,
|
|
74
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.VOICE_TRANSCRIPTION_COMPLETED,
|
|
75
|
+
widget_interaction_data: { transcription: transcript }
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}, []);
|
|
56
79
|
const handleLinkClick = (url) => {
|
|
57
80
|
trackWidgetInteraction({
|
|
58
81
|
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
@@ -79,7 +102,8 @@ const ChatPreviewWidgetHandler = (props) => {
|
|
|
79
102
|
messageText: hardCopyContent?.messageText,
|
|
80
103
|
promptButtons: hardCopyContent?.promptButtons,
|
|
81
104
|
textFieldPlaceholderText: hardCopyContent?.textFieldPlaceholderText,
|
|
82
|
-
logoSrc: logoSrc ?? void 0
|
|
105
|
+
logoSrc: logoSrc ?? void 0,
|
|
106
|
+
voiceInputEnabled: isVoiceInputEnabled
|
|
83
107
|
};
|
|
84
108
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_ChatPreview.ChatPreview, {
|
|
85
109
|
baseProps: { id },
|
|
@@ -94,7 +118,9 @@ const ChatPreviewWidgetHandler = (props) => {
|
|
|
94
118
|
handlePromptButtonTouchStart: onTouchStart,
|
|
95
119
|
handlePromptButtonTouchEnd: onTouchEnd,
|
|
96
120
|
handleLinkClick,
|
|
97
|
-
handleTextFieldClick
|
|
121
|
+
handleTextFieldClick,
|
|
122
|
+
onTranscriptionStarted: handleTranscriptionStarted,
|
|
123
|
+
onTranscriptionCompleted: handleTranscriptionCompleted
|
|
98
124
|
}
|
|
99
125
|
});
|
|
100
126
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime10 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_runtime10.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_runtime10.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_runtime12 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_runtime12.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_runtime12.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|