@envive-ai/react-toolkit-v3 0.3.5 → 0.3.7

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 (544) hide show
  1. package/dist/AnimatedText/AnimatedText.d.cts +3 -3
  2. package/dist/AnimatedText/AnimatedText.d.ts +3 -3
  3. package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.cts +2 -2
  4. package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.ts +2 -2
  5. package/dist/CSSVariablesEditor/hooks/useGetCssVariablesOptions.cjs +3 -3
  6. package/dist/CSSVariablesEditor/hooks/useGetCssVariablesOptions.js +3 -3
  7. package/dist/CSSVariablesEditor/hooks/useGetCurrentMerchantColors.cjs +1 -1
  8. package/dist/CSSVariablesEditor/hooks/useGetCurrentMerchantColors.js +1 -1
  9. package/dist/CSSVariablesEditor/hooks/useGetDefaultCssVariables.cjs +10 -10
  10. package/dist/CSSVariablesEditor/hooks/useGetDefaultCssVariables.js +10 -10
  11. package/dist/CSSVariablesEditor/hooks/useHandleUpdateCssVars.cjs +9 -9
  12. package/dist/CSSVariablesEditor/hooks/useHandleUpdateCssVars.js +9 -9
  13. package/dist/CSSVariablesEditor/utils/functions.cjs +2 -2
  14. package/dist/CSSVariablesEditor/utils/functions.js +2 -2
  15. package/dist/Carousel/Carousel.cjs +1 -1
  16. package/dist/Carousel/Carousel.d.cts +2 -2
  17. package/dist/Carousel/Carousel.d.ts +2 -2
  18. package/dist/Carousel/Carousel.js +1 -1
  19. package/dist/Carousel/components/ArrowIcon.cjs +3 -2
  20. package/dist/Carousel/components/ArrowIcon.js +2 -2
  21. package/dist/Carousel/hooks/useGetBadgeProperties.cjs +1 -1
  22. package/dist/Carousel/hooks/useGetBadgeProperties.js +1 -1
  23. package/dist/Carousel/types/types.d.cts +1 -1
  24. package/dist/Carousel/types/types.d.ts +1 -1
  25. package/dist/ChatFooter/ChatFooter.cjs +1 -1
  26. package/dist/ChatFooter/ChatFooter.d.cts +2 -2
  27. package/dist/ChatFooter/ChatFooter.d.ts +2 -2
  28. package/dist/ChatFooter/ChatFooter.js +1 -1
  29. package/dist/ChatFooter/components/EnviveLogo.cjs +3 -2
  30. package/dist/ChatFooter/components/EnviveLogo.js +2 -2
  31. package/dist/ChatFooter/components/Layout.d.cts +1 -1
  32. package/dist/ChatFooter/components/Layout.d.ts +1 -1
  33. package/dist/ChatFooter/components/PromptSuggestions.d.cts +1 -1
  34. package/dist/ChatFooter/components/PromptSuggestions.d.ts +1 -1
  35. package/dist/ChatFooter/components/index.d.cts +5 -5
  36. package/dist/ChatFooter/components/index.d.ts +5 -5
  37. package/dist/ChatFooter/hooks/useGetChatScrollProperties.cjs +1 -1
  38. package/dist/ChatFooter/hooks/useGetChatScrollProperties.js +1 -1
  39. package/dist/ChatFooter/hooks/useGetContainerProperties.cjs +3 -3
  40. package/dist/ChatFooter/hooks/useGetContainerProperties.js +3 -3
  41. package/dist/ChatFooter/types/types.d.cts +1 -1
  42. package/dist/ChatFooter/types/types.d.ts +1 -1
  43. package/dist/ChatHeader/ChatHeader.cjs +4 -3
  44. package/dist/ChatHeader/ChatHeader.d.cts +3 -2
  45. package/dist/ChatHeader/ChatHeader.d.ts +3 -2
  46. package/dist/ChatHeader/ChatHeader.js +4 -3
  47. package/dist/ChatHeader/components/CloseButton.cjs +10 -7
  48. package/dist/ChatHeader/components/CloseButton.js +7 -7
  49. package/dist/ChatHeader/components/Handle.cjs +27 -1
  50. package/dist/ChatHeader/components/Handle.js +27 -1
  51. package/dist/ChatHeader/components/Toggle.cjs +1 -1
  52. package/dist/ChatHeader/components/Toggle.js +1 -1
  53. package/dist/ChatHeader/hooks/useGetCloseButtonProperties.cjs +1 -1
  54. package/dist/ChatHeader/hooks/useGetCloseButtonProperties.js +1 -1
  55. package/dist/ChatHeader/hooks/useGetHandleProperties.cjs +1 -1
  56. package/dist/ChatHeader/hooks/useGetHandleProperties.js +1 -1
  57. package/dist/ChatHeader/hooks/useGetLayoutProperties.cjs +2 -2
  58. package/dist/ChatHeader/hooks/useGetLayoutProperties.js +2 -2
  59. package/dist/ChatHeader/hooks/useGetToggleOptionProperties.cjs +1 -1
  60. package/dist/ChatHeader/hooks/useGetToggleOptionProperties.js +1 -1
  61. package/dist/ChatHeader/hooks/useGetToggleProperties.cjs +1 -1
  62. package/dist/ChatHeader/hooks/useGetToggleProperties.js +1 -1
  63. package/dist/ChatHeader/hooks/useToggleLogoSelector.cjs +1 -1
  64. package/dist/ChatHeader/hooks/useToggleLogoSelector.js +1 -1
  65. package/dist/ChatHeader/types/index.d.cts +4 -2
  66. package/dist/ChatHeader/types/index.d.ts +4 -2
  67. package/dist/ChatPreview/ChatPreview.cjs +1 -1
  68. package/dist/ChatPreview/ChatPreview.d.cts +2 -2
  69. package/dist/ChatPreview/ChatPreview.d.ts +2 -2
  70. package/dist/ChatPreview/ChatPreview.js +1 -1
  71. package/dist/ChatPreview/types/types.d.cts +1 -1
  72. package/dist/ChatPreview/types/types.d.ts +1 -1
  73. package/dist/ChatPreviewComparison/ChatPreviewComparison.cjs +1 -1
  74. package/dist/ChatPreviewComparison/ChatPreviewComparison.d.cts +2 -2
  75. package/dist/ChatPreviewComparison/ChatPreviewComparison.d.ts +2 -2
  76. package/dist/ChatPreviewComparison/ChatPreviewComparison.js +1 -1
  77. package/dist/ChatPreviewComparison/components/Headline.cjs +1 -1
  78. package/dist/ChatPreviewComparison/components/Headline.js +1 -1
  79. package/dist/ChatPreviewComparison/components/Layout.cjs +3 -3
  80. package/dist/ChatPreviewComparison/components/Layout.js +3 -3
  81. package/dist/ChatPreviewComparison/components/Message.cjs +1 -1
  82. package/dist/ChatPreviewComparison/components/Message.js +1 -1
  83. package/dist/ChatPreviewComparison/types/types.d.cts +1 -1
  84. package/dist/ChatPreviewComparison/types/types.d.ts +1 -1
  85. package/dist/ChatPreviewLoading/ChatPreviewLoading.d.cts +2 -2
  86. package/dist/ChatPreviewLoading/ChatPreviewLoading.d.ts +2 -2
  87. package/dist/Container/Container.d.cts +174 -174
  88. package/dist/Container/Container.d.ts +174 -174
  89. package/dist/DesignTokens/DesignTokensComponent.d.cts +2 -2
  90. package/dist/DesignTokens/DesignTokensComponent.d.ts +2 -2
  91. package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.cts +2 -2
  92. package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.cjs +3 -2
  93. package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.js +2 -2
  94. package/dist/DocumentRetrievalCard/hooks/useGetBackgroundColorsProperties.cjs +1 -1
  95. package/dist/DocumentRetrievalCard/hooks/useGetBackgroundColorsProperties.js +1 -1
  96. package/dist/DocumentRetrievalCard/hooks/useGetBorderProperties.cjs +1 -1
  97. package/dist/DocumentRetrievalCard/hooks/useGetBorderProperties.js +1 -1
  98. package/dist/DocumentRetrievalCard/hooks/useGetBorderRadiusProperties.cjs +1 -1
  99. package/dist/DocumentRetrievalCard/hooks/useGetBorderRadiusProperties.js +1 -1
  100. package/dist/DocumentRetrievalCard/hooks/useGetIconBackgroundProperties.cjs +1 -1
  101. package/dist/DocumentRetrievalCard/hooks/useGetIconBackgroundProperties.js +1 -1
  102. package/dist/DocumentRetrievalCard/hooks/useGetIconColorProperties.cjs +1 -1
  103. package/dist/DocumentRetrievalCard/hooks/useGetIconColorProperties.js +1 -1
  104. package/dist/DocumentRetrievalCard/hooks/useGetLabelTextCaseProperties.cjs +1 -1
  105. package/dist/DocumentRetrievalCard/hooks/useGetLabelTextCaseProperties.js +1 -1
  106. package/dist/DocumentRetrievalCard/hooks/useGetLabelTypographyProperties.cjs +1 -1
  107. package/dist/DocumentRetrievalCard/hooks/useGetLabelTypographyProperties.js +1 -1
  108. package/dist/DocumentRetrievalCard/index.cjs +1 -1
  109. package/dist/DocumentRetrievalCard/index.d.cts +1 -1
  110. package/dist/DocumentRetrievalCard/index.d.ts +1 -1
  111. package/dist/DocumentRetrievalCard/index.js +1 -1
  112. package/dist/DocumentRetrievalCard/types/index.d.cts +1 -1
  113. package/dist/DocumentRetrievalCard/types/index.d.ts +1 -1
  114. package/dist/DocumentRetrievalCard/utils/functions.cjs +1 -1
  115. package/dist/DocumentRetrievalCard/utils/functions.js +1 -1
  116. package/dist/FloatingButton/FloatingButton.cjs +2 -1
  117. package/dist/FloatingButton/FloatingButton.d.cts +4 -3
  118. package/dist/FloatingButton/FloatingButton.d.ts +4 -3
  119. package/dist/FloatingButton/FloatingButton.js +2 -1
  120. package/dist/FloatingButton/components/Container.cjs +2 -2
  121. package/dist/FloatingButton/components/Container.js +2 -2
  122. package/dist/FloatingButton/components/Icon.cjs +3 -2
  123. package/dist/FloatingButton/components/Icon.js +2 -2
  124. package/dist/FloatingButton/hooks/useGetButtonProperties.cjs +1 -1
  125. package/dist/FloatingButton/hooks/useGetButtonProperties.js +1 -1
  126. package/dist/FloatingButton/hooks/useGetContainerProperties.cjs +2 -2
  127. package/dist/FloatingButton/hooks/useGetContainerProperties.js +2 -2
  128. package/dist/FloatingButton/types/types.cjs +4 -4
  129. package/dist/FloatingButton/types/types.d.cts +9 -5
  130. package/dist/FloatingButton/types/types.d.ts +9 -5
  131. package/dist/FloatingButton/types/types.js +4 -4
  132. package/dist/FloatingChat/FloatingChat.cjs +107 -40
  133. package/dist/FloatingChat/FloatingChat.d.cts +3 -2
  134. package/dist/FloatingChat/FloatingChat.d.ts +3 -2
  135. package/dist/FloatingChat/FloatingChat.js +109 -42
  136. package/dist/FloatingChat/components/AgentMessage.cjs +4 -3
  137. package/dist/FloatingChat/components/AgentMessage.js +4 -3
  138. package/dist/FloatingChat/components/ChatMessages.cjs +60 -42
  139. package/dist/FloatingChat/components/ChatMessages.js +59 -41
  140. package/dist/FloatingChat/components/Layout.cjs +3 -3
  141. package/dist/FloatingChat/components/Layout.js +3 -3
  142. package/dist/FloatingChat/components/ModalSheet.cjs +184 -0
  143. package/dist/FloatingChat/components/ModalSheet.js +182 -0
  144. package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.cjs +3 -2
  145. package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.js +3 -2
  146. package/dist/FloatingChat/components/ScrollToBottomButton.cjs +3 -2
  147. package/dist/FloatingChat/components/ScrollToBottomButton.js +2 -2
  148. package/dist/FloatingChat/components/index.cjs +1 -0
  149. package/dist/FloatingChat/components/index.js +1 -0
  150. package/dist/FloatingChat/hooks/useChatSuggestions.cjs +25 -0
  151. package/dist/FloatingChat/hooks/useChatSuggestions.js +24 -0
  152. package/dist/FloatingChat/hooks/useFilteredChatMessages.cjs +24 -0
  153. package/dist/FloatingChat/hooks/useFilteredChatMessages.js +23 -0
  154. package/dist/FloatingChat/hooks/usePreventScroll.cjs +117 -0
  155. package/dist/FloatingChat/hooks/usePreventScroll.js +116 -0
  156. package/dist/FloatingChat/hooks/useSnapCalculator.cjs +37 -0
  157. package/dist/FloatingChat/hooks/useSnapCalculator.js +35 -0
  158. package/dist/FloatingChat/hooks/useSnapControl.cjs +82 -0
  159. package/dist/FloatingChat/hooks/useSnapControl.js +81 -0
  160. package/dist/FloatingChat/hooks/useSnapSetup.cjs +59 -0
  161. package/dist/FloatingChat/hooks/useSnapSetup.js +58 -0
  162. package/dist/FloatingChat/types/types.d.cts +7 -3
  163. package/dist/FloatingChat/types/types.d.ts +7 -4
  164. package/dist/Image/Image.d.cts +2 -2
  165. package/dist/Image/Image.d.ts +2 -2
  166. package/dist/ImageGallery/ImageGallery.cjs +1 -1
  167. package/dist/ImageGallery/ImageGallery.d.cts +2 -2
  168. package/dist/ImageGallery/ImageGallery.d.ts +2 -2
  169. package/dist/ImageGallery/ImageGallery.js +1 -1
  170. package/dist/ImageGallery/components/Layout.cjs +1 -1
  171. package/dist/ImageGallery/components/Layout.js +1 -1
  172. package/dist/ImageGallery/types/types.d.cts +1 -1
  173. package/dist/ImageGallery/types/types.d.ts +1 -1
  174. package/dist/ImageGallery/utils/functions.cjs +1 -1
  175. package/dist/ImageGallery/utils/functions.js +1 -1
  176. package/dist/MarkdownProcessor/MarkdownProcessor.d.cts +2 -2
  177. package/dist/MarkdownProcessor/MarkdownProcessor.d.ts +2 -2
  178. package/dist/Message/components/LinkButton.cjs +3 -2
  179. package/dist/Message/components/LinkButton.js +2 -2
  180. package/dist/Message/hooks/useLatencyAnimation.cjs +19 -13
  181. package/dist/Message/hooks/useLatencyAnimation.js +13 -13
  182. package/dist/OrderLookupCard/OrderLookupCard.cjs +1 -1
  183. package/dist/OrderLookupCard/OrderLookupCard.js +1 -1
  184. package/dist/OrderLookupCard/hooks/useGetContainerProperties.cjs +1 -1
  185. package/dist/OrderLookupCard/hooks/useGetContainerProperties.js +1 -1
  186. package/dist/OrderLookupCard/hooks/useGetImageBorderRadiusProperties.cjs +1 -1
  187. package/dist/OrderLookupCard/hooks/useGetImageBorderRadiusProperties.js +1 -1
  188. package/dist/OrderLookupCard/hooks/useGetStatusLabelProperties.cjs +1 -1
  189. package/dist/OrderLookupCard/hooks/useGetStatusLabelProperties.js +1 -1
  190. package/dist/OrderLookupCard/hooks/useGetTrackOrderLinkProperties.cjs +1 -1
  191. package/dist/OrderLookupCard/hooks/useGetTrackOrderLinkProperties.js +1 -1
  192. package/dist/OrderLookupCard/types/index.d.cts +1 -1
  193. package/dist/OrderLookupCard/types/index.d.ts +1 -1
  194. package/dist/PromptButton/PromptButton.cjs +4 -3
  195. package/dist/PromptButton/PromptButton.d.cts +2 -2
  196. package/dist/PromptButton/PromptButton.d.ts +2 -2
  197. package/dist/PromptButton/PromptButton.js +3 -3
  198. package/dist/PromptButton/hooks/useGetIconColorsProperties.cjs +1 -1
  199. package/dist/PromptButton/hooks/useGetIconColorsProperties.js +1 -1
  200. package/dist/PromptButton/types/index.d.cts +1 -1
  201. package/dist/PromptButton/types/index.d.ts +1 -1
  202. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.cjs +1 -1
  203. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.cts +2 -2
  204. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.ts +2 -2
  205. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.js +1 -1
  206. package/dist/PromptButtonCarouselWithImage/types/types.d.cts +1 -1
  207. package/dist/PromptButtonCarouselWithImage/types/types.d.ts +1 -1
  208. package/dist/PromptCarousel/PromptCarousel.cjs +1 -2
  209. package/dist/PromptCarousel/PromptCarousel.d.cts +2 -2
  210. package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
  211. package/dist/PromptCarousel/PromptCarousel.js +1 -2
  212. package/dist/PromptCarousel/types/types.d.cts +1 -1
  213. package/dist/PromptCarousel/types/types.d.ts +1 -1
  214. package/dist/ReviewCard/ReviewCard.cjs +1 -1
  215. package/dist/ReviewCard/ReviewCard.d.cts +2 -2
  216. package/dist/ReviewCard/ReviewCard.d.ts +2 -2
  217. package/dist/ReviewCard/ReviewCard.js +1 -1
  218. package/dist/ReviewCard/components/Container.d.cts +1 -1
  219. package/dist/ReviewCard/components/Container.d.ts +1 -1
  220. package/dist/ReviewCard/components/Rating.d.cts +1 -1
  221. package/dist/ReviewCard/components/Rating.d.ts +1 -1
  222. package/dist/ReviewCard/components/ReadMoreButton.cjs +4 -3
  223. package/dist/ReviewCard/components/ReadMoreButton.d.cts +1 -1
  224. package/dist/ReviewCard/components/ReadMoreButton.d.ts +1 -1
  225. package/dist/ReviewCard/components/ReadMoreButton.js +3 -3
  226. package/dist/ReviewCard/components/StarIcon.cjs +3 -2
  227. package/dist/ReviewCard/components/StarIcon.js +2 -2
  228. package/dist/ReviewCard/components/VerifiedBuyer.cjs +3 -2
  229. package/dist/ReviewCard/components/VerifiedBuyer.js +2 -2
  230. package/dist/ReviewCard/components/index.d.cts +7 -7
  231. package/dist/ReviewCard/components/index.d.ts +7 -7
  232. package/dist/ReviewCard/hooks/useGetBackgroundColorsProperties.cjs +1 -1
  233. package/dist/ReviewCard/hooks/useGetBackgroundColorsProperties.js +1 -1
  234. package/dist/ReviewCard/hooks/useGetBorderProperties.cjs +1 -1
  235. package/dist/ReviewCard/hooks/useGetBorderProperties.js +1 -1
  236. package/dist/ReviewCard/hooks/useGetBorderRadiusProperties.cjs +1 -1
  237. package/dist/ReviewCard/hooks/useGetBorderRadiusProperties.js +1 -1
  238. package/dist/ReviewCard/hooks/useGetRatingBackgroundProperties.cjs +1 -1
  239. package/dist/ReviewCard/hooks/useGetRatingBackgroundProperties.js +1 -1
  240. package/dist/ReviewCard/hooks/useGetReadMoreTypographyProperties.cjs +1 -1
  241. package/dist/ReviewCard/hooks/useGetReadMoreTypographyProperties.js +1 -1
  242. package/dist/ReviewCard/hooks/useGetStarIconProperties.cjs +1 -1
  243. package/dist/ReviewCard/hooks/useGetStarIconProperties.js +1 -1
  244. package/dist/ReviewCard/types/types.d.cts +1 -1
  245. package/dist/ReviewCard/types/types.d.ts +1 -1
  246. package/dist/SalesAgentProductCard/SalesAgentProductCard.cjs +1 -1
  247. package/dist/SalesAgentProductCard/SalesAgentProductCard.d.cts +2 -2
  248. package/dist/SalesAgentProductCard/SalesAgentProductCard.d.ts +2 -2
  249. package/dist/SalesAgentProductCard/SalesAgentProductCard.js +1 -1
  250. package/dist/SalesAgentProductCard/components/Container.cjs +1 -1
  251. package/dist/SalesAgentProductCard/components/Container.d.cts +1 -1
  252. package/dist/SalesAgentProductCard/components/Container.d.ts +1 -1
  253. package/dist/SalesAgentProductCard/components/Container.js +1 -1
  254. package/dist/SalesAgentProductCard/components/ProductName.cjs +1 -1
  255. package/dist/SalesAgentProductCard/components/ProductName.d.cts +1 -1
  256. package/dist/SalesAgentProductCard/components/ProductName.d.ts +1 -1
  257. package/dist/SalesAgentProductCard/components/ProductName.js +1 -1
  258. package/dist/SalesAgentProductCard/components/Rate.cjs +1 -1
  259. package/dist/SalesAgentProductCard/components/Rate.d.cts +1 -1
  260. package/dist/SalesAgentProductCard/components/Rate.d.ts +1 -1
  261. package/dist/SalesAgentProductCard/components/Rate.js +1 -1
  262. package/dist/SalesAgentProductCard/components/StarIcon.cjs +3 -2
  263. package/dist/SalesAgentProductCard/components/StarIcon.js +2 -2
  264. package/dist/SalesAgentProductCard/components/index.d.cts +9 -9
  265. package/dist/SalesAgentProductCard/components/index.d.ts +9 -9
  266. package/dist/SalesAgentProductCard/hooks/useGetContainerProperties.cjs +1 -1
  267. package/dist/SalesAgentProductCard/hooks/useGetContainerProperties.js +1 -1
  268. package/dist/SalesAgentProductCard/hooks/useGetProductDescriptionProperties.cjs +1 -1
  269. package/dist/SalesAgentProductCard/hooks/useGetProductDescriptionProperties.js +1 -1
  270. package/dist/SalesAgentProductCard/hooks/useGetProductNameProperties.cjs +1 -1
  271. package/dist/SalesAgentProductCard/hooks/useGetProductNameProperties.js +1 -1
  272. package/dist/SalesAgentProductCard/hooks/useGetStarIconProperties.cjs +1 -1
  273. package/dist/SalesAgentProductCard/hooks/useGetStarIconProperties.js +1 -1
  274. package/dist/SalesAgentProductCard/types/types.d.cts +1 -1
  275. package/dist/SalesAgentProductCard/types/types.d.ts +1 -1
  276. package/dist/SocialProof/SocialProof.cjs +10 -3
  277. package/dist/SocialProof/SocialProof.d.cts +2 -2
  278. package/dist/SocialProof/SocialProof.d.ts +2 -2
  279. package/dist/SocialProof/SocialProof.js +10 -3
  280. package/dist/SocialProof/components/Headline.cjs +1 -1
  281. package/dist/SocialProof/components/Headline.js +1 -1
  282. package/dist/SocialProof/components/LayoutFourHorizontal.cjs +1 -1
  283. package/dist/SocialProof/components/LayoutFourHorizontal.js +1 -1
  284. package/dist/SocialProof/components/Subheadline.cjs +1 -1
  285. package/dist/SocialProof/components/Subheadline.js +1 -1
  286. package/dist/SocialProof/components/Textfield.cjs +1 -1
  287. package/dist/SocialProof/components/Textfield.js +1 -1
  288. package/dist/SocialProof/hooks/index.cjs +1 -0
  289. package/dist/SocialProof/hooks/index.js +3 -0
  290. package/dist/SocialProof/hooks/useSocialProofCount.cjs +48 -0
  291. package/dist/SocialProof/hooks/useSocialProofCount.d.cts +15 -0
  292. package/dist/SocialProof/hooks/useSocialProofCount.d.ts +15 -0
  293. package/dist/SocialProof/hooks/useSocialProofCount.js +46 -0
  294. package/dist/SocialProof/index.cjs +5 -1
  295. package/dist/SocialProof/index.d.cts +3 -2
  296. package/dist/SocialProof/index.d.ts +3 -2
  297. package/dist/SocialProof/index.js +4 -2
  298. package/dist/SocialProof/types/types.cjs +8 -1
  299. package/dist/SocialProof/types/types.d.cts +17 -7
  300. package/dist/SocialProof/types/types.d.ts +17 -7
  301. package/dist/SocialProof/types/types.js +7 -1
  302. package/dist/SocialProof/utils/functions.cjs +1 -1
  303. package/dist/SocialProof/utils/functions.js +1 -1
  304. package/dist/Stack/Stack.d.cts +2 -2
  305. package/dist/Stack/Stack.d.ts +2 -2
  306. package/dist/TextField/TextField.cjs +1 -1
  307. package/dist/TextField/TextField.js +1 -1
  308. package/dist/TextField/hooks/useGetContainerProperties.cjs +1 -1
  309. package/dist/TextField/hooks/useGetContainerProperties.js +1 -1
  310. package/dist/TextField/types/index.d.cts +1 -1
  311. package/dist/TextField/types/index.d.ts +1 -1
  312. package/dist/TextField/utils/getInputClasses.cjs +1 -1
  313. package/dist/TextField/utils/getInputClasses.js +1 -1
  314. package/dist/TextField/utils/getSendIconElement.cjs +13 -9
  315. package/dist/TextField/utils/getSendIconElement.js +9 -9
  316. package/dist/TitledPromptCarousel/TitledPromptCarousel.cjs +1 -1
  317. package/dist/TitledPromptCarousel/TitledPromptCarousel.d.cts +2 -2
  318. package/dist/TitledPromptCarousel/TitledPromptCarousel.d.ts +2 -2
  319. package/dist/TitledPromptCarousel/TitledPromptCarousel.js +1 -1
  320. package/dist/TitledPromptCarousel/types/index.d.cts +1 -1
  321. package/dist/TitledPromptCarousel/types/index.d.ts +1 -1
  322. package/dist/Tokens/index.cjs +13 -13
  323. package/dist/Tokens/index.d.cts +13 -13
  324. package/dist/Tokens/index.d.ts +13 -13
  325. package/dist/Tokens/index.js +13 -13
  326. package/dist/TypingAnimation/TypingAnimation.cjs +1 -1
  327. package/dist/TypingAnimation/TypingAnimation.d.cts +2 -2
  328. package/dist/TypingAnimation/TypingAnimation.d.ts +2 -2
  329. package/dist/TypingAnimation/TypingAnimation.js +1 -1
  330. package/dist/TypingAnimation/hooks/useGetTypographyVariant.cjs +1 -1
  331. package/dist/TypingAnimation/hooks/useGetTypographyVariant.js +1 -1
  332. package/dist/TypingAnimation/types/index.d.cts +1 -1
  333. package/dist/TypingAnimation/types/index.d.ts +1 -1
  334. package/dist/Typography/Typography.d.cts +4 -4
  335. package/dist/Typography/Typography.d.ts +4 -4
  336. package/dist/WelcomeMessage/WelcomeMessage.cjs +1 -1
  337. package/dist/WelcomeMessage/WelcomeMessage.js +1 -1
  338. package/dist/WelcomeMessage/components/SparkleIcon.cjs +3 -2
  339. package/dist/WelcomeMessage/components/SparkleIcon.js +2 -2
  340. package/dist/WelcomeMessage/hooks/useGetContainerProperties.cjs +1 -1
  341. package/dist/WelcomeMessage/hooks/useGetContainerProperties.js +1 -1
  342. package/dist/WelcomeMessage/types/types.cjs +1 -1
  343. package/dist/WelcomeMessage/types/types.d.cts +1 -1
  344. package/dist/WelcomeMessage/types/types.d.ts +1 -1
  345. package/dist/WelcomeMessage/types/types.js +1 -1
  346. package/dist/WidgetTextField/WidgetTextField.cjs +1 -1
  347. package/dist/WidgetTextField/WidgetTextField.d.cts +2 -2
  348. package/dist/WidgetTextField/WidgetTextField.d.ts +2 -2
  349. package/dist/WidgetTextField/WidgetTextField.js +1 -1
  350. package/dist/WidgetTextField/components/Icon.cjs +11 -8
  351. package/dist/WidgetTextField/components/Icon.js +8 -8
  352. package/dist/WidgetTextField/components/Skeleton.cjs +1 -1
  353. package/dist/WidgetTextField/components/Skeleton.js +1 -1
  354. package/dist/WidgetTextField/hooks/useGetContainerProperties.cjs +1 -1
  355. package/dist/WidgetTextField/hooks/useGetContainerProperties.js +1 -1
  356. package/dist/WidgetTextField/types/types.d.cts +1 -1
  357. package/dist/WidgetTextField/types/types.d.ts +1 -1
  358. package/dist/WidgetWrapper/WidgetWrapper.d.cts +2 -2
  359. package/dist/WidgetWrapper/WidgetWrapper.d.ts +2 -2
  360. package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.ts +2 -2
  361. package/dist/styles.css +1 -1
  362. package/dist/utils/resolveTheme.cjs +1 -1
  363. package/dist/utils/resolveTheme.js +1 -1
  364. package/dist/utils/useCheckIsMobile.cjs +1 -1
  365. package/dist/utils/useCheckIsMobile.js +1 -1
  366. package/dist/utils/useResponsiveValue.cjs +1 -1
  367. package/dist/utils/useResponsiveValue.d.cts +1 -1
  368. package/dist/utils/useResponsiveValue.d.ts +1 -1
  369. package/dist/utils/useResponsiveValue.js +1 -1
  370. package/package.json +1 -1
  371. package/src/components/ChatFooter/hooks/useGetContainerProperties.ts +2 -2
  372. package/src/components/ChatHeader/ChatHeader.tsx +2 -0
  373. package/src/components/ChatHeader/components/Handle.tsx +29 -1
  374. package/src/components/ChatHeader/types/index.ts +3 -0
  375. package/src/components/FloatingButton/FloatingButton.tsx +2 -0
  376. package/src/components/FloatingButton/components/Container.tsx +3 -0
  377. package/src/components/FloatingButton/hooks/useGetContainerProperties.ts +2 -1
  378. package/src/components/FloatingButton/types/types.ts +9 -4
  379. package/src/components/FloatingChat/FloatingChat.tsx +160 -59
  380. package/src/components/FloatingChat/components/AgentMessage.tsx +3 -0
  381. package/src/components/FloatingChat/components/ChatMessages.tsx +25 -0
  382. package/src/components/FloatingChat/components/Layout.tsx +2 -2
  383. package/src/components/FloatingChat/components/ModalSheet.tsx +288 -0
  384. package/src/components/FloatingChat/components/SalesAgentProductCardsCarousel.tsx +7 -2
  385. package/src/components/FloatingChat/components/index.ts +3 -0
  386. package/src/components/FloatingChat/hooks/useChatSuggestions.ts +49 -0
  387. package/src/components/FloatingChat/hooks/useFilteredChatMessages.ts +43 -0
  388. package/src/components/FloatingChat/hooks/usePreventScroll.ts +207 -0
  389. package/src/components/FloatingChat/hooks/useSnapCalculator.ts +41 -0
  390. package/src/components/FloatingChat/hooks/useSnapControl.ts +131 -0
  391. package/src/components/FloatingChat/hooks/useSnapSetup.ts +106 -0
  392. package/src/components/FloatingChat/types/types.ts +4 -0
  393. package/src/components/PromptCarousel/PromptCarousel.tsx +0 -1
  394. package/src/components/SocialProof/SocialProof.tsx +8 -2
  395. package/src/components/SocialProof/__tests__/SocialProof.test.tsx +66 -17
  396. package/src/components/SocialProof/hooks/index.ts +2 -0
  397. package/src/components/SocialProof/hooks/useSocialProofCount.ts +67 -0
  398. package/src/components/SocialProof/index.ts +2 -1
  399. package/src/components/SocialProof/types/types.ts +18 -6
  400. package/dist/hooks/dist/application/models/api/response.d.cts +0 -63
  401. package/dist/hooks/dist/application/models/api/response.d.ts +0 -63
  402. package/dist/hooks/dist/application/models/api/responseGenerics.d.cts +0 -41
  403. package/dist/hooks/dist/application/models/api/responseGenerics.d.ts +0 -41
  404. package/dist/hooks/dist/application/models/api/suggestion.d.cts +0 -10
  405. package/dist/hooks/dist/application/models/api/suggestion.d.ts +0 -10
  406. package/dist/hooks/dist/application/models/api/userEvent.d.cts +0 -60
  407. package/dist/hooks/dist/application/models/api/userEvent.d.ts +0 -60
  408. package/dist/hooks/dist/application/models/message.d.cts +0 -108
  409. package/dist/hooks/dist/application/models/message.d.ts +0 -108
  410. package/dist/hooks/dist/application/models/utilityTypes/camelCase.d.cts +0 -71
  411. package/dist/hooks/dist/application/models/utilityTypes/camelCase.d.ts +0 -71
  412. package/dist/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.cts +0 -58
  413. package/dist/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts +0 -58
  414. package/dist/hooks/dist/application/models/utilityTypes/internal.d.cts +0 -22
  415. package/dist/hooks/dist/application/models/utilityTypes/internal.d.ts +0 -22
  416. package/dist/hooks/dist/application/models/utilityTypes/splitWords.d.cts +0 -31
  417. package/dist/hooks/dist/application/models/utilityTypes/splitWords.d.ts +0 -31
  418. package/dist/hooks/dist/application/models/utilityTypes/trim.d.cts +0 -30
  419. package/dist/hooks/dist/application/models/utilityTypes/trim.d.ts +0 -30
  420. package/dist/hooks/dist/application/models/utilityTypes/unknownArray.d.cts +0 -30
  421. package/dist/hooks/dist/application/models/utilityTypes/unknownArray.d.ts +0 -30
  422. package/dist/hooks/dist/contexts/salesAgentContext/chatAPI.d.cts +0 -23
  423. package/dist/hooks/dist/contexts/salesAgentContext/chatAPI.d.ts +0 -23
  424. package/dist/hooks/dist/contexts/salesAgentContext/index.d.ts +0 -3
  425. package/dist/hooks/dist/contexts/salesAgentContext/salesAgentContext.d.cts +0 -18
  426. package/dist/hooks/dist/contexts/salesAgentContext/salesAgentContext.d.ts +0 -18
  427. package/dist/hooks/dist/contexts/typesV3.d.cts +0 -81
  428. package/dist/hooks/dist/contexts/typesV3.d.ts +0 -81
  429. package/dist/icons/dist/ArrowUp.cjs +0 -28
  430. package/dist/icons/dist/ArrowUp.js +0 -28
  431. package/dist/icons/dist/Checkmark.cjs +0 -31
  432. package/dist/icons/dist/Checkmark.js +0 -31
  433. package/dist/icons/dist/ChevronDown.cjs +0 -23
  434. package/dist/icons/dist/ChevronDown.js +0 -23
  435. package/dist/icons/dist/Document.cjs +0 -18
  436. package/dist/icons/dist/Document.js +0 -18
  437. package/dist/icons/dist/EnviveWatermark.cjs +0 -39
  438. package/dist/icons/dist/EnviveWatermark.js +0 -39
  439. package/dist/icons/dist/FourPointStar.cjs +0 -22
  440. package/dist/icons/dist/FourPointStar.js +0 -22
  441. package/dist/icons/dist/IconCloseRounded.cjs +0 -21
  442. package/dist/icons/dist/IconCloseRounded.js +0 -21
  443. package/dist/icons/dist/IconCloseSharp.cjs +0 -30
  444. package/dist/icons/dist/IconCloseSharp.js +0 -30
  445. package/dist/icons/dist/IconCloseTransparent.cjs +0 -23
  446. package/dist/icons/dist/IconCloseTransparent.js +0 -23
  447. package/dist/icons/dist/LatencyIconEmptyStep.cjs +0 -17
  448. package/dist/icons/dist/LatencyIconEmptyStep.js +0 -17
  449. package/dist/icons/dist/LatencyIconStep1.cjs +0 -43
  450. package/dist/icons/dist/LatencyIconStep1.js +0 -43
  451. package/dist/icons/dist/LatencyIconStep2.cjs +0 -32
  452. package/dist/icons/dist/LatencyIconStep2.js +0 -32
  453. package/dist/icons/dist/LatencyIconStep3.cjs +0 -25
  454. package/dist/icons/dist/LatencyIconStep3.js +0 -25
  455. package/dist/icons/dist/LatencyIconStep4.cjs +0 -25
  456. package/dist/icons/dist/LatencyIconStep4.js +0 -25
  457. package/dist/icons/dist/LatencyIconStep5.cjs +0 -32
  458. package/dist/icons/dist/LatencyIconStep5.js +0 -32
  459. package/dist/icons/dist/Send.cjs +0 -21
  460. package/dist/icons/dist/Send.js +0 -21
  461. package/dist/icons/dist/SendMinimalist.cjs +0 -34
  462. package/dist/icons/dist/SendMinimalist.js +0 -34
  463. package/dist/icons/dist/SendModern.cjs +0 -43
  464. package/dist/icons/dist/SendModern.js +0 -43
  465. package/dist/icons/dist/SendStandard.cjs +0 -21
  466. package/dist/icons/dist/SendStandard.js +0 -21
  467. package/dist/icons/dist/Sparkles.cjs +0 -43
  468. package/dist/icons/dist/Sparkles.js +0 -43
  469. package/dist/icons/dist/Star.cjs +0 -23
  470. package/dist/icons/dist/Star.js +0 -23
  471. package/dist/icons/dist/VectorUpRight.cjs +0 -17
  472. package/dist/icons/dist/VectorUpRight.js +0 -17
  473. package/dist/icons/dist/_virtual/rolldown_runtime.cjs +0 -27
  474. package/dist/icons/dist/_virtual/rolldown_runtime.js +0 -25
  475. package/dist/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs +0 -696
  476. package/dist/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.js +0 -696
  477. package/dist/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.cjs +0 -43
  478. package/dist/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -43
  479. package/dist/icons/dist/node_modules/react/cjs/react.development.cjs +0 -1528
  480. package/dist/icons/dist/node_modules/react/cjs/react.development.js +0 -1528
  481. package/dist/icons/dist/node_modules/react/cjs/react.production.min.cjs +0 -329
  482. package/dist/icons/dist/node_modules/react/cjs/react.production.min.js +0 -329
  483. package/dist/icons/dist/node_modules/react/index.cjs +0 -13
  484. package/dist/icons/dist/node_modules/react/index.js +0 -13
  485. package/dist/icons/dist/node_modules/react/jsx-runtime.cjs +0 -13
  486. package/dist/icons/dist/node_modules/react/jsx-runtime.js +0 -13
  487. /package/dist/{components-v3/src → src}/models/colorsConfig.cjs +0 -0
  488. /package/dist/{components-v3/src → src}/models/colorsConfig.d.cts +0 -0
  489. /package/dist/{components-v3/src → src}/models/colorsConfig.d.ts +0 -0
  490. /package/dist/{components-v3/src → src}/models/colorsConfig.js +0 -0
  491. /package/dist/{components-v3/tokens → tokens}/aspectRatio/aspectRatio.cjs +0 -0
  492. /package/dist/{components-v3/tokens → tokens}/aspectRatio/aspectRatio.d.cts +0 -0
  493. /package/dist/{components-v3/tokens → tokens}/aspectRatio/aspectRatio.d.ts +0 -0
  494. /package/dist/{components-v3/tokens → tokens}/aspectRatio/aspectRatio.js +0 -0
  495. /package/dist/{components-v3/tokens → tokens}/breakpoints/breakpoints.cjs +0 -0
  496. /package/dist/{components-v3/tokens → tokens}/breakpoints/breakpoints.d.cts +0 -0
  497. /package/dist/{components-v3/tokens → tokens}/breakpoints/breakpoints.d.ts +0 -0
  498. /package/dist/{components-v3/tokens → tokens}/breakpoints/breakpoints.js +0 -0
  499. /package/dist/{components-v3/tokens → tokens}/colors/colors.cjs +0 -0
  500. /package/dist/{components-v3/tokens → tokens}/colors/colors.d.cts +0 -0
  501. /package/dist/{components-v3/tokens → tokens}/colors/colors.d.ts +0 -0
  502. /package/dist/{components-v3/tokens → tokens}/colors/colors.js +0 -0
  503. /package/dist/{components-v3/tokens → tokens}/montion/motion.cjs +0 -0
  504. /package/dist/{components-v3/tokens → tokens}/montion/motion.d.cts +0 -0
  505. /package/dist/{components-v3/tokens → tokens}/montion/motion.d.ts +0 -0
  506. /package/dist/{components-v3/tokens → tokens}/montion/motion.js +0 -0
  507. /package/dist/{components-v3/tokens → tokens}/radius/radius.cjs +0 -0
  508. /package/dist/{components-v3/tokens → tokens}/radius/radius.d.cts +0 -0
  509. /package/dist/{components-v3/tokens → tokens}/radius/radius.d.ts +0 -0
  510. /package/dist/{components-v3/tokens → tokens}/radius/radius.js +0 -0
  511. /package/dist/{components-v3/tokens → tokens}/spacing/spacing.cjs +0 -0
  512. /package/dist/{components-v3/tokens → tokens}/spacing/spacing.d.cts +0 -0
  513. /package/dist/{components-v3/tokens → tokens}/spacing/spacing.d.ts +0 -0
  514. /package/dist/{components-v3/tokens → tokens}/spacing/spacing.js +0 -0
  515. /package/dist/{components-v3/tokens → tokens}/theme/theme.cjs +0 -0
  516. /package/dist/{components-v3/tokens → tokens}/theme/theme.d.cts +0 -0
  517. /package/dist/{components-v3/tokens → tokens}/theme/theme.d.ts +0 -0
  518. /package/dist/{components-v3/tokens → tokens}/theme/theme.js +0 -0
  519. /package/dist/{components-v3/tokens → tokens}/typography/fontFamily.cjs +0 -0
  520. /package/dist/{components-v3/tokens → tokens}/typography/fontFamily.d.cts +0 -0
  521. /package/dist/{components-v3/tokens → tokens}/typography/fontFamily.d.ts +0 -0
  522. /package/dist/{components-v3/tokens → tokens}/typography/fontFamily.js +0 -0
  523. /package/dist/{components-v3/tokens → tokens}/typography/fontSize.cjs +0 -0
  524. /package/dist/{components-v3/tokens → tokens}/typography/fontSize.d.cts +0 -0
  525. /package/dist/{components-v3/tokens → tokens}/typography/fontSize.d.ts +0 -0
  526. /package/dist/{components-v3/tokens → tokens}/typography/fontSize.js +0 -0
  527. /package/dist/{components-v3/tokens → tokens}/typography/fontWeight.cjs +0 -0
  528. /package/dist/{components-v3/tokens → tokens}/typography/fontWeight.d.cts +0 -0
  529. /package/dist/{components-v3/tokens → tokens}/typography/fontWeight.d.ts +0 -0
  530. /package/dist/{components-v3/tokens → tokens}/typography/fontWeight.js +0 -0
  531. /package/dist/{components-v3/tokens → tokens}/typography/letterSpacing.cjs +0 -0
  532. /package/dist/{components-v3/tokens → tokens}/typography/letterSpacing.d.cts +0 -0
  533. /package/dist/{components-v3/tokens → tokens}/typography/letterSpacing.d.ts +0 -0
  534. /package/dist/{components-v3/tokens → tokens}/typography/letterSpacing.js +0 -0
  535. /package/dist/{components-v3/tokens → tokens}/typography/lineHeight.cjs +0 -0
  536. /package/dist/{components-v3/tokens → tokens}/typography/lineHeight.d.cts +0 -0
  537. /package/dist/{components-v3/tokens → tokens}/typography/lineHeight.d.ts +0 -0
  538. /package/dist/{components-v3/tokens → tokens}/typography/lineHeight.js +0 -0
  539. /package/dist/{components-v3/tokens → tokens}/typography/typography.cjs +0 -0
  540. /package/dist/{components-v3/tokens → tokens}/typography/typography.d.cts +0 -0
  541. /package/dist/{components-v3/tokens → tokens}/typography/typography.d.ts +0 -0
  542. /package/dist/{components-v3/tokens → tokens}/typography/typography.js +0 -0
  543. /package/dist/{components-v3/tokens → tokens}/utils.cjs +0 -0
  544. /package/dist/{components-v3/tokens → tokens}/utils.js +0 -0
@@ -1,21 +1,25 @@
1
- import { useEffect, useRef, useState } from 'react';
1
+ import { useRef, useState } from 'react';
2
2
 
3
+ import { motion } from 'framer-motion';
3
4
  import { ColorNames } from '../../models/colorsConfig';
4
5
  import { Theme } from '../../../tokens/theme/theme';
5
6
 
6
- import { FloatingChatComponents } from './components';
7
+ import { FloatingChatComponents, ModalSheet } from './components';
7
8
  import { useScrollToBottom } from './hooks/useScrollToBottom';
9
+ import { useSnapSetup } from './hooks/useSnapSetup';
10
+ import { useChatSuggestions } from './hooks/useChatSuggestions';
8
11
  import { ChatHeader } from '../ChatHeader';
9
- import { ChatHeaderOptions, ChatHeaderVariant } from '../ChatHeader/types';
12
+ import { ChatHeaderOptions, ChatHeaderVariant, HandleState } from '../ChatHeader/types';
10
13
  import { WelcomeMessage } from '../WelcomeMessage/WelcomeMessage';
11
14
  import { SparkleIconColor } from '../WelcomeMessage/types/types';
12
- import { Stack } from '../Stack';
13
15
  import { ChatFooter } from '../ChatFooter';
14
16
  import { PromptCarousel, PromptCarouselRows } from '../PromptCarousel';
15
17
  import { PromptButtonVariant } from '../PromptButton';
16
18
 
17
19
  import { resolveTheme } from '../utils/resolveTheme';
18
20
  import { FloatingChatProps } from './types/types';
21
+ import { useFilteredChatMessages } from './hooks/useFilteredChatMessages';
22
+ import { Unit } from './hooks/useSnapCalculator';
19
23
 
20
24
  export const FloatingChat = ({
21
25
  id,
@@ -27,6 +31,7 @@ export const FloatingChat = ({
27
31
  floatingChatConfig,
28
32
  lookAndFeelConfig,
29
33
  isCXButtonSwitchEnabled,
34
+ isFloatingChatOpen,
30
35
  onClose,
31
36
  onToggleCXButton,
32
37
  }: FloatingChatProps) => {
@@ -41,7 +46,8 @@ export const FloatingChat = ({
41
46
  headerMode,
42
47
  welcomeMessageIconColor,
43
48
  showVerifiedBuyer,
44
- userQueryInputEnabled,
49
+ // Default this to true to avoid needing it in the default config
50
+ userQueryInputEnabled = true,
45
51
  showEnviveLogo,
46
52
  ignoreFirstModelResponse,
47
53
  neverShowSingleProductCards,
@@ -61,24 +67,17 @@ export const FloatingChat = ({
61
67
  onTypedMessageSubmitted,
62
68
  } = salesAgentData;
63
69
 
64
- const [answerSuggestions, setAnswerSuggestions] = useState<string[]>([]);
65
- const [generalSuggestions, setGeneralSuggestions] = useState<string[]>([]);
66
-
67
- const showAnswerSuggestions =
68
- answerSuggestions.length > 0 && !isPendingResponse && !isResponseStreaming;
69
-
70
- useEffect(() => {
71
- if (suggestions.length > 0) {
72
- setAnswerSuggestions(
73
- suggestions.filter(suggestion => suggestion.isAnswer).map(suggestion => suggestion.content),
74
- );
75
- setGeneralSuggestions(
76
- suggestions
77
- .filter(suggestion => !suggestion.isAnswer)
78
- .map(suggestion => suggestion.content),
79
- );
80
- }
81
- }, [suggestions]);
70
+ const {
71
+ answerSuggestions,
72
+ generalSuggestions,
73
+ showAnswerSuggestions,
74
+ setAnswerSuggestions,
75
+ setGeneralSuggestions,
76
+ } = useChatSuggestions({
77
+ suggestions,
78
+ isPendingResponse,
79
+ isResponseStreaming,
80
+ });
82
81
 
83
82
  const handleToggleCXButton = (item: ChatHeaderOptions) => {
84
83
  if (item === ChatHeaderOptions.LIVE_SUPPORT) {
@@ -99,6 +98,32 @@ export const FloatingChat = ({
99
98
  scrollThreshold: 30,
100
99
  });
101
100
 
101
+ const {
102
+ modalSheetControl,
103
+ maxSwipeableViewHeight,
104
+ isOpen,
105
+ isMobile,
106
+ snaps,
107
+ initialSnap,
108
+ shouldAutoExpand,
109
+ currentSnapPercentage,
110
+ handleSnapChange,
111
+ animationKey,
112
+ mobileHeaderHeight,
113
+ shouldShowHeader,
114
+ shouldShowScrolled,
115
+ isFullView,
116
+ isPartialView,
117
+ } = useSnapSetup({ isFloatingChatOpen });
118
+
119
+ const { filteredMessages, hasFilteredMessages, handlePreviousDiscussions } =
120
+ useFilteredChatMessages({
121
+ messages,
122
+ isMobile,
123
+ currentSnapPercentage,
124
+ modalSheetControl,
125
+ });
126
+
102
127
  const header = (
103
128
  <ChatHeader
104
129
  logoDark={chatHeaderLogoDarkSrc}
@@ -116,43 +141,76 @@ export const FloatingChat = ({
116
141
  />
117
142
  );
118
143
 
119
- const footer = (
120
- <Stack
121
- direction="column"
122
- gap={4}
144
+ const mobileHeader = (
145
+ <motion.div
146
+ style={{
147
+ maxHeight: mobileHeaderHeight,
148
+ overflow: 'hidden',
149
+ }}
123
150
  >
124
- <ChatFooter
151
+ <ChatHeader
152
+ logoDark={chatHeaderLogoDarkSrc}
153
+ logoLight={chatHeaderLogoLightSrc}
125
154
  theme={finalTheme}
126
- isScrolled={false}
127
- onChange={setQuery}
128
- onSubmit={() => {
129
- onTypedMessageSubmitted({ query });
130
- setAnswerSuggestions([]);
131
- setGeneralSuggestions([]);
132
- }}
133
- textFieldPlaceholderText={chatFooterTextFieldPlaceholderText}
134
- promptSuggestions={
135
- isPendingResponse || isResponseStreaming || generalSuggestions.length === 0
136
- ? ['Loading suggestions 1...', 'Loading suggestions 2...'] // This is strings will not be shown to the user
137
- : generalSuggestions
138
- }
139
- handleButtonClick={buttonText => {
140
- const suggestion = suggestions.find(s => s.content === buttonText && !s.isAnswer);
141
- if (suggestion) {
142
- onSuggestionClicked(suggestion);
143
- }
144
-
145
- setAnswerSuggestions([]);
146
- setGeneralSuggestions([]);
147
- }}
148
- disabled={isPendingResponse || isResponseStreaming}
149
- disabledInput={!userQueryInputEnabled}
150
- isLoadingPromptSuggestions={
151
- isPendingResponse || isResponseStreaming || generalSuggestions.length === 0
152
- }
153
- hideEnviveWatermark={!showEnviveLogo}
155
+ variant={headerMode as ChatHeaderVariant}
156
+ headerBgColor={headerBackgroundColor as ColorNames}
157
+ showLogo
158
+ showCXToggle={isCXButtonSwitchEnabled}
159
+ centralizeCXToggle
160
+ selectedOption={ChatHeaderOptions.ASSISTANT}
161
+ onToggle={handleToggleCXButton}
162
+ onClose={onClose}
154
163
  />
155
- </Stack>
164
+ </motion.div>
165
+ );
166
+
167
+ const handler = (
168
+ <ChatHeader
169
+ theme={finalTheme}
170
+ variant={headerMode as ChatHeaderVariant}
171
+ headerBgColor={headerBackgroundColor as ColorNames}
172
+ showHandle
173
+ handleState={isFullView ? HandleState.OPEN : HandleState.CLOSED}
174
+ handleAnimationKey={animationKey}
175
+ showMainContent={false}
176
+ selectedOption={ChatHeaderOptions.ASSISTANT}
177
+ onToggle={handleToggleCXButton}
178
+ onClose={onClose}
179
+ />
180
+ );
181
+
182
+ const footer = (
183
+ <ChatFooter
184
+ theme={finalTheme}
185
+ isScrolled={isMobile ? shouldShowScrolled : false}
186
+ onChange={setQuery}
187
+ onSubmit={() => {
188
+ onTypedMessageSubmitted({ query, userTyped: true });
189
+ setAnswerSuggestions([]);
190
+ setGeneralSuggestions([]);
191
+ }}
192
+ textFieldPlaceholderText={chatFooterTextFieldPlaceholderText}
193
+ promptSuggestions={
194
+ isPendingResponse || isResponseStreaming || generalSuggestions.length === 0
195
+ ? ['Loading suggestions 1...', 'Loading suggestions 2...'] // This is strings will not be shown to the user
196
+ : generalSuggestions
197
+ }
198
+ handleButtonClick={buttonText => {
199
+ const suggestion = suggestions.find(s => s.content === buttonText && !s.isAnswer);
200
+ if (suggestion) {
201
+ onSuggestionClicked(suggestion);
202
+ }
203
+
204
+ setAnswerSuggestions([]);
205
+ setGeneralSuggestions([]);
206
+ }}
207
+ disabled={isPendingResponse || isResponseStreaming}
208
+ disabledInput={!userQueryInputEnabled}
209
+ isLoadingPromptSuggestions={
210
+ isPendingResponse || isResponseStreaming || generalSuggestions.length === 0
211
+ }
212
+ hideEnviveWatermark={!showEnviveLogo}
213
+ />
156
214
  );
157
215
 
158
216
  const welcomeMessage = (
@@ -170,11 +228,14 @@ export const FloatingChat = ({
170
228
  ref={chatMessagesRef}
171
229
  isLoading={isPendingResponse && !isResponseStreaming}
172
230
  agentName={agentName}
173
- messages={messages}
231
+ messages={filteredMessages}
232
+ hasFilteredMessages={hasFilteredMessages}
233
+ handlePreviousDiscussions={handlePreviousDiscussions}
174
234
  isResponseStreaming={isResponseStreaming}
175
235
  ignoreFirstModelResponse={ignoreFirstModelResponse}
176
236
  neverShowSingleProductCards={neverShowSingleProductCards}
177
237
  showVerifiedBuyer={showVerifiedBuyer}
238
+ isPartialView={isPartialView}
178
239
  />
179
240
  );
180
241
 
@@ -196,7 +257,7 @@ export const FloatingChat = ({
196
257
  />
197
258
  );
198
259
 
199
- return (
260
+ const desktopLayout = (
200
261
  <FloatingChatComponents.Layout
201
262
  id={id}
202
263
  className={className}
@@ -215,4 +276,44 @@ export const FloatingChat = ({
215
276
  }
216
277
  />
217
278
  );
279
+
280
+ const mobileLayout = (
281
+ <FloatingChatComponents.Layout
282
+ id={id}
283
+ className={className}
284
+ style={style}
285
+ testId={testId}
286
+ theme={finalTheme}
287
+ header={shouldShowHeader ? mobileHeader : undefined}
288
+ footer={footer}
289
+ welcomeMessage={welcomeMessage}
290
+ chatMessages={chatMessages}
291
+ answerSuggestions={showAnswerSuggestions ? answerSuggestionsComponent : undefined}
292
+ scrollToBottomButton={
293
+ showScrollButton ? (
294
+ <FloatingChatComponents.ScrollToBottomButton onClick={scrollToBottom} />
295
+ ) : undefined
296
+ }
297
+ />
298
+ );
299
+
300
+ return isMobile ? (
301
+ <ModalSheet
302
+ animationKey={animationKey}
303
+ open={isOpen}
304
+ height={maxSwipeableViewHeight}
305
+ handler={handler}
306
+ unit={Unit.PERCENT}
307
+ snaps={snaps}
308
+ initSnap={initialSnap}
309
+ onSnap={handleSnapChange}
310
+ onClose={onClose}
311
+ controlRef={modalSheetControl}
312
+ disableDrag={shouldAutoExpand}
313
+ >
314
+ {mobileLayout}
315
+ </ModalSheet>
316
+ ) : (
317
+ desktopLayout
318
+ );
218
319
  };
@@ -23,6 +23,7 @@ export interface AgentMessageProps {
23
23
  isResponseStreaming?: boolean;
24
24
  neverShowSingleProductCards?: boolean;
25
25
  showVerifiedBuyer?: boolean;
26
+ isPartialView?: boolean;
26
27
  }
27
28
 
28
29
  export const AgentMessage = ({
@@ -34,6 +35,7 @@ export const AgentMessage = ({
34
35
  isResponseStreaming = false,
35
36
  neverShowSingleProductCards = false,
36
37
  showVerifiedBuyer = false,
38
+ isPartialView,
37
39
  }: AgentMessageProps) => {
38
40
  const finalTheme = resolveTheme(theme);
39
41
 
@@ -86,6 +88,7 @@ export const AgentMessage = ({
86
88
  products={products}
87
89
  numberOfProducts={products.length}
88
90
  theme={finalTheme}
91
+ isPartialView={isPartialView}
89
92
  />
90
93
  );
91
94
  }
@@ -9,17 +9,22 @@ import { Message as MessageComponent, MessageVariant } from '../../Message';
9
9
  import { MessageDivider } from './MessageDivider';
10
10
  import { Theme } from '../../../../tokens/theme/theme';
11
11
  import { resolveTheme } from '../../utils/resolveTheme';
12
+ import { Typography, TypographyVariant } from '../../Typography';
13
+ import { TypographyColor } from '../../Typography/types';
12
14
 
13
15
  export interface ChatMessagesProps {
14
16
  theme: Theme;
15
17
  className?: string;
16
18
  agentName: string;
17
19
  messages: Message[][];
20
+ hasFilteredMessages: boolean;
21
+ handlePreviousDiscussions: () => void;
18
22
  isLoading: boolean;
19
23
  isResponseStreaming: boolean;
20
24
  ignoreFirstModelResponse?: boolean;
21
25
  neverShowSingleProductCards?: boolean;
22
26
  showVerifiedBuyer?: boolean;
27
+ isPartialView?: boolean;
23
28
  }
24
29
 
25
30
  export const ChatMessages = forwardRef<HTMLDivElement, ChatMessagesProps>(
@@ -29,11 +34,14 @@ export const ChatMessages = forwardRef<HTMLDivElement, ChatMessagesProps>(
29
34
  className,
30
35
  agentName,
31
36
  messages,
37
+ hasFilteredMessages,
38
+ handlePreviousDiscussions,
32
39
  isLoading,
33
40
  isResponseStreaming,
34
41
  ignoreFirstModelResponse,
35
42
  neverShowSingleProductCards,
36
43
  showVerifiedBuyer,
44
+ isPartialView,
37
45
  },
38
46
  ref,
39
47
  ) => {
@@ -45,6 +53,22 @@ export const ChatMessages = forwardRef<HTMLDivElement, ChatMessagesProps>(
45
53
  className={classNames('envive-tw-px-4', className)}
46
54
  gap={4}
47
55
  >
56
+ {hasFilteredMessages && (
57
+ <button
58
+ type="button"
59
+ className="envive-tw-w-full envive-tw-cursor-pointer envive-tw-px-4 envive-tw-py-2 envive-tw-text-center"
60
+ onClick={handlePreviousDiscussions}
61
+ >
62
+ {/* TODO: Get hard copy */}
63
+ <Typography
64
+ color={TypographyColor.TEXT_PRIMARY}
65
+ variant={TypographyVariant.B3_RG}
66
+ className="hover:envive-tw-underline"
67
+ >
68
+ View Previous Messages
69
+ </Typography>
70
+ </button>
71
+ )}
48
72
  {messages.map((message: Message[], index: number) => {
49
73
  if (
50
74
  ignoreFirstModelResponse &&
@@ -108,6 +132,7 @@ export const ChatMessages = forwardRef<HTMLDivElement, ChatMessagesProps>(
108
132
  isResponseStreaming={isResponseStreaming && isLastMessageTurn}
109
133
  neverShowSingleProductCards={neverShowSingleProductCards}
110
134
  showVerifiedBuyer={showVerifiedBuyer}
135
+ isPartialView={isPartialView}
111
136
  />
112
137
  );
113
138
  }
@@ -42,7 +42,7 @@ export const Layout = ({
42
42
  testId={testId}
43
43
  style={style}
44
44
  className={classNames(
45
- 'envive-tw-flex envive-tw-h-full envive-tw-w-[512px] envive-tw-flex-col envive-tw-bg-[#FFFFFF]',
45
+ 'envive-tw-flex envive-tw-h-full envive-tw-w-full envive-tw-max-w-[512px] envive-tw-flex-col envive-tw-bg-[#FFFFFF]',
46
46
  className,
47
47
  )}
48
48
  >
@@ -50,7 +50,7 @@ export const Layout = ({
50
50
  direction="column"
51
51
  className="envive-tw-relative envive-tw-h-full envive-tw-overflow-hidden"
52
52
  >
53
- {header && <div className="envive-tw-flex-shrink-0">{header}</div>}
53
+ {header && <div className="envive-tw-flex-shrink-0 envive-tw-leading-[0]">{header}</div>}
54
54
 
55
55
  <div className="envive-tw-flex-1 envive-tw-overflow-y-auto envive-tw-overflow-x-hidden">
56
56
  <Stack
@@ -0,0 +1,288 @@
1
+ import {
2
+ AnimatePresence,
3
+ MotionValue,
4
+ ValueAnimationTransition,
5
+ motion,
6
+ useAnimate,
7
+ } from 'framer-motion';
8
+ import React, { FC, TouchEvent, useEffect, useImperativeHandle } from 'react';
9
+ import { Unit } from '../hooks/useSnapCalculator';
10
+ import { useSnapControl } from '../hooks/useSnapControl';
11
+ import { usePreventScroll } from '../hooks/usePreventScroll';
12
+
13
+ const BOTTOM_OFFSET = 100;
14
+
15
+ export interface ModalSheetControl {
16
+ jumpToSnap: (snapIndex: number) => void;
17
+ }
18
+
19
+ interface ModalSheetProps {
20
+ animationKey: MotionValue;
21
+ open: boolean;
22
+ height: number;
23
+ unit: Unit;
24
+ snaps?: number[];
25
+ initSnap?: number;
26
+ children?: React.ReactNode;
27
+ handler?: React.ReactNode;
28
+ animation?: ValueAnimationTransition;
29
+ onClose: () => void;
30
+ onSnap?: (snap: number) => void;
31
+ controlRef?: React.MutableRefObject<ModalSheetControl | undefined>;
32
+ disableDrag?: boolean;
33
+ }
34
+
35
+ export const ModalSheet: FC<ModalSheetProps> = ({
36
+ animationKey,
37
+ children,
38
+ open,
39
+ height,
40
+ unit,
41
+ snaps = [],
42
+ initSnap = 0,
43
+ handler,
44
+ animation = { type: 'spring', stiffness: 300, damping: 30 },
45
+ controlRef,
46
+ onClose,
47
+ onSnap,
48
+ disableDrag = false,
49
+ }) => {
50
+ const [layerRef] = useAnimate();
51
+ const [containerRef] = useAnimate();
52
+
53
+ const {
54
+ gestureRef,
55
+ isScrollableArea,
56
+ getScrollParent,
57
+ getGestureDirection,
58
+ getScrollDirections,
59
+ } = usePreventScroll();
60
+
61
+ const onSnapComplete = (currentSnap: number, nextSnap: number, collapsed: boolean) => {
62
+ if (collapsed) {
63
+ onClose?.();
64
+ return;
65
+ }
66
+
67
+ if (currentSnap !== nextSnap) {
68
+ onSnap?.(nextSnap);
69
+ }
70
+ };
71
+
72
+ const {
73
+ scope,
74
+ animatedY,
75
+ swipeviewHeightPx,
76
+ initSnapInPixels,
77
+ contentHeight,
78
+ currentSnap,
79
+ displayOverlay,
80
+ opacityOverlay,
81
+ jumpTo,
82
+ defineNextSnapByPosition,
83
+ resetControls,
84
+ getSnapToPixel,
85
+ } = useSnapControl({
86
+ animationKey,
87
+ animation,
88
+ height,
89
+ unit,
90
+ snaps,
91
+ initSnap,
92
+ overlayOpacity: 0.5,
93
+ onSnapComplete,
94
+ });
95
+
96
+ useImperativeHandle(controlRef, () => ({
97
+ jumpToSnap: (snapIndex: number) => {
98
+ const snapPx = getSnapToPixel(snaps[snapIndex]);
99
+ jumpTo(snapPx);
100
+ },
101
+ }));
102
+
103
+ const expandToFullView = () => {
104
+ const idx = snaps.indexOf(currentSnap);
105
+ if (idx === 1) {
106
+ jumpTo(getSnapToPixel(2));
107
+ }
108
+ };
109
+
110
+ const notifySnapChanges = (isModalOpen: boolean) => {
111
+ if (isModalOpen) {
112
+ onSnap?.(currentSnap);
113
+ return;
114
+ }
115
+
116
+ const snap = resetControls();
117
+ onSnap?.(snap);
118
+ };
119
+
120
+ useEffect(() => {
121
+ // Making iOS compatible
122
+ const preventDefault = (event: TouchEvent) => event.preventDefault();
123
+ layerRef?.current?.addEventListener('touchmove', preventDefault, { passive: false });
124
+
125
+ return () => {
126
+ layerRef?.current?.removeEventListener('touchmove', preventDefault);
127
+ };
128
+ }, [layerRef?.current]);
129
+
130
+ useEffect(() => {
131
+ const preventScroll = (event: TouchEvent) => {
132
+ const gestureDirection = getGestureDirection(
133
+ event.touches[0].clientX,
134
+ event.touches[0].clientY,
135
+ );
136
+ const isScrollable = isScrollableArea(gestureDirection);
137
+
138
+ if (!isScrollable) {
139
+ event.preventDefault();
140
+ event.stopPropagation();
141
+ }
142
+ };
143
+
144
+ containerRef?.current?.addEventListener('touchmove', preventScroll, { passive: false });
145
+ notifySnapChanges(open);
146
+
147
+ return () => {
148
+ containerRef?.current?.removeEventListener('touchmove', preventScroll);
149
+ };
150
+ }, [open]);
151
+
152
+ const handleDragEnd = () => {
153
+ const snap = defineNextSnapByPosition();
154
+ jumpTo(snap);
155
+ };
156
+
157
+ const handleTouchStart = (event: React.TouchEvent) => {
158
+ const scrollableElement = getScrollParent(event.target as HTMLElement);
159
+ const scrollableDirections = getScrollDirections(scrollableElement);
160
+ const parentScrollableElement = getScrollParent(scrollableElement, true);
161
+ const parentScrollableDirections = getScrollDirections(parentScrollableElement);
162
+ const grandparentScrollableElement = getScrollParent(parentScrollableElement, true);
163
+ const grandparentScrollableDirections = getScrollDirections(grandparentScrollableElement);
164
+ gestureRef.current = {
165
+ event: event.touches?.[0],
166
+ scrollableElements: [
167
+ {
168
+ element: scrollableElement,
169
+ scrollableDirections,
170
+ },
171
+ {
172
+ element: parentScrollableElement,
173
+ scrollableDirections: parentScrollableDirections,
174
+ },
175
+ {
176
+ element: grandparentScrollableElement,
177
+ scrollableDirections: grandparentScrollableDirections,
178
+ },
179
+ ],
180
+ };
181
+ };
182
+
183
+ const handleTouchEnd = () => {
184
+ handleDragEnd();
185
+ gestureRef.current = {
186
+ scrollableElements: [],
187
+ event: null,
188
+ };
189
+ };
190
+
191
+ const handleContentGesture = (fingerX: number, fingerY: number) => {
192
+ if (!gestureRef.current?.event) {
193
+ return;
194
+ }
195
+
196
+ const pointerDistance = (gestureRef.current?.event?.clientY || 0) - fingerY;
197
+ const snapPx = getSnapToPixel(currentSnap);
198
+ const distanceToTravel = snapPx - pointerDistance;
199
+ const gestureDirection = getGestureDirection(fingerX, fingerY);
200
+ const isScrollable = isScrollableArea(gestureDirection);
201
+ const animationBlocked = isScrollable || (gestureDirection !== 'down' && currentSnap === 100);
202
+
203
+ if (!animationBlocked) {
204
+ animatedY.set(distanceToTravel);
205
+ }
206
+ };
207
+
208
+ return (
209
+ <AnimatePresence>
210
+ {open && (
211
+ <>
212
+ <motion.div
213
+ ref={layerRef}
214
+ style={{
215
+ display: displayOverlay,
216
+ position: 'fixed',
217
+ top: 0,
218
+ left: 0,
219
+ right: 0,
220
+ bottom: 0,
221
+ opacity: opacityOverlay,
222
+ background: 'black',
223
+ }}
224
+ />
225
+ <motion.div
226
+ ref={scope}
227
+ drag="y"
228
+ dragConstraints={{ top: 0, bottom: swipeviewHeightPx }}
229
+ initial={{ y: swipeviewHeightPx }}
230
+ animate={{ y: initSnapInPixels }}
231
+ exit={{ y: swipeviewHeightPx + BOTTOM_OFFSET }}
232
+ transition={animation}
233
+ onDragEnd={handleDragEnd}
234
+ onClick={expandToFullView}
235
+ style={{
236
+ y: animatedY,
237
+ bottom: swipeviewHeightPx,
238
+ right: 0,
239
+ position: 'fixed',
240
+ width: '100%',
241
+ zIndex: 2147483647,
242
+ }}
243
+ >
244
+ {handler}
245
+ </motion.div>
246
+
247
+ <motion.div
248
+ ref={scope}
249
+ onTouchStart={handleTouchStart}
250
+ onTouchEnd={handleTouchEnd}
251
+ onTouchMove={event =>
252
+ handleContentGesture(event.touches[0].clientX, event.touches[0].clientY)
253
+ }
254
+ onPointerMove={
255
+ disableDrag ? undefined : event => handleContentGesture(event.clientX, event.clientY)
256
+ }
257
+ initial={{ y: swipeviewHeightPx + BOTTOM_OFFSET }}
258
+ animate={{ y: initSnapInPixels }}
259
+ exit={{ y: swipeviewHeightPx + BOTTOM_OFFSET }}
260
+ transition={animation}
261
+ style={{
262
+ y: animatedY,
263
+ width: '100%',
264
+ height: swipeviewHeightPx + BOTTOM_OFFSET,
265
+ position: 'fixed',
266
+ bottom: -BOTTOM_OFFSET + 1,
267
+ right: 0,
268
+ boxSizing: 'content-box',
269
+ zIndex: 2147483646,
270
+ }}
271
+ >
272
+ <motion.div
273
+ ref={containerRef}
274
+ initial={{ height: 0 }}
275
+ style={{
276
+ width: '100%',
277
+ height: contentHeight,
278
+ userSelect: 'none',
279
+ }}
280
+ >
281
+ {children}
282
+ </motion.div>
283
+ </motion.div>
284
+ </>
285
+ )}
286
+ </AnimatePresence>
287
+ );
288
+ };