@envive-ai/react-toolkit-v3 0.3.42 → 0.3.44
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/AnimatedText/AnimatedText.d.cts +3 -3
- package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.cts +2 -2
- package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.ts +2 -2
- package/dist/Carousel/Carousel.d.cts +2 -2
- package/dist/Carousel/Carousel.d.ts +2 -2
- package/dist/Carousel/components/Container.cjs +1 -1
- package/dist/Carousel/components/Container.js +1 -1
- package/dist/Carousel/components/Item.cjs +4 -1
- package/dist/Carousel/components/Item.js +4 -1
- package/dist/ChatFooter/ChatFooter.d.cts +2 -2
- package/dist/ChatFooter/components/index.d.cts +5 -5
- package/dist/ChatHeader/ChatHeader.d.cts +2 -2
- package/dist/ChatHeader/ChatHeader.d.ts +2 -2
- package/dist/ChatPreview/ChatPreview.d.cts +2 -2
- package/dist/ChatPreview/ChatPreview.d.ts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.cts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.ts +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.cts +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.ts +2 -2
- package/dist/Container/Container.d.cts +223 -223
- package/dist/Container/Container.d.ts +56 -56
- package/dist/DesignTokens/DesignTokensComponent.d.cts +2 -2
- package/dist/DesignTokens/DesignTokensComponent.d.ts +2 -2
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.cts +2 -2
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.ts +2 -2
- package/dist/FloatingButton/FloatingButton.d.cts +2 -2
- package/dist/FloatingButton/FloatingButton.d.ts +2 -2
- package/dist/FloatingChat/FloatingChat.d.cts +2 -2
- package/dist/FloatingChat/FloatingChat.d.ts +2 -2
- package/dist/FullPageSalesAgent/FullPageSalesAgent.cjs +25 -5
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.cts +5 -3
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.ts +5 -3
- package/dist/FullPageSalesAgent/FullPageSalesAgent.js +26 -6
- package/dist/FullPageSalesAgent/components/Layout.cjs +15 -7
- package/dist/FullPageSalesAgent/components/Layout.js +15 -7
- package/dist/Image/Image.d.cts +2 -2
- package/dist/ImageGallery/ImageGallery.d.cts +2 -2
- package/dist/ImageGallery/ImageGallery.d.ts +2 -2
- package/dist/MarkdownProcessor/MarkdownProcessor.d.cts +2 -2
- package/dist/MarkdownProcessor/MarkdownProcessor.d.ts +2 -2
- package/dist/ProductCard/ProductCard.d.cts +2 -2
- package/dist/ProductCard/ProductCard.d.ts +2 -2
- package/dist/PromptButton/PromptButton.d.cts +2 -2
- package/dist/PromptButton/PromptButton.d.ts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.cts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.ts +2 -2
- package/dist/PromptCarousel/PromptCarousel.d.cts +2 -2
- package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
- package/dist/ReviewCard/ReviewCard.d.cts +2 -2
- package/dist/ReviewCard/ReviewCard.d.ts +2 -2
- package/dist/ReviewCard/components/index.d.cts +6 -6
- package/dist/ReviewCard/components/index.d.ts +6 -6
- package/dist/SalesAgentProductCard/SalesAgentProductCard.d.cts +2 -2
- package/dist/SalesAgentProductCard/SalesAgentProductCard.d.ts +2 -2
- package/dist/SalesAgentProductCard/components/Container.cjs +14 -10
- package/dist/SalesAgentProductCard/components/Container.js +14 -10
- package/dist/SalesAgentProductCard/components/index.d.cts +8 -8
- package/dist/SalesAgentProductCard/components/index.d.ts +8 -8
- package/dist/SalesAgentProductCard/hooks/useGetContainerProperties.cjs +3 -0
- package/dist/SalesAgentProductCard/hooks/useGetContainerProperties.js +3 -0
- package/dist/SalesAgentProductCard/hooks/useGetProductDescriptionProperties.cjs +3 -3
- package/dist/SalesAgentProductCard/hooks/useGetProductDescriptionProperties.js +3 -3
- package/dist/SocialProof/SocialProof.d.cts +2 -2
- package/dist/SocialProof/SocialProof.d.ts +2 -2
- package/dist/SparkleAnimation/SparkleAnimation.d.cts +2 -2
- package/dist/Stack/Stack.d.cts +2 -2
- package/dist/Stack/Stack.d.ts +2 -2
- package/dist/TitledPromptCarousel/TitledPromptCarousel.d.cts +2 -2
- package/dist/TitledPromptCarousel/TitledPromptCarousel.d.ts +2 -2
- package/dist/TypingAnimation/TypingAnimation.d.cts +2 -2
- package/dist/TypingAnimation/TypingAnimation.d.ts +2 -2
- package/dist/Typography/Typography.d.ts +4 -4
- package/dist/WidgetTextField/WidgetTextField.d.cts +2 -2
- package/dist/WidgetTextField/WidgetTextField.d.ts +2 -2
- package/dist/WidgetWrapper/WidgetWrapper.d.cts +2 -2
- package/dist/WidgetWrapper/WidgetWrapper.d.ts +2 -2
- package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.cts +2 -2
- package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/Carousel/components/Container.tsx +1 -1
- package/src/components/Carousel/components/Item.tsx +1 -1
- package/src/components/FullPageSalesAgent/FullPageSalesAgent.tsx +49 -5
- package/src/components/FullPageSalesAgent/components/Layout.tsx +7 -0
- package/src/components/SalesAgentProductCard/components/Container.tsx +15 -5
- package/src/components/SalesAgentProductCard/hooks/useGetContainerProperties.ts +11 -1
- package/src/components/SalesAgentProductCard/hooks/useGetProductDescriptionProperties.ts +8 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/SparkleAnimation/SparkleAnimation.d.ts
|
|
4
4
|
interface SparkleAnimationProps {
|
|
@@ -10,6 +10,6 @@ declare const SparkleAnimation: ({
|
|
|
10
10
|
color,
|
|
11
11
|
className,
|
|
12
12
|
animate
|
|
13
|
-
}: SparkleAnimationProps) =>
|
|
13
|
+
}: SparkleAnimationProps) => react_jsx_runtime0.JSX.Element;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { SparkleAnimation };
|
package/dist/Stack/Stack.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { StackProps } from "./types/index.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react184 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Stack/Stack.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Stack component for laying out children in a flexible container with gap.
|
|
7
7
|
*/
|
|
8
|
-
declare const Stack:
|
|
8
|
+
declare const Stack: react184.ForwardRefExoticComponent<StackProps & react184.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { Stack };
|
package/dist/Stack/Stack.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { StackProps } from "./types/index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react2 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Stack/Stack.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Stack component for laying out children in a flexible container with gap.
|
|
7
7
|
*/
|
|
8
|
-
declare const Stack:
|
|
8
|
+
declare const Stack: react2.ForwardRefExoticComponent<StackProps & react2.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { Stack };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TitledPromptCarouselProps } from "./types/index.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/TitledPromptCarousel/TitledPromptCarousel.d.ts
|
|
5
5
|
declare const TitledPromptCarousel: ({
|
|
@@ -21,6 +21,6 @@ declare const TitledPromptCarousel: ({
|
|
|
21
21
|
handleButtonTouchEnd,
|
|
22
22
|
promptButtonTexts,
|
|
23
23
|
promptCarouselAriaLabel
|
|
24
|
-
}: TitledPromptCarouselProps) =>
|
|
24
|
+
}: TitledPromptCarouselProps) => react_jsx_runtime0.JSX.Element;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { TitledPromptCarousel };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TitledPromptCarouselProps } from "./types/index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime16 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/TitledPromptCarousel/TitledPromptCarousel.d.ts
|
|
5
5
|
declare const TitledPromptCarousel: ({
|
|
@@ -21,6 +21,6 @@ declare const TitledPromptCarousel: ({
|
|
|
21
21
|
handleButtonTouchEnd,
|
|
22
22
|
promptButtonTexts,
|
|
23
23
|
promptCarouselAriaLabel
|
|
24
|
-
}: TitledPromptCarouselProps) =>
|
|
24
|
+
}: TitledPromptCarouselProps) => react_jsx_runtime16.JSX.Element;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { TitledPromptCarousel };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TypingAnimationProps } from "./types/index.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/TypingAnimation/TypingAnimation.d.ts
|
|
5
5
|
declare const TypingAnimation: ({
|
|
@@ -7,6 +7,6 @@ declare const TypingAnimation: ({
|
|
|
7
7
|
widgetContentProps,
|
|
8
8
|
widgetStyleProps,
|
|
9
9
|
widgetEventProps
|
|
10
|
-
}: TypingAnimationProps) =>
|
|
10
|
+
}: TypingAnimationProps) => react_jsx_runtime1.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { TypingAnimation };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TypingAnimationProps } from "./types/index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/TypingAnimation/TypingAnimation.d.ts
|
|
5
5
|
declare const TypingAnimation: ({
|
|
@@ -7,6 +7,6 @@ declare const TypingAnimation: ({
|
|
|
7
7
|
widgetContentProps,
|
|
8
8
|
widgetStyleProps,
|
|
9
9
|
widgetEventProps
|
|
10
|
-
}: TypingAnimationProps) =>
|
|
10
|
+
}: TypingAnimationProps) => react_jsx_runtime0.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { TypingAnimation };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TypographyProps } from "./types/index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react0 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Typography/Typography.d.ts
|
|
5
5
|
/**
|
|
@@ -18,13 +18,13 @@ declare const Typography: ({
|
|
|
18
18
|
noWrap,
|
|
19
19
|
as,
|
|
20
20
|
"aria-label": ariaLabel
|
|
21
|
-
}: TypographyProps) =>
|
|
21
|
+
}: TypographyProps) => react0.DetailedReactHTMLElement<{
|
|
22
22
|
'aria-label': string;
|
|
23
23
|
'aria-level'?: number;
|
|
24
|
-
role?:
|
|
24
|
+
role?: react0.AriaRole;
|
|
25
25
|
title?: string;
|
|
26
26
|
className: string;
|
|
27
|
-
style:
|
|
27
|
+
style: react0.CSSProperties;
|
|
28
28
|
id: string;
|
|
29
29
|
'data-testid': string;
|
|
30
30
|
}, HTMLElement>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WidgetTextFieldProps } from "./types/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/WidgetTextField/WidgetTextField.d.ts
|
|
5
5
|
declare const WidgetTextField: ({
|
|
@@ -20,6 +20,6 @@ declare const WidgetTextField: ({
|
|
|
20
20
|
onClick,
|
|
21
21
|
enableVoiceInput,
|
|
22
22
|
onTranscriptionStarted
|
|
23
|
-
}: WidgetTextFieldProps) =>
|
|
23
|
+
}: WidgetTextFieldProps) => react_jsx_runtime12.JSX.Element;
|
|
24
24
|
//#endregion
|
|
25
25
|
export { WidgetTextField };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WidgetTextFieldProps } from "./types/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/WidgetTextField/WidgetTextField.d.ts
|
|
5
5
|
declare const WidgetTextField: ({
|
|
@@ -20,6 +20,6 @@ declare const WidgetTextField: ({
|
|
|
20
20
|
onClick,
|
|
21
21
|
enableVoiceInput,
|
|
22
22
|
onTranscriptionStarted
|
|
23
|
-
}: WidgetTextFieldProps) =>
|
|
23
|
+
}: WidgetTextFieldProps) => react_jsx_runtime1.JSX.Element;
|
|
24
24
|
//#endregion
|
|
25
25
|
export { WidgetTextField };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WidgetWrapperProps } from "./types/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/WidgetWrapper/WidgetWrapper.d.ts
|
|
5
5
|
|
|
@@ -16,6 +16,6 @@ declare const WidgetWrapper: ({
|
|
|
16
16
|
className,
|
|
17
17
|
style,
|
|
18
18
|
...containerProps
|
|
19
|
-
}: WidgetWrapperProps) =>
|
|
19
|
+
}: WidgetWrapperProps) => react_jsx_runtime8.JSX.Element;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { WidgetWrapper };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WidgetWrapperProps } from "./types/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/WidgetWrapper/WidgetWrapper.d.ts
|
|
5
5
|
|
|
@@ -16,6 +16,6 @@ declare const WidgetWrapper: ({
|
|
|
16
16
|
className,
|
|
17
17
|
style,
|
|
18
18
|
...containerProps
|
|
19
|
-
}: WidgetWrapperProps) =>
|
|
19
|
+
}: WidgetWrapperProps) => react_jsx_runtime8.JSX.Element;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { WidgetWrapper };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WidgetWrapperWithTitleProps } from "./types/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime10 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.ts
|
|
5
5
|
declare const WidgetWrapperWithTitle: ({
|
|
@@ -14,6 +14,6 @@ declare const WidgetWrapperWithTitle: ({
|
|
|
14
14
|
hexCardColor,
|
|
15
15
|
hideLogo,
|
|
16
16
|
fullIsLoading
|
|
17
|
-
}: WidgetWrapperWithTitleProps) =>
|
|
17
|
+
}: WidgetWrapperWithTitleProps) => react_jsx_runtime10.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { WidgetWrapperWithTitle };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WidgetWrapperWithTitleProps } from "./types/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime36 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.ts
|
|
5
5
|
declare const WidgetWrapperWithTitle: ({
|
|
@@ -14,6 +14,6 @@ declare const WidgetWrapperWithTitle: ({
|
|
|
14
14
|
hexCardColor,
|
|
15
15
|
hideLogo,
|
|
16
16
|
fullIsLoading
|
|
17
|
-
}: WidgetWrapperWithTitleProps) =>
|
|
17
|
+
}: WidgetWrapperWithTitleProps) => react_jsx_runtime36.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { WidgetWrapperWithTitle };
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ChatElementDisplayLocationV3 } from '@envive-ai/react-hooks/application/models';
|
|
2
2
|
import { listeningToSpeechAtom } from '@envive-ai/react-hooks/atoms/chat';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
EnviveMetricsEventName,
|
|
5
|
+
useAmplitude,
|
|
6
|
+
} from '@envive-ai/react-hooks/contexts/amplitudeContext';
|
|
4
7
|
import { HardcopyResponse } from '@envive-ai/react-hooks/contexts/hardcopyContext';
|
|
5
8
|
import { useSalesAgent } from '@envive-ai/react-hooks/contexts/salesAgentContext';
|
|
6
9
|
import {
|
|
@@ -46,6 +49,7 @@ export interface FullPageSalesAgentProps {
|
|
|
46
49
|
widgetConfig: FullPageSalesAgentWidgetV3Config;
|
|
47
50
|
hardcopyContent: HardcopyResponse;
|
|
48
51
|
voiceInputEnabled?: boolean;
|
|
52
|
+
debugBar?: React.ReactNode;
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
export const FullPageSalesAgent = ({
|
|
@@ -55,6 +59,7 @@ export const FullPageSalesAgent = ({
|
|
|
55
59
|
widgetConfig,
|
|
56
60
|
hardcopyContent,
|
|
57
61
|
voiceInputEnabled,
|
|
62
|
+
debugBar,
|
|
58
63
|
}: FullPageSalesAgentProps) => {
|
|
59
64
|
const resolvedTheme = resolveTheme(theme);
|
|
60
65
|
const salesAgentData = useSalesAgent(WidgetInteractionComponent.FULL_PAGE_SALES_AGENT);
|
|
@@ -63,10 +68,11 @@ export const FullPageSalesAgent = ({
|
|
|
63
68
|
const { messageClasses } = useGetMessagesStyles();
|
|
64
69
|
const { isMobile } = useIsMobile();
|
|
65
70
|
const { trackWidgetInteraction } = useWidgetInteraction();
|
|
71
|
+
const { trackEvent } = useAmplitude();
|
|
66
72
|
const { onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } =
|
|
67
73
|
usePromptCarouselAnalytics(WidgetInteractionComponent.FULL_PAGE_SALES_AGENT, text => text);
|
|
68
|
-
const
|
|
69
|
-
(text: string) => {
|
|
74
|
+
const getOverlayStringId = useCallback(
|
|
75
|
+
(text: string): string | undefined => {
|
|
70
76
|
const rawValues = hardcopyContent?.rawValues;
|
|
71
77
|
if (rawValues) {
|
|
72
78
|
for (const raw of Object.values(rawValues)) {
|
|
@@ -75,10 +81,14 @@ export const FullPageSalesAgent = ({
|
|
|
75
81
|
if (found) return found.id;
|
|
76
82
|
}
|
|
77
83
|
}
|
|
78
|
-
return
|
|
84
|
+
return undefined;
|
|
79
85
|
},
|
|
80
86
|
[hardcopyContent?.rawValues],
|
|
81
87
|
);
|
|
88
|
+
const getOverlaySuggestionId = useCallback(
|
|
89
|
+
(text: string) => getOverlayStringId(text) ?? text,
|
|
90
|
+
[getOverlayStringId],
|
|
91
|
+
);
|
|
82
92
|
const {
|
|
83
93
|
onDrag: onOverlayDrag,
|
|
84
94
|
onHover: onOverlayHover,
|
|
@@ -108,6 +118,7 @@ export const FullPageSalesAgent = ({
|
|
|
108
118
|
mobileBackgroundImage,
|
|
109
119
|
desktopBackgroundImage,
|
|
110
120
|
backgroundColor,
|
|
121
|
+
chatBackgroundColor,
|
|
111
122
|
} = widgetConfig;
|
|
112
123
|
|
|
113
124
|
const backgroundStyle = useMemo((): React.CSSProperties => {
|
|
@@ -135,6 +146,13 @@ export const FullPageSalesAgent = ({
|
|
|
135
146
|
isMobile,
|
|
136
147
|
]);
|
|
137
148
|
|
|
149
|
+
const chatBackgroundStyle = useMemo((): React.CSSProperties | undefined => {
|
|
150
|
+
if (chatBackgroundColor) {
|
|
151
|
+
return { backgroundColor: chatBackgroundColor };
|
|
152
|
+
}
|
|
153
|
+
return undefined;
|
|
154
|
+
}, [chatBackgroundColor]);
|
|
155
|
+
|
|
138
156
|
const { agentName } = lookAndFeelConfig;
|
|
139
157
|
|
|
140
158
|
const {
|
|
@@ -233,6 +251,16 @@ export const FullPageSalesAgent = ({
|
|
|
233
251
|
);
|
|
234
252
|
};
|
|
235
253
|
|
|
254
|
+
// Product cards in the default-view welcome overlay are the static suggestion/recommendations
|
|
255
|
+
// widget — tag them with a distinct widget so analytics separates them from in-chat product cards.
|
|
256
|
+
const handleSuggestionCardClick = (product: SalesAgentProductCardProps) => {
|
|
257
|
+
trackProductCardClicked(
|
|
258
|
+
trackWidgetInteraction,
|
|
259
|
+
WidgetInteractionComponent.FULL_PAGE_SALES_AGENT_RECOMMENDATIONS,
|
|
260
|
+
product,
|
|
261
|
+
);
|
|
262
|
+
};
|
|
263
|
+
|
|
236
264
|
const handleTranscriptionStarted = useCallback(() => {
|
|
237
265
|
trackWidgetInteraction({
|
|
238
266
|
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
@@ -282,6 +310,17 @@ export const FullPageSalesAgent = ({
|
|
|
282
310
|
},
|
|
283
311
|
},
|
|
284
312
|
});
|
|
313
|
+
// Also emit Widget Text Clicked so the AI-suggestions bandit attributes the
|
|
314
|
+
// click to the served chip (it joins on response_id + matches by text), the
|
|
315
|
+
// same contract PromptCarousel/SocialProof use.
|
|
316
|
+
trackEvent({
|
|
317
|
+
eventName: EnviveMetricsEventName.WidgetTextClicked,
|
|
318
|
+
eventProps: {
|
|
319
|
+
response_id: hardcopyContent?.responseId,
|
|
320
|
+
string_id: getOverlayStringId(buttonText),
|
|
321
|
+
text: buttonText,
|
|
322
|
+
},
|
|
323
|
+
});
|
|
285
324
|
onTypedMessageSubmitted({
|
|
286
325
|
query: buttonText,
|
|
287
326
|
userTyped: false,
|
|
@@ -294,7 +333,10 @@ export const FullPageSalesAgent = ({
|
|
|
294
333
|
},
|
|
295
334
|
[
|
|
296
335
|
getOverlaySuggestionId,
|
|
336
|
+
getOverlayStringId,
|
|
297
337
|
trackWidgetInteraction,
|
|
338
|
+
trackEvent,
|
|
339
|
+
hardcopyContent?.responseId,
|
|
298
340
|
onTypedMessageSubmitted,
|
|
299
341
|
setListeningToSpeech,
|
|
300
342
|
setAnswerSuggestions,
|
|
@@ -457,10 +499,12 @@ export const FullPageSalesAgent = ({
|
|
|
457
499
|
<FloatingChatComponents.ScrollToBottomButton onClick={handleScrollToBottom} />
|
|
458
500
|
) : undefined
|
|
459
501
|
}
|
|
502
|
+
chatBackgroundStyle={chatBackgroundStyle}
|
|
460
503
|
disclaimer={isResultsView ? null : disclaimer}
|
|
461
504
|
headerContainer={headerContainer}
|
|
462
505
|
autoHeight={autoHeight}
|
|
463
506
|
scrollContainerRef={scrollContainerRef}
|
|
507
|
+
debugBar={debugBar}
|
|
464
508
|
overlay={
|
|
465
509
|
overlayEnabled && showOverlay ? (
|
|
466
510
|
<WelcomeOverlay
|
|
@@ -481,7 +525,7 @@ export const FullPageSalesAgent = ({
|
|
|
481
525
|
onSuggestionMouseUp={onOverlayMouseUp}
|
|
482
526
|
onSuggestionTouchStart={onOverlayTouchStart}
|
|
483
527
|
onSuggestionTouchEnd={onOverlayTouchEnd}
|
|
484
|
-
onProductCardClick={
|
|
528
|
+
onProductCardClick={handleSuggestionCardClick}
|
|
485
529
|
/>
|
|
486
530
|
) : null
|
|
487
531
|
}
|
|
@@ -23,6 +23,9 @@ export interface LayoutProps {
|
|
|
23
23
|
overlay?: React.ReactNode;
|
|
24
24
|
/** Background style applied to the container (background image or color). */
|
|
25
25
|
backgroundStyle?: React.CSSProperties;
|
|
26
|
+
/** Background style applied to the chat container (background image or color). */
|
|
27
|
+
chatBackgroundStyle?: React.CSSProperties;
|
|
28
|
+
debugBar?: React.ReactNode;
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
export const Layout = ({
|
|
@@ -38,6 +41,8 @@ export const Layout = ({
|
|
|
38
41
|
scrollContainerRef,
|
|
39
42
|
overlay,
|
|
40
43
|
backgroundStyle,
|
|
44
|
+
chatBackgroundStyle,
|
|
45
|
+
debugBar,
|
|
41
46
|
}: LayoutProps) => {
|
|
42
47
|
const hasWelcomeMessage = isValidElement(welcomeMessage);
|
|
43
48
|
const hasAnswerSuggestions = isValidElement(answerSuggestions);
|
|
@@ -72,6 +77,7 @@ export const Layout = ({
|
|
|
72
77
|
<Stack
|
|
73
78
|
direction="column"
|
|
74
79
|
gap="0"
|
|
80
|
+
style={{ ...chatBackgroundStyle }}
|
|
75
81
|
className={classNames(
|
|
76
82
|
(!hasWelcomeMessage || (hasWelcomeMessage && theme === Theme.STANDARD)) &&
|
|
77
83
|
!hasAnswerSuggestions &&
|
|
@@ -92,6 +98,7 @@ export const Layout = ({
|
|
|
92
98
|
</div>
|
|
93
99
|
)}
|
|
94
100
|
{footer}
|
|
101
|
+
{debugBar && <div className="envive-debug-bar">{debugBar}</div>}
|
|
95
102
|
</div>
|
|
96
103
|
</div>
|
|
97
104
|
);
|
|
@@ -37,8 +37,13 @@ export const Container = ({
|
|
|
37
37
|
target = '_self',
|
|
38
38
|
onClick,
|
|
39
39
|
}: ContainerProps) => {
|
|
40
|
-
const {
|
|
41
|
-
|
|
40
|
+
const {
|
|
41
|
+
baseClassName,
|
|
42
|
+
themeContainerClassNames,
|
|
43
|
+
containerDirection,
|
|
44
|
+
containerWidthClassName,
|
|
45
|
+
containerHeightClassName,
|
|
46
|
+
} = useGetContainerProperties({ theme, variant });
|
|
42
47
|
|
|
43
48
|
const {
|
|
44
49
|
themeProductDescriptionClassNames,
|
|
@@ -68,13 +73,18 @@ export const Container = ({
|
|
|
68
73
|
testId={testId}
|
|
69
74
|
component="a"
|
|
70
75
|
style={style}
|
|
71
|
-
className={className}
|
|
76
|
+
className={classNames(className, containerHeightClassName)}
|
|
72
77
|
{...(anchorProps as React.ComponentPropsWithoutRef<'a'>)}
|
|
73
78
|
>
|
|
74
79
|
<Stack
|
|
75
80
|
direction={containerDirection}
|
|
76
81
|
gap="0"
|
|
77
|
-
className={classNames(
|
|
82
|
+
className={classNames(
|
|
83
|
+
baseClassName,
|
|
84
|
+
themeContainerClassNames,
|
|
85
|
+
containerWidthClassName,
|
|
86
|
+
containerHeightClassName,
|
|
87
|
+
)}
|
|
78
88
|
>
|
|
79
89
|
{image}
|
|
80
90
|
<Stack
|
|
@@ -83,7 +93,7 @@ export const Container = ({
|
|
|
83
93
|
className={classNames(themeProductDescriptionClassNames, smallVariantClassName)}
|
|
84
94
|
justify={productDescriptionJustify}
|
|
85
95
|
>
|
|
86
|
-
{productName}
|
|
96
|
+
<div className="envive-tw-flex-1">{productName}</div>
|
|
87
97
|
<Stack
|
|
88
98
|
direction="row"
|
|
89
99
|
justify="between"
|
|
@@ -35,5 +35,15 @@ export const useGetContainerProperties = ({ theme, variant }: UseGetContainerPro
|
|
|
35
35
|
return containerWidthClassNameMap[variant] ?? '';
|
|
36
36
|
}, [variant]);
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
const containerHeightClassName = useMemo(() => {
|
|
39
|
+
return variant === SalesAgentProductCardVariant.LARGE ? 'envive-tw-h-full' : '';
|
|
40
|
+
}, [variant]);
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
themeContainerClassNames,
|
|
44
|
+
baseClassName,
|
|
45
|
+
containerDirection,
|
|
46
|
+
containerWidthClassName,
|
|
47
|
+
containerHeightClassName,
|
|
48
|
+
};
|
|
39
49
|
};
|
|
@@ -32,7 +32,11 @@ export const useGetProductDescriptionProperties = ({
|
|
|
32
32
|
},
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
return
|
|
35
|
+
return (
|
|
36
|
+
themeProductDescriptionClassNameMap[
|
|
37
|
+
theme as keyof typeof themeProductDescriptionClassNameMap
|
|
38
|
+
]?.[variant] ?? ''
|
|
39
|
+
);
|
|
36
40
|
}, [theme, variant]);
|
|
37
41
|
|
|
38
42
|
const productDescriptionGap = useMemo(() => {
|
|
@@ -40,12 +44,12 @@ export const useGetProductDescriptionProperties = ({
|
|
|
40
44
|
}, [variant]);
|
|
41
45
|
|
|
42
46
|
const productDescriptionJustify = useMemo(() => {
|
|
43
|
-
return (variant === SalesAgentProductCardVariant.LARGE ? '
|
|
47
|
+
return (variant === SalesAgentProductCardVariant.LARGE ? 'between' : 'center') as StackJustify;
|
|
44
48
|
}, [variant]);
|
|
45
49
|
|
|
46
50
|
const smallVariantClassName = useMemo(() => {
|
|
47
|
-
return
|
|
48
|
-
}, [
|
|
51
|
+
return 'envive-tw-flex-1';
|
|
52
|
+
}, []);
|
|
49
53
|
|
|
50
54
|
return {
|
|
51
55
|
themeProductDescriptionClassNames,
|