@envive-ai/react-widgets-v3 0.3.15-alpha.1 → 0.3.15-alpha.2

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 (246) hide show
  1. package/dist/hocs/withBaseWidget/types.d.cts +5 -6
  2. package/dist/hocs/withBaseWidget/types.d.ts +5 -7
  3. package/dist/hocs/withBaseWidget/withBaseWidget.cjs +37 -43
  4. package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +2 -2
  5. package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
  6. package/dist/hocs/withBaseWidget/withBaseWidget.js +39 -45
  7. package/dist/packages/hooks/dist/application/models/api/orgConfigResults.d.ts +2 -1
  8. package/dist/packages/hooks/dist/application/models/api/userEvent.d.ts +1 -0
  9. package/dist/packages/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.ts +1 -0
  10. package/dist/packages/hooks/dist/contexts/types.d.ts +3 -1
  11. package/dist/packages/hooks/dist/contexts/typesV3.d.ts +1 -1
  12. package/dist/packages/hooks/dist/types/custservice-types.d.ts +1 -0
  13. package/dist/packages/widgets/dist/packages/hooks/dist/application/models/variantInfo/pageVisitInfo.d.ts +1 -0
  14. package/dist/packages/widgets/dist/packages/hooks/dist/application/models/variantInfo/variantInfo.d.ts +2 -1
  15. package/dist/packages/widgets/dist/packages/hooks/dist/contexts/types.d.ts +1 -0
  16. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +3 -3
  17. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
  18. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +3 -3
  19. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +3 -3
  20. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
  21. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
  22. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +2 -11
  23. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
  24. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
  25. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +4 -13
  26. package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.cjs +44 -21
  27. package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.js +44 -21
  28. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +34 -34
  29. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +3 -1
  30. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +5 -3
  31. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +35 -35
  32. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +2 -2
  33. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
  34. package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +1 -11
  35. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
  36. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
  37. package/dist/widgets/ProductCardWidget/ProductCardWidget.js +3 -13
  38. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +2 -11
  39. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
  40. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
  41. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +4 -13
  42. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +1 -10
  43. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
  44. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
  45. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +3 -12
  46. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.cjs +1 -1
  47. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
  48. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
  49. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +1 -1
  50. package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +2 -11
  51. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
  52. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
  53. package/dist/widgets/SocialProofWidget/SocialProofWidget.js +4 -13
  54. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +0 -9
  55. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
  56. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
  57. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +2 -11
  58. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.cjs +1 -1
  59. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
  60. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
  61. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +1 -1
  62. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +1 -10
  63. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
  64. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
  65. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +3 -12
  66. package/package.json +1 -1
  67. package/dist/hooks/dist/services/amplitudeService/eventNames.d.cts +0 -43
  68. package/dist/packages/hooks/dist/contexts/amplitudeContext/amplitudeContext.d.ts +0 -2
  69. package/dist/packages/hooks/dist/contexts/amplitudeContext/index.d.ts +0 -2
  70. package/dist/packages/hooks/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.d.ts +0 -2
  71. package/dist/packages/hooks/dist/services/amplitudeService/amplitudeService.d.ts +0 -1
  72. package/dist/packages/hooks/dist/services/amplitudeService/eventNames.d.ts +0 -43
  73. package/dist/src/CXIntegration/hooks/useUnifiedCXButton.d.ts +0 -10
  74. package/dist/src/CXIntegration/hooks/useUnifiedCXButton.js +0 -29
  75. package/dist/src/CXIntegration/implementations/useDefaultUnifiedCXButton.d.ts +0 -2
  76. package/dist/src/CXIntegration/implementations/useDefaultUnifiedCXButton.js +0 -6
  77. package/dist/src/CXIntegration/implementations/useEightByEightUnifiedCXButton.d.ts +0 -5
  78. package/dist/src/CXIntegration/implementations/useEightByEightUnifiedCXButton.js +0 -63
  79. package/dist/src/CXIntegration/implementations/useGladlyUnifiedCXButton.d.ts +0 -5
  80. package/dist/src/CXIntegration/implementations/useGladlyUnifiedCXButton.js +0 -23
  81. package/dist/src/CXIntegration/implementations/useGorgiasUnifiedCXButton.d.ts +0 -5
  82. package/dist/src/CXIntegration/implementations/useGorgiasUnifiedCXButton.js +0 -54
  83. package/dist/src/CXIntegration/implementations/useGrooveUnifiedCXButton.d.ts +0 -18
  84. package/dist/src/CXIntegration/implementations/useGrooveUnifiedCXButton.js +0 -48
  85. package/dist/src/CXIntegration/implementations/useHelpScoutUnifiedCXButton.d.ts +0 -5
  86. package/dist/src/CXIntegration/implementations/useHelpScoutUnifiedCXButton.js +0 -84
  87. package/dist/src/CXIntegration/implementations/useKustomerUnifiedCXButton.d.ts +0 -5
  88. package/dist/src/CXIntegration/implementations/useKustomerUnifiedCXButton.js +0 -86
  89. package/dist/src/CXIntegration/implementations/useReDoUnifiedCXButton.d.ts +0 -5
  90. package/dist/src/CXIntegration/implementations/useReDoUnifiedCXButton.js +0 -59
  91. package/dist/src/CXIntegration/implementations/useRichpanelUnifiedCXButton.d.ts +0 -5
  92. package/dist/src/CXIntegration/implementations/useRichpanelUnifiedCXButton.js +0 -62
  93. package/dist/src/CXIntegration/implementations/useShopifyChatUnifiedCXButton.d.ts +0 -5
  94. package/dist/src/CXIntegration/implementations/useShopifyChatUnifiedCXButton.js +0 -49
  95. package/dist/src/CXIntegration/implementations/useTalkdeskUnifiedCXButton.d.ts +0 -5
  96. package/dist/src/CXIntegration/implementations/useTalkdeskUnifiedCXButton.js +0 -77
  97. package/dist/src/CXIntegration/implementations/useTidioUnifiedCXButton.d.ts +0 -13
  98. package/dist/src/CXIntegration/implementations/useTidioUnifiedCXButton.js +0 -20
  99. package/dist/src/CXIntegration/implementations/useZendeskUnifiedCXButton.d.ts +0 -5
  100. package/dist/src/CXIntegration/implementations/useZendeskUnifiedCXButton.js +0 -55
  101. package/dist/src/CXIntegration/implementations/useZowieUnifiedCXButton.d.ts +0 -13
  102. package/dist/src/CXIntegration/implementations/useZowieUnifiedCXButton.js +0 -20
  103. package/dist/src/CXIntegration/types.d.ts +0 -26
  104. package/dist/src/CXIntegration/types.js +0 -17
  105. package/dist/src/CXIntegration/utils/functions.d.ts +0 -2
  106. package/dist/src/CXIntegration/utils/functions.js +0 -57
  107. package/dist/src/debug/GenericSelect.d.ts +0 -11
  108. package/dist/src/debug/GenericSelect.js +0 -151
  109. package/dist/src/debug/MessageContent.d.ts +0 -4
  110. package/dist/src/debug/MessageContent.js +0 -87
  111. package/dist/src/debug/chatEmbed.d.ts +0 -2
  112. package/dist/src/debug/chatEmbed.js +0 -58
  113. package/dist/src/debug/debugBar.d.ts +0 -1
  114. package/dist/src/debug/debugBar.js +0 -9
  115. package/dist/src/debug/reportIssue.d.ts +0 -1
  116. package/dist/src/debug/reportIssue.js +0 -322
  117. package/dist/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.d.ts +0 -1
  118. package/dist/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.js +0 -452
  119. package/dist/src/hocs/withBaseWidget/index.d.ts +0 -2
  120. package/dist/src/hocs/withBaseWidget/index.js +0 -1
  121. package/dist/src/hocs/withBaseWidget/types.d.ts +0 -33
  122. package/dist/src/hocs/withBaseWidget/types.js +0 -0
  123. package/dist/src/hocs/withBaseWidget/withBaseWidget.d.ts +0 -5
  124. package/dist/src/hocs/withBaseWidget/withBaseWidget.js +0 -80
  125. package/dist/src/stories/FloatingChatWidget.stories.d.ts +0 -25
  126. package/dist/src/stories/FloatingChatWidget.stories.js +0 -44
  127. package/dist/src/stories/FullPageSalesAgentWidget.stories.d.ts +0 -31
  128. package/dist/src/stories/FullPageSalesAgentWidget.stories.js +0 -51
  129. package/dist/src/stories/ProductCardWidget.stories.d.ts +0 -31
  130. package/dist/src/stories/ProductCardWidget.stories.js +0 -44
  131. package/dist/src/stories/PromptButtonCarouselWithImageWidget.stories.d.ts +0 -31
  132. package/dist/src/stories/PromptButtonCarouselWithImageWidget.stories.js +0 -40
  133. package/dist/src/stories/PromptCarouselWidget.stories.d.ts +0 -31
  134. package/dist/src/stories/PromptCarouselWidget.stories.js +0 -40
  135. package/dist/src/stories/SalesAgentTest/SalesAgentTest.d.ts +0 -1
  136. package/dist/src/stories/SalesAgentTest/SalesAgentTest.js +0 -40
  137. package/dist/src/stories/SalesAgentTest/SalesAgentTest.stories.d.ts +0 -12
  138. package/dist/src/stories/SalesAgentTest/SalesAgentTest.stories.js +0 -12
  139. package/dist/src/stories/SalesAgentTest/index.d.ts +0 -0
  140. package/dist/src/stories/SalesAgentTest/index.js +0 -0
  141. package/dist/src/stories/SearchResults.stories.d.ts +0 -6
  142. package/dist/src/stories/SearchResults.stories.js +0 -23
  143. package/dist/src/stories/SearchZeroState.stories.d.ts +0 -38
  144. package/dist/src/stories/SearchZeroState.stories.js +0 -42
  145. package/dist/src/stories/SocialProofFlowWidget.stories.d.ts +0 -35
  146. package/dist/src/stories/SocialProofFlowWidget.stories.js +0 -60
  147. package/dist/src/stories/SuggestionBar.stories.d.ts +0 -7
  148. package/dist/src/stories/SuggestionBar.stories.js +0 -36
  149. package/dist/src/stories/TitledPromptCarouselWidget.stories.d.ts +0 -32
  150. package/dist/src/stories/TitledPromptCarouselWidget.stories.js +0 -55
  151. package/dist/src/stories/TypingAnimationFlowWidget.stories.d.ts +0 -34
  152. package/dist/src/stories/TypingAnimationFlowWidget.stories.js +0 -51
  153. package/dist/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +0 -12
  154. package/dist/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +0 -112
  155. package/dist/src/widgets/ChatPreviewComparisonWidget/index.d.ts +0 -3
  156. package/dist/src/widgets/ChatPreviewComparisonWidget/index.js +0 -2
  157. package/dist/src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +0 -9
  158. package/dist/src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js +0 -34
  159. package/dist/src/widgets/ChatPreviewLoadingWidget/index.d.ts +0 -3
  160. package/dist/src/widgets/ChatPreviewLoadingWidget/index.js +0 -2
  161. package/dist/src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +0 -12
  162. package/dist/src/widgets/ChatPreviewWidget/ChatPreviewWidget.js +0 -111
  163. package/dist/src/widgets/ChatPreviewWidget/__tests__/ChatPreviewWidget.test.d.ts +0 -1
  164. package/dist/src/widgets/ChatPreviewWidget/__tests__/ChatPreviewWidget.test.js +0 -97
  165. package/dist/src/widgets/ChatPreviewWidget/index.d.ts +0 -3
  166. package/dist/src/widgets/ChatPreviewWidget/index.js +0 -2
  167. package/dist/src/widgets/FloatingChatWidget/FloatingChatOverlay.d.ts +0 -14
  168. package/dist/src/widgets/FloatingChatWidget/FloatingChatOverlay.js +0 -44
  169. package/dist/src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +0 -8
  170. package/dist/src/widgets/FloatingChatWidget/FloatingChatWidget.js +0 -134
  171. package/dist/src/widgets/FloatingChatWidget/__tests__/FloatingChatWidget.test.d.ts +0 -1
  172. package/dist/src/widgets/FloatingChatWidget/__tests__/FloatingChatWidget.test.js +0 -100
  173. package/dist/src/widgets/FloatingChatWidget/constants.d.ts +0 -1
  174. package/dist/src/widgets/FloatingChatWidget/constants.js +0 -1
  175. package/dist/src/widgets/FloatingChatWidget/hooks/useAutoPopup.d.ts +0 -4
  176. package/dist/src/widgets/FloatingChatWidget/hooks/useAutoPopup.js +0 -51
  177. package/dist/src/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.d.ts +0 -11
  178. package/dist/src/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.js +0 -21
  179. package/dist/src/widgets/FloatingChatWidget/index.d.ts +0 -4
  180. package/dist/src/widgets/FloatingChatWidget/index.js +0 -3
  181. package/dist/src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +0 -12
  182. package/dist/src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.js +0 -14
  183. package/dist/src/widgets/FullPageSalesAgentWidget/index.d.ts +0 -1
  184. package/dist/src/widgets/FullPageSalesAgentWidget/index.js +0 -1
  185. package/dist/src/widgets/ProductCardWidget/ProductCardWidget.d.ts +0 -7
  186. package/dist/src/widgets/ProductCardWidget/ProductCardWidget.js +0 -94
  187. package/dist/src/widgets/ProductCardWidget/__tests__/ProductCardWidget.test.d.ts +0 -1
  188. package/dist/src/widgets/ProductCardWidget/__tests__/ProductCardWidget.test.js +0 -106
  189. package/dist/src/widgets/ProductCardWidget/index.d.ts +0 -2
  190. package/dist/src/widgets/ProductCardWidget/index.js +0 -1
  191. package/dist/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +0 -12
  192. package/dist/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +0 -88
  193. package/dist/src/widgets/PromptButtonCarouselWithImageWidget/__tests__/PromptButtonCarouselWithImageWidget.test.d.ts +0 -1
  194. package/dist/src/widgets/PromptButtonCarouselWithImageWidget/__tests__/PromptButtonCarouselWithImageWidget.test.js +0 -132
  195. package/dist/src/widgets/PromptButtonCarouselWithImageWidget/index.d.ts +0 -2
  196. package/dist/src/widgets/PromptButtonCarouselWithImageWidget/index.js +0 -2
  197. package/dist/src/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +0 -7
  198. package/dist/src/widgets/PromptCarouselWidget/PromptCarouselWidget.js +0 -74
  199. package/dist/src/widgets/PromptCarouselWidget/__tests__/PromptCarouselWidget.test.d.ts +0 -1
  200. package/dist/src/widgets/PromptCarouselWidget/__tests__/PromptCarouselWidget.test.js +0 -106
  201. package/dist/src/widgets/PromptCarouselWidget/index.d.ts +0 -2
  202. package/dist/src/widgets/PromptCarouselWidget/index.js +0 -1
  203. package/dist/src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +0 -7
  204. package/dist/src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +0 -25
  205. package/dist/src/widgets/SocialProofFlowWidget/index.d.ts +0 -3
  206. package/dist/src/widgets/SocialProofFlowWidget/index.js +0 -2
  207. package/dist/src/widgets/SocialProofWidget/SocialProofWidget.d.ts +0 -12
  208. package/dist/src/widgets/SocialProofWidget/SocialProofWidget.js +0 -203
  209. package/dist/src/widgets/SocialProofWidget/__tests__/SocialProofWidget.test.d.ts +0 -1
  210. package/dist/src/widgets/SocialProofWidget/__tests__/SocialProofWidget.test.js +0 -135
  211. package/dist/src/widgets/SocialProofWidget/index.d.ts +0 -2
  212. package/dist/src/widgets/SocialProofWidget/index.js +0 -1
  213. package/dist/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +0 -7
  214. package/dist/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +0 -75
  215. package/dist/src/widgets/TitledPromptCarouselWidget/__tests__/TitledPromptCarouselWidget.test.d.ts +0 -1
  216. package/dist/src/widgets/TitledPromptCarouselWidget/__tests__/TitledPromptCarouselWidget.test.js +0 -106
  217. package/dist/src/widgets/TitledPromptCarouselWidget/index.d.ts +0 -2
  218. package/dist/src/widgets/TitledPromptCarouselWidget/index.js +0 -1
  219. package/dist/src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +0 -7
  220. package/dist/src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +0 -25
  221. package/dist/src/widgets/TypingAnimationFlowWidget/index.d.ts +0 -3
  222. package/dist/src/widgets/TypingAnimationFlowWidget/index.js +0 -2
  223. package/dist/src/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +0 -12
  224. package/dist/src/widgets/TypingAnimationWidget/TypingAnimationWidget.js +0 -126
  225. package/dist/src/widgets/TypingAnimationWidget/__tests__/TypingAnimationWidget.test.d.ts +0 -1
  226. package/dist/src/widgets/TypingAnimationWidget/__tests__/TypingAnimationWidget.test.js +0 -118
  227. package/dist/src/widgets/TypingAnimationWidget/index.d.ts +0 -2
  228. package/dist/src/widgets/TypingAnimationWidget/index.js +0 -1
  229. package/dist/src/widgets/__tests__/testUtils.d.ts +0 -60
  230. package/dist/src/widgets/__tests__/testUtils.js +0 -46
  231. package/dist/src/widgets/__tests__/trackEventCanary.test.d.ts +0 -1
  232. package/dist/src/widgets/__tests__/trackEventCanary.test.js +0 -37
  233. package/dist/src/widgets/hooks/useGetWidgetStatus.d.ts +0 -7
  234. package/dist/src/widgets/hooks/useGetWidgetStatus.js +0 -17
  235. package/dist/src/widgets/utils/functions.d.ts +0 -16
  236. package/dist/src/widgets/utils/functions.js +0 -87
  237. package/dist/src/widgets-v2/SearchResults/index.d.ts +0 -2
  238. package/dist/src/widgets-v2/SearchResults/index.js +0 -2
  239. package/dist/src/widgets-v2/SearchZeroState/index.d.ts +0 -2
  240. package/dist/src/widgets-v2/SearchZeroState/index.js +0 -2
  241. package/dist/src/widgets-v2/SuggestionBar/index.d.ts +0 -2
  242. package/dist/src/widgets-v2/SuggestionBar/index.js +0 -2
  243. package/dist/src/widgets-v2/SuggestionButtonContainer/index.d.ts +0 -2
  244. package/dist/src/widgets-v2/SuggestionButtonContainer/index.js +0 -2
  245. package/dist/tsdown.config.d.ts +0 -2
  246. package/dist/tsdown.config.js +0 -12
@@ -3,26 +3,59 @@ let react_jsx_runtime = require("react/jsx-runtime");
3
3
  let classnames = require("classnames");
4
4
  classnames = require_rolldown_runtime.__toESM(classnames);
5
5
  let framer_motion = require("framer-motion");
6
+ let __envive_ai_react_toolkit_v3_utils_useCheckIsMobile = require("@envive-ai/react-toolkit-v3/utils/useCheckIsMobile");
6
7
 
7
8
  //#region src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx
8
- const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestId, previewMode = false }) => {
9
+ const ANIMATION_DURATION = .3;
10
+ const useOverlayAnimations = ({ previewMode, isMobile }) => {
11
+ if (previewMode) return {
12
+ overlayExitAnimation: {
13
+ opacity: 0,
14
+ x: 0
15
+ },
16
+ overlayAnimation: {
17
+ opacity: 1,
18
+ x: 0
19
+ }
20
+ };
21
+ if (isMobile) return {
22
+ overlayExitAnimation: { opacity: 0 },
23
+ overlayAnimation: { opacity: 1 }
24
+ };
25
+ return {
26
+ overlayExitAnimation: {
27
+ opacity: 0,
28
+ x: 512
29
+ },
30
+ overlayAnimation: {
31
+ opacity: 1,
32
+ x: 0
33
+ }
34
+ };
35
+ };
36
+ const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestId, previewMode = false, isResultsModalOpen = false }) => {
37
+ const { isMobile } = (0, __envive_ai_react_toolkit_v3_utils_useCheckIsMobile.useCheckIsMobile)();
38
+ const { overlayExitAnimation, overlayAnimation } = useOverlayAnimations({
39
+ previewMode,
40
+ isMobile
41
+ });
9
42
  const overlayClasses = (0, classnames.default)(previewMode ? "envive-tw-absolute" : "envive-tw-fixed", "envive-tw-top-0", "envive-tw-left-0", previewMode ? "envive-tw-h-full" : "envive-tw-h-screen", "envive-tw-w-full", "envive-tw-z-[2147483647]", className);
10
- const backdropClasses = (0, classnames.default)("envive-tw-absolute", "envive-tw-top-0", "envive-tw-left-0", "envive-tw-h-full", "envive-tw-w-full", "envive-tw-bg-black", "envive-tw-opacity-50", "envive-tw-pointer-events-none", "envive-tw-z-0");
43
+ const backdropClasses = (0, classnames.default)("envive-tw-absolute", "envive-tw-top-0", "envive-tw-left-0", "envive-tw-h-full", "envive-tw-w-full", isMobile ? "envive-tw-bg-black" : "", "envive-tw-opacity-50", "envive-tw-pointer-events-none", "envive-tw-z-0");
11
44
  const overlayContentClasses = (0, classnames.default)("envive-tw-relative", "envive-tw-flex", "envive-tw-justify-end", "envive-tw-items-stretch", "envive-tw-h-full", "envive-tw-w-full", "envive-tw-pointer-events-auto", "envive-tw-cursor-pointer", "envive-tw-z-10");
12
- const chatWrapper = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.AnimatePresence, { children: isOpened && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(framer_motion.motion.div, {
45
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.AnimatePresence, { children: isOpened && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(framer_motion.motion.div, {
13
46
  className: overlayClasses,
14
47
  style: { top: "0px" },
15
48
  initial: { opacity: 0 },
16
49
  animate: { opacity: 1 },
17
50
  exit: { opacity: 0 },
18
- transition: { duration: .3 },
51
+ transition: { duration: ANIMATION_DURATION },
19
52
  "data-testid": dataTestId,
20
53
  children: [!previewMode && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
21
54
  className: backdropClasses,
22
55
  initial: { opacity: 0 },
23
56
  animate: { opacity: .5 },
24
57
  exit: { opacity: 0 },
25
- transition: { duration: .3 },
58
+ transition: { duration: ANIMATION_DURATION },
26
59
  "aria-label": "Close chat"
27
60
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
28
61
  className: overlayContentClasses,
@@ -35,22 +68,14 @@ const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestI
35
68
  tabIndex: 0,
36
69
  "aria-label": "Close floating chat",
37
70
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
38
- initial: {
39
- opacity: 0,
40
- x: previewMode ? 0 : 512
41
- },
42
- animate: {
43
- opacity: 1,
44
- x: 0
45
- },
46
- exit: {
47
- opacity: 0,
48
- x: previewMode ? 0 : 512
49
- },
50
- transition: { duration: .3 },
71
+ initial: overlayExitAnimation,
72
+ animate: overlayAnimation,
73
+ exit: overlayExitAnimation,
74
+ transition: { duration: ANIMATION_DURATION },
51
75
  style: {
52
76
  height: previewMode ? "100%" : "100dvh",
53
- cursor: "default"
77
+ cursor: "default",
78
+ margin: isResultsModalOpen ? "0 auto" : "0"
54
79
  },
55
80
  className: "envive-tw-shadow-md",
56
81
  onClick: (e) => e.stopPropagation(),
@@ -58,8 +83,6 @@ const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestI
58
83
  })
59
84
  })]
60
85
  }, "floating-chat-overlay") });
61
- if (previewMode) return chatWrapper;
62
- return chatWrapper;
63
86
  };
64
87
  FloatingChatOverlay.displayName = "FloatingChatOverlay";
65
88
 
@@ -1,26 +1,59 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import classNames from "classnames";
3
3
  import { AnimatePresence, motion } from "framer-motion";
4
+ import { useCheckIsMobile } from "@envive-ai/react-toolkit-v3/utils/useCheckIsMobile";
4
5
 
5
6
  //#region src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx
6
- const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestId, previewMode = false }) => {
7
+ const ANIMATION_DURATION = .3;
8
+ const useOverlayAnimations = ({ previewMode, isMobile }) => {
9
+ if (previewMode) return {
10
+ overlayExitAnimation: {
11
+ opacity: 0,
12
+ x: 0
13
+ },
14
+ overlayAnimation: {
15
+ opacity: 1,
16
+ x: 0
17
+ }
18
+ };
19
+ if (isMobile) return {
20
+ overlayExitAnimation: { opacity: 0 },
21
+ overlayAnimation: { opacity: 1 }
22
+ };
23
+ return {
24
+ overlayExitAnimation: {
25
+ opacity: 0,
26
+ x: 512
27
+ },
28
+ overlayAnimation: {
29
+ opacity: 1,
30
+ x: 0
31
+ }
32
+ };
33
+ };
34
+ const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestId, previewMode = false, isResultsModalOpen = false }) => {
35
+ const { isMobile } = useCheckIsMobile();
36
+ const { overlayExitAnimation, overlayAnimation } = useOverlayAnimations({
37
+ previewMode,
38
+ isMobile
39
+ });
7
40
  const overlayClasses = classNames(previewMode ? "envive-tw-absolute" : "envive-tw-fixed", "envive-tw-top-0", "envive-tw-left-0", previewMode ? "envive-tw-h-full" : "envive-tw-h-screen", "envive-tw-w-full", "envive-tw-z-[2147483647]", className);
8
- const backdropClasses = classNames("envive-tw-absolute", "envive-tw-top-0", "envive-tw-left-0", "envive-tw-h-full", "envive-tw-w-full", "envive-tw-bg-black", "envive-tw-opacity-50", "envive-tw-pointer-events-none", "envive-tw-z-0");
41
+ const backdropClasses = classNames("envive-tw-absolute", "envive-tw-top-0", "envive-tw-left-0", "envive-tw-h-full", "envive-tw-w-full", isMobile ? "envive-tw-bg-black" : "", "envive-tw-opacity-50", "envive-tw-pointer-events-none", "envive-tw-z-0");
9
42
  const overlayContentClasses = classNames("envive-tw-relative", "envive-tw-flex", "envive-tw-justify-end", "envive-tw-items-stretch", "envive-tw-h-full", "envive-tw-w-full", "envive-tw-pointer-events-auto", "envive-tw-cursor-pointer", "envive-tw-z-10");
10
- const chatWrapper = /* @__PURE__ */ jsx(AnimatePresence, { children: isOpened && /* @__PURE__ */ jsxs(motion.div, {
43
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: isOpened && /* @__PURE__ */ jsxs(motion.div, {
11
44
  className: overlayClasses,
12
45
  style: { top: "0px" },
13
46
  initial: { opacity: 0 },
14
47
  animate: { opacity: 1 },
15
48
  exit: { opacity: 0 },
16
- transition: { duration: .3 },
49
+ transition: { duration: ANIMATION_DURATION },
17
50
  "data-testid": dataTestId,
18
51
  children: [!previewMode && /* @__PURE__ */ jsx(motion.div, {
19
52
  className: backdropClasses,
20
53
  initial: { opacity: 0 },
21
54
  animate: { opacity: .5 },
22
55
  exit: { opacity: 0 },
23
- transition: { duration: .3 },
56
+ transition: { duration: ANIMATION_DURATION },
24
57
  "aria-label": "Close chat"
25
58
  }), /* @__PURE__ */ jsx("div", {
26
59
  className: overlayContentClasses,
@@ -33,22 +66,14 @@ const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestI
33
66
  tabIndex: 0,
34
67
  "aria-label": "Close floating chat",
35
68
  children: /* @__PURE__ */ jsx(motion.div, {
36
- initial: {
37
- opacity: 0,
38
- x: previewMode ? 0 : 512
39
- },
40
- animate: {
41
- opacity: 1,
42
- x: 0
43
- },
44
- exit: {
45
- opacity: 0,
46
- x: previewMode ? 0 : 512
47
- },
48
- transition: { duration: .3 },
69
+ initial: overlayExitAnimation,
70
+ animate: overlayAnimation,
71
+ exit: overlayExitAnimation,
72
+ transition: { duration: ANIMATION_DURATION },
49
73
  style: {
50
74
  height: previewMode ? "100%" : "100dvh",
51
- cursor: "default"
75
+ cursor: "default",
76
+ margin: isResultsModalOpen ? "0 auto" : "0"
52
77
  },
53
78
  className: "envive-tw-shadow-md",
54
79
  onClick: (e) => e.stopPropagation(),
@@ -56,8 +81,6 @@ const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestI
56
81
  })
57
82
  })]
58
83
  }, "floating-chat-overlay") });
59
- if (previewMode) return chatWrapper;
60
- return chatWrapper;
61
84
  };
62
85
  FloatingChatOverlay.displayName = "FloatingChatOverlay";
63
86
 
@@ -11,14 +11,15 @@ const require_useFloatingButtonVisibility = require('./hooks/useFloatingButtonVi
11
11
  const require_useAutoPopup = require('./hooks/useAutoPopup.cjs');
12
12
  let react = require("react");
13
13
  let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
14
+ let __envive_ai_react_hooks_hooks_TrackComponentVisibleEvent = require("@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent");
14
15
  let react_jsx_runtime = require("react/jsx-runtime");
15
16
  let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
16
17
  let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
17
18
  let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
19
+ let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
18
20
  let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
19
21
  let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
20
22
  let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
21
- let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
22
23
  let __envive_ai_react_toolkit_v3_FloatingButton = require("@envive-ai/react-toolkit-v3/FloatingButton");
23
24
 
24
25
  //#region src/widgets/FloatingChatWidget/FloatingChatWidget.tsx
@@ -43,7 +44,7 @@ const CXButtonProvider = ({ provider, enabled, suppressMerchantButton, onSwitchT
43
44
  }) });
44
45
  };
45
46
  const FloatingChatWidgetHandler = (props) => {
46
- const { previewButtonOnly, previewChatAlwaysOpen } = props;
47
+ const { previewButtonOnly, previewChatAlwaysOpen, previewCXButtonsEnabled } = props;
47
48
  const salesAgentData = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)();
48
49
  const { trackWidgetInteraction } = (0, __envive_ai_react_hooks_hooks_WidgetInteraction.useWidgetInteraction)();
49
50
  const { userHasInteractedValue } = require_useGetWidgetStatus.default();
@@ -52,6 +53,7 @@ const FloatingChatWidgetHandler = (props) => {
52
53
  const cxProvider = customerServiceIntegration?.provider ?? require_types.CustomerServiceType.unsupported;
53
54
  const { isOpen, openChat, closeChat, onHover } = (0, __envive_ai_react_hooks_hooks_ChatToggle.useChatToggle)();
54
55
  const [isCXOpen, setIsCXOpen] = (0, react.useState)(false);
56
+ const [isResultsModalOpen, setIsResultsModalOpen] = (0, react.useState)(false);
55
57
  (0, react.useEffect)(() => {
56
58
  if (isOpen) setIsCXOpen(false);
57
59
  }, [isOpen]);
@@ -77,40 +79,34 @@ const FloatingChatWidgetHandler = (props) => {
77
79
  return uiConfig?.lookAndFeel?.theme ?? __envive_ai_react_toolkit_v3_Tokens.Theme.GLOBAL_CUSTOM;
78
80
  }, [isUiConfigLoading, uiConfig]);
79
81
  require_useAutoPopup.useAutoPopup({ autoPopupConfig: floatingChat?.autoPopupConfig });
80
- const { trackEvent } = (0, __envive_ai_react_hooks_contexts_amplitudeContext.useAmplitude)();
81
- const hasTrackedEvent = (0, react.useRef)(false);
82
- (0, react.useEffect)(() => {
83
- if (buttonShouldRender && !hasTrackedEvent.current) {
84
- trackEvent({
85
- eventName: __envive_ai_react_hooks_contexts_amplitudeContext.SpiffyMetricsEventName.ChatComponentVisible,
86
- eventProps: {
87
- widget_config_id: "floating-button",
88
- widget_type: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.FloatingButtonV3
89
- }
90
- });
91
- hasTrackedEvent.current = true;
92
- }
93
- }, [trackEvent, buttonShouldRender]);
82
+ const { isReady } = (0, __envive_ai_react_hooks_contexts_amplitudeContext.useAmplitude)();
83
+ const floatingButtonVisibilityRef = (0, react.useRef)(null);
84
+ (0, __envive_ai_react_hooks_hooks_TrackComponentVisibleEvent.useTrackComponentVisibleEvent)(floatingButtonVisibilityRef, {
85
+ widget_config_id: "floating-button",
86
+ widget_type: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.FloatingButtonV3
87
+ }, "0px", isReady && buttonShouldRender);
94
88
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CXButtonProvider, {
95
89
  provider: cxProvider,
96
90
  enabled: customerServiceIntegration?.enabled ?? false,
97
91
  suppressMerchantButton: customerServiceIntegration?.suppressMerchantButton ?? false,
98
92
  onSwitchToAgent: () => setIsCXOpen(true),
99
93
  onCXClose: () => setIsCXOpen(false),
100
- children: ({ isSwitchEnabled, toggle }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(previewChatAlwaysOpen || effectiveIsOpen) && !previewButtonOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FloatingChatOverlay.FloatingChatOverlay, {
94
+ children: ({ isSwitchEnabled, toggle }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [!previewButtonOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FloatingChatOverlay.FloatingChatOverlay, {
101
95
  isOpened: effectiveIsOpen,
96
+ isResultsModalOpen,
102
97
  onClose: previewChatAlwaysOpen ? () => {} : () => {
103
98
  closeChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_OVERLAY);
104
99
  handleClose({ collapse_source: "body_click" });
105
100
  },
106
101
  previewMode: !!previewChatAlwaysOpen,
107
102
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FloatingChat, {
103
+ setIsResultsModalOpen,
108
104
  theme,
109
105
  salesAgentData,
110
106
  hardcopyContent,
111
107
  floatingChatConfig: uiConfig?.floatingChat ?? {},
112
108
  lookAndFeelConfig: uiConfig?.lookAndFeel ?? {},
113
- isCXButtonSwitchEnabled: !!isSwitchEnabled?.(),
109
+ isCXButtonSwitchEnabled: previewCXButtonsEnabled ? true : !!isSwitchEnabled?.(),
114
110
  isFloatingChatOpen: effectiveIsOpen,
115
111
  onToggleCXButton: toggle,
116
112
  debugBar: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_debugBar.DebugBar, {}),
@@ -123,29 +119,33 @@ const FloatingChatWidgetHandler = (props) => {
123
119
  handleClose({ collapse_source: "close_button" });
124
120
  }
125
121
  }) })
126
- }), buttonShouldRender && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_FloatingButton.FloatingButton, {
127
- id: require_constants.FLOATING_BUTTON_ID,
128
- variant: floatingButton?.style,
129
- mode: floatingButton?.mode,
130
- backgroundColor: floatingButton?.backgroundColor,
131
- onClick: previewButtonOnly ? () => {} : () => openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_BUTTON),
132
- onMouseOver: onHover,
133
- customIcon: floatingButton?.iconSVGSrc,
134
- show: floatingButton?.showOption,
135
- location: floatingButton?.position,
136
- hasInteractionHappened: userHasInteractedValue,
137
- ariaLabel: "Open chat",
138
- previewMode: !!previewButtonOnly
122
+ }), buttonShouldRender && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
123
+ ref: floatingButtonVisibilityRef,
124
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_FloatingButton.FloatingButton, {
125
+ id: require_constants.FLOATING_BUTTON_ID,
126
+ variant: floatingButton?.style,
127
+ mode: floatingButton?.mode,
128
+ backgroundColor: floatingButton?.backgroundColor,
129
+ onClick: previewButtonOnly ? () => {} : () => openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_BUTTON),
130
+ onMouseOver: onHover,
131
+ customIcon: floatingButton?.iconSVGSrc,
132
+ show: floatingButton?.showOption,
133
+ location: floatingButton?.position,
134
+ hasInteractionHappened: userHasInteractedValue,
135
+ ariaLabel: "Open chat",
136
+ previewMode: !!previewButtonOnly
137
+ })
139
138
  })] })
140
139
  }, cxProvider);
141
140
  };
142
- const FloatingChatWidgetWithBaseWidget = require_withBaseWidget.withBaseWidget(FloatingChatWidgetHandler);
143
- const FloatingChatWidget = ({ previewButtonOnly, previewChatAlwaysOpen } = {}) => {
141
+ const FloatingChatWidgetWithBaseWidget = require_withBaseWidget.withBaseWidget(FloatingChatWidgetHandler, { deferLoading: false });
142
+ const FloatingChatWidget = ({ previewButtonOnly, previewChatAlwaysOpen, previewCXButtonsEnabled } = {}) => {
144
143
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FloatingChatWidgetWithBaseWidget, {
145
144
  widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.FloatingChatV3,
146
145
  widgetConfigId: "fake-widget-config-id",
147
146
  previewButtonOnly,
148
- previewChatAlwaysOpen
147
+ previewChatAlwaysOpen,
148
+ previewCXButtonsEnabled
149
149
  });
150
150
  };
151
151
  FloatingChatWidget.displayName = "FloatingChatWidget";
@@ -4,11 +4,13 @@ import * as react_jsx_runtime17 from "react/jsx-runtime";
4
4
  interface FloatingChatWidgetProps {
5
5
  previewButtonOnly?: boolean;
6
6
  previewChatAlwaysOpen?: boolean;
7
+ previewCXButtonsEnabled?: boolean;
7
8
  }
8
9
  declare const FloatingChatWidget: {
9
10
  ({
10
11
  previewButtonOnly,
11
- previewChatAlwaysOpen
12
+ previewChatAlwaysOpen,
13
+ previewCXButtonsEnabled
12
14
  }?: FloatingChatWidgetProps): react_jsx_runtime17.JSX.Element;
13
15
  displayName: string;
14
16
  };
@@ -1,15 +1,17 @@
1
- import * as react_jsx_runtime4 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime19 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts
4
4
  interface FloatingChatWidgetProps {
5
5
  previewButtonOnly?: boolean;
6
6
  previewChatAlwaysOpen?: boolean;
7
+ previewCXButtonsEnabled?: boolean;
7
8
  }
8
9
  declare const FloatingChatWidget: {
9
10
  ({
10
11
  previewButtonOnly,
11
- previewChatAlwaysOpen
12
- }?: FloatingChatWidgetProps): react_jsx_runtime4.JSX.Element;
12
+ previewChatAlwaysOpen,
13
+ previewCXButtonsEnabled
14
+ }?: FloatingChatWidgetProps): react_jsx_runtime19.JSX.Element;
13
15
  displayName: string;
14
16
  };
15
17
  //#endregion
@@ -9,15 +9,16 @@ import { FloatingChatOverlay } from "./FloatingChatOverlay.js";
9
9
  import { useFloatingButtonVisibility } from "./hooks/useFloatingButtonVisibility.js";
10
10
  import { useAutoPopup } from "./hooks/useAutoPopup.js";
11
11
  import { Suspense, lazy, useEffect, useMemo, useRef, useState } from "react";
12
- import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
12
+ import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
13
+ import { useTrackComponentVisibleEvent } from "@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent";
13
14
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
14
15
  import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
15
16
  import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
16
17
  import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
18
+ import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
17
19
  import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
18
20
  import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
19
21
  import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
20
- import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
21
22
  import { FloatingButton } from "@envive-ai/react-toolkit-v3/FloatingButton";
22
23
 
23
24
  //#region src/widgets/FloatingChatWidget/FloatingChatWidget.tsx
@@ -42,7 +43,7 @@ const CXButtonProvider = ({ provider, enabled, suppressMerchantButton, onSwitchT
42
43
  }) });
43
44
  };
44
45
  const FloatingChatWidgetHandler = (props) => {
45
- const { previewButtonOnly, previewChatAlwaysOpen } = props;
46
+ const { previewButtonOnly, previewChatAlwaysOpen, previewCXButtonsEnabled } = props;
46
47
  const salesAgentData = useSalesAgent();
47
48
  const { trackWidgetInteraction } = useWidgetInteraction();
48
49
  const { userHasInteractedValue } = useGetWidgetStatus_default();
@@ -51,6 +52,7 @@ const FloatingChatWidgetHandler = (props) => {
51
52
  const cxProvider = customerServiceIntegration?.provider ?? CustomerServiceType.unsupported;
52
53
  const { isOpen, openChat, closeChat, onHover } = useChatToggle();
53
54
  const [isCXOpen, setIsCXOpen] = useState(false);
55
+ const [isResultsModalOpen, setIsResultsModalOpen] = useState(false);
54
56
  useEffect(() => {
55
57
  if (isOpen) setIsCXOpen(false);
56
58
  }, [isOpen]);
@@ -76,40 +78,34 @@ const FloatingChatWidgetHandler = (props) => {
76
78
  return uiConfig?.lookAndFeel?.theme ?? Theme.GLOBAL_CUSTOM;
77
79
  }, [isUiConfigLoading, uiConfig]);
78
80
  useAutoPopup({ autoPopupConfig: floatingChat?.autoPopupConfig });
79
- const { trackEvent } = useAmplitude();
80
- const hasTrackedEvent = useRef(false);
81
- useEffect(() => {
82
- if (buttonShouldRender && !hasTrackedEvent.current) {
83
- trackEvent({
84
- eventName: SpiffyMetricsEventName.ChatComponentVisible,
85
- eventProps: {
86
- widget_config_id: "floating-button",
87
- widget_type: WidgetTypeV3.FloatingButtonV3
88
- }
89
- });
90
- hasTrackedEvent.current = true;
91
- }
92
- }, [trackEvent, buttonShouldRender]);
81
+ const { isReady } = useAmplitude();
82
+ const floatingButtonVisibilityRef = useRef(null);
83
+ useTrackComponentVisibleEvent(floatingButtonVisibilityRef, {
84
+ widget_config_id: "floating-button",
85
+ widget_type: WidgetTypeV3.FloatingButtonV3
86
+ }, "0px", isReady && buttonShouldRender);
93
87
  return /* @__PURE__ */ jsx(CXButtonProvider, {
94
88
  provider: cxProvider,
95
89
  enabled: customerServiceIntegration?.enabled ?? false,
96
90
  suppressMerchantButton: customerServiceIntegration?.suppressMerchantButton ?? false,
97
91
  onSwitchToAgent: () => setIsCXOpen(true),
98
92
  onCXClose: () => setIsCXOpen(false),
99
- children: ({ isSwitchEnabled, toggle }) => /* @__PURE__ */ jsxs(Fragment, { children: [(previewChatAlwaysOpen || effectiveIsOpen) && !previewButtonOnly && /* @__PURE__ */ jsx(FloatingChatOverlay, {
93
+ children: ({ isSwitchEnabled, toggle }) => /* @__PURE__ */ jsxs(Fragment, { children: [!previewButtonOnly && /* @__PURE__ */ jsx(FloatingChatOverlay, {
100
94
  isOpened: effectiveIsOpen,
95
+ isResultsModalOpen,
101
96
  onClose: previewChatAlwaysOpen ? () => {} : () => {
102
97
  closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_OVERLAY);
103
98
  handleClose({ collapse_source: "body_click" });
104
99
  },
105
100
  previewMode: !!previewChatAlwaysOpen,
106
101
  children: /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(FloatingChat, {
102
+ setIsResultsModalOpen,
107
103
  theme,
108
104
  salesAgentData,
109
105
  hardcopyContent,
110
106
  floatingChatConfig: uiConfig?.floatingChat ?? {},
111
107
  lookAndFeelConfig: uiConfig?.lookAndFeel ?? {},
112
- isCXButtonSwitchEnabled: !!isSwitchEnabled?.(),
108
+ isCXButtonSwitchEnabled: previewCXButtonsEnabled ? true : !!isSwitchEnabled?.(),
113
109
  isFloatingChatOpen: effectiveIsOpen,
114
110
  onToggleCXButton: toggle,
115
111
  debugBar: /* @__PURE__ */ jsx(DebugBar, {}),
@@ -122,29 +118,33 @@ const FloatingChatWidgetHandler = (props) => {
122
118
  handleClose({ collapse_source: "close_button" });
123
119
  }
124
120
  }) })
125
- }), buttonShouldRender && /* @__PURE__ */ jsx(FloatingButton, {
126
- id: FLOATING_BUTTON_ID,
127
- variant: floatingButton?.style,
128
- mode: floatingButton?.mode,
129
- backgroundColor: floatingButton?.backgroundColor,
130
- onClick: previewButtonOnly ? () => {} : () => openChat(ChatElementDisplayLocationV3.FLOATING_BUTTON),
131
- onMouseOver: onHover,
132
- customIcon: floatingButton?.iconSVGSrc,
133
- show: floatingButton?.showOption,
134
- location: floatingButton?.position,
135
- hasInteractionHappened: userHasInteractedValue,
136
- ariaLabel: "Open chat",
137
- previewMode: !!previewButtonOnly
121
+ }), buttonShouldRender && /* @__PURE__ */ jsx("div", {
122
+ ref: floatingButtonVisibilityRef,
123
+ children: /* @__PURE__ */ jsx(FloatingButton, {
124
+ id: FLOATING_BUTTON_ID,
125
+ variant: floatingButton?.style,
126
+ mode: floatingButton?.mode,
127
+ backgroundColor: floatingButton?.backgroundColor,
128
+ onClick: previewButtonOnly ? () => {} : () => openChat(ChatElementDisplayLocationV3.FLOATING_BUTTON),
129
+ onMouseOver: onHover,
130
+ customIcon: floatingButton?.iconSVGSrc,
131
+ show: floatingButton?.showOption,
132
+ location: floatingButton?.position,
133
+ hasInteractionHappened: userHasInteractedValue,
134
+ ariaLabel: "Open chat",
135
+ previewMode: !!previewButtonOnly
136
+ })
138
137
  })] })
139
138
  }, cxProvider);
140
139
  };
141
- const FloatingChatWidgetWithBaseWidget = withBaseWidget(FloatingChatWidgetHandler);
142
- const FloatingChatWidget = ({ previewButtonOnly, previewChatAlwaysOpen } = {}) => {
140
+ const FloatingChatWidgetWithBaseWidget = withBaseWidget(FloatingChatWidgetHandler, { deferLoading: false });
141
+ const FloatingChatWidget = ({ previewButtonOnly, previewChatAlwaysOpen, previewCXButtonsEnabled } = {}) => {
143
142
  return /* @__PURE__ */ jsx(FloatingChatWidgetWithBaseWidget, {
144
143
  widgetType: WidgetTypeV3.FloatingChatV3,
145
144
  widgetConfigId: "fake-widget-config-id",
146
145
  previewButtonOnly,
147
- previewChatAlwaysOpen
146
+ previewChatAlwaysOpen,
147
+ previewCXButtonsEnabled
148
148
  });
149
149
  };
150
150
  FloatingChatWidget.displayName = "FloatingChatWidget";
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime11 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime14 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts
4
4
 
@@ -8,7 +8,7 @@ interface FullPageSalesAgentBaseWidgetProps {
8
8
  declare const FullPageSalesAgentWidget: {
9
9
  ({
10
10
  widgetConfigId
11
- }: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime11.JSX.Element;
11
+ }: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime14.JSX.Element;
12
12
  displayName: string;
13
13
  };
14
14
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime6 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime14 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts
4
4
 
@@ -8,7 +8,7 @@ interface FullPageSalesAgentBaseWidgetProps {
8
8
  declare const FullPageSalesAgentWidget: {
9
9
  ({
10
10
  widgetConfigId
11
- }: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime6.JSX.Element;
11
+ }: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime14.JSX.Element;
12
12
  displayName: string;
13
13
  };
14
14
  //#endregion
@@ -8,11 +8,11 @@ let react_jsx_runtime = require("react/jsx-runtime");
8
8
  let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
9
9
  let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
10
10
  let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
11
+ let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
11
12
  let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
12
13
  let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
13
14
  let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
14
15
  let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
15
- let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
16
16
  let __envive_ai_react_toolkit_v3_ProductCard = require("@envive-ai/react-toolkit-v3/ProductCard");
17
17
  let __envive_ai_react_toolkit_v3_PromptButton_types = require("@envive-ai/react-toolkit-v3/PromptButton/types");
18
18
 
@@ -49,16 +49,6 @@ const ProductCardWidgetHandler = (props) => {
49
49
  const rawValues = hardcopyContent?.rawValues;
50
50
  return require_functions.getStringIdForText(rawValues, text);
51
51
  });
52
- const { widgetConfigId } = props;
53
- (0, react.useEffect)(() => {
54
- trackEvent({
55
- eventName: __envive_ai_react_hooks_contexts_amplitudeContext.SpiffyMetricsEventName.ChatComponentVisible,
56
- eventProps: {
57
- widget_config_id: widgetConfigId,
58
- widget_type: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ProductCardV3
59
- }
60
- });
61
- }, [trackEvent, widgetConfigId]);
62
52
  const handleSelect = (0, react.useCallback)((text) => {
63
53
  const rawValues = hardcopyContent?.rawValues;
64
54
  const stringId = require_functions.getStringIdForText(rawValues, text);
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime8 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime19 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/ProductCardWidget/ProductCardWidget.d.ts
4
4
  interface ProductCardWidgetProps {
@@ -7,7 +7,7 @@ interface ProductCardWidgetProps {
7
7
  declare const ProductCardWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: ProductCardWidgetProps): react_jsx_runtime8.JSX.Element;
10
+ }: ProductCardWidgetProps): react_jsx_runtime19.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime15 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime18 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/ProductCardWidget/ProductCardWidget.d.ts
4
4
  interface ProductCardWidgetProps {
@@ -7,7 +7,7 @@ interface ProductCardWidgetProps {
7
7
  declare const ProductCardWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: ProductCardWidgetProps): react_jsx_runtime15.JSX.Element;
10
+ }: ProductCardWidgetProps): react_jsx_runtime18.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,17 +1,17 @@
1
1
  import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
2
2
  import "../../hocs/withBaseWidget/index.js";
3
3
  import { getStringIdForText } from "../utils/functions.js";
4
- import { useCallback, useEffect } from "react";
5
- import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
4
+ import { useCallback } from "react";
5
+ import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
8
8
  import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
9
9
  import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
10
+ import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
10
11
  import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
11
12
  import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
12
13
  import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
13
14
  import { usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
14
- import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
15
15
  import { ProductCard } from "@envive-ai/react-toolkit-v3/ProductCard";
16
16
  import { PromptButtonVariant } from "@envive-ai/react-toolkit-v3/PromptButton/types";
17
17
 
@@ -48,16 +48,6 @@ const ProductCardWidgetHandler = (props) => {
48
48
  const rawValues = hardcopyContent?.rawValues;
49
49
  return getStringIdForText(rawValues, text);
50
50
  });
51
- const { widgetConfigId } = props;
52
- useEffect(() => {
53
- trackEvent({
54
- eventName: SpiffyMetricsEventName.ChatComponentVisible,
55
- eventProps: {
56
- widget_config_id: widgetConfigId,
57
- widget_type: WidgetTypeV3.ProductCardV3
58
- }
59
- });
60
- }, [trackEvent, widgetConfigId]);
61
51
  const handleSelect = useCallback((text) => {
62
52
  const rawValues = hardcopyContent?.rawValues;
63
53
  const stringId = getStringIdForText(rawValues, text);