@envive-ai/react-toolkit-v3 0.3.18 → 0.3.20
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 +1 -1
- package/dist/CSSVariablesEditor/hooks/useGetDefaultCssVariables.js +1 -1
- package/dist/CSSVariablesEditor/hooks/useHandleUpdateCssVars.cjs +1 -1
- package/dist/CSSVariablesEditor/hooks/useHandleUpdateCssVars.js +1 -1
- 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 +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/Layout.cjs +1 -1
- package/dist/ChatFooter/components/Layout.js +1 -1
- package/dist/ChatFooter/components/index.d.cts +5 -5
- package/dist/ChatFooter/components/index.d.ts +5 -5
- package/dist/ChatHeader/ChatHeader.d.cts +2 -2
- package/dist/ChatHeader/hooks/useGetLayoutProperties.cjs +1 -1
- package/dist/ChatHeader/hooks/useGetLayoutProperties.js +1 -1
- 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 +4 -4
- package/dist/ChatPreviewComparison/components/Layout.js +2 -2
- package/dist/ChatPreviewComparison/components/Message.cjs +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.cts +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.ts +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/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.cjs +64 -25
- package/dist/FloatingChat/FloatingChat.d.cts +4 -3
- package/dist/FloatingChat/FloatingChat.d.ts +4 -3
- package/dist/FloatingChat/FloatingChat.js +66 -27
- package/dist/FloatingChat/components/AgentMessage.cjs +3 -9
- package/dist/FloatingChat/components/AgentMessage.js +3 -9
- package/dist/FloatingChat/components/ChatMessages.cjs +2 -2
- package/dist/FloatingChat/components/ChatMessages.js +2 -2
- package/dist/FloatingChat/components/Layout.cjs +3 -2
- package/dist/FloatingChat/components/Layout.js +3 -2
- package/dist/FloatingChat/components/ProductResultsModal.cjs +62 -0
- package/dist/FloatingChat/components/ProductResultsModal.js +60 -0
- package/dist/FloatingChat/components/ResultsGridView.cjs +86 -0
- package/dist/FloatingChat/components/ResultsGridView.js +82 -0
- package/dist/FloatingChat/components/SalesAgentBadgeContent.cjs +1 -1
- package/dist/FloatingChat/components/SalesAgentBadgeContent.js +1 -1
- package/dist/FloatingChat/components/SlideChatContent.cjs +47 -0
- package/dist/FloatingChat/components/SlideChatContent.js +46 -0
- package/dist/FloatingChat/components/index.cjs +6 -0
- package/dist/FloatingChat/components/index.js +6 -0
- package/dist/FloatingChat/hooks/useProductResultsView.cjs +49 -0
- package/dist/FloatingChat/hooks/useProductResultsView.js +48 -0
- package/dist/FloatingChat/hooks/useSnapSetup.cjs +2 -2
- package/dist/FloatingChat/types/types.d.cts +4 -0
- package/dist/FloatingChat/types/types.d.ts +4 -0
- package/dist/FloatingChat/utils/functions.cjs +40 -17
- package/dist/FloatingChat/utils/functions.js +38 -17
- package/dist/FloatingChat/utils/trackProductCardInteraction.cjs +18 -0
- package/dist/FloatingChat/utils/trackProductCardInteraction.js +17 -0
- 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 +30 -8
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.cts +2 -2
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.ts +2 -2
- package/dist/FullPageSalesAgent/FullPageSalesAgent.js +30 -8
- package/dist/FullPageSalesAgent/components/Layout.cjs +3 -2
- package/dist/FullPageSalesAgent/components/Layout.js +3 -2
- package/dist/FullPageSalesAgent/hooks/useIsMobile.cjs +2 -2
- 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 +3 -3
- 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.ts +2 -2
- package/dist/Message/components/Layout.cjs +1 -1
- package/dist/Message/components/Layout.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.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/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.cts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.ts +2 -2
- package/dist/PromptButtonCarouselWithImage/components/Layout.cjs +3 -3
- package/dist/PromptButtonCarouselWithImage/components/Layout.js +1 -1
- package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.cjs +2 -2
- package/dist/PromptButtonCarouselWithImage/components/Skeleton.cjs +1 -1
- package/dist/PromptButtonCarouselWithImage/components/Skeleton.js +1 -1
- package/dist/PromptCarousel/PromptCarousel.cjs +3 -3
- package/dist/PromptCarousel/PromptCarousel.d.cts +2 -2
- package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
- package/dist/PromptCarousel/PromptCarousel.js +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 +2 -2
- package/dist/ReviewCard/components/index.d.ts +4 -4
- 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/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/index.d.cts +8 -8
- package/dist/SalesAgentProductCard/components/index.d.ts +6 -6
- package/dist/SocialProof/SocialProof.cjs +2 -2
- package/dist/SocialProof/SocialProof.d.cts +2 -2
- package/dist/SocialProof/components/Headline.cjs +1 -1
- package/dist/SocialProof/components/Headline.js +1 -1
- package/dist/SocialProof/components/LayoutFourHorizontal.cjs +3 -3
- package/dist/SocialProof/components/LayoutFourHorizontal.js +1 -1
- package/dist/SocialProof/components/LayoutSingle.cjs +2 -2
- 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/TextField/TextField.cjs +1 -1
- package/dist/TextField/TextField.js +1 -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/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 +2 -2
- package/dist/Tokens/index.js +2 -2
- 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/Typography/Typography.d.ts +4 -4
- package/dist/WelcomeMessage/components/Container.cjs +1 -1
- package/dist/WelcomeMessage/components/Container.js +1 -1
- package/dist/WidgetTextField/WidgetTextField.d.cts +2 -2
- package/dist/WidgetTextField/WidgetTextField.d.ts +2 -2
- 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/styles.css +1 -1
- package/dist/utils/resolveTheme.cjs +1 -1
- package/dist/utils/resolveTheme.js +1 -1
- package/dist/utils/useCheckIsMobile.d.cts +9 -0
- package/dist/utils/useCheckIsMobile.d.ts +9 -0
- package/package.json +5 -1
- package/src/components/FloatingChat/FloatingChat.tsx +92 -36
- package/src/components/FloatingChat/components/AgentMessage.tsx +2 -12
- package/src/components/FloatingChat/components/Layout.tsx +7 -1
- package/src/components/FloatingChat/components/ProductResultsModal.tsx +87 -0
- package/src/components/FloatingChat/components/ResultsGridView.tsx +117 -0
- package/src/components/FloatingChat/components/SlideChatContent.tsx +80 -0
- package/src/components/FloatingChat/components/index.ts +6 -0
- package/src/components/FloatingChat/hooks/useProductResultsView.ts +73 -0
- package/src/components/FloatingChat/types/types.ts +4 -0
- package/src/components/FloatingChat/utils/functions.ts +56 -19
- package/src/components/FloatingChat/utils/trackProductCardInteraction.ts +26 -0
- package/src/components/FullPageSalesAgent/FullPageSalesAgent.tsx +54 -5
- package/src/components/FullPageSalesAgent/components/Layout.tsx +7 -1
- package/src/logging/logger.ts +33 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ImageAspectRatio } from "../../Image/types/index.js";
|
|
2
2
|
import { Image } from "../../Image/Image.js";
|
|
3
3
|
import "../../Image/index.js";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
4
|
import classNames from "classnames";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/components/DocumentRetrievalCard/components/Image.tsx
|
|
8
8
|
const Image$1 = ({ imageUrl, imageAlt, className }) => {
|
|
@@ -7,9 +7,9 @@ const require_useGetThemeProperties = require('../hooks/useGetThemeProperties.cj
|
|
|
7
7
|
const require_useGetStackLayoutProperties = require('../hooks/useGetStackLayoutProperties.cjs');
|
|
8
8
|
const require_useGetCardWidthProperties = require('../hooks/useGetCardWidthProperties.cjs');
|
|
9
9
|
const require_useGetPaddingProperties = require('../hooks/useGetPaddingProperties.cjs');
|
|
10
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
10
|
let classnames = require("classnames");
|
|
12
11
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
12
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
13
13
|
|
|
14
14
|
//#region src/components/DocumentRetrievalCard/components/Layout.tsx
|
|
15
15
|
const Layout = ({ content, image, viewArticleButton, id, testId, className, style, theme, ariaLabel }) => {
|
|
@@ -6,8 +6,8 @@ import { useGetThemeProperties } from "../hooks/useGetThemeProperties.js";
|
|
|
6
6
|
import { useGetStackLayoutProperties } from "../hooks/useGetStackLayoutProperties.js";
|
|
7
7
|
import { useGetCardWidthProperties } from "../hooks/useGetCardWidthProperties.js";
|
|
8
8
|
import { useGetPaddingProperties } from "../hooks/useGetPaddingProperties.js";
|
|
9
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
9
|
import classNames from "classnames";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
|
|
12
12
|
//#region src/components/DocumentRetrievalCard/components/Layout.tsx
|
|
13
13
|
const Layout = ({ content, image, viewArticleButton, id, testId, className, style, theme, ariaLabel }) => {
|
|
@@ -2,9 +2,9 @@ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.
|
|
|
2
2
|
const require_Stack = require('../../../../Stack/Stack.cjs');
|
|
3
3
|
require('../../../../Stack/index.cjs');
|
|
4
4
|
const require_CustomIcon = require('../../../../utils/CustomIcon.cjs');
|
|
5
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
5
|
let classnames = require("classnames");
|
|
7
6
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
8
|
let __envive_ai_react_icons_Document = require("@envive-ai/react-icons/Document");
|
|
9
9
|
__envive_ai_react_icons_Document = require_rolldown_runtime.__toESM(__envive_ai_react_icons_Document);
|
|
10
10
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Stack } from "../../../../Stack/Stack.js";
|
|
2
2
|
import "../../../../Stack/index.js";
|
|
3
3
|
import { CustomIcon } from "../../../../utils/CustomIcon.js";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
4
|
import classNames from "classnames";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import Document from "@envive-ai/react-icons/Document";
|
|
7
7
|
|
|
8
8
|
//#region src/components/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.tsx
|
|
@@ -5,9 +5,9 @@ const require_index = require('../../../../Typography/types/index.cjs');
|
|
|
5
5
|
const require_Typography = require('../../../../Typography/Typography.cjs');
|
|
6
6
|
require('../../../../Typography/index.cjs');
|
|
7
7
|
const require_useGetLabelUnderlineProperties = require('../../../hooks/useGetLabelUnderlineProperties.cjs');
|
|
8
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
8
|
let classnames = require("classnames");
|
|
10
9
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
11
|
|
|
12
12
|
//#region src/components/DocumentRetrievalCard/components/ViewArticleButton/components/Label.tsx
|
|
13
13
|
const Label = ({ viewArticleLabel, typographyVariant, shouldUnderline = false, textCaseClassName }) => {
|
|
@@ -4,8 +4,8 @@ import { TypographyColor } from "../../../../Typography/types/index.js";
|
|
|
4
4
|
import { Typography } from "../../../../Typography/Typography.js";
|
|
5
5
|
import "../../../../Typography/index.js";
|
|
6
6
|
import { useGetLabelUnderlineProperties } from "../../../hooks/useGetLabelUnderlineProperties.js";
|
|
7
|
-
import { jsx } from "react/jsx-runtime";
|
|
8
7
|
import classNames from "classnames";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
|
|
10
10
|
//#region src/components/DocumentRetrievalCard/components/ViewArticleButton/components/Label.tsx
|
|
11
11
|
const Label = ({ viewArticleLabel, typographyVariant, shouldUnderline = false, textCaseClassName }) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_Stack = require('../../../../Stack/Stack.cjs');
|
|
3
3
|
require('../../../../Stack/index.cjs');
|
|
4
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
4
|
let classnames = require("classnames");
|
|
6
5
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
|
|
8
8
|
//#region src/components/DocumentRetrievalCard/components/ViewArticleButton/components/Layout.tsx
|
|
9
9
|
const Layout = ({ icon, label, onClick, className, ariaLabel }) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Stack } from "../../../../Stack/Stack.js";
|
|
2
2
|
import "../../../../Stack/index.js";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
3
|
import classNames from "classnames";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/components/DocumentRetrievalCard/components/ViewArticleButton/components/Layout.tsx
|
|
7
7
|
const Layout = ({ icon, label, onClick, className, ariaLabel }) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FloatingButtonProps } from "./types/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime24 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/FloatingButton/FloatingButton.d.ts
|
|
5
5
|
declare const FloatingButton: ({
|
|
@@ -18,6 +18,6 @@ declare const FloatingButton: ({
|
|
|
18
18
|
onMouseOver,
|
|
19
19
|
ariaLabel,
|
|
20
20
|
previewMode
|
|
21
|
-
}: FloatingButtonProps) =>
|
|
21
|
+
}: FloatingButtonProps) => react_jsx_runtime24.JSX.Element;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { FloatingButton };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FloatingButtonProps } from "./types/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime31 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/FloatingButton/FloatingButton.d.ts
|
|
5
5
|
declare const FloatingButton: ({
|
|
@@ -18,6 +18,6 @@ declare const FloatingButton: ({
|
|
|
18
18
|
onMouseOver,
|
|
19
19
|
ariaLabel,
|
|
20
20
|
previewMode
|
|
21
|
-
}: FloatingButtonProps) =>
|
|
21
|
+
}: FloatingButtonProps) => react_jsx_runtime31.JSX.Element;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { FloatingButton };
|
|
@@ -2,9 +2,9 @@ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
|
2
2
|
const require_types = require('../types/types.cjs');
|
|
3
3
|
const require_useGetButtonHoverProperties = require('../hooks/useGetButtonHoverProperties.cjs');
|
|
4
4
|
const require_useGetButtonProperties = require('../hooks/useGetButtonProperties.cjs');
|
|
5
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
5
|
let classnames = require("classnames");
|
|
7
6
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
8
|
|
|
9
9
|
//#region src/components/FloatingButton/components/Button.tsx
|
|
10
10
|
const Button = ({ variant = require_types.FloatingButtonVariant.ATTACHED, mode = require_types.FloatingButtonMode.LIGHT, backgroundColor, onClick, onMouseOver, onFocus, children, className = "", ariaLabel }) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FloatingButtonMode, FloatingButtonVariant } from "../types/types.js";
|
|
2
2
|
import { useGetButtonHoverProperties } from "../hooks/useGetButtonHoverProperties.js";
|
|
3
3
|
import { useGetButtonProperties } from "../hooks/useGetButtonProperties.js";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
4
|
import classNames from "classnames";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/components/FloatingButton/components/Button.tsx
|
|
8
8
|
const Button = ({ variant = FloatingButtonVariant.ATTACHED, mode = FloatingButtonMode.LIGHT, backgroundColor, onClick, onMouseOver, onFocus, children, className = "", ariaLabel }) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_types = require('../types/types.cjs');
|
|
3
3
|
const require_useGetContainerProperties = require('../hooks/useGetContainerProperties.cjs');
|
|
4
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
4
|
let classnames = require("classnames");
|
|
6
5
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
|
|
8
8
|
//#region src/components/FloatingButton/components/Container.tsx
|
|
9
9
|
const Container = ({ location = require_types.FloatingButtonLocation.BOTTOM_RIGHT, show = require_types.FloatingButtonShow.ALWAYS, variant = require_types.FloatingButtonVariant.ATTACHED, hasInteractionHappened = false, children, id, testId, className = "", style, previewMode = false }) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FloatingButtonLocation, FloatingButtonShow, FloatingButtonVariant } from "../types/types.js";
|
|
2
2
|
import { useGetContainerProperties } from "../hooks/useGetContainerProperties.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
import classNames from "classnames";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/components/FloatingButton/components/Container.tsx
|
|
7
7
|
const Container = ({ location = FloatingButtonLocation.BOTTOM_RIGHT, show = FloatingButtonShow.ALWAYS, variant = FloatingButtonVariant.ATTACHED, hasInteractionHappened = false, children, id, testId, className = "", style, previewMode = false }) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_types = require('../types/types.cjs');
|
|
3
3
|
const require_useGetWrapperProperties = require('../hooks/useGetWrapperProperties.cjs');
|
|
4
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
4
|
let classnames = require("classnames");
|
|
6
5
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
|
|
8
8
|
//#region src/components/FloatingButton/components/Wrapper.tsx
|
|
9
9
|
const Wrapper = ({ location = require_types.FloatingButtonLocation.BOTTOM_RIGHT, children, className = "" }) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FloatingButtonLocation } from "../types/types.js";
|
|
2
2
|
import { useGetWrapperProperties } from "../hooks/useGetWrapperProperties.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
import classNames from "classnames";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/components/FloatingButton/components/Wrapper.tsx
|
|
7
7
|
const Wrapper = ({ location = FloatingButtonLocation.BOTTOM_RIGHT, children, className = "" }) => {
|
|
@@ -15,14 +15,15 @@ require('../ChatHeader/index.cjs');
|
|
|
15
15
|
const require_Disclaimer = require('../Disclaimer/Disclaimer.cjs');
|
|
16
16
|
require('../Disclaimer/index.cjs');
|
|
17
17
|
const require_WelcomeMessage = require('../WelcomeMessage/WelcomeMessage.cjs');
|
|
18
|
-
const require_functions = require('./utils/functions.cjs');
|
|
19
|
-
const require_useSnapCalculator = require('./hooks/useSnapCalculator.cjs');
|
|
20
|
-
const require_ModalSheet = require('./components/ModalSheet.cjs');
|
|
21
|
-
const require_index$1 = require('./components/index.cjs');
|
|
22
18
|
const require_useChatSuggestions = require('./hooks/useChatSuggestions.cjs');
|
|
19
|
+
const require_useProductResultsView = require('./hooks/useProductResultsView.cjs');
|
|
23
20
|
const require_useScrollToBottom = require('./hooks/useScrollToBottom.cjs');
|
|
24
21
|
const require_useSnapSetup = require('./hooks/useSnapSetup.cjs');
|
|
25
22
|
const require_useFilteredChatMessages = require('./hooks/useFilteredChatMessages.cjs');
|
|
23
|
+
const require_useSnapCalculator = require('./hooks/useSnapCalculator.cjs');
|
|
24
|
+
const require_trackProductCardInteraction = require('./utils/trackProductCardInteraction.cjs');
|
|
25
|
+
const require_ModalSheet = require('./components/ModalSheet.cjs');
|
|
26
|
+
const require_index$1 = require('./components/index.cjs');
|
|
26
27
|
let react = require("react");
|
|
27
28
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
28
29
|
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
@@ -32,7 +33,7 @@ let framer_motion = require("framer-motion");
|
|
|
32
33
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
33
34
|
|
|
34
35
|
//#region src/components/FloatingChat/FloatingChat.tsx
|
|
35
|
-
const FloatingChat = ({ id, className, style, testId, theme = require_theme.Theme.GLOBAL_CUSTOM, salesAgentData, floatingChatConfig, hardcopyContent, lookAndFeelConfig, isCXButtonSwitchEnabled, isFloatingChatOpen, debugBar, onClose, onSwipeClose, onToggleCXButton }) => {
|
|
36
|
+
const FloatingChat = ({ id, className, style, testId, theme = require_theme.Theme.GLOBAL_CUSTOM, salesAgentData, floatingChatConfig, hardcopyContent, lookAndFeelConfig, isCXButtonSwitchEnabled, isFloatingChatOpen, debugBar, onClose, onSwipeClose, onToggleCXButton, setIsResultsModalOpen }) => {
|
|
36
37
|
const finalTheme = require_resolveTheme.resolveTheme(theme);
|
|
37
38
|
const { trackWidgetInteraction } = (0, __envive_ai_react_hooks_hooks_WidgetInteraction.useWidgetInteraction)();
|
|
38
39
|
const { onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = require_usePromptCarouselAnalytics.usePromptCarouselAnalytics(__envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.FLOATING_CHAT, (text) => text);
|
|
@@ -40,6 +41,13 @@ const FloatingChat = ({ id, className, style, testId, theme = require_theme.Them
|
|
|
40
41
|
const chatMessagesRef = (0, react.useRef)(null);
|
|
41
42
|
const { headerBackgroundColor, headerMode, welcomeMessageIconColor, showVerifiedBuyer, userQueryInputEnabled = true, showEnviveLogo, ignoreFirstModelResponse, neverShowSingleProductCards } = floatingChatConfig;
|
|
42
43
|
const { welcomeMessageTitle, welcomeMessageText, chatFooterTextFieldPlaceholderText, disclaimerText, leftToggleLabel, rightToggleLabel } = hardcopyContent?.values ?? {};
|
|
44
|
+
const disclaimerTextString = (0, react.useMemo)(() => {
|
|
45
|
+
if (disclaimerText && typeof disclaimerText === "string") return disclaimerText;
|
|
46
|
+
if (disclaimerText && Array.isArray(disclaimerText)) {
|
|
47
|
+
const textString = disclaimerText[0];
|
|
48
|
+
if (textString && typeof textString === "string") return textString;
|
|
49
|
+
}
|
|
50
|
+
}, [disclaimerText]);
|
|
43
51
|
const { agentName, chatHeaderLogoDarkSrc, chatHeaderLogoLightSrc } = lookAndFeelConfig;
|
|
44
52
|
const { messages, isResponseStreaming, isPendingResponse, suggestions, onSuggestionClicked, onTypedMessageSubmitted, onFormResponseSubmitted } = salesAgentData;
|
|
45
53
|
const { answerSuggestions, generalSuggestions, showAnswerSuggestions, setAnswerSuggestions, setGeneralSuggestions } = require_useChatSuggestions.useChatSuggestions({
|
|
@@ -68,6 +76,15 @@ const FloatingChat = ({ id, className, style, testId, theme = require_theme.Them
|
|
|
68
76
|
footerHeight: 160,
|
|
69
77
|
isOpen: isFloatingChatOpen
|
|
70
78
|
});
|
|
79
|
+
const { resultsViewData, isResultsView, scrollContainerRef, isResultsViewRef, handleBackToChat, handleExploreAllResults } = require_useProductResultsView.useProductResultsView({ scrollToBottom });
|
|
80
|
+
(0, react.useEffect)(() => {
|
|
81
|
+
setIsResultsModalOpen?.(!isMobile && isResultsView && resultsViewData !== null);
|
|
82
|
+
}, [
|
|
83
|
+
isMobile,
|
|
84
|
+
isResultsView,
|
|
85
|
+
resultsViewData,
|
|
86
|
+
setIsResultsModalOpen
|
|
87
|
+
]);
|
|
71
88
|
(0, react.useEffect)(() => {
|
|
72
89
|
if (isFloatingChatOpen) trackWidgetInteraction({
|
|
73
90
|
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
@@ -102,6 +119,9 @@ const FloatingChat = ({ id, className, style, testId, theme = require_theme.Them
|
|
|
102
119
|
currentSnapPercentage,
|
|
103
120
|
modalSheetControl
|
|
104
121
|
});
|
|
122
|
+
const handleProductCardClick = (product) => {
|
|
123
|
+
require_trackProductCardInteraction.trackProductCardClicked(trackWidgetInteraction, __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.FLOATING_CHAT, product);
|
|
124
|
+
};
|
|
105
125
|
const header = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatHeader.ChatHeader, {
|
|
106
126
|
logoDark: chatHeaderLogoDarkSrc,
|
|
107
127
|
logoLight: chatHeaderLogoLightSrc,
|
|
@@ -163,6 +183,7 @@ const FloatingChat = ({ id, className, style, testId, theme = require_theme.Them
|
|
|
163
183
|
});
|
|
164
184
|
setAnswerSuggestions([]);
|
|
165
185
|
setGeneralSuggestions([]);
|
|
186
|
+
handleBackToChat();
|
|
166
187
|
},
|
|
167
188
|
textFieldPlaceholderText: chatFooterTextFieldPlaceholderText,
|
|
168
189
|
promptSuggestions: isPendingResponse || isResponseStreaming ? ["Loading suggestions 1...", "Loading suggestions 2..."] : generalSuggestions,
|
|
@@ -171,6 +192,7 @@ const FloatingChat = ({ id, className, style, testId, theme = require_theme.Them
|
|
|
171
192
|
if (suggestion) onSuggestionClicked(suggestion, __envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_PROMPT_BUTTON);
|
|
172
193
|
setAnswerSuggestions([]);
|
|
173
194
|
setGeneralSuggestions([]);
|
|
195
|
+
handleBackToChat();
|
|
174
196
|
},
|
|
175
197
|
disabled: isPendingResponse || isResponseStreaming,
|
|
176
198
|
disabledInput: !userQueryInputEnabled,
|
|
@@ -185,13 +207,6 @@ const FloatingChat = ({ id, className, style, testId, theme = require_theme.Them
|
|
|
185
207
|
text: welcomeMessageText,
|
|
186
208
|
theme: finalTheme
|
|
187
209
|
});
|
|
188
|
-
const handleExploreAllResults = (firstProductMessageId) => {
|
|
189
|
-
const products = require_functions.getCleanProducts(messages.find((block) => block.some((msg) => msg.type === __envive_ai_react_hooks_application_models.MessageType.Product && msg.id === firstProductMessageId))?.filter((msg) => msg.type === __envive_ai_react_hooks_application_models.MessageType.Product) ?? []);
|
|
190
|
-
console.log("[INFO] [spiffy-ai] Explore All Results clicked", {
|
|
191
|
-
firstProductMessageId,
|
|
192
|
-
products
|
|
193
|
-
});
|
|
194
|
-
};
|
|
195
210
|
const chatMessages = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$1.FloatingChatComponents.ChatMessages, {
|
|
196
211
|
theme: finalTheme,
|
|
197
212
|
ref: chatMessagesRef,
|
|
@@ -206,7 +221,17 @@ const FloatingChat = ({ id, className, style, testId, theme = require_theme.Them
|
|
|
206
221
|
showVerifiedBuyer,
|
|
207
222
|
onFormResponseSubmitted,
|
|
208
223
|
parentWidget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.FLOATING_CHAT,
|
|
209
|
-
onExploreAllResults: handleExploreAllResults
|
|
224
|
+
onExploreAllResults: (firstProductMessageId) => handleExploreAllResults(firstProductMessageId, filteredMessages)
|
|
225
|
+
});
|
|
226
|
+
const middleContent = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$1.FloatingChatComponents.SlideChatContent, {
|
|
227
|
+
isResultsView,
|
|
228
|
+
isResultsViewRef,
|
|
229
|
+
resultsViewData,
|
|
230
|
+
onBackToChat: handleBackToChat,
|
|
231
|
+
onProductCardClick: handleProductCardClick,
|
|
232
|
+
theme: finalTheme,
|
|
233
|
+
chatMessages,
|
|
234
|
+
scrollToBottom
|
|
210
235
|
});
|
|
211
236
|
const answerSuggestionsComponent = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_PromptCarousel.PromptCarousel, {
|
|
212
237
|
className: "envive-tw-flex envive-tw-justify-end envive-tw-p-4 [&>div>div]:envive-tw-items-end",
|
|
@@ -235,12 +260,13 @@ const FloatingChat = ({ id, className, style, testId, theme = require_theme.Them
|
|
|
235
260
|
theme: finalTheme,
|
|
236
261
|
header,
|
|
237
262
|
footer,
|
|
238
|
-
welcomeMessage,
|
|
239
|
-
chatMessages,
|
|
240
|
-
answerSuggestions: showAnswerSuggestions ? answerSuggestionsComponent :
|
|
241
|
-
scrollToBottomButton: showScrollButton ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$1.FloatingChatComponents.ScrollToBottomButton, { onClick: handleScrollToBottom }) :
|
|
242
|
-
disclaimer:
|
|
243
|
-
debugBar
|
|
263
|
+
welcomeMessage: isResultsView ? null : welcomeMessage,
|
|
264
|
+
chatMessages: middleContent,
|
|
265
|
+
answerSuggestions: showAnswerSuggestions ? answerSuggestionsComponent : null,
|
|
266
|
+
scrollToBottomButton: !isResultsView && showScrollButton ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$1.FloatingChatComponents.ScrollToBottomButton, { onClick: handleScrollToBottom }) : null,
|
|
267
|
+
disclaimer: disclaimerTextString ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Disclaimer.Disclaimer, { disclaimerMarkdown: disclaimerTextString }) : null,
|
|
268
|
+
debugBar,
|
|
269
|
+
scrollContainerRef
|
|
244
270
|
});
|
|
245
271
|
const mobileLayout = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$1.FloatingChatComponents.Layout, {
|
|
246
272
|
id,
|
|
@@ -250,12 +276,25 @@ const FloatingChat = ({ id, className, style, testId, theme = require_theme.Them
|
|
|
250
276
|
theme: finalTheme,
|
|
251
277
|
header: mobileHeader,
|
|
252
278
|
footer,
|
|
253
|
-
welcomeMessage,
|
|
254
|
-
chatMessages,
|
|
255
|
-
answerSuggestions: showAnswerSuggestions ? answerSuggestionsComponent :
|
|
256
|
-
scrollToBottomButton: showScrollButton ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$1.FloatingChatComponents.ScrollToBottomButton, { onClick: handleScrollToBottom }) :
|
|
257
|
-
disclaimer:
|
|
258
|
-
isFloatingFooterLayout: isFloatingLayout
|
|
279
|
+
welcomeMessage: isResultsView ? null : welcomeMessage,
|
|
280
|
+
chatMessages: middleContent,
|
|
281
|
+
answerSuggestions: showAnswerSuggestions ? answerSuggestionsComponent : null,
|
|
282
|
+
scrollToBottomButton: !isResultsView && showScrollButton ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$1.FloatingChatComponents.ScrollToBottomButton, { onClick: handleScrollToBottom }) : null,
|
|
283
|
+
disclaimer: disclaimerTextString ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Disclaimer.Disclaimer, { disclaimerMarkdown: disclaimerTextString }) : null,
|
|
284
|
+
isFloatingFooterLayout: isFloatingLayout,
|
|
285
|
+
scrollContainerRef
|
|
286
|
+
});
|
|
287
|
+
if (!isMobile && isResultsView && resultsViewData) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$1.FloatingChatComponents.ProductResultsModal, {
|
|
288
|
+
theme: finalTheme,
|
|
289
|
+
resultsViewData,
|
|
290
|
+
onBackToChat: handleBackToChat,
|
|
291
|
+
onProductCardClick: handleProductCardClick,
|
|
292
|
+
onClose,
|
|
293
|
+
logoDark: chatHeaderLogoDarkSrc,
|
|
294
|
+
logoLight: chatHeaderLogoLightSrc,
|
|
295
|
+
headerBgColor: headerBackgroundColor,
|
|
296
|
+
headerMode,
|
|
297
|
+
footer
|
|
259
298
|
});
|
|
260
299
|
return isMobile ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ModalSheet.ModalSheet, {
|
|
261
300
|
animationKey,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FloatingChatProps } from "./types/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime21 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/FloatingChat/FloatingChat.d.ts
|
|
5
5
|
declare const FloatingChat: ({
|
|
@@ -17,7 +17,8 @@ declare const FloatingChat: ({
|
|
|
17
17
|
debugBar,
|
|
18
18
|
onClose,
|
|
19
19
|
onSwipeClose,
|
|
20
|
-
onToggleCXButton
|
|
21
|
-
|
|
20
|
+
onToggleCXButton,
|
|
21
|
+
setIsResultsModalOpen
|
|
22
|
+
}: FloatingChatProps) => react_jsx_runtime21.JSX.Element;
|
|
22
23
|
//#endregion
|
|
23
24
|
export { FloatingChat };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FloatingChatProps } from "./types/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime22 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/FloatingChat/FloatingChat.d.ts
|
|
5
5
|
declare const FloatingChat: ({
|
|
@@ -17,7 +17,8 @@ declare const FloatingChat: ({
|
|
|
17
17
|
debugBar,
|
|
18
18
|
onClose,
|
|
19
19
|
onSwipeClose,
|
|
20
|
-
onToggleCXButton
|
|
21
|
-
|
|
20
|
+
onToggleCXButton,
|
|
21
|
+
setIsResultsModalOpen
|
|
22
|
+
}: FloatingChatProps) => react_jsx_runtime22.JSX.Element;
|
|
22
23
|
//#endregion
|
|
23
24
|
export { FloatingChat };
|
|
@@ -14,24 +14,25 @@ import "../ChatHeader/index.js";
|
|
|
14
14
|
import { Disclaimer } from "../Disclaimer/Disclaimer.js";
|
|
15
15
|
import "../Disclaimer/index.js";
|
|
16
16
|
import { WelcomeMessage } from "../WelcomeMessage/WelcomeMessage.js";
|
|
17
|
-
import { getCleanProducts } from "./utils/functions.js";
|
|
18
|
-
import { Unit } from "./hooks/useSnapCalculator.js";
|
|
19
|
-
import { ModalSheet } from "./components/ModalSheet.js";
|
|
20
|
-
import { FloatingChatComponents } from "./components/index.js";
|
|
21
17
|
import { useChatSuggestions } from "./hooks/useChatSuggestions.js";
|
|
18
|
+
import { useProductResultsView } from "./hooks/useProductResultsView.js";
|
|
22
19
|
import { useScrollToBottom } from "./hooks/useScrollToBottom.js";
|
|
23
20
|
import { useSnapSetup } from "./hooks/useSnapSetup.js";
|
|
24
21
|
import { useFilteredChatMessages } from "./hooks/useFilteredChatMessages.js";
|
|
25
|
-
import {
|
|
22
|
+
import { Unit } from "./hooks/useSnapCalculator.js";
|
|
23
|
+
import { trackProductCardClicked } from "./utils/trackProductCardInteraction.js";
|
|
24
|
+
import { ModalSheet } from "./components/ModalSheet.js";
|
|
25
|
+
import { FloatingChatComponents } from "./components/index.js";
|
|
26
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
26
27
|
import { jsx } from "react/jsx-runtime";
|
|
27
28
|
import { EnviveMetricsEventName } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
28
29
|
import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
|
|
29
30
|
import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
30
31
|
import { motion } from "framer-motion";
|
|
31
|
-
import { ChatElementDisplayLocationV3
|
|
32
|
+
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
32
33
|
|
|
33
34
|
//#region src/components/FloatingChat/FloatingChat.tsx
|
|
34
|
-
const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTOM, salesAgentData, floatingChatConfig, hardcopyContent, lookAndFeelConfig, isCXButtonSwitchEnabled, isFloatingChatOpen, debugBar, onClose, onSwipeClose, onToggleCXButton }) => {
|
|
35
|
+
const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTOM, salesAgentData, floatingChatConfig, hardcopyContent, lookAndFeelConfig, isCXButtonSwitchEnabled, isFloatingChatOpen, debugBar, onClose, onSwipeClose, onToggleCXButton, setIsResultsModalOpen }) => {
|
|
35
36
|
const finalTheme = resolveTheme(theme);
|
|
36
37
|
const { trackWidgetInteraction } = useWidgetInteraction();
|
|
37
38
|
const { onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = usePromptCarouselAnalytics(WidgetInteractionComponent.FLOATING_CHAT, (text) => text);
|
|
@@ -39,6 +40,13 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
|
|
|
39
40
|
const chatMessagesRef = useRef(null);
|
|
40
41
|
const { headerBackgroundColor, headerMode, welcomeMessageIconColor, showVerifiedBuyer, userQueryInputEnabled = true, showEnviveLogo, ignoreFirstModelResponse, neverShowSingleProductCards } = floatingChatConfig;
|
|
41
42
|
const { welcomeMessageTitle, welcomeMessageText, chatFooterTextFieldPlaceholderText, disclaimerText, leftToggleLabel, rightToggleLabel } = hardcopyContent?.values ?? {};
|
|
43
|
+
const disclaimerTextString = useMemo(() => {
|
|
44
|
+
if (disclaimerText && typeof disclaimerText === "string") return disclaimerText;
|
|
45
|
+
if (disclaimerText && Array.isArray(disclaimerText)) {
|
|
46
|
+
const textString = disclaimerText[0];
|
|
47
|
+
if (textString && typeof textString === "string") return textString;
|
|
48
|
+
}
|
|
49
|
+
}, [disclaimerText]);
|
|
42
50
|
const { agentName, chatHeaderLogoDarkSrc, chatHeaderLogoLightSrc } = lookAndFeelConfig;
|
|
43
51
|
const { messages, isResponseStreaming, isPendingResponse, suggestions, onSuggestionClicked, onTypedMessageSubmitted, onFormResponseSubmitted } = salesAgentData;
|
|
44
52
|
const { answerSuggestions, generalSuggestions, showAnswerSuggestions, setAnswerSuggestions, setGeneralSuggestions } = useChatSuggestions({
|
|
@@ -67,6 +75,15 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
|
|
|
67
75
|
footerHeight: 160,
|
|
68
76
|
isOpen: isFloatingChatOpen
|
|
69
77
|
});
|
|
78
|
+
const { resultsViewData, isResultsView, scrollContainerRef, isResultsViewRef, handleBackToChat, handleExploreAllResults } = useProductResultsView({ scrollToBottom });
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
setIsResultsModalOpen?.(!isMobile && isResultsView && resultsViewData !== null);
|
|
81
|
+
}, [
|
|
82
|
+
isMobile,
|
|
83
|
+
isResultsView,
|
|
84
|
+
resultsViewData,
|
|
85
|
+
setIsResultsModalOpen
|
|
86
|
+
]);
|
|
70
87
|
useEffect(() => {
|
|
71
88
|
if (isFloatingChatOpen) trackWidgetInteraction({
|
|
72
89
|
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
@@ -101,6 +118,9 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
|
|
|
101
118
|
currentSnapPercentage,
|
|
102
119
|
modalSheetControl
|
|
103
120
|
});
|
|
121
|
+
const handleProductCardClick = (product) => {
|
|
122
|
+
trackProductCardClicked(trackWidgetInteraction, WidgetInteractionComponent.FLOATING_CHAT, product);
|
|
123
|
+
};
|
|
104
124
|
const header = /* @__PURE__ */ jsx(ChatHeader, {
|
|
105
125
|
logoDark: chatHeaderLogoDarkSrc,
|
|
106
126
|
logoLight: chatHeaderLogoLightSrc,
|
|
@@ -162,6 +182,7 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
|
|
|
162
182
|
});
|
|
163
183
|
setAnswerSuggestions([]);
|
|
164
184
|
setGeneralSuggestions([]);
|
|
185
|
+
handleBackToChat();
|
|
165
186
|
},
|
|
166
187
|
textFieldPlaceholderText: chatFooterTextFieldPlaceholderText,
|
|
167
188
|
promptSuggestions: isPendingResponse || isResponseStreaming ? ["Loading suggestions 1...", "Loading suggestions 2..."] : generalSuggestions,
|
|
@@ -170,6 +191,7 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
|
|
|
170
191
|
if (suggestion) onSuggestionClicked(suggestion, ChatElementDisplayLocationV3.FLOATING_CHAT_PROMPT_BUTTON);
|
|
171
192
|
setAnswerSuggestions([]);
|
|
172
193
|
setGeneralSuggestions([]);
|
|
194
|
+
handleBackToChat();
|
|
173
195
|
},
|
|
174
196
|
disabled: isPendingResponse || isResponseStreaming,
|
|
175
197
|
disabledInput: !userQueryInputEnabled,
|
|
@@ -184,13 +206,6 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
|
|
|
184
206
|
text: welcomeMessageText,
|
|
185
207
|
theme: finalTheme
|
|
186
208
|
});
|
|
187
|
-
const handleExploreAllResults = (firstProductMessageId) => {
|
|
188
|
-
const products = getCleanProducts(messages.find((block) => block.some((msg) => msg.type === MessageType.Product && msg.id === firstProductMessageId))?.filter((msg) => msg.type === MessageType.Product) ?? []);
|
|
189
|
-
console.log("[INFO] [spiffy-ai] Explore All Results clicked", {
|
|
190
|
-
firstProductMessageId,
|
|
191
|
-
products
|
|
192
|
-
});
|
|
193
|
-
};
|
|
194
209
|
const chatMessages = /* @__PURE__ */ jsx(FloatingChatComponents.ChatMessages, {
|
|
195
210
|
theme: finalTheme,
|
|
196
211
|
ref: chatMessagesRef,
|
|
@@ -205,7 +220,17 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
|
|
|
205
220
|
showVerifiedBuyer,
|
|
206
221
|
onFormResponseSubmitted,
|
|
207
222
|
parentWidget: WidgetInteractionComponent.FLOATING_CHAT,
|
|
208
|
-
onExploreAllResults: handleExploreAllResults
|
|
223
|
+
onExploreAllResults: (firstProductMessageId) => handleExploreAllResults(firstProductMessageId, filteredMessages)
|
|
224
|
+
});
|
|
225
|
+
const middleContent = /* @__PURE__ */ jsx(FloatingChatComponents.SlideChatContent, {
|
|
226
|
+
isResultsView,
|
|
227
|
+
isResultsViewRef,
|
|
228
|
+
resultsViewData,
|
|
229
|
+
onBackToChat: handleBackToChat,
|
|
230
|
+
onProductCardClick: handleProductCardClick,
|
|
231
|
+
theme: finalTheme,
|
|
232
|
+
chatMessages,
|
|
233
|
+
scrollToBottom
|
|
209
234
|
});
|
|
210
235
|
const answerSuggestionsComponent = /* @__PURE__ */ jsx(PromptCarousel, {
|
|
211
236
|
className: "envive-tw-flex envive-tw-justify-end envive-tw-p-4 [&>div>div]:envive-tw-items-end",
|
|
@@ -234,12 +259,13 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
|
|
|
234
259
|
theme: finalTheme,
|
|
235
260
|
header,
|
|
236
261
|
footer,
|
|
237
|
-
welcomeMessage,
|
|
238
|
-
chatMessages,
|
|
239
|
-
answerSuggestions: showAnswerSuggestions ? answerSuggestionsComponent :
|
|
240
|
-
scrollToBottomButton: showScrollButton ? /* @__PURE__ */ jsx(FloatingChatComponents.ScrollToBottomButton, { onClick: handleScrollToBottom }) :
|
|
241
|
-
disclaimer:
|
|
242
|
-
debugBar
|
|
262
|
+
welcomeMessage: isResultsView ? null : welcomeMessage,
|
|
263
|
+
chatMessages: middleContent,
|
|
264
|
+
answerSuggestions: showAnswerSuggestions ? answerSuggestionsComponent : null,
|
|
265
|
+
scrollToBottomButton: !isResultsView && showScrollButton ? /* @__PURE__ */ jsx(FloatingChatComponents.ScrollToBottomButton, { onClick: handleScrollToBottom }) : null,
|
|
266
|
+
disclaimer: disclaimerTextString ? /* @__PURE__ */ jsx(Disclaimer, { disclaimerMarkdown: disclaimerTextString }) : null,
|
|
267
|
+
debugBar,
|
|
268
|
+
scrollContainerRef
|
|
243
269
|
});
|
|
244
270
|
const mobileLayout = /* @__PURE__ */ jsx(FloatingChatComponents.Layout, {
|
|
245
271
|
id,
|
|
@@ -249,12 +275,25 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
|
|
|
249
275
|
theme: finalTheme,
|
|
250
276
|
header: mobileHeader,
|
|
251
277
|
footer,
|
|
252
|
-
welcomeMessage,
|
|
253
|
-
chatMessages,
|
|
254
|
-
answerSuggestions: showAnswerSuggestions ? answerSuggestionsComponent :
|
|
255
|
-
scrollToBottomButton: showScrollButton ? /* @__PURE__ */ jsx(FloatingChatComponents.ScrollToBottomButton, { onClick: handleScrollToBottom }) :
|
|
256
|
-
disclaimer:
|
|
257
|
-
isFloatingFooterLayout: isFloatingLayout
|
|
278
|
+
welcomeMessage: isResultsView ? null : welcomeMessage,
|
|
279
|
+
chatMessages: middleContent,
|
|
280
|
+
answerSuggestions: showAnswerSuggestions ? answerSuggestionsComponent : null,
|
|
281
|
+
scrollToBottomButton: !isResultsView && showScrollButton ? /* @__PURE__ */ jsx(FloatingChatComponents.ScrollToBottomButton, { onClick: handleScrollToBottom }) : null,
|
|
282
|
+
disclaimer: disclaimerTextString ? /* @__PURE__ */ jsx(Disclaimer, { disclaimerMarkdown: disclaimerTextString }) : null,
|
|
283
|
+
isFloatingFooterLayout: isFloatingLayout,
|
|
284
|
+
scrollContainerRef
|
|
285
|
+
});
|
|
286
|
+
if (!isMobile && isResultsView && resultsViewData) return /* @__PURE__ */ jsx(FloatingChatComponents.ProductResultsModal, {
|
|
287
|
+
theme: finalTheme,
|
|
288
|
+
resultsViewData,
|
|
289
|
+
onBackToChat: handleBackToChat,
|
|
290
|
+
onProductCardClick: handleProductCardClick,
|
|
291
|
+
onClose,
|
|
292
|
+
logoDark: chatHeaderLogoDarkSrc,
|
|
293
|
+
logoLight: chatHeaderLogoLightSrc,
|
|
294
|
+
headerBgColor: headerBackgroundColor,
|
|
295
|
+
headerMode,
|
|
296
|
+
footer
|
|
258
297
|
});
|
|
259
298
|
return isMobile ? /* @__PURE__ */ jsx(ModalSheet, {
|
|
260
299
|
animationKey,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_theme = require('../../packages/components-v3/tokens/theme/theme.cjs');
|
|
3
3
|
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
4
|
+
const require_functions = require('../utils/functions.cjs');
|
|
4
5
|
const require_index = require('../../Message/types/index.cjs');
|
|
5
6
|
const require_Message = require('../../Message/Message.cjs');
|
|
6
7
|
require('../../Message/index.cjs');
|
|
7
8
|
const require_react = require('../../node_modules/jotai/esm/react.cjs');
|
|
8
9
|
const require_Form = require('../../Form/Form.cjs');
|
|
9
10
|
require('../../Form/index.cjs');
|
|
10
|
-
const
|
|
11
|
+
const require_trackProductCardInteraction = require('../utils/trackProductCardInteraction.cjs');
|
|
11
12
|
const require_DocumentRetrievalCardsCarousel = require('./DocumentRetrievalCardsCarousel.cjs');
|
|
12
13
|
const require_OrderLookupCardCarousel = require('./OrderLookupCardCarousel.cjs');
|
|
13
14
|
const require_ReviewCardsCarousel = require('./ReviewCardsCarousel.cjs');
|
|
@@ -40,14 +41,7 @@ const AgentMessage = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, agentName, ty
|
|
|
40
41
|
});
|
|
41
42
|
};
|
|
42
43
|
const handleProductCardClick = (product) => {
|
|
43
|
-
trackWidgetInteraction
|
|
44
|
-
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
45
|
-
trigger: {
|
|
46
|
-
widget: parentWidget,
|
|
47
|
-
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.PRODUCT_CARD_CLICKED,
|
|
48
|
-
widget_interaction_data: { product_card_clicked: { product_id: product.id } }
|
|
49
|
-
}
|
|
50
|
-
});
|
|
44
|
+
require_trackProductCardInteraction.trackProductCardClicked(trackWidgetInteraction, parentWidget, product);
|
|
51
45
|
};
|
|
52
46
|
const handleReviewCardClick = (review) => {
|
|
53
47
|
trackWidgetInteraction({
|