@envive-ai/react-toolkit-v3 0.3.10 → 0.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AnimatedText/AnimatedText.d.ts +3 -3
- package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.cts +2 -2
- package/dist/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.cts +2 -2
- package/dist/Carousel/Carousel.d.ts +2 -2
- package/dist/Carousel/components/Badge.cjs +1 -1
- package/dist/Carousel/components/Badge.js +1 -1
- package/dist/Carousel/components/Container.cjs +11 -3
- package/dist/Carousel/components/Container.js +12 -4
- 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 +3 -9
- package/dist/ChatFooter/components/Layout.js +3 -9
- package/dist/ChatFooter/components/index.d.cts +3 -3
- package/dist/ChatFooter/components/index.d.ts +5 -5
- package/dist/ChatHeader/ChatHeader.d.cts +2 -2
- package/dist/ChatHeader/ChatHeader.d.ts +2 -2
- package/dist/ChatHeader/hooks/useGetCloseButtonProperties.cjs +1 -1
- package/dist/ChatHeader/hooks/useGetCloseButtonProperties.js +1 -1
- 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 +2 -2
- package/dist/ChatPreviewComparison/components/Layout.js +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.cts +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.ts +2 -2
- package/dist/Container/Container.d.cts +5 -5
- package/dist/Container/Container.d.ts +5 -5
- 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 +6 -4
- package/dist/FloatingChat/FloatingChat.d.cts +3 -2
- package/dist/FloatingChat/FloatingChat.d.ts +3 -2
- package/dist/FloatingChat/FloatingChat.js +6 -4
- package/dist/FloatingChat/components/ChatMessages.cjs +1 -1
- package/dist/FloatingChat/components/ChatMessages.js +1 -1
- package/dist/FloatingChat/components/Layout.cjs +6 -2
- package/dist/FloatingChat/components/Layout.js +6 -2
- package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.cjs +1 -0
- package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.js +1 -0
- package/dist/FloatingChat/types/types.d.cts +4 -0
- package/dist/FloatingChat/types/types.d.ts +4 -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 +132 -0
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.cts +24 -0
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.ts +24 -0
- package/dist/FullPageSalesAgent/FullPageSalesAgent.js +131 -0
- package/dist/FullPageSalesAgent/components/Layout.cjs +53 -0
- package/dist/FullPageSalesAgent/components/Layout.js +51 -0
- package/dist/FullPageSalesAgent/components/index.cjs +7 -0
- package/dist/FullPageSalesAgent/components/index.js +7 -0
- package/dist/FullPageSalesAgent/hooks/useContainerResizerObserver.cjs +23 -0
- package/dist/FullPageSalesAgent/hooks/useContainerResizerObserver.js +22 -0
- package/dist/FullPageSalesAgent/hooks/useGetContainerStyles.cjs +16 -0
- package/dist/FullPageSalesAgent/hooks/useGetContainerStyles.js +16 -0
- package/dist/FullPageSalesAgent/hooks/useGetFooterStyles.cjs +16 -0
- package/dist/FullPageSalesAgent/hooks/useGetFooterStyles.js +16 -0
- package/dist/FullPageSalesAgent/hooks/useGetScrollContentStyles.cjs +19 -0
- package/dist/FullPageSalesAgent/hooks/useGetScrollContentStyles.js +17 -0
- package/dist/FullPageSalesAgent/hooks/useIsMobile.cjs +7 -0
- package/dist/FullPageSalesAgent/hooks/useIsMobile.js +7 -0
- package/dist/FullPageSalesAgent/index.cjs +3 -0
- package/dist/FullPageSalesAgent/index.d.cts +2 -0
- package/dist/FullPageSalesAgent/index.d.ts +2 -0
- package/dist/FullPageSalesAgent/index.js +3 -0
- package/dist/Image/Image.cjs +6 -1
- package/dist/Image/Image.d.cts +2 -2
- package/dist/Image/Image.d.ts +2 -2
- package/dist/Image/Image.js +6 -1
- package/dist/ImageGallery/ImageGallery.d.cts +2 -2
- package/dist/ImageGallery/ImageGallery.d.ts +2 -2
- package/dist/ImageGallery/components/Layout.cjs +1 -1
- package/dist/ImageGallery/components/Layout.js +1 -1
- package/dist/ImageGallery/utils/functions.cjs +1 -1
- package/dist/ImageGallery/utils/functions.js +1 -1
- package/dist/MarkdownProcessor/MarkdownProcessor.d.cts +2 -2
- package/dist/MarkdownProcessor/MarkdownProcessor.d.ts +2 -2
- package/dist/Message/components/Layout.cjs +1 -1
- package/dist/Message/components/Layout.js +1 -1
- package/dist/Message/hooks/useVariantStyleProperties.cjs +1 -1
- package/dist/Message/hooks/useVariantStyleProperties.js +1 -1
- package/dist/OrderLookupCard/OrderLookupCard.cjs +1 -1
- package/dist/OrderLookupCard/OrderLookupCard.js +1 -1
- package/dist/OrderLookupCard/components/Layout.cjs +1 -1
- package/dist/OrderLookupCard/components/Layout.js +1 -1
- package/dist/OrderLookupCard/components/MoreProductsOverlay.cjs +1 -1
- package/dist/OrderLookupCard/components/MoreProductsOverlay.js +1 -1
- package/dist/OrderLookupCard/components/ProductImageGridItem.cjs +1 -1
- package/dist/OrderLookupCard/components/ProductImageGridItem.js +1 -1
- package/dist/OrderLookupCard/components/ProductImageItem.cjs +1 -1
- package/dist/OrderLookupCard/components/ProductImageItem.js +1 -1
- package/dist/OrderLookupCard/components/ProductImagesGrid.cjs +1 -1
- package/dist/OrderLookupCard/components/ProductImagesGrid.js +1 -1
- package/dist/OrderLookupCard/components/StatusLabel.cjs +1 -1
- package/dist/OrderLookupCard/components/StatusLabel.js +1 -1
- package/dist/OrderLookupCard/components/TrackOrderLink.cjs +1 -1
- package/dist/OrderLookupCard/components/TrackOrderLink.js +1 -1
- package/dist/ProductCard/ProductCard.cjs +1 -1
- package/dist/ProductCard/ProductCard.d.cts +2 -2
- package/dist/ProductCard/ProductCard.d.ts +2 -2
- package/dist/ProductCard/ProductCard.js +1 -1
- package/dist/PromptButton/PromptButton.cjs +1 -1
- package/dist/PromptButton/PromptButton.d.cts +2 -2
- package/dist/PromptButton/PromptButton.d.ts +2 -2
- package/dist/PromptButton/PromptButton.js +1 -1
- package/dist/PromptButton/components/Layout.cjs +1 -1
- package/dist/PromptButton/components/Layout.js +1 -1
- package/dist/PromptButton/components/Loading.cjs +1 -1
- package/dist/PromptButton/components/Loading.js +1 -1
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.cts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.ts +2 -2
- package/dist/PromptButtonCarouselWithImage/components/Layout.cjs +1 -1
- package/dist/PromptButtonCarouselWithImage/components/Layout.js +1 -1
- package/dist/PromptButtonCarouselWithImage/components/Skeleton.cjs +1 -1
- package/dist/PromptButtonCarouselWithImage/components/Skeleton.js +1 -1
- package/dist/PromptCarousel/PromptCarousel.cjs +20 -29
- package/dist/PromptCarousel/PromptCarousel.d.cts +2 -2
- package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
- package/dist/PromptCarousel/PromptCarousel.js +20 -29
- 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 +4 -4
- package/dist/ReviewCard/components/index.d.ts +6 -6
- package/dist/SalesAgentProductCard/SalesAgentProductCard.cjs +2 -1
- package/dist/SalesAgentProductCard/SalesAgentProductCard.d.cts +3 -2
- package/dist/SalesAgentProductCard/SalesAgentProductCard.d.ts +3 -2
- package/dist/SalesAgentProductCard/SalesAgentProductCard.js +2 -1
- package/dist/SalesAgentProductCard/components/Container.cjs +8 -6
- package/dist/SalesAgentProductCard/components/Container.d.cts +2 -1
- package/dist/SalesAgentProductCard/components/Container.d.ts +2 -1
- package/dist/SalesAgentProductCard/components/Container.js +8 -6
- 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 +9 -8
- package/dist/SalesAgentProductCard/components/index.d.ts +9 -8
- package/dist/SalesAgentProductCard/types/types.d.cts +4 -0
- package/dist/SalesAgentProductCard/types/types.d.ts +4 -0
- package/dist/SocialProof/SocialProof.d.cts +2 -2
- package/dist/SocialProof/SocialProof.d.ts +2 -2
- 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/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/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/package.json +5 -1
- package/src/components/Carousel/components/Container.tsx +15 -3
- package/src/components/ChatFooter/components/Layout.tsx +2 -14
- package/src/components/ChatHeader/hooks/useGetCloseButtonProperties.ts +1 -1
- package/src/components/FloatingChat/FloatingChat.tsx +8 -2
- package/src/components/FloatingChat/components/Layout.tsx +3 -0
- package/src/components/FloatingChat/components/SalesAgentProductCardsCarousel.tsx +4 -3
- package/src/components/FloatingChat/types/types.ts +4 -0
- package/src/components/FullPageSalesAgent/FullPageSalesAgent.tsx +203 -0
- package/src/components/FullPageSalesAgent/components/Layout.tsx +81 -0
- package/src/components/FullPageSalesAgent/components/index.ts +5 -0
- package/src/components/FullPageSalesAgent/hooks/useContainerResizerObserver.ts +34 -0
- package/src/components/FullPageSalesAgent/hooks/useGetContainerStyles.ts +24 -0
- package/src/components/FullPageSalesAgent/hooks/useGetFooterStyles.ts +17 -0
- package/src/components/FullPageSalesAgent/hooks/useGetScrollContentStyles.ts +17 -0
- package/src/components/FullPageSalesAgent/hooks/useIsMobile.ts +3 -0
- package/src/components/FullPageSalesAgent/index.ts +1 -0
- package/src/components/Image/Image.tsx +2 -0
- package/src/components/Message/hooks/useVariantStyleProperties.ts +1 -1
- package/src/components/PromptCarousel/PromptCarousel.tsx +29 -31
- package/src/components/SalesAgentProductCard/SalesAgentProductCard.tsx +2 -0
- package/src/components/SalesAgentProductCard/components/Container.tsx +16 -9
- package/src/components/SalesAgentProductCard/types/types.ts +4 -0
- package/dist/ChatFooter/hooks/useGetButtonScrollProperties.cjs +0 -18
- package/dist/ChatFooter/hooks/useGetButtonScrollProperties.js +0 -17
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { useRef } from 'react';
|
|
1
|
+
import { useCallback, useRef } from 'react';
|
|
2
|
+
import { useScrollContainer } from 'react-indiana-drag-scroll';
|
|
2
3
|
import { Stack } from '../../Stack';
|
|
3
4
|
import { Container as ContainerComponent } from '../../Container';
|
|
4
5
|
import { useCarouselItems } from '../hooks/useCarouselItems';
|
|
@@ -27,8 +28,17 @@ export const Container = ({
|
|
|
27
28
|
previous,
|
|
28
29
|
badge,
|
|
29
30
|
}: ContainerProps) => {
|
|
31
|
+
const { ref: dragScrollRef } = useScrollContainer();
|
|
30
32
|
const scrollContainerRef = useRef<HTMLDivElement>(null);
|
|
31
33
|
|
|
34
|
+
const setRef = useCallback(
|
|
35
|
+
(el: HTMLDivElement | null) => {
|
|
36
|
+
if (typeof dragScrollRef === 'function') dragScrollRef(el);
|
|
37
|
+
scrollContainerRef.current = el;
|
|
38
|
+
},
|
|
39
|
+
[dragScrollRef],
|
|
40
|
+
);
|
|
41
|
+
|
|
32
42
|
const { items, totalItems } = useCarouselItems(children);
|
|
33
43
|
|
|
34
44
|
const { handleNext, handlePrevious } = useCarouselNavigation({
|
|
@@ -66,11 +76,13 @@ export const Container = ({
|
|
|
66
76
|
)}
|
|
67
77
|
|
|
68
78
|
<div
|
|
69
|
-
ref={
|
|
70
|
-
className="[&::-webkit-scrollbar]:hidden envive-tw-flex envive-tw-gap-4 envive-tw-overflow-x-auto
|
|
79
|
+
ref={setRef}
|
|
80
|
+
className="[&::-webkit-scrollbar]:hidden envive-tw-flex envive-tw-gap-4 envive-tw-overflow-x-auto"
|
|
71
81
|
style={{
|
|
72
82
|
scrollbarWidth: 'none',
|
|
73
83
|
msOverflowStyle: 'none',
|
|
84
|
+
cursor: 'grab',
|
|
85
|
+
userSelect: 'none',
|
|
74
86
|
}}
|
|
75
87
|
>
|
|
76
88
|
{items.map((item, index) => (
|
|
@@ -2,7 +2,6 @@ import { Container } from 'src/components/Container';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { Stack } from '../../Stack';
|
|
4
4
|
import { useGetContainerProperties } from '../hooks/useGetContainerProperties';
|
|
5
|
-
import { useGetButtonScrollProperties } from '../hooks/useGetButtonScrollProperties';
|
|
6
5
|
import { useGetChatScrollProperties } from '../hooks/useGetChatScrollProperties';
|
|
7
6
|
import { Theme } from '../../../../tokens/theme/theme';
|
|
8
7
|
|
|
@@ -35,7 +34,6 @@ export const Layout = ({
|
|
|
35
34
|
isScrolled,
|
|
36
35
|
theme,
|
|
37
36
|
});
|
|
38
|
-
const { buttonScrollClasses, buttonScrollStyle } = useGetButtonScrollProperties();
|
|
39
37
|
const { footerVisibleClasses, footerVisibleOpacityClass } = useGetChatScrollProperties(
|
|
40
38
|
isScrolled,
|
|
41
39
|
theme,
|
|
@@ -51,19 +49,9 @@ export const Layout = ({
|
|
|
51
49
|
>
|
|
52
50
|
<Stack gap={2}>
|
|
53
51
|
{!isScrolled && (
|
|
54
|
-
<
|
|
55
|
-
direction="row"
|
|
56
|
-
align="center"
|
|
57
|
-
gap="2"
|
|
58
|
-
style={buttonScrollStyle}
|
|
59
|
-
className={classNames(
|
|
60
|
-
footerVisibleClasses,
|
|
61
|
-
footerVisibleOpacityClass,
|
|
62
|
-
buttonScrollClasses,
|
|
63
|
-
)}
|
|
64
|
-
>
|
|
52
|
+
<div className={classNames(footerVisibleClasses, footerVisibleOpacityClass)}>
|
|
65
53
|
{promptSuggestions}
|
|
66
|
-
</
|
|
54
|
+
</div>
|
|
67
55
|
)}
|
|
68
56
|
{textField}
|
|
69
57
|
{!hideEnviveWatermark && !isScrolled && (
|
|
@@ -17,7 +17,7 @@ const iconClassMap = {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export const useGetCloseButtonProperties = (theme: Theme, variant: ChatHeaderVariant) => {
|
|
20
|
-
const closeButtonClasses = 'envive-tw-justify-end';
|
|
20
|
+
const closeButtonClasses = 'envive-tw-flex envive-tw-flex-1 envive-tw-justify-end';
|
|
21
21
|
const iconClasses = classNames(
|
|
22
22
|
'envive-tw-h-4 envive-tw-w-4 envive-tw-cursor-pointer',
|
|
23
23
|
iconClassMap[theme][variant],
|
|
@@ -35,6 +35,7 @@ export const FloatingChat = ({
|
|
|
35
35
|
lookAndFeelConfig,
|
|
36
36
|
isCXButtonSwitchEnabled,
|
|
37
37
|
isFloatingChatOpen,
|
|
38
|
+
debugBar,
|
|
38
39
|
onClose,
|
|
39
40
|
onToggleCXButton,
|
|
40
41
|
}: FloatingChatProps) => {
|
|
@@ -195,13 +196,17 @@ export const FloatingChat = ({
|
|
|
195
196
|
isScrolled={isMobile ? isFloatingLayout : false}
|
|
196
197
|
onChange={setQuery}
|
|
197
198
|
onSubmit={() => {
|
|
198
|
-
onTypedMessageSubmitted({
|
|
199
|
+
onTypedMessageSubmitted({
|
|
200
|
+
query,
|
|
201
|
+
userTyped: true,
|
|
202
|
+
displayLocation: ChatElementDisplayLocationV3.FLOATING_CHAT_TEXT_INPUT,
|
|
203
|
+
});
|
|
199
204
|
setAnswerSuggestions([]);
|
|
200
205
|
setGeneralSuggestions([]);
|
|
201
206
|
}}
|
|
202
207
|
textFieldPlaceholderText={chatFooterTextFieldPlaceholderText as string}
|
|
203
208
|
promptSuggestions={
|
|
204
|
-
isPendingResponse || isResponseStreaming
|
|
209
|
+
isPendingResponse || isResponseStreaming
|
|
205
210
|
? ['Loading suggestions 1...', 'Loading suggestions 2...'] // This is strings will not be shown to the user
|
|
206
211
|
: generalSuggestions
|
|
207
212
|
}
|
|
@@ -290,6 +295,7 @@ export const FloatingChat = ({
|
|
|
290
295
|
<Disclaimer disclaimerMarkdown={disclaimerText} />
|
|
291
296
|
) : undefined
|
|
292
297
|
}
|
|
298
|
+
debugBar={debugBar}
|
|
293
299
|
/>
|
|
294
300
|
);
|
|
295
301
|
|
|
@@ -19,6 +19,7 @@ type LayoutProps = {
|
|
|
19
19
|
scrollToBottomButton?: React.ReactNode;
|
|
20
20
|
disclaimer?: React.ReactNode;
|
|
21
21
|
isFloatingFooterLayout?: boolean;
|
|
22
|
+
debugBar?: React.ReactNode;
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
export const Layout = ({
|
|
@@ -35,6 +36,7 @@ export const Layout = ({
|
|
|
35
36
|
scrollToBottomButton,
|
|
36
37
|
disclaimer,
|
|
37
38
|
isFloatingFooterLayout = false,
|
|
39
|
+
debugBar,
|
|
38
40
|
}: LayoutProps) => {
|
|
39
41
|
const finalTheme = resolveTheme(theme);
|
|
40
42
|
const hasWelcomeMessage = isValidElement(welcomeMessage);
|
|
@@ -108,6 +110,7 @@ export const Layout = ({
|
|
|
108
110
|
{scrollToBottomButton}
|
|
109
111
|
</div>
|
|
110
112
|
)}
|
|
113
|
+
{debugBar && <div className="envive-debug-bar">{debugBar}</div>}
|
|
111
114
|
</Stack>
|
|
112
115
|
</Container>
|
|
113
116
|
);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { Theme } from '../../../../tokens/theme/theme';
|
|
2
|
+
import { Carousel } from '../../Carousel/Carousel';
|
|
3
|
+
import { SalesAgentProductCard } from '../../SalesAgentProductCard/SalesAgentProductCard';
|
|
1
4
|
import {
|
|
2
5
|
SalesAgentProductCardProps,
|
|
3
6
|
SalesAgentProductCardVariant,
|
|
4
7
|
} from '../../SalesAgentProductCard/types/types';
|
|
5
8
|
import { resolveTheme } from '../../utils/resolveTheme';
|
|
6
|
-
import { Carousel } from '../../Carousel/Carousel';
|
|
7
|
-
import { SalesAgentProductCard } from '../../SalesAgentProductCard/SalesAgentProductCard';
|
|
8
|
-
import { Theme } from '../../../../tokens/theme/theme';
|
|
9
9
|
|
|
10
10
|
export interface SalesAgentProductCardsCarouselProps {
|
|
11
11
|
theme: Theme;
|
|
@@ -52,6 +52,7 @@ export const SalesAgentProductCardsCarousel = ({
|
|
|
52
52
|
numberOfReviews={product.numberOfReviews}
|
|
53
53
|
image={product.image}
|
|
54
54
|
url={product.url}
|
|
55
|
+
target="_blank"
|
|
55
56
|
theme={finalTheme}
|
|
56
57
|
/>
|
|
57
58
|
))}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { ChatElementDisplayLocationV3 } from '@envive-ai/react-hooks/application/models';
|
|
2
|
+
import { HardcopyResponse } from '@envive-ai/react-hooks/contexts/hardcopyContext';
|
|
3
|
+
import { useSalesAgent } from '@envive-ai/react-hooks/contexts/salesAgentContext';
|
|
4
|
+
import { FloatingChatConfig, LookAndFeelConfig } from '@envive-ai/react-hooks/contexts/typesV3';
|
|
5
|
+
import { useRef, useState } from 'react';
|
|
6
|
+
import { ChatFooter } from '../ChatFooter';
|
|
7
|
+
import { Disclaimer } from '../Disclaimer';
|
|
8
|
+
import { FloatingChatComponents } from '../FloatingChat/components';
|
|
9
|
+
import { useChatSuggestions } from '../FloatingChat/hooks/useChatSuggestions';
|
|
10
|
+
import { useScrollToBottom } from '../FloatingChat/hooks/useScrollToBottom';
|
|
11
|
+
import { PromptButtonVariant } from '../PromptButton';
|
|
12
|
+
import { PromptCarousel, PromptCarouselRows } from '../PromptCarousel';
|
|
13
|
+
import { Theme } from '../Tokens';
|
|
14
|
+
import { resolveTheme } from '../utils/resolveTheme';
|
|
15
|
+
import { SparkleIconColor, WelcomeMessage } from '../WelcomeMessage';
|
|
16
|
+
import { FullPageSAComponents } from './components';
|
|
17
|
+
import { useGetFooterStyles } from './hooks/useGetFooterStyles';
|
|
18
|
+
import { useIsMobile } from './hooks/useIsMobile';
|
|
19
|
+
|
|
20
|
+
interface FullPageSalesAgentProps {
|
|
21
|
+
theme?: Theme;
|
|
22
|
+
floatingChatConfig: FloatingChatConfig;
|
|
23
|
+
lookAndFeelConfig: LookAndFeelConfig;
|
|
24
|
+
hardcopyContent: HardcopyResponse;
|
|
25
|
+
headerContainer?: string;
|
|
26
|
+
autoHeight?: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const FullPageSalesAgent = ({
|
|
30
|
+
theme = Theme.GLOBAL_CUSTOM,
|
|
31
|
+
floatingChatConfig,
|
|
32
|
+
lookAndFeelConfig,
|
|
33
|
+
hardcopyContent,
|
|
34
|
+
headerContainer,
|
|
35
|
+
autoHeight,
|
|
36
|
+
}: FullPageSalesAgentProps) => {
|
|
37
|
+
const resolvedTheme = resolveTheme(theme);
|
|
38
|
+
const salesAgentData = useSalesAgent();
|
|
39
|
+
const [query, setQuery] = useState('');
|
|
40
|
+
const chatMessagesRef = useRef<HTMLDivElement>(null);
|
|
41
|
+
const { footerStyles } = useGetFooterStyles();
|
|
42
|
+
const { isMobile } = useIsMobile();
|
|
43
|
+
|
|
44
|
+
const {
|
|
45
|
+
welcomeMessageIconColor,
|
|
46
|
+
ignoreFirstModelResponse,
|
|
47
|
+
neverShowSingleProductCards,
|
|
48
|
+
showVerifiedBuyer,
|
|
49
|
+
showEnviveLogo,
|
|
50
|
+
userQueryInputEnabled = true,
|
|
51
|
+
} = floatingChatConfig;
|
|
52
|
+
|
|
53
|
+
const { agentName } = lookAndFeelConfig;
|
|
54
|
+
|
|
55
|
+
const {
|
|
56
|
+
welcomeMessageTitle,
|
|
57
|
+
welcomeMessageText,
|
|
58
|
+
chatFooterTextFieldPlaceholderText,
|
|
59
|
+
disclaimerText,
|
|
60
|
+
} = hardcopyContent?.values ?? {};
|
|
61
|
+
|
|
62
|
+
const {
|
|
63
|
+
messages,
|
|
64
|
+
isResponseStreaming,
|
|
65
|
+
isPendingResponse,
|
|
66
|
+
suggestions,
|
|
67
|
+
onSuggestionClicked,
|
|
68
|
+
onTypedMessageSubmitted,
|
|
69
|
+
onFormResponseSubmitted,
|
|
70
|
+
} = salesAgentData;
|
|
71
|
+
|
|
72
|
+
const {
|
|
73
|
+
answerSuggestions,
|
|
74
|
+
generalSuggestions,
|
|
75
|
+
showAnswerSuggestions,
|
|
76
|
+
setAnswerSuggestions,
|
|
77
|
+
setGeneralSuggestions,
|
|
78
|
+
} = useChatSuggestions({
|
|
79
|
+
suggestions,
|
|
80
|
+
isPendingResponse,
|
|
81
|
+
isResponseStreaming,
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const { showScrollButton, scrollToBottom, isFloatingLayout } = useScrollToBottom({
|
|
85
|
+
messagesRef: chatMessagesRef,
|
|
86
|
+
scrollThreshold: 100,
|
|
87
|
+
footerHeight: 160,
|
|
88
|
+
autoScrollDependencies: [
|
|
89
|
+
messages,
|
|
90
|
+
isPendingResponse,
|
|
91
|
+
suggestions,
|
|
92
|
+
answerSuggestions,
|
|
93
|
+
generalSuggestions,
|
|
94
|
+
],
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const welcomeMessage = (
|
|
98
|
+
<WelcomeMessage
|
|
99
|
+
sparkleIconColor={welcomeMessageIconColor as SparkleIconColor}
|
|
100
|
+
title={welcomeMessageTitle as string}
|
|
101
|
+
text={welcomeMessageText as string}
|
|
102
|
+
theme={resolvedTheme}
|
|
103
|
+
/>
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
const footer = (
|
|
107
|
+
<ChatFooter
|
|
108
|
+
className="envive-tw-bg-background-light"
|
|
109
|
+
style={footerStyles}
|
|
110
|
+
theme={resolvedTheme}
|
|
111
|
+
isScrolled={isMobile ? isFloatingLayout : false}
|
|
112
|
+
disabled={isPendingResponse || isResponseStreaming}
|
|
113
|
+
disabledInput={!userQueryInputEnabled}
|
|
114
|
+
isLoadingPromptSuggestions={
|
|
115
|
+
isPendingResponse || isResponseStreaming || generalSuggestions.length === 0
|
|
116
|
+
}
|
|
117
|
+
hideEnviveWatermark={!showEnviveLogo}
|
|
118
|
+
textFieldPlaceholderText={chatFooterTextFieldPlaceholderText as string}
|
|
119
|
+
promptSuggestions={
|
|
120
|
+
isPendingResponse || isResponseStreaming
|
|
121
|
+
? ['Loading suggestions 1...', 'Loading suggestions 2...']
|
|
122
|
+
: generalSuggestions
|
|
123
|
+
}
|
|
124
|
+
handleButtonClick={buttonText => {
|
|
125
|
+
const suggestion = suggestions.find(s => s.content === buttonText && !s.isAnswer);
|
|
126
|
+
if (suggestion) {
|
|
127
|
+
onSuggestionClicked(suggestion, ChatElementDisplayLocationV3.FLOATING_CHAT_PROMPT_BUTTON);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
setAnswerSuggestions([]);
|
|
131
|
+
setGeneralSuggestions([]);
|
|
132
|
+
}}
|
|
133
|
+
onChange={setQuery}
|
|
134
|
+
onSubmit={() => {
|
|
135
|
+
onTypedMessageSubmitted({
|
|
136
|
+
query,
|
|
137
|
+
userTyped: true,
|
|
138
|
+
displayLocation: ChatElementDisplayLocationV3.FLOATING_CHAT_TEXT_INPUT,
|
|
139
|
+
});
|
|
140
|
+
setAnswerSuggestions([]);
|
|
141
|
+
setGeneralSuggestions([]);
|
|
142
|
+
}}
|
|
143
|
+
/>
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
const chatMessages = (
|
|
147
|
+
<FloatingChatComponents.ChatMessages
|
|
148
|
+
theme={resolvedTheme}
|
|
149
|
+
ref={chatMessagesRef}
|
|
150
|
+
isLoading={isPendingResponse && !isResponseStreaming}
|
|
151
|
+
agentName={agentName}
|
|
152
|
+
messages={messages}
|
|
153
|
+
hasFilteredMessages={false}
|
|
154
|
+
handlePreviousDiscussions={() => {}}
|
|
155
|
+
isResponseStreaming={isResponseStreaming}
|
|
156
|
+
ignoreFirstModelResponse={ignoreFirstModelResponse}
|
|
157
|
+
neverShowSingleProductCards={neverShowSingleProductCards}
|
|
158
|
+
showVerifiedBuyer={showVerifiedBuyer}
|
|
159
|
+
onFormResponseSubmitted={onFormResponseSubmitted}
|
|
160
|
+
/>
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
const answerSuggestionsComponent = (
|
|
164
|
+
<PromptCarousel
|
|
165
|
+
className="envive-tw-flex envive-tw-justify-end envive-tw-p-4 [&>div>div]:envive-tw-items-end"
|
|
166
|
+
theme={resolvedTheme}
|
|
167
|
+
promptButtonType={PromptButtonVariant.SUGGESTED_RESPONSE}
|
|
168
|
+
promptCarouselRows={PromptCarouselRows.ALWAYS_TWO}
|
|
169
|
+
promptButtonTexts={answerSuggestions}
|
|
170
|
+
handleButtonClick={buttonText => {
|
|
171
|
+
const suggestion = suggestions.find(s => s.content === buttonText && s.isAnswer);
|
|
172
|
+
if (suggestion) {
|
|
173
|
+
onSuggestionClicked(suggestion, ChatElementDisplayLocationV3.FLOATING_CHAT_PROMPT_BUTTON);
|
|
174
|
+
}
|
|
175
|
+
setAnswerSuggestions([]);
|
|
176
|
+
setGeneralSuggestions([]);
|
|
177
|
+
}}
|
|
178
|
+
/>
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
const disclaimer =
|
|
182
|
+
disclaimerText && typeof disclaimerText === 'string' ? (
|
|
183
|
+
<Disclaimer disclaimerMarkdown={disclaimerText} />
|
|
184
|
+
) : undefined;
|
|
185
|
+
|
|
186
|
+
return (
|
|
187
|
+
<FullPageSAComponents.Layout
|
|
188
|
+
theme={resolvedTheme}
|
|
189
|
+
welcomeMessage={welcomeMessage}
|
|
190
|
+
footer={footer}
|
|
191
|
+
chatMessages={chatMessages}
|
|
192
|
+
answerSuggestions={showAnswerSuggestions ? answerSuggestionsComponent : undefined}
|
|
193
|
+
scrollToBottomButton={
|
|
194
|
+
showScrollButton ? (
|
|
195
|
+
<FloatingChatComponents.ScrollToBottomButton onClick={scrollToBottom} />
|
|
196
|
+
) : undefined
|
|
197
|
+
}
|
|
198
|
+
disclaimer={disclaimer}
|
|
199
|
+
headerContainer={headerContainer}
|
|
200
|
+
autoHeight={autoHeight}
|
|
201
|
+
/>
|
|
202
|
+
);
|
|
203
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { isValidElement } from 'react';
|
|
3
|
+
import { Theme } from 'tokens/theme/theme';
|
|
4
|
+
import { Stack } from '../../Stack';
|
|
5
|
+
import { useGetContainerStyles } from '../hooks/useGetContainerStyles';
|
|
6
|
+
import { useGetFooterStyles } from '../hooks/useGetFooterStyles';
|
|
7
|
+
import { useGetScrollContentStyles } from '../hooks/useGetScrollContentStyles';
|
|
8
|
+
|
|
9
|
+
export interface LayoutProps {
|
|
10
|
+
theme: Theme;
|
|
11
|
+
welcomeMessage: React.ReactNode;
|
|
12
|
+
footer?: React.ReactNode;
|
|
13
|
+
chatMessages?: React.ReactNode;
|
|
14
|
+
answerSuggestions?: React.ReactNode;
|
|
15
|
+
scrollToBottomButton?: React.ReactNode;
|
|
16
|
+
disclaimer?: React.ReactNode;
|
|
17
|
+
headerContainer?: string;
|
|
18
|
+
autoHeight?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const Layout = ({
|
|
22
|
+
theme,
|
|
23
|
+
welcomeMessage,
|
|
24
|
+
footer,
|
|
25
|
+
chatMessages,
|
|
26
|
+
answerSuggestions,
|
|
27
|
+
scrollToBottomButton,
|
|
28
|
+
disclaimer,
|
|
29
|
+
headerContainer,
|
|
30
|
+
autoHeight,
|
|
31
|
+
}: LayoutProps) => {
|
|
32
|
+
const hasWelcomeMessage = isValidElement(welcomeMessage);
|
|
33
|
+
const hasAnswerSuggestions = isValidElement(answerSuggestions);
|
|
34
|
+
const { contentClasses, messageContainerClasses } = useGetScrollContentStyles();
|
|
35
|
+
const { footerContainerClasses } = useGetFooterStyles();
|
|
36
|
+
const { containerClasses, containerStyles } = useGetContainerStyles({
|
|
37
|
+
headerContainer,
|
|
38
|
+
autoHeight,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div
|
|
43
|
+
className={containerClasses}
|
|
44
|
+
style={containerStyles}
|
|
45
|
+
>
|
|
46
|
+
<div className={contentClasses}>
|
|
47
|
+
<Stack
|
|
48
|
+
className={messageContainerClasses}
|
|
49
|
+
direction="column"
|
|
50
|
+
justify="between"
|
|
51
|
+
>
|
|
52
|
+
{welcomeMessage}
|
|
53
|
+
{disclaimer}
|
|
54
|
+
</Stack>
|
|
55
|
+
<Stack
|
|
56
|
+
direction="column"
|
|
57
|
+
gap="0"
|
|
58
|
+
className={classNames(
|
|
59
|
+
(!hasWelcomeMessage || (hasWelcomeMessage && theme === Theme.STANDARD)) &&
|
|
60
|
+
!hasAnswerSuggestions &&
|
|
61
|
+
'envive-tw-pb-4',
|
|
62
|
+
'envive-tw-pt-4',
|
|
63
|
+
)}
|
|
64
|
+
>
|
|
65
|
+
{chatMessages}
|
|
66
|
+
{answerSuggestions}
|
|
67
|
+
</Stack>
|
|
68
|
+
</div>
|
|
69
|
+
<div className={footerContainerClasses}>
|
|
70
|
+
{scrollToBottomButton && (
|
|
71
|
+
<div className="envive-tw-h-[0px]">
|
|
72
|
+
<div className="envive-tw-ml-auto envive-tw-table envive-tw-translate-x-[-30px] envive-tw-translate-y-[-50px]">
|
|
73
|
+
{scrollToBottomButton}
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
)}
|
|
77
|
+
{footer}
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
export const useContainerResizerObserver = ({
|
|
4
|
+
headerContainer,
|
|
5
|
+
autoHeight,
|
|
6
|
+
}: {
|
|
7
|
+
headerContainer?: string;
|
|
8
|
+
autoHeight?: boolean;
|
|
9
|
+
}) => {
|
|
10
|
+
const [containerHeight, setContainerHeight] = useState<number | string>('100%');
|
|
11
|
+
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (!autoHeight) {
|
|
14
|
+
return () => {};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const watchResizing = () => {
|
|
18
|
+
const { height = 0, top = 0 } =
|
|
19
|
+
document.querySelector(headerContainer)?.getBoundingClientRect() || {};
|
|
20
|
+
setContainerHeight(window.innerHeight - (height + top));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
window.addEventListener('resize', watchResizing);
|
|
24
|
+
watchResizing();
|
|
25
|
+
|
|
26
|
+
return () => {
|
|
27
|
+
window.removeEventListener('resize', watchResizing);
|
|
28
|
+
};
|
|
29
|
+
}, [headerContainer, autoHeight]);
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
containerHeight,
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useContainerResizerObserver } from './useContainerResizerObserver';
|
|
2
|
+
|
|
3
|
+
export const useGetContainerStyles = ({
|
|
4
|
+
headerContainer,
|
|
5
|
+
autoHeight,
|
|
6
|
+
}: {
|
|
7
|
+
headerContainer?: string;
|
|
8
|
+
autoHeight?: boolean;
|
|
9
|
+
}) => {
|
|
10
|
+
const { containerHeight } = useContainerResizerObserver({
|
|
11
|
+
headerContainer,
|
|
12
|
+
autoHeight,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const containerClasses =
|
|
16
|
+
'envive-tw-mx-auto envive-tw-flex envive-tw-h-full envive-tw-max-w-[768px] envive-tw-flex-col';
|
|
17
|
+
|
|
18
|
+
const containerStyles = { height: containerHeight };
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
containerClasses,
|
|
22
|
+
containerStyles,
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useIsMobile } from './useIsMobile';
|
|
2
|
+
|
|
3
|
+
export const useGetFooterStyles = () => {
|
|
4
|
+
const { isMobile } = useIsMobile();
|
|
5
|
+
const footerStyles = !isMobile
|
|
6
|
+
? { boxShadow: '0px 2px 10px 0px rgba(0, 0, 0, 0.2)', borderWidth: '1px' }
|
|
7
|
+
: null;
|
|
8
|
+
|
|
9
|
+
const footerContainerClasses = isMobile
|
|
10
|
+
? 'envive-tw-absolute envive-tw-bottom-[0] envive-tw-left-[0] envive-tw-right-[0]'
|
|
11
|
+
: 'envive-tw-pb-5';
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
footerStyles,
|
|
15
|
+
footerContainerClasses,
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { useIsMobile } from './useIsMobile';
|
|
3
|
+
|
|
4
|
+
export const useGetScrollContentStyles = () => {
|
|
5
|
+
const { isMobile } = useIsMobile();
|
|
6
|
+
const contentClasses = classNames({
|
|
7
|
+
'envive-tw-flex-1 envive-tw-overflow-y-auto envive-tw-overflow-x-hidden envive-tw-transition-all envive-tw-duration-300 envive-tw-ease-in-out': true,
|
|
8
|
+
'envive-tw-pb-[131px]': isMobile,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const messageContainerClasses = !isMobile ? 'envive-tw-pt-4' : null;
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
contentClasses,
|
|
15
|
+
messageContainerClasses,
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FullPageSalesAgent } from './FullPageSalesAgent';
|
|
@@ -88,8 +88,10 @@ export const Image = ({
|
|
|
88
88
|
objectFitClass,
|
|
89
89
|
isLoading && 'envive-tw-opacity-0',
|
|
90
90
|
)}
|
|
91
|
+
style={{ userSelect: 'none', WebkitUserDrag: 'none' } as React.CSSProperties}
|
|
91
92
|
onLoad={handleLoad}
|
|
92
93
|
onError={handleError}
|
|
94
|
+
draggable={false}
|
|
93
95
|
{...accessibilityProps}
|
|
94
96
|
{...rest}
|
|
95
97
|
/>
|
|
@@ -20,7 +20,7 @@ export const useVariantStyleProperties = (
|
|
|
20
20
|
const variantStylesMap: Record<MessageVariant, VariantStylesProperties> = {
|
|
21
21
|
[MessageVariant.AGENT]: {
|
|
22
22
|
containerLayoutClasses: 'envive-tw-flex envive-tw-flex-col envive-tw-gap-2',
|
|
23
|
-
containerBackgroundClasses: '
|
|
23
|
+
containerBackgroundClasses: '',
|
|
24
24
|
containerBorderClasses: '',
|
|
25
25
|
containerRadiusClasses: 'envive-tw-rounded-md',
|
|
26
26
|
contentClasses: '',
|