@envive-ai/react-toolkit-v3 0.3.26 → 0.3.28
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.ts +3 -3
- package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.cts +2 -2
- package/dist/Carousel/Carousel.cjs +1 -1
- package/dist/Carousel/Carousel.d.cts +2 -2
- package/dist/Carousel/Carousel.d.ts +2 -2
- package/dist/Carousel/Carousel.js +1 -1
- package/dist/Carousel/components/Container.cjs +2 -2
- package/dist/Carousel/components/Container.js +2 -2
- package/dist/ChatFooter/ChatFooter.cjs +3 -1
- package/dist/ChatFooter/ChatFooter.d.cts +2 -2
- package/dist/ChatFooter/ChatFooter.d.ts +2 -2
- package/dist/ChatFooter/ChatFooter.js +3 -1
- package/dist/ChatFooter/components/Layout.cjs +4 -4
- package/dist/ChatFooter/components/Layout.d.cts +1 -0
- package/dist/ChatFooter/components/Layout.d.ts +1 -0
- package/dist/ChatFooter/components/Layout.js +4 -4
- package/dist/ChatFooter/components/index.d.cts +5 -3
- package/dist/ChatFooter/components/index.d.ts +7 -5
- package/dist/ChatFooter/types/types.d.cts +3 -2
- package/dist/ChatFooter/types/types.d.ts +3 -2
- package/dist/ChatHeader/ChatHeader.d.cts +2 -2
- package/dist/ChatHeader/ChatHeader.d.ts +2 -2
- package/dist/ChatHeader/components/Handle.cjs +2 -2
- package/dist/ChatHeader/components/Handle.js +2 -2
- package/dist/ChatHeader/components/Toggle.cjs +3 -3
- package/dist/ChatHeader/components/Toggle.js +3 -3
- package/dist/ChatPreview/ChatPreview.cjs +1 -1
- package/dist/ChatPreview/ChatPreview.d.cts +2 -2
- package/dist/ChatPreview/ChatPreview.d.ts +2 -2
- package/dist/ChatPreview/ChatPreview.js +1 -1
- package/dist/ChatPreviewComparison/ChatPreviewComparison.cjs +1 -1
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.cts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.ts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.js +1 -1
- package/dist/ChatPreviewComparison/components/Headline.cjs +2 -2
- package/dist/ChatPreviewComparison/components/Headline.js +2 -2
- package/dist/ChatPreviewComparison/components/Layout.cjs +4 -4
- package/dist/ChatPreviewComparison/components/Layout.js +4 -4
- package/dist/ChatPreviewComparison/components/Message.cjs +2 -2
- package/dist/ChatPreviewComparison/components/Message.js +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.cts +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.ts +2 -2
- package/dist/Container/Container.d.cts +56 -56
- package/dist/Container/Container.d.ts +220 -220
- package/dist/DesignTokens/DesignTokensComponent.d.ts +2 -2
- package/dist/Disclaimer/components/Container.cjs +2 -2
- package/dist/Disclaimer/components/Container.js +2 -2
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.cts +2 -2
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.ts +2 -2
- package/dist/DocumentRetrievalCard/components/Layout.cjs +2 -2
- package/dist/DocumentRetrievalCard/components/Layout.js +2 -2
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.cjs +1 -1
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.js +1 -1
- 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/FloatingChat/components/ChatMessages.cjs +1 -1
- package/dist/FloatingChat/components/ChatMessages.js +1 -1
- package/dist/FloatingChat/components/Layout.cjs +3 -3
- package/dist/FloatingChat/components/Layout.js +3 -3
- package/dist/FloatingChat/components/ResultsGridView.cjs +1 -1
- package/dist/FloatingChat/components/ResultsGridView.js +1 -1
- package/dist/FloatingChat/components/SalesAgentBadgeContent.cjs +6 -2
- package/dist/FloatingChat/components/SalesAgentBadgeContent.js +6 -2
- package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.cjs +2 -1
- package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.js +2 -1
- package/dist/FullPageSalesAgent/FullPageSalesAgent.cjs +126 -27
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.cts +5 -7
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.ts +5 -7
- package/dist/FullPageSalesAgent/FullPageSalesAgent.js +127 -28
- package/dist/FullPageSalesAgent/components/Layout.cjs +34 -27
- package/dist/FullPageSalesAgent/components/Layout.js +34 -27
- package/dist/FullPageSalesAgent/components/WelcomeOverlay.cjs +109 -0
- package/dist/FullPageSalesAgent/components/WelcomeOverlay.js +107 -0
- package/dist/FullPageSalesAgent/components/index.cjs +1 -0
- package/dist/FullPageSalesAgent/components/index.js +1 -0
- package/dist/FullPageSalesAgent/hooks/useGetFooterStyles.cjs +16 -6
- package/dist/FullPageSalesAgent/hooks/useGetFooterStyles.js +16 -6
- package/dist/FullPageSalesAgent/hooks/useWelcomeOverlayProducts.cjs +44 -0
- package/dist/FullPageSalesAgent/hooks/useWelcomeOverlayProducts.js +42 -0
- package/dist/Image/Image.d.cts +2 -2
- package/dist/Image/Image.d.ts +2 -2
- package/dist/ImageGallery/ImageGallery.d.cts +2 -2
- package/dist/ImageGallery/ImageGallery.d.ts +2 -2
- package/dist/ImageGallery/components/Layout.cjs +1 -1
- package/dist/ImageGallery/components/Layout.js +1 -1
- package/dist/MarkdownProcessor/MarkdownProcessor.d.cts +2 -2
- package/dist/MarkdownProcessor/MarkdownProcessor.d.ts +2 -2
- package/dist/Message/components/LinkButton.cjs +1 -1
- package/dist/Message/components/LinkButton.js +1 -1
- package/dist/OrderLookupCard/OrderLookupCard.cjs +1 -1
- package/dist/OrderLookupCard/OrderLookupCard.js +1 -1
- package/dist/ProductCard/ProductCard.cjs +2 -2
- package/dist/ProductCard/ProductCard.d.cts +2 -2
- package/dist/ProductCard/ProductCard.d.ts +2 -2
- package/dist/ProductCard/ProductCard.js +2 -2
- package/dist/PromptButton/PromptButton.d.cts +2 -2
- package/dist/PromptButton/PromptButton.d.ts +2 -2
- package/dist/PromptButton/hooks/useGetLayoutBaseProperties.cjs +1 -1
- package/dist/PromptButton/hooks/useGetLayoutBaseProperties.js +1 -1
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.cts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.ts +2 -2
- package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.cjs +1 -1
- package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.js +1 -1
- package/dist/PromptCarousel/PromptCarousel.cjs +3 -3
- package/dist/PromptCarousel/PromptCarousel.d.cts +2 -2
- package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
- package/dist/PromptCarousel/PromptCarousel.js +3 -3
- package/dist/ReviewCard/ReviewCard.d.ts +2 -2
- package/dist/ReviewCard/components/Container.cjs +2 -2
- package/dist/ReviewCard/components/Container.js +2 -2
- package/dist/ReviewCard/components/ReadMoreButton.cjs +1 -1
- package/dist/ReviewCard/components/ReadMoreButton.js +1 -1
- package/dist/ReviewCard/components/index.d.cts +4 -4
- 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 +2 -2
- package/dist/SalesAgentProductCard/components/Container.js +2 -2
- package/dist/SalesAgentProductCard/components/Price.cjs +2 -2
- package/dist/SalesAgentProductCard/components/Price.js +2 -2
- package/dist/SalesAgentProductCard/components/Rate.cjs +1 -1
- package/dist/SalesAgentProductCard/components/Rate.js +1 -1
- package/dist/SalesAgentProductCard/components/index.d.cts +8 -8
- package/dist/SalesAgentProductCard/components/index.d.ts +8 -8
- package/dist/SocialProof/SocialProof.cjs +5 -4
- package/dist/SocialProof/SocialProof.d.cts +2 -2
- package/dist/SocialProof/SocialProof.d.ts +2 -2
- package/dist/SocialProof/SocialProof.js +5 -4
- package/dist/SocialProof/components/Headline.cjs +4 -4
- package/dist/SocialProof/components/Headline.js +4 -4
- package/dist/SocialProof/components/LayoutFourHorizontal.cjs +1 -1
- package/dist/SocialProof/components/LayoutFourHorizontal.js +1 -1
- package/dist/SocialProof/components/LayoutSingle.cjs +3 -4
- package/dist/SocialProof/components/LayoutSingle.js +3 -4
- package/dist/SocialProof/components/Subheadline.cjs +1 -1
- package/dist/SocialProof/components/Subheadline.js +1 -1
- package/dist/SocialProof/hooks/useSocialProofCount.cjs +3 -2
- package/dist/SocialProof/hooks/useSocialProofCount.d.cts +2 -0
- package/dist/SocialProof/hooks/useSocialProofCount.d.ts +2 -0
- package/dist/SocialProof/hooks/useSocialProofCount.js +3 -2
- package/dist/SocialProof/types/types.d.cts +5 -0
- package/dist/SocialProof/types/types.d.ts +5 -0
- package/dist/SparkleAnimation/SparkleAnimation.d.cts +2 -2
- package/dist/SparkleAnimation/SparkleAnimation.d.ts +2 -2
- package/dist/Stack/Stack.d.cts +2 -2
- package/dist/Stack/Stack.d.ts +2 -2
- package/dist/TextField/TextField.cjs +10 -3
- package/dist/TextField/TextField.d.cts +1 -0
- package/dist/TextField/TextField.d.ts +1 -0
- package/dist/TextField/TextField.js +10 -3
- package/dist/TextField/components/Input.cjs +31 -2
- package/dist/TextField/components/Input.js +31 -2
- package/dist/TextField/components/Layout.cjs +7 -2
- package/dist/TextField/components/Layout.js +7 -2
- package/dist/TextField/hooks/useAutoResize.cjs +17 -0
- package/dist/TextField/hooks/useAutoResize.js +16 -0
- package/dist/TextField/hooks/usePlaceholderAnimation.cjs +58 -0
- package/dist/TextField/hooks/usePlaceholderAnimation.js +57 -0
- package/dist/TextField/hooks/useVoiceInput.cjs +9 -1
- package/dist/TextField/hooks/useVoiceInput.js +9 -1
- package/dist/TextField/types/index.d.cts +19 -1
- package/dist/TextField/types/index.d.ts +19 -1
- package/dist/TitledPromptCarousel/TitledPromptCarousel.cjs +1 -1
- package/dist/TitledPromptCarousel/TitledPromptCarousel.d.cts +2 -2
- package/dist/TitledPromptCarousel/TitledPromptCarousel.d.ts +2 -2
- package/dist/TitledPromptCarousel/TitledPromptCarousel.js +1 -1
- package/dist/Tokens/index.cjs +1 -1
- package/dist/Tokens/index.js +1 -1
- package/dist/TypingAnimation/TypingAnimation.cjs +1 -1
- package/dist/TypingAnimation/TypingAnimation.d.cts +2 -2
- package/dist/TypingAnimation/TypingAnimation.d.ts +2 -2
- package/dist/TypingAnimation/TypingAnimation.js +1 -1
- package/dist/TypingAnimation/hooks/useGetTypographyVariant.cjs +1 -1
- package/dist/TypingAnimation/hooks/useGetTypographyVariant.js +1 -1
- package/dist/Typography/Typography.d.cts +4 -4
- package/dist/Typography/Typography.d.ts +4 -4
- package/dist/WelcomeMessage/components/Container.cjs +2 -2
- package/dist/WelcomeMessage/components/Container.js +2 -2
- package/dist/WidgetTextField/WidgetTextField.cjs +4 -4
- package/dist/WidgetTextField/WidgetTextField.d.cts +2 -2
- package/dist/WidgetTextField/WidgetTextField.d.ts +2 -2
- package/dist/WidgetTextField/WidgetTextField.js +1 -1
- package/dist/WidgetTextField/components/Container.cjs +2 -2
- package/dist/WidgetTextField/components/Container.js +2 -2
- package/dist/WidgetTextField/components/Icon.cjs +1 -1
- package/dist/WidgetTextField/components/Icon.js +1 -1
- 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/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/ChatFooter/ChatFooter.tsx +2 -0
- package/src/components/ChatFooter/components/Layout.tsx +3 -1
- package/src/components/ChatFooter/components/TextField.tsx +4 -1
- package/src/components/ChatFooter/types/types.ts +3 -2
- package/src/components/FloatingChat/components/SalesAgentBadgeContent.tsx +8 -0
- package/src/components/FloatingChat/components/SalesAgentProductCardsCarousel.tsx +3 -0
- package/src/components/FullPageSalesAgent/FullPageSalesAgent.tsx +207 -49
- package/src/components/FullPageSalesAgent/components/Layout.tsx +10 -3
- package/src/components/FullPageSalesAgent/components/WelcomeOverlay.tsx +143 -0
- package/src/components/FullPageSalesAgent/components/index.ts +2 -0
- package/src/components/FullPageSalesAgent/hooks/useGetFooterStyles.ts +15 -5
- package/src/components/FullPageSalesAgent/hooks/useWelcomeOverlayProducts.ts +52 -0
- package/src/components/PromptButton/hooks/useGetLayoutBaseProperties.ts +3 -1
- package/src/components/SalesAgentProductCard/components/Price.tsx +2 -2
- package/src/components/SalesAgentProductCard/components/Rate.tsx +1 -1
- package/src/components/SocialProof/SocialProof.tsx +4 -2
- package/src/components/SocialProof/components/Headline.tsx +1 -1
- package/src/components/SocialProof/components/LayoutSingle.tsx +6 -5
- package/src/components/SocialProof/hooks/useSocialProofCount.ts +8 -1
- package/src/components/SocialProof/types/types.ts +6 -0
- package/src/components/TextField/TextField.tsx +17 -3
- package/src/components/TextField/__tests__/VoiceInputButton.test.tsx +22 -58
- package/src/components/TextField/components/Input.tsx +43 -9
- package/src/components/TextField/components/Layout.tsx +7 -1
- package/src/components/TextField/hooks/useAutoResize.ts +14 -0
- package/src/components/TextField/hooks/usePlaceholderAnimation.ts +67 -0
- package/src/components/TextField/hooks/useTextFieldSubmit.ts +1 -1
- package/src/components/TextField/hooks/useVoiceInput.ts +8 -0
- package/src/components/TextField/types/index.ts +19 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Theme } from "../packages/components-v3/tokens/theme/theme.js";
|
|
2
|
-
import { resolveTheme } from "../utils/resolveTheme.js";
|
|
3
2
|
import "../Tokens/index.js";
|
|
3
|
+
import { resolveTheme } from "../utils/resolveTheme.js";
|
|
4
4
|
import { useSetAtom } from "../node_modules/jotai/esm/react.js";
|
|
5
5
|
import { usePromptCarouselAnalytics } from "../PromptCarousel/hooks/usePromptCarouselAnalytics.js";
|
|
6
6
|
import { PromptButtonVariant } from "../PromptButton/types/index.js";
|
|
@@ -12,44 +12,75 @@ import { ChatFooter } from "../ChatFooter/ChatFooter.js";
|
|
|
12
12
|
import "../ChatFooter/index.js";
|
|
13
13
|
import { Disclaimer } from "../Disclaimer/Disclaimer.js";
|
|
14
14
|
import "../Disclaimer/index.js";
|
|
15
|
-
import { WelcomeMessage } from "../WelcomeMessage/WelcomeMessage.js";
|
|
16
15
|
import { useChatSuggestions } from "../FloatingChat/hooks/useChatSuggestions.js";
|
|
17
16
|
import { useProductResultsView } from "../FloatingChat/hooks/useProductResultsView.js";
|
|
18
17
|
import { useScrollToBottom } from "../FloatingChat/hooks/useScrollToBottom.js";
|
|
19
18
|
import { NUM_COLUMNS_FPSA, NUM_COLUMNS_MOBILE } from "../FloatingChat/components/ResultsGridView.js";
|
|
20
19
|
import { trackProductCardClicked } from "../FloatingChat/utils/trackProductCardInteraction.js";
|
|
21
20
|
import { FloatingChatComponents } from "../FloatingChat/components/index.js";
|
|
22
|
-
import "../WelcomeMessage/index.js";
|
|
23
21
|
import { useIsMobile } from "./hooks/useIsMobile.js";
|
|
24
22
|
import { useGetFooterStyles } from "./hooks/useGetFooterStyles.js";
|
|
25
|
-
import {
|
|
23
|
+
import { WelcomeOverlay } from "./components/WelcomeOverlay.js";
|
|
26
24
|
import { FullPageSAComponents } from "./components/index.js";
|
|
27
25
|
import { useGetMessagesStyles } from "./hooks/useGetMessagesStyles.js";
|
|
28
|
-
import { useCallback, useRef, useState } from "react";
|
|
26
|
+
import { useCallback, useMemo, useRef, useState } from "react";
|
|
29
27
|
import { jsx } from "react/jsx-runtime";
|
|
30
28
|
import { listeningToSpeechAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
31
29
|
import { EnviveMetricsEventName } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
32
30
|
import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
|
|
33
31
|
import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
32
|
+
import { LayoutGroup, motion } from "framer-motion";
|
|
34
33
|
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
35
34
|
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
36
35
|
|
|
37
36
|
//#region src/components/FullPageSalesAgent/FullPageSalesAgent.tsx
|
|
38
|
-
const FullPageSalesAgent = ({ theme = Theme.GLOBAL_CUSTOM, floatingChatConfig, lookAndFeelConfig,
|
|
37
|
+
const FullPageSalesAgent = ({ theme = Theme.GLOBAL_CUSTOM, floatingChatConfig, lookAndFeelConfig, widgetConfig, hardcopyContent, voiceInputEnabled }) => {
|
|
39
38
|
const resolvedTheme = resolveTheme(theme);
|
|
40
39
|
const salesAgentData = useSalesAgent(WidgetInteractionComponent.FULL_PAGE_SALES_AGENT);
|
|
41
40
|
const [query, setQuery] = useState("");
|
|
42
41
|
const chatMessagesRef = useRef(null);
|
|
43
|
-
const { footerStyles, footerClasses } = useGetFooterStyles();
|
|
44
42
|
const { messageClasses } = useGetMessagesStyles();
|
|
45
|
-
const { messageContainerClasses } = useGetScrollContentStyles();
|
|
46
43
|
const { isMobile } = useIsMobile();
|
|
47
44
|
const { trackWidgetInteraction } = useWidgetInteraction();
|
|
48
45
|
const { onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = usePromptCarouselAnalytics(WidgetInteractionComponent.FULL_PAGE_SALES_AGENT, (text) => text);
|
|
46
|
+
const getOverlaySuggestionId = useCallback((text) => {
|
|
47
|
+
const rawValues = hardcopyContent?.rawValues;
|
|
48
|
+
if (rawValues) for (const raw of Object.values(rawValues)) {
|
|
49
|
+
const found = (Array.isArray(raw) ? raw : [raw]).find((s) => s.value === text);
|
|
50
|
+
if (found) return found.id;
|
|
51
|
+
}
|
|
52
|
+
return text;
|
|
53
|
+
}, [hardcopyContent?.rawValues]);
|
|
54
|
+
const { onDrag: onOverlayDrag, onHover: onOverlayHover, onMouseDown: onOverlayMouseDown, onMouseUp: onOverlayMouseUp, onTouchStart: onOverlayTouchStart, onTouchEnd: onOverlayTouchEnd } = usePromptCarouselAnalytics(WidgetInteractionComponent.FULL_PAGE_SALES_AGENT, getOverlaySuggestionId);
|
|
49
55
|
const setListeningToSpeech = useSetAtom(listeningToSpeechAtom);
|
|
50
|
-
const {
|
|
56
|
+
const { ignoreFirstModelResponse, neverShowSingleProductCards, showVerifiedBuyer, showEnviveLogo } = floatingChatConfig;
|
|
57
|
+
const { headerContainer, autoHeight, sparkleColor = "var(--envive-colors-accent-primary)", suggestionButtonType = PromptButtonVariant.LIGHT, useBackgroundImage, mobileBackgroundImage, desktopBackgroundImage, backgroundColor } = widgetConfig;
|
|
58
|
+
const backgroundStyle = useMemo(() => {
|
|
59
|
+
if (useBackgroundImage) {
|
|
60
|
+
const imageUrl = isMobile ? mobileBackgroundImage ?? desktopBackgroundImage : desktopBackgroundImage ?? mobileBackgroundImage;
|
|
61
|
+
if (imageUrl) return {
|
|
62
|
+
backgroundImage: `url(${imageUrl})`,
|
|
63
|
+
backgroundSize: "cover",
|
|
64
|
+
backgroundPosition: "center"
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
if (backgroundColor) return { backgroundColor };
|
|
68
|
+
return { backgroundColor: "white" };
|
|
69
|
+
}, [
|
|
70
|
+
useBackgroundImage,
|
|
71
|
+
mobileBackgroundImage,
|
|
72
|
+
desktopBackgroundImage,
|
|
73
|
+
backgroundColor,
|
|
74
|
+
isMobile
|
|
75
|
+
]);
|
|
51
76
|
const { agentName } = lookAndFeelConfig;
|
|
52
|
-
const {
|
|
77
|
+
const { chatFooterTextFieldPlaceholderText, disclaimerText, welcomeOverlayTitle, welcomeOverlayAnimatedPlaceholder, welcomeOverlayPromptSuggestions, welcomeOverlayProductCarouselTitle, welcomeOverlayProductIds } = hardcopyContent?.values ?? {};
|
|
78
|
+
const overlayTitle = Array.isArray(welcomeOverlayTitle) && welcomeOverlayTitle.length > 0 ? welcomeOverlayTitle[0] : welcomeOverlayTitle;
|
|
79
|
+
const overlayEnabled = typeof overlayTitle === "string" && !!welcomeOverlayTitle;
|
|
80
|
+
const [showOverlay, setShowOverlay] = useState(overlayEnabled);
|
|
81
|
+
const { footerStyles, footerClasses } = useGetFooterStyles({ showOverlay });
|
|
82
|
+
const overlayPromptSuggestions = Array.isArray(welcomeOverlayPromptSuggestions) ? welcomeOverlayPromptSuggestions : [];
|
|
83
|
+
const overlayProductIds = Array.isArray(welcomeOverlayProductIds) ? welcomeOverlayProductIds : [];
|
|
53
84
|
const { messages, isResponseStreaming, isPendingResponse, suggestions, onSuggestionClicked, onTypedMessageSubmitted, onFormResponseSubmitted } = salesAgentData;
|
|
54
85
|
const { answerSuggestions, generalSuggestions, showAnswerSuggestions, setAnswerSuggestions, setGeneralSuggestions } = useChatSuggestions({
|
|
55
86
|
suggestions,
|
|
@@ -110,26 +141,62 @@ const FullPageSalesAgent = ({ theme = Theme.GLOBAL_CUSTOM, floatingChatConfig, l
|
|
|
110
141
|
}
|
|
111
142
|
});
|
|
112
143
|
}, [trackWidgetInteraction]);
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
})
|
|
121
|
-
|
|
144
|
+
const handleOverlayDismiss = useCallback(() => {
|
|
145
|
+
trackWidgetInteraction({
|
|
146
|
+
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
147
|
+
trigger: {
|
|
148
|
+
widget: WidgetInteractionComponent.FULL_PAGE_SALES_AGENT,
|
|
149
|
+
widget_interaction: WidgetInteractionType.OVERLAY_DISMISSED
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
setShowOverlay(false);
|
|
153
|
+
}, [trackWidgetInteraction]);
|
|
154
|
+
const handleOverlaySuggestionClick = useCallback((buttonText) => {
|
|
155
|
+
trackWidgetInteraction({
|
|
156
|
+
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
157
|
+
trigger: {
|
|
158
|
+
widget: WidgetInteractionComponent.FULL_PAGE_SALES_AGENT,
|
|
159
|
+
widget_interaction: WidgetInteractionType.SUGGESTION_CLICKED,
|
|
160
|
+
widget_interaction_data: { suggestion_clicked: { suggestion_id: getOverlaySuggestionId(buttonText) } }
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
onTypedMessageSubmitted({
|
|
164
|
+
query: buttonText,
|
|
165
|
+
userTyped: true,
|
|
166
|
+
displayLocation: ChatElementDisplayLocationV3.FLOATING_CHAT_TEXT_INPUT
|
|
167
|
+
});
|
|
168
|
+
setListeningToSpeech("abort");
|
|
169
|
+
setAnswerSuggestions([]);
|
|
170
|
+
setGeneralSuggestions([]);
|
|
171
|
+
setShowOverlay(false);
|
|
172
|
+
}, [
|
|
173
|
+
getOverlaySuggestionId,
|
|
174
|
+
trackWidgetInteraction,
|
|
175
|
+
onTypedMessageSubmitted,
|
|
176
|
+
setListeningToSpeech,
|
|
177
|
+
setAnswerSuggestions,
|
|
178
|
+
setGeneralSuggestions
|
|
179
|
+
]);
|
|
180
|
+
const promptSuggestions = useMemo(() => {
|
|
181
|
+
if (showOverlay) return [];
|
|
182
|
+
if (isPendingResponse || isResponseStreaming) return ["Loading suggestions 1...", "Loading suggestions 2..."];
|
|
183
|
+
return generalSuggestions;
|
|
184
|
+
}, [
|
|
185
|
+
showOverlay,
|
|
186
|
+
isPendingResponse,
|
|
187
|
+
isResponseStreaming,
|
|
188
|
+
generalSuggestions
|
|
189
|
+
]);
|
|
122
190
|
const footer = /* @__PURE__ */ jsx(ChatFooter, {
|
|
123
191
|
className: footerClasses,
|
|
124
192
|
style: footerStyles,
|
|
125
193
|
theme: resolvedTheme,
|
|
126
194
|
isScrolled: isMobile ? isFloatingLayout : false,
|
|
127
195
|
disabled: isPendingResponse || isResponseStreaming,
|
|
128
|
-
disabledInput: !userQueryInputEnabled,
|
|
129
196
|
isLoadingPromptSuggestions: isPendingResponse || isResponseStreaming || generalSuggestions.length === 0,
|
|
130
|
-
hideEnviveWatermark: !showEnviveLogo,
|
|
131
|
-
textFieldPlaceholderText: chatFooterTextFieldPlaceholderText,
|
|
132
|
-
promptSuggestions
|
|
197
|
+
hideEnviveWatermark: showOverlay || !showEnviveLogo,
|
|
198
|
+
textFieldPlaceholderText: showOverlay ? welcomeOverlayAnimatedPlaceholder : chatFooterTextFieldPlaceholderText,
|
|
199
|
+
promptSuggestions,
|
|
133
200
|
handleButtonClick: (buttonText) => {
|
|
134
201
|
const suggestion = suggestions.find((s) => s.content === buttonText && !s.isAnswer);
|
|
135
202
|
if (suggestion) onSuggestionClicked(suggestion, ChatElementDisplayLocationV3.FLOATING_CHAT_PROMPT_BUTTON);
|
|
@@ -137,6 +204,7 @@ const FullPageSalesAgent = ({ theme = Theme.GLOBAL_CUSTOM, floatingChatConfig, l
|
|
|
137
204
|
setAnswerSuggestions([]);
|
|
138
205
|
setGeneralSuggestions([]);
|
|
139
206
|
handleBackToChat();
|
|
207
|
+
handleOverlayDismiss();
|
|
140
208
|
},
|
|
141
209
|
onChange: setQuery,
|
|
142
210
|
onSubmit: () => {
|
|
@@ -148,6 +216,7 @@ const FullPageSalesAgent = ({ theme = Theme.GLOBAL_CUSTOM, floatingChatConfig, l
|
|
|
148
216
|
setAnswerSuggestions([]);
|
|
149
217
|
setGeneralSuggestions([]);
|
|
150
218
|
handleBackToChat();
|
|
219
|
+
handleOverlayDismiss();
|
|
151
220
|
},
|
|
152
221
|
onFocus: handleInputQueryFocus,
|
|
153
222
|
parentWidget: WidgetInteractionComponent.FULL_PAGE_SALES_AGENT,
|
|
@@ -204,18 +273,48 @@ const FullPageSalesAgent = ({ theme = Theme.GLOBAL_CUSTOM, floatingChatConfig, l
|
|
|
204
273
|
handleButtonTouchEnd: onTouchEnd
|
|
205
274
|
});
|
|
206
275
|
const disclaimer = disclaimerText && typeof disclaimerText === "string" ? /* @__PURE__ */ jsx(Disclaimer, { disclaimerMarkdown: disclaimerText }) : void 0;
|
|
207
|
-
|
|
276
|
+
const motionFooter = /* @__PURE__ */ jsx(motion.div, {
|
|
277
|
+
transition: {
|
|
278
|
+
layout: { duration: .2 },
|
|
279
|
+
default: { duration: 0 }
|
|
280
|
+
},
|
|
281
|
+
layoutId: "fpsa-chat-footer",
|
|
282
|
+
children: footer
|
|
283
|
+
});
|
|
284
|
+
const productCarouselTitle = Array.isArray(welcomeOverlayProductCarouselTitle) ? welcomeOverlayProductCarouselTitle[0] : welcomeOverlayProductCarouselTitle;
|
|
285
|
+
return /* @__PURE__ */ jsx(LayoutGroup, { children: /* @__PURE__ */ jsx(FullPageSAComponents.Layout, {
|
|
208
286
|
theme: resolvedTheme,
|
|
209
|
-
welcomeMessage:
|
|
210
|
-
footer,
|
|
287
|
+
welcomeMessage: null,
|
|
288
|
+
footer: !overlayEnabled || !showOverlay ? motionFooter : null,
|
|
211
289
|
chatMessages: middleContent,
|
|
212
290
|
answerSuggestions: showAnswerSuggestions && !isResultsView ? answerSuggestionsComponent : void 0,
|
|
213
291
|
scrollToBottomButton: !isResultsView && showScrollButton ? /* @__PURE__ */ jsx(FloatingChatComponents.ScrollToBottomButton, { onClick: handleScrollToBottom }) : void 0,
|
|
214
292
|
disclaimer: isResultsView ? null : disclaimer,
|
|
215
293
|
headerContainer,
|
|
216
294
|
autoHeight,
|
|
217
|
-
scrollContainerRef
|
|
218
|
-
|
|
295
|
+
scrollContainerRef,
|
|
296
|
+
backgroundStyle,
|
|
297
|
+
overlay: overlayEnabled ? /* @__PURE__ */ jsx(WelcomeOverlay, {
|
|
298
|
+
show: showOverlay,
|
|
299
|
+
theme: resolvedTheme,
|
|
300
|
+
suggestionButtonType,
|
|
301
|
+
sparkleColor,
|
|
302
|
+
title: overlayTitle,
|
|
303
|
+
promptSuggestions: overlayPromptSuggestions,
|
|
304
|
+
productCarouselTitle,
|
|
305
|
+
productIds: overlayProductIds,
|
|
306
|
+
backgroundStyle,
|
|
307
|
+
chatFooter: showOverlay ? motionFooter : null,
|
|
308
|
+
onSuggestionClick: handleOverlaySuggestionClick,
|
|
309
|
+
onSuggestionHover: onOverlayHover,
|
|
310
|
+
onSuggestionDrag: onOverlayDrag,
|
|
311
|
+
onSuggestionMouseDown: onOverlayMouseDown,
|
|
312
|
+
onSuggestionMouseUp: onOverlayMouseUp,
|
|
313
|
+
onSuggestionTouchStart: onOverlayTouchStart,
|
|
314
|
+
onSuggestionTouchEnd: onOverlayTouchEnd,
|
|
315
|
+
onProductCardClick: handleProductCardClick
|
|
316
|
+
}) : null
|
|
317
|
+
}) });
|
|
219
318
|
};
|
|
220
319
|
|
|
221
320
|
//#endregion
|
|
@@ -12,42 +12,49 @@ let classnames = require("classnames");
|
|
|
12
12
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
13
13
|
|
|
14
14
|
//#region src/components/FullPageSalesAgent/components/Layout.tsx
|
|
15
|
-
const Layout = ({ theme, welcomeMessage, footer, chatMessages, answerSuggestions, scrollToBottomButton, disclaimer, headerContainer, autoHeight, scrollContainerRef }) => {
|
|
15
|
+
const Layout = ({ theme, welcomeMessage, footer, chatMessages, answerSuggestions, scrollToBottomButton, disclaimer, headerContainer, autoHeight, scrollContainerRef, overlay, backgroundStyle }) => {
|
|
16
16
|
const hasWelcomeMessage = (0, react.isValidElement)(welcomeMessage);
|
|
17
17
|
const hasAnswerSuggestions = (0, react.isValidElement)(answerSuggestions);
|
|
18
18
|
const { isMobile } = require_useIsMobile.useIsMobile();
|
|
19
19
|
const { contentClasses } = require_useGetScrollContentStyles.useGetScrollContentStyles();
|
|
20
|
-
const { footerContainerClasses } = require_useGetFooterStyles.useGetFooterStyles();
|
|
20
|
+
const { footerContainerClasses } = require_useGetFooterStyles.useGetFooterStyles({ showOverlay: false });
|
|
21
21
|
const { containerClasses, containerStyles } = require_useGetContainerStyles.useGetContainerStyles({
|
|
22
22
|
headerContainer,
|
|
23
23
|
autoHeight
|
|
24
24
|
});
|
|
25
25
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
26
|
-
className: containerClasses,
|
|
27
|
-
style:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
26
|
+
className: (0, classnames.default)(containerClasses, "envive-tw-relative"),
|
|
27
|
+
style: {
|
|
28
|
+
...containerStyles,
|
|
29
|
+
...backgroundStyle
|
|
30
|
+
},
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
33
|
+
ref: scrollContainerRef,
|
|
34
|
+
className: contentClasses,
|
|
35
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Stack.Stack, {
|
|
36
|
+
direction: "column",
|
|
37
|
+
justify: "between",
|
|
38
|
+
children: [welcomeMessage, disclaimer]
|
|
39
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Stack.Stack, {
|
|
40
|
+
direction: "column",
|
|
41
|
+
gap: "0",
|
|
42
|
+
className: (0, classnames.default)((!hasWelcomeMessage || hasWelcomeMessage && theme === require_theme.Theme.STANDARD) && !hasAnswerSuggestions && "envive-tw-pb-4", isMobile ? "envive-tw-pt-4" : "envive-tw-pt-6"),
|
|
43
|
+
children: [chatMessages, answerSuggestions]
|
|
44
|
+
})]
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
47
|
+
className: footerContainerClasses,
|
|
48
|
+
children: [scrollToBottomButton && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49
|
+
className: "envive-tw-h-[0px]",
|
|
50
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
51
|
+
className: "envive-tw-ml-auto envive-tw-table envive-tw-translate-x-[-30px] envive-tw-translate-y-[-50px]",
|
|
52
|
+
children: scrollToBottomButton
|
|
53
|
+
})
|
|
54
|
+
}), footer]
|
|
55
|
+
}),
|
|
56
|
+
overlay
|
|
57
|
+
]
|
|
51
58
|
});
|
|
52
59
|
};
|
|
53
60
|
|
|
@@ -10,42 +10,49 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
10
10
|
import classNames from "classnames";
|
|
11
11
|
|
|
12
12
|
//#region src/components/FullPageSalesAgent/components/Layout.tsx
|
|
13
|
-
const Layout = ({ theme, welcomeMessage, footer, chatMessages, answerSuggestions, scrollToBottomButton, disclaimer, headerContainer, autoHeight, scrollContainerRef }) => {
|
|
13
|
+
const Layout = ({ theme, welcomeMessage, footer, chatMessages, answerSuggestions, scrollToBottomButton, disclaimer, headerContainer, autoHeight, scrollContainerRef, overlay, backgroundStyle }) => {
|
|
14
14
|
const hasWelcomeMessage = isValidElement(welcomeMessage);
|
|
15
15
|
const hasAnswerSuggestions = isValidElement(answerSuggestions);
|
|
16
16
|
const { isMobile } = useIsMobile();
|
|
17
17
|
const { contentClasses } = useGetScrollContentStyles();
|
|
18
|
-
const { footerContainerClasses } = useGetFooterStyles();
|
|
18
|
+
const { footerContainerClasses } = useGetFooterStyles({ showOverlay: false });
|
|
19
19
|
const { containerClasses, containerStyles } = useGetContainerStyles({
|
|
20
20
|
headerContainer,
|
|
21
21
|
autoHeight
|
|
22
22
|
});
|
|
23
23
|
return /* @__PURE__ */ jsxs("div", {
|
|
24
|
-
className: containerClasses,
|
|
25
|
-
style:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
24
|
+
className: classNames(containerClasses, "envive-tw-relative"),
|
|
25
|
+
style: {
|
|
26
|
+
...containerStyles,
|
|
27
|
+
...backgroundStyle
|
|
28
|
+
},
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsxs("div", {
|
|
31
|
+
ref: scrollContainerRef,
|
|
32
|
+
className: contentClasses,
|
|
33
|
+
children: [/* @__PURE__ */ jsxs(Stack, {
|
|
34
|
+
direction: "column",
|
|
35
|
+
justify: "between",
|
|
36
|
+
children: [welcomeMessage, disclaimer]
|
|
37
|
+
}), /* @__PURE__ */ jsxs(Stack, {
|
|
38
|
+
direction: "column",
|
|
39
|
+
gap: "0",
|
|
40
|
+
className: classNames((!hasWelcomeMessage || hasWelcomeMessage && theme === Theme.STANDARD) && !hasAnswerSuggestions && "envive-tw-pb-4", isMobile ? "envive-tw-pt-4" : "envive-tw-pt-6"),
|
|
41
|
+
children: [chatMessages, answerSuggestions]
|
|
42
|
+
})]
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ jsxs("div", {
|
|
45
|
+
className: footerContainerClasses,
|
|
46
|
+
children: [scrollToBottomButton && /* @__PURE__ */ jsx("div", {
|
|
47
|
+
className: "envive-tw-h-[0px]",
|
|
48
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
49
|
+
className: "envive-tw-ml-auto envive-tw-table envive-tw-translate-x-[-30px] envive-tw-translate-y-[-50px]",
|
|
50
|
+
children: scrollToBottomButton
|
|
51
|
+
})
|
|
52
|
+
}), footer]
|
|
53
|
+
}),
|
|
54
|
+
overlay
|
|
55
|
+
]
|
|
49
56
|
});
|
|
50
57
|
};
|
|
51
58
|
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_index = require('../../Typography/types/index.cjs');
|
|
3
|
+
const require_Typography = require('../../Typography/Typography.cjs');
|
|
4
|
+
require('../../Typography/index.cjs');
|
|
5
|
+
const require_PromptCarousel_types_types = require('../../PromptCarousel/types/types.cjs');
|
|
6
|
+
const require_PromptCarousel = require('../../PromptCarousel/PromptCarousel.cjs');
|
|
7
|
+
require('../../PromptCarousel/index.cjs');
|
|
8
|
+
const require_SparkleAnimation = require('../../SparkleAnimation/SparkleAnimation.cjs');
|
|
9
|
+
require('../../SparkleAnimation/index.cjs');
|
|
10
|
+
const require_SalesAgentProductCardsCarousel = require('../../FloatingChat/components/SalesAgentProductCardsCarousel.cjs');
|
|
11
|
+
const require_useWelcomeOverlayProducts = require('../hooks/useWelcomeOverlayProducts.cjs');
|
|
12
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
13
|
+
let classnames = require("classnames");
|
|
14
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
15
|
+
let framer_motion = require("framer-motion");
|
|
16
|
+
|
|
17
|
+
//#region src/components/FullPageSalesAgent/components/WelcomeOverlay.tsx
|
|
18
|
+
const WelcomeOverlay = ({ show, theme, title, promptSuggestions, productCarouselTitle, productIds, chatFooter, suggestionButtonType, sparkleColor, backgroundStyle = { backgroundColor: "white" }, onSuggestionClick, onSuggestionHover, onSuggestionDrag, onSuggestionMouseDown, onSuggestionMouseUp, onSuggestionTouchStart, onSuggestionTouchEnd, onProductCardClick }) => {
|
|
19
|
+
const { products, isLoading } = require_useWelcomeOverlayProducts.useWelcomeOverlayProducts(productIds);
|
|
20
|
+
const showProductCarousel = !isLoading && products.length > 0 && !!productCarouselTitle;
|
|
21
|
+
const welcomeOverlayClassNames = (0, classnames.default)([
|
|
22
|
+
"envive-tw-inset-0",
|
|
23
|
+
"envive-tw-absolute",
|
|
24
|
+
"envive-tw-z-20",
|
|
25
|
+
"envive-tw-flex",
|
|
26
|
+
"envive-tw-w-full",
|
|
27
|
+
"envive-tw-h-full",
|
|
28
|
+
"envive-tw-max-w-[768px]",
|
|
29
|
+
"envive-tw-flex-col"
|
|
30
|
+
]);
|
|
31
|
+
const titleClassNames = (0, classnames.default)([
|
|
32
|
+
"envive-tw-flex",
|
|
33
|
+
"envive-tw-flex-row",
|
|
34
|
+
"envive-tw-gap-2",
|
|
35
|
+
"envive-tw-items-center"
|
|
36
|
+
]);
|
|
37
|
+
const titleBoxClassNames = (0, classnames.default)([
|
|
38
|
+
"envive-tw-flex",
|
|
39
|
+
"envive-tw-py-4",
|
|
40
|
+
"envive-tw-px-[14px]",
|
|
41
|
+
"envive-tw-flex-col",
|
|
42
|
+
"envive-tw-gap-4",
|
|
43
|
+
"envive-tw-bg-background-light",
|
|
44
|
+
"envive-tw-border-border-light",
|
|
45
|
+
"envive-tw-border-solid",
|
|
46
|
+
"envive-tw-border",
|
|
47
|
+
"envive-tw-rounded-global-custom"
|
|
48
|
+
]);
|
|
49
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.AnimatePresence, { children: show && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
|
|
50
|
+
className: welcomeOverlayClassNames,
|
|
51
|
+
style: backgroundStyle,
|
|
52
|
+
initial: { opacity: 1 },
|
|
53
|
+
exit: {
|
|
54
|
+
opacity: 0,
|
|
55
|
+
transition: {
|
|
56
|
+
duration: .5,
|
|
57
|
+
ease: "easeIn"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
61
|
+
className: "envive-tw-flex envive-tw-flex-1 envive-tw-flex-col envive-tw-gap-6 envive-tw-overflow-y-auto envive-tw-overflow-x-hidden envive-tw-px-4 envive-tw-pb-4 envive-tw-pt-6 lg:envive-tw-gap-10",
|
|
62
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
63
|
+
className: titleBoxClassNames,
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
66
|
+
className: titleClassNames,
|
|
67
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
|
|
68
|
+
variant: require_index.TypographyVariant.T3_MD,
|
|
69
|
+
children: title
|
|
70
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SparkleAnimation.SparkleAnimation, {
|
|
71
|
+
color: sparkleColor,
|
|
72
|
+
animate: false
|
|
73
|
+
})]
|
|
74
|
+
}),
|
|
75
|
+
chatFooter,
|
|
76
|
+
promptSuggestions.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_PromptCarousel.PromptCarousel, {
|
|
77
|
+
theme,
|
|
78
|
+
promptButtonTexts: promptSuggestions,
|
|
79
|
+
promptButtonType: suggestionButtonType,
|
|
80
|
+
promptCarouselRows: require_PromptCarousel_types_types.PromptCarouselRows.ALWAYS_TWO,
|
|
81
|
+
animationSpeed: require_PromptCarousel_types_types.AnimationSpeed.NONE,
|
|
82
|
+
handleButtonClick: onSuggestionClick,
|
|
83
|
+
handleButtonHover: onSuggestionHover,
|
|
84
|
+
handleButtonDrag: onSuggestionDrag,
|
|
85
|
+
handleButtonMouseDown: onSuggestionMouseDown,
|
|
86
|
+
handleButtonMouseUp: onSuggestionMouseUp,
|
|
87
|
+
handleButtonTouchStart: onSuggestionTouchStart,
|
|
88
|
+
handleButtonTouchEnd: onSuggestionTouchEnd
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
}), showProductCarousel && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
92
|
+
className: "envive-tw-flex envive-tw-flex-col envive-tw-gap-3",
|
|
93
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
|
|
94
|
+
variant: require_index.TypographyVariant.B2_MD,
|
|
95
|
+
children: productCarouselTitle
|
|
96
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SalesAgentProductCardsCarousel.SalesAgentProductCardsCarousel, {
|
|
97
|
+
theme,
|
|
98
|
+
hideBadgeCount: true,
|
|
99
|
+
products,
|
|
100
|
+
hideNavigation: false,
|
|
101
|
+
onProductCardClick
|
|
102
|
+
})]
|
|
103
|
+
})]
|
|
104
|
+
})
|
|
105
|
+
}, "welcome-overlay") });
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
//#endregion
|
|
109
|
+
exports.WelcomeOverlay = WelcomeOverlay;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { TypographyVariant } from "../../Typography/types/index.js";
|
|
2
|
+
import { Typography } from "../../Typography/Typography.js";
|
|
3
|
+
import "../../Typography/index.js";
|
|
4
|
+
import { AnimationSpeed, PromptCarouselRows } from "../../PromptCarousel/types/types.js";
|
|
5
|
+
import { PromptCarousel } from "../../PromptCarousel/PromptCarousel.js";
|
|
6
|
+
import "../../PromptCarousel/index.js";
|
|
7
|
+
import { SparkleAnimation } from "../../SparkleAnimation/SparkleAnimation.js";
|
|
8
|
+
import "../../SparkleAnimation/index.js";
|
|
9
|
+
import { SalesAgentProductCardsCarousel } from "../../FloatingChat/components/SalesAgentProductCardsCarousel.js";
|
|
10
|
+
import { useWelcomeOverlayProducts } from "../hooks/useWelcomeOverlayProducts.js";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import classNames from "classnames";
|
|
13
|
+
import { AnimatePresence, motion } from "framer-motion";
|
|
14
|
+
|
|
15
|
+
//#region src/components/FullPageSalesAgent/components/WelcomeOverlay.tsx
|
|
16
|
+
const WelcomeOverlay = ({ show, theme, title, promptSuggestions, productCarouselTitle, productIds, chatFooter, suggestionButtonType, sparkleColor, backgroundStyle = { backgroundColor: "white" }, onSuggestionClick, onSuggestionHover, onSuggestionDrag, onSuggestionMouseDown, onSuggestionMouseUp, onSuggestionTouchStart, onSuggestionTouchEnd, onProductCardClick }) => {
|
|
17
|
+
const { products, isLoading } = useWelcomeOverlayProducts(productIds);
|
|
18
|
+
const showProductCarousel = !isLoading && products.length > 0 && !!productCarouselTitle;
|
|
19
|
+
const welcomeOverlayClassNames = classNames([
|
|
20
|
+
"envive-tw-inset-0",
|
|
21
|
+
"envive-tw-absolute",
|
|
22
|
+
"envive-tw-z-20",
|
|
23
|
+
"envive-tw-flex",
|
|
24
|
+
"envive-tw-w-full",
|
|
25
|
+
"envive-tw-h-full",
|
|
26
|
+
"envive-tw-max-w-[768px]",
|
|
27
|
+
"envive-tw-flex-col"
|
|
28
|
+
]);
|
|
29
|
+
const titleClassNames = classNames([
|
|
30
|
+
"envive-tw-flex",
|
|
31
|
+
"envive-tw-flex-row",
|
|
32
|
+
"envive-tw-gap-2",
|
|
33
|
+
"envive-tw-items-center"
|
|
34
|
+
]);
|
|
35
|
+
const titleBoxClassNames = classNames([
|
|
36
|
+
"envive-tw-flex",
|
|
37
|
+
"envive-tw-py-4",
|
|
38
|
+
"envive-tw-px-[14px]",
|
|
39
|
+
"envive-tw-flex-col",
|
|
40
|
+
"envive-tw-gap-4",
|
|
41
|
+
"envive-tw-bg-background-light",
|
|
42
|
+
"envive-tw-border-border-light",
|
|
43
|
+
"envive-tw-border-solid",
|
|
44
|
+
"envive-tw-border",
|
|
45
|
+
"envive-tw-rounded-global-custom"
|
|
46
|
+
]);
|
|
47
|
+
return /* @__PURE__ */ jsx(AnimatePresence, { children: show && /* @__PURE__ */ jsx(motion.div, {
|
|
48
|
+
className: welcomeOverlayClassNames,
|
|
49
|
+
style: backgroundStyle,
|
|
50
|
+
initial: { opacity: 1 },
|
|
51
|
+
exit: {
|
|
52
|
+
opacity: 0,
|
|
53
|
+
transition: {
|
|
54
|
+
duration: .5,
|
|
55
|
+
ease: "easeIn"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
59
|
+
className: "envive-tw-flex envive-tw-flex-1 envive-tw-flex-col envive-tw-gap-6 envive-tw-overflow-y-auto envive-tw-overflow-x-hidden envive-tw-px-4 envive-tw-pb-4 envive-tw-pt-6 lg:envive-tw-gap-10",
|
|
60
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
61
|
+
className: titleBoxClassNames,
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ jsxs("div", {
|
|
64
|
+
className: titleClassNames,
|
|
65
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
66
|
+
variant: TypographyVariant.T3_MD,
|
|
67
|
+
children: title
|
|
68
|
+
}), /* @__PURE__ */ jsx(SparkleAnimation, {
|
|
69
|
+
color: sparkleColor,
|
|
70
|
+
animate: false
|
|
71
|
+
})]
|
|
72
|
+
}),
|
|
73
|
+
chatFooter,
|
|
74
|
+
promptSuggestions.length > 0 && /* @__PURE__ */ jsx(PromptCarousel, {
|
|
75
|
+
theme,
|
|
76
|
+
promptButtonTexts: promptSuggestions,
|
|
77
|
+
promptButtonType: suggestionButtonType,
|
|
78
|
+
promptCarouselRows: PromptCarouselRows.ALWAYS_TWO,
|
|
79
|
+
animationSpeed: AnimationSpeed.NONE,
|
|
80
|
+
handleButtonClick: onSuggestionClick,
|
|
81
|
+
handleButtonHover: onSuggestionHover,
|
|
82
|
+
handleButtonDrag: onSuggestionDrag,
|
|
83
|
+
handleButtonMouseDown: onSuggestionMouseDown,
|
|
84
|
+
handleButtonMouseUp: onSuggestionMouseUp,
|
|
85
|
+
handleButtonTouchStart: onSuggestionTouchStart,
|
|
86
|
+
handleButtonTouchEnd: onSuggestionTouchEnd
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
}), showProductCarousel && /* @__PURE__ */ jsxs("div", {
|
|
90
|
+
className: "envive-tw-flex envive-tw-flex-col envive-tw-gap-3",
|
|
91
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
92
|
+
variant: TypographyVariant.B2_MD,
|
|
93
|
+
children: productCarouselTitle
|
|
94
|
+
}), /* @__PURE__ */ jsx(SalesAgentProductCardsCarousel, {
|
|
95
|
+
theme,
|
|
96
|
+
hideBadgeCount: true,
|
|
97
|
+
products,
|
|
98
|
+
hideNavigation: false,
|
|
99
|
+
onProductCardClick
|
|
100
|
+
})]
|
|
101
|
+
})]
|
|
102
|
+
})
|
|
103
|
+
}, "welcome-overlay") });
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
//#endregion
|
|
107
|
+
export { WelcomeOverlay };
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
const require_useIsMobile = require('./useIsMobile.cjs');
|
|
2
2
|
|
|
3
3
|
//#region src/components/FullPageSalesAgent/hooks/useGetFooterStyles.ts
|
|
4
|
-
const
|
|
4
|
+
const getStyles = ({ isMobile, showOverlay }) => {
|
|
5
|
+
if (showOverlay) return {
|
|
6
|
+
padding: 0,
|
|
7
|
+
borderTopWidth: "0px"
|
|
8
|
+
};
|
|
9
|
+
return isMobile ? void 0 : {
|
|
10
|
+
boxShadow: "0px 2px 10px 0px rgba(0, 0, 0, 0.2)",
|
|
11
|
+
borderWidth: "1px"
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
const useGetFooterStyles = ({ showOverlay }) => {
|
|
5
15
|
const { isMobile } = require_useIsMobile.useIsMobile();
|
|
6
16
|
return {
|
|
7
|
-
footerStyles:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
17
|
+
footerStyles: getStyles({
|
|
18
|
+
isMobile,
|
|
19
|
+
showOverlay
|
|
20
|
+
}),
|
|
11
21
|
footerClasses: isMobile ? "envive-tw-rounded-t-[var(--envive-global-custom-border-radius)]" : "envive-tw-rounded-[var(--envive-global-custom-border-radius)]",
|
|
12
|
-
footerContainerClasses: isMobile ? "envive-tw-z-10 envive-tw-absolute envive-tw-bottom-[0] envive-tw-left-[0] envive-tw-right-[0]" : "envive-tw-z-10 envive-tw-absolute envive-tw-bottom-5 envive-tw-
|
|
22
|
+
footerContainerClasses: isMobile ? "envive-tw-z-10 envive-tw-absolute envive-tw-bottom-[0] envive-tw-left-[0] envive-tw-right-[0]" : "envive-tw-z-10 envive-tw-absolute envive-tw-bottom-5 envive-tw-w-full envive-tw-left-0 envive-tw-right-0"
|
|
13
23
|
};
|
|
14
24
|
};
|
|
15
25
|
|