@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
@@ -36,7 +36,7 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
36
36
  const { onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = usePromptCarouselAnalytics(WidgetInteractionComponent.FLOATING_CHAT, (text) => text);
37
37
  const [query, setQuery] = useState("");
38
38
  const chatMessagesRef = useRef(null);
39
- const { headerBackgroundColor, headerMode, welcomeMessageIconColor, showVerifiedBuyer, userQueryInputEnabled = true, showEnviveLogo, ignoreFirstModelResponse, neverShowSingleProductCards, partialViewConfig } = floatingChatConfig;
39
+ const { headerBackgroundColor, headerMode, welcomeMessageIconColor, showVerifiedBuyer, userQueryInputEnabled = true, showEnviveLogo, ignoreFirstModelResponse, neverShowSingleProductCards } = floatingChatConfig;
40
40
  const { welcomeMessageTitle, welcomeMessageText, chatFooterTextFieldPlaceholderText, disclaimerText, leftToggleLabel, rightToggleLabel } = hardcopyContent?.values ?? {};
41
41
  const { agentName, chatHeaderLogoDarkSrc, chatHeaderLogoLightSrc } = lookAndFeelConfig;
42
42
  const { messages, isResponseStreaming, isPendingResponse, suggestions, onSuggestionClicked, onTypedMessageSubmitted, onFormResponseSubmitted } = salesAgentData;
@@ -51,10 +51,7 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
51
51
  onClose();
52
52
  }
53
53
  };
54
- const { modalSheetControl, maxSwipeableViewHeight, isOpen, isMobile, snaps, initialSnap, shouldAutoExpand, currentSnapPercentage, handleSnapChange, animationKey, mobileHeaderHeight, shouldShowHeader, isFullView, isPartialView } = useSnapSetup({
55
- isFloatingChatOpen,
56
- partialViewDisabled: partialViewConfig?.disabled ?? false
57
- });
54
+ const { modalSheetControl, maxSwipeableViewHeight, isOpen, isMobile, snaps, initialSnap, shouldAutoExpand, currentSnapPercentage, handleSnapChange, animationKey, mobileHeaderHeight, isFullView } = useSnapSetup({ isFloatingChatOpen });
58
55
  const { showScrollButton, scrollToBottom, isFloatingLayout } = useScrollToBottom({
59
56
  messagesRef: chatMessagesRef,
60
57
  autoScrollDependencies: [
@@ -65,7 +62,7 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
65
62
  generalSuggestions
66
63
  ],
67
64
  scrollThreshold: 100,
68
- useFloatingLayout: isMobile && isPartialView,
65
+ useFloatingLayout: false,
69
66
  footerHeight: 160,
70
67
  isOpen: isFloatingChatOpen
71
68
  });
@@ -198,7 +195,6 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
198
195
  ignoreFirstModelResponse,
199
196
  neverShowSingleProductCards,
200
197
  showVerifiedBuyer,
201
- isPartialView,
202
198
  onFormResponseSubmitted,
203
199
  parentWidget: WidgetInteractionComponent.FLOATING_CHAT
204
200
  });
@@ -242,7 +238,7 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
242
238
  style,
243
239
  testId,
244
240
  theme: finalTheme,
245
- header: shouldShowHeader ? mobileHeader : void 0,
241
+ header: mobileHeader,
246
242
  footer,
247
243
  welcomeMessage,
248
244
  chatMessages,
@@ -20,7 +20,7 @@ let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks
20
20
  let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
21
21
 
22
22
  //#region src/components/FloatingChat/components/AgentMessage.tsx
23
- const AgentMessage = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, agentName, type, messages, hideAgentName = false, isResponseStreaming = false, isPendingResponse = false, neverShowSingleProductCards = false, showVerifiedBuyer = false, isPartialView, onFormResponseSubmitted, parentWidget }) => {
23
+ const AgentMessage = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, agentName, type, messages, hideAgentName = false, isResponseStreaming = false, isPendingResponse = false, neverShowSingleProductCards = false, showVerifiedBuyer = false, onFormResponseSubmitted, parentWidget }) => {
24
24
  const handleFormSubmittedAtomFallback = require_react.useSetAtom(__envive_ai_react_hooks_atoms_chat.handleFormSubmittedAtom);
25
25
  const finalTheme = require_resolveTheme.resolveTheme(theme);
26
26
  const { trackWidgetInteraction } = (0, __envive_ai_react_hooks_hooks_WidgetInteraction.useWidgetInteraction)();
@@ -97,7 +97,6 @@ const AgentMessage = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, agentName, ty
97
97
  products,
98
98
  numberOfProducts: products.length,
99
99
  theme: finalTheme,
100
- isPartialView,
101
100
  onProductCardClick: handleProductCardClick
102
101
  });
103
102
  }
@@ -19,7 +19,7 @@ import { MessageType } from "@envive-ai/react-hooks/application/models";
19
19
  import { handleFormSubmittedAtom } from "@envive-ai/react-hooks/atoms/chat";
20
20
 
21
21
  //#region src/components/FloatingChat/components/AgentMessage.tsx
22
- const AgentMessage = ({ theme = Theme.GLOBAL_CUSTOM, agentName, type, messages, hideAgentName = false, isResponseStreaming = false, isPendingResponse = false, neverShowSingleProductCards = false, showVerifiedBuyer = false, isPartialView, onFormResponseSubmitted, parentWidget }) => {
22
+ const AgentMessage = ({ theme = Theme.GLOBAL_CUSTOM, agentName, type, messages, hideAgentName = false, isResponseStreaming = false, isPendingResponse = false, neverShowSingleProductCards = false, showVerifiedBuyer = false, onFormResponseSubmitted, parentWidget }) => {
23
23
  const handleFormSubmittedAtomFallback = useSetAtom(handleFormSubmittedAtom);
24
24
  const finalTheme = resolveTheme(theme);
25
25
  const { trackWidgetInteraction } = useWidgetInteraction();
@@ -96,7 +96,6 @@ const AgentMessage = ({ theme = Theme.GLOBAL_CUSTOM, agentName, type, messages,
96
96
  products,
97
97
  numberOfProducts: products.length,
98
98
  theme: finalTheme,
99
- isPartialView,
100
99
  onProductCardClick: handleProductCardClick
101
100
  });
102
101
  }
@@ -1,11 +1,11 @@
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');
3
4
  const require_Stack = require('../../Stack/Stack.cjs');
4
5
  require('../../Stack/index.cjs');
5
6
  const require_index = require('../../Typography/types/index.cjs');
6
7
  const require_Typography = require('../../Typography/Typography.cjs');
7
8
  require('../../Typography/index.cjs');
8
- const require_resolveTheme = require('../../utils/resolveTheme.cjs');
9
9
  const require_index$1 = require('../../Message/types/index.cjs');
10
10
  const require_Message = require('../../Message/Message.cjs');
11
11
  require('../../Message/index.cjs');
@@ -20,7 +20,7 @@ classnames = require_rolldown_runtime.__toESM(classnames);
20
20
  let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
21
21
 
22
22
  //#region src/components/FloatingChat/components/ChatMessages.tsx
23
- const ChatMessages = (0, react.forwardRef)(({ theme = require_theme.Theme.GLOBAL_CUSTOM, className, agentName, messages, hasFilteredMessages, handlePreviousDiscussions, isLoading, isResponseStreaming, ignoreFirstModelResponse, neverShowSingleProductCards, showVerifiedBuyer, isPartialView, onFormResponseSubmitted, parentWidget }, ref) => {
23
+ const ChatMessages = (0, react.forwardRef)(({ theme = require_theme.Theme.GLOBAL_CUSTOM, className, agentName, messages, hasFilteredMessages, handlePreviousDiscussions, isLoading, isResponseStreaming, ignoreFirstModelResponse, neverShowSingleProductCards, showVerifiedBuyer, onFormResponseSubmitted, parentWidget }, ref) => {
24
24
  const finalTheme = require_resolveTheme.resolveTheme(theme);
25
25
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Stack.Stack, {
26
26
  ref,
@@ -69,7 +69,6 @@ const ChatMessages = (0, react.forwardRef)(({ theme = require_theme.Theme.GLOBAL
69
69
  isPendingResponse: isLoading && isLastMessageTurn,
70
70
  neverShowSingleProductCards,
71
71
  showVerifiedBuyer,
72
- isPartialView,
73
72
  onFormResponseSubmitted,
74
73
  parentWidget
75
74
  }, assistantMessageId);
@@ -1,10 +1,10 @@
1
1
  import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
2
+ import { resolveTheme } from "../../utils/resolveTheme.js";
2
3
  import { Stack } from "../../Stack/Stack.js";
3
4
  import "../../Stack/index.js";
4
5
  import { TypographyColor, TypographyVariant } from "../../Typography/types/index.js";
5
6
  import { Typography } from "../../Typography/Typography.js";
6
7
  import "../../Typography/index.js";
7
- import { resolveTheme } from "../../utils/resolveTheme.js";
8
8
  import { MessageVariant } from "../../Message/types/index.js";
9
9
  import { Message } from "../../Message/Message.js";
10
10
  import "../../Message/index.js";
@@ -18,7 +18,7 @@ import classNames from "classnames";
18
18
  import { MessageRole, MessageType } from "@envive-ai/react-hooks/application/models";
19
19
 
20
20
  //#region src/components/FloatingChat/components/ChatMessages.tsx
21
- const ChatMessages = forwardRef(({ theme = Theme.GLOBAL_CUSTOM, className, agentName, messages, hasFilteredMessages, handlePreviousDiscussions, isLoading, isResponseStreaming, ignoreFirstModelResponse, neverShowSingleProductCards, showVerifiedBuyer, isPartialView, onFormResponseSubmitted, parentWidget }, ref) => {
21
+ const ChatMessages = forwardRef(({ theme = Theme.GLOBAL_CUSTOM, className, agentName, messages, hasFilteredMessages, handlePreviousDiscussions, isLoading, isResponseStreaming, ignoreFirstModelResponse, neverShowSingleProductCards, showVerifiedBuyer, onFormResponseSubmitted, parentWidget }, ref) => {
22
22
  const finalTheme = resolveTheme(theme);
23
23
  return /* @__PURE__ */ jsxs(Stack, {
24
24
  ref,
@@ -67,7 +67,6 @@ const ChatMessages = forwardRef(({ theme = Theme.GLOBAL_CUSTOM, className, agent
67
67
  isPendingResponse: isLoading && isLastMessageTurn,
68
68
  neverShowSingleProductCards,
69
69
  showVerifiedBuyer,
70
- isPartialView,
71
70
  onFormResponseSubmitted,
72
71
  parentWidget
73
72
  }, assistantMessageId);
@@ -1,10 +1,10 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
2
  const require_theme = require('../../packages/components-v3/tokens/theme/theme.cjs');
3
- const require_Stack = require('../../Stack/Stack.cjs');
4
- require('../../Stack/index.cjs');
3
+ const require_resolveTheme = require('../../utils/resolveTheme.cjs');
5
4
  const require_Container = require('../../Container/Container.cjs');
6
5
  require('../../Container/index.cjs');
7
- const require_resolveTheme = require('../../utils/resolveTheme.cjs');
6
+ const require_Stack = require('../../Stack/Stack.cjs');
7
+ require('../../Stack/index.cjs');
8
8
  let react = require("react");
9
9
  let react_jsx_runtime = require("react/jsx-runtime");
10
10
  let classnames = require("classnames");
@@ -1,9 +1,9 @@
1
1
  import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
2
- import { Stack } from "../../Stack/Stack.js";
3
- import "../../Stack/index.js";
2
+ import { resolveTheme } from "../../utils/resolveTheme.js";
4
3
  import { Container } from "../../Container/Container.js";
5
4
  import "../../Container/index.js";
6
- import { resolveTheme } from "../../utils/resolveTheme.js";
5
+ import { Stack } from "../../Stack/Stack.js";
6
+ import "../../Stack/index.js";
7
7
  import { isValidElement } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import classNames from "classnames";
@@ -1,4 +1,5 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ const require_snapConstants = require('../snapConstants.cjs');
2
3
  const require_usePreventScroll = require('../hooks/usePreventScroll.cjs');
3
4
  const require_useSnapControl = require('../hooks/useSnapControl.cjs');
4
5
  let react = require("react");
@@ -14,6 +15,7 @@ const ModalSheet = ({ animationKey, children, open, height, unit, snaps = [], in
14
15
  }, controlRef, onClose, onSnap, disableDrag = false }) => {
15
16
  const [layerRef] = (0, framer_motion.useAnimate)();
16
17
  const [containerRef] = (0, framer_motion.useAnimate)();
18
+ const justDraggedRef = (0, react.useRef)(false);
17
19
  const { gestureRef, isScrollableArea, getScrollParent, getGestureDirection, getScrollDirections } = require_usePreventScroll.usePreventScroll();
18
20
  const onSnapComplete = (currentSnap$1, nextSnap, collapsed) => {
19
21
  if (collapsed) {
@@ -35,8 +37,12 @@ const ModalSheet = ({ animationKey, children, open, height, unit, snaps = [], in
35
37
  (0, react.useImperativeHandle)(controlRef, () => ({ jumpToSnap: (snapIndex) => {
36
38
  jumpTo(getSnapToPixel(snaps[snapIndex]));
37
39
  } }));
38
- const expandToFullView = () => {
39
- if (snaps.indexOf(currentSnap) === 1) jumpTo(getSnapToPixel(2));
40
+ const handleHandlerClick = () => {
41
+ if (justDraggedRef.current) {
42
+ justDraggedRef.current = false;
43
+ return;
44
+ }
45
+ if (snaps.length === 2) jumpTo(getSnapToPixel(currentSnap === 100 ? snaps[require_snapConstants.HIDDEN_SNAP_INDEX] : snaps[require_snapConstants.FULL_SNAP_INDEX]));
40
46
  };
41
47
  const notifySnapChanges = (isModalOpen) => {
42
48
  if (isModalOpen) {
@@ -67,6 +73,10 @@ const ModalSheet = ({ animationKey, children, open, height, unit, snaps = [], in
67
73
  };
68
74
  }, [open]);
69
75
  const handleDragEnd = () => {
76
+ justDraggedRef.current = true;
77
+ setTimeout(() => {
78
+ justDraggedRef.current = false;
79
+ }, 200);
70
80
  jumpTo(defineNextSnapByPosition());
71
81
  };
72
82
  const handleTouchStart = (event) => {
@@ -134,7 +144,7 @@ const ModalSheet = ({ animationKey, children, open, height, unit, snaps = [], in
134
144
  exit: { y: swipeviewHeightPx },
135
145
  transition: animation,
136
146
  onDragEnd: handleDragEnd,
137
- onClick: expandToFullView,
147
+ onClick: handleHandlerClick,
138
148
  style: {
139
149
  y: animatedY,
140
150
  bottom: swipeviewHeightPx,
@@ -1,6 +1,7 @@
1
+ import { FULL_SNAP_INDEX, HIDDEN_SNAP_INDEX } from "../snapConstants.js";
1
2
  import { usePreventScroll } from "../hooks/usePreventScroll.js";
2
3
  import { useSnapControl } from "../hooks/useSnapControl.js";
3
- import React, { useEffect, useImperativeHandle } from "react";
4
+ import React, { useEffect, useImperativeHandle, useRef } from "react";
4
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
6
  import { AnimatePresence, motion, useAnimate } from "framer-motion";
6
7
 
@@ -12,6 +13,7 @@ const ModalSheet = ({ animationKey, children, open, height, unit, snaps = [], in
12
13
  }, controlRef, onClose, onSnap, disableDrag = false }) => {
13
14
  const [layerRef] = useAnimate();
14
15
  const [containerRef] = useAnimate();
16
+ const justDraggedRef = useRef(false);
15
17
  const { gestureRef, isScrollableArea, getScrollParent, getGestureDirection, getScrollDirections } = usePreventScroll();
16
18
  const onSnapComplete = (currentSnap$1, nextSnap, collapsed) => {
17
19
  if (collapsed) {
@@ -33,8 +35,12 @@ const ModalSheet = ({ animationKey, children, open, height, unit, snaps = [], in
33
35
  useImperativeHandle(controlRef, () => ({ jumpToSnap: (snapIndex) => {
34
36
  jumpTo(getSnapToPixel(snaps[snapIndex]));
35
37
  } }));
36
- const expandToFullView = () => {
37
- if (snaps.indexOf(currentSnap) === 1) jumpTo(getSnapToPixel(2));
38
+ const handleHandlerClick = () => {
39
+ if (justDraggedRef.current) {
40
+ justDraggedRef.current = false;
41
+ return;
42
+ }
43
+ if (snaps.length === 2) jumpTo(getSnapToPixel(currentSnap === 100 ? snaps[HIDDEN_SNAP_INDEX] : snaps[FULL_SNAP_INDEX]));
38
44
  };
39
45
  const notifySnapChanges = (isModalOpen) => {
40
46
  if (isModalOpen) {
@@ -65,6 +71,10 @@ const ModalSheet = ({ animationKey, children, open, height, unit, snaps = [], in
65
71
  };
66
72
  }, [open]);
67
73
  const handleDragEnd = () => {
74
+ justDraggedRef.current = true;
75
+ setTimeout(() => {
76
+ justDraggedRef.current = false;
77
+ }, 200);
68
78
  jumpTo(defineNextSnapByPosition());
69
79
  };
70
80
  const handleTouchStart = (event) => {
@@ -132,7 +142,7 @@ const ModalSheet = ({ animationKey, children, open, height, unit, snaps = [], in
132
142
  exit: { y: swipeviewHeightPx },
133
143
  transition: animation,
134
144
  onDragEnd: handleDragEnd,
135
- onClick: expandToFullView,
145
+ onClick: handleHandlerClick,
136
146
  style: {
137
147
  y: animatedY,
138
148
  bottom: swipeviewHeightPx,
@@ -6,15 +6,14 @@ const require_SalesAgentProductCard = require('../../SalesAgentProductCard/Sales
6
6
  let react_jsx_runtime = require("react/jsx-runtime");
7
7
 
8
8
  //#region src/components/FloatingChat/components/SalesAgentProductCardsCarousel.tsx
9
- const SalesAgentProductCardsCarousel = ({ products, theme, hideNavigation = false, numberOfProducts, variant = require_types.SalesAgentProductCardVariant.LARGE, isPartialView = false, onProductCardClick }) => {
9
+ const SalesAgentProductCardsCarousel = ({ products, theme, hideNavigation = false, numberOfProducts, variant = require_types.SalesAgentProductCardVariant.LARGE, onProductCardClick }) => {
10
10
  const finalTheme = require_resolveTheme.resolveTheme(theme);
11
- const finalVariant = isPartialView ? require_types.SalesAgentProductCardVariant.SMALL : variant;
12
11
  const forceShowCurrentPriceSpace = products.some((product) => product.currentPrice && product.previousPrice !== product.currentPrice);
13
12
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Carousel.Carousel, {
14
13
  hideNavigation,
15
14
  badgeLabel: numberOfProducts && numberOfProducts > 1 ? `${numberOfProducts} Products` : void 0,
16
15
  elements: products.map((product) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SalesAgentProductCard.SalesAgentProductCard, {
17
- variant: finalVariant,
16
+ variant,
18
17
  productName: product.productName,
19
18
  currentPrice: product.currentPrice,
20
19
  previousPrice: product.previousPrice,
@@ -5,15 +5,14 @@ import { SalesAgentProductCard } from "../../SalesAgentProductCard/SalesAgentPro
5
5
  import { jsx } from "react/jsx-runtime";
6
6
 
7
7
  //#region src/components/FloatingChat/components/SalesAgentProductCardsCarousel.tsx
8
- const SalesAgentProductCardsCarousel = ({ products, theme, hideNavigation = false, numberOfProducts, variant = SalesAgentProductCardVariant.LARGE, isPartialView = false, onProductCardClick }) => {
8
+ const SalesAgentProductCardsCarousel = ({ products, theme, hideNavigation = false, numberOfProducts, variant = SalesAgentProductCardVariant.LARGE, onProductCardClick }) => {
9
9
  const finalTheme = resolveTheme(theme);
10
- const finalVariant = isPartialView ? SalesAgentProductCardVariant.SMALL : variant;
11
10
  const forceShowCurrentPriceSpace = products.some((product) => product.currentPrice && product.previousPrice !== product.currentPrice);
12
11
  return /* @__PURE__ */ jsx(Carousel, {
13
12
  hideNavigation,
14
13
  badgeLabel: numberOfProducts && numberOfProducts > 1 ? `${numberOfProducts} Products` : void 0,
15
14
  elements: products.map((product) => /* @__PURE__ */ jsx(SalesAgentProductCard, {
16
- variant: finalVariant,
15
+ variant,
17
16
  productName: product.productName,
18
17
  currentPrice: product.currentPrice,
19
18
  previousPrice: product.previousPrice,
@@ -12,7 +12,7 @@ const useFilteredChatMessages = ({ messages, isMobile, currentSnapPercentage, mo
12
12
  keepMessagesExpanded
13
13
  ]);
14
14
  const hasFilteredMessages = filteredMessages.length !== messages.length && isMobile;
15
- const handlePreviousDiscussions = () => modalSheetControl.current?.jumpToSnap(2);
15
+ const handlePreviousDiscussions = () => modalSheetControl.current?.jumpToSnap(1);
16
16
  return {
17
17
  filteredMessages,
18
18
  hasFilteredMessages,
@@ -11,7 +11,7 @@ const useFilteredChatMessages = ({ messages, isMobile, currentSnapPercentage, mo
11
11
  keepMessagesExpanded
12
12
  ]);
13
13
  const hasFilteredMessages = filteredMessages.length !== messages.length && isMobile;
14
- const handlePreviousDiscussions = () => modalSheetControl.current?.jumpToSnap(2);
14
+ const handlePreviousDiscussions = () => modalSheetControl.current?.jumpToSnap(1);
15
15
  return {
16
16
  filteredMessages,
17
17
  hasFilteredMessages,
@@ -1,31 +1,32 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ const require_snapConstants = require('../snapConstants.cjs');
2
3
  const require_useSnapCalculator = require('./useSnapCalculator.cjs');
3
4
  let react = require("react");
4
5
  let framer_motion = require("framer-motion");
5
6
 
6
7
  //#region src/components/FloatingChat/hooks/useSnapControl.ts
7
- const MIDDLE_SNAP_OFFSET = 5;
8
8
  const useSnapControl = ({ animationKey, animation, height, unit, snaps, initSnap, onSnapComplete, overlayOpacity }) => {
9
9
  const [scope, animate] = (0, framer_motion.useAnimate)();
10
10
  const defaultAnimationKey = (0, framer_motion.useMotionValue)(-1);
11
11
  const animatedY = animationKey || defaultAnimationKey;
12
12
  const { swipeviewHeightPx, snapsToPixels, getPixelToSnap, getSnapToPixel } = require_useSnapCalculator.useSnapCalculator(snaps, height, unit);
13
13
  const contentHeight = (0, framer_motion.useTransform)(animatedY, [0, swipeviewHeightPx], [swipeviewHeightPx, 0]);
14
- const snapOverlayReference = (0, react.useMemo)(() => [
15
- getSnapToPixel(snaps[0]),
16
- getSnapToPixel(snaps[1]) - MIDDLE_SNAP_OFFSET,
17
- getSnapToPixel(snaps[2])
18
- ], [getSnapToPixel, snaps]);
19
- const displayOverlay = (0, framer_motion.useTransform)(() => animatedY.get() === -1 ? "none" : (0, framer_motion.transform)(animatedY.get(), snapOverlayReference, [
20
- "none",
21
- "none",
22
- "block"
23
- ]));
24
- const opacityOverlay = (0, framer_motion.useTransform)(() => animatedY.get() === -1 ? 0 : (0, framer_motion.transform)(animatedY.get(), snapOverlayReference, [
25
- 0,
26
- 0,
27
- overlayOpacity
28
- ]));
14
+ const snapOverlayReference = (0, react.useMemo)(() => {
15
+ if (snaps.length === 1) return [0, swipeviewHeightPx];
16
+ return [getSnapToPixel(snaps[require_snapConstants.HIDDEN_SNAP_INDEX]), getSnapToPixel(snaps[require_snapConstants.FULL_SNAP_INDEX])];
17
+ }, [
18
+ getSnapToPixel,
19
+ snaps,
20
+ swipeviewHeightPx
21
+ ]);
22
+ const displayOverlay = (0, framer_motion.useTransform)(() => {
23
+ if (animatedY.get() === -1) return "none";
24
+ return (0, framer_motion.transform)(animatedY.get(), snapOverlayReference, ["none", "block"]);
25
+ });
26
+ const opacityOverlay = (0, framer_motion.useTransform)(() => {
27
+ if (animatedY.get() === -1) return 0;
28
+ return (0, framer_motion.transform)(animatedY.get(), snapOverlayReference, [0, overlayOpacity]);
29
+ });
29
30
  const initSnapInPixels = snapsToPixels?.[initSnap];
30
31
  const getInitSnap = () => snaps?.[initSnap];
31
32
  const [currentSnap, setCurrentSnap] = (0, react.useState)(getInitSnap());
@@ -1,30 +1,31 @@
1
+ import { FULL_SNAP_INDEX, HIDDEN_SNAP_INDEX } from "../snapConstants.js";
1
2
  import { useSnapCalculator } from "./useSnapCalculator.js";
2
3
  import { useMemo, useState } from "react";
3
4
  import { transform, useAnimate, useMotionValue, useTransform } from "framer-motion";
4
5
 
5
6
  //#region src/components/FloatingChat/hooks/useSnapControl.ts
6
- const MIDDLE_SNAP_OFFSET = 5;
7
7
  const useSnapControl = ({ animationKey, animation, height, unit, snaps, initSnap, onSnapComplete, overlayOpacity }) => {
8
8
  const [scope, animate] = useAnimate();
9
9
  const defaultAnimationKey = useMotionValue(-1);
10
10
  const animatedY = animationKey || defaultAnimationKey;
11
11
  const { swipeviewHeightPx, snapsToPixels, getPixelToSnap, getSnapToPixel } = useSnapCalculator(snaps, height, unit);
12
12
  const contentHeight = useTransform(animatedY, [0, swipeviewHeightPx], [swipeviewHeightPx, 0]);
13
- const snapOverlayReference = useMemo(() => [
14
- getSnapToPixel(snaps[0]),
15
- getSnapToPixel(snaps[1]) - MIDDLE_SNAP_OFFSET,
16
- getSnapToPixel(snaps[2])
17
- ], [getSnapToPixel, snaps]);
18
- const displayOverlay = useTransform(() => animatedY.get() === -1 ? "none" : transform(animatedY.get(), snapOverlayReference, [
19
- "none",
20
- "none",
21
- "block"
22
- ]));
23
- const opacityOverlay = useTransform(() => animatedY.get() === -1 ? 0 : transform(animatedY.get(), snapOverlayReference, [
24
- 0,
25
- 0,
26
- overlayOpacity
27
- ]));
13
+ const snapOverlayReference = useMemo(() => {
14
+ if (snaps.length === 1) return [0, swipeviewHeightPx];
15
+ return [getSnapToPixel(snaps[HIDDEN_SNAP_INDEX]), getSnapToPixel(snaps[FULL_SNAP_INDEX])];
16
+ }, [
17
+ getSnapToPixel,
18
+ snaps,
19
+ swipeviewHeightPx
20
+ ]);
21
+ const displayOverlay = useTransform(() => {
22
+ if (animatedY.get() === -1) return "none";
23
+ return transform(animatedY.get(), snapOverlayReference, ["none", "block"]);
24
+ });
25
+ const opacityOverlay = useTransform(() => {
26
+ if (animatedY.get() === -1) return 0;
27
+ return transform(animatedY.get(), snapOverlayReference, [0, overlayOpacity]);
28
+ });
28
29
  const initSnapInPixels = snapsToPixels?.[initSnap];
29
30
  const getInitSnap = () => snaps?.[initSnap];
30
31
  const [currentSnap, setCurrentSnap] = useState(getInitSnap());
@@ -1,37 +1,23 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
2
  const require_useCheckIsMobile = require('../../utils/useCheckIsMobile.cjs');
3
+ const require_snapConstants = require('../snapConstants.cjs');
3
4
  let react = require("react");
4
5
  let framer_motion = require("framer-motion");
5
6
 
6
7
  //#region src/components/FloatingChat/hooks/useSnapSetup.ts
7
- const useSnapSetup = ({ isFloatingChatOpen, partialViewDisabled }) => {
8
- const maxSwipeableViewHeight = 89;
8
+ const SNAPS_NO_AUTO_EXPAND = [0, 100];
9
+ const useSnapSetup = ({ isFloatingChatOpen }) => {
10
+ const maxSwipeableViewHeight = require_snapConstants.MAX_SWIPEABLE_VIEW_HEIGHT;
9
11
  const modalSheetControl = (0, react.useRef)(null);
10
12
  const { viewportWidth } = require_useCheckIsMobile.useCheckIsMobile();
11
13
  const isMobile = viewportWidth !== void 0 && viewportWidth < 512;
12
14
  const shouldAutoExpand = Boolean(isMobile && window?._spiffy?.selectedCustomizeOption);
13
- const snaps = (() => {
14
- if (partialViewDisabled) return shouldAutoExpand ? [100] : [0, 100];
15
- return shouldAutoExpand ? [43, 100] : [
16
- 0,
17
- 43,
18
- 100
19
- ];
20
- })();
21
- const initialSnap = partialViewDisabled ? shouldAutoExpand ? 0 : 1 : 1;
22
- const [currentSnapPercentage, setCurrentSnapPercentage] = (0, react.useState)(snaps[initialSnap] || 43);
15
+ const snaps = shouldAutoExpand ? [100] : SNAPS_NO_AUTO_EXPAND;
16
+ const initialSnap = shouldAutoExpand ? 0 : 1;
17
+ const [currentSnapPercentage, setCurrentSnapPercentage] = (0, react.useState)(snaps[initialSnap] ?? 100);
23
18
  const animationKey = (0, framer_motion.useMotionValue)(0);
24
- const snap43Percent = 57 / 100 * window.innerHeight;
25
- const snap100Percent = 0;
26
- const mobileHeaderHeight = (0, framer_motion.useTransform)(animationKey, [snap100Percent, snap43Percent], [56, 0]);
27
- const [shouldShowHeader, setShouldShowHeader] = (0, react.useState)(false);
28
- (0, react.useEffect)(() => {
29
- return animationKey.on("change", (value) => {
30
- setShouldShowHeader(value < snap43Percent - 10);
31
- });
32
- }, [animationKey, snap43Percent]);
19
+ const mobileHeaderHeight = (0, framer_motion.useTransform)(animationKey, [0, Math.floor((typeof window !== "undefined" ? window.innerHeight : 0) * (maxSwipeableViewHeight / 100))], [56, 0]);
33
20
  const isFullView = isMobile && currentSnapPercentage === 100;
34
- const isPartialView = isMobile && currentSnapPercentage >= 0 && currentSnapPercentage <= 43;
35
21
  const handleSnapChange = (snapPercentage) => {
36
22
  setCurrentSnapPercentage(snapPercentage);
37
23
  };
@@ -47,11 +33,7 @@ const useSnapSetup = ({ isFloatingChatOpen, partialViewDisabled }) => {
47
33
  handleSnapChange,
48
34
  animationKey,
49
35
  mobileHeaderHeight,
50
- snap43Percent,
51
- snap100Percent,
52
- shouldShowHeader,
53
- isFullView,
54
- isPartialView
36
+ isFullView
55
37
  };
56
38
  };
57
39
 
@@ -1,36 +1,22 @@
1
1
  import { useCheckIsMobile } from "../../utils/useCheckIsMobile.js";
2
- import { useEffect, useRef, useState } from "react";
2
+ import { FULL_SNAP_INDEX, HIDDEN_SNAP_INDEX, MAX_SWIPEABLE_VIEW_HEIGHT } from "../snapConstants.js";
3
+ import { useRef, useState } from "react";
3
4
  import { useMotionValue, useTransform } from "framer-motion";
4
5
 
5
6
  //#region src/components/FloatingChat/hooks/useSnapSetup.ts
6
- const useSnapSetup = ({ isFloatingChatOpen, partialViewDisabled }) => {
7
- const maxSwipeableViewHeight = 89;
7
+ const SNAPS_NO_AUTO_EXPAND = [0, 100];
8
+ const useSnapSetup = ({ isFloatingChatOpen }) => {
9
+ const maxSwipeableViewHeight = MAX_SWIPEABLE_VIEW_HEIGHT;
8
10
  const modalSheetControl = useRef(null);
9
11
  const { viewportWidth } = useCheckIsMobile();
10
12
  const isMobile = viewportWidth !== void 0 && viewportWidth < 512;
11
13
  const shouldAutoExpand = Boolean(isMobile && window?._spiffy?.selectedCustomizeOption);
12
- const snaps = (() => {
13
- if (partialViewDisabled) return shouldAutoExpand ? [100] : [0, 100];
14
- return shouldAutoExpand ? [43, 100] : [
15
- 0,
16
- 43,
17
- 100
18
- ];
19
- })();
20
- const initialSnap = partialViewDisabled ? shouldAutoExpand ? 0 : 1 : 1;
21
- const [currentSnapPercentage, setCurrentSnapPercentage] = useState(snaps[initialSnap] || 43);
14
+ const snaps = shouldAutoExpand ? [100] : SNAPS_NO_AUTO_EXPAND;
15
+ const initialSnap = shouldAutoExpand ? 0 : 1;
16
+ const [currentSnapPercentage, setCurrentSnapPercentage] = useState(snaps[initialSnap] ?? 100);
22
17
  const animationKey = useMotionValue(0);
23
- const snap43Percent = 57 / 100 * window.innerHeight;
24
- const snap100Percent = 0;
25
- const mobileHeaderHeight = useTransform(animationKey, [snap100Percent, snap43Percent], [56, 0]);
26
- const [shouldShowHeader, setShouldShowHeader] = useState(false);
27
- useEffect(() => {
28
- return animationKey.on("change", (value) => {
29
- setShouldShowHeader(value < snap43Percent - 10);
30
- });
31
- }, [animationKey, snap43Percent]);
18
+ const mobileHeaderHeight = useTransform(animationKey, [0, Math.floor((typeof window !== "undefined" ? window.innerHeight : 0) * (maxSwipeableViewHeight / 100))], [56, 0]);
32
19
  const isFullView = isMobile && currentSnapPercentage === 100;
33
- const isPartialView = isMobile && currentSnapPercentage >= 0 && currentSnapPercentage <= 43;
34
20
  const handleSnapChange = (snapPercentage) => {
35
21
  setCurrentSnapPercentage(snapPercentage);
36
22
  };
@@ -46,11 +32,7 @@ const useSnapSetup = ({ isFloatingChatOpen, partialViewDisabled }) => {
46
32
  handleSnapChange,
47
33
  animationKey,
48
34
  mobileHeaderHeight,
49
- snap43Percent,
50
- snap100Percent,
51
- shouldShowHeader,
52
- isFullView,
53
- isPartialView
35
+ isFullView
54
36
  };
55
37
  };
56
38
 
@@ -0,0 +1,10 @@
1
+
2
+ //#region src/components/FloatingChat/snapConstants.ts
3
+ const MAX_SWIPEABLE_VIEW_HEIGHT = 89;
4
+ const HIDDEN_SNAP_INDEX = 0;
5
+ const FULL_SNAP_INDEX = 1;
6
+
7
+ //#endregion
8
+ exports.FULL_SNAP_INDEX = FULL_SNAP_INDEX;
9
+ exports.HIDDEN_SNAP_INDEX = HIDDEN_SNAP_INDEX;
10
+ exports.MAX_SWIPEABLE_VIEW_HEIGHT = MAX_SWIPEABLE_VIEW_HEIGHT;
@@ -0,0 +1,7 @@
1
+ //#region src/components/FloatingChat/snapConstants.ts
2
+ const MAX_SWIPEABLE_VIEW_HEIGHT = 89;
3
+ const HIDDEN_SNAP_INDEX = 0;
4
+ const FULL_SNAP_INDEX = 1;
5
+
6
+ //#endregion
7
+ export { FULL_SNAP_INDEX, HIDDEN_SNAP_INDEX, MAX_SWIPEABLE_VIEW_HEIGHT };
@@ -1,7 +1,7 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_theme = require('../packages/components-v3/tokens/theme/theme.cjs');
3
- const require_resolveTheme = require('../utils/resolveTheme.cjs');
4
3
  require('../Tokens/index.cjs');
4
+ const require_resolveTheme = require('../utils/resolveTheme.cjs');
5
5
  const require_usePromptCarouselAnalytics = require('../PromptCarousel/hooks/usePromptCarouselAnalytics.cjs');
6
6
  const require_PromptButton_types_index = require('../PromptButton/types/index.cjs');
7
7
  require('../PromptButton/index.cjs');
@@ -20,6 +20,7 @@ require('../WelcomeMessage/index.cjs');
20
20
  const require_useIsMobile = require('./hooks/useIsMobile.cjs');
21
21
  const require_useGetFooterStyles = require('./hooks/useGetFooterStyles.cjs');
22
22
  const require_index$1 = require('./components/index.cjs');
23
+ const require_useGetMessagesStyles = require('./hooks/useGetMessagesStyles.cjs');
23
24
  let react = require("react");
24
25
  let react_jsx_runtime = require("react/jsx-runtime");
25
26
  let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
@@ -34,7 +35,8 @@ const FullPageSalesAgent = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, floatin
34
35
  const salesAgentData = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)(__envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.FULL_PAGE_SALES_AGENT);
35
36
  const [query, setQuery] = (0, react.useState)("");
36
37
  const chatMessagesRef = (0, react.useRef)(null);
37
- const { footerStyles } = require_useGetFooterStyles.useGetFooterStyles();
38
+ const { footerStyles, footerClasses } = require_useGetFooterStyles.useGetFooterStyles();
39
+ const { messageClasses } = require_useGetMessagesStyles.useGetMessagesStyles();
38
40
  const { isMobile } = require_useIsMobile.useIsMobile();
39
41
  const { trackWidgetInteraction } = (0, __envive_ai_react_hooks_hooks_WidgetInteraction.useWidgetInteraction)();
40
42
  const { onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = require_usePromptCarouselAnalytics.usePromptCarouselAnalytics(__envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.FULL_PAGE_SALES_AGENT, (text) => text);
@@ -85,7 +87,7 @@ const FullPageSalesAgent = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, floatin
85
87
  theme: resolvedTheme
86
88
  });
87
89
  const footer = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatFooter.ChatFooter, {
88
- className: "envive-tw-bg-background-light",
90
+ className: footerClasses,
89
91
  style: footerStyles,
90
92
  theme: resolvedTheme,
91
93
  isScrolled: isMobile ? isFloatingLayout : false,
@@ -115,6 +117,7 @@ const FullPageSalesAgent = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, floatin
115
117
  parentWidget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.FULL_PAGE_SALES_AGENT
116
118
  });
117
119
  const chatMessages = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.FloatingChatComponents.ChatMessages, {
120
+ className: messageClasses,
118
121
  theme: resolvedTheme,
119
122
  ref: chatMessagesRef,
120
123
  isLoading: isPendingResponse && !isResponseStreaming,
@@ -1,5 +1,5 @@
1
1
  import { Theme } from "../packages/components-v3/tokens/theme/theme.js";
2
- import * as react_jsx_runtime23 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime31 from "react/jsx-runtime";
3
3
  import { FloatingChatConfig, LookAndFeelConfig } from "@envive-ai/react-hooks/contexts/typesV3";
4
4
  import { HardcopyResponse } from "@envive-ai/react-hooks/contexts/hardcopyContext";
5
5
 
@@ -19,6 +19,6 @@ declare const FullPageSalesAgent: ({
19
19
  hardcopyContent,
20
20
  headerContainer,
21
21
  autoHeight
22
- }: FullPageSalesAgentProps) => react_jsx_runtime23.JSX.Element;
22
+ }: FullPageSalesAgentProps) => react_jsx_runtime31.JSX.Element;
23
23
  //#endregion
24
24
  export { FullPageSalesAgent };