@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
|
@@ -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
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
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
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_runtime17 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_runtime17.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_runtime35 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_runtime35.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { ChatPreviewComparison };
|
|
@@ -1,14 +1,14 @@
|
|
|
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
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,
|
|
@@ -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
|
+
require('../../Tokens/index.cjs');
|
|
4
|
+
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
3
5
|
const require_index = require('../../Typography/types/index.cjs');
|
|
4
6
|
const require_Typography = require('../../Typography/Typography.cjs');
|
|
5
7
|
require('../../Typography/index.cjs');
|
|
6
|
-
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
7
|
-
require('../../Tokens/index.cjs');
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
|
|
10
10
|
//#region src/components/ChatPreviewComparison/components/Headline.tsx
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
|
|
2
|
+
import "../../Tokens/index.js";
|
|
3
|
+
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
2
4
|
import { TypographyColor, TypographyVariant } from "../../Typography/types/index.js";
|
|
3
5
|
import { Typography } from "../../Typography/Typography.js";
|
|
4
6
|
import "../../Typography/index.js";
|
|
5
|
-
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
6
|
-
import "../../Tokens/index.js";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
|
|
9
9
|
//#region src/components/ChatPreviewComparison/components/Headline.tsx
|
|
@@ -3,12 +3,12 @@ const require_utils = require('../../DesignTokens/components/utils.cjs');
|
|
|
3
3
|
const require_aspectRatio = require('../../packages/components-v3/tokens/aspectRatio/aspectRatio.cjs');
|
|
4
4
|
const require_theme = require('../../packages/components-v3/tokens/theme/theme.cjs');
|
|
5
5
|
const require_breakpoints = require('../../packages/components-v3/tokens/breakpoints/breakpoints.cjs');
|
|
6
|
-
|
|
7
|
-
require('../../
|
|
6
|
+
require('../../Tokens/index.cjs');
|
|
7
|
+
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
8
8
|
const require_Container = require('../../Container/Container.cjs');
|
|
9
9
|
require('../../Container/index.cjs');
|
|
10
|
-
const
|
|
11
|
-
require('../../
|
|
10
|
+
const require_Stack = require('../../Stack/Stack.cjs');
|
|
11
|
+
require('../../Stack/index.cjs');
|
|
12
12
|
const require_useCheckIsMobile = require('../../utils/useCheckIsMobile.cjs');
|
|
13
13
|
const require_useGetContentSize = require('../../utils/useGetContentSize.cjs');
|
|
14
14
|
const require_types = require('../../ImageGallery/types/types.cjs');
|
|
@@ -2,12 +2,12 @@ import { getCSSVariable } from "../../DesignTokens/components/utils.js";
|
|
|
2
2
|
import { AspectRatioCSSVar } from "../../packages/components-v3/tokens/aspectRatio/aspectRatio.js";
|
|
3
3
|
import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
|
|
4
4
|
import { screensBreakpointsVariables } from "../../packages/components-v3/tokens/breakpoints/breakpoints.js";
|
|
5
|
-
import
|
|
6
|
-
import "../../
|
|
5
|
+
import "../../Tokens/index.js";
|
|
6
|
+
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
7
7
|
import { Container } from "../../Container/Container.js";
|
|
8
8
|
import "../../Container/index.js";
|
|
9
|
-
import {
|
|
10
|
-
import "../../
|
|
9
|
+
import { Stack } from "../../Stack/Stack.js";
|
|
10
|
+
import "../../Stack/index.js";
|
|
11
11
|
import { useCheckIsMobile } from "../../utils/useCheckIsMobile.js";
|
|
12
12
|
import { useGetContentSize } from "../../utils/useGetContentSize.js";
|
|
13
13
|
import { ImageGalleryLayout } from "../../ImageGallery/types/types.js";
|
|
@@ -1,22 +1,23 @@
|
|
|
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
|
+
require('../../Tokens/index.cjs');
|
|
4
|
+
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
3
5
|
const require_index = require('../../Typography/types/index.cjs');
|
|
4
6
|
require('../../Typography/index.cjs');
|
|
5
|
-
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
6
|
-
require('../../Tokens/index.cjs');
|
|
7
7
|
const require_useCheckIsMobile = require('../../utils/useCheckIsMobile.cjs');
|
|
8
8
|
let react = require("react");
|
|
9
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
10
|
|
|
11
11
|
//#region src/components/ChatPreviewComparison/components/Message.tsx
|
|
12
12
|
const MarkdownProcessor = (0, react.lazy)(async () => ({ default: (await Promise.resolve().then(() => require("../../MarkdownProcessor/MarkdownProcessor.cjs"))).MarkdownProcessor }));
|
|
13
|
-
const Message = ({ messageText, theme = require_theme.Theme.GLOBAL_CUSTOM }) => {
|
|
13
|
+
const Message = ({ messageText, theme = require_theme.Theme.GLOBAL_CUSTOM, onLinkClick }) => {
|
|
14
14
|
const { isMobile } = require_useCheckIsMobile.useCheckIsMobile();
|
|
15
15
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkdownProcessor, {
|
|
16
16
|
content: messageText,
|
|
17
17
|
clampParagraphs: require_resolveTheme.resolveTheme(theme) === require_theme.Theme.STANDARD && isMobile ? 7 : 3,
|
|
18
18
|
textColor: require_index.TypographyColor.TEXT_PRIMARY,
|
|
19
|
-
textVariant: require_index.TypographyVariant.B3_RG
|
|
19
|
+
textVariant: require_index.TypographyVariant.B3_RG,
|
|
20
|
+
onLinkClick
|
|
20
21
|
}) });
|
|
21
22
|
};
|
|
22
23
|
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
|
|
2
|
+
import "../../Tokens/index.js";
|
|
3
|
+
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
2
4
|
import { TypographyColor, TypographyVariant } from "../../Typography/types/index.js";
|
|
3
5
|
import "../../Typography/index.js";
|
|
4
|
-
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
5
|
-
import "../../Tokens/index.js";
|
|
6
6
|
import { useCheckIsMobile } from "../../utils/useCheckIsMobile.js";
|
|
7
7
|
import { Suspense, lazy } from "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
|
|
10
10
|
//#region src/components/ChatPreviewComparison/components/Message.tsx
|
|
11
11
|
const MarkdownProcessor = lazy(async () => ({ default: (await import("../../MarkdownProcessor/MarkdownProcessor.js")).MarkdownProcessor }));
|
|
12
|
-
const Message = ({ messageText, theme = Theme.GLOBAL_CUSTOM }) => {
|
|
12
|
+
const Message = ({ messageText, theme = Theme.GLOBAL_CUSTOM, onLinkClick }) => {
|
|
13
13
|
const { isMobile } = useCheckIsMobile();
|
|
14
14
|
return /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(MarkdownProcessor, {
|
|
15
15
|
content: messageText,
|
|
16
16
|
clampParagraphs: resolveTheme(theme) === Theme.STANDARD && isMobile ? 7 : 3,
|
|
17
17
|
textColor: TypographyColor.TEXT_PRIMARY,
|
|
18
|
-
textVariant: TypographyVariant.B3_RG
|
|
18
|
+
textVariant: TypographyVariant.B3_RG,
|
|
19
|
+
onLinkClick
|
|
19
20
|
}) });
|
|
20
21
|
};
|
|
21
22
|
|
|
@@ -122,8 +122,41 @@ type WidgetEventProps = {
|
|
|
122
122
|
*/
|
|
123
123
|
handlePromptButtonClick?: (suggestion: Suggestion) => void;
|
|
124
124
|
/**
|
|
125
|
-
* Callback function invoked when the
|
|
125
|
+
* Callback function invoked when the prompt buttons carousel is dragged.
|
|
126
|
+
* Useful for tracking drag-to-scroll interactions.
|
|
127
|
+
*/
|
|
128
|
+
handlePromptButtonDrag?: () => void;
|
|
129
|
+
/**
|
|
130
|
+
* Callback function invoked when the user hovers over a prompt button.
|
|
131
|
+
* Receives the hovered button's text as a parameter.
|
|
132
|
+
*/
|
|
133
|
+
handlePromptButtonHover?: (text: string) => void;
|
|
134
|
+
/**
|
|
135
|
+
* Callback function invoked when the mouse button is pressed down on a prompt button.
|
|
136
|
+
* Receives the pressed button's text as a parameter.
|
|
137
|
+
*/
|
|
138
|
+
handlePromptButtonMouseDown?: (text: string) => void;
|
|
139
|
+
/**
|
|
140
|
+
* Callback function invoked when the mouse button is released after pressing a prompt button.
|
|
141
|
+
*/
|
|
142
|
+
handlePromptButtonMouseUp?: () => void;
|
|
143
|
+
/**
|
|
144
|
+
* Callback function invoked when a touch interaction starts on a prompt button.
|
|
145
|
+
* Receives the touched button's text as a parameter.
|
|
146
|
+
*/
|
|
147
|
+
handlePromptButtonTouchStart?: (text: string) => void;
|
|
148
|
+
/**
|
|
149
|
+
* Callback function invoked when a touch interaction ends after touching a prompt button.
|
|
150
|
+
*/
|
|
151
|
+
handlePromptButtonTouchEnd?: () => void;
|
|
152
|
+
/**
|
|
153
|
+
* Callback function invoked when a link inside the widget is clicked.
|
|
126
154
|
*
|
|
155
|
+
* @param url - The URL of the clicked link
|
|
156
|
+
*/
|
|
157
|
+
handleLinkClick?: (url: string) => void;
|
|
158
|
+
/**
|
|
159
|
+
* Callback function invoked when the text field is clicked.
|
|
127
160
|
*/
|
|
128
161
|
handleTextFieldClick?: () => void;
|
|
129
162
|
};
|
|
@@ -122,8 +122,41 @@ type WidgetEventProps = {
|
|
|
122
122
|
*/
|
|
123
123
|
handlePromptButtonClick?: (suggestion: Suggestion) => void;
|
|
124
124
|
/**
|
|
125
|
-
* Callback function invoked when the
|
|
125
|
+
* Callback function invoked when the prompt buttons carousel is dragged.
|
|
126
|
+
* Useful for tracking drag-to-scroll interactions.
|
|
127
|
+
*/
|
|
128
|
+
handlePromptButtonDrag?: () => void;
|
|
129
|
+
/**
|
|
130
|
+
* Callback function invoked when the user hovers over a prompt button.
|
|
131
|
+
* Receives the hovered button's text as a parameter.
|
|
132
|
+
*/
|
|
133
|
+
handlePromptButtonHover?: (text: string) => void;
|
|
134
|
+
/**
|
|
135
|
+
* Callback function invoked when the mouse button is pressed down on a prompt button.
|
|
136
|
+
* Receives the pressed button's text as a parameter.
|
|
137
|
+
*/
|
|
138
|
+
handlePromptButtonMouseDown?: (text: string) => void;
|
|
139
|
+
/**
|
|
140
|
+
* Callback function invoked when the mouse button is released after pressing a prompt button.
|
|
141
|
+
*/
|
|
142
|
+
handlePromptButtonMouseUp?: () => void;
|
|
143
|
+
/**
|
|
144
|
+
* Callback function invoked when a touch interaction starts on a prompt button.
|
|
145
|
+
* Receives the touched button's text as a parameter.
|
|
146
|
+
*/
|
|
147
|
+
handlePromptButtonTouchStart?: (text: string) => void;
|
|
148
|
+
/**
|
|
149
|
+
* Callback function invoked when a touch interaction ends after touching a prompt button.
|
|
150
|
+
*/
|
|
151
|
+
handlePromptButtonTouchEnd?: () => void;
|
|
152
|
+
/**
|
|
153
|
+
* Callback function invoked when a link inside the widget is clicked.
|
|
126
154
|
*
|
|
155
|
+
* @param url - The URL of the clicked link
|
|
156
|
+
*/
|
|
157
|
+
handleLinkClick?: (url: string) => void;
|
|
158
|
+
/**
|
|
159
|
+
* Callback function invoked when the text field is clicked.
|
|
127
160
|
*/
|
|
128
161
|
handleTextFieldClick?: () => void;
|
|
129
162
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_Stack = require('../Stack/Stack.cjs');
|
|
3
3
|
require('../Stack/index.cjs');
|
|
4
|
-
const require_types = require('../WidgetWrapper/types/types.cjs');
|
|
5
4
|
const require_WidgetTextField = require('../WidgetTextField/WidgetTextField.cjs');
|
|
6
5
|
require('../WidgetTextField/index.cjs');
|
|
6
|
+
const require_types = require('../WidgetWrapper/types/types.cjs');
|
|
7
7
|
require('../WidgetWrapper/index.cjs');
|
|
8
8
|
const require_index = require('./components/index.cjs');
|
|
9
9
|
let react = require("react");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatPreviewLoadingProps } from "./types/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime21 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ChatPreviewLoading/ChatPreviewLoading.d.ts
|
|
5
5
|
declare const ChatPreviewLoading: ({
|
|
@@ -15,6 +15,6 @@ declare const ChatPreviewLoading: ({
|
|
|
15
15
|
hideLogo,
|
|
16
16
|
logoSrc,
|
|
17
17
|
titleLabel
|
|
18
|
-
}: ChatPreviewLoadingProps) =>
|
|
18
|
+
}: ChatPreviewLoadingProps) => react_jsx_runtime21.JSX.Element;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { ChatPreviewLoading };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatPreviewLoadingProps } from "./types/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime28 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ChatPreviewLoading/ChatPreviewLoading.d.ts
|
|
5
5
|
declare const ChatPreviewLoading: ({
|
|
@@ -15,6 +15,6 @@ declare const ChatPreviewLoading: ({
|
|
|
15
15
|
hideLogo,
|
|
16
16
|
logoSrc,
|
|
17
17
|
titleLabel
|
|
18
|
-
}: ChatPreviewLoadingProps) =>
|
|
18
|
+
}: ChatPreviewLoadingProps) => react_jsx_runtime28.JSX.Element;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { ChatPreviewLoading };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Stack } from "../Stack/Stack.js";
|
|
2
2
|
import "../Stack/index.js";
|
|
3
|
-
import { WidgetWrapperVariant } from "../WidgetWrapper/types/types.js";
|
|
4
3
|
import { WidgetTextField } from "../WidgetTextField/WidgetTextField.js";
|
|
5
4
|
import "../WidgetTextField/index.js";
|
|
5
|
+
import { WidgetWrapperVariant } from "../WidgetWrapper/types/types.js";
|
|
6
6
|
import "../WidgetWrapper/index.js";
|
|
7
7
|
import { ChatPreviewLoadingComponents } from "./components/index.js";
|
|
8
8
|
import { useMemo } from "react";
|