@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
@@ -1,32 +0,0 @@
1
- import type { StoryObj } from '@storybook/react-vite';
2
- declare const meta: {
3
- title: string;
4
- component: {
5
- ({ widgetConfigId }: import("../widgets/TitledPromptCarouselWidget").TitledPromptCarouselWidgetProps): import("react/jsx-runtime").JSX.Element;
6
- displayName: string;
7
- };
8
- tags: string[];
9
- args: {
10
- widgetConfigId: string;
11
- };
12
- argTypes: {
13
- widgetConfigId: {
14
- control: "text";
15
- description: string;
16
- };
17
- };
18
- parameters: {
19
- docs: {
20
- description: {
21
- component: string;
22
- };
23
- };
24
- };
25
- decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
26
- widgetConfigId: string;
27
- }>) => import("react/jsx-runtime").JSX.Element)[];
28
- };
29
- export default meta;
30
- type Story = StoryObj<typeof meta>;
31
- export declare const Light: Story;
32
- export declare const Dark: Story;
@@ -1,55 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { TitledPromptCarouselWidget } from '../widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget';
3
- const meta = {
4
- title: 'Widgets V3/TitledPromptCarouselWidget',
5
- component: TitledPromptCarouselWidget,
6
- tags: ['autodocs'],
7
- args: {
8
- widgetConfigId: 'titled-prompt-carousel-test-light-widget',
9
- },
10
- argTypes: {
11
- widgetConfigId: {
12
- control: 'text',
13
- description: 'Unique identifier for the widget configuration. The widget will fetch the widget config and hardcopy content based on this ID.',
14
- },
15
- },
16
- parameters: {
17
- docs: {
18
- description: {
19
- component: 'TitledPromptCarouselWidget is a widget wrapper that combines a Title component with a PromptCarousel component. It includes base widget functionality such as visibility tracking, widget config fetching and hardcopy content fetching. The widget automatically fetches title label, title logo, and prompt button texts from hardcopy and widget config based on the widgetConfigId.',
20
- },
21
- },
22
- },
23
- decorators: [
24
- Story => (_jsx("div", { style: {
25
- padding: '1rem',
26
- maxWidth: '100%',
27
- overflow: 'hidden',
28
- }, children: _jsx(Story, {}) })),
29
- ],
30
- };
31
- export default meta;
32
- export const Light = {
33
- args: {
34
- widgetConfigId: 'titled-prompt-carousel-test-light-widget',
35
- },
36
- parameters: {
37
- docs: {
38
- description: {
39
- story: 'TitledPromptCarouselWidget in light mode. The widget displays with light prompt buttons.',
40
- },
41
- },
42
- },
43
- };
44
- export const Dark = {
45
- args: {
46
- widgetConfigId: 'titled-prompt-carousel-test-dark-widget',
47
- },
48
- parameters: {
49
- docs: {
50
- description: {
51
- story: 'TitledPromptCarouselWidget in dark mode. The widget displays with dark prompt buttons.',
52
- },
53
- },
54
- },
55
- };
@@ -1,34 +0,0 @@
1
- import type { StoryObj } from '@storybook/react-vite';
2
- declare const meta: {
3
- title: string;
4
- component: {
5
- ({ widgetConfigId }: import("../widgets/TypingAnimationFlowWidget").TypingAnimationFlowWidgetProps): import("react/jsx-runtime").JSX.Element;
6
- displayName: string;
7
- };
8
- tags: string[];
9
- args: {
10
- widgetConfigId: string;
11
- };
12
- argTypes: {
13
- widgetConfigId: {
14
- control: "select";
15
- options: string[];
16
- description: string;
17
- };
18
- };
19
- parameters: {
20
- docs: {
21
- description: {
22
- component: string;
23
- };
24
- };
25
- };
26
- decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
27
- widgetConfigId: string;
28
- }>) => import("react/jsx-runtime").JSX.Element)[];
29
- };
30
- export default meta;
31
- type Story = StoryObj<typeof meta>;
32
- export declare const Playground: Story;
33
- export declare const LightButtons: Story;
34
- export declare const DarkButtons: Story;
@@ -1,51 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { TypingAnimationFlowWidget } from '../widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget';
3
- const meta = {
4
- title: 'Widgets V3/TypingAnimationFlowWidget',
5
- component: TypingAnimationFlowWidget,
6
- tags: ['autodocs'],
7
- args: {
8
- widgetConfigId: 'typing-animation-test-light-widget',
9
- },
10
- argTypes: {
11
- widgetConfigId: {
12
- control: 'select',
13
- options: ['typing-animation-test-light-widget', 'typing-animation-test-dark-widget'],
14
- description: 'Unique identifier for the widget configuration. The widget will fetch the widget config based on this ID.',
15
- },
16
- },
17
- parameters: {
18
- docs: {
19
- description: {
20
- component: 'TypingAnimationFlowWidget is a widget wrapper around TypingAnimation, ChatPreviewLoading and ChatPreview that includes base widget functionality such as visibility tracking, widget config fetching and hardcopy content fetching. The widget automatically fetches typing animation content (title, headline, animated text sequence, prompt buttons) from hardcopy and widget config based on the widgetConfigId. It handles post-interaction actions by transitioning to ChatPreview widget when the user interacts.',
21
- },
22
- },
23
- },
24
- decorators: [
25
- Story => (_jsx("div", { style: {
26
- padding: '1rem',
27
- maxWidth: '100%',
28
- overflow: 'hidden',
29
- }, children: _jsx(Story, {}) })),
30
- ],
31
- };
32
- export default meta;
33
- export const Playground = {
34
- parameters: {
35
- docs: {
36
- description: {
37
- story: 'Experiment with different widgetConfigId values. The widget will fetch typing animation content (title, headline, animated text sequence, prompt buttons) from hardcopy content and widget config based on the widgetConfigId. After user interaction, it will transition to ChatPreview widget.',
38
- },
39
- },
40
- },
41
- };
42
- export const LightButtons = {
43
- args: {
44
- widgetConfigId: 'typing-animation-test-light-widget',
45
- },
46
- };
47
- export const DarkButtons = {
48
- args: {
49
- widgetConfigId: 'typing-animation-test-dark-widget',
50
- },
51
- };
@@ -1,12 +0,0 @@
1
- import { BaseWidgetProps } from '../../hocs/withBaseWidget/types';
2
- export declare const ChatPreviewComparisonWidgetWithBaseWidget: {
3
- (props: BaseWidgetProps): import("react/jsx-runtime").JSX.Element;
4
- displayName: string;
5
- };
6
- export interface ChatPreviewComparisonWidgetProps {
7
- widgetConfigId: string;
8
- }
9
- export declare const ChatPreviewComparisonWidget: {
10
- ({ widgetConfigId, }: ChatPreviewComparisonWidgetProps): import("react/jsx-runtime").JSX.Element;
11
- displayName: string;
12
- };
@@ -1,112 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { chatAtom, lastAssistantMessageAtom } from '@envive-ai/react-hooks/atoms/chat';
3
- import { useSalesAgent } from '@envive-ai/react-hooks/contexts/salesAgentContext';
4
- import { WidgetTypeV3, } from '@envive-ai/react-hooks/contexts/typesV3';
5
- import { useChatToggle } from '@envive-ai/react-hooks/hooks/ChatToggle';
6
- import { useAtomValue } from 'jotai';
7
- import { ChatElementDisplayLocationV3, VariantTypeEnum, } from '@envive-ai/react-hooks/application/models';
8
- import { variantInfoAtom } from '@envive-ai/react-hooks/atoms/app';
9
- import { EnviveMetricsEventName } from '@envive-ai/react-hooks/contexts/amplitudeContext';
10
- import { useWidgetInteraction } from '@envive-ai/react-hooks/hooks/WidgetInteraction';
11
- import { WidgetInteractionComponent, WidgetInteractionType, } from '@envive-ai/react-hooks/hooks/WidgetInteraction/types';
12
- import { ChatPreviewComparison } from '@envive-ai/react-toolkit-v3/ChatPreviewComparison';
13
- import { usePromptCarouselAnalytics } from '@envive-ai/react-toolkit-v3/PromptCarousel';
14
- import { Theme } from '@envive-ai/react-toolkit-v3/Tokens';
15
- import { useCallback, useMemo } from 'react';
16
- import { withBaseWidget } from '../../hocs/withBaseWidget/withBaseWidget';
17
- import { ChatPreviewLoadingWidgetWithBaseWidget } from '../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget';
18
- import { getMessageText, getRecentProductImageUrls } from '../utils/functions';
19
- const ChatPreviewComparisonWidgetHandler = (props) => {
20
- const { onSuggestionClicked } = useSalesAgent();
21
- const { openChat } = useChatToggle();
22
- const { trackWidgetInteraction } = useWidgetInteraction();
23
- const { onClick: onPromptClicked, onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd, } = usePromptCarouselAnalytics(WidgetInteractionComponent.POST_INTERACTION_COMPARISON, text => text);
24
- const lastAssistantMessage = useAtomValue(lastAssistantMessageAtom);
25
- const variantInfo = useAtomValue(variantInfoAtom);
26
- const productId = variantInfo.variant === VariantTypeEnum.Pdp ? variantInfo.productId : undefined;
27
- const { suggestions } = useAtomValue(chatAtom);
28
- const messageText = useMemo(() => getMessageText(lastAssistantMessage), [lastAssistantMessage]);
29
- const productImageUrls = useMemo(() => (lastAssistantMessage ? getRecentProductImageUrls(lastAssistantMessage, productId) : []), [lastAssistantMessage, productId]);
30
- const images = useMemo(() => productImageUrls
31
- ? productImageUrls.map((url, index) => ({ src: url, alt: `Product Image ${index + 1}` }))
32
- : [], [productImageUrls]);
33
- const { hardcopyContent, widgetConfig, uiConfig, isLoading, widgetConfigId } = props;
34
- const chatPreviewComparisonWidgetConfig = widgetConfig;
35
- const id = widgetConfig?.contentId;
36
- const hardCopyContent = {
37
- titleLabel: hardcopyContent?.values?.titleLabel,
38
- headlineText: hardcopyContent?.values?.headlineText,
39
- textFieldPlaceholderText: hardcopyContent?.values?.textFieldPlaceholderText,
40
- messageText,
41
- };
42
- const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
43
- const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
44
- const handlePromptButtonClick = useCallback((suggestion) => {
45
- onSuggestionClicked(suggestion, ChatElementDisplayLocationV3.CHAT_PREVIEW_COMPARISON_PROMPT_BUTTON);
46
- openChat(ChatElementDisplayLocationV3.CHAT_PREVIEW_COMPARISON_PROMPT_BUTTON);
47
- onPromptClicked(suggestion.id);
48
- }, [onSuggestionClicked, openChat]);
49
- const handleTextFieldClick = useCallback(() => {
50
- openChat(ChatElementDisplayLocationV3.CHAT_PREVIEW_COMPARISON_TEXT_FIELD);
51
- trackWidgetInteraction({
52
- eventName: EnviveMetricsEventName.WidgetInteraction,
53
- trigger: {
54
- widget: WidgetInteractionComponent.POST_INTERACTION_COMPARISON,
55
- widget_interaction: WidgetInteractionType.QUERY_INPUT_CLICKED,
56
- },
57
- });
58
- }, [openChat]);
59
- const handleLinkClick = (url) => {
60
- trackWidgetInteraction({
61
- eventName: EnviveMetricsEventName.WidgetInteraction,
62
- trigger: {
63
- widget: WidgetInteractionComponent.POST_INTERACTION_COMPARISON,
64
- widget_interaction: WidgetInteractionType.LINK_CLICKED,
65
- widget_interaction_data: {
66
- link_clicked: {
67
- url,
68
- },
69
- },
70
- },
71
- });
72
- };
73
- if (isLoading) {
74
- return (_jsx(ChatPreviewLoadingWidgetWithBaseWidget, { widgetConfigId: widgetConfigId, widgetType: WidgetTypeV3.ChatPreviewLoadingV3 }));
75
- }
76
- const widgetStyleProps = {
77
- theme: Theme.GLOBAL_CUSTOM,
78
- variant: chatPreviewComparisonWidgetConfig?.variant,
79
- hideImage: images?.length === 0 || images === undefined
80
- ? true
81
- : chatPreviewComparisonWidgetConfig?.hideImage,
82
- hideTextField: chatPreviewComparisonWidgetConfig?.hideTextField,
83
- hideLogo,
84
- hexCardColor: chatPreviewComparisonWidgetConfig?.hexCardColor,
85
- };
86
- const widgetContentProps = {
87
- titleLabel: hardCopyContent?.titleLabel,
88
- headlineText: hardCopyContent?.headlineText,
89
- messageText: hardCopyContent?.messageText,
90
- promptButtons: suggestions,
91
- textFieldPlaceholderText: hardCopyContent?.textFieldPlaceholderText,
92
- images: images ?? [],
93
- logoSrc: logoSrc ?? undefined,
94
- };
95
- const widgetEventProps = {
96
- handlePromptButtonClick,
97
- handlePromptButtonDrag: onDrag,
98
- handlePromptButtonHover: onHover,
99
- handlePromptButtonMouseDown: onMouseDown,
100
- handlePromptButtonMouseUp: onMouseUp,
101
- handlePromptButtonTouchStart: onTouchStart,
102
- handlePromptButtonTouchEnd: onTouchEnd,
103
- handleLinkClick,
104
- handleTextFieldClick,
105
- };
106
- return (_jsx(ChatPreviewComparison, { baseProps: { id }, widgetStyleProps: widgetStyleProps, widgetContentProps: widgetContentProps, widgetEventProps: widgetEventProps }));
107
- };
108
- export const ChatPreviewComparisonWidgetWithBaseWidget = withBaseWidget(ChatPreviewComparisonWidgetHandler);
109
- export const ChatPreviewComparisonWidget = ({ widgetConfigId, }) => {
110
- return (_jsx(ChatPreviewComparisonWidgetWithBaseWidget, { widgetConfigId: widgetConfigId, widgetType: WidgetTypeV3.ChatPreviewComparisonV3 }));
111
- };
112
- ChatPreviewComparisonWidget.displayName = 'ChatPreviewComparisonWidget';
@@ -1,3 +0,0 @@
1
- import { ChatPreviewComparisonWidget, ChatPreviewComparisonWidgetWithBaseWidget } from './ChatPreviewComparisonWidget';
2
- export { ChatPreviewComparisonWidget, ChatPreviewComparisonWidgetWithBaseWidget };
3
- export type { ChatPreviewComparisonWidgetProps } from './ChatPreviewComparisonWidget';
@@ -1,2 +0,0 @@
1
- import { ChatPreviewComparisonWidget, ChatPreviewComparisonWidgetWithBaseWidget, } from './ChatPreviewComparisonWidget';
2
- export { ChatPreviewComparisonWidget, ChatPreviewComparisonWidgetWithBaseWidget };
@@ -1,9 +0,0 @@
1
- import { BaseWidgetProps } from '../../hocs/withBaseWidget/types';
2
- export declare const ChatPreviewLoadingWidgetWithBaseWidget: {
3
- (props: BaseWidgetProps): import("react/jsx-runtime").JSX.Element;
4
- displayName: string;
5
- };
6
- export interface ChatPreviewLoadingWidgetProps {
7
- widgetConfigId: string;
8
- }
9
- export declare const ChatPreviewLoadingWidget: ({ widgetConfigId }: ChatPreviewLoadingWidgetProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,34 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { WidgetTypeV3, } from '@envive-ai/react-hooks/contexts/typesV3';
3
- import { useAtomValue } from 'jotai';
4
- import { ChatPreviewLoading } from '@envive-ai/react-toolkit-v3/ChatPreviewLoading';
5
- import { chatPreviewLoadingDataAtom } from '@envive-ai/react-hooks/atoms/widget';
6
- import { withBaseWidget } from '../../hocs/withBaseWidget/withBaseWidget';
7
- import { PromptCarouselWidget } from '../PromptCarouselWidget/PromptCarouselWidget';
8
- const ChatPreviewLoadingWidgetHandler = (props) => {
9
- const { widgetConfig, isLoading, widgetConfigId, hardcopyContent, uiConfig } = props;
10
- const chatPreviewLoadingWidgetConfig = widgetConfig;
11
- const id = widgetConfig?.contentId;
12
- const chatPreviewLoadingDataMap = useAtomValue(chatPreviewLoadingDataAtom);
13
- const chatPreviewLoadingData = chatPreviewLoadingDataMap[widgetConfigId] ?? undefined;
14
- const isCacheEmpty = !chatPreviewLoadingData ||
15
- Object.values(chatPreviewLoadingData).every(value => value === undefined) ||
16
- Object.keys(chatPreviewLoadingData).length === 0;
17
- if (isLoading && isCacheEmpty) {
18
- return _jsx(ChatPreviewLoading, { fullIsLoading: true });
19
- }
20
- const titleLabel = hardcopyContent?.values?.titleLabel ?? chatPreviewLoadingData?.titleLabel;
21
- const textFieldPlaceholder = hardcopyContent?.values?.textFieldPlaceholderText ??
22
- chatPreviewLoadingData?.textFieldPlaceholder;
23
- const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo ?? chatPreviewLoadingData?.hideLogo;
24
- const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc ?? chatPreviewLoadingData?.logoSrc;
25
- const variant = chatPreviewLoadingWidgetConfig?.variant ?? chatPreviewLoadingData?.variant;
26
- const hexCardColor = chatPreviewLoadingWidgetConfig?.hexCardColor ?? chatPreviewLoadingData?.hexCardColor;
27
- const hideTextField = chatPreviewLoadingWidgetConfig?.hideTextField ?? chatPreviewLoadingData?.hideTextField;
28
- return (_jsx(ChatPreviewLoading, { id: id, variant: variant, hexCardColor: hexCardColor, hideTextField: hideTextField, textFieldPlaceholder: textFieldPlaceholder, hideLogo: hideLogo, logoSrc: logoSrc, titleLabel: titleLabel }));
29
- };
30
- export const ChatPreviewLoadingWidgetWithBaseWidget = withBaseWidget(ChatPreviewLoadingWidgetHandler);
31
- export const ChatPreviewLoadingWidget = ({ widgetConfigId }) => {
32
- return (_jsx(ChatPreviewLoadingWidgetWithBaseWidget, { widgetConfigId: widgetConfigId, widgetType: WidgetTypeV3.ChatPreviewLoadingV3 }));
33
- };
34
- PromptCarouselWidget.displayName = 'PromptCarouselWidget';
@@ -1,3 +0,0 @@
1
- import { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetWithBaseWidget } from './ChatPreviewLoadingWidget';
2
- export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetWithBaseWidget };
3
- export type { ChatPreviewLoadingWidgetProps } from './ChatPreviewLoadingWidget';
@@ -1,2 +0,0 @@
1
- import { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetWithBaseWidget, } from './ChatPreviewLoadingWidget';
2
- export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetWithBaseWidget };
@@ -1,12 +0,0 @@
1
- import { BaseWidgetProps } from '../../hocs/withBaseWidget/types';
2
- export declare const ChatPreviewWidgetWithBaseWidget: {
3
- (props: BaseWidgetProps): import("react/jsx-runtime").JSX.Element;
4
- displayName: string;
5
- };
6
- export interface ChatPreviewWidgetProps {
7
- widgetConfigId: string;
8
- }
9
- export declare const ChatPreviewWidget: {
10
- ({ widgetConfigId }: ChatPreviewWidgetProps): import("react/jsx-runtime").JSX.Element;
11
- displayName: string;
12
- };
@@ -1,111 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { chatAtom, lastAssistantMessageAtom } from '@envive-ai/react-hooks/atoms/chat';
3
- import { useSalesAgent } from '@envive-ai/react-hooks/contexts/salesAgentContext';
4
- import { WidgetTypeV3 } from '@envive-ai/react-hooks/contexts/typesV3';
5
- import { useChatToggle } from '@envive-ai/react-hooks/hooks/ChatToggle';
6
- import { useAtomValue } from 'jotai';
7
- import { Theme } from '@envive-ai/react-toolkit-v3/Tokens';
8
- import { ChatElementDisplayLocationV3, } from '@envive-ai/react-hooks/application/models';
9
- import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude, } from '@envive-ai/react-hooks/contexts/amplitudeContext';
10
- import { useWidgetInteraction } from '@envive-ai/react-hooks/hooks/WidgetInteraction';
11
- import { WidgetInteractionComponent, WidgetInteractionType, } from '@envive-ai/react-hooks/hooks/WidgetInteraction/types';
12
- import { ChatPreview } from '@envive-ai/react-toolkit-v3/ChatPreview';
13
- import { usePromptCarouselAnalytics } from '@envive-ai/react-toolkit-v3/PromptCarousel';
14
- import { useCallback, useEffect, useMemo } from 'react';
15
- import { withBaseWidget } from '../../hocs/withBaseWidget/withBaseWidget';
16
- import { ChatPreviewLoadingWidgetWithBaseWidget } from '../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget';
17
- import { getMessageText } from '../utils/functions';
18
- const ChatPreviewWidgetHandler = (props) => {
19
- const { onSuggestionClicked } = useSalesAgent();
20
- const { openChat } = useChatToggle();
21
- const lastAssistantMessage = useAtomValue(lastAssistantMessageAtom);
22
- const { suggestions } = useAtomValue(chatAtom);
23
- const messageText = useMemo(() => getMessageText(lastAssistantMessage), [lastAssistantMessage]);
24
- const { hardcopyContent, widgetConfig, uiConfig, isLoading, widgetConfigId } = props;
25
- const chatPreviewWidgetConfig = widgetConfig;
26
- const id = widgetConfig?.contentId;
27
- const hardCopyContent = {
28
- titleLabel: hardcopyContent?.values?.titleLabel,
29
- textFieldPlaceholderText: hardcopyContent?.values?.textFieldPlaceholderText,
30
- promptButtons: suggestions,
31
- messageText,
32
- };
33
- const { trackEvent } = useAmplitude();
34
- const { trackWidgetInteraction } = useWidgetInteraction();
35
- const { onClick: onPromptClicked, onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd, } = usePromptCarouselAnalytics(WidgetInteractionComponent.CHAT_PREVIEW, text => text);
36
- useEffect(() => {
37
- // TODO: -Add Widget Interaction here
38
- trackEvent({
39
- eventName: SpiffyMetricsEventName.ChatComponentVisible,
40
- eventProps: {
41
- widget_config_id: widgetConfigId,
42
- widget_type: WidgetTypeV3.ChatPreviewV3,
43
- },
44
- });
45
- }, [trackEvent, widgetConfigId]);
46
- const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
47
- const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
48
- const handlePromptButtonClick = useCallback((suggestion) => {
49
- onSuggestionClicked(suggestion, ChatElementDisplayLocationV3.CHAT_PREVIEW_PROMPT_BUTTON);
50
- openChat(ChatElementDisplayLocationV3.CHAT_PREVIEW_PROMPT_BUTTON);
51
- onPromptClicked(suggestion.id);
52
- }, [onSuggestionClicked, openChat]);
53
- const handleTextFieldClick = useCallback(() => {
54
- openChat(ChatElementDisplayLocationV3.CHAT_PREVIEW_TEXT_FIELD);
55
- trackWidgetInteraction({
56
- eventName: EnviveMetricsEventName.WidgetInteraction,
57
- trigger: {
58
- widget: WidgetInteractionComponent.CHAT_PREVIEW,
59
- widget_interaction: WidgetInteractionType.QUERY_INPUT_CLICKED,
60
- },
61
- });
62
- }, [openChat]);
63
- const handleLinkClick = (url) => {
64
- trackWidgetInteraction({
65
- eventName: EnviveMetricsEventName.WidgetInteraction,
66
- trigger: {
67
- widget: WidgetInteractionComponent.CHAT_PREVIEW,
68
- widget_interaction: WidgetInteractionType.LINK_CLICKED,
69
- widget_interaction_data: {
70
- link_clicked: {
71
- url,
72
- },
73
- },
74
- },
75
- });
76
- };
77
- if (isLoading) {
78
- return (_jsx(ChatPreviewLoadingWidgetWithBaseWidget, { widgetConfigId: widgetConfigId, widgetType: WidgetTypeV3.ChatPreviewLoadingV3 }));
79
- }
80
- const widgetStyleProps = {
81
- theme: Theme.GLOBAL_CUSTOM,
82
- variant: chatPreviewWidgetConfig?.variant,
83
- hideTextField: chatPreviewWidgetConfig?.hideTextField,
84
- hideLogo,
85
- hexCardColor: chatPreviewWidgetConfig?.hexCardColor,
86
- };
87
- const widgetContentProps = {
88
- titleLabel: hardCopyContent?.titleLabel,
89
- messageText: hardCopyContent?.messageText,
90
- promptButtons: hardCopyContent?.promptButtons,
91
- textFieldPlaceholderText: hardCopyContent?.textFieldPlaceholderText,
92
- logoSrc: logoSrc ?? undefined,
93
- };
94
- const widgetEventProps = {
95
- handlePromptButtonClick,
96
- handlePromptButtonDrag: onDrag,
97
- handlePromptButtonHover: onHover,
98
- handlePromptButtonMouseDown: onMouseDown,
99
- handlePromptButtonMouseUp: onMouseUp,
100
- handlePromptButtonTouchStart: onTouchStart,
101
- handlePromptButtonTouchEnd: onTouchEnd,
102
- handleLinkClick,
103
- handleTextFieldClick,
104
- };
105
- return (_jsx(ChatPreview, { baseProps: { id }, widgetStyleProps: widgetStyleProps, widgetContentProps: widgetContentProps, widgetEventProps: widgetEventProps }));
106
- };
107
- export const ChatPreviewWidgetWithBaseWidget = withBaseWidget(ChatPreviewWidgetHandler);
108
- export const ChatPreviewWidget = ({ widgetConfigId }) => {
109
- return (_jsx(ChatPreviewWidgetWithBaseWidget, { widgetConfigId: widgetConfigId, widgetType: WidgetTypeV3.ChatPreviewV3 }));
110
- };
111
- ChatPreviewWidget.displayName = 'ChatPreviewWidget';
@@ -1,97 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render, waitFor } from '@testing-library/react';
3
- import { SpiffyMetricsEventName } from '@envive-ai/react-hooks/contexts/amplitudeContext';
4
- import { WidgetTypeV3 } from '@envive-ai/react-hooks/contexts/typesV3';
5
- import { UserEventCategory } from '@spiffy-ai/commerce-api-client';
6
- import { ChatPreviewWidget } from '../ChatPreviewWidget';
7
- const mockTrackEvent = vi.fn();
8
- const mockGetHardcopy = vi.fn();
9
- vi.mock('@envive-ai/react-toolkit-v3/ChatPreview', () => ({
10
- ChatPreview: () => _jsx("div", { "data-testid": "chat-preview-mock", children: "Chat Preview" }),
11
- }));
12
- vi.mock('@envive-ai/react-hooks/contexts/amplitudeContext', () => ({
13
- useAmplitude: () => ({
14
- trackEvent: mockTrackEvent,
15
- isReady: true,
16
- }),
17
- SpiffyMetricsEventName: {
18
- ChatComponentVisible: 'Chat Component Visible',
19
- SearchComponentVisible: 'Search Component Visible',
20
- },
21
- }));
22
- vi.mock('@envive-ai/react-hooks/contexts/hardcopyContext', () => ({
23
- useHardcopy: () => ({
24
- getHardcopy: mockGetHardcopy,
25
- }),
26
- }));
27
- vi.mock('@envive-ai/react-hooks/contexts/pageContext', () => ({
28
- usePage: () => ({
29
- userEvent: {
30
- id: 'test-user-event-id',
31
- category: UserEventCategory.PageVisit,
32
- created_at: '2025-01-01T00:00:00Z',
33
- event_id: 'test-event-id',
34
- },
35
- }),
36
- }));
37
- vi.mock('@envive-ai/react-hooks/contexts/widgetConfigContext', () => ({
38
- useWidgetConfig: () => ({
39
- getWidgetConfig: vi.fn().mockResolvedValue({}),
40
- }),
41
- }));
42
- vi.mock('@envive-ai/react-hooks/contexts/uiConfigContext', () => ({
43
- useUiConfig: () => ({
44
- getUiConfig: vi.fn().mockResolvedValue({}),
45
- }),
46
- }));
47
- vi.mock('@envive-ai/react-hooks/contexts/salesAgentContext', () => ({
48
- useSalesAgent: () => ({
49
- onSuggestionClicked: vi.fn(),
50
- }),
51
- }));
52
- vi.mock('@envive-ai/react-hooks/hooks/ChatToggle', () => ({
53
- useChatToggle: () => ({
54
- openChat: vi.fn(),
55
- }),
56
- }));
57
- vi.mock('@envive-ai/react-hooks/atoms/chat', () => ({
58
- chatAtom: {},
59
- lastAssistantMessageAtom: {},
60
- }));
61
- vi.mock('jotai', async (importOriginal) => {
62
- const actual = await importOriginal();
63
- return {
64
- ...actual,
65
- useAtomValue: vi
66
- .fn()
67
- .mockReturnValueOnce([])
68
- .mockReturnValueOnce({ messages: [], suggestions: [] })
69
- .mockReturnValue([]),
70
- };
71
- });
72
- describe('ChatPreviewWidget analytics', () => {
73
- const defaultHardcopy = {
74
- responseId: 'test-response-id',
75
- language: 'en',
76
- values: {
77
- titleLabel: 'Chat Preview',
78
- textFieldPlaceholderText: 'Type here',
79
- },
80
- };
81
- beforeEach(() => {
82
- vi.clearAllMocks();
83
- mockGetHardcopy.mockResolvedValue(defaultHardcopy);
84
- });
85
- it('should track ChatComponentVisible when widget mounts', async () => {
86
- render(_jsx(ChatPreviewWidget, { widgetConfigId: "test-config-1" }));
87
- await waitFor(() => {
88
- expect(mockTrackEvent).toHaveBeenCalledWith({
89
- eventName: SpiffyMetricsEventName.ChatComponentVisible,
90
- eventProps: {
91
- widget_config_id: 'test-config-1',
92
- widget_type: WidgetTypeV3.ChatPreviewV3,
93
- },
94
- });
95
- }, { timeout: 3000 });
96
- }, 5000);
97
- });
@@ -1,3 +0,0 @@
1
- import { ChatPreviewWidget, ChatPreviewWidgetWithBaseWidget } from './ChatPreviewWidget';
2
- export { ChatPreviewWidget, ChatPreviewWidgetWithBaseWidget };
3
- export type { ChatPreviewWidgetProps } from './ChatPreviewWidget';
@@ -1,2 +0,0 @@
1
- import { ChatPreviewWidget, ChatPreviewWidgetWithBaseWidget } from './ChatPreviewWidget';
2
- export { ChatPreviewWidget, ChatPreviewWidgetWithBaseWidget };
@@ -1,14 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export interface FloatingChatOverlayProps {
3
- children?: ReactNode;
4
- isOpened: boolean;
5
- onClose: () => void;
6
- className?: string;
7
- dataTestId?: string;
8
- previewMode?: boolean;
9
- isResultsModalOpen?: boolean;
10
- }
11
- export declare const FloatingChatOverlay: {
12
- ({ children, isOpened, onClose, className, dataTestId, previewMode, isResultsModalOpen, }: FloatingChatOverlayProps): import("react/jsx-runtime").JSX.Element;
13
- displayName: string;
14
- };