@envive-ai/react-widgets-v3 0.3.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 (289) hide show
  1. package/dist/CXIntegration/hooks/useUnifiedCXButton.cjs +23 -0
  2. package/dist/CXIntegration/hooks/useUnifiedCXButton.js +22 -0
  3. package/dist/CXIntegration/implementations/useDefaultUnifiedCXButton.cjs +11 -0
  4. package/dist/CXIntegration/implementations/useDefaultUnifiedCXButton.js +10 -0
  5. package/dist/CXIntegration/implementations/useGladlyUnifiedCXButton.cjs +20 -0
  6. package/dist/CXIntegration/implementations/useGladlyUnifiedCXButton.js +19 -0
  7. package/dist/CXIntegration/implementations/useGorgiasUnifiedCXButton.cjs +53 -0
  8. package/dist/CXIntegration/implementations/useGorgiasUnifiedCXButton.js +52 -0
  9. package/dist/CXIntegration/implementations/useGrooveUnifiedCXButton.cjs +45 -0
  10. package/dist/CXIntegration/implementations/useGrooveUnifiedCXButton.js +44 -0
  11. package/dist/CXIntegration/implementations/useKustomerUnifiedCXButton.cjs +70 -0
  12. package/dist/CXIntegration/implementations/useKustomerUnifiedCXButton.js +69 -0
  13. package/dist/CXIntegration/implementations/useReDoUnifiedCXButton.cjs +59 -0
  14. package/dist/CXIntegration/implementations/useReDoUnifiedCXButton.js +58 -0
  15. package/dist/CXIntegration/implementations/useRichpanelUnifiedCXButton.cjs +65 -0
  16. package/dist/CXIntegration/implementations/useRichpanelUnifiedCXButton.js +64 -0
  17. package/dist/CXIntegration/implementations/useShopifyChatUnifiedCXButton.cjs +53 -0
  18. package/dist/CXIntegration/implementations/useShopifyChatUnifiedCXButton.js +52 -0
  19. package/dist/CXIntegration/implementations/useTidioUnifiedCXButton.cjs +18 -0
  20. package/dist/CXIntegration/implementations/useTidioUnifiedCXButton.js +17 -0
  21. package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.cjs +54 -0
  22. package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.js +53 -0
  23. package/dist/CXIntegration/implementations/useZowieUnifiedCXButton.cjs +18 -0
  24. package/dist/CXIntegration/implementations/useZowieUnifiedCXButton.js +17 -0
  25. package/dist/CXIntegration/types.cjs +19 -0
  26. package/dist/CXIntegration/types.js +18 -0
  27. package/dist/CXIntegration/utils/functions.cjs +30 -0
  28. package/dist/CXIntegration/utils/functions.js +30 -0
  29. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  30. package/dist/hocs/withBaseWidget/index.cjs +3 -0
  31. package/dist/hocs/withBaseWidget/index.d.cts +3 -0
  32. package/dist/hocs/withBaseWidget/index.d.ts +3 -0
  33. package/dist/hocs/withBaseWidget/index.js +3 -0
  34. package/dist/hocs/withBaseWidget/types.d.cts +37 -0
  35. package/dist/hocs/withBaseWidget/types.d.ts +39 -0
  36. package/dist/hocs/withBaseWidget/withBaseWidget.cjs +101 -0
  37. package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +10 -0
  38. package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +10 -0
  39. package/dist/hocs/withBaseWidget/withBaseWidget.js +100 -0
  40. package/dist/hooks/dist/application/models/api/orgConfigResults.d.ts +1 -0
  41. package/dist/hooks/dist/application/models/frontendConfig.d.ts +1 -0
  42. package/dist/hooks/dist/contexts/amplitudeContext/amplitudeContext.d.ts +2 -0
  43. package/dist/hooks/dist/contexts/amplitudeContext/index.d.ts +2 -0
  44. package/dist/hooks/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.d.ts +2 -0
  45. package/dist/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.cts +8 -0
  46. package/dist/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.ts +11 -0
  47. package/dist/hooks/dist/contexts/hardcopyContext/index.d.ts +1 -0
  48. package/dist/hooks/dist/contexts/types.d.cts +44 -0
  49. package/dist/hooks/dist/contexts/types.d.ts +47 -0
  50. package/dist/hooks/dist/contexts/typesV3.d.cts +201 -0
  51. package/dist/hooks/dist/contexts/typesV3.d.ts +201 -0
  52. package/dist/hooks/dist/services/amplitudeService/amplitudeService.d.cts +36 -0
  53. package/dist/hooks/dist/services/amplitudeService/amplitudeService.d.ts +37 -0
  54. package/dist/hooks/dist/types/customerService.d.cts +18 -0
  55. package/dist/hooks/dist/types/customerService.d.ts +18 -0
  56. package/dist/stories/SalesAgentTest/index.cjs +0 -0
  57. package/dist/stories/SalesAgentTest/index.d.cts +1 -0
  58. package/dist/stories/SalesAgentTest/index.d.ts +1 -0
  59. package/dist/stories/SalesAgentTest/index.js +0 -0
  60. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +98 -0
  61. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +19 -0
  62. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +19 -0
  63. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +96 -0
  64. package/dist/widgets/ChatPreviewComparisonWidget/index.cjs +4 -0
  65. package/dist/widgets/ChatPreviewComparisonWidget/index.d.cts +2 -0
  66. package/dist/widgets/ChatPreviewComparisonWidget/index.d.ts +2 -0
  67. package/dist/widgets/ChatPreviewComparisonWidget/index.js +3 -0
  68. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs +44 -0
  69. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +16 -0
  70. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +16 -0
  71. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js +42 -0
  72. package/dist/widgets/ChatPreviewLoadingWidget/index.cjs +4 -0
  73. package/dist/widgets/ChatPreviewLoadingWidget/index.d.cts +2 -0
  74. package/dist/widgets/ChatPreviewLoadingWidget/index.d.ts +2 -0
  75. package/dist/widgets/ChatPreviewLoadingWidget/index.js +3 -0
  76. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +86 -0
  77. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +19 -0
  78. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +19 -0
  79. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +84 -0
  80. package/dist/widgets/ChatPreviewWidget/index.cjs +4 -0
  81. package/dist/widgets/ChatPreviewWidget/index.d.cts +2 -0
  82. package/dist/widgets/ChatPreviewWidget/index.d.ts +2 -0
  83. package/dist/widgets/ChatPreviewWidget/index.js +3 -0
  84. package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.cjs +66 -0
  85. package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.js +64 -0
  86. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +70 -0
  87. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +10 -0
  88. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +10 -0
  89. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +69 -0
  90. package/dist/widgets/FloatingChatWidget/constants.cjs +6 -0
  91. package/dist/widgets/FloatingChatWidget/constants.d.cts +4 -0
  92. package/dist/widgets/FloatingChatWidget/constants.d.ts +4 -0
  93. package/dist/widgets/FloatingChatWidget/constants.js +5 -0
  94. package/dist/widgets/FloatingChatWidget/index.cjs +5 -0
  95. package/dist/widgets/FloatingChatWidget/index.d.cts +3 -0
  96. package/dist/widgets/FloatingChatWidget/index.d.ts +3 -0
  97. package/dist/widgets/FloatingChatWidget/index.js +4 -0
  98. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +60 -0
  99. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +19 -0
  100. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +19 -0
  101. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +58 -0
  102. package/dist/widgets/PromptButtonCarouselWithImageWidget/index.cjs +4 -0
  103. package/dist/widgets/PromptButtonCarouselWithImageWidget/index.d.cts +2 -0
  104. package/dist/widgets/PromptButtonCarouselWithImageWidget/index.d.ts +2 -0
  105. package/dist/widgets/PromptButtonCarouselWithImageWidget/index.js +3 -0
  106. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +64 -0
  107. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +14 -0
  108. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +14 -0
  109. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +63 -0
  110. package/dist/widgets/PromptCarouselWidget/index.cjs +3 -0
  111. package/dist/widgets/PromptCarouselWidget/index.d.cts +2 -0
  112. package/dist/widgets/PromptCarouselWidget/index.d.ts +2 -0
  113. package/dist/widgets/PromptCarouselWidget/index.js +3 -0
  114. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.cjs +35 -0
  115. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +14 -0
  116. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +14 -0
  117. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +34 -0
  118. package/dist/widgets/SocialProofFlowWidget/index.cjs +3 -0
  119. package/dist/widgets/SocialProofFlowWidget/index.d.cts +2 -0
  120. package/dist/widgets/SocialProofFlowWidget/index.d.ts +2 -0
  121. package/dist/widgets/SocialProofFlowWidget/index.js +3 -0
  122. package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +118 -0
  123. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +19 -0
  124. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +19 -0
  125. package/dist/widgets/SocialProofWidget/SocialProofWidget.js +116 -0
  126. package/dist/widgets/SocialProofWidget/index.cjs +4 -0
  127. package/dist/widgets/SocialProofWidget/index.d.cts +2 -0
  128. package/dist/widgets/SocialProofWidget/index.d.ts +2 -0
  129. package/dist/widgets/SocialProofWidget/index.js +3 -0
  130. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +67 -0
  131. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +14 -0
  132. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +14 -0
  133. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +66 -0
  134. package/dist/widgets/TitledPromptCarouselWidget/index.cjs +3 -0
  135. package/dist/widgets/TitledPromptCarouselWidget/index.d.cts +2 -0
  136. package/dist/widgets/TitledPromptCarouselWidget/index.d.ts +2 -0
  137. package/dist/widgets/TitledPromptCarouselWidget/index.js +3 -0
  138. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.cjs +35 -0
  139. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +14 -0
  140. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +14 -0
  141. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +34 -0
  142. package/dist/widgets/TypingAnimationFlowWidget/index.cjs +3 -0
  143. package/dist/widgets/TypingAnimationFlowWidget/index.d.cts +2 -0
  144. package/dist/widgets/TypingAnimationFlowWidget/index.d.ts +2 -0
  145. package/dist/widgets/TypingAnimationFlowWidget/index.js +3 -0
  146. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +90 -0
  147. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +19 -0
  148. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +19 -0
  149. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +88 -0
  150. package/dist/widgets/TypingAnimationWidget/index.cjs +4 -0
  151. package/dist/widgets/TypingAnimationWidget/index.d.cts +2 -0
  152. package/dist/widgets/TypingAnimationWidget/index.d.ts +2 -0
  153. package/dist/widgets/TypingAnimationWidget/index.js +3 -0
  154. package/dist/widgets/dist/SearchResults/SearchResults.d.cts +15 -0
  155. package/dist/widgets/dist/SearchResults/SearchResults.d.ts +15 -0
  156. package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.cts +9 -0
  157. package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.ts +9 -0
  158. package/dist/widgets/dist/SearchResults/index.d.ts +2 -0
  159. package/dist/widgets/dist/SearchResults/types.d.cts +20 -0
  160. package/dist/widgets/dist/SearchResults/types.d.ts +20 -0
  161. package/dist/widgets/dist/SearchZeroState/SearchZeroState.d.cts +10 -0
  162. package/dist/widgets/dist/SearchZeroState/SearchZeroState.d.ts +10 -0
  163. package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.cts +18 -0
  164. package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.ts +18 -0
  165. package/dist/widgets/dist/SearchZeroState/index.d.ts +4 -0
  166. package/dist/widgets/dist/SearchZeroState/types.d.cts +13 -0
  167. package/dist/widgets/dist/SearchZeroState/types.d.ts +13 -0
  168. package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.cts +36 -0
  169. package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.ts +36 -0
  170. package/dist/widgets/dist/SuggestionBar/index.d.ts +2 -0
  171. package/dist/widgets/dist/SuggestionBar/types.d.cts +9 -0
  172. package/dist/widgets/dist/SuggestionBar/types.d.ts +9 -0
  173. package/dist/widgets/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.cts +9 -0
  174. package/dist/widgets/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.ts +9 -0
  175. package/dist/widgets/dist/SuggestionButtonContainer/types.d.cts +20 -0
  176. package/dist/widgets/dist/SuggestionButtonContainer/types.d.ts +20 -0
  177. package/dist/widgets/dist/config/BaseWidgetConfig.d.cts +13 -0
  178. package/dist/widgets/dist/config/BaseWidgetConfig.d.ts +13 -0
  179. package/dist/widgets/dist/config/WidgetType.d.cts +23 -0
  180. package/dist/widgets/dist/config/WidgetType.d.ts +23 -0
  181. package/dist/widgets/dist/packages/hooks/dist/application/models/api/response.d.cts +14 -0
  182. package/dist/widgets/dist/packages/hooks/dist/application/models/api/response.d.ts +14 -0
  183. package/dist/widgets/dist/packages/hooks/dist/application/models/api/search.d.cts +15 -0
  184. package/dist/widgets/dist/packages/hooks/dist/application/models/api/search.d.ts +15 -0
  185. package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCase.d.cts +73 -0
  186. package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCase.d.ts +73 -0
  187. package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.cts +61 -0
  188. package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts +61 -0
  189. package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/internal.d.cts +25 -0
  190. package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/internal.d.ts +25 -0
  191. package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/splitWords.d.cts +35 -0
  192. package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/splitWords.d.ts +35 -0
  193. package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/trim.d.cts +32 -0
  194. package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/trim.d.ts +32 -0
  195. package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.cts +32 -0
  196. package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.ts +32 -0
  197. package/dist/widgets/dist/packages/hooks/dist/atoms/search/searchAPI.d.cts +14 -0
  198. package/dist/widgets/dist/packages/hooks/dist/atoms/search/searchAPI.d.ts +15 -0
  199. package/dist/widgets/dist/packages/hooks/dist/contexts/types.d.cts +61 -0
  200. package/dist/widgets/dist/packages/hooks/dist/contexts/types.d.ts +61 -0
  201. package/dist/widgets/dist/packages/hooks/dist/hooks/Search/useSearch.d.cts +60 -0
  202. package/dist/widgets/dist/packages/hooks/dist/hooks/Search/useSearch.d.ts +60 -0
  203. package/dist/widgets/dist/packages/hooks/dist/hooks/utils.d.cts +11 -0
  204. package/dist/widgets/dist/packages/hooks/dist/hooks/utils.d.ts +11 -0
  205. package/dist/widgets/dist/packages/hooks/dist/types/search-filter-types.d.cts +28 -0
  206. package/dist/widgets/dist/packages/hooks/dist/types/search-filter-types.d.ts +28 -0
  207. package/dist/widgets/dist/packages/hooks/dist/types/test-types.d.cts +10 -0
  208. package/dist/widgets/dist/packages/hooks/dist/types/test-types.d.ts +10 -0
  209. package/dist/widgets/hooks/useGetWidgetStatus.cjs +27 -0
  210. package/dist/widgets/hooks/useGetWidgetStatus.js +26 -0
  211. package/dist/widgets/utils/functions.cjs +55 -0
  212. package/dist/widgets/utils/functions.js +48 -0
  213. package/dist/widgets-v2/SearchResults/index.cjs +5 -0
  214. package/dist/widgets-v2/SearchResults/index.d.cts +3 -0
  215. package/dist/widgets-v2/SearchResults/index.d.ts +4 -0
  216. package/dist/widgets-v2/SearchResults/index.js +3 -0
  217. package/dist/widgets-v2/SearchZeroState/index.cjs +8 -0
  218. package/dist/widgets-v2/SearchZeroState/index.d.cts +5 -0
  219. package/dist/widgets-v2/SearchZeroState/index.d.ts +6 -0
  220. package/dist/widgets-v2/SearchZeroState/index.js +3 -0
  221. package/dist/widgets-v2/SuggestionBar/index.cjs +5 -0
  222. package/dist/widgets-v2/SuggestionBar/index.d.cts +3 -0
  223. package/dist/widgets-v2/SuggestionBar/index.d.ts +4 -0
  224. package/dist/widgets-v2/SuggestionBar/index.js +3 -0
  225. package/dist/widgets-v2/SuggestionButtonContainer/index.cjs +5 -0
  226. package/dist/widgets-v2/SuggestionButtonContainer/index.d.cts +3 -0
  227. package/dist/widgets-v2/SuggestionButtonContainer/index.d.ts +3 -0
  228. package/dist/widgets-v2/SuggestionButtonContainer/index.js +3 -0
  229. package/package.json +158 -0
  230. package/src/CXIntegration/hooks/useUnifiedCXButton.ts +38 -0
  231. package/src/CXIntegration/implementations/useDefaultUnifiedCXButton.ts +8 -0
  232. package/src/CXIntegration/implementations/useGladlyUnifiedCXButton.ts +28 -0
  233. package/src/CXIntegration/implementations/useGorgiasUnifiedCXButton.ts +67 -0
  234. package/src/CXIntegration/implementations/useGrooveUnifiedCXButton.ts +83 -0
  235. package/src/CXIntegration/implementations/useKustomerUnifiedCXButton.ts +120 -0
  236. package/src/CXIntegration/implementations/useReDoUnifiedCXButton.ts +80 -0
  237. package/src/CXIntegration/implementations/useRichpanelUnifiedCXButton.ts +83 -0
  238. package/src/CXIntegration/implementations/useShopifyChatUnifiedCXButton.ts +78 -0
  239. package/src/CXIntegration/implementations/useTidioUnifiedCXButton.ts +34 -0
  240. package/src/CXIntegration/implementations/useZendeskUnifiedCXButton.ts +69 -0
  241. package/src/CXIntegration/implementations/useZowieUnifiedCXButton.ts +34 -0
  242. package/src/CXIntegration/types.ts +24 -0
  243. package/src/CXIntegration/utils/functions.ts +50 -0
  244. package/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.tsx +689 -0
  245. package/src/hocs/withBaseWidget/index.ts +2 -0
  246. package/src/hocs/withBaseWidget/types.ts +39 -0
  247. package/src/hocs/withBaseWidget/withBaseWidget.tsx +126 -0
  248. package/src/stories/FloatingChatWidget.stories.tsx +56 -0
  249. package/src/stories/PromptButtonCarouselWithImageWidget.stories.tsx +54 -0
  250. package/src/stories/PromptCarouselWidget.stories.tsx +54 -0
  251. package/src/stories/SalesAgentTest/SalesAgentTest.stories.tsx +18 -0
  252. package/src/stories/SalesAgentTest/SalesAgentTest.tsx +111 -0
  253. package/src/stories/SalesAgentTest/index.ts +0 -0
  254. package/src/stories/SearchResults.stories.tsx +29 -0
  255. package/src/stories/SearchZeroState.stories.tsx +52 -0
  256. package/src/stories/SocialProofFlowWidget.stories.tsx +77 -0
  257. package/src/stories/SuggestionBar.stories.tsx +45 -0
  258. package/src/stories/TitledPromptCarouselWidget.stories.tsx +71 -0
  259. package/src/stories/TypingAnimationFlowWidget.stories.tsx +67 -0
  260. package/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx +152 -0
  261. package/src/widgets/ChatPreviewComparisonWidget/index.ts +7 -0
  262. package/src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.tsx +82 -0
  263. package/src/widgets/ChatPreviewLoadingWidget/index.ts +7 -0
  264. package/src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx +119 -0
  265. package/src/widgets/ChatPreviewWidget/index.ts +4 -0
  266. package/src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx +115 -0
  267. package/src/widgets/FloatingChatWidget/FloatingChatWidget.tsx +110 -0
  268. package/src/widgets/FloatingChatWidget/constants.ts +1 -0
  269. package/src/widgets/FloatingChatWidget/index.ts +5 -0
  270. package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +87 -0
  271. package/src/widgets/PromptButtonCarouselWithImageWidget/index.ts +6 -0
  272. package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +83 -0
  273. package/src/widgets/PromptCarouselWidget/index.ts +2 -0
  274. package/src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.tsx +61 -0
  275. package/src/widgets/SocialProofFlowWidget/index.ts +4 -0
  276. package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +160 -0
  277. package/src/widgets/SocialProofWidget/index.ts +2 -0
  278. package/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx +93 -0
  279. package/src/widgets/TitledPromptCarouselWidget/index.ts +2 -0
  280. package/src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.tsx +61 -0
  281. package/src/widgets/TypingAnimationFlowWidget/index.ts +4 -0
  282. package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +115 -0
  283. package/src/widgets/TypingAnimationWidget/index.ts +2 -0
  284. package/src/widgets/hooks/useGetWidgetStatus.tsx +29 -0
  285. package/src/widgets/utils/functions.ts +104 -0
  286. package/src/widgets-v2/SearchResults/index.ts +3 -0
  287. package/src/widgets-v2/SearchZeroState/index.ts +15 -0
  288. package/src/widgets-v2/SuggestionBar/index.ts +6 -0
  289. package/src/widgets-v2/SuggestionButtonContainer/index.ts +6 -0
@@ -0,0 +1,42 @@
1
+ import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
2
+ import { PromptCarouselWidget } from "../PromptCarouselWidget/PromptCarouselWidget.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
5
+ import { useAtomValue } from "jotai";
6
+ import { ChatPreviewLoading } from "@envive-ai/react-toolkit-v3/ChatPreviewLoading";
7
+ import { chatPreviewLoadingDataAtom } from "@envive-ai/react-hooks/atoms/widget";
8
+
9
+ //#region src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.tsx
10
+ const ChatPreviewLoadingWidgetHandler = (props) => {
11
+ const { widgetConfig, isLoading, widgetConfigId, hardcopyContent, uiConfig } = props;
12
+ const chatPreviewLoadingWidgetConfig = widgetConfig;
13
+ const id = widgetConfig?.contentId;
14
+ const chatPreviewLoadingData = useAtomValue(chatPreviewLoadingDataAtom)[widgetConfigId] ?? void 0;
15
+ const isCacheEmpty = !chatPreviewLoadingData || Object.values(chatPreviewLoadingData).every((value) => value === void 0) || Object.keys(chatPreviewLoadingData).length === 0;
16
+ if (isLoading && isCacheEmpty) return /* @__PURE__ */ jsx(ChatPreviewLoading, { fullIsLoading: true });
17
+ const titleLabel = hardcopyContent?.values?.titleLabel ?? chatPreviewLoadingData?.titleLabel;
18
+ const textFieldPlaceholder = hardcopyContent?.values?.textFieldPlaceholderText ?? chatPreviewLoadingData?.textFieldPlaceholder;
19
+ const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo ?? chatPreviewLoadingData?.hideLogo;
20
+ const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc ?? chatPreviewLoadingData?.logoSrc;
21
+ return /* @__PURE__ */ jsx(ChatPreviewLoading, {
22
+ id,
23
+ variant: chatPreviewLoadingWidgetConfig?.variant ?? chatPreviewLoadingData?.variant,
24
+ hexCardColor: chatPreviewLoadingWidgetConfig?.hexCardColor ?? chatPreviewLoadingData?.hexCardColor,
25
+ hideTextField: chatPreviewLoadingWidgetConfig?.hideTextField ?? chatPreviewLoadingData?.hideTextField,
26
+ textFieldPlaceholder,
27
+ hideLogo,
28
+ logoSrc,
29
+ titleLabel
30
+ });
31
+ };
32
+ const ChatPreviewLoadingWidgetWithBaseWidget = withBaseWidget(ChatPreviewLoadingWidgetHandler);
33
+ const ChatPreviewLoadingWidget = ({ widgetConfigId }) => {
34
+ return /* @__PURE__ */ jsx(ChatPreviewLoadingWidgetWithBaseWidget, {
35
+ widgetConfigId,
36
+ widgetType: WidgetTypeV3.ChatPreviewLoadingV3
37
+ });
38
+ };
39
+ PromptCarouselWidget.displayName = "PromptCarouselWidget";
40
+
41
+ //#endregion
42
+ export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetWithBaseWidget };
@@ -0,0 +1,4 @@
1
+ const require_ChatPreviewLoadingWidget = require('./ChatPreviewLoadingWidget.cjs');
2
+
3
+ exports.ChatPreviewLoadingWidget = require_ChatPreviewLoadingWidget.ChatPreviewLoadingWidget;
4
+ exports.ChatPreviewLoadingWidgetWithBaseWidget = require_ChatPreviewLoadingWidget.ChatPreviewLoadingWidgetWithBaseWidget;
@@ -0,0 +1,2 @@
1
+ import { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetProps, ChatPreviewLoadingWidgetWithBaseWidget } from "./ChatPreviewLoadingWidget.cjs";
2
+ export { ChatPreviewLoadingWidget, type ChatPreviewLoadingWidgetProps, ChatPreviewLoadingWidgetWithBaseWidget };
@@ -0,0 +1,2 @@
1
+ import { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetProps, ChatPreviewLoadingWidgetWithBaseWidget } from "./ChatPreviewLoadingWidget.js";
2
+ export { ChatPreviewLoadingWidget, type ChatPreviewLoadingWidgetProps, ChatPreviewLoadingWidgetWithBaseWidget };
@@ -0,0 +1,3 @@
1
+ import { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetWithBaseWidget } from "./ChatPreviewLoadingWidget.js";
2
+
3
+ export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetWithBaseWidget };
@@ -0,0 +1,86 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget.cjs');
3
+ const require_functions = require('../utils/functions.cjs');
4
+ const require_ChatPreviewLoadingWidget = require('../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs');
5
+ let react = require("react");
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
8
+ let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
9
+ let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
10
+ let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
11
+ let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
12
+ let jotai = require("jotai");
13
+ let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
14
+ let __envive_ai_react_toolkit_v3_ChatPreview = require("@envive-ai/react-toolkit-v3/ChatPreview");
15
+
16
+ //#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx
17
+ const ChatPreviewWidgetHandler = (props) => {
18
+ const { onTypedMessageSubmitted } = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)();
19
+ const { openChat } = (0, __envive_ai_react_hooks_hooks_ChatToggle.useChatToggle)();
20
+ const lastAssistantMessage = (0, jotai.useAtomValue)(__envive_ai_react_hooks_atoms_chat.lastAssistantMessageAtom);
21
+ const { suggestions } = (0, jotai.useAtomValue)(__envive_ai_react_hooks_atoms_chat.chatAtom);
22
+ const promptButtonTexts = (0, react.useMemo)(() => {
23
+ return suggestions.map((suggestion) => suggestion.content);
24
+ }, [suggestions]);
25
+ const messageText = (0, react.useMemo)(() => require_functions.getMessageText(lastAssistantMessage), [lastAssistantMessage]);
26
+ const { hardcopyContent, widgetConfig, uiConfig, isLoading, widgetConfigId } = props;
27
+ const chatPreviewWidgetConfig = widgetConfig;
28
+ const id = widgetConfig?.contentId;
29
+ const hardCopyContent = {
30
+ titleLabel: hardcopyContent?.values?.titleLabel,
31
+ textFieldPlaceholderText: hardcopyContent?.values?.textFieldPlaceholderText,
32
+ messageText,
33
+ promptButtonTexts
34
+ };
35
+ const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
36
+ const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
37
+ const handlePromptButtonClick = (0, react.useCallback)((text) => {
38
+ onTypedMessageSubmitted({
39
+ query: text,
40
+ userTyped: false
41
+ });
42
+ openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.CHAT_PREVIEW_PROMPT_BUTTON);
43
+ }, [onTypedMessageSubmitted, openChat]);
44
+ const handleTextFieldClick = (0, react.useCallback)(() => {
45
+ openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.CHAT_PREVIEW_TEXT_FIELD);
46
+ }, [openChat]);
47
+ if (isLoading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewLoadingWidget.ChatPreviewLoadingWidgetWithBaseWidget, {
48
+ widgetConfigId,
49
+ widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewLoadingV3
50
+ });
51
+ const widgetStyleProps = {
52
+ theme: __envive_ai_react_toolkit_v3_Tokens.Theme.GLOBAL_CUSTOM,
53
+ variant: chatPreviewWidgetConfig?.variant,
54
+ hideTextField: chatPreviewWidgetConfig?.hideTextField,
55
+ hideLogo,
56
+ hexCardColor: chatPreviewWidgetConfig?.hexCardColor
57
+ };
58
+ const widgetContentProps = {
59
+ titleLabel: hardCopyContent?.titleLabel,
60
+ messageText: hardCopyContent?.messageText,
61
+ promptButtonTexts: hardCopyContent?.promptButtonTexts,
62
+ textFieldPlaceholderText: hardCopyContent?.textFieldPlaceholderText,
63
+ logoSrc: logoSrc ?? void 0
64
+ };
65
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_ChatPreview.ChatPreview, {
66
+ baseProps: { id },
67
+ widgetStyleProps,
68
+ widgetContentProps,
69
+ widgetEventProps: {
70
+ handlePromptButtonClick,
71
+ handleTextFieldClick
72
+ }
73
+ });
74
+ };
75
+ const ChatPreviewWidgetWithBaseWidget = require_withBaseWidget.withBaseWidget(ChatPreviewWidgetHandler);
76
+ const ChatPreviewWidget = ({ widgetConfigId }) => {
77
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChatPreviewWidgetWithBaseWidget, {
78
+ widgetConfigId,
79
+ widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewV3
80
+ });
81
+ };
82
+ ChatPreviewWidget.displayName = "ChatPreviewWidget";
83
+
84
+ //#endregion
85
+ exports.ChatPreviewWidget = ChatPreviewWidget;
86
+ exports.ChatPreviewWidgetWithBaseWidget = ChatPreviewWidgetWithBaseWidget;
@@ -0,0 +1,19 @@
1
+ import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
3
+
4
+ //#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts
5
+ declare const ChatPreviewWidgetWithBaseWidget: {
6
+ (props: BaseWidgetProps): react_jsx_runtime2.JSX.Element;
7
+ displayName: string;
8
+ };
9
+ interface ChatPreviewWidgetProps {
10
+ widgetConfigId: string;
11
+ }
12
+ declare const ChatPreviewWidget: {
13
+ ({
14
+ widgetConfigId
15
+ }: ChatPreviewWidgetProps): react_jsx_runtime2.JSX.Element;
16
+ displayName: string;
17
+ };
18
+ //#endregion
19
+ export { ChatPreviewWidget, ChatPreviewWidgetProps, ChatPreviewWidgetWithBaseWidget };
@@ -0,0 +1,19 @@
1
+ import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
2
+ import * as react_jsx_runtime5 from "react/jsx-runtime";
3
+
4
+ //#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts
5
+ declare const ChatPreviewWidgetWithBaseWidget: {
6
+ (props: BaseWidgetProps): react_jsx_runtime5.JSX.Element;
7
+ displayName: string;
8
+ };
9
+ interface ChatPreviewWidgetProps {
10
+ widgetConfigId: string;
11
+ }
12
+ declare const ChatPreviewWidget: {
13
+ ({
14
+ widgetConfigId
15
+ }: ChatPreviewWidgetProps): react_jsx_runtime5.JSX.Element;
16
+ displayName: string;
17
+ };
18
+ //#endregion
19
+ export { ChatPreviewWidget, ChatPreviewWidgetProps, ChatPreviewWidgetWithBaseWidget };
@@ -0,0 +1,84 @@
1
+ import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
2
+ import { getMessageText } from "../utils/functions.js";
3
+ import { ChatPreviewLoadingWidgetWithBaseWidget } from "../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js";
4
+ import { useCallback, useMemo } from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
7
+ import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
8
+ import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
9
+ import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
10
+ import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
11
+ import { useAtomValue } from "jotai";
12
+ import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
13
+ import { ChatPreview } from "@envive-ai/react-toolkit-v3/ChatPreview";
14
+
15
+ //#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx
16
+ const ChatPreviewWidgetHandler = (props) => {
17
+ const { onTypedMessageSubmitted } = useSalesAgent();
18
+ const { openChat } = useChatToggle();
19
+ const lastAssistantMessage = useAtomValue(lastAssistantMessageAtom);
20
+ const { suggestions } = useAtomValue(chatAtom);
21
+ const promptButtonTexts = useMemo(() => {
22
+ return suggestions.map((suggestion) => suggestion.content);
23
+ }, [suggestions]);
24
+ const messageText = useMemo(() => getMessageText(lastAssistantMessage), [lastAssistantMessage]);
25
+ const { hardcopyContent, widgetConfig, uiConfig, isLoading, widgetConfigId } = props;
26
+ const chatPreviewWidgetConfig = widgetConfig;
27
+ const id = widgetConfig?.contentId;
28
+ const hardCopyContent = {
29
+ titleLabel: hardcopyContent?.values?.titleLabel,
30
+ textFieldPlaceholderText: hardcopyContent?.values?.textFieldPlaceholderText,
31
+ messageText,
32
+ promptButtonTexts
33
+ };
34
+ const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
35
+ const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
36
+ const handlePromptButtonClick = useCallback((text) => {
37
+ onTypedMessageSubmitted({
38
+ query: text,
39
+ userTyped: false
40
+ });
41
+ openChat(ChatElementDisplayLocationV3.CHAT_PREVIEW_PROMPT_BUTTON);
42
+ }, [onTypedMessageSubmitted, openChat]);
43
+ const handleTextFieldClick = useCallback(() => {
44
+ openChat(ChatElementDisplayLocationV3.CHAT_PREVIEW_TEXT_FIELD);
45
+ }, [openChat]);
46
+ if (isLoading) return /* @__PURE__ */ jsx(ChatPreviewLoadingWidgetWithBaseWidget, {
47
+ widgetConfigId,
48
+ widgetType: WidgetTypeV3.ChatPreviewLoadingV3
49
+ });
50
+ const widgetStyleProps = {
51
+ theme: Theme.GLOBAL_CUSTOM,
52
+ variant: chatPreviewWidgetConfig?.variant,
53
+ hideTextField: chatPreviewWidgetConfig?.hideTextField,
54
+ hideLogo,
55
+ hexCardColor: chatPreviewWidgetConfig?.hexCardColor
56
+ };
57
+ const widgetContentProps = {
58
+ titleLabel: hardCopyContent?.titleLabel,
59
+ messageText: hardCopyContent?.messageText,
60
+ promptButtonTexts: hardCopyContent?.promptButtonTexts,
61
+ textFieldPlaceholderText: hardCopyContent?.textFieldPlaceholderText,
62
+ logoSrc: logoSrc ?? void 0
63
+ };
64
+ return /* @__PURE__ */ jsx(ChatPreview, {
65
+ baseProps: { id },
66
+ widgetStyleProps,
67
+ widgetContentProps,
68
+ widgetEventProps: {
69
+ handlePromptButtonClick,
70
+ handleTextFieldClick
71
+ }
72
+ });
73
+ };
74
+ const ChatPreviewWidgetWithBaseWidget = withBaseWidget(ChatPreviewWidgetHandler);
75
+ const ChatPreviewWidget = ({ widgetConfigId }) => {
76
+ return /* @__PURE__ */ jsx(ChatPreviewWidgetWithBaseWidget, {
77
+ widgetConfigId,
78
+ widgetType: WidgetTypeV3.ChatPreviewV3
79
+ });
80
+ };
81
+ ChatPreviewWidget.displayName = "ChatPreviewWidget";
82
+
83
+ //#endregion
84
+ export { ChatPreviewWidget, ChatPreviewWidgetWithBaseWidget };
@@ -0,0 +1,4 @@
1
+ const require_ChatPreviewWidget = require('./ChatPreviewWidget.cjs');
2
+
3
+ exports.ChatPreviewWidget = require_ChatPreviewWidget.ChatPreviewWidget;
4
+ exports.ChatPreviewWidgetWithBaseWidget = require_ChatPreviewWidget.ChatPreviewWidgetWithBaseWidget;
@@ -0,0 +1,2 @@
1
+ import { ChatPreviewWidget, ChatPreviewWidgetProps, ChatPreviewWidgetWithBaseWidget } from "./ChatPreviewWidget.cjs";
2
+ export { ChatPreviewWidget, type ChatPreviewWidgetProps, ChatPreviewWidgetWithBaseWidget };
@@ -0,0 +1,2 @@
1
+ import { ChatPreviewWidget, ChatPreviewWidgetProps, ChatPreviewWidgetWithBaseWidget } from "./ChatPreviewWidget.js";
2
+ export { ChatPreviewWidget, type ChatPreviewWidgetProps, ChatPreviewWidgetWithBaseWidget };
@@ -0,0 +1,3 @@
1
+ import { ChatPreviewWidget, ChatPreviewWidgetWithBaseWidget } from "./ChatPreviewWidget.js";
2
+
3
+ export { ChatPreviewWidget, ChatPreviewWidgetWithBaseWidget };
@@ -0,0 +1,66 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ let react_jsx_runtime = require("react/jsx-runtime");
3
+ let react_dom = require("react-dom");
4
+ let framer_motion = require("framer-motion");
5
+ let classnames = require("classnames");
6
+ classnames = require_rolldown_runtime.__toESM(classnames);
7
+
8
+ //#region src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx
9
+ const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestId }) => {
10
+ const overlayClasses = (0, classnames.default)("envive-floating-chat-overlay", "envive-tw-fixed", "envive-tw-top-0", "envive-tw-left-0", "envive-tw-h-screen", "envive-tw-w-full", "envive-tw-z-[2147483647]", className);
11
+ const backdropClasses = (0, classnames.default)("envive-floating-chat-backdrop", "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");
12
+ const overlayContentClasses = (0, classnames.default)("envive-floating-chat-overlay-content", "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");
13
+ const chatWrapper = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.AnimatePresence, { children: isOpened && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(framer_motion.motion.div, {
14
+ className: overlayClasses,
15
+ initial: { opacity: 0 },
16
+ animate: { opacity: 1 },
17
+ exit: { opacity: 0 },
18
+ transition: { duration: .3 },
19
+ "data-testid": dataTestId,
20
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
21
+ className: backdropClasses,
22
+ initial: { opacity: 0 },
23
+ animate: { opacity: .5 },
24
+ exit: { opacity: 0 },
25
+ transition: { duration: .3 },
26
+ "aria-label": "Close chat"
27
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
28
+ className: overlayContentClasses,
29
+ onClick: onClose,
30
+ onKeyDown: (e) => {
31
+ if (e.key === "Escape") onClose();
32
+ },
33
+ role: "button",
34
+ tabIndex: 0,
35
+ "aria-label": "Close floating chat",
36
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
37
+ initial: {
38
+ opacity: 0,
39
+ x: 512
40
+ },
41
+ animate: {
42
+ opacity: 1,
43
+ x: 0
44
+ },
45
+ exit: {
46
+ opacity: 0,
47
+ x: 512
48
+ },
49
+ transition: { duration: .3 },
50
+ style: {
51
+ height: "100dvh",
52
+ cursor: "default"
53
+ },
54
+ className: "envive-tw-shadow-md",
55
+ onClick: (e) => e.stopPropagation(),
56
+ children
57
+ })
58
+ })]
59
+ }, "floating-chat-overlay") });
60
+ if (typeof document !== "undefined") return (0, react_dom.createPortal)(chatWrapper, document.body);
61
+ return chatWrapper;
62
+ };
63
+ FloatingChatOverlay.displayName = "FloatingChatOverlay";
64
+
65
+ //#endregion
66
+ exports.FloatingChatOverlay = FloatingChatOverlay;
@@ -0,0 +1,64 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { createPortal } from "react-dom";
3
+ import { AnimatePresence, motion } from "framer-motion";
4
+ import classNames from "classnames";
5
+
6
+ //#region src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx
7
+ const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestId }) => {
8
+ const overlayClasses = classNames("envive-floating-chat-overlay", "envive-tw-fixed", "envive-tw-top-0", "envive-tw-left-0", "envive-tw-h-screen", "envive-tw-w-full", "envive-tw-z-[2147483647]", className);
9
+ const backdropClasses = classNames("envive-floating-chat-backdrop", "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");
10
+ const overlayContentClasses = classNames("envive-floating-chat-overlay-content", "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");
11
+ const chatWrapper = /* @__PURE__ */ jsx(AnimatePresence, { children: isOpened && /* @__PURE__ */ jsxs(motion.div, {
12
+ className: overlayClasses,
13
+ initial: { opacity: 0 },
14
+ animate: { opacity: 1 },
15
+ exit: { opacity: 0 },
16
+ transition: { duration: .3 },
17
+ "data-testid": dataTestId,
18
+ children: [/* @__PURE__ */ jsx(motion.div, {
19
+ className: backdropClasses,
20
+ initial: { opacity: 0 },
21
+ animate: { opacity: .5 },
22
+ exit: { opacity: 0 },
23
+ transition: { duration: .3 },
24
+ "aria-label": "Close chat"
25
+ }), /* @__PURE__ */ jsx("div", {
26
+ className: overlayContentClasses,
27
+ onClick: onClose,
28
+ onKeyDown: (e) => {
29
+ if (e.key === "Escape") onClose();
30
+ },
31
+ role: "button",
32
+ tabIndex: 0,
33
+ "aria-label": "Close floating chat",
34
+ children: /* @__PURE__ */ jsx(motion.div, {
35
+ initial: {
36
+ opacity: 0,
37
+ x: 512
38
+ },
39
+ animate: {
40
+ opacity: 1,
41
+ x: 0
42
+ },
43
+ exit: {
44
+ opacity: 0,
45
+ x: 512
46
+ },
47
+ transition: { duration: .3 },
48
+ style: {
49
+ height: "100dvh",
50
+ cursor: "default"
51
+ },
52
+ className: "envive-tw-shadow-md",
53
+ onClick: (e) => e.stopPropagation(),
54
+ children
55
+ })
56
+ })]
57
+ }, "floating-chat-overlay") });
58
+ if (typeof document !== "undefined") return createPortal(chatWrapper, document.body);
59
+ return chatWrapper;
60
+ };
61
+ FloatingChatOverlay.displayName = "FloatingChatOverlay";
62
+
63
+ //#endregion
64
+ export { FloatingChatOverlay };
@@ -0,0 +1,70 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget.cjs');
3
+ require('../../hocs/withBaseWidget/index.cjs');
4
+ const require_FloatingChatOverlay = require('./FloatingChatOverlay.cjs');
5
+ const require_useGetWidgetStatus = require('../hooks/useGetWidgetStatus.cjs');
6
+ const require_types = require('../../CXIntegration/types.cjs');
7
+ const require_constants = require('./constants.cjs');
8
+ const require_useUnifiedCXButton = require('../../CXIntegration/hooks/useUnifiedCXButton.cjs');
9
+ let react = require("react");
10
+ let react_jsx_runtime = require("react/jsx-runtime");
11
+ let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
12
+ let __envive_ai_react_toolkit_v3_FloatingChat = require("@envive-ai/react-toolkit-v3/FloatingChat");
13
+ let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
14
+ let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
15
+ let __envive_ai_react_toolkit_v3_FloatingButton = require("@envive-ai/react-toolkit-v3/FloatingButton");
16
+ let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
17
+ let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
18
+
19
+ //#region src/widgets/FloatingChatWidget/FloatingChatWidget.tsx
20
+ const FloatingChatWidgetHandler = (props) => {
21
+ const salesAgentData = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)();
22
+ const { userHasInteractedValue } = require_useGetWidgetStatus.default();
23
+ const { uiConfig, isUiConfigLoading } = props;
24
+ const { isSwitchEnabled, toggle } = require_useUnifiedCXButton.useUnifiedCXButton({
25
+ provider: require_types.CustomerServiceType.unsupported,
26
+ enabled: false,
27
+ suppressMerchantButton: false
28
+ }) ?? {};
29
+ const { isOpen, openChat, closeChat } = (0, __envive_ai_react_hooks_hooks_ChatToggle.useChatToggle)();
30
+ const theme = (0, react.useMemo)(() => {
31
+ if (isUiConfigLoading || !uiConfig) return __envive_ai_react_toolkit_v3_Tokens.Theme.STANDARD;
32
+ return uiConfig?.lookAndFeel?.theme ?? __envive_ai_react_toolkit_v3_Tokens.Theme.GLOBAL_CUSTOM;
33
+ }, [isUiConfigLoading, uiConfig]);
34
+ const { floatingButton } = uiConfig ?? {};
35
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FloatingChatOverlay.FloatingChatOverlay, {
36
+ isOpened: isOpen,
37
+ onClose: () => closeChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_OVERLAY),
38
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_FloatingChat.FloatingChat, {
39
+ theme,
40
+ salesAgentData,
41
+ floatingChatConfig: uiConfig?.floatingChat ?? {},
42
+ lookAndFeelConfig: uiConfig?.lookAndFeel ?? {},
43
+ isCXButtonSwitchEnabled: !!isSwitchEnabled?.(),
44
+ onToggleCXButton: toggle,
45
+ onClose: () => closeChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON)
46
+ })
47
+ }), !isOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_FloatingButton.FloatingButton, {
48
+ id: require_constants.FLOATING_BUTTON_ID,
49
+ variant: floatingButton?.style,
50
+ mode: floatingButton?.mode,
51
+ backgroundColor: floatingButton?.backgroundColor,
52
+ onClick: () => openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_BUTTON),
53
+ customIcon: floatingButton?.iconSVGSrc,
54
+ show: floatingButton?.showOption,
55
+ location: floatingButton?.position,
56
+ hasInteractionHappened: userHasInteractedValue,
57
+ ariaLabel: "Open chat"
58
+ })] });
59
+ };
60
+ const FloatingChatWidgetWithBaseWidget = require_withBaseWidget.withBaseWidget(FloatingChatWidgetHandler);
61
+ const FloatingChatWidget = () => {
62
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FloatingChatWidgetWithBaseWidget, {
63
+ widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.FloatingChatV3,
64
+ widgetConfigId: "fake-widget-config-id"
65
+ });
66
+ };
67
+ FloatingChatWidget.displayName = "FloatingChatWidget";
68
+
69
+ //#endregion
70
+ exports.FloatingChatWidget = FloatingChatWidget;
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime13 from "react/jsx-runtime";
2
+
3
+ //#region src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts
4
+ interface FloatingChatWidgetProps {}
5
+ declare const FloatingChatWidget: {
6
+ (): react_jsx_runtime13.JSX.Element;
7
+ displayName: string;
8
+ };
9
+ //#endregion
10
+ export { FloatingChatWidget, FloatingChatWidgetProps };
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
2
+
3
+ //#region src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts
4
+ interface FloatingChatWidgetProps {}
5
+ declare const FloatingChatWidget: {
6
+ (): react_jsx_runtime9.JSX.Element;
7
+ displayName: string;
8
+ };
9
+ //#endregion
10
+ export { FloatingChatWidget, FloatingChatWidgetProps };
@@ -0,0 +1,69 @@
1
+ import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
2
+ import "../../hocs/withBaseWidget/index.js";
3
+ import { FloatingChatOverlay } from "./FloatingChatOverlay.js";
4
+ import useGetWidgetStatus_default from "../hooks/useGetWidgetStatus.js";
5
+ import { CustomerServiceType } from "../../CXIntegration/types.js";
6
+ import { FLOATING_BUTTON_ID } from "./constants.js";
7
+ import { useUnifiedCXButton } from "../../CXIntegration/hooks/useUnifiedCXButton.js";
8
+ import { useMemo } from "react";
9
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
+ import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
11
+ import { FloatingChat } from "@envive-ai/react-toolkit-v3/FloatingChat";
12
+ import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
13
+ import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
14
+ import { FloatingButton } from "@envive-ai/react-toolkit-v3/FloatingButton";
15
+ import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
16
+ import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
17
+
18
+ //#region src/widgets/FloatingChatWidget/FloatingChatWidget.tsx
19
+ const FloatingChatWidgetHandler = (props) => {
20
+ const salesAgentData = useSalesAgent();
21
+ const { userHasInteractedValue } = useGetWidgetStatus_default();
22
+ const { uiConfig, isUiConfigLoading } = props;
23
+ const { isSwitchEnabled, toggle } = useUnifiedCXButton({
24
+ provider: CustomerServiceType.unsupported,
25
+ enabled: false,
26
+ suppressMerchantButton: false
27
+ }) ?? {};
28
+ const { isOpen, openChat, closeChat } = useChatToggle();
29
+ const theme = useMemo(() => {
30
+ if (isUiConfigLoading || !uiConfig) return Theme.STANDARD;
31
+ return uiConfig?.lookAndFeel?.theme ?? Theme.GLOBAL_CUSTOM;
32
+ }, [isUiConfigLoading, uiConfig]);
33
+ const { floatingButton } = uiConfig ?? {};
34
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(FloatingChatOverlay, {
35
+ isOpened: isOpen,
36
+ onClose: () => closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_OVERLAY),
37
+ children: /* @__PURE__ */ jsx(FloatingChat, {
38
+ theme,
39
+ salesAgentData,
40
+ floatingChatConfig: uiConfig?.floatingChat ?? {},
41
+ lookAndFeelConfig: uiConfig?.lookAndFeel ?? {},
42
+ isCXButtonSwitchEnabled: !!isSwitchEnabled?.(),
43
+ onToggleCXButton: toggle,
44
+ onClose: () => closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON)
45
+ })
46
+ }), !isOpen && /* @__PURE__ */ jsx(FloatingButton, {
47
+ id: FLOATING_BUTTON_ID,
48
+ variant: floatingButton?.style,
49
+ mode: floatingButton?.mode,
50
+ backgroundColor: floatingButton?.backgroundColor,
51
+ onClick: () => openChat(ChatElementDisplayLocationV3.FLOATING_BUTTON),
52
+ customIcon: floatingButton?.iconSVGSrc,
53
+ show: floatingButton?.showOption,
54
+ location: floatingButton?.position,
55
+ hasInteractionHappened: userHasInteractedValue,
56
+ ariaLabel: "Open chat"
57
+ })] });
58
+ };
59
+ const FloatingChatWidgetWithBaseWidget = withBaseWidget(FloatingChatWidgetHandler);
60
+ const FloatingChatWidget = () => {
61
+ return /* @__PURE__ */ jsx(FloatingChatWidgetWithBaseWidget, {
62
+ widgetType: WidgetTypeV3.FloatingChatV3,
63
+ widgetConfigId: "fake-widget-config-id"
64
+ });
65
+ };
66
+ FloatingChatWidget.displayName = "FloatingChatWidget";
67
+
68
+ //#endregion
69
+ export { FloatingChatWidget };
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/widgets/FloatingChatWidget/constants.ts
3
+ const FLOATING_BUTTON_ID = "envive-ai-floating-button";
4
+
5
+ //#endregion
6
+ exports.FLOATING_BUTTON_ID = FLOATING_BUTTON_ID;
@@ -0,0 +1,4 @@
1
+ //#region src/widgets/FloatingChatWidget/constants.d.ts
2
+ declare const FLOATING_BUTTON_ID = "envive-ai-floating-button";
3
+ //#endregion
4
+ export { FLOATING_BUTTON_ID };
@@ -0,0 +1,4 @@
1
+ //#region src/widgets/FloatingChatWidget/constants.d.ts
2
+ declare const FLOATING_BUTTON_ID = "envive-ai-floating-button";
3
+ //#endregion
4
+ export { FLOATING_BUTTON_ID };
@@ -0,0 +1,5 @@
1
+ //#region src/widgets/FloatingChatWidget/constants.ts
2
+ const FLOATING_BUTTON_ID = "envive-ai-floating-button";
3
+
4
+ //#endregion
5
+ export { FLOATING_BUTTON_ID };
@@ -0,0 +1,5 @@
1
+ const require_constants = require('./constants.cjs');
2
+ const require_FloatingChatWidget = require('./FloatingChatWidget.cjs');
3
+
4
+ exports.FLOATING_BUTTON_ID = require_constants.FLOATING_BUTTON_ID;
5
+ exports.FloatingChatWidget = require_FloatingChatWidget.FloatingChatWidget;
@@ -0,0 +1,3 @@
1
+ import { FloatingChatWidget, FloatingChatWidgetProps } from "./FloatingChatWidget.cjs";
2
+ import { FLOATING_BUTTON_ID } from "./constants.cjs";
3
+ export { FLOATING_BUTTON_ID, FloatingChatWidget, type FloatingChatWidgetProps };
@@ -0,0 +1,3 @@
1
+ import { FloatingChatWidget, FloatingChatWidgetProps } from "./FloatingChatWidget.js";
2
+ import { FLOATING_BUTTON_ID } from "./constants.js";
3
+ export { FLOATING_BUTTON_ID, FloatingChatWidget, type FloatingChatWidgetProps };
@@ -0,0 +1,4 @@
1
+ import { FLOATING_BUTTON_ID } from "./constants.js";
2
+ import { FloatingChatWidget } from "./FloatingChatWidget.js";
3
+
4
+ export { FLOATING_BUTTON_ID, FloatingChatWidget };