@envive-ai/react-toolkit-v3 0.3.15 → 0.3.17
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/Carousel/Carousel.d.cts +2 -2
- package/dist/Carousel/Carousel.d.ts +2 -2
- package/dist/ChatFooter/ChatFooter.d.cts +2 -2
- package/dist/ChatFooter/ChatFooter.d.ts +2 -2
- package/dist/ChatFooter/components/index.d.cts +5 -5
- package/dist/ChatFooter/components/index.d.ts +3 -3
- 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/ChatHeader.d.ts +2 -2
- package/dist/ChatHeader/components/Handle.cjs +6 -4
- package/dist/ChatHeader/components/Handle.js +6 -4
- package/dist/ChatPreview/ChatPreview.cjs +14 -5
- package/dist/ChatPreview/ChatPreview.d.cts +2 -2
- package/dist/ChatPreview/ChatPreview.d.ts +2 -2
- package/dist/ChatPreview/ChatPreview.js +14 -5
- 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 +11 -4
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.cts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.ts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.js +11 -4
- package/dist/ChatPreviewComparison/components/Message.cjs +3 -2
- package/dist/ChatPreviewComparison/components/Message.js +3 -2
- 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 +180 -180
- package/dist/Container/Container.d.ts +10 -10
- package/dist/DesignTokens/DesignTokensComponent.d.cts +2 -2
- package/dist/DesignTokens/DesignTokensComponent.d.ts +2 -2
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.cts +2 -2
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.ts +2 -2
- 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 +1 -2
- package/dist/FloatingChat/components/ChatMessages.js +1 -2
- 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 +5 -2
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.cts +2 -2
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.ts +2 -2
- package/dist/FullPageSalesAgent/FullPageSalesAgent.js +5 -2
- 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/ImageGallery.d.ts +2 -2
- 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/ProductCard/ProductCard.cjs +8 -2
- package/dist/ProductCard/ProductCard.d.cts +8 -2
- package/dist/ProductCard/ProductCard.d.ts +8 -2
- package/dist/ProductCard/ProductCard.js +8 -2
- 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 +15 -21
- package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.js +15 -21
- package/dist/PromptCarousel/PromptCarousel.d.cts +2 -2
- package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
- package/dist/ReviewCard/ReviewCard.d.cts +2 -2
- package/dist/ReviewCard/ReviewCard.d.ts +2 -2
- package/dist/ReviewCard/components/index.d.cts +6 -6
- package/dist/ReviewCard/components/index.d.ts +6 -6
- package/dist/SalesAgentProductCard/SalesAgentProductCard.d.cts +2 -2
- package/dist/SalesAgentProductCard/SalesAgentProductCard.d.ts +2 -2
- package/dist/SalesAgentProductCard/components/index.d.cts +8 -8
- package/dist/SalesAgentProductCard/components/index.d.ts +8 -8
- package/dist/SocialProof/SocialProof.cjs +4 -4
- package/dist/SocialProof/SocialProof.d.cts +2 -2
- package/dist/SocialProof/SocialProof.d.ts +2 -2
- package/dist/SocialProof/SocialProof.js +1 -1
- package/dist/SparkleAnimation/SparkleAnimation.d.cts +2 -2
- package/dist/SparkleAnimation/SparkleAnimation.d.ts +2 -2
- package/dist/Stack/Stack.d.cts +2 -2
- package/dist/Stack/Stack.d.ts +2 -2
- package/dist/TitledPromptCarousel/TitledPromptCarousel.d.cts +2 -2
- package/dist/TitledPromptCarousel/TitledPromptCarousel.d.ts +2 -2
- package/dist/TypingAnimation/TypingAnimation.cjs +8 -2
- package/dist/TypingAnimation/TypingAnimation.d.cts +2 -2
- package/dist/TypingAnimation/TypingAnimation.d.ts +2 -2
- package/dist/TypingAnimation/TypingAnimation.js +8 -2
- package/dist/TypingAnimation/types/index.d.cts +28 -0
- package/dist/TypingAnimation/types/index.d.ts +28 -0
- package/dist/Typography/Typography.d.cts +4 -4
- package/dist/WidgetTextField/WidgetTextField.d.cts +2 -2
- package/dist/WidgetTextField/WidgetTextField.d.ts +2 -2
- package/dist/WidgetTextField/components/Icon.cjs +2 -2
- package/dist/WidgetTextField/components/Icon.js +2 -2
- package/dist/WidgetWrapper/WidgetWrapper.d.cts +2 -2
- package/dist/WidgetWrapper/WidgetWrapper.d.ts +2 -2
- package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.ts +2 -2
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- 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/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.tsx +12 -9
- 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 react184 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/AnimatedText/AnimatedText.d.ts
|
|
5
|
-
declare const AnimatedText:
|
|
5
|
+
declare const AnimatedText: react184.MemoExoticComponent<({
|
|
6
6
|
sequence,
|
|
7
7
|
typingDuration,
|
|
8
8
|
transition,
|
|
9
9
|
loop,
|
|
10
10
|
getNodeWrapper
|
|
11
|
-
}: AnimatedTextProps) =>
|
|
11
|
+
}: AnimatedTextProps) => react184.ReactNode>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { AnimatedText };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime32 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_runtime32.JSX.Element;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { CssVariablesEditorComponent };
|
|
@@ -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_runtime36 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_runtime36.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { Carousel };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatFooterProps } from "./types/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime31 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_runtime31.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_runtime34 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_runtime34.JSX.Element;
|
|
24
24
|
//#endregion
|
|
25
25
|
export { ChatFooter };
|
|
@@ -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 react181 from "react";
|
|
5
|
+
import * as react_jsx_runtime29 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_runtime29.JSX.Element;
|
|
21
21
|
EnviveLogo: ({
|
|
22
22
|
style
|
|
23
23
|
}: {
|
|
24
24
|
className?: string;
|
|
25
25
|
style?: React.CSSProperties;
|
|
26
|
-
}) =>
|
|
26
|
+
}) => react181.ReactElement<react181.SVGProps<SVGSVGElement>, string | react181.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_runtime29.JSX.Element;
|
|
36
36
|
TextField: ({
|
|
37
37
|
theme,
|
|
38
38
|
placeholder,
|
|
@@ -2,7 +2,7 @@ import { LayoutProps } from "./Layout.js";
|
|
|
2
2
|
import { PromptSuggestionsProps } from "./PromptSuggestions.js";
|
|
3
3
|
import { TextFieldProps } from "../../TextField/types/index.js";
|
|
4
4
|
import * as react181 from "react";
|
|
5
|
-
import * as
|
|
5
|
+
import * as react_jsx_runtime32 from "react/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/components/ChatFooter/components/index.d.ts
|
|
8
8
|
declare const ChatFooterComponents: {
|
|
@@ -17,7 +17,7 @@ declare const ChatFooterComponents: {
|
|
|
17
17
|
testId,
|
|
18
18
|
className,
|
|
19
19
|
style
|
|
20
|
-
}: LayoutProps) =>
|
|
20
|
+
}: LayoutProps) => react_jsx_runtime32.JSX.Element;
|
|
21
21
|
EnviveLogo: ({
|
|
22
22
|
style
|
|
23
23
|
}: {
|
|
@@ -32,7 +32,7 @@ declare const ChatFooterComponents: {
|
|
|
32
32
|
style,
|
|
33
33
|
disabled,
|
|
34
34
|
parentWidget
|
|
35
|
-
}: PromptSuggestionsProps) =>
|
|
35
|
+
}: PromptSuggestionsProps) => react_jsx_runtime32.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_runtime34 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_runtime34.JSX.Element;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { ChatHeader };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatHeaderProps } from "./types/index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime28 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_runtime28.JSX.Element;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { ChatHeader };
|
|
@@ -3,6 +3,7 @@ const require_Stack = require('../../Stack/Stack.cjs');
|
|
|
3
3
|
require('../../Stack/index.cjs');
|
|
4
4
|
const require_Container = require('../../Container/Container.cjs');
|
|
5
5
|
require('../../Container/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, {
|
|
@@ -2,6 +2,7 @@ import { Stack } from "../../Stack/Stack.js";
|
|
|
2
2
|
import "../../Stack/index.js";
|
|
3
3
|
import { Container } from "../../Container/Container.js";
|
|
4
4
|
import "../../Container/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, {
|
|
@@ -7,11 +7,11 @@ 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_runtime28 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_runtime28.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_runtime30 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_runtime30.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { ChatPreview };
|
|
@@ -6,11 +6,11 @@ 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
|
};
|
|
@@ -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
|
};
|
|
@@ -7,9 +7,9 @@ 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
10
|
const require_WidgetTextField = require('../WidgetTextField/WidgetTextField.cjs');
|
|
12
11
|
require('../WidgetTextField/index.cjs');
|
|
12
|
+
const require_types = require('../WidgetWrapper/types/types.cjs');
|
|
13
13
|
const require_WidgetWrapperWithTitle = require('../WidgetWrapperWithTitle/WidgetWrapperWithTitle.cjs');
|
|
14
14
|
const require_index = require('./components/index.cjs');
|
|
15
15
|
let react = require("react");
|
|
@@ -20,7 +20,7 @@ const ChatPreviewComparison = ({ baseProps, widgetContentProps, widgetStyleProps
|
|
|
20
20
|
const { id, testId, className, style } = baseProps ?? {};
|
|
21
21
|
const { theme = require_theme.Theme.GLOBAL_CUSTOM, variant = require_types.WidgetWrapperVariant.CARD_WITH_BORDER, hideImage, hideTextField, hideLogo, hexCardColor } = widgetStyleProps ?? {};
|
|
22
22
|
const { headlineText, messageText, promptButtons, textFieldPlaceholderText, images, logoSrc, titleLabel } = widgetContentProps ?? {};
|
|
23
|
-
const { handlePromptButtonClick, handleTextFieldClick } = widgetEventProps ?? {};
|
|
23
|
+
const { handlePromptButtonClick, handlePromptButtonDrag, handlePromptButtonHover, handlePromptButtonMouseDown, handlePromptButtonMouseUp, handlePromptButtonTouchStart, handlePromptButtonTouchEnd, handleLinkClick, handleTextFieldClick } = widgetEventProps ?? {};
|
|
24
24
|
const finalTheme = require_resolveTheme.resolveTheme(theme);
|
|
25
25
|
const suggestionTextMap = (0, react.useMemo)(() => {
|
|
26
26
|
return Object.fromEntries(promptButtons?.map((suggestion) => [suggestion.content, suggestion]) ?? []);
|
|
@@ -37,13 +37,20 @@ const ChatPreviewComparison = ({ baseProps, widgetContentProps, widgetStyleProps
|
|
|
37
37
|
});
|
|
38
38
|
const message = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.ChatPreviewComparisonComponents.Message, {
|
|
39
39
|
messageText: messageText ?? "",
|
|
40
|
-
theme: finalTheme
|
|
40
|
+
theme: finalTheme,
|
|
41
|
+
onLinkClick: handleLinkClick
|
|
41
42
|
});
|
|
42
43
|
const promptCarousel = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_PromptCarousel.PromptCarousel, {
|
|
43
44
|
promptButtonTexts: promptButtonTexts ?? [],
|
|
44
45
|
promptButtonType: require_PromptButton_types_index.PromptButtonVariant.SUGGESTED_RESPONSE,
|
|
45
46
|
promptCarouselRows: require_PromptCarousel_types_types.PromptCarouselRows.ALWAYS_ONE,
|
|
46
|
-
handleButtonClick: handleSuggestionButtonClick
|
|
47
|
+
handleButtonClick: handleSuggestionButtonClick,
|
|
48
|
+
handleButtonDrag: handlePromptButtonDrag,
|
|
49
|
+
handleButtonHover: (text) => handlePromptButtonHover(suggestionTextMap[text].id),
|
|
50
|
+
handleButtonMouseDown: (text) => handlePromptButtonMouseDown(suggestionTextMap[text].id),
|
|
51
|
+
handleButtonMouseUp: handlePromptButtonMouseUp,
|
|
52
|
+
handleButtonTouchStart: (text) => handlePromptButtonTouchStart(suggestionTextMap[text].id),
|
|
53
|
+
handleButtonTouchEnd: handlePromptButtonTouchEnd
|
|
47
54
|
});
|
|
48
55
|
const widgetTextField = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_WidgetTextField.WidgetTextField, {
|
|
49
56
|
theme: finalTheme,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatPreviewComparisonProps } from "./types/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime25 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ChatPreviewComparison/ChatPreviewComparison.d.ts
|
|
5
5
|
declare const ChatPreviewComparison: ({
|
|
@@ -7,6 +7,6 @@ declare const ChatPreviewComparison: ({
|
|
|
7
7
|
widgetContentProps,
|
|
8
8
|
widgetStyleProps,
|
|
9
9
|
widgetEventProps
|
|
10
|
-
}: ChatPreviewComparisonProps) =>
|
|
10
|
+
}: ChatPreviewComparisonProps) => react_jsx_runtime25.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { ChatPreviewComparison };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatPreviewComparisonProps } from "./types/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime20 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ChatPreviewComparison/ChatPreviewComparison.d.ts
|
|
5
5
|
declare const ChatPreviewComparison: ({
|
|
@@ -7,6 +7,6 @@ declare const ChatPreviewComparison: ({
|
|
|
7
7
|
widgetContentProps,
|
|
8
8
|
widgetStyleProps,
|
|
9
9
|
widgetEventProps
|
|
10
|
-
}: ChatPreviewComparisonProps) =>
|
|
10
|
+
}: ChatPreviewComparisonProps) => react_jsx_runtime20.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { ChatPreviewComparison };
|
|
@@ -6,9 +6,9 @@ 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
9
|
import { WidgetTextField } from "../WidgetTextField/WidgetTextField.js";
|
|
11
10
|
import "../WidgetTextField/index.js";
|
|
11
|
+
import { WidgetWrapperVariant } from "../WidgetWrapper/types/types.js";
|
|
12
12
|
import { WidgetWrapperWithTitle } from "../WidgetWrapperWithTitle/WidgetWrapperWithTitle.js";
|
|
13
13
|
import { ChatPreviewComparisonComponents } from "./components/index.js";
|
|
14
14
|
import { useCallback, useMemo } from "react";
|
|
@@ -19,7 +19,7 @@ const ChatPreviewComparison = ({ baseProps, widgetContentProps, widgetStyleProps
|
|
|
19
19
|
const { id, testId, className, style } = baseProps ?? {};
|
|
20
20
|
const { theme = Theme.GLOBAL_CUSTOM, variant = WidgetWrapperVariant.CARD_WITH_BORDER, hideImage, hideTextField, hideLogo, hexCardColor } = widgetStyleProps ?? {};
|
|
21
21
|
const { headlineText, messageText, promptButtons, textFieldPlaceholderText, images, logoSrc, titleLabel } = widgetContentProps ?? {};
|
|
22
|
-
const { handlePromptButtonClick, handleTextFieldClick } = widgetEventProps ?? {};
|
|
22
|
+
const { handlePromptButtonClick, handlePromptButtonDrag, handlePromptButtonHover, handlePromptButtonMouseDown, handlePromptButtonMouseUp, handlePromptButtonTouchStart, handlePromptButtonTouchEnd, handleLinkClick, handleTextFieldClick } = widgetEventProps ?? {};
|
|
23
23
|
const finalTheme = resolveTheme(theme);
|
|
24
24
|
const suggestionTextMap = useMemo(() => {
|
|
25
25
|
return Object.fromEntries(promptButtons?.map((suggestion) => [suggestion.content, suggestion]) ?? []);
|
|
@@ -36,13 +36,20 @@ const ChatPreviewComparison = ({ baseProps, widgetContentProps, widgetStyleProps
|
|
|
36
36
|
});
|
|
37
37
|
const message = /* @__PURE__ */ jsx(ChatPreviewComparisonComponents.Message, {
|
|
38
38
|
messageText: messageText ?? "",
|
|
39
|
-
theme: finalTheme
|
|
39
|
+
theme: finalTheme,
|
|
40
|
+
onLinkClick: handleLinkClick
|
|
40
41
|
});
|
|
41
42
|
const promptCarousel = /* @__PURE__ */ jsx(PromptCarousel, {
|
|
42
43
|
promptButtonTexts: promptButtonTexts ?? [],
|
|
43
44
|
promptButtonType: PromptButtonVariant.SUGGESTED_RESPONSE,
|
|
44
45
|
promptCarouselRows: PromptCarouselRows.ALWAYS_ONE,
|
|
45
|
-
handleButtonClick: handleSuggestionButtonClick
|
|
46
|
+
handleButtonClick: handleSuggestionButtonClick,
|
|
47
|
+
handleButtonDrag: handlePromptButtonDrag,
|
|
48
|
+
handleButtonHover: (text) => handlePromptButtonHover(suggestionTextMap[text].id),
|
|
49
|
+
handleButtonMouseDown: (text) => handlePromptButtonMouseDown(suggestionTextMap[text].id),
|
|
50
|
+
handleButtonMouseUp: handlePromptButtonMouseUp,
|
|
51
|
+
handleButtonTouchStart: (text) => handlePromptButtonTouchStart(suggestionTextMap[text].id),
|
|
52
|
+
handleButtonTouchEnd: handlePromptButtonTouchEnd
|
|
46
53
|
});
|
|
47
54
|
const widgetTextField = /* @__PURE__ */ jsx(WidgetTextField, {
|
|
48
55
|
theme: finalTheme,
|