@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.
Files changed (216) hide show
  1. package/dist/AnimatedText/AnimatedText.d.cts +3 -3
  2. package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.cts +2 -2
  3. package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.ts +2 -2
  4. package/dist/Carousel/Carousel.cjs +1 -1
  5. package/dist/Carousel/Carousel.d.cts +2 -2
  6. package/dist/Carousel/Carousel.d.ts +2 -2
  7. package/dist/Carousel/Carousel.js +1 -1
  8. package/dist/Carousel/components/Container.cjs +2 -2
  9. package/dist/Carousel/components/Container.js +2 -2
  10. package/dist/ChatFooter/ChatFooter.cjs +1 -1
  11. package/dist/ChatFooter/ChatFooter.d.cts +2 -2
  12. package/dist/ChatFooter/ChatFooter.d.ts +2 -2
  13. package/dist/ChatFooter/ChatFooter.js +1 -1
  14. package/dist/ChatFooter/components/Layout.cjs +2 -2
  15. package/dist/ChatFooter/components/Layout.js +2 -2
  16. package/dist/ChatFooter/components/index.d.cts +5 -5
  17. package/dist/ChatFooter/components/index.d.ts +5 -5
  18. package/dist/ChatFooter/hooks/useGetContainerProperties.cjs +1 -1
  19. package/dist/ChatFooter/hooks/useGetContainerProperties.js +1 -1
  20. package/dist/ChatHeader/ChatHeader.d.cts +2 -2
  21. package/dist/ChatHeader/components/Handle.cjs +8 -6
  22. package/dist/ChatHeader/components/Handle.js +8 -6
  23. package/dist/ChatHeader/components/Toggle.cjs +3 -3
  24. package/dist/ChatHeader/components/Toggle.js +3 -3
  25. package/dist/ChatPreview/ChatPreview.cjs +15 -6
  26. package/dist/ChatPreview/ChatPreview.d.cts +2 -2
  27. package/dist/ChatPreview/ChatPreview.d.ts +2 -2
  28. package/dist/ChatPreview/ChatPreview.js +15 -6
  29. package/dist/ChatPreview/components/Message.cjs +3 -2
  30. package/dist/ChatPreview/components/Message.js +3 -2
  31. package/dist/ChatPreview/types/types.d.cts +34 -2
  32. package/dist/ChatPreview/types/types.d.ts +34 -2
  33. package/dist/ChatPreviewComparison/ChatPreviewComparison.cjs +12 -5
  34. package/dist/ChatPreviewComparison/ChatPreviewComparison.d.cts +2 -2
  35. package/dist/ChatPreviewComparison/ChatPreviewComparison.d.ts +2 -2
  36. package/dist/ChatPreviewComparison/ChatPreviewComparison.js +12 -5
  37. package/dist/ChatPreviewComparison/components/Headline.cjs +2 -2
  38. package/dist/ChatPreviewComparison/components/Headline.js +2 -2
  39. package/dist/ChatPreviewComparison/components/Layout.cjs +4 -4
  40. package/dist/ChatPreviewComparison/components/Layout.js +4 -4
  41. package/dist/ChatPreviewComparison/components/Message.cjs +5 -4
  42. package/dist/ChatPreviewComparison/components/Message.js +5 -4
  43. package/dist/ChatPreviewComparison/types/types.d.cts +34 -1
  44. package/dist/ChatPreviewComparison/types/types.d.ts +34 -1
  45. package/dist/ChatPreviewLoading/ChatPreviewLoading.cjs +1 -1
  46. package/dist/ChatPreviewLoading/ChatPreviewLoading.d.cts +2 -2
  47. package/dist/ChatPreviewLoading/ChatPreviewLoading.d.ts +2 -2
  48. package/dist/ChatPreviewLoading/ChatPreviewLoading.js +1 -1
  49. package/dist/Container/Container.d.cts +173 -173
  50. package/dist/Container/Container.d.ts +173 -173
  51. package/dist/DesignTokens/DesignTokensComponent.d.cts +2 -2
  52. package/dist/DesignTokens/DesignTokensComponent.d.ts +2 -2
  53. package/dist/Disclaimer/components/Container.cjs +2 -2
  54. package/dist/Disclaimer/components/Container.js +2 -2
  55. package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.cts +2 -2
  56. package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.ts +2 -2
  57. package/dist/DocumentRetrievalCard/components/Layout.cjs +2 -2
  58. package/dist/DocumentRetrievalCard/components/Layout.js +2 -2
  59. package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.cjs +1 -1
  60. package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.js +1 -1
  61. package/dist/FloatingButton/FloatingButton.d.cts +2 -2
  62. package/dist/FloatingButton/FloatingButton.d.ts +2 -2
  63. package/dist/FloatingChat/FloatingChat.cjs +4 -8
  64. package/dist/FloatingChat/FloatingChat.d.cts +2 -2
  65. package/dist/FloatingChat/FloatingChat.d.ts +2 -2
  66. package/dist/FloatingChat/FloatingChat.js +4 -8
  67. package/dist/FloatingChat/components/AgentMessage.cjs +1 -2
  68. package/dist/FloatingChat/components/AgentMessage.js +1 -2
  69. package/dist/FloatingChat/components/ChatMessages.cjs +2 -3
  70. package/dist/FloatingChat/components/ChatMessages.js +2 -3
  71. package/dist/FloatingChat/components/Layout.cjs +3 -3
  72. package/dist/FloatingChat/components/Layout.js +3 -3
  73. package/dist/FloatingChat/components/ModalSheet.cjs +13 -3
  74. package/dist/FloatingChat/components/ModalSheet.js +14 -4
  75. package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.cjs +2 -3
  76. package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.js +2 -3
  77. package/dist/FloatingChat/hooks/useFilteredChatMessages.cjs +1 -1
  78. package/dist/FloatingChat/hooks/useFilteredChatMessages.js +1 -1
  79. package/dist/FloatingChat/hooks/useSnapControl.cjs +17 -16
  80. package/dist/FloatingChat/hooks/useSnapControl.js +17 -16
  81. package/dist/FloatingChat/hooks/useSnapSetup.cjs +9 -27
  82. package/dist/FloatingChat/hooks/useSnapSetup.js +10 -28
  83. package/dist/FloatingChat/snapConstants.cjs +10 -0
  84. package/dist/FloatingChat/snapConstants.js +7 -0
  85. package/dist/FullPageSalesAgent/FullPageSalesAgent.cjs +6 -3
  86. package/dist/FullPageSalesAgent/FullPageSalesAgent.d.ts +2 -2
  87. package/dist/FullPageSalesAgent/FullPageSalesAgent.js +6 -3
  88. package/dist/FullPageSalesAgent/components/Layout.cjs +3 -1
  89. package/dist/FullPageSalesAgent/components/Layout.js +3 -1
  90. package/dist/FullPageSalesAgent/hooks/useGetFooterStyles.cjs +2 -1
  91. package/dist/FullPageSalesAgent/hooks/useGetFooterStyles.js +2 -1
  92. package/dist/FullPageSalesAgent/hooks/useGetMessagesStyles.cjs +10 -0
  93. package/dist/FullPageSalesAgent/hooks/useGetMessagesStyles.js +10 -0
  94. package/dist/FullPageSalesAgent/hooks/useGetScrollContentStyles.cjs +4 -2
  95. package/dist/FullPageSalesAgent/hooks/useGetScrollContentStyles.js +4 -2
  96. package/dist/Image/Image.d.cts +2 -2
  97. package/dist/Image/Image.d.ts +2 -2
  98. package/dist/ImageGallery/ImageGallery.d.cts +2 -2
  99. package/dist/ImageGallery/components/Layout.cjs +1 -1
  100. package/dist/ImageGallery/components/Layout.js +1 -1
  101. package/dist/MarkdownProcessor/MarkdownProcessor.cjs +2 -1
  102. package/dist/MarkdownProcessor/MarkdownProcessor.d.cts +2 -2
  103. package/dist/MarkdownProcessor/MarkdownProcessor.d.ts +2 -2
  104. package/dist/MarkdownProcessor/MarkdownProcessor.js +2 -1
  105. package/dist/Message/components/LinkButton.cjs +1 -1
  106. package/dist/Message/components/LinkButton.js +1 -1
  107. package/dist/OrderLookupCard/OrderLookupCard.cjs +1 -1
  108. package/dist/OrderLookupCard/OrderLookupCard.js +1 -1
  109. package/dist/ProductCard/ProductCard.cjs +10 -4
  110. package/dist/ProductCard/ProductCard.d.cts +8 -2
  111. package/dist/ProductCard/ProductCard.d.ts +8 -2
  112. package/dist/ProductCard/ProductCard.js +10 -4
  113. package/dist/ProductCard/components/Carousel.cjs +9 -3
  114. package/dist/ProductCard/components/Carousel.js +9 -3
  115. package/dist/ProductCard/types/index.d.cts +34 -0
  116. package/dist/ProductCard/types/index.d.ts +34 -0
  117. package/dist/PromptButton/PromptButton.d.cts +2 -2
  118. package/dist/PromptButton/PromptButton.d.ts +2 -2
  119. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.cts +2 -2
  120. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.ts +2 -2
  121. package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.cjs +1 -1
  122. package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.js +1 -1
  123. package/dist/PromptCarousel/PromptCarousel.cjs +3 -3
  124. package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
  125. package/dist/PromptCarousel/PromptCarousel.js +3 -3
  126. package/dist/ReviewCard/ReviewCard.d.cts +2 -2
  127. package/dist/ReviewCard/ReviewCard.d.ts +2 -2
  128. package/dist/ReviewCard/components/Container.cjs +2 -2
  129. package/dist/ReviewCard/components/Container.js +2 -2
  130. package/dist/ReviewCard/components/ReadMoreButton.cjs +1 -1
  131. package/dist/ReviewCard/components/ReadMoreButton.js +1 -1
  132. package/dist/ReviewCard/components/index.d.cts +6 -6
  133. package/dist/ReviewCard/components/index.d.ts +4 -4
  134. package/dist/SalesAgentProductCard/SalesAgentProductCard.d.cts +2 -2
  135. package/dist/SalesAgentProductCard/SalesAgentProductCard.d.ts +2 -2
  136. package/dist/SalesAgentProductCard/components/Container.cjs +2 -2
  137. package/dist/SalesAgentProductCard/components/Container.js +2 -2
  138. package/dist/SalesAgentProductCard/components/index.d.cts +6 -6
  139. package/dist/SalesAgentProductCard/components/index.d.ts +6 -6
  140. package/dist/SocialProof/SocialProof.cjs +5 -5
  141. package/dist/SocialProof/SocialProof.d.cts +2 -2
  142. package/dist/SocialProof/SocialProof.d.ts +2 -2
  143. package/dist/SocialProof/SocialProof.js +2 -2
  144. package/dist/SocialProof/components/Headline.cjs +3 -3
  145. package/dist/SocialProof/components/Headline.js +3 -3
  146. package/dist/SocialProof/components/LayoutFourHorizontal.cjs +1 -1
  147. package/dist/SocialProof/components/LayoutFourHorizontal.js +1 -1
  148. package/dist/SocialProof/components/Subheadline.cjs +1 -1
  149. package/dist/SocialProof/components/Subheadline.js +1 -1
  150. package/dist/SparkleAnimation/SparkleAnimation.d.cts +2 -2
  151. package/dist/SparkleAnimation/SparkleAnimation.d.ts +2 -2
  152. package/dist/Stack/Stack.d.ts +2 -2
  153. package/dist/TitledPromptCarousel/TitledPromptCarousel.cjs +1 -1
  154. package/dist/TitledPromptCarousel/TitledPromptCarousel.d.cts +2 -2
  155. package/dist/TitledPromptCarousel/TitledPromptCarousel.js +1 -1
  156. package/dist/Tokens/index.cjs +1 -1
  157. package/dist/Tokens/index.js +1 -1
  158. package/dist/TypingAnimation/TypingAnimation.cjs +9 -3
  159. package/dist/TypingAnimation/TypingAnimation.d.cts +2 -2
  160. package/dist/TypingAnimation/TypingAnimation.d.ts +2 -2
  161. package/dist/TypingAnimation/TypingAnimation.js +9 -3
  162. package/dist/TypingAnimation/hooks/useGetTypographyVariant.cjs +1 -1
  163. package/dist/TypingAnimation/hooks/useGetTypographyVariant.js +1 -1
  164. package/dist/TypingAnimation/types/index.d.cts +28 -0
  165. package/dist/TypingAnimation/types/index.d.ts +28 -0
  166. package/dist/Typography/Typography.d.ts +4 -4
  167. package/dist/WelcomeMessage/components/Container.cjs +2 -2
  168. package/dist/WelcomeMessage/components/Container.js +2 -2
  169. package/dist/WidgetTextField/WidgetTextField.cjs +1 -1
  170. package/dist/WidgetTextField/WidgetTextField.d.ts +2 -2
  171. package/dist/WidgetTextField/WidgetTextField.js +1 -1
  172. package/dist/WidgetTextField/components/Container.cjs +2 -2
  173. package/dist/WidgetTextField/components/Container.js +2 -2
  174. package/dist/WidgetTextField/components/Icon.cjs +3 -3
  175. package/dist/WidgetTextField/components/Icon.js +3 -3
  176. package/dist/WidgetWrapper/WidgetWrapper.d.cts +2 -2
  177. package/dist/WidgetWrapper/WidgetWrapper.d.ts +2 -2
  178. package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.cts +2 -2
  179. package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.ts +2 -2
  180. package/dist/styles.css +1 -1
  181. package/package.json +1 -1
  182. package/src/components/ChatFooter/__tests__/ChatFooter.test.tsx +3 -0
  183. package/src/components/ChatFooter/hooks/useGetContainerProperties.ts +1 -1
  184. package/src/components/ChatHeader/components/Handle.tsx +14 -4
  185. package/src/components/ChatPreview/ChatPreview.tsx +27 -6
  186. package/src/components/ChatPreview/__tests__/ChatPreview.test.tsx +16 -5
  187. package/src/components/ChatPreview/components/Message.tsx +3 -1
  188. package/src/components/ChatPreview/types/types.ts +35 -2
  189. package/src/components/ChatPreviewComparison/ChatPreviewComparison.tsx +23 -6
  190. package/src/components/ChatPreviewComparison/__tests__/ChatPreviewComparison.test.tsx +16 -5
  191. package/src/components/ChatPreviewComparison/components/Message.tsx +7 -1
  192. package/src/components/ChatPreviewComparison/types/types.ts +35 -1
  193. package/src/components/FloatingChat/FloatingChat.tsx +3 -9
  194. package/src/components/FloatingChat/components/AgentMessage.tsx +0 -3
  195. package/src/components/FloatingChat/components/ChatMessages.tsx +0 -3
  196. package/src/components/FloatingChat/components/ModalSheet.tsx +18 -10
  197. package/src/components/FloatingChat/components/SalesAgentProductCardsCarousel.tsx +1 -5
  198. package/src/components/FloatingChat/hooks/useFilteredChatMessages.ts +2 -2
  199. package/src/components/FloatingChat/hooks/useScrollToBottom.ts +1 -0
  200. package/src/components/FloatingChat/hooks/useSnapControl.ts +17 -22
  201. package/src/components/FloatingChat/hooks/useSnapSetup.ts +16 -37
  202. package/src/components/FloatingChat/snapConstants.ts +7 -0
  203. package/src/components/FullPageSalesAgent/FullPageSalesAgent.tsx +5 -2
  204. package/src/components/FullPageSalesAgent/components/Layout.tsx +3 -1
  205. package/src/components/FullPageSalesAgent/hooks/useGetFooterStyles.ts +7 -2
  206. package/src/components/FullPageSalesAgent/hooks/useGetMessagesStyles.ts +11 -0
  207. package/src/components/FullPageSalesAgent/hooks/useGetScrollContentStyles.ts +5 -1
  208. package/src/components/MarkdownProcessor/MarkdownProcessor.tsx +1 -1
  209. package/src/components/Message/__tests__/Message.test.tsx +3 -3
  210. package/src/components/ProductCard/ProductCard.tsx +13 -1
  211. package/src/components/ProductCard/__tests__/ProductCard.test.tsx +73 -1
  212. package/src/components/ProductCard/components/Carousel.tsx +13 -1
  213. package/src/components/ProductCard/types/index.ts +34 -0
  214. package/src/components/TypingAnimation/TypingAnimation.tsx +22 -7
  215. package/src/components/TypingAnimation/types/index.ts +29 -0
  216. 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 text field is clicked.
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 text - The placeholder text of the text field
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 react_jsx_runtime29 from "react/jsx-runtime";
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) => react_jsx_runtime29.JSX.Element;
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 react_jsx_runtime28 from "react/jsx-runtime";
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) => react_jsx_runtime28.JSX.Element;
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
- const require_Stack = require('../../Stack/Stack.cjs');
7
- require('../../Stack/index.cjs');
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 require_resolveTheme = require('../../utils/resolveTheme.cjs');
11
- require('../../Tokens/index.cjs');
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 { Stack } from "../../Stack/Stack.js";
6
- import "../../Stack/index.js";
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 { resolveTheme } from "../../utils/resolveTheme.js";
10
- import "../../Tokens/index.js";
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 text field is clicked.
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 text field is clicked.
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 react_jsx_runtime31 from "react/jsx-runtime";
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) => react_jsx_runtime31.JSX.Element;
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 react_jsx_runtime21 from "react/jsx-runtime";
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) => react_jsx_runtime21.JSX.Element;
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";