@envive-ai/react-toolkit-v3 0.3.15 → 0.3.16
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/CSSVariablesEditor/CssVariablesEditorComponent.d.cts +2 -2
- package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.ts +2 -2
- package/dist/Carousel/Carousel.cjs +1 -1
- package/dist/Carousel/Carousel.d.cts +2 -2
- package/dist/Carousel/Carousel.d.ts +2 -2
- package/dist/Carousel/Carousel.js +1 -1
- package/dist/Carousel/components/Container.cjs +2 -2
- package/dist/Carousel/components/Container.js +2 -2
- package/dist/ChatFooter/ChatFooter.cjs +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 +2 -2
- package/dist/ChatFooter/components/Layout.js +2 -2
- package/dist/ChatFooter/components/index.d.cts +5 -5
- package/dist/ChatFooter/components/index.d.ts +5 -5
- package/dist/ChatFooter/hooks/useGetContainerProperties.cjs +1 -1
- package/dist/ChatFooter/hooks/useGetContainerProperties.js +1 -1
- package/dist/ChatHeader/ChatHeader.d.cts +2 -2
- package/dist/ChatHeader/components/Handle.cjs +8 -6
- package/dist/ChatHeader/components/Handle.js +8 -6
- package/dist/ChatHeader/components/Toggle.cjs +3 -3
- package/dist/ChatHeader/components/Toggle.js +3 -3
- package/dist/ChatPreview/ChatPreview.cjs +15 -6
- package/dist/ChatPreview/ChatPreview.d.cts +2 -2
- package/dist/ChatPreview/ChatPreview.d.ts +2 -2
- package/dist/ChatPreview/ChatPreview.js +15 -6
- package/dist/ChatPreview/components/Message.cjs +3 -2
- package/dist/ChatPreview/components/Message.js +3 -2
- package/dist/ChatPreview/types/types.d.cts +34 -2
- package/dist/ChatPreview/types/types.d.ts +34 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.cjs +12 -5
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.cts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.ts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.js +12 -5
- package/dist/ChatPreviewComparison/components/Headline.cjs +2 -2
- package/dist/ChatPreviewComparison/components/Headline.js +2 -2
- package/dist/ChatPreviewComparison/components/Layout.cjs +4 -4
- package/dist/ChatPreviewComparison/components/Layout.js +4 -4
- package/dist/ChatPreviewComparison/components/Message.cjs +5 -4
- package/dist/ChatPreviewComparison/components/Message.js +5 -4
- package/dist/ChatPreviewComparison/types/types.d.cts +34 -1
- package/dist/ChatPreviewComparison/types/types.d.ts +34 -1
- package/dist/ChatPreviewLoading/ChatPreviewLoading.cjs +1 -1
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.cts +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.ts +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.js +1 -1
- package/dist/Container/Container.d.cts +173 -173
- package/dist/Container/Container.d.ts +173 -173
- package/dist/DesignTokens/DesignTokensComponent.d.cts +2 -2
- package/dist/DesignTokens/DesignTokensComponent.d.ts +2 -2
- package/dist/Disclaimer/components/Container.cjs +2 -2
- package/dist/Disclaimer/components/Container.js +2 -2
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.cts +2 -2
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.ts +2 -2
- package/dist/DocumentRetrievalCard/components/Layout.cjs +2 -2
- package/dist/DocumentRetrievalCard/components/Layout.js +2 -2
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.cjs +1 -1
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.js +1 -1
- package/dist/FloatingButton/FloatingButton.d.cts +2 -2
- package/dist/FloatingButton/FloatingButton.d.ts +2 -2
- package/dist/FloatingChat/FloatingChat.cjs +4 -8
- package/dist/FloatingChat/FloatingChat.d.cts +2 -2
- package/dist/FloatingChat/FloatingChat.d.ts +2 -2
- package/dist/FloatingChat/FloatingChat.js +4 -8
- package/dist/FloatingChat/components/AgentMessage.cjs +1 -2
- package/dist/FloatingChat/components/AgentMessage.js +1 -2
- package/dist/FloatingChat/components/ChatMessages.cjs +2 -3
- package/dist/FloatingChat/components/ChatMessages.js +2 -3
- package/dist/FloatingChat/components/Layout.cjs +3 -3
- package/dist/FloatingChat/components/Layout.js +3 -3
- package/dist/FloatingChat/components/ModalSheet.cjs +13 -3
- package/dist/FloatingChat/components/ModalSheet.js +14 -4
- package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.cjs +2 -3
- package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.js +2 -3
- package/dist/FloatingChat/hooks/useFilteredChatMessages.cjs +1 -1
- package/dist/FloatingChat/hooks/useFilteredChatMessages.js +1 -1
- package/dist/FloatingChat/hooks/useSnapControl.cjs +17 -16
- package/dist/FloatingChat/hooks/useSnapControl.js +17 -16
- package/dist/FloatingChat/hooks/useSnapSetup.cjs +9 -27
- package/dist/FloatingChat/hooks/useSnapSetup.js +10 -28
- package/dist/FloatingChat/snapConstants.cjs +10 -0
- package/dist/FloatingChat/snapConstants.js +7 -0
- package/dist/FullPageSalesAgent/FullPageSalesAgent.cjs +6 -3
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.ts +2 -2
- package/dist/FullPageSalesAgent/FullPageSalesAgent.js +6 -3
- package/dist/FullPageSalesAgent/components/Layout.cjs +3 -1
- package/dist/FullPageSalesAgent/components/Layout.js +3 -1
- package/dist/FullPageSalesAgent/hooks/useGetFooterStyles.cjs +2 -1
- package/dist/FullPageSalesAgent/hooks/useGetFooterStyles.js +2 -1
- package/dist/FullPageSalesAgent/hooks/useGetMessagesStyles.cjs +10 -0
- package/dist/FullPageSalesAgent/hooks/useGetMessagesStyles.js +10 -0
- package/dist/FullPageSalesAgent/hooks/useGetScrollContentStyles.cjs +4 -2
- package/dist/FullPageSalesAgent/hooks/useGetScrollContentStyles.js +4 -2
- package/dist/Image/Image.d.cts +2 -2
- package/dist/Image/Image.d.ts +2 -2
- package/dist/ImageGallery/ImageGallery.d.cts +2 -2
- package/dist/ImageGallery/components/Layout.cjs +1 -1
- package/dist/ImageGallery/components/Layout.js +1 -1
- package/dist/MarkdownProcessor/MarkdownProcessor.cjs +2 -1
- package/dist/MarkdownProcessor/MarkdownProcessor.d.cts +2 -2
- package/dist/MarkdownProcessor/MarkdownProcessor.d.ts +2 -2
- package/dist/MarkdownProcessor/MarkdownProcessor.js +2 -1
- package/dist/Message/components/LinkButton.cjs +1 -1
- package/dist/Message/components/LinkButton.js +1 -1
- package/dist/OrderLookupCard/OrderLookupCard.cjs +1 -1
- package/dist/OrderLookupCard/OrderLookupCard.js +1 -1
- package/dist/ProductCard/ProductCard.cjs +10 -4
- package/dist/ProductCard/ProductCard.d.cts +8 -2
- package/dist/ProductCard/ProductCard.d.ts +8 -2
- package/dist/ProductCard/ProductCard.js +10 -4
- package/dist/ProductCard/components/Carousel.cjs +9 -3
- package/dist/ProductCard/components/Carousel.js +9 -3
- package/dist/ProductCard/types/index.d.cts +34 -0
- package/dist/ProductCard/types/index.d.ts +34 -0
- package/dist/PromptButton/PromptButton.d.cts +2 -2
- package/dist/PromptButton/PromptButton.d.ts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.cts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.ts +2 -2
- package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.cjs +1 -1
- package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.js +1 -1
- package/dist/PromptCarousel/PromptCarousel.cjs +3 -3
- package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
- package/dist/PromptCarousel/PromptCarousel.js +3 -3
- package/dist/ReviewCard/ReviewCard.d.cts +2 -2
- package/dist/ReviewCard/ReviewCard.d.ts +2 -2
- package/dist/ReviewCard/components/Container.cjs +2 -2
- package/dist/ReviewCard/components/Container.js +2 -2
- package/dist/ReviewCard/components/ReadMoreButton.cjs +1 -1
- package/dist/ReviewCard/components/ReadMoreButton.js +1 -1
- package/dist/ReviewCard/components/index.d.cts +6 -6
- 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 +2 -2
- package/dist/SalesAgentProductCard/components/Container.js +2 -2
- package/dist/SalesAgentProductCard/components/index.d.cts +6 -6
- package/dist/SalesAgentProductCard/components/index.d.ts +6 -6
- package/dist/SocialProof/SocialProof.cjs +5 -5
- package/dist/SocialProof/SocialProof.d.cts +2 -2
- package/dist/SocialProof/SocialProof.d.ts +2 -2
- package/dist/SocialProof/SocialProof.js +2 -2
- package/dist/SocialProof/components/Headline.cjs +3 -3
- package/dist/SocialProof/components/Headline.js +3 -3
- package/dist/SocialProof/components/LayoutFourHorizontal.cjs +1 -1
- package/dist/SocialProof/components/LayoutFourHorizontal.js +1 -1
- package/dist/SocialProof/components/Subheadline.cjs +1 -1
- package/dist/SocialProof/components/Subheadline.js +1 -1
- package/dist/SparkleAnimation/SparkleAnimation.d.cts +2 -2
- package/dist/SparkleAnimation/SparkleAnimation.d.ts +2 -2
- package/dist/Stack/Stack.d.ts +2 -2
- package/dist/TitledPromptCarousel/TitledPromptCarousel.cjs +1 -1
- package/dist/TitledPromptCarousel/TitledPromptCarousel.d.cts +2 -2
- package/dist/TitledPromptCarousel/TitledPromptCarousel.js +1 -1
- package/dist/Tokens/index.cjs +1 -1
- package/dist/Tokens/index.js +1 -1
- package/dist/TypingAnimation/TypingAnimation.cjs +9 -3
- package/dist/TypingAnimation/TypingAnimation.d.cts +2 -2
- package/dist/TypingAnimation/TypingAnimation.d.ts +2 -2
- package/dist/TypingAnimation/TypingAnimation.js +9 -3
- package/dist/TypingAnimation/hooks/useGetTypographyVariant.cjs +1 -1
- package/dist/TypingAnimation/hooks/useGetTypographyVariant.js +1 -1
- package/dist/TypingAnimation/types/index.d.cts +28 -0
- package/dist/TypingAnimation/types/index.d.ts +28 -0
- package/dist/Typography/Typography.d.ts +4 -4
- package/dist/WelcomeMessage/components/Container.cjs +2 -2
- package/dist/WelcomeMessage/components/Container.js +2 -2
- package/dist/WidgetTextField/WidgetTextField.cjs +1 -1
- package/dist/WidgetTextField/WidgetTextField.d.ts +2 -2
- package/dist/WidgetTextField/WidgetTextField.js +1 -1
- package/dist/WidgetTextField/components/Container.cjs +2 -2
- package/dist/WidgetTextField/components/Container.js +2 -2
- package/dist/WidgetTextField/components/Icon.cjs +3 -3
- package/dist/WidgetTextField/components/Icon.js +3 -3
- package/dist/WidgetWrapper/WidgetWrapper.d.cts +2 -2
- package/dist/WidgetWrapper/WidgetWrapper.d.ts +2 -2
- package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.cts +2 -2
- package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.ts +2 -2
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/ChatFooter/__tests__/ChatFooter.test.tsx +3 -0
- package/src/components/ChatFooter/hooks/useGetContainerProperties.ts +1 -1
- package/src/components/ChatHeader/components/Handle.tsx +14 -4
- package/src/components/ChatPreview/ChatPreview.tsx +27 -6
- package/src/components/ChatPreview/__tests__/ChatPreview.test.tsx +16 -5
- package/src/components/ChatPreview/components/Message.tsx +3 -1
- package/src/components/ChatPreview/types/types.ts +35 -2
- package/src/components/ChatPreviewComparison/ChatPreviewComparison.tsx +23 -6
- package/src/components/ChatPreviewComparison/__tests__/ChatPreviewComparison.test.tsx +16 -5
- package/src/components/ChatPreviewComparison/components/Message.tsx +7 -1
- package/src/components/ChatPreviewComparison/types/types.ts +35 -1
- package/src/components/FloatingChat/FloatingChat.tsx +3 -9
- package/src/components/FloatingChat/components/AgentMessage.tsx +0 -3
- package/src/components/FloatingChat/components/ChatMessages.tsx +0 -3
- package/src/components/FloatingChat/components/ModalSheet.tsx +18 -10
- package/src/components/FloatingChat/components/SalesAgentProductCardsCarousel.tsx +1 -5
- package/src/components/FloatingChat/hooks/useFilteredChatMessages.ts +2 -2
- package/src/components/FloatingChat/hooks/useScrollToBottom.ts +1 -0
- package/src/components/FloatingChat/hooks/useSnapControl.ts +17 -22
- package/src/components/FloatingChat/hooks/useSnapSetup.ts +16 -37
- package/src/components/FloatingChat/snapConstants.ts +7 -0
- package/src/components/FullPageSalesAgent/FullPageSalesAgent.tsx +5 -2
- package/src/components/FullPageSalesAgent/components/Layout.tsx +3 -1
- package/src/components/FullPageSalesAgent/hooks/useGetFooterStyles.ts +7 -2
- package/src/components/FullPageSalesAgent/hooks/useGetMessagesStyles.ts +11 -0
- package/src/components/FullPageSalesAgent/hooks/useGetScrollContentStyles.ts +5 -1
- package/src/components/MarkdownProcessor/MarkdownProcessor.tsx +1 -1
- package/src/components/Message/__tests__/Message.test.tsx +3 -3
- package/src/components/ProductCard/ProductCard.tsx +13 -1
- package/src/components/ProductCard/__tests__/ProductCard.test.tsx +73 -1
- package/src/components/ProductCard/components/Carousel.tsx +13 -1
- package/src/components/ProductCard/types/index.ts +34 -0
- package/src/components/TypingAnimation/TypingAnimation.tsx +22 -7
- package/src/components/TypingAnimation/types/index.ts +29 -0
- package/src/components/WidgetTextField/components/Icon.tsx +2 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { AnimatedTextProps } from "./types/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react7 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/AnimatedText/AnimatedText.d.ts
|
|
5
|
-
declare const AnimatedText:
|
|
5
|
+
declare const AnimatedText: react7.MemoExoticComponent<({
|
|
6
6
|
sequence,
|
|
7
7
|
typingDuration,
|
|
8
8
|
transition,
|
|
9
9
|
loop,
|
|
10
10
|
getNodeWrapper
|
|
11
|
-
}: AnimatedTextProps) =>
|
|
11
|
+
}: AnimatedTextProps) => react7.ReactNode>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { AnimatedText };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime26 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/CSSVariablesEditor/CssVariablesEditorComponent.d.ts
|
|
4
4
|
declare const CssVariablesEditorComponent: ({
|
|
5
5
|
selectedMerchantName
|
|
6
6
|
}: {
|
|
7
7
|
selectedMerchantName: string;
|
|
8
|
-
}) =>
|
|
8
|
+
}) => react_jsx_runtime26.JSX.Element;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { CssVariablesEditorComponent };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime36 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/CSSVariablesEditor/CssVariablesEditorComponent.d.ts
|
|
4
4
|
declare const CssVariablesEditorComponent: ({
|
|
5
5
|
selectedMerchantName
|
|
6
6
|
}: {
|
|
7
7
|
selectedMerchantName: string;
|
|
8
|
-
}) =>
|
|
8
|
+
}) => react_jsx_runtime36.JSX.Element;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { CssVariablesEditorComponent };
|
|
@@ -1,7 +1,7 @@
|
|
|
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
|
-
const require_index = require('./components/index.cjs');
|
|
4
3
|
const require_resolveTheme = require('../utils/resolveTheme.cjs');
|
|
4
|
+
const require_index = require('./components/index.cjs');
|
|
5
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
6
|
|
|
7
7
|
//#region src/components/Carousel/Carousel.tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CarouselProps } from "./types/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime27 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Carousel/Carousel.d.ts
|
|
5
5
|
declare const Carousel: ({
|
|
@@ -11,6 +11,6 @@ declare const Carousel: ({
|
|
|
11
11
|
badgeLabel,
|
|
12
12
|
theme,
|
|
13
13
|
hideNavigation
|
|
14
|
-
}: CarouselProps) =>
|
|
14
|
+
}: CarouselProps) => react_jsx_runtime27.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { Carousel };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CarouselProps } from "./types/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime34 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Carousel/Carousel.d.ts
|
|
5
5
|
declare const Carousel: ({
|
|
@@ -11,6 +11,6 @@ declare const Carousel: ({
|
|
|
11
11
|
badgeLabel,
|
|
12
12
|
theme,
|
|
13
13
|
hideNavigation
|
|
14
|
-
}: CarouselProps) =>
|
|
14
|
+
}: CarouselProps) => react_jsx_runtime34.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { Carousel };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Theme } from "../packages/components-v3/tokens/theme/theme.js";
|
|
2
|
-
import { CarouselComponents } from "./components/index.js";
|
|
3
2
|
import { resolveTheme } from "../utils/resolveTheme.js";
|
|
3
|
+
import { CarouselComponents } from "./components/index.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/components/Carousel/Carousel.tsx
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_Stack = require('../../Stack/Stack.cjs');
|
|
3
|
-
require('../../Stack/index.cjs');
|
|
4
2
|
const require_Container = require('../../Container/Container.cjs');
|
|
5
3
|
require('../../Container/index.cjs');
|
|
4
|
+
const require_Stack = require('../../Stack/Stack.cjs');
|
|
5
|
+
require('../../Stack/index.cjs');
|
|
6
6
|
const require_useCarouselItems = require('../hooks/useCarouselItems.cjs');
|
|
7
7
|
const require_useCarouselNavigation = require('../hooks/useCarouselNavigation.cjs');
|
|
8
8
|
const require_useCarouselNavigationButtons = require('../hooks/useCarouselNavigationButtons.cjs');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Stack } from "../../Stack/Stack.js";
|
|
2
|
-
import "../../Stack/index.js";
|
|
3
1
|
import { Container } from "../../Container/Container.js";
|
|
4
2
|
import "../../Container/index.js";
|
|
3
|
+
import { Stack } from "../../Stack/Stack.js";
|
|
4
|
+
import "../../Stack/index.js";
|
|
5
5
|
import { useCarouselItems } from "../hooks/useCarouselItems.js";
|
|
6
6
|
import { useCarouselNavigation } from "../hooks/useCarouselNavigation.js";
|
|
7
7
|
import { useCarouselNavigationButtons } from "../hooks/useCarouselNavigationButtons.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
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
|
-
const require_resolveTheme = require('../utils/resolveTheme.cjs');
|
|
4
3
|
require('../Tokens/index.cjs');
|
|
4
|
+
const require_resolveTheme = require('../utils/resolveTheme.cjs');
|
|
5
5
|
const require_useGetChatScrollProperties = require('./hooks/useGetChatScrollProperties.cjs');
|
|
6
6
|
const require_index = require('./components/index.cjs');
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatFooterProps } from "./types/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime30 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ChatFooter/ChatFooter.d.ts
|
|
5
5
|
declare const ChatFooter: ({
|
|
@@ -20,6 +20,6 @@ declare const ChatFooter: ({
|
|
|
20
20
|
isLoadingPromptSuggestions,
|
|
21
21
|
disabledInput,
|
|
22
22
|
parentWidget
|
|
23
|
-
}: ChatFooterProps) =>
|
|
23
|
+
}: ChatFooterProps) => react_jsx_runtime30.JSX.Element;
|
|
24
24
|
//#endregion
|
|
25
25
|
export { ChatFooter };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatFooterProps } from "./types/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime27 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ChatFooter/ChatFooter.d.ts
|
|
5
5
|
declare const ChatFooter: ({
|
|
@@ -20,6 +20,6 @@ declare const ChatFooter: ({
|
|
|
20
20
|
isLoadingPromptSuggestions,
|
|
21
21
|
disabledInput,
|
|
22
22
|
parentWidget
|
|
23
|
-
}: ChatFooterProps) =>
|
|
23
|
+
}: ChatFooterProps) => react_jsx_runtime27.JSX.Element;
|
|
24
24
|
//#endregion
|
|
25
25
|
export { ChatFooter };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Theme } from "../packages/components-v3/tokens/theme/theme.js";
|
|
2
|
-
import { resolveTheme } from "../utils/resolveTheme.js";
|
|
3
2
|
import "../Tokens/index.js";
|
|
3
|
+
import { resolveTheme } from "../utils/resolveTheme.js";
|
|
4
4
|
import { useGetChatScrollProperties } from "./hooks/useGetChatScrollProperties.js";
|
|
5
5
|
import { ChatFooterComponents } from "./components/index.js";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_Stack = require('../../Stack/Stack.cjs');
|
|
3
|
-
require('../../Stack/index.cjs');
|
|
4
2
|
const require_Container = require('../../Container/Container.cjs');
|
|
5
3
|
require('../../Container/index.cjs');
|
|
4
|
+
const require_Stack = require('../../Stack/Stack.cjs');
|
|
5
|
+
require('../../Stack/index.cjs');
|
|
6
6
|
const require_useGetContainerProperties = require('../hooks/useGetContainerProperties.cjs');
|
|
7
7
|
const require_useGetChatScrollProperties = require('../hooks/useGetChatScrollProperties.cjs');
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Stack } from "../../Stack/Stack.js";
|
|
2
|
-
import "../../Stack/index.js";
|
|
3
1
|
import { Container } from "../../Container/Container.js";
|
|
4
2
|
import "../../Container/index.js";
|
|
3
|
+
import { Stack } from "../../Stack/Stack.js";
|
|
4
|
+
import "../../Stack/index.js";
|
|
5
5
|
import { useGetContainerProperties } from "../hooks/useGetContainerProperties.js";
|
|
6
6
|
import { useGetChatScrollProperties } from "../hooks/useGetChatScrollProperties.js";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LayoutProps } from "./Layout.cjs";
|
|
2
2
|
import { PromptSuggestionsProps } from "./PromptSuggestions.cjs";
|
|
3
3
|
import { TextFieldProps } from "../../TextField/types/index.cjs";
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
4
|
+
import * as react9 from "react";
|
|
5
|
+
import * as react_jsx_runtime28 from "react/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/components/ChatFooter/components/index.d.ts
|
|
8
8
|
declare const ChatFooterComponents: {
|
|
@@ -17,13 +17,13 @@ declare const ChatFooterComponents: {
|
|
|
17
17
|
testId,
|
|
18
18
|
className,
|
|
19
19
|
style
|
|
20
|
-
}: LayoutProps) =>
|
|
20
|
+
}: LayoutProps) => react_jsx_runtime28.JSX.Element;
|
|
21
21
|
EnviveLogo: ({
|
|
22
22
|
style
|
|
23
23
|
}: {
|
|
24
24
|
className?: string;
|
|
25
25
|
style?: React.CSSProperties;
|
|
26
|
-
}) =>
|
|
26
|
+
}) => react9.ReactElement<react9.SVGProps<SVGSVGElement>, string | react9.JSXElementConstructor<any>>;
|
|
27
27
|
PromptSuggestions: ({
|
|
28
28
|
theme,
|
|
29
29
|
suggestions,
|
|
@@ -32,7 +32,7 @@ declare const ChatFooterComponents: {
|
|
|
32
32
|
style,
|
|
33
33
|
disabled,
|
|
34
34
|
parentWidget
|
|
35
|
-
}: PromptSuggestionsProps) =>
|
|
35
|
+
}: PromptSuggestionsProps) => react_jsx_runtime28.JSX.Element;
|
|
36
36
|
TextField: ({
|
|
37
37
|
theme,
|
|
38
38
|
placeholder,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LayoutProps } from "./Layout.js";
|
|
2
2
|
import { PromptSuggestionsProps } from "./PromptSuggestions.js";
|
|
3
3
|
import { TextFieldProps } from "../../TextField/types/index.js";
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
4
|
+
import * as react10 from "react";
|
|
5
|
+
import * as react_jsx_runtime25 from "react/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/components/ChatFooter/components/index.d.ts
|
|
8
8
|
declare const ChatFooterComponents: {
|
|
@@ -17,13 +17,13 @@ declare const ChatFooterComponents: {
|
|
|
17
17
|
testId,
|
|
18
18
|
className,
|
|
19
19
|
style
|
|
20
|
-
}: LayoutProps) =>
|
|
20
|
+
}: LayoutProps) => react_jsx_runtime25.JSX.Element;
|
|
21
21
|
EnviveLogo: ({
|
|
22
22
|
style
|
|
23
23
|
}: {
|
|
24
24
|
className?: string;
|
|
25
25
|
style?: React.CSSProperties;
|
|
26
|
-
}) =>
|
|
26
|
+
}) => react10.ReactElement<react10.SVGProps<SVGSVGElement>, string | react10.JSXElementConstructor<any>>;
|
|
27
27
|
PromptSuggestions: ({
|
|
28
28
|
theme,
|
|
29
29
|
suggestions,
|
|
@@ -32,7 +32,7 @@ declare const ChatFooterComponents: {
|
|
|
32
32
|
style,
|
|
33
33
|
disabled,
|
|
34
34
|
parentWidget
|
|
35
|
-
}: PromptSuggestionsProps) =>
|
|
35
|
+
}: PromptSuggestionsProps) => react_jsx_runtime25.JSX.Element;
|
|
36
36
|
TextField: ({
|
|
37
37
|
theme,
|
|
38
38
|
placeholder,
|
|
@@ -12,7 +12,7 @@ const useGetContainerProperties = ({ isScrolled, theme }) => {
|
|
|
12
12
|
}[theme] ?? "";
|
|
13
13
|
}, [theme, isScrolled]);
|
|
14
14
|
return {
|
|
15
|
-
baseClassName: `envive-tw-w-full envive-tw-border-border-light ${!isScrolled ? "envive-tw-
|
|
15
|
+
baseClassName: `envive-tw-w-full envive-tw-border-border-light ${!isScrolled ? "envive-tw-bg-[color-mix(in_srgb,var(--envive-colors-background-light),transparent_10%)] envive-tw-backdrop-blur-[12px]" : ""}`,
|
|
16
16
|
themeContainerClassNames
|
|
17
17
|
};
|
|
18
18
|
};
|
|
@@ -11,7 +11,7 @@ const useGetContainerProperties = ({ isScrolled, theme }) => {
|
|
|
11
11
|
}[theme] ?? "";
|
|
12
12
|
}, [theme, isScrolled]);
|
|
13
13
|
return {
|
|
14
|
-
baseClassName: `envive-tw-w-full envive-tw-border-border-light ${!isScrolled ? "envive-tw-
|
|
14
|
+
baseClassName: `envive-tw-w-full envive-tw-border-border-light ${!isScrolled ? "envive-tw-bg-[color-mix(in_srgb,var(--envive-colors-background-light),transparent_10%)] envive-tw-backdrop-blur-[12px]" : ""}`,
|
|
15
15
|
themeContainerClassNames
|
|
16
16
|
};
|
|
17
17
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatHeaderProps } from "./types/index.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime18 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ChatHeader/ChatHeader.d.ts
|
|
5
5
|
declare const ChatHeader: ({
|
|
@@ -21,6 +21,6 @@ declare const ChatHeader: ({
|
|
|
21
21
|
headerBgColor,
|
|
22
22
|
onClose,
|
|
23
23
|
onToggle
|
|
24
|
-
}: ChatHeaderProps) =>
|
|
24
|
+
}: ChatHeaderProps) => react_jsx_runtime18.JSX.Element;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { ChatHeader };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_Stack = require('../../Stack/Stack.cjs');
|
|
3
|
-
require('../../Stack/index.cjs');
|
|
4
2
|
const require_Container = require('../../Container/Container.cjs');
|
|
5
3
|
require('../../Container/index.cjs');
|
|
4
|
+
const require_Stack = require('../../Stack/Stack.cjs');
|
|
5
|
+
require('../../Stack/index.cjs');
|
|
6
|
+
const require_snapConstants = require('../../FloatingChat/snapConstants.cjs');
|
|
6
7
|
const require_useGetHandleProperties = require('../hooks/useGetHandleProperties.cjs');
|
|
7
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
9
|
let framer_motion = require("framer-motion");
|
|
@@ -10,12 +11,13 @@ let framer_motion = require("framer-motion");
|
|
|
10
11
|
//#region src/components/ChatHeader/components/Handle.tsx
|
|
11
12
|
const Handle = ({ theme, variant, state, animationKey }) => {
|
|
12
13
|
const { containerClasses, leftBar, rightBar } = require_useGetHandleProperties.useGetHandleProperties(theme, variant, state);
|
|
13
|
-
const
|
|
14
|
-
const
|
|
14
|
+
const swipeviewFactor = require_snapConstants.MAX_SWIPEABLE_VIEW_HEIGHT / 100;
|
|
15
|
+
const closetSheetHeight = Math.floor(window.innerHeight * swipeviewFactor);
|
|
16
|
+
const snapFullView = 0;
|
|
15
17
|
const defaultAnimationKey = (0, framer_motion.useMotionValue)(0);
|
|
16
18
|
const activeAnimationKey = animationKey || defaultAnimationKey;
|
|
17
|
-
const leftRotation = (0, framer_motion.useTransform)(activeAnimationKey, [
|
|
18
|
-
const rightRotation = (0, framer_motion.useTransform)(activeAnimationKey, [
|
|
19
|
+
const leftRotation = (0, framer_motion.useTransform)(activeAnimationKey, [snapFullView, closetSheetHeight], [0, -10]);
|
|
20
|
+
const rightRotation = (0, framer_motion.useTransform)(activeAnimationKey, [snapFullView, closetSheetHeight], [0, 10]);
|
|
19
21
|
if (animationKey) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Container.Container, {
|
|
20
22
|
className: containerClasses,
|
|
21
23
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Stack.Stack, {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Stack } from "../../Stack/Stack.js";
|
|
2
|
-
import "../../Stack/index.js";
|
|
3
1
|
import { Container } from "../../Container/Container.js";
|
|
4
2
|
import "../../Container/index.js";
|
|
3
|
+
import { Stack } from "../../Stack/Stack.js";
|
|
4
|
+
import "../../Stack/index.js";
|
|
5
|
+
import { MAX_SWIPEABLE_VIEW_HEIGHT } from "../../FloatingChat/snapConstants.js";
|
|
5
6
|
import { useGetHandleProperties } from "../hooks/useGetHandleProperties.js";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
import { motion, useMotionValue, useTransform } from "framer-motion";
|
|
@@ -9,12 +10,13 @@ import { motion, useMotionValue, useTransform } from "framer-motion";
|
|
|
9
10
|
//#region src/components/ChatHeader/components/Handle.tsx
|
|
10
11
|
const Handle = ({ theme, variant, state, animationKey }) => {
|
|
11
12
|
const { containerClasses, leftBar, rightBar } = useGetHandleProperties(theme, variant, state);
|
|
12
|
-
const
|
|
13
|
-
const
|
|
13
|
+
const swipeviewFactor = MAX_SWIPEABLE_VIEW_HEIGHT / 100;
|
|
14
|
+
const closetSheetHeight = Math.floor(window.innerHeight * swipeviewFactor);
|
|
15
|
+
const snapFullView = 0;
|
|
14
16
|
const defaultAnimationKey = useMotionValue(0);
|
|
15
17
|
const activeAnimationKey = animationKey || defaultAnimationKey;
|
|
16
|
-
const leftRotation = useTransform(activeAnimationKey, [
|
|
17
|
-
const rightRotation = useTransform(activeAnimationKey, [
|
|
18
|
+
const leftRotation = useTransform(activeAnimationKey, [snapFullView, closetSheetHeight], [0, -10]);
|
|
19
|
+
const rightRotation = useTransform(activeAnimationKey, [snapFullView, closetSheetHeight], [0, 10]);
|
|
18
20
|
if (animationKey) return /* @__PURE__ */ jsx(Container, {
|
|
19
21
|
className: containerClasses,
|
|
20
22
|
children: /* @__PURE__ */ jsxs(Stack, {
|
|
@@ -1,10 +1,10 @@
|
|
|
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
|
-
const
|
|
4
|
-
require('../../Stack/index.cjs');
|
|
3
|
+
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
5
4
|
const require_Container = require('../../Container/Container.cjs');
|
|
6
5
|
require('../../Container/index.cjs');
|
|
7
|
-
const
|
|
6
|
+
const require_Stack = require('../../Stack/Stack.cjs');
|
|
7
|
+
require('../../Stack/index.cjs');
|
|
8
8
|
const require_index = require('../types/index.cjs');
|
|
9
9
|
const require_useGetToggleProperties = require('../hooks/useGetToggleProperties.cjs');
|
|
10
10
|
const require_ToggleItem = require('./ToggleItem.cjs');
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
|
|
2
|
-
import {
|
|
3
|
-
import "../../Stack/index.js";
|
|
2
|
+
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
4
3
|
import { Container } from "../../Container/Container.js";
|
|
5
4
|
import "../../Container/index.js";
|
|
6
|
-
import {
|
|
5
|
+
import { Stack } from "../../Stack/Stack.js";
|
|
6
|
+
import "../../Stack/index.js";
|
|
7
7
|
import { ChatHeaderOptions } from "../types/index.js";
|
|
8
8
|
import { useGetToggleProperties } from "../hooks/useGetToggleProperties.js";
|
|
9
9
|
import { ToggleItem } from "./ToggleItem.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
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
|
-
const require_resolveTheme = require('../utils/resolveTheme.cjs');
|
|
4
3
|
require('../Tokens/index.cjs');
|
|
4
|
+
const require_resolveTheme = require('../utils/resolveTheme.cjs');
|
|
5
5
|
const require_PromptButton_types_index = require('../PromptButton/types/index.cjs');
|
|
6
6
|
require('../PromptButton/index.cjs');
|
|
7
7
|
const require_PromptCarousel_types_types = require('../PromptCarousel/types/types.cjs');
|
|
8
8
|
const require_PromptCarousel = require('../PromptCarousel/PromptCarousel.cjs');
|
|
9
9
|
require('../PromptCarousel/index.cjs');
|
|
10
|
-
const require_types = require('../WidgetWrapper/types/types.cjs');
|
|
11
|
-
const require_index = require('./components/index.cjs');
|
|
12
10
|
const require_WidgetTextField = require('../WidgetTextField/WidgetTextField.cjs');
|
|
13
11
|
require('../WidgetTextField/index.cjs');
|
|
12
|
+
const require_types = require('../WidgetWrapper/types/types.cjs');
|
|
14
13
|
const require_WidgetWrapperWithTitle = require('../WidgetWrapperWithTitle/WidgetWrapperWithTitle.cjs');
|
|
14
|
+
const require_index = require('./components/index.cjs');
|
|
15
15
|
let react = require("react");
|
|
16
16
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
17
17
|
|
|
@@ -20,7 +20,7 @@ const ChatPreview = ({ baseProps, widgetContentProps, widgetStyleProps, widgetEv
|
|
|
20
20
|
const { id, testId, className, style } = baseProps ?? {};
|
|
21
21
|
const { theme = require_theme.Theme.GLOBAL_CUSTOM, variant = require_types.WidgetWrapperVariant.CARD_WITH_BORDER, hideTextField, hideLogo, hexCardColor } = widgetStyleProps ?? {};
|
|
22
22
|
const { messageText, promptButtons, textFieldPlaceholderText, logoSrc, titleLabel } = widgetContentProps ?? {};
|
|
23
|
-
const { handlePromptButtonClick, handleTextFieldClick } = widgetEventProps ?? {};
|
|
23
|
+
const { handlePromptButtonClick, handlePromptButtonDrag, handlePromptButtonHover, handlePromptButtonMouseDown, handlePromptButtonMouseUp, handlePromptButtonTouchStart, handlePromptButtonTouchEnd, handleLinkClick, handleTextFieldClick } = widgetEventProps ?? {};
|
|
24
24
|
const suggestionTextMap = (0, react.useMemo)(() => {
|
|
25
25
|
return Object.fromEntries(promptButtons?.map((suggestion) => [suggestion.content, suggestion]) ?? []);
|
|
26
26
|
}, [promptButtons]);
|
|
@@ -31,12 +31,21 @@ const ChatPreview = ({ baseProps, widgetContentProps, widgetStyleProps, widgetEv
|
|
|
31
31
|
handlePromptButtonClick?.(suggestionTextMap[text]);
|
|
32
32
|
}, [handlePromptButtonClick, suggestionTextMap]);
|
|
33
33
|
const finalTheme = require_resolveTheme.resolveTheme(theme);
|
|
34
|
-
const message = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.ChatPreviewComponents.Message, {
|
|
34
|
+
const message = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.ChatPreviewComponents.Message, {
|
|
35
|
+
messageText: messageText ?? "",
|
|
36
|
+
onLinkClick: handleLinkClick
|
|
37
|
+
});
|
|
35
38
|
const promptCarousel = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_PromptCarousel.PromptCarousel, {
|
|
36
39
|
promptButtonTexts: promptButtonTexts ?? [],
|
|
37
40
|
promptButtonType: require_PromptButton_types_index.PromptButtonVariant.SUGGESTED_RESPONSE,
|
|
38
41
|
promptCarouselRows: require_PromptCarousel_types_types.PromptCarouselRows.ALWAYS_ONE,
|
|
39
|
-
handleButtonClick: handleSuggestionButtonClick
|
|
42
|
+
handleButtonClick: handleSuggestionButtonClick,
|
|
43
|
+
handleButtonDrag: handlePromptButtonDrag,
|
|
44
|
+
handleButtonHover: (text) => handlePromptButtonHover(suggestionTextMap[text].id),
|
|
45
|
+
handleButtonMouseDown: (text) => handlePromptButtonMouseDown(suggestionTextMap[text].id),
|
|
46
|
+
handleButtonMouseUp: handlePromptButtonMouseUp,
|
|
47
|
+
handleButtonTouchStart: (text) => handlePromptButtonTouchStart(suggestionTextMap[text].id),
|
|
48
|
+
handleButtonTouchEnd: handlePromptButtonTouchEnd
|
|
40
49
|
});
|
|
41
50
|
const widgetTextField = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_WidgetTextField.WidgetTextField, {
|
|
42
51
|
theme: finalTheme,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatPreviewProps } from "./types/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime31 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ChatPreview/ChatPreview.d.ts
|
|
5
5
|
declare const ChatPreview: ({
|
|
@@ -7,6 +7,6 @@ declare const ChatPreview: ({
|
|
|
7
7
|
widgetContentProps,
|
|
8
8
|
widgetStyleProps,
|
|
9
9
|
widgetEventProps
|
|
10
|
-
}: ChatPreviewProps) =>
|
|
10
|
+
}: ChatPreviewProps) => react_jsx_runtime31.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { ChatPreview };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatPreviewProps } from "./types/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime32 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ChatPreview/ChatPreview.d.ts
|
|
5
5
|
declare const ChatPreview: ({
|
|
@@ -7,6 +7,6 @@ declare const ChatPreview: ({
|
|
|
7
7
|
widgetContentProps,
|
|
8
8
|
widgetStyleProps,
|
|
9
9
|
widgetEventProps
|
|
10
|
-
}: ChatPreviewProps) =>
|
|
10
|
+
}: ChatPreviewProps) => react_jsx_runtime32.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { ChatPreview };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Theme } from "../packages/components-v3/tokens/theme/theme.js";
|
|
2
|
-
import { resolveTheme } from "../utils/resolveTheme.js";
|
|
3
2
|
import "../Tokens/index.js";
|
|
3
|
+
import { resolveTheme } from "../utils/resolveTheme.js";
|
|
4
4
|
import { PromptButtonVariant } from "../PromptButton/types/index.js";
|
|
5
5
|
import "../PromptButton/index.js";
|
|
6
6
|
import { PromptCarouselRows } from "../PromptCarousel/types/types.js";
|
|
7
7
|
import { PromptCarousel } from "../PromptCarousel/PromptCarousel.js";
|
|
8
8
|
import "../PromptCarousel/index.js";
|
|
9
|
-
import { WidgetWrapperVariant } from "../WidgetWrapper/types/types.js";
|
|
10
|
-
import { ChatPreviewComponents } from "./components/index.js";
|
|
11
9
|
import { WidgetTextField } from "../WidgetTextField/WidgetTextField.js";
|
|
12
10
|
import "../WidgetTextField/index.js";
|
|
11
|
+
import { WidgetWrapperVariant } from "../WidgetWrapper/types/types.js";
|
|
13
12
|
import { WidgetWrapperWithTitle } from "../WidgetWrapperWithTitle/WidgetWrapperWithTitle.js";
|
|
13
|
+
import { ChatPreviewComponents } from "./components/index.js";
|
|
14
14
|
import { useCallback, useMemo } from "react";
|
|
15
15
|
import { jsx } from "react/jsx-runtime";
|
|
16
16
|
|
|
@@ -19,7 +19,7 @@ const ChatPreview = ({ baseProps, widgetContentProps, widgetStyleProps, widgetEv
|
|
|
19
19
|
const { id, testId, className, style } = baseProps ?? {};
|
|
20
20
|
const { theme = Theme.GLOBAL_CUSTOM, variant = WidgetWrapperVariant.CARD_WITH_BORDER, hideTextField, hideLogo, hexCardColor } = widgetStyleProps ?? {};
|
|
21
21
|
const { messageText, promptButtons, textFieldPlaceholderText, logoSrc, titleLabel } = widgetContentProps ?? {};
|
|
22
|
-
const { handlePromptButtonClick, handleTextFieldClick } = widgetEventProps ?? {};
|
|
22
|
+
const { handlePromptButtonClick, handlePromptButtonDrag, handlePromptButtonHover, handlePromptButtonMouseDown, handlePromptButtonMouseUp, handlePromptButtonTouchStart, handlePromptButtonTouchEnd, handleLinkClick, handleTextFieldClick } = widgetEventProps ?? {};
|
|
23
23
|
const suggestionTextMap = useMemo(() => {
|
|
24
24
|
return Object.fromEntries(promptButtons?.map((suggestion) => [suggestion.content, suggestion]) ?? []);
|
|
25
25
|
}, [promptButtons]);
|
|
@@ -30,12 +30,21 @@ const ChatPreview = ({ baseProps, widgetContentProps, widgetStyleProps, widgetEv
|
|
|
30
30
|
handlePromptButtonClick?.(suggestionTextMap[text]);
|
|
31
31
|
}, [handlePromptButtonClick, suggestionTextMap]);
|
|
32
32
|
const finalTheme = resolveTheme(theme);
|
|
33
|
-
const message = /* @__PURE__ */ jsx(ChatPreviewComponents.Message, {
|
|
33
|
+
const message = /* @__PURE__ */ jsx(ChatPreviewComponents.Message, {
|
|
34
|
+
messageText: messageText ?? "",
|
|
35
|
+
onLinkClick: handleLinkClick
|
|
36
|
+
});
|
|
34
37
|
const promptCarousel = /* @__PURE__ */ jsx(PromptCarousel, {
|
|
35
38
|
promptButtonTexts: promptButtonTexts ?? [],
|
|
36
39
|
promptButtonType: PromptButtonVariant.SUGGESTED_RESPONSE,
|
|
37
40
|
promptCarouselRows: PromptCarouselRows.ALWAYS_ONE,
|
|
38
|
-
handleButtonClick: handleSuggestionButtonClick
|
|
41
|
+
handleButtonClick: handleSuggestionButtonClick,
|
|
42
|
+
handleButtonDrag: handlePromptButtonDrag,
|
|
43
|
+
handleButtonHover: (text) => handlePromptButtonHover(suggestionTextMap[text].id),
|
|
44
|
+
handleButtonMouseDown: (text) => handlePromptButtonMouseDown(suggestionTextMap[text].id),
|
|
45
|
+
handleButtonMouseUp: handlePromptButtonMouseUp,
|
|
46
|
+
handleButtonTouchStart: (text) => handlePromptButtonTouchStart(suggestionTextMap[text].id),
|
|
47
|
+
handleButtonTouchEnd: handlePromptButtonTouchEnd
|
|
39
48
|
});
|
|
40
49
|
const widgetTextField = /* @__PURE__ */ jsx(WidgetTextField, {
|
|
41
50
|
theme: finalTheme,
|
|
@@ -5,12 +5,13 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
5
5
|
|
|
6
6
|
//#region src/components/ChatPreview/components/Message.tsx
|
|
7
7
|
const MarkdownProcessor = (0, react.lazy)(async () => ({ default: (await Promise.resolve().then(() => require("../../MarkdownProcessor/MarkdownProcessor.cjs"))).MarkdownProcessor }));
|
|
8
|
-
const Message = ({ messageText }) => {
|
|
8
|
+
const Message = ({ messageText, onLinkClick }) => {
|
|
9
9
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkdownProcessor, {
|
|
10
10
|
content: messageText,
|
|
11
11
|
clampParagraphs: 4,
|
|
12
12
|
textColor: require_index.TypographyColor.TEXT_PRIMARY,
|
|
13
|
-
textVariant: require_index.TypographyVariant.B3_RG
|
|
13
|
+
textVariant: require_index.TypographyVariant.B3_RG,
|
|
14
|
+
onLinkClick
|
|
14
15
|
}) });
|
|
15
16
|
};
|
|
16
17
|
|
|
@@ -4,12 +4,13 @@ import { jsx } from "react/jsx-runtime";
|
|
|
4
4
|
|
|
5
5
|
//#region src/components/ChatPreview/components/Message.tsx
|
|
6
6
|
const MarkdownProcessor = lazy(async () => ({ default: (await import("../../MarkdownProcessor/MarkdownProcessor.js")).MarkdownProcessor }));
|
|
7
|
-
const Message = ({ messageText }) => {
|
|
7
|
+
const Message = ({ messageText, onLinkClick }) => {
|
|
8
8
|
return /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(MarkdownProcessor, {
|
|
9
9
|
content: messageText,
|
|
10
10
|
clampParagraphs: 4,
|
|
11
11
|
textColor: TypographyColor.TEXT_PRIMARY,
|
|
12
|
-
textVariant: TypographyVariant.B3_RG
|
|
12
|
+
textVariant: TypographyVariant.B3_RG,
|
|
13
|
+
onLinkClick
|
|
13
14
|
}) });
|
|
14
15
|
};
|
|
15
16
|
|
|
@@ -113,9 +113,41 @@ type WidgetEventProps = {
|
|
|
113
113
|
*/
|
|
114
114
|
handlePromptButtonClick?: (suggestion: Suggestion) => void;
|
|
115
115
|
/**
|
|
116
|
-
* Callback function invoked when the
|
|
116
|
+
* Callback function invoked when the prompt buttons carousel is dragged.
|
|
117
|
+
* Useful for tracking drag-to-scroll interactions.
|
|
118
|
+
*/
|
|
119
|
+
handlePromptButtonDrag?: () => void;
|
|
120
|
+
/**
|
|
121
|
+
* Callback function invoked when the user hovers over a prompt button.
|
|
122
|
+
* Receives the hovered button's text as a parameter.
|
|
123
|
+
*/
|
|
124
|
+
handlePromptButtonHover?: (text: string) => void;
|
|
125
|
+
/**
|
|
126
|
+
* Callback function invoked when the mouse button is pressed down on a prompt button.
|
|
127
|
+
* Receives the pressed button's text as a parameter.
|
|
128
|
+
*/
|
|
129
|
+
handlePromptButtonMouseDown?: (text: string) => void;
|
|
130
|
+
/**
|
|
131
|
+
* Callback function invoked when the mouse button is released after pressing a prompt button.
|
|
132
|
+
*/
|
|
133
|
+
handlePromptButtonMouseUp?: () => void;
|
|
134
|
+
/**
|
|
135
|
+
* Callback function invoked when a touch interaction starts on a prompt button.
|
|
136
|
+
* Receives the touched button's text as a parameter.
|
|
137
|
+
*/
|
|
138
|
+
handlePromptButtonTouchStart?: (text: string) => void;
|
|
139
|
+
/**
|
|
140
|
+
* Callback function invoked when a touch interaction ends after touching a prompt button.
|
|
141
|
+
*/
|
|
142
|
+
handlePromptButtonTouchEnd?: () => void;
|
|
143
|
+
/**
|
|
144
|
+
* Callback function invoked when a link inside the widget is clicked.
|
|
117
145
|
*
|
|
118
|
-
* @param
|
|
146
|
+
* @param url - The URL of the clicked link
|
|
147
|
+
*/
|
|
148
|
+
handleLinkClick?: (url: string) => void;
|
|
149
|
+
/**
|
|
150
|
+
* Callback function invoked when the text field is clicked.
|
|
119
151
|
*/
|
|
120
152
|
handleTextFieldClick?: () => void;
|
|
121
153
|
};
|