@envive-ai/react-toolkit-v3 0.3.25 → 0.3.27
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/AnimatedText/AnimatedText.d.ts +3 -3
- package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.cts +2 -2
- package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.ts +2 -2
- package/dist/CSSVariablesEditor/hooks/useGetCssVariablesOptions.cjs +1 -1
- package/dist/CSSVariablesEditor/hooks/useGetCssVariablesOptions.js +1 -1
- package/dist/CSSVariablesEditor/hooks/useGetCurrentMerchantColors.cjs +1 -1
- package/dist/CSSVariablesEditor/hooks/useGetCurrentMerchantColors.js +1 -1
- package/dist/CSSVariablesEditor/hooks/useGetDefaultCssVariables.cjs +4 -4
- package/dist/CSSVariablesEditor/hooks/useGetDefaultCssVariables.js +4 -4
- package/dist/CSSVariablesEditor/hooks/useHandleUpdateCssVars.cjs +3 -3
- package/dist/CSSVariablesEditor/hooks/useHandleUpdateCssVars.js +3 -3
- package/dist/Carousel/Carousel.d.cts +2 -2
- package/dist/Carousel/Carousel.d.ts +2 -2
- package/dist/Carousel/components/Badge.cjs +1 -1
- package/dist/Carousel/components/Badge.js +1 -1
- package/dist/Carousel/components/Container.cjs +1 -1
- package/dist/Carousel/components/Container.js +1 -1
- package/dist/ChatFooter/ChatFooter.cjs +2 -1
- package/dist/ChatFooter/ChatFooter.d.cts +2 -2
- package/dist/ChatFooter/ChatFooter.d.ts +2 -2
- package/dist/ChatFooter/ChatFooter.js +2 -1
- package/dist/ChatFooter/components/Layout.cjs +3 -3
- package/dist/ChatFooter/components/Layout.d.cts +1 -0
- package/dist/ChatFooter/components/Layout.d.ts +1 -0
- package/dist/ChatFooter/components/Layout.js +3 -3
- package/dist/ChatFooter/components/index.d.cts +6 -5
- package/dist/ChatFooter/components/index.d.ts +6 -5
- package/dist/ChatHeader/ChatHeader.d.cts +2 -2
- package/dist/ChatHeader/ChatHeader.d.ts +2 -2
- package/dist/ChatHeader/hooks/useGetHandleProperties.cjs +1 -1
- package/dist/ChatHeader/hooks/useGetHandleProperties.js +1 -1
- package/dist/ChatHeader/hooks/useGetLayoutProperties.cjs +1 -1
- package/dist/ChatHeader/hooks/useGetLayoutProperties.js +1 -1
- package/dist/ChatHeader/hooks/useGetToggleOptionProperties.cjs +6 -6
- package/dist/ChatHeader/hooks/useGetToggleOptionProperties.js +6 -6
- 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/ChatPreviewComparison/components/Layout.cjs +2 -2
- package/dist/ChatPreviewComparison/components/Layout.js +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.cts +2 -2
- package/dist/Container/Container.d.cts +176 -176
- package/dist/Container/Container.d.ts +176 -176
- package/dist/DesignTokens/DesignTokensComponent.d.cts +2 -2
- package/dist/DesignTokens/DesignTokensComponent.d.ts +2 -2
- package/dist/DesignTokens/components/FontFamily.cjs +1 -1
- package/dist/DesignTokens/components/FontFamily.js +1 -1
- package/dist/DesignTokens/components/FontSize.cjs +1 -1
- package/dist/DesignTokens/components/FontSize.js +1 -1
- package/dist/DesignTokens/components/FontWeight.cjs +1 -1
- package/dist/DesignTokens/components/FontWeight.js +1 -1
- package/dist/DesignTokens/components/LetterSpacing.cjs +1 -1
- package/dist/DesignTokens/components/LetterSpacing.js +1 -1
- package/dist/DesignTokens/components/LineHeight.cjs +1 -1
- package/dist/DesignTokens/components/LineHeight.js +1 -1
- package/dist/DesignTokens/components/Typography.cjs +1 -1
- package/dist/DesignTokens/components/Typography.js +1 -1
- package/dist/Disclaimer/components/Container.cjs +1 -1
- package/dist/Disclaimer/components/Container.js +1 -1
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.cts +2 -2
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.ts +2 -2
- package/dist/DocumentRetrievalCard/components/Image.cjs +1 -1
- package/dist/DocumentRetrievalCard/components/Image.js +1 -1
- package/dist/DocumentRetrievalCard/components/Layout.cjs +1 -1
- package/dist/DocumentRetrievalCard/components/Layout.js +1 -1
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.cjs +1 -1
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.js +1 -1
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Label.cjs +1 -1
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Label.js +1 -1
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Layout.cjs +1 -1
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Layout.js +1 -1
- package/dist/DocumentRetrievalCard/components/ViewArticleButton.cjs +1 -1
- package/dist/DocumentRetrievalCard/components/ViewArticleButton.js +1 -1
- package/dist/FloatingButton/FloatingButton.d.cts +2 -2
- package/dist/FloatingButton/FloatingButton.d.ts +2 -2
- package/dist/FloatingButton/components/Button.cjs +1 -1
- package/dist/FloatingButton/components/Button.js +1 -1
- package/dist/FloatingButton/components/Container.cjs +1 -1
- package/dist/FloatingButton/components/Container.js +1 -1
- package/dist/FloatingButton/components/Wrapper.cjs +1 -1
- package/dist/FloatingButton/components/Wrapper.js +1 -1
- 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 +1 -1
- package/dist/FloatingChat/components/Layout.js +1 -1
- package/dist/FloatingChat/components/ProductResultsModal.cjs +1 -1
- package/dist/FloatingChat/components/ProductResultsModal.js +1 -1
- 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/Form/Form.cjs +1 -1
- package/dist/Form/Form.js +1 -1
- package/dist/Form/components/Layout.cjs +1 -1
- package/dist/Form/components/Layout.js +1 -1
- package/dist/Form/components/SubmitButtonItem.cjs +1 -1
- package/dist/Form/components/SubmitButtonItem.js +1 -1
- package/dist/Form/components/TextFieldItem.cjs +1 -1
- package/dist/Form/components/TextFieldItem.js +1 -1
- package/dist/FullPageSalesAgent/FullPageSalesAgent.cjs +89 -25
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.cts +5 -7
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.ts +5 -7
- package/dist/FullPageSalesAgent/FullPageSalesAgent.js +90 -26
- package/dist/FullPageSalesAgent/components/Layout.cjs +35 -28
- package/dist/FullPageSalesAgent/components/Layout.js +35 -28
- package/dist/FullPageSalesAgent/components/WelcomeOverlay.cjs +102 -0
- package/dist/FullPageSalesAgent/components/WelcomeOverlay.js +100 -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 +43 -0
- package/dist/FullPageSalesAgent/hooks/useWelcomeOverlayProducts.js +41 -0
- package/dist/Image/Image.cjs +1 -1
- package/dist/Image/Image.d.cts +2 -2
- package/dist/Image/Image.d.ts +2 -2
- package/dist/Image/Image.js +1 -1
- 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/ImageGallery/utils/functions.cjs +1 -1
- package/dist/ImageGallery/utils/functions.js +1 -1
- package/dist/MarkdownProcessor/MarkdownProcessor.d.cts +2 -2
- package/dist/MarkdownProcessor/MarkdownProcessor.d.ts +2 -2
- package/dist/Message/components/Layout.cjs +1 -1
- package/dist/Message/components/Layout.js +1 -1
- 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/OrderLookupCard/components/Layout.cjs +1 -1
- package/dist/OrderLookupCard/components/Layout.js +1 -1
- package/dist/OrderLookupCard/components/MoreProductsOverlay.cjs +1 -1
- package/dist/OrderLookupCard/components/MoreProductsOverlay.js +1 -1
- package/dist/OrderLookupCard/components/ProductImageGridItem.cjs +1 -1
- package/dist/OrderLookupCard/components/ProductImageGridItem.js +1 -1
- package/dist/OrderLookupCard/components/ProductImageItem.cjs +1 -1
- package/dist/OrderLookupCard/components/ProductImageItem.js +1 -1
- package/dist/OrderLookupCard/components/ProductImagesGrid.cjs +1 -1
- package/dist/OrderLookupCard/components/ProductImagesGrid.js +1 -1
- package/dist/OrderLookupCard/components/StatusLabel.cjs +1 -1
- package/dist/OrderLookupCard/components/StatusLabel.js +1 -1
- package/dist/OrderLookupCard/components/TrackOrderLink.cjs +1 -1
- package/dist/OrderLookupCard/components/TrackOrderLink.js +1 -1
- package/dist/ProductCard/ProductCard.cjs +1 -1
- package/dist/ProductCard/ProductCard.d.cts +2 -2
- package/dist/ProductCard/ProductCard.d.ts +2 -2
- package/dist/ProductCard/ProductCard.js +1 -1
- package/dist/PromptButton/PromptButton.cjs +1 -1
- package/dist/PromptButton/PromptButton.d.cts +2 -2
- package/dist/PromptButton/PromptButton.d.ts +2 -2
- package/dist/PromptButton/PromptButton.js +1 -1
- package/dist/PromptButton/components/Layout.cjs +1 -1
- package/dist/PromptButton/components/Layout.js +1 -1
- package/dist/PromptButton/components/Loading.cjs +1 -1
- package/dist/PromptButton/components/Loading.js +1 -1
- 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/Layout.cjs +1 -1
- package/dist/PromptButtonCarouselWithImage/components/Layout.js +1 -1
- package/dist/PromptButtonCarouselWithImage/components/Skeleton.cjs +1 -1
- package/dist/PromptButtonCarouselWithImage/components/Skeleton.js +1 -1
- package/dist/PromptCarousel/PromptCarousel.cjs +1 -1
- package/dist/PromptCarousel/PromptCarousel.d.cts +2 -2
- package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
- package/dist/PromptCarousel/PromptCarousel.js +1 -1
- package/dist/ReviewCard/ReviewCard.d.cts +2 -2
- package/dist/ReviewCard/ReviewCard.d.ts +2 -2
- package/dist/ReviewCard/components/Container.cjs +1 -1
- package/dist/ReviewCard/components/Container.js +1 -1
- package/dist/ReviewCard/components/Rating.cjs +1 -1
- package/dist/ReviewCard/components/Rating.js +1 -1
- package/dist/ReviewCard/components/ReadMoreButton.cjs +1 -1
- package/dist/ReviewCard/components/ReadMoreButton.js +1 -1
- 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 +1 -1
- package/dist/SalesAgentProductCard/components/Container.js +1 -1
- package/dist/SalesAgentProductCard/components/Price.cjs +2 -2
- package/dist/SalesAgentProductCard/components/Price.js +2 -2
- package/dist/SalesAgentProductCard/components/ProductImage.cjs +1 -1
- package/dist/SalesAgentProductCard/components/ProductImage.js +1 -1
- package/dist/SalesAgentProductCard/components/ProductName.cjs +1 -1
- package/dist/SalesAgentProductCard/components/ProductName.js +1 -1
- 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 +4 -3
- package/dist/SocialProof/SocialProof.d.cts +2 -2
- package/dist/SocialProof/SocialProof.d.ts +2 -2
- package/dist/SocialProof/SocialProof.js +4 -3
- package/dist/SocialProof/components/Headline.cjs +2 -2
- package/dist/SocialProof/components/Headline.js +2 -2
- 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/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 +4 -1
- package/dist/TextField/TextField.js +4 -1
- package/dist/TextField/components/Input.cjs +1 -1
- package/dist/TextField/components/Input.js +1 -1
- package/dist/TextField/components/Layout.cjs +1 -1
- package/dist/TextField/components/Layout.js +1 -1
- package/dist/TextField/components/SendIcon.cjs +1 -1
- package/dist/TextField/components/SendIcon.js +1 -1
- package/dist/TextField/hooks/useVoiceInput.cjs +9 -1
- package/dist/TextField/hooks/useVoiceInput.js +9 -1
- package/dist/TextField/types/index.d.cts +12 -0
- package/dist/TextField/types/index.d.ts +12 -0
- package/dist/Title/Title.cjs +1 -1
- package/dist/Title/Title.js +1 -1
- package/dist/Title/components/Layout.cjs +1 -1
- package/dist/Title/components/Layout.js +1 -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 +6 -6
- package/dist/Tokens/index.js +6 -6
- package/dist/TypingAnimation/TypingAnimation.d.cts +2 -2
- package/dist/TypingAnimation/TypingAnimation.d.ts +2 -2
- package/dist/Typography/Typography.d.cts +4 -4
- package/dist/WelcomeMessage/components/Container.cjs +1 -1
- package/dist/WelcomeMessage/components/Container.js +1 -1
- package/dist/WidgetTextField/WidgetTextField.cjs +1 -1
- package/dist/WidgetTextField/WidgetTextField.d.cts +2 -2
- package/dist/WidgetTextField/WidgetTextField.js +1 -1
- package/dist/WidgetTextField/components/Container.cjs +1 -1
- package/dist/WidgetTextField/components/Container.js +1 -1
- package/dist/WidgetTextField/components/Skeleton.cjs +1 -1
- package/dist/WidgetTextField/components/Skeleton.js +1 -1
- package/dist/WidgetWrapper/WidgetWrapper.cjs +1 -1
- package/dist/WidgetWrapper/WidgetWrapper.d.cts +2 -2
- package/dist/WidgetWrapper/WidgetWrapper.d.ts +2 -2
- package/dist/WidgetWrapper/WidgetWrapper.js +1 -1
- package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.cts +2 -2
- package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.ts +2 -2
- package/dist/packages/components-v3/tokens/typography/typography.cjs +1 -1
- package/dist/packages/components-v3/tokens/typography/typography.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/utils/resolveTheme.cjs +1 -1
- package/dist/utils/resolveTheme.js +1 -1
- package/package.json +1 -1
- package/src/components/ChatFooter/ChatFooter.tsx +1 -0
- package/src/components/ChatFooter/components/Layout.tsx +3 -1
- package/src/components/ChatHeader/hooks/useGetToggleOptionProperties.ts +6 -6
- package/src/components/FloatingChat/components/SalesAgentBadgeContent.tsx +8 -0
- package/src/components/FloatingChat/components/SalesAgentProductCardsCarousel.tsx +3 -0
- package/src/components/FullPageSalesAgent/FullPageSalesAgent.tsx +139 -49
- package/src/components/FullPageSalesAgent/components/Layout.tsx +10 -3
- package/src/components/FullPageSalesAgent/components/WelcomeOverlay.tsx +121 -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 +51 -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 +10 -2
- package/src/components/TextField/__tests__/VoiceInputButton.test.tsx +22 -58
- package/src/components/TextField/hooks/useVoiceInput.ts +8 -0
- package/src/components/TextField/types/index.ts +12 -0
|
@@ -13,17 +13,15 @@ const require_ChatFooter = require('../ChatFooter/ChatFooter.cjs');
|
|
|
13
13
|
require('../ChatFooter/index.cjs');
|
|
14
14
|
const require_Disclaimer = require('../Disclaimer/Disclaimer.cjs');
|
|
15
15
|
require('../Disclaimer/index.cjs');
|
|
16
|
-
const require_WelcomeMessage = require('../WelcomeMessage/WelcomeMessage.cjs');
|
|
17
16
|
const require_useChatSuggestions = require('../FloatingChat/hooks/useChatSuggestions.cjs');
|
|
18
17
|
const require_useProductResultsView = require('../FloatingChat/hooks/useProductResultsView.cjs');
|
|
19
18
|
const require_useScrollToBottom = require('../FloatingChat/hooks/useScrollToBottom.cjs');
|
|
20
19
|
const require_ResultsGridView = require('../FloatingChat/components/ResultsGridView.cjs');
|
|
21
20
|
const require_trackProductCardInteraction = require('../FloatingChat/utils/trackProductCardInteraction.cjs');
|
|
22
21
|
const require_index = require('../FloatingChat/components/index.cjs');
|
|
23
|
-
require('../WelcomeMessage/index.cjs');
|
|
24
22
|
const require_useIsMobile = require('./hooks/useIsMobile.cjs');
|
|
25
23
|
const require_useGetFooterStyles = require('./hooks/useGetFooterStyles.cjs');
|
|
26
|
-
const
|
|
24
|
+
const require_WelcomeOverlay = require('./components/WelcomeOverlay.cjs');
|
|
27
25
|
const require_index$1 = require('./components/index.cjs');
|
|
28
26
|
const require_useGetMessagesStyles = require('./hooks/useGetMessagesStyles.cjs');
|
|
29
27
|
let react = require("react");
|
|
@@ -32,25 +30,48 @@ let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/c
|
|
|
32
30
|
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
33
31
|
let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
|
|
34
32
|
let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
|
|
33
|
+
let framer_motion = require("framer-motion");
|
|
35
34
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
36
35
|
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
37
36
|
|
|
38
37
|
//#region src/components/FullPageSalesAgent/FullPageSalesAgent.tsx
|
|
39
|
-
const FullPageSalesAgent = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, floatingChatConfig, lookAndFeelConfig,
|
|
38
|
+
const FullPageSalesAgent = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, floatingChatConfig, lookAndFeelConfig, widgetConfig, hardcopyContent, voiceInputEnabled }) => {
|
|
40
39
|
const resolvedTheme = require_resolveTheme.resolveTheme(theme);
|
|
41
40
|
const salesAgentData = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)(__envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.FULL_PAGE_SALES_AGENT);
|
|
42
41
|
const [query, setQuery] = (0, react.useState)("");
|
|
43
42
|
const chatMessagesRef = (0, react.useRef)(null);
|
|
44
|
-
const { footerStyles, footerClasses } = require_useGetFooterStyles.useGetFooterStyles();
|
|
45
43
|
const { messageClasses } = require_useGetMessagesStyles.useGetMessagesStyles();
|
|
46
|
-
const { messageContainerClasses } = require_useGetScrollContentStyles.useGetScrollContentStyles();
|
|
47
44
|
const { isMobile } = require_useIsMobile.useIsMobile();
|
|
48
45
|
const { trackWidgetInteraction } = (0, __envive_ai_react_hooks_hooks_WidgetInteraction.useWidgetInteraction)();
|
|
49
46
|
const { onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = require_usePromptCarouselAnalytics.usePromptCarouselAnalytics(__envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.FULL_PAGE_SALES_AGENT, (text) => text);
|
|
50
47
|
const setListeningToSpeech = require_react.useSetAtom(__envive_ai_react_hooks_atoms_chat.listeningToSpeechAtom);
|
|
51
|
-
const {
|
|
48
|
+
const { ignoreFirstModelResponse, neverShowSingleProductCards, showVerifiedBuyer, showEnviveLogo } = floatingChatConfig;
|
|
49
|
+
const { headerContainer, autoHeight, sparkleColor = "var(--envive-colors-accent-primary)", suggestionButtonType = require_PromptButton_types_index.PromptButtonVariant.LIGHT, useBackgroundImage, mobileBackgroundImage, desktopBackgroundImage, backgroundColor } = widgetConfig;
|
|
50
|
+
const backgroundStyle = (0, react.useMemo)(() => {
|
|
51
|
+
if (useBackgroundImage) {
|
|
52
|
+
const imageUrl = isMobile ? mobileBackgroundImage ?? desktopBackgroundImage : desktopBackgroundImage ?? mobileBackgroundImage;
|
|
53
|
+
if (imageUrl) return {
|
|
54
|
+
backgroundImage: `url(${imageUrl})`,
|
|
55
|
+
backgroundSize: "cover",
|
|
56
|
+
backgroundPosition: "center"
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
if (backgroundColor) return { backgroundColor };
|
|
60
|
+
return { backgroundColor: "white" };
|
|
61
|
+
}, [
|
|
62
|
+
useBackgroundImage,
|
|
63
|
+
mobileBackgroundImage,
|
|
64
|
+
desktopBackgroundImage,
|
|
65
|
+
backgroundColor,
|
|
66
|
+
isMobile
|
|
67
|
+
]);
|
|
52
68
|
const { agentName } = lookAndFeelConfig;
|
|
53
|
-
const {
|
|
69
|
+
const { chatFooterTextFieldPlaceholderText, disclaimerText, welcomeOverlayTitle, welcomeOverlayPromptSuggestions, welcomeOverlayProductCarouselTitle, welcomeOverlayProductIds } = hardcopyContent?.values ?? {};
|
|
70
|
+
const overlayEnabled = typeof welcomeOverlayTitle === "string" && !!welcomeOverlayTitle;
|
|
71
|
+
const [showOverlay, setShowOverlay] = (0, react.useState)(overlayEnabled);
|
|
72
|
+
const { footerStyles, footerClasses } = require_useGetFooterStyles.useGetFooterStyles({ showOverlay });
|
|
73
|
+
const overlayPromptSuggestions = Array.isArray(welcomeOverlayPromptSuggestions) ? welcomeOverlayPromptSuggestions : [];
|
|
74
|
+
const overlayProductIds = Array.isArray(welcomeOverlayProductIds) ? welcomeOverlayProductIds : [];
|
|
54
75
|
const { messages, isResponseStreaming, isPendingResponse, suggestions, onSuggestionClicked, onTypedMessageSubmitted, onFormResponseSubmitted } = salesAgentData;
|
|
55
76
|
const { answerSuggestions, generalSuggestions, showAnswerSuggestions, setAnswerSuggestions, setGeneralSuggestions } = require_useChatSuggestions.useChatSuggestions({
|
|
56
77
|
suggestions,
|
|
@@ -111,26 +132,45 @@ const FullPageSalesAgent = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, floatin
|
|
|
111
132
|
}
|
|
112
133
|
});
|
|
113
134
|
}, [trackWidgetInteraction]);
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
135
|
+
const handleOverlayDismiss = (0, react.useCallback)(() => {
|
|
136
|
+
setShowOverlay(false);
|
|
137
|
+
}, []);
|
|
138
|
+
const handleOverlaySuggestionClick = (0, react.useCallback)((buttonText) => {
|
|
139
|
+
onTypedMessageSubmitted({
|
|
140
|
+
query: buttonText,
|
|
141
|
+
userTyped: true,
|
|
142
|
+
displayLocation: __envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_TEXT_INPUT
|
|
143
|
+
});
|
|
144
|
+
setListeningToSpeech("abort");
|
|
145
|
+
setAnswerSuggestions([]);
|
|
146
|
+
setGeneralSuggestions([]);
|
|
147
|
+
setShowOverlay(false);
|
|
148
|
+
}, [
|
|
149
|
+
onTypedMessageSubmitted,
|
|
150
|
+
setListeningToSpeech,
|
|
151
|
+
setAnswerSuggestions,
|
|
152
|
+
setGeneralSuggestions
|
|
153
|
+
]);
|
|
154
|
+
const promptSuggestions = (0, react.useMemo)(() => {
|
|
155
|
+
if (showOverlay) return [];
|
|
156
|
+
if (isPendingResponse || isResponseStreaming) return ["Loading suggestions 1...", "Loading suggestions 2..."];
|
|
157
|
+
return generalSuggestions;
|
|
158
|
+
}, [
|
|
159
|
+
showOverlay,
|
|
160
|
+
isPendingResponse,
|
|
161
|
+
isResponseStreaming,
|
|
162
|
+
generalSuggestions
|
|
163
|
+
]);
|
|
123
164
|
const footer = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatFooter.ChatFooter, {
|
|
124
165
|
className: footerClasses,
|
|
125
166
|
style: footerStyles,
|
|
126
167
|
theme: resolvedTheme,
|
|
127
168
|
isScrolled: isMobile ? isFloatingLayout : false,
|
|
128
169
|
disabled: isPendingResponse || isResponseStreaming,
|
|
129
|
-
disabledInput: !userQueryInputEnabled,
|
|
130
170
|
isLoadingPromptSuggestions: isPendingResponse || isResponseStreaming || generalSuggestions.length === 0,
|
|
131
|
-
hideEnviveWatermark: !showEnviveLogo,
|
|
171
|
+
hideEnviveWatermark: showOverlay || !showEnviveLogo,
|
|
132
172
|
textFieldPlaceholderText: chatFooterTextFieldPlaceholderText,
|
|
133
|
-
promptSuggestions
|
|
173
|
+
promptSuggestions,
|
|
134
174
|
handleButtonClick: (buttonText) => {
|
|
135
175
|
const suggestion = suggestions.find((s) => s.content === buttonText && !s.isAnswer);
|
|
136
176
|
if (suggestion) onSuggestionClicked(suggestion, __envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_PROMPT_BUTTON);
|
|
@@ -138,6 +178,7 @@ const FullPageSalesAgent = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, floatin
|
|
|
138
178
|
setAnswerSuggestions([]);
|
|
139
179
|
setGeneralSuggestions([]);
|
|
140
180
|
handleBackToChat();
|
|
181
|
+
handleOverlayDismiss();
|
|
141
182
|
},
|
|
142
183
|
onChange: setQuery,
|
|
143
184
|
onSubmit: () => {
|
|
@@ -149,6 +190,7 @@ const FullPageSalesAgent = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, floatin
|
|
|
149
190
|
setAnswerSuggestions([]);
|
|
150
191
|
setGeneralSuggestions([]);
|
|
151
192
|
handleBackToChat();
|
|
193
|
+
handleOverlayDismiss();
|
|
152
194
|
},
|
|
153
195
|
onFocus: handleInputQueryFocus,
|
|
154
196
|
parentWidget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.FULL_PAGE_SALES_AGENT,
|
|
@@ -205,18 +247,40 @@ const FullPageSalesAgent = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, floatin
|
|
|
205
247
|
handleButtonTouchEnd: onTouchEnd
|
|
206
248
|
});
|
|
207
249
|
const disclaimer = disclaimerText && typeof disclaimerText === "string" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Disclaimer.Disclaimer, { disclaimerMarkdown: disclaimerText }) : void 0;
|
|
208
|
-
|
|
250
|
+
const motionFooter = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
|
|
251
|
+
transition: {
|
|
252
|
+
layout: { duration: .2 },
|
|
253
|
+
default: { duration: 0 }
|
|
254
|
+
},
|
|
255
|
+
layoutId: "fpsa-chat-footer",
|
|
256
|
+
children: footer
|
|
257
|
+
});
|
|
258
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.LayoutGroup, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$1.FullPageSAComponents.Layout, {
|
|
209
259
|
theme: resolvedTheme,
|
|
210
|
-
welcomeMessage:
|
|
211
|
-
footer,
|
|
260
|
+
welcomeMessage: null,
|
|
261
|
+
footer: !overlayEnabled || !showOverlay ? motionFooter : null,
|
|
212
262
|
chatMessages: middleContent,
|
|
213
263
|
answerSuggestions: showAnswerSuggestions && !isResultsView ? answerSuggestionsComponent : void 0,
|
|
214
264
|
scrollToBottomButton: !isResultsView && showScrollButton ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.FloatingChatComponents.ScrollToBottomButton, { onClick: handleScrollToBottom }) : void 0,
|
|
215
265
|
disclaimer: isResultsView ? null : disclaimer,
|
|
216
266
|
headerContainer,
|
|
217
267
|
autoHeight,
|
|
218
|
-
scrollContainerRef
|
|
219
|
-
|
|
268
|
+
scrollContainerRef,
|
|
269
|
+
backgroundStyle,
|
|
270
|
+
overlay: overlayEnabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_WelcomeOverlay.WelcomeOverlay, {
|
|
271
|
+
show: showOverlay,
|
|
272
|
+
theme: resolvedTheme,
|
|
273
|
+
suggestionButtonType,
|
|
274
|
+
sparkleColor,
|
|
275
|
+
title: welcomeOverlayTitle,
|
|
276
|
+
promptSuggestions: overlayPromptSuggestions,
|
|
277
|
+
productCarouselTitle: welcomeOverlayProductCarouselTitle,
|
|
278
|
+
productIds: overlayProductIds,
|
|
279
|
+
backgroundStyle,
|
|
280
|
+
chatFooter: showOverlay ? motionFooter : null,
|
|
281
|
+
onSuggestionClick: handleOverlaySuggestionClick
|
|
282
|
+
}) : null
|
|
283
|
+
}) });
|
|
220
284
|
};
|
|
221
285
|
|
|
222
286
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Theme } from "../tokens/theme/theme.cjs";
|
|
2
|
-
import * as
|
|
3
|
-
import { FloatingChatConfig, LookAndFeelConfig } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
2
|
+
import * as react_jsx_runtime30 from "react/jsx-runtime";
|
|
3
|
+
import { FloatingChatConfig, FullPageSalesAgentWidgetV3Config, LookAndFeelConfig } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
4
4
|
import { HardcopyResponse } from "@envive-ai/react-hooks/contexts/hardcopyContext";
|
|
5
5
|
|
|
6
6
|
//#region src/components/FullPageSalesAgent/FullPageSalesAgent.d.ts
|
|
@@ -8,19 +8,17 @@ interface FullPageSalesAgentProps {
|
|
|
8
8
|
theme?: Theme;
|
|
9
9
|
floatingChatConfig: FloatingChatConfig;
|
|
10
10
|
lookAndFeelConfig: LookAndFeelConfig;
|
|
11
|
+
widgetConfig: FullPageSalesAgentWidgetV3Config;
|
|
11
12
|
hardcopyContent: HardcopyResponse;
|
|
12
|
-
headerContainer?: string;
|
|
13
|
-
autoHeight?: boolean;
|
|
14
13
|
voiceInputEnabled?: boolean;
|
|
15
14
|
}
|
|
16
15
|
declare const FullPageSalesAgent: ({
|
|
17
16
|
theme,
|
|
18
17
|
floatingChatConfig,
|
|
19
18
|
lookAndFeelConfig,
|
|
19
|
+
widgetConfig,
|
|
20
20
|
hardcopyContent,
|
|
21
|
-
headerContainer,
|
|
22
|
-
autoHeight,
|
|
23
21
|
voiceInputEnabled
|
|
24
|
-
}: FullPageSalesAgentProps) =>
|
|
22
|
+
}: FullPageSalesAgentProps) => react_jsx_runtime30.JSX.Element;
|
|
25
23
|
//#endregion
|
|
26
24
|
export { FullPageSalesAgent };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Theme } from "../packages/components-v3/tokens/theme/theme.js";
|
|
2
|
-
import * as
|
|
3
|
-
import { FloatingChatConfig, LookAndFeelConfig } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
2
|
+
import * as react_jsx_runtime21 from "react/jsx-runtime";
|
|
3
|
+
import { FloatingChatConfig, FullPageSalesAgentWidgetV3Config, LookAndFeelConfig } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
4
4
|
import { HardcopyResponse } from "@envive-ai/react-hooks/contexts/hardcopyContext";
|
|
5
5
|
|
|
6
6
|
//#region src/components/FullPageSalesAgent/FullPageSalesAgent.d.ts
|
|
@@ -8,19 +8,17 @@ interface FullPageSalesAgentProps {
|
|
|
8
8
|
theme?: Theme;
|
|
9
9
|
floatingChatConfig: FloatingChatConfig;
|
|
10
10
|
lookAndFeelConfig: LookAndFeelConfig;
|
|
11
|
+
widgetConfig: FullPageSalesAgentWidgetV3Config;
|
|
11
12
|
hardcopyContent: HardcopyResponse;
|
|
12
|
-
headerContainer?: string;
|
|
13
|
-
autoHeight?: boolean;
|
|
14
13
|
voiceInputEnabled?: boolean;
|
|
15
14
|
}
|
|
16
15
|
declare const FullPageSalesAgent: ({
|
|
17
16
|
theme,
|
|
18
17
|
floatingChatConfig,
|
|
19
18
|
lookAndFeelConfig,
|
|
19
|
+
widgetConfig,
|
|
20
20
|
hardcopyContent,
|
|
21
|
-
headerContainer,
|
|
22
|
-
autoHeight,
|
|
23
21
|
voiceInputEnabled
|
|
24
|
-
}: FullPageSalesAgentProps) =>
|
|
22
|
+
}: FullPageSalesAgentProps) => react_jsx_runtime21.JSX.Element;
|
|
25
23
|
//#endregion
|
|
26
24
|
export { FullPageSalesAgent };
|
|
@@ -12,44 +12,65 @@ 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);
|
|
49
46
|
const setListeningToSpeech = useSetAtom(listeningToSpeechAtom);
|
|
50
|
-
const {
|
|
47
|
+
const { ignoreFirstModelResponse, neverShowSingleProductCards, showVerifiedBuyer, showEnviveLogo } = floatingChatConfig;
|
|
48
|
+
const { headerContainer, autoHeight, sparkleColor = "var(--envive-colors-accent-primary)", suggestionButtonType = PromptButtonVariant.LIGHT, useBackgroundImage, mobileBackgroundImage, desktopBackgroundImage, backgroundColor } = widgetConfig;
|
|
49
|
+
const backgroundStyle = useMemo(() => {
|
|
50
|
+
if (useBackgroundImage) {
|
|
51
|
+
const imageUrl = isMobile ? mobileBackgroundImage ?? desktopBackgroundImage : desktopBackgroundImage ?? mobileBackgroundImage;
|
|
52
|
+
if (imageUrl) return {
|
|
53
|
+
backgroundImage: `url(${imageUrl})`,
|
|
54
|
+
backgroundSize: "cover",
|
|
55
|
+
backgroundPosition: "center"
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (backgroundColor) return { backgroundColor };
|
|
59
|
+
return { backgroundColor: "white" };
|
|
60
|
+
}, [
|
|
61
|
+
useBackgroundImage,
|
|
62
|
+
mobileBackgroundImage,
|
|
63
|
+
desktopBackgroundImage,
|
|
64
|
+
backgroundColor,
|
|
65
|
+
isMobile
|
|
66
|
+
]);
|
|
51
67
|
const { agentName } = lookAndFeelConfig;
|
|
52
|
-
const {
|
|
68
|
+
const { chatFooterTextFieldPlaceholderText, disclaimerText, welcomeOverlayTitle, welcomeOverlayPromptSuggestions, welcomeOverlayProductCarouselTitle, welcomeOverlayProductIds } = hardcopyContent?.values ?? {};
|
|
69
|
+
const overlayEnabled = typeof welcomeOverlayTitle === "string" && !!welcomeOverlayTitle;
|
|
70
|
+
const [showOverlay, setShowOverlay] = useState(overlayEnabled);
|
|
71
|
+
const { footerStyles, footerClasses } = useGetFooterStyles({ showOverlay });
|
|
72
|
+
const overlayPromptSuggestions = Array.isArray(welcomeOverlayPromptSuggestions) ? welcomeOverlayPromptSuggestions : [];
|
|
73
|
+
const overlayProductIds = Array.isArray(welcomeOverlayProductIds) ? welcomeOverlayProductIds : [];
|
|
53
74
|
const { messages, isResponseStreaming, isPendingResponse, suggestions, onSuggestionClicked, onTypedMessageSubmitted, onFormResponseSubmitted } = salesAgentData;
|
|
54
75
|
const { answerSuggestions, generalSuggestions, showAnswerSuggestions, setAnswerSuggestions, setGeneralSuggestions } = useChatSuggestions({
|
|
55
76
|
suggestions,
|
|
@@ -110,26 +131,45 @@ const FullPageSalesAgent = ({ theme = Theme.GLOBAL_CUSTOM, floatingChatConfig, l
|
|
|
110
131
|
}
|
|
111
132
|
});
|
|
112
133
|
}, [trackWidgetInteraction]);
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
134
|
+
const handleOverlayDismiss = useCallback(() => {
|
|
135
|
+
setShowOverlay(false);
|
|
136
|
+
}, []);
|
|
137
|
+
const handleOverlaySuggestionClick = useCallback((buttonText) => {
|
|
138
|
+
onTypedMessageSubmitted({
|
|
139
|
+
query: buttonText,
|
|
140
|
+
userTyped: true,
|
|
141
|
+
displayLocation: ChatElementDisplayLocationV3.FLOATING_CHAT_TEXT_INPUT
|
|
142
|
+
});
|
|
143
|
+
setListeningToSpeech("abort");
|
|
144
|
+
setAnswerSuggestions([]);
|
|
145
|
+
setGeneralSuggestions([]);
|
|
146
|
+
setShowOverlay(false);
|
|
147
|
+
}, [
|
|
148
|
+
onTypedMessageSubmitted,
|
|
149
|
+
setListeningToSpeech,
|
|
150
|
+
setAnswerSuggestions,
|
|
151
|
+
setGeneralSuggestions
|
|
152
|
+
]);
|
|
153
|
+
const promptSuggestions = useMemo(() => {
|
|
154
|
+
if (showOverlay) return [];
|
|
155
|
+
if (isPendingResponse || isResponseStreaming) return ["Loading suggestions 1...", "Loading suggestions 2..."];
|
|
156
|
+
return generalSuggestions;
|
|
157
|
+
}, [
|
|
158
|
+
showOverlay,
|
|
159
|
+
isPendingResponse,
|
|
160
|
+
isResponseStreaming,
|
|
161
|
+
generalSuggestions
|
|
162
|
+
]);
|
|
122
163
|
const footer = /* @__PURE__ */ jsx(ChatFooter, {
|
|
123
164
|
className: footerClasses,
|
|
124
165
|
style: footerStyles,
|
|
125
166
|
theme: resolvedTheme,
|
|
126
167
|
isScrolled: isMobile ? isFloatingLayout : false,
|
|
127
168
|
disabled: isPendingResponse || isResponseStreaming,
|
|
128
|
-
disabledInput: !userQueryInputEnabled,
|
|
129
169
|
isLoadingPromptSuggestions: isPendingResponse || isResponseStreaming || generalSuggestions.length === 0,
|
|
130
|
-
hideEnviveWatermark: !showEnviveLogo,
|
|
170
|
+
hideEnviveWatermark: showOverlay || !showEnviveLogo,
|
|
131
171
|
textFieldPlaceholderText: chatFooterTextFieldPlaceholderText,
|
|
132
|
-
promptSuggestions
|
|
172
|
+
promptSuggestions,
|
|
133
173
|
handleButtonClick: (buttonText) => {
|
|
134
174
|
const suggestion = suggestions.find((s) => s.content === buttonText && !s.isAnswer);
|
|
135
175
|
if (suggestion) onSuggestionClicked(suggestion, ChatElementDisplayLocationV3.FLOATING_CHAT_PROMPT_BUTTON);
|
|
@@ -137,6 +177,7 @@ const FullPageSalesAgent = ({ theme = Theme.GLOBAL_CUSTOM, floatingChatConfig, l
|
|
|
137
177
|
setAnswerSuggestions([]);
|
|
138
178
|
setGeneralSuggestions([]);
|
|
139
179
|
handleBackToChat();
|
|
180
|
+
handleOverlayDismiss();
|
|
140
181
|
},
|
|
141
182
|
onChange: setQuery,
|
|
142
183
|
onSubmit: () => {
|
|
@@ -148,6 +189,7 @@ const FullPageSalesAgent = ({ theme = Theme.GLOBAL_CUSTOM, floatingChatConfig, l
|
|
|
148
189
|
setAnswerSuggestions([]);
|
|
149
190
|
setGeneralSuggestions([]);
|
|
150
191
|
handleBackToChat();
|
|
192
|
+
handleOverlayDismiss();
|
|
151
193
|
},
|
|
152
194
|
onFocus: handleInputQueryFocus,
|
|
153
195
|
parentWidget: WidgetInteractionComponent.FULL_PAGE_SALES_AGENT,
|
|
@@ -204,18 +246,40 @@ const FullPageSalesAgent = ({ theme = Theme.GLOBAL_CUSTOM, floatingChatConfig, l
|
|
|
204
246
|
handleButtonTouchEnd: onTouchEnd
|
|
205
247
|
});
|
|
206
248
|
const disclaimer = disclaimerText && typeof disclaimerText === "string" ? /* @__PURE__ */ jsx(Disclaimer, { disclaimerMarkdown: disclaimerText }) : void 0;
|
|
207
|
-
|
|
249
|
+
const motionFooter = /* @__PURE__ */ jsx(motion.div, {
|
|
250
|
+
transition: {
|
|
251
|
+
layout: { duration: .2 },
|
|
252
|
+
default: { duration: 0 }
|
|
253
|
+
},
|
|
254
|
+
layoutId: "fpsa-chat-footer",
|
|
255
|
+
children: footer
|
|
256
|
+
});
|
|
257
|
+
return /* @__PURE__ */ jsx(LayoutGroup, { children: /* @__PURE__ */ jsx(FullPageSAComponents.Layout, {
|
|
208
258
|
theme: resolvedTheme,
|
|
209
|
-
welcomeMessage:
|
|
210
|
-
footer,
|
|
259
|
+
welcomeMessage: null,
|
|
260
|
+
footer: !overlayEnabled || !showOverlay ? motionFooter : null,
|
|
211
261
|
chatMessages: middleContent,
|
|
212
262
|
answerSuggestions: showAnswerSuggestions && !isResultsView ? answerSuggestionsComponent : void 0,
|
|
213
263
|
scrollToBottomButton: !isResultsView && showScrollButton ? /* @__PURE__ */ jsx(FloatingChatComponents.ScrollToBottomButton, { onClick: handleScrollToBottom }) : void 0,
|
|
214
264
|
disclaimer: isResultsView ? null : disclaimer,
|
|
215
265
|
headerContainer,
|
|
216
266
|
autoHeight,
|
|
217
|
-
scrollContainerRef
|
|
218
|
-
|
|
267
|
+
scrollContainerRef,
|
|
268
|
+
backgroundStyle,
|
|
269
|
+
overlay: overlayEnabled ? /* @__PURE__ */ jsx(WelcomeOverlay, {
|
|
270
|
+
show: showOverlay,
|
|
271
|
+
theme: resolvedTheme,
|
|
272
|
+
suggestionButtonType,
|
|
273
|
+
sparkleColor,
|
|
274
|
+
title: welcomeOverlayTitle,
|
|
275
|
+
promptSuggestions: overlayPromptSuggestions,
|
|
276
|
+
productCarouselTitle: welcomeOverlayProductCarouselTitle,
|
|
277
|
+
productIds: overlayProductIds,
|
|
278
|
+
backgroundStyle,
|
|
279
|
+
chatFooter: showOverlay ? motionFooter : null,
|
|
280
|
+
onSuggestionClick: handleOverlaySuggestionClick
|
|
281
|
+
}) : null
|
|
282
|
+
}) });
|
|
219
283
|
};
|
|
220
284
|
|
|
221
285
|
//#endregion
|
|
@@ -7,47 +7,54 @@ const require_useIsMobile = require('../hooks/useIsMobile.cjs');
|
|
|
7
7
|
const require_useGetFooterStyles = require('../hooks/useGetFooterStyles.cjs');
|
|
8
8
|
const require_useGetScrollContentStyles = require('../hooks/useGetScrollContentStyles.cjs');
|
|
9
9
|
let react = require("react");
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
11
|
let classnames = require("classnames");
|
|
11
12
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
12
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
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
|
|
|
@@ -6,46 +6,53 @@ import { useIsMobile } from "../hooks/useIsMobile.js";
|
|
|
6
6
|
import { useGetFooterStyles } from "../hooks/useGetFooterStyles.js";
|
|
7
7
|
import { useGetScrollContentStyles } from "../hooks/useGetScrollContentStyles.js";
|
|
8
8
|
import { isValidElement } from "react";
|
|
9
|
-
import classNames from "classnames";
|
|
10
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
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
|
|