@envive-ai/react-toolkit-v3 0.3.5 → 0.3.7
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 +3 -3
- package/dist/CSSVariablesEditor/hooks/useGetCssVariablesOptions.js +3 -3
- package/dist/CSSVariablesEditor/hooks/useGetCurrentMerchantColors.cjs +1 -1
- package/dist/CSSVariablesEditor/hooks/useGetCurrentMerchantColors.js +1 -1
- package/dist/CSSVariablesEditor/hooks/useGetDefaultCssVariables.cjs +10 -10
- package/dist/CSSVariablesEditor/hooks/useGetDefaultCssVariables.js +10 -10
- package/dist/CSSVariablesEditor/hooks/useHandleUpdateCssVars.cjs +9 -9
- package/dist/CSSVariablesEditor/hooks/useHandleUpdateCssVars.js +9 -9
- package/dist/CSSVariablesEditor/utils/functions.cjs +2 -2
- package/dist/CSSVariablesEditor/utils/functions.js +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/ArrowIcon.cjs +3 -2
- package/dist/Carousel/components/ArrowIcon.js +2 -2
- package/dist/Carousel/hooks/useGetBadgeProperties.cjs +1 -1
- package/dist/Carousel/hooks/useGetBadgeProperties.js +1 -1
- package/dist/Carousel/types/types.d.cts +1 -1
- package/dist/Carousel/types/types.d.ts +1 -1
- package/dist/ChatFooter/ChatFooter.cjs +1 -1
- package/dist/ChatFooter/ChatFooter.d.cts +2 -2
- package/dist/ChatFooter/ChatFooter.d.ts +2 -2
- package/dist/ChatFooter/ChatFooter.js +1 -1
- package/dist/ChatFooter/components/EnviveLogo.cjs +3 -2
- package/dist/ChatFooter/components/EnviveLogo.js +2 -2
- package/dist/ChatFooter/components/Layout.d.cts +1 -1
- package/dist/ChatFooter/components/Layout.d.ts +1 -1
- package/dist/ChatFooter/components/PromptSuggestions.d.cts +1 -1
- package/dist/ChatFooter/components/PromptSuggestions.d.ts +1 -1
- package/dist/ChatFooter/components/index.d.cts +5 -5
- package/dist/ChatFooter/components/index.d.ts +5 -5
- package/dist/ChatFooter/hooks/useGetChatScrollProperties.cjs +1 -1
- package/dist/ChatFooter/hooks/useGetChatScrollProperties.js +1 -1
- package/dist/ChatFooter/hooks/useGetContainerProperties.cjs +3 -3
- package/dist/ChatFooter/hooks/useGetContainerProperties.js +3 -3
- package/dist/ChatFooter/types/types.d.cts +1 -1
- package/dist/ChatFooter/types/types.d.ts +1 -1
- package/dist/ChatHeader/ChatHeader.cjs +4 -3
- package/dist/ChatHeader/ChatHeader.d.cts +3 -2
- package/dist/ChatHeader/ChatHeader.d.ts +3 -2
- package/dist/ChatHeader/ChatHeader.js +4 -3
- package/dist/ChatHeader/components/CloseButton.cjs +10 -7
- package/dist/ChatHeader/components/CloseButton.js +7 -7
- package/dist/ChatHeader/components/Handle.cjs +27 -1
- package/dist/ChatHeader/components/Handle.js +27 -1
- package/dist/ChatHeader/components/Toggle.cjs +1 -1
- package/dist/ChatHeader/components/Toggle.js +1 -1
- package/dist/ChatHeader/hooks/useGetCloseButtonProperties.cjs +1 -1
- package/dist/ChatHeader/hooks/useGetCloseButtonProperties.js +1 -1
- package/dist/ChatHeader/hooks/useGetHandleProperties.cjs +1 -1
- package/dist/ChatHeader/hooks/useGetHandleProperties.js +1 -1
- package/dist/ChatHeader/hooks/useGetLayoutProperties.cjs +2 -2
- package/dist/ChatHeader/hooks/useGetLayoutProperties.js +2 -2
- package/dist/ChatHeader/hooks/useGetToggleOptionProperties.cjs +1 -1
- package/dist/ChatHeader/hooks/useGetToggleOptionProperties.js +1 -1
- package/dist/ChatHeader/hooks/useGetToggleProperties.cjs +1 -1
- package/dist/ChatHeader/hooks/useGetToggleProperties.js +1 -1
- package/dist/ChatHeader/hooks/useToggleLogoSelector.cjs +1 -1
- package/dist/ChatHeader/hooks/useToggleLogoSelector.js +1 -1
- package/dist/ChatHeader/types/index.d.cts +4 -2
- package/dist/ChatHeader/types/index.d.ts +4 -2
- 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/ChatPreview/types/types.d.cts +1 -1
- package/dist/ChatPreview/types/types.d.ts +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 +1 -1
- package/dist/ChatPreviewComparison/components/Headline.js +1 -1
- package/dist/ChatPreviewComparison/components/Layout.cjs +3 -3
- package/dist/ChatPreviewComparison/components/Layout.js +3 -3
- package/dist/ChatPreviewComparison/components/Message.cjs +1 -1
- package/dist/ChatPreviewComparison/components/Message.js +1 -1
- package/dist/ChatPreviewComparison/types/types.d.cts +1 -1
- package/dist/ChatPreviewComparison/types/types.d.ts +1 -1
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.cts +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.ts +2 -2
- package/dist/Container/Container.d.cts +174 -174
- package/dist/Container/Container.d.ts +174 -174
- package/dist/DesignTokens/DesignTokensComponent.d.cts +2 -2
- package/dist/DesignTokens/DesignTokensComponent.d.ts +2 -2
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.cts +2 -2
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.cjs +3 -2
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.js +2 -2
- package/dist/DocumentRetrievalCard/hooks/useGetBackgroundColorsProperties.cjs +1 -1
- package/dist/DocumentRetrievalCard/hooks/useGetBackgroundColorsProperties.js +1 -1
- package/dist/DocumentRetrievalCard/hooks/useGetBorderProperties.cjs +1 -1
- package/dist/DocumentRetrievalCard/hooks/useGetBorderProperties.js +1 -1
- package/dist/DocumentRetrievalCard/hooks/useGetBorderRadiusProperties.cjs +1 -1
- package/dist/DocumentRetrievalCard/hooks/useGetBorderRadiusProperties.js +1 -1
- package/dist/DocumentRetrievalCard/hooks/useGetIconBackgroundProperties.cjs +1 -1
- package/dist/DocumentRetrievalCard/hooks/useGetIconBackgroundProperties.js +1 -1
- package/dist/DocumentRetrievalCard/hooks/useGetIconColorProperties.cjs +1 -1
- package/dist/DocumentRetrievalCard/hooks/useGetIconColorProperties.js +1 -1
- package/dist/DocumentRetrievalCard/hooks/useGetLabelTextCaseProperties.cjs +1 -1
- package/dist/DocumentRetrievalCard/hooks/useGetLabelTextCaseProperties.js +1 -1
- package/dist/DocumentRetrievalCard/hooks/useGetLabelTypographyProperties.cjs +1 -1
- package/dist/DocumentRetrievalCard/hooks/useGetLabelTypographyProperties.js +1 -1
- package/dist/DocumentRetrievalCard/index.cjs +1 -1
- package/dist/DocumentRetrievalCard/index.d.cts +1 -1
- package/dist/DocumentRetrievalCard/index.d.ts +1 -1
- package/dist/DocumentRetrievalCard/index.js +1 -1
- package/dist/DocumentRetrievalCard/types/index.d.cts +1 -1
- package/dist/DocumentRetrievalCard/types/index.d.ts +1 -1
- package/dist/DocumentRetrievalCard/utils/functions.cjs +1 -1
- package/dist/DocumentRetrievalCard/utils/functions.js +1 -1
- package/dist/FloatingButton/FloatingButton.cjs +2 -1
- package/dist/FloatingButton/FloatingButton.d.cts +4 -3
- package/dist/FloatingButton/FloatingButton.d.ts +4 -3
- package/dist/FloatingButton/FloatingButton.js +2 -1
- package/dist/FloatingButton/components/Container.cjs +2 -2
- package/dist/FloatingButton/components/Container.js +2 -2
- package/dist/FloatingButton/components/Icon.cjs +3 -2
- package/dist/FloatingButton/components/Icon.js +2 -2
- package/dist/FloatingButton/hooks/useGetButtonProperties.cjs +1 -1
- package/dist/FloatingButton/hooks/useGetButtonProperties.js +1 -1
- package/dist/FloatingButton/hooks/useGetContainerProperties.cjs +2 -2
- package/dist/FloatingButton/hooks/useGetContainerProperties.js +2 -2
- package/dist/FloatingButton/types/types.cjs +4 -4
- package/dist/FloatingButton/types/types.d.cts +9 -5
- package/dist/FloatingButton/types/types.d.ts +9 -5
- package/dist/FloatingButton/types/types.js +4 -4
- package/dist/FloatingChat/FloatingChat.cjs +107 -40
- package/dist/FloatingChat/FloatingChat.d.cts +3 -2
- package/dist/FloatingChat/FloatingChat.d.ts +3 -2
- package/dist/FloatingChat/FloatingChat.js +109 -42
- package/dist/FloatingChat/components/AgentMessage.cjs +4 -3
- package/dist/FloatingChat/components/AgentMessage.js +4 -3
- package/dist/FloatingChat/components/ChatMessages.cjs +60 -42
- package/dist/FloatingChat/components/ChatMessages.js +59 -41
- package/dist/FloatingChat/components/Layout.cjs +3 -3
- package/dist/FloatingChat/components/Layout.js +3 -3
- package/dist/FloatingChat/components/ModalSheet.cjs +184 -0
- package/dist/FloatingChat/components/ModalSheet.js +182 -0
- package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.cjs +3 -2
- package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.js +3 -2
- package/dist/FloatingChat/components/ScrollToBottomButton.cjs +3 -2
- package/dist/FloatingChat/components/ScrollToBottomButton.js +2 -2
- package/dist/FloatingChat/components/index.cjs +1 -0
- package/dist/FloatingChat/components/index.js +1 -0
- package/dist/FloatingChat/hooks/useChatSuggestions.cjs +25 -0
- package/dist/FloatingChat/hooks/useChatSuggestions.js +24 -0
- package/dist/FloatingChat/hooks/useFilteredChatMessages.cjs +24 -0
- package/dist/FloatingChat/hooks/useFilteredChatMessages.js +23 -0
- package/dist/FloatingChat/hooks/usePreventScroll.cjs +117 -0
- package/dist/FloatingChat/hooks/usePreventScroll.js +116 -0
- package/dist/FloatingChat/hooks/useSnapCalculator.cjs +37 -0
- package/dist/FloatingChat/hooks/useSnapCalculator.js +35 -0
- package/dist/FloatingChat/hooks/useSnapControl.cjs +82 -0
- package/dist/FloatingChat/hooks/useSnapControl.js +81 -0
- package/dist/FloatingChat/hooks/useSnapSetup.cjs +59 -0
- package/dist/FloatingChat/hooks/useSnapSetup.js +58 -0
- package/dist/FloatingChat/types/types.d.cts +7 -3
- package/dist/FloatingChat/types/types.d.ts +7 -4
- package/dist/Image/Image.d.cts +2 -2
- package/dist/Image/Image.d.ts +2 -2
- package/dist/ImageGallery/ImageGallery.cjs +1 -1
- package/dist/ImageGallery/ImageGallery.d.cts +2 -2
- package/dist/ImageGallery/ImageGallery.d.ts +2 -2
- package/dist/ImageGallery/ImageGallery.js +1 -1
- package/dist/ImageGallery/components/Layout.cjs +1 -1
- package/dist/ImageGallery/components/Layout.js +1 -1
- package/dist/ImageGallery/types/types.d.cts +1 -1
- package/dist/ImageGallery/types/types.d.ts +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/LinkButton.cjs +3 -2
- package/dist/Message/components/LinkButton.js +2 -2
- package/dist/Message/hooks/useLatencyAnimation.cjs +19 -13
- package/dist/Message/hooks/useLatencyAnimation.js +13 -13
- package/dist/OrderLookupCard/OrderLookupCard.cjs +1 -1
- package/dist/OrderLookupCard/OrderLookupCard.js +1 -1
- package/dist/OrderLookupCard/hooks/useGetContainerProperties.cjs +1 -1
- package/dist/OrderLookupCard/hooks/useGetContainerProperties.js +1 -1
- package/dist/OrderLookupCard/hooks/useGetImageBorderRadiusProperties.cjs +1 -1
- package/dist/OrderLookupCard/hooks/useGetImageBorderRadiusProperties.js +1 -1
- package/dist/OrderLookupCard/hooks/useGetStatusLabelProperties.cjs +1 -1
- package/dist/OrderLookupCard/hooks/useGetStatusLabelProperties.js +1 -1
- package/dist/OrderLookupCard/hooks/useGetTrackOrderLinkProperties.cjs +1 -1
- package/dist/OrderLookupCard/hooks/useGetTrackOrderLinkProperties.js +1 -1
- package/dist/OrderLookupCard/types/index.d.cts +1 -1
- package/dist/OrderLookupCard/types/index.d.ts +1 -1
- package/dist/PromptButton/PromptButton.cjs +4 -3
- package/dist/PromptButton/PromptButton.d.cts +2 -2
- package/dist/PromptButton/PromptButton.d.ts +2 -2
- package/dist/PromptButton/PromptButton.js +3 -3
- package/dist/PromptButton/hooks/useGetIconColorsProperties.cjs +1 -1
- package/dist/PromptButton/hooks/useGetIconColorsProperties.js +1 -1
- package/dist/PromptButton/types/index.d.cts +1 -1
- package/dist/PromptButton/types/index.d.ts +1 -1
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.cjs +1 -1
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.cts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.ts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.js +1 -1
- package/dist/PromptButtonCarouselWithImage/types/types.d.cts +1 -1
- package/dist/PromptButtonCarouselWithImage/types/types.d.ts +1 -1
- package/dist/PromptCarousel/PromptCarousel.cjs +1 -2
- package/dist/PromptCarousel/PromptCarousel.d.cts +2 -2
- package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
- package/dist/PromptCarousel/PromptCarousel.js +1 -2
- package/dist/PromptCarousel/types/types.d.cts +1 -1
- package/dist/PromptCarousel/types/types.d.ts +1 -1
- package/dist/ReviewCard/ReviewCard.cjs +1 -1
- package/dist/ReviewCard/ReviewCard.d.cts +2 -2
- package/dist/ReviewCard/ReviewCard.d.ts +2 -2
- package/dist/ReviewCard/ReviewCard.js +1 -1
- package/dist/ReviewCard/components/Container.d.cts +1 -1
- package/dist/ReviewCard/components/Container.d.ts +1 -1
- package/dist/ReviewCard/components/Rating.d.cts +1 -1
- package/dist/ReviewCard/components/Rating.d.ts +1 -1
- package/dist/ReviewCard/components/ReadMoreButton.cjs +4 -3
- package/dist/ReviewCard/components/ReadMoreButton.d.cts +1 -1
- package/dist/ReviewCard/components/ReadMoreButton.d.ts +1 -1
- package/dist/ReviewCard/components/ReadMoreButton.js +3 -3
- package/dist/ReviewCard/components/StarIcon.cjs +3 -2
- package/dist/ReviewCard/components/StarIcon.js +2 -2
- package/dist/ReviewCard/components/VerifiedBuyer.cjs +3 -2
- package/dist/ReviewCard/components/VerifiedBuyer.js +2 -2
- package/dist/ReviewCard/components/index.d.cts +7 -7
- package/dist/ReviewCard/components/index.d.ts +7 -7
- package/dist/ReviewCard/hooks/useGetBackgroundColorsProperties.cjs +1 -1
- package/dist/ReviewCard/hooks/useGetBackgroundColorsProperties.js +1 -1
- package/dist/ReviewCard/hooks/useGetBorderProperties.cjs +1 -1
- package/dist/ReviewCard/hooks/useGetBorderProperties.js +1 -1
- package/dist/ReviewCard/hooks/useGetBorderRadiusProperties.cjs +1 -1
- package/dist/ReviewCard/hooks/useGetBorderRadiusProperties.js +1 -1
- package/dist/ReviewCard/hooks/useGetRatingBackgroundProperties.cjs +1 -1
- package/dist/ReviewCard/hooks/useGetRatingBackgroundProperties.js +1 -1
- package/dist/ReviewCard/hooks/useGetReadMoreTypographyProperties.cjs +1 -1
- package/dist/ReviewCard/hooks/useGetReadMoreTypographyProperties.js +1 -1
- package/dist/ReviewCard/hooks/useGetStarIconProperties.cjs +1 -1
- package/dist/ReviewCard/hooks/useGetStarIconProperties.js +1 -1
- package/dist/ReviewCard/types/types.d.cts +1 -1
- package/dist/ReviewCard/types/types.d.ts +1 -1
- package/dist/SalesAgentProductCard/SalesAgentProductCard.cjs +1 -1
- package/dist/SalesAgentProductCard/SalesAgentProductCard.d.cts +2 -2
- package/dist/SalesAgentProductCard/SalesAgentProductCard.d.ts +2 -2
- package/dist/SalesAgentProductCard/SalesAgentProductCard.js +1 -1
- package/dist/SalesAgentProductCard/components/Container.cjs +1 -1
- package/dist/SalesAgentProductCard/components/Container.d.cts +1 -1
- package/dist/SalesAgentProductCard/components/Container.d.ts +1 -1
- package/dist/SalesAgentProductCard/components/Container.js +1 -1
- package/dist/SalesAgentProductCard/components/ProductName.cjs +1 -1
- package/dist/SalesAgentProductCard/components/ProductName.d.cts +1 -1
- package/dist/SalesAgentProductCard/components/ProductName.d.ts +1 -1
- package/dist/SalesAgentProductCard/components/ProductName.js +1 -1
- package/dist/SalesAgentProductCard/components/Rate.cjs +1 -1
- package/dist/SalesAgentProductCard/components/Rate.d.cts +1 -1
- package/dist/SalesAgentProductCard/components/Rate.d.ts +1 -1
- package/dist/SalesAgentProductCard/components/Rate.js +1 -1
- package/dist/SalesAgentProductCard/components/StarIcon.cjs +3 -2
- package/dist/SalesAgentProductCard/components/StarIcon.js +2 -2
- package/dist/SalesAgentProductCard/components/index.d.cts +9 -9
- package/dist/SalesAgentProductCard/components/index.d.ts +9 -9
- package/dist/SalesAgentProductCard/hooks/useGetContainerProperties.cjs +1 -1
- package/dist/SalesAgentProductCard/hooks/useGetContainerProperties.js +1 -1
- package/dist/SalesAgentProductCard/hooks/useGetProductDescriptionProperties.cjs +1 -1
- package/dist/SalesAgentProductCard/hooks/useGetProductDescriptionProperties.js +1 -1
- package/dist/SalesAgentProductCard/hooks/useGetProductNameProperties.cjs +1 -1
- package/dist/SalesAgentProductCard/hooks/useGetProductNameProperties.js +1 -1
- package/dist/SalesAgentProductCard/hooks/useGetStarIconProperties.cjs +1 -1
- package/dist/SalesAgentProductCard/hooks/useGetStarIconProperties.js +1 -1
- package/dist/SalesAgentProductCard/types/types.d.cts +1 -1
- package/dist/SalesAgentProductCard/types/types.d.ts +1 -1
- package/dist/SocialProof/SocialProof.cjs +10 -3
- package/dist/SocialProof/SocialProof.d.cts +2 -2
- package/dist/SocialProof/SocialProof.d.ts +2 -2
- package/dist/SocialProof/SocialProof.js +10 -3
- package/dist/SocialProof/components/Headline.cjs +1 -1
- package/dist/SocialProof/components/Headline.js +1 -1
- package/dist/SocialProof/components/LayoutFourHorizontal.cjs +1 -1
- package/dist/SocialProof/components/LayoutFourHorizontal.js +1 -1
- package/dist/SocialProof/components/Subheadline.cjs +1 -1
- package/dist/SocialProof/components/Subheadline.js +1 -1
- package/dist/SocialProof/components/Textfield.cjs +1 -1
- package/dist/SocialProof/components/Textfield.js +1 -1
- package/dist/SocialProof/hooks/index.cjs +1 -0
- package/dist/SocialProof/hooks/index.js +3 -0
- package/dist/SocialProof/hooks/useSocialProofCount.cjs +48 -0
- package/dist/SocialProof/hooks/useSocialProofCount.d.cts +15 -0
- package/dist/SocialProof/hooks/useSocialProofCount.d.ts +15 -0
- package/dist/SocialProof/hooks/useSocialProofCount.js +46 -0
- package/dist/SocialProof/index.cjs +5 -1
- package/dist/SocialProof/index.d.cts +3 -2
- package/dist/SocialProof/index.d.ts +3 -2
- package/dist/SocialProof/index.js +4 -2
- package/dist/SocialProof/types/types.cjs +8 -1
- package/dist/SocialProof/types/types.d.cts +17 -7
- package/dist/SocialProof/types/types.d.ts +17 -7
- package/dist/SocialProof/types/types.js +7 -1
- package/dist/SocialProof/utils/functions.cjs +1 -1
- package/dist/SocialProof/utils/functions.js +1 -1
- package/dist/Stack/Stack.d.cts +2 -2
- package/dist/Stack/Stack.d.ts +2 -2
- package/dist/TextField/TextField.cjs +1 -1
- package/dist/TextField/TextField.js +1 -1
- package/dist/TextField/hooks/useGetContainerProperties.cjs +1 -1
- package/dist/TextField/hooks/useGetContainerProperties.js +1 -1
- package/dist/TextField/types/index.d.cts +1 -1
- package/dist/TextField/types/index.d.ts +1 -1
- package/dist/TextField/utils/getInputClasses.cjs +1 -1
- package/dist/TextField/utils/getInputClasses.js +1 -1
- package/dist/TextField/utils/getSendIconElement.cjs +13 -9
- package/dist/TextField/utils/getSendIconElement.js +9 -9
- 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/TitledPromptCarousel/types/index.d.cts +1 -1
- package/dist/TitledPromptCarousel/types/index.d.ts +1 -1
- package/dist/Tokens/index.cjs +13 -13
- package/dist/Tokens/index.d.cts +13 -13
- package/dist/Tokens/index.d.ts +13 -13
- package/dist/Tokens/index.js +13 -13
- 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/TypingAnimation/types/index.d.cts +1 -1
- package/dist/TypingAnimation/types/index.d.ts +1 -1
- package/dist/Typography/Typography.d.cts +4 -4
- package/dist/Typography/Typography.d.ts +4 -4
- package/dist/WelcomeMessage/WelcomeMessage.cjs +1 -1
- package/dist/WelcomeMessage/WelcomeMessage.js +1 -1
- package/dist/WelcomeMessage/components/SparkleIcon.cjs +3 -2
- package/dist/WelcomeMessage/components/SparkleIcon.js +2 -2
- package/dist/WelcomeMessage/hooks/useGetContainerProperties.cjs +1 -1
- package/dist/WelcomeMessage/hooks/useGetContainerProperties.js +1 -1
- package/dist/WelcomeMessage/types/types.cjs +1 -1
- package/dist/WelcomeMessage/types/types.d.cts +1 -1
- package/dist/WelcomeMessage/types/types.d.ts +1 -1
- package/dist/WelcomeMessage/types/types.js +1 -1
- package/dist/WidgetTextField/WidgetTextField.cjs +1 -1
- 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/Icon.cjs +11 -8
- package/dist/WidgetTextField/components/Icon.js +8 -8
- package/dist/WidgetTextField/components/Skeleton.cjs +1 -1
- package/dist/WidgetTextField/components/Skeleton.js +1 -1
- package/dist/WidgetTextField/hooks/useGetContainerProperties.cjs +1 -1
- package/dist/WidgetTextField/hooks/useGetContainerProperties.js +1 -1
- package/dist/WidgetTextField/types/types.d.cts +1 -1
- package/dist/WidgetTextField/types/types.d.ts +1 -1
- package/dist/WidgetWrapper/WidgetWrapper.d.cts +2 -2
- package/dist/WidgetWrapper/WidgetWrapper.d.ts +2 -2
- package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.ts +2 -2
- package/dist/styles.css +1 -1
- package/dist/utils/resolveTheme.cjs +1 -1
- package/dist/utils/resolveTheme.js +1 -1
- package/dist/utils/useCheckIsMobile.cjs +1 -1
- package/dist/utils/useCheckIsMobile.js +1 -1
- package/dist/utils/useResponsiveValue.cjs +1 -1
- package/dist/utils/useResponsiveValue.d.cts +1 -1
- package/dist/utils/useResponsiveValue.d.ts +1 -1
- package/dist/utils/useResponsiveValue.js +1 -1
- package/package.json +1 -1
- package/src/components/ChatFooter/hooks/useGetContainerProperties.ts +2 -2
- package/src/components/ChatHeader/ChatHeader.tsx +2 -0
- package/src/components/ChatHeader/components/Handle.tsx +29 -1
- package/src/components/ChatHeader/types/index.ts +3 -0
- package/src/components/FloatingButton/FloatingButton.tsx +2 -0
- package/src/components/FloatingButton/components/Container.tsx +3 -0
- package/src/components/FloatingButton/hooks/useGetContainerProperties.ts +2 -1
- package/src/components/FloatingButton/types/types.ts +9 -4
- package/src/components/FloatingChat/FloatingChat.tsx +160 -59
- package/src/components/FloatingChat/components/AgentMessage.tsx +3 -0
- package/src/components/FloatingChat/components/ChatMessages.tsx +25 -0
- package/src/components/FloatingChat/components/Layout.tsx +2 -2
- package/src/components/FloatingChat/components/ModalSheet.tsx +288 -0
- package/src/components/FloatingChat/components/SalesAgentProductCardsCarousel.tsx +7 -2
- package/src/components/FloatingChat/components/index.ts +3 -0
- package/src/components/FloatingChat/hooks/useChatSuggestions.ts +49 -0
- package/src/components/FloatingChat/hooks/useFilteredChatMessages.ts +43 -0
- package/src/components/FloatingChat/hooks/usePreventScroll.ts +207 -0
- package/src/components/FloatingChat/hooks/useSnapCalculator.ts +41 -0
- package/src/components/FloatingChat/hooks/useSnapControl.ts +131 -0
- package/src/components/FloatingChat/hooks/useSnapSetup.ts +106 -0
- package/src/components/FloatingChat/types/types.ts +4 -0
- package/src/components/PromptCarousel/PromptCarousel.tsx +0 -1
- package/src/components/SocialProof/SocialProof.tsx +8 -2
- package/src/components/SocialProof/__tests__/SocialProof.test.tsx +66 -17
- package/src/components/SocialProof/hooks/index.ts +2 -0
- package/src/components/SocialProof/hooks/useSocialProofCount.ts +67 -0
- package/src/components/SocialProof/index.ts +2 -1
- package/src/components/SocialProof/types/types.ts +18 -6
- package/dist/hooks/dist/application/models/api/response.d.cts +0 -63
- package/dist/hooks/dist/application/models/api/response.d.ts +0 -63
- package/dist/hooks/dist/application/models/api/responseGenerics.d.cts +0 -41
- package/dist/hooks/dist/application/models/api/responseGenerics.d.ts +0 -41
- package/dist/hooks/dist/application/models/api/suggestion.d.cts +0 -10
- package/dist/hooks/dist/application/models/api/suggestion.d.ts +0 -10
- package/dist/hooks/dist/application/models/api/userEvent.d.cts +0 -60
- package/dist/hooks/dist/application/models/api/userEvent.d.ts +0 -60
- package/dist/hooks/dist/application/models/message.d.cts +0 -108
- package/dist/hooks/dist/application/models/message.d.ts +0 -108
- package/dist/hooks/dist/application/models/utilityTypes/camelCase.d.cts +0 -71
- package/dist/hooks/dist/application/models/utilityTypes/camelCase.d.ts +0 -71
- package/dist/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.cts +0 -58
- package/dist/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts +0 -58
- package/dist/hooks/dist/application/models/utilityTypes/internal.d.cts +0 -22
- package/dist/hooks/dist/application/models/utilityTypes/internal.d.ts +0 -22
- package/dist/hooks/dist/application/models/utilityTypes/splitWords.d.cts +0 -31
- package/dist/hooks/dist/application/models/utilityTypes/splitWords.d.ts +0 -31
- package/dist/hooks/dist/application/models/utilityTypes/trim.d.cts +0 -30
- package/dist/hooks/dist/application/models/utilityTypes/trim.d.ts +0 -30
- package/dist/hooks/dist/application/models/utilityTypes/unknownArray.d.cts +0 -30
- package/dist/hooks/dist/application/models/utilityTypes/unknownArray.d.ts +0 -30
- package/dist/hooks/dist/contexts/salesAgentContext/chatAPI.d.cts +0 -23
- package/dist/hooks/dist/contexts/salesAgentContext/chatAPI.d.ts +0 -23
- package/dist/hooks/dist/contexts/salesAgentContext/index.d.ts +0 -3
- package/dist/hooks/dist/contexts/salesAgentContext/salesAgentContext.d.cts +0 -18
- package/dist/hooks/dist/contexts/salesAgentContext/salesAgentContext.d.ts +0 -18
- package/dist/hooks/dist/contexts/typesV3.d.cts +0 -81
- package/dist/hooks/dist/contexts/typesV3.d.ts +0 -81
- package/dist/icons/dist/ArrowUp.cjs +0 -28
- package/dist/icons/dist/ArrowUp.js +0 -28
- package/dist/icons/dist/Checkmark.cjs +0 -31
- package/dist/icons/dist/Checkmark.js +0 -31
- package/dist/icons/dist/ChevronDown.cjs +0 -23
- package/dist/icons/dist/ChevronDown.js +0 -23
- package/dist/icons/dist/Document.cjs +0 -18
- package/dist/icons/dist/Document.js +0 -18
- package/dist/icons/dist/EnviveWatermark.cjs +0 -39
- package/dist/icons/dist/EnviveWatermark.js +0 -39
- package/dist/icons/dist/FourPointStar.cjs +0 -22
- package/dist/icons/dist/FourPointStar.js +0 -22
- package/dist/icons/dist/IconCloseRounded.cjs +0 -21
- package/dist/icons/dist/IconCloseRounded.js +0 -21
- package/dist/icons/dist/IconCloseSharp.cjs +0 -30
- package/dist/icons/dist/IconCloseSharp.js +0 -30
- package/dist/icons/dist/IconCloseTransparent.cjs +0 -23
- package/dist/icons/dist/IconCloseTransparent.js +0 -23
- package/dist/icons/dist/LatencyIconEmptyStep.cjs +0 -17
- package/dist/icons/dist/LatencyIconEmptyStep.js +0 -17
- package/dist/icons/dist/LatencyIconStep1.cjs +0 -43
- package/dist/icons/dist/LatencyIconStep1.js +0 -43
- package/dist/icons/dist/LatencyIconStep2.cjs +0 -32
- package/dist/icons/dist/LatencyIconStep2.js +0 -32
- package/dist/icons/dist/LatencyIconStep3.cjs +0 -25
- package/dist/icons/dist/LatencyIconStep3.js +0 -25
- package/dist/icons/dist/LatencyIconStep4.cjs +0 -25
- package/dist/icons/dist/LatencyIconStep4.js +0 -25
- package/dist/icons/dist/LatencyIconStep5.cjs +0 -32
- package/dist/icons/dist/LatencyIconStep5.js +0 -32
- package/dist/icons/dist/Send.cjs +0 -21
- package/dist/icons/dist/Send.js +0 -21
- package/dist/icons/dist/SendMinimalist.cjs +0 -34
- package/dist/icons/dist/SendMinimalist.js +0 -34
- package/dist/icons/dist/SendModern.cjs +0 -43
- package/dist/icons/dist/SendModern.js +0 -43
- package/dist/icons/dist/SendStandard.cjs +0 -21
- package/dist/icons/dist/SendStandard.js +0 -21
- package/dist/icons/dist/Sparkles.cjs +0 -43
- package/dist/icons/dist/Sparkles.js +0 -43
- package/dist/icons/dist/Star.cjs +0 -23
- package/dist/icons/dist/Star.js +0 -23
- package/dist/icons/dist/VectorUpRight.cjs +0 -17
- package/dist/icons/dist/VectorUpRight.js +0 -17
- package/dist/icons/dist/_virtual/rolldown_runtime.cjs +0 -27
- package/dist/icons/dist/_virtual/rolldown_runtime.js +0 -25
- package/dist/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs +0 -696
- package/dist/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.js +0 -696
- package/dist/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.cjs +0 -43
- package/dist/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -43
- package/dist/icons/dist/node_modules/react/cjs/react.development.cjs +0 -1528
- package/dist/icons/dist/node_modules/react/cjs/react.development.js +0 -1528
- package/dist/icons/dist/node_modules/react/cjs/react.production.min.cjs +0 -329
- package/dist/icons/dist/node_modules/react/cjs/react.production.min.js +0 -329
- package/dist/icons/dist/node_modules/react/index.cjs +0 -13
- package/dist/icons/dist/node_modules/react/index.js +0 -13
- package/dist/icons/dist/node_modules/react/jsx-runtime.cjs +0 -13
- package/dist/icons/dist/node_modules/react/jsx-runtime.js +0 -13
- /package/dist/{components-v3/src → src}/models/colorsConfig.cjs +0 -0
- /package/dist/{components-v3/src → src}/models/colorsConfig.d.cts +0 -0
- /package/dist/{components-v3/src → src}/models/colorsConfig.d.ts +0 -0
- /package/dist/{components-v3/src → src}/models/colorsConfig.js +0 -0
- /package/dist/{components-v3/tokens → tokens}/aspectRatio/aspectRatio.cjs +0 -0
- /package/dist/{components-v3/tokens → tokens}/aspectRatio/aspectRatio.d.cts +0 -0
- /package/dist/{components-v3/tokens → tokens}/aspectRatio/aspectRatio.d.ts +0 -0
- /package/dist/{components-v3/tokens → tokens}/aspectRatio/aspectRatio.js +0 -0
- /package/dist/{components-v3/tokens → tokens}/breakpoints/breakpoints.cjs +0 -0
- /package/dist/{components-v3/tokens → tokens}/breakpoints/breakpoints.d.cts +0 -0
- /package/dist/{components-v3/tokens → tokens}/breakpoints/breakpoints.d.ts +0 -0
- /package/dist/{components-v3/tokens → tokens}/breakpoints/breakpoints.js +0 -0
- /package/dist/{components-v3/tokens → tokens}/colors/colors.cjs +0 -0
- /package/dist/{components-v3/tokens → tokens}/colors/colors.d.cts +0 -0
- /package/dist/{components-v3/tokens → tokens}/colors/colors.d.ts +0 -0
- /package/dist/{components-v3/tokens → tokens}/colors/colors.js +0 -0
- /package/dist/{components-v3/tokens → tokens}/montion/motion.cjs +0 -0
- /package/dist/{components-v3/tokens → tokens}/montion/motion.d.cts +0 -0
- /package/dist/{components-v3/tokens → tokens}/montion/motion.d.ts +0 -0
- /package/dist/{components-v3/tokens → tokens}/montion/motion.js +0 -0
- /package/dist/{components-v3/tokens → tokens}/radius/radius.cjs +0 -0
- /package/dist/{components-v3/tokens → tokens}/radius/radius.d.cts +0 -0
- /package/dist/{components-v3/tokens → tokens}/radius/radius.d.ts +0 -0
- /package/dist/{components-v3/tokens → tokens}/radius/radius.js +0 -0
- /package/dist/{components-v3/tokens → tokens}/spacing/spacing.cjs +0 -0
- /package/dist/{components-v3/tokens → tokens}/spacing/spacing.d.cts +0 -0
- /package/dist/{components-v3/tokens → tokens}/spacing/spacing.d.ts +0 -0
- /package/dist/{components-v3/tokens → tokens}/spacing/spacing.js +0 -0
- /package/dist/{components-v3/tokens → tokens}/theme/theme.cjs +0 -0
- /package/dist/{components-v3/tokens → tokens}/theme/theme.d.cts +0 -0
- /package/dist/{components-v3/tokens → tokens}/theme/theme.d.ts +0 -0
- /package/dist/{components-v3/tokens → tokens}/theme/theme.js +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/fontFamily.cjs +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/fontFamily.d.cts +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/fontFamily.d.ts +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/fontFamily.js +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/fontSize.cjs +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/fontSize.d.cts +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/fontSize.d.ts +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/fontSize.js +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/fontWeight.cjs +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/fontWeight.d.cts +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/fontWeight.d.ts +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/fontWeight.js +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/letterSpacing.cjs +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/letterSpacing.d.cts +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/letterSpacing.d.ts +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/letterSpacing.js +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/lineHeight.cjs +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/lineHeight.d.cts +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/lineHeight.d.ts +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/lineHeight.js +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/typography.cjs +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/typography.d.cts +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/typography.d.ts +0 -0
- /package/dist/{components-v3/tokens → tokens}/typography/typography.js +0 -0
- /package/dist/{components-v3/tokens → tokens}/utils.cjs +0 -0
- /package/dist/{components-v3/tokens → tokens}/utils.js +0 -0
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { Theme } from "../
|
|
2
|
-
import { Stack } from "../Stack/Stack.js";
|
|
3
|
-
import "../Stack/index.js";
|
|
1
|
+
import { Theme } from "../tokens/theme/theme.js";
|
|
4
2
|
import { resolveTheme } from "../utils/resolveTheme.js";
|
|
5
3
|
import { PromptButtonVariant } from "../PromptButton/types/index.js";
|
|
6
4
|
import "../PromptButton/index.js";
|
|
@@ -9,32 +7,34 @@ import { PromptCarousel } from "../PromptCarousel/PromptCarousel.js";
|
|
|
9
7
|
import "../PromptCarousel/index.js";
|
|
10
8
|
import { ChatFooter } from "../ChatFooter/ChatFooter.js";
|
|
11
9
|
import "../ChatFooter/index.js";
|
|
12
|
-
import { ChatHeaderOptions } from "../ChatHeader/types/index.js";
|
|
10
|
+
import { ChatHeaderOptions, HandleState } from "../ChatHeader/types/index.js";
|
|
13
11
|
import { ChatHeader } from "../ChatHeader/ChatHeader.js";
|
|
14
12
|
import "../ChatHeader/index.js";
|
|
13
|
+
import { Unit } from "./hooks/useSnapCalculator.js";
|
|
14
|
+
import { ModalSheet } from "./components/ModalSheet.js";
|
|
15
15
|
import { FloatingChatComponents } from "./components/index.js";
|
|
16
16
|
import { useScrollToBottom } from "./hooks/useScrollToBottom.js";
|
|
17
|
+
import { useSnapSetup } from "./hooks/useSnapSetup.js";
|
|
18
|
+
import { useChatSuggestions } from "./hooks/useChatSuggestions.js";
|
|
17
19
|
import { WelcomeMessage } from "../WelcomeMessage/WelcomeMessage.js";
|
|
18
|
-
import {
|
|
20
|
+
import { useFilteredChatMessages } from "./hooks/useFilteredChatMessages.js";
|
|
21
|
+
import { useRef, useState } from "react";
|
|
19
22
|
import { jsx } from "react/jsx-runtime";
|
|
23
|
+
import { motion } from "framer-motion";
|
|
20
24
|
|
|
21
25
|
//#region src/components/FloatingChat/FloatingChat.tsx
|
|
22
|
-
const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTOM, salesAgentData, floatingChatConfig, lookAndFeelConfig, isCXButtonSwitchEnabled, onClose, onToggleCXButton }) => {
|
|
26
|
+
const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTOM, salesAgentData, floatingChatConfig, lookAndFeelConfig, isCXButtonSwitchEnabled, isFloatingChatOpen, onClose, onToggleCXButton }) => {
|
|
23
27
|
const finalTheme = resolveTheme(theme);
|
|
24
28
|
const [query, setQuery] = useState("");
|
|
25
29
|
const chatMessagesRef = useRef(null);
|
|
26
|
-
const { headerBackgroundColor, headerMode, welcomeMessageIconColor, showVerifiedBuyer, userQueryInputEnabled, showEnviveLogo, ignoreFirstModelResponse, neverShowSingleProductCards, welcomeMessageTitle, welcomeMessageText, chatFooterTextFieldPlaceholderText } = floatingChatConfig;
|
|
30
|
+
const { headerBackgroundColor, headerMode, welcomeMessageIconColor, showVerifiedBuyer, userQueryInputEnabled = true, showEnviveLogo, ignoreFirstModelResponse, neverShowSingleProductCards, welcomeMessageTitle, welcomeMessageText, chatFooterTextFieldPlaceholderText } = floatingChatConfig;
|
|
27
31
|
const { agentName, chatHeaderLogoDarkSrc, chatHeaderLogoLightSrc } = lookAndFeelConfig;
|
|
28
32
|
const { messages, isResponseStreaming, isPendingResponse, suggestions, onSuggestionClicked, onTypedMessageSubmitted } = salesAgentData;
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
setAnswerSuggestions(suggestions.filter((suggestion) => suggestion.isAnswer).map((suggestion) => suggestion.content));
|
|
35
|
-
setGeneralSuggestions(suggestions.filter((suggestion) => !suggestion.isAnswer).map((suggestion) => suggestion.content));
|
|
36
|
-
}
|
|
37
|
-
}, [suggestions]);
|
|
33
|
+
const { answerSuggestions, generalSuggestions, showAnswerSuggestions, setAnswerSuggestions, setGeneralSuggestions } = useChatSuggestions({
|
|
34
|
+
suggestions,
|
|
35
|
+
isPendingResponse,
|
|
36
|
+
isResponseStreaming
|
|
37
|
+
});
|
|
38
38
|
const handleToggleCXButton = (item) => {
|
|
39
39
|
if (item === ChatHeaderOptions.LIVE_SUPPORT) {
|
|
40
40
|
onToggleCXButton?.();
|
|
@@ -52,6 +52,13 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
|
|
|
52
52
|
],
|
|
53
53
|
scrollThreshold: 30
|
|
54
54
|
});
|
|
55
|
+
const { modalSheetControl, maxSwipeableViewHeight, isOpen, isMobile, snaps, initialSnap, shouldAutoExpand, currentSnapPercentage, handleSnapChange, animationKey, mobileHeaderHeight, shouldShowHeader, shouldShowScrolled, isFullView, isPartialView } = useSnapSetup({ isFloatingChatOpen });
|
|
56
|
+
const { filteredMessages, hasFilteredMessages, handlePreviousDiscussions } = useFilteredChatMessages({
|
|
57
|
+
messages,
|
|
58
|
+
isMobile,
|
|
59
|
+
currentSnapPercentage,
|
|
60
|
+
modalSheetControl
|
|
61
|
+
});
|
|
55
62
|
const header = /* @__PURE__ */ jsx(ChatHeader, {
|
|
56
63
|
logoDark: chatHeaderLogoDarkSrc,
|
|
57
64
|
logoLight: chatHeaderLogoLightSrc,
|
|
@@ -66,32 +73,62 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
|
|
|
66
73
|
variant: headerMode,
|
|
67
74
|
headerBgColor: headerBackgroundColor
|
|
68
75
|
});
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
76
|
+
const mobileHeader = /* @__PURE__ */ jsx(motion.div, {
|
|
77
|
+
style: {
|
|
78
|
+
maxHeight: mobileHeaderHeight,
|
|
79
|
+
overflow: "hidden"
|
|
80
|
+
},
|
|
81
|
+
children: /* @__PURE__ */ jsx(ChatHeader, {
|
|
82
|
+
logoDark: chatHeaderLogoDarkSrc,
|
|
83
|
+
logoLight: chatHeaderLogoLightSrc,
|
|
73
84
|
theme: finalTheme,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
promptSuggestions: isPendingResponse || isResponseStreaming || generalSuggestions.length === 0 ? ["Loading suggestions 1...", "Loading suggestions 2..."] : generalSuggestions,
|
|
83
|
-
handleButtonClick: (buttonText) => {
|
|
84
|
-
const suggestion = suggestions.find((s) => s.content === buttonText && !s.isAnswer);
|
|
85
|
-
if (suggestion) onSuggestionClicked(suggestion);
|
|
86
|
-
setAnswerSuggestions([]);
|
|
87
|
-
setGeneralSuggestions([]);
|
|
88
|
-
},
|
|
89
|
-
disabled: isPendingResponse || isResponseStreaming,
|
|
90
|
-
disabledInput: !userQueryInputEnabled,
|
|
91
|
-
isLoadingPromptSuggestions: isPendingResponse || isResponseStreaming || generalSuggestions.length === 0,
|
|
92
|
-
hideEnviveWatermark: !showEnviveLogo
|
|
85
|
+
variant: headerMode,
|
|
86
|
+
headerBgColor: headerBackgroundColor,
|
|
87
|
+
showLogo: true,
|
|
88
|
+
showCXToggle: isCXButtonSwitchEnabled,
|
|
89
|
+
centralizeCXToggle: true,
|
|
90
|
+
selectedOption: ChatHeaderOptions.ASSISTANT,
|
|
91
|
+
onToggle: handleToggleCXButton,
|
|
92
|
+
onClose
|
|
93
93
|
})
|
|
94
94
|
});
|
|
95
|
+
const handler = /* @__PURE__ */ jsx(ChatHeader, {
|
|
96
|
+
theme: finalTheme,
|
|
97
|
+
variant: headerMode,
|
|
98
|
+
headerBgColor: headerBackgroundColor,
|
|
99
|
+
showHandle: true,
|
|
100
|
+
handleState: isFullView ? HandleState.OPEN : HandleState.CLOSED,
|
|
101
|
+
handleAnimationKey: animationKey,
|
|
102
|
+
showMainContent: false,
|
|
103
|
+
selectedOption: ChatHeaderOptions.ASSISTANT,
|
|
104
|
+
onToggle: handleToggleCXButton,
|
|
105
|
+
onClose
|
|
106
|
+
});
|
|
107
|
+
const footer = /* @__PURE__ */ jsx(ChatFooter, {
|
|
108
|
+
theme: finalTheme,
|
|
109
|
+
isScrolled: isMobile ? shouldShowScrolled : false,
|
|
110
|
+
onChange: setQuery,
|
|
111
|
+
onSubmit: () => {
|
|
112
|
+
onTypedMessageSubmitted({
|
|
113
|
+
query,
|
|
114
|
+
userTyped: true
|
|
115
|
+
});
|
|
116
|
+
setAnswerSuggestions([]);
|
|
117
|
+
setGeneralSuggestions([]);
|
|
118
|
+
},
|
|
119
|
+
textFieldPlaceholderText: chatFooterTextFieldPlaceholderText,
|
|
120
|
+
promptSuggestions: isPendingResponse || isResponseStreaming || generalSuggestions.length === 0 ? ["Loading suggestions 1...", "Loading suggestions 2..."] : generalSuggestions,
|
|
121
|
+
handleButtonClick: (buttonText) => {
|
|
122
|
+
const suggestion = suggestions.find((s) => s.content === buttonText && !s.isAnswer);
|
|
123
|
+
if (suggestion) onSuggestionClicked(suggestion);
|
|
124
|
+
setAnswerSuggestions([]);
|
|
125
|
+
setGeneralSuggestions([]);
|
|
126
|
+
},
|
|
127
|
+
disabled: isPendingResponse || isResponseStreaming,
|
|
128
|
+
disabledInput: !userQueryInputEnabled,
|
|
129
|
+
isLoadingPromptSuggestions: isPendingResponse || isResponseStreaming || generalSuggestions.length === 0,
|
|
130
|
+
hideEnviveWatermark: !showEnviveLogo
|
|
131
|
+
});
|
|
95
132
|
const welcomeMessage = /* @__PURE__ */ jsx(WelcomeMessage, {
|
|
96
133
|
sparkleIconColor: welcomeMessageIconColor,
|
|
97
134
|
title: welcomeMessageTitle,
|
|
@@ -103,11 +140,14 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
|
|
|
103
140
|
ref: chatMessagesRef,
|
|
104
141
|
isLoading: isPendingResponse && !isResponseStreaming,
|
|
105
142
|
agentName,
|
|
106
|
-
messages,
|
|
143
|
+
messages: filteredMessages,
|
|
144
|
+
hasFilteredMessages,
|
|
145
|
+
handlePreviousDiscussions,
|
|
107
146
|
isResponseStreaming,
|
|
108
147
|
ignoreFirstModelResponse,
|
|
109
148
|
neverShowSingleProductCards,
|
|
110
|
-
showVerifiedBuyer
|
|
149
|
+
showVerifiedBuyer,
|
|
150
|
+
isPartialView
|
|
111
151
|
});
|
|
112
152
|
const answerSuggestionsComponent = /* @__PURE__ */ jsx(PromptCarousel, {
|
|
113
153
|
className: "envive-tw-flex envive-tw-justify-end envive-tw-p-4 [&>div>div]:envive-tw-items-end",
|
|
@@ -122,7 +162,7 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
|
|
|
122
162
|
setGeneralSuggestions([]);
|
|
123
163
|
}
|
|
124
164
|
});
|
|
125
|
-
|
|
165
|
+
const desktopLayout = /* @__PURE__ */ jsx(FloatingChatComponents.Layout, {
|
|
126
166
|
id,
|
|
127
167
|
className,
|
|
128
168
|
style,
|
|
@@ -135,6 +175,33 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
|
|
|
135
175
|
answerSuggestions: showAnswerSuggestions ? answerSuggestionsComponent : void 0,
|
|
136
176
|
scrollToBottomButton: showScrollButton ? /* @__PURE__ */ jsx(FloatingChatComponents.ScrollToBottomButton, { onClick: scrollToBottom }) : void 0
|
|
137
177
|
});
|
|
178
|
+
const mobileLayout = /* @__PURE__ */ jsx(FloatingChatComponents.Layout, {
|
|
179
|
+
id,
|
|
180
|
+
className,
|
|
181
|
+
style,
|
|
182
|
+
testId,
|
|
183
|
+
theme: finalTheme,
|
|
184
|
+
header: shouldShowHeader ? mobileHeader : void 0,
|
|
185
|
+
footer,
|
|
186
|
+
welcomeMessage,
|
|
187
|
+
chatMessages,
|
|
188
|
+
answerSuggestions: showAnswerSuggestions ? answerSuggestionsComponent : void 0,
|
|
189
|
+
scrollToBottomButton: showScrollButton ? /* @__PURE__ */ jsx(FloatingChatComponents.ScrollToBottomButton, { onClick: scrollToBottom }) : void 0
|
|
190
|
+
});
|
|
191
|
+
return isMobile ? /* @__PURE__ */ jsx(ModalSheet, {
|
|
192
|
+
animationKey,
|
|
193
|
+
open: isOpen,
|
|
194
|
+
height: maxSwipeableViewHeight,
|
|
195
|
+
handler,
|
|
196
|
+
unit: Unit.PERCENT,
|
|
197
|
+
snaps,
|
|
198
|
+
initSnap: initialSnap,
|
|
199
|
+
onSnap: handleSnapChange,
|
|
200
|
+
onClose,
|
|
201
|
+
controlRef: modalSheetControl,
|
|
202
|
+
disableDrag: shouldAutoExpand,
|
|
203
|
+
children: mobileLayout
|
|
204
|
+
}) : desktopLayout;
|
|
138
205
|
};
|
|
139
206
|
|
|
140
207
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_theme = require('../../
|
|
2
|
+
const require_theme = require('../../tokens/theme/theme.cjs');
|
|
3
3
|
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
4
4
|
const require_index = require('../../Message/types/index.cjs');
|
|
5
5
|
const require_Message = require('../../Message/Message.cjs');
|
|
@@ -15,7 +15,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
15
15
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
16
16
|
|
|
17
17
|
//#region src/components/FloatingChat/components/AgentMessage.tsx
|
|
18
|
-
const AgentMessage = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, agentName, type, messages, hideAgentName = false, isResponseStreaming = false, neverShowSingleProductCards = false, showVerifiedBuyer = false }) => {
|
|
18
|
+
const AgentMessage = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, agentName, type, messages, hideAgentName = false, isResponseStreaming = false, neverShowSingleProductCards = false, showVerifiedBuyer = false, isPartialView }) => {
|
|
19
19
|
const finalTheme = require_resolveTheme.resolveTheme(theme);
|
|
20
20
|
if (new Set([
|
|
21
21
|
__envive_ai_react_hooks_application_models.MessageType.Text,
|
|
@@ -42,7 +42,8 @@ const AgentMessage = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, agentName, ty
|
|
|
42
42
|
hideNavigation: products.length === 1,
|
|
43
43
|
products,
|
|
44
44
|
numberOfProducts: products.length,
|
|
45
|
-
theme: finalTheme
|
|
45
|
+
theme: finalTheme,
|
|
46
|
+
isPartialView
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
49
|
if (type === __envive_ai_react_hooks_application_models.MessageType.Page) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DocumentRetrievalCardsCarousel.DocumentRetrievalCardsCarousel, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Theme } from "../../
|
|
1
|
+
import { Theme } from "../../tokens/theme/theme.js";
|
|
2
2
|
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
3
3
|
import { MessageVariant } from "../../Message/types/index.js";
|
|
4
4
|
import { Message } from "../../Message/Message.js";
|
|
@@ -14,7 +14,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
14
14
|
import { MessageType } from "@envive-ai/react-hooks/application/models";
|
|
15
15
|
|
|
16
16
|
//#region src/components/FloatingChat/components/AgentMessage.tsx
|
|
17
|
-
const AgentMessage = ({ theme = Theme.GLOBAL_CUSTOM, agentName, type, messages, hideAgentName = false, isResponseStreaming = false, neverShowSingleProductCards = false, showVerifiedBuyer = false }) => {
|
|
17
|
+
const AgentMessage = ({ theme = Theme.GLOBAL_CUSTOM, agentName, type, messages, hideAgentName = false, isResponseStreaming = false, neverShowSingleProductCards = false, showVerifiedBuyer = false, isPartialView }) => {
|
|
18
18
|
const finalTheme = resolveTheme(theme);
|
|
19
19
|
if (new Set([
|
|
20
20
|
MessageType.Text,
|
|
@@ -41,7 +41,8 @@ const AgentMessage = ({ theme = Theme.GLOBAL_CUSTOM, agentName, type, messages,
|
|
|
41
41
|
hideNavigation: products.length === 1,
|
|
42
42
|
products,
|
|
43
43
|
numberOfProducts: products.length,
|
|
44
|
-
theme: finalTheme
|
|
44
|
+
theme: finalTheme,
|
|
45
|
+
isPartialView
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
48
|
if (type === MessageType.Page) return /* @__PURE__ */ jsx(DocumentRetrievalCardsCarousel, {
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_theme = require('../../
|
|
2
|
+
const require_theme = require('../../tokens/theme/theme.cjs');
|
|
3
3
|
const require_Stack = require('../../Stack/Stack.cjs');
|
|
4
4
|
require('../../Stack/index.cjs');
|
|
5
|
+
const require_index = require('../../Typography/types/index.cjs');
|
|
6
|
+
const require_Typography = require('../../Typography/Typography.cjs');
|
|
7
|
+
require('../../Typography/index.cjs');
|
|
5
8
|
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
6
|
-
const require_index = require('../../Message/types/index.cjs');
|
|
9
|
+
const require_index$1 = require('../../Message/types/index.cjs');
|
|
7
10
|
const require_Message = require('../../Message/Message.cjs');
|
|
8
11
|
require('../../Message/index.cjs');
|
|
9
12
|
const require_UserMessage = require('./UserMessage.cjs');
|
|
@@ -17,52 +20,67 @@ classnames = require_rolldown_runtime.__toESM(classnames);
|
|
|
17
20
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
18
21
|
|
|
19
22
|
//#region src/components/FloatingChat/components/ChatMessages.tsx
|
|
20
|
-
const ChatMessages = (0, react.forwardRef)(({ theme = require_theme.Theme.GLOBAL_CUSTOM, className, agentName, messages, isLoading, isResponseStreaming, ignoreFirstModelResponse, neverShowSingleProductCards, showVerifiedBuyer }, ref) => {
|
|
23
|
+
const ChatMessages = (0, react.forwardRef)(({ theme = require_theme.Theme.GLOBAL_CUSTOM, className, agentName, messages, hasFilteredMessages, handlePreviousDiscussions, isLoading, isResponseStreaming, ignoreFirstModelResponse, neverShowSingleProductCards, showVerifiedBuyer, isPartialView }, ref) => {
|
|
21
24
|
const finalTheme = require_resolveTheme.resolveTheme(theme);
|
|
22
25
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Stack.Stack, {
|
|
23
26
|
ref,
|
|
24
27
|
direction: "column",
|
|
25
28
|
className: (0, classnames.default)("envive-tw-px-4", className),
|
|
26
29
|
gap: 4,
|
|
27
|
-
children: [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
30
|
+
children: [
|
|
31
|
+
hasFilteredMessages && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
32
|
+
type: "button",
|
|
33
|
+
className: "envive-tw-w-full envive-tw-cursor-pointer envive-tw-px-4 envive-tw-py-2 envive-tw-text-center",
|
|
34
|
+
onClick: handlePreviousDiscussions,
|
|
35
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
|
|
36
|
+
color: require_index.TypographyColor.TEXT_PRIMARY,
|
|
37
|
+
variant: require_index.TypographyVariant.B3_RG,
|
|
38
|
+
className: "hover:envive-tw-underline",
|
|
39
|
+
children: "View Previous Messages"
|
|
40
|
+
})
|
|
41
|
+
}),
|
|
42
|
+
messages.map((message, index) => {
|
|
43
|
+
if (ignoreFirstModelResponse && index === 0 && message[0].role === __envive_ai_react_hooks_application_models.MessageRole.Assistant) return null;
|
|
44
|
+
const groupableMessages = require_functions.getGroupableMessages(message);
|
|
45
|
+
const firstMessageId = message[0]?.id || `message-${index}`;
|
|
46
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Stack.Stack, {
|
|
47
|
+
direction: "column",
|
|
48
|
+
gap: 4,
|
|
49
|
+
children: [groupableMessages.find(([type]) => type === __envive_ai_react_hooks_application_models.MessageType.Separator) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MessageDivider.MessageDivider, { label: "New Discussion" }, `divider-${firstMessageId}`), groupableMessages.map(([type, content], indexSubMessage) => {
|
|
50
|
+
const isUser = content[0].role === __envive_ai_react_hooks_application_models.MessageRole.User;
|
|
51
|
+
const isAssistant = content[0].role === __envive_ai_react_hooks_application_models.MessageRole.Assistant;
|
|
52
|
+
const previousMessages = indexSubMessage > 0 ? groupableMessages[indexSubMessage - 1][1] : [];
|
|
53
|
+
const hideAgentName = indexSubMessage > 0 && require_functions.checkIfHideAgentName(previousMessages);
|
|
54
|
+
const isLastMessageTurn = index === messages.length - 1;
|
|
55
|
+
if (isUser) {
|
|
56
|
+
const userMessage = content[0];
|
|
57
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_UserMessage.UserMessage, { message: userMessage }, userMessage.id);
|
|
58
|
+
}
|
|
59
|
+
if (isAssistant) {
|
|
60
|
+
const assistantMessages = content;
|
|
61
|
+
const assistantMessageId = assistantMessages[0]?.id || `agent-${firstMessageId}-${type}-${indexSubMessage}`;
|
|
62
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AgentMessage.AgentMessage, {
|
|
63
|
+
theme: finalTheme,
|
|
64
|
+
hideAgentName,
|
|
65
|
+
agentName,
|
|
66
|
+
type,
|
|
67
|
+
messages: assistantMessages,
|
|
68
|
+
isResponseStreaming: isResponseStreaming && isLastMessageTurn,
|
|
69
|
+
neverShowSingleProductCards,
|
|
70
|
+
showVerifiedBuyer,
|
|
71
|
+
isPartialView
|
|
72
|
+
}, assistantMessageId);
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
})]
|
|
76
|
+
}, firstMessageId);
|
|
77
|
+
}),
|
|
78
|
+
isLoading && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Message.Message, {
|
|
79
|
+
isLoading: true,
|
|
80
|
+
agentName,
|
|
81
|
+
variant: require_index$1.MessageVariant.AGENT
|
|
82
|
+
})
|
|
83
|
+
]
|
|
66
84
|
});
|
|
67
85
|
});
|
|
68
86
|
ChatMessages.displayName = "ChatMessages";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { Theme } from "../../
|
|
1
|
+
import { Theme } from "../../tokens/theme/theme.js";
|
|
2
2
|
import { Stack } from "../../Stack/Stack.js";
|
|
3
3
|
import "../../Stack/index.js";
|
|
4
|
+
import { TypographyColor, TypographyVariant } from "../../Typography/types/index.js";
|
|
5
|
+
import { Typography } from "../../Typography/Typography.js";
|
|
6
|
+
import "../../Typography/index.js";
|
|
4
7
|
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
5
8
|
import { MessageVariant } from "../../Message/types/index.js";
|
|
6
9
|
import { Message } from "../../Message/Message.js";
|
|
@@ -15,52 +18,67 @@ import classNames from "classnames";
|
|
|
15
18
|
import { MessageRole, MessageType } from "@envive-ai/react-hooks/application/models";
|
|
16
19
|
|
|
17
20
|
//#region src/components/FloatingChat/components/ChatMessages.tsx
|
|
18
|
-
const ChatMessages = forwardRef(({ theme = Theme.GLOBAL_CUSTOM, className, agentName, messages, isLoading, isResponseStreaming, ignoreFirstModelResponse, neverShowSingleProductCards, showVerifiedBuyer }, ref) => {
|
|
21
|
+
const ChatMessages = forwardRef(({ theme = Theme.GLOBAL_CUSTOM, className, agentName, messages, hasFilteredMessages, handlePreviousDiscussions, isLoading, isResponseStreaming, ignoreFirstModelResponse, neverShowSingleProductCards, showVerifiedBuyer, isPartialView }, ref) => {
|
|
19
22
|
const finalTheme = resolveTheme(theme);
|
|
20
23
|
return /* @__PURE__ */ jsxs(Stack, {
|
|
21
24
|
ref,
|
|
22
25
|
direction: "column",
|
|
23
26
|
className: classNames("envive-tw-px-4", className),
|
|
24
27
|
gap: 4,
|
|
25
|
-
children: [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
28
|
+
children: [
|
|
29
|
+
hasFilteredMessages && /* @__PURE__ */ jsx("button", {
|
|
30
|
+
type: "button",
|
|
31
|
+
className: "envive-tw-w-full envive-tw-cursor-pointer envive-tw-px-4 envive-tw-py-2 envive-tw-text-center",
|
|
32
|
+
onClick: handlePreviousDiscussions,
|
|
33
|
+
children: /* @__PURE__ */ jsx(Typography, {
|
|
34
|
+
color: TypographyColor.TEXT_PRIMARY,
|
|
35
|
+
variant: TypographyVariant.B3_RG,
|
|
36
|
+
className: "hover:envive-tw-underline",
|
|
37
|
+
children: "View Previous Messages"
|
|
38
|
+
})
|
|
39
|
+
}),
|
|
40
|
+
messages.map((message, index) => {
|
|
41
|
+
if (ignoreFirstModelResponse && index === 0 && message[0].role === MessageRole.Assistant) return null;
|
|
42
|
+
const groupableMessages = getGroupableMessages(message);
|
|
43
|
+
const firstMessageId = message[0]?.id || `message-${index}`;
|
|
44
|
+
return /* @__PURE__ */ jsxs(Stack, {
|
|
45
|
+
direction: "column",
|
|
46
|
+
gap: 4,
|
|
47
|
+
children: [groupableMessages.find(([type]) => type === MessageType.Separator) && /* @__PURE__ */ jsx(MessageDivider, { label: "New Discussion" }, `divider-${firstMessageId}`), groupableMessages.map(([type, content], indexSubMessage) => {
|
|
48
|
+
const isUser = content[0].role === MessageRole.User;
|
|
49
|
+
const isAssistant = content[0].role === MessageRole.Assistant;
|
|
50
|
+
const previousMessages = indexSubMessage > 0 ? groupableMessages[indexSubMessage - 1][1] : [];
|
|
51
|
+
const hideAgentName = indexSubMessage > 0 && checkIfHideAgentName(previousMessages);
|
|
52
|
+
const isLastMessageTurn = index === messages.length - 1;
|
|
53
|
+
if (isUser) {
|
|
54
|
+
const userMessage = content[0];
|
|
55
|
+
return /* @__PURE__ */ jsx(UserMessage, { message: userMessage }, userMessage.id);
|
|
56
|
+
}
|
|
57
|
+
if (isAssistant) {
|
|
58
|
+
const assistantMessages = content;
|
|
59
|
+
const assistantMessageId = assistantMessages[0]?.id || `agent-${firstMessageId}-${type}-${indexSubMessage}`;
|
|
60
|
+
return /* @__PURE__ */ jsx(AgentMessage, {
|
|
61
|
+
theme: finalTheme,
|
|
62
|
+
hideAgentName,
|
|
63
|
+
agentName,
|
|
64
|
+
type,
|
|
65
|
+
messages: assistantMessages,
|
|
66
|
+
isResponseStreaming: isResponseStreaming && isLastMessageTurn,
|
|
67
|
+
neverShowSingleProductCards,
|
|
68
|
+
showVerifiedBuyer,
|
|
69
|
+
isPartialView
|
|
70
|
+
}, assistantMessageId);
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
})]
|
|
74
|
+
}, firstMessageId);
|
|
75
|
+
}),
|
|
76
|
+
isLoading && /* @__PURE__ */ jsx(Message, {
|
|
77
|
+
isLoading: true,
|
|
78
|
+
agentName,
|
|
79
|
+
variant: MessageVariant.AGENT
|
|
80
|
+
})
|
|
81
|
+
]
|
|
64
82
|
});
|
|
65
83
|
});
|
|
66
84
|
ChatMessages.displayName = "ChatMessages";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_theme = require('../../
|
|
2
|
+
const require_theme = require('../../tokens/theme/theme.cjs');
|
|
3
3
|
const require_Stack = require('../../Stack/Stack.cjs');
|
|
4
4
|
require('../../Stack/index.cjs');
|
|
5
5
|
const require_Container = require('../../Container/Container.cjs');
|
|
@@ -19,13 +19,13 @@ const Layout = ({ id, className, style, testId, theme = require_theme.Theme.GLOB
|
|
|
19
19
|
id,
|
|
20
20
|
testId,
|
|
21
21
|
style,
|
|
22
|
-
className: (0, classnames.default)("envive-tw-flex envive-tw-h-full envive-tw-w-[512px] envive-tw-flex-col envive-tw-bg-[#FFFFFF]", className),
|
|
22
|
+
className: (0, classnames.default)("envive-tw-flex envive-tw-h-full envive-tw-w-full envive-tw-max-w-[512px] envive-tw-flex-col envive-tw-bg-[#FFFFFF]", className),
|
|
23
23
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Stack.Stack, {
|
|
24
24
|
direction: "column",
|
|
25
25
|
className: "envive-tw-relative envive-tw-h-full envive-tw-overflow-hidden",
|
|
26
26
|
children: [
|
|
27
27
|
header && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
28
|
-
className: "envive-tw-flex-shrink-0",
|
|
28
|
+
className: "envive-tw-flex-shrink-0 envive-tw-leading-[0]",
|
|
29
29
|
children: header
|
|
30
30
|
}),
|
|
31
31
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Theme } from "../../
|
|
1
|
+
import { Theme } from "../../tokens/theme/theme.js";
|
|
2
2
|
import { Stack } from "../../Stack/Stack.js";
|
|
3
3
|
import "../../Stack/index.js";
|
|
4
4
|
import { Container } from "../../Container/Container.js";
|
|
@@ -17,13 +17,13 @@ const Layout = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTOM, hea
|
|
|
17
17
|
id,
|
|
18
18
|
testId,
|
|
19
19
|
style,
|
|
20
|
-
className: classNames("envive-tw-flex envive-tw-h-full envive-tw-w-[512px] envive-tw-flex-col envive-tw-bg-[#FFFFFF]", className),
|
|
20
|
+
className: classNames("envive-tw-flex envive-tw-h-full envive-tw-w-full envive-tw-max-w-[512px] envive-tw-flex-col envive-tw-bg-[#FFFFFF]", className),
|
|
21
21
|
children: /* @__PURE__ */ jsxs(Stack, {
|
|
22
22
|
direction: "column",
|
|
23
23
|
className: "envive-tw-relative envive-tw-h-full envive-tw-overflow-hidden",
|
|
24
24
|
children: [
|
|
25
25
|
header && /* @__PURE__ */ jsx("div", {
|
|
26
|
-
className: "envive-tw-flex-shrink-0",
|
|
26
|
+
className: "envive-tw-flex-shrink-0 envive-tw-leading-[0]",
|
|
27
27
|
children: header
|
|
28
28
|
}),
|
|
29
29
|
/* @__PURE__ */ jsx("div", {
|