@envive-ai/react-widgets-v3 0.3.13 → 0.3.15-beta.0

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 (143) hide show
  1. package/dist/CXIntegration/implementations/useHelpScoutUnifiedCXButton.cjs +65 -0
  2. package/dist/CXIntegration/implementations/useHelpScoutUnifiedCXButton.js +64 -0
  3. package/dist/CXIntegration/implementations/useTalkdeskUnifiedCXButton.cjs +64 -0
  4. package/dist/CXIntegration/implementations/useTalkdeskUnifiedCXButton.js +63 -0
  5. package/dist/CXIntegration/types.cjs +2 -0
  6. package/dist/CXIntegration/types.js +2 -0
  7. package/dist/CXIntegration/utils/functions.cjs +4 -0
  8. package/dist/CXIntegration/utils/functions.js +4 -0
  9. package/dist/hocs/withBaseWidget/types.d.cts +3 -3
  10. package/dist/hocs/withBaseWidget/types.d.ts +5 -3
  11. package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +2 -2
  12. package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
  13. package/dist/hooks/dist/application/models/api/widgetText.d.cts +8 -0
  14. package/dist/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.cts +12 -0
  15. package/dist/hooks/dist/contexts/types.d.cts +38 -0
  16. package/dist/hooks/dist/contexts/typesV3.d.cts +239 -0
  17. package/dist/hooks/dist/services/amplitudeService/eventNames.d.cts +43 -0
  18. package/dist/hooks/dist/types/customerService.d.cts +21 -0
  19. package/dist/packages/hooks/dist/application/models/api/orgConfigResults.d.ts +1 -0
  20. package/dist/packages/hooks/dist/application/models/api/widgetText.d.ts +8 -0
  21. package/dist/packages/hooks/dist/application/models/frontendConfig.d.ts +1 -0
  22. package/dist/packages/hooks/dist/contexts/amplitudeContext/amplitudeContext.d.ts +2 -0
  23. package/dist/packages/hooks/dist/contexts/amplitudeContext/index.d.ts +2 -0
  24. package/dist/packages/hooks/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.d.ts +2 -0
  25. package/dist/packages/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.ts +14 -0
  26. package/dist/packages/hooks/dist/contexts/hardcopyContext/index.d.ts +1 -0
  27. package/dist/packages/hooks/dist/contexts/types.d.ts +42 -0
  28. package/dist/packages/hooks/dist/contexts/typesV3.d.ts +239 -0
  29. package/dist/packages/hooks/dist/services/amplitudeService/amplitudeService.d.ts +1 -0
  30. package/dist/packages/hooks/dist/services/amplitudeService/eventNames.d.ts +43 -0
  31. package/dist/packages/hooks/dist/types/customerService.d.ts +21 -0
  32. package/dist/packages/widgets/dist/SearchResults/SearchResults.d.ts +3 -2
  33. package/dist/packages/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.ts +2 -2
  34. package/dist/packages/widgets/dist/SearchZeroState/index.d.ts +2 -1
  35. package/dist/packages/widgets/dist/SearchZeroState/types.d.ts +2 -2
  36. package/dist/packages/widgets/dist/SuggestionBar/SuggestionBar.d.ts +3 -3
  37. package/dist/packages/widgets/dist/SuggestionButtonContainer/index.d.ts +2 -0
  38. package/dist/packages/widgets/dist/SuggestionButtonContainer/types.d.ts +3 -2
  39. package/dist/packages/widgets/dist/packages/hooks/dist/application/models/api/response.d.ts +14 -0
  40. package/dist/packages/widgets/dist/packages/hooks/dist/application/models/api/search.d.ts +15 -0
  41. package/dist/packages/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCase.d.ts +73 -0
  42. package/dist/packages/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts +61 -0
  43. package/dist/packages/widgets/dist/packages/hooks/dist/application/models/utilityTypes/internal.d.ts +25 -0
  44. package/dist/packages/widgets/dist/packages/hooks/dist/application/models/utilityTypes/splitWords.d.ts +35 -0
  45. package/dist/packages/widgets/dist/packages/hooks/dist/application/models/utilityTypes/trim.d.ts +32 -0
  46. package/dist/packages/widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.ts +32 -0
  47. package/dist/packages/widgets/dist/packages/hooks/dist/application/models/variantInfo/variantInfo.d.ts +1 -0
  48. package/dist/packages/widgets/dist/packages/hooks/dist/atoms/search/searchAPI.d.ts +15 -0
  49. package/dist/packages/widgets/dist/packages/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.ts +1 -0
  50. package/dist/packages/widgets/dist/packages/hooks/dist/contexts/types.d.ts +63 -0
  51. package/dist/packages/widgets/dist/packages/hooks/dist/hooks/Search/useSearch.d.ts +60 -0
  52. package/dist/packages/widgets/dist/packages/hooks/dist/hooks/utils.d.ts +13 -0
  53. package/dist/packages/widgets/dist/packages/hooks/dist/types/OrgInfo.d.ts +1 -0
  54. package/dist/packages/widgets/dist/packages/hooks/dist/types/index.d.ts +1 -0
  55. package/dist/packages/widgets/dist/packages/hooks/dist/types/search-filter-types.d.ts +28 -0
  56. package/dist/packages/widgets/dist/packages/hooks/dist/types/test-types.d.ts +10 -0
  57. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
  58. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
  59. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
  60. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
  61. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
  62. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +29 -5
  63. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
  64. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +2 -2
  65. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +30 -6
  66. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +2 -2
  67. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
  68. package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +19 -3
  69. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
  70. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
  71. package/dist/widgets/ProductCardWidget/ProductCardWidget.js +20 -4
  72. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +10 -0
  73. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
  74. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
  75. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +12 -2
  76. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +15 -10
  77. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
  78. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
  79. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +16 -11
  80. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
  81. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
  82. package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +10 -0
  83. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
  84. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
  85. package/dist/widgets/SocialProofWidget/SocialProofWidget.js +12 -2
  86. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +11 -0
  87. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
  88. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
  89. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +12 -1
  90. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
  91. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
  92. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +23 -3
  93. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
  94. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
  95. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +24 -4
  96. package/dist/widgets/dist/SearchResults/SearchResults.d.cts +3 -2
  97. package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.cts +2 -2
  98. package/dist/widgets/dist/SearchZeroState/types.d.cts +2 -2
  99. package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.cts +3 -3
  100. package/dist/widgets/dist/SuggestionButtonContainer/types.d.cts +3 -2
  101. package/dist/widgets/dist/packages/hooks/dist/application/models/api/response.d.cts +14 -0
  102. package/dist/widgets/dist/packages/hooks/dist/application/models/api/search.d.cts +15 -0
  103. package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCase.d.cts +73 -0
  104. package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.cts +61 -0
  105. package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/internal.d.cts +25 -0
  106. package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/splitWords.d.cts +35 -0
  107. package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/trim.d.cts +32 -0
  108. package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.cts +32 -0
  109. package/dist/widgets/dist/packages/hooks/dist/atoms/search/searchAPI.d.cts +14 -0
  110. package/dist/widgets/dist/packages/hooks/dist/contexts/types.d.cts +61 -0
  111. package/dist/widgets/dist/packages/hooks/dist/hooks/Search/useSearch.d.cts +60 -0
  112. package/dist/widgets/dist/packages/hooks/dist/hooks/utils.d.cts +12 -0
  113. package/dist/widgets/dist/packages/hooks/dist/types/search-filter-types.d.cts +28 -0
  114. package/dist/widgets/dist/packages/hooks/dist/types/test-types.d.cts +10 -0
  115. package/dist/widgets/utils/functions.cjs +9 -0
  116. package/dist/widgets/utils/functions.js +9 -1
  117. package/dist/widgets-v2/SearchZeroState/index.d.cts +2 -1
  118. package/dist/widgets-v2/SearchZeroState/index.d.ts +2 -1
  119. package/dist/widgets-v2/SuggestionButtonContainer/index.d.ts +1 -0
  120. package/package.json +1 -1
  121. package/src/CXIntegration/implementations/useHelpScoutUnifiedCXButton.ts +108 -0
  122. package/src/CXIntegration/implementations/useTalkdeskUnifiedCXButton.ts +94 -0
  123. package/src/CXIntegration/types.ts +2 -0
  124. package/src/CXIntegration/utils/functions.ts +8 -0
  125. package/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.tsx +15 -3
  126. package/src/widgets/ChatPreviewWidget/__tests__/ChatPreviewWidget.test.tsx +114 -0
  127. package/src/widgets/FloatingChatWidget/FloatingChatWidget.tsx +56 -15
  128. package/src/widgets/FloatingChatWidget/__tests__/FloatingChatWidget.test.tsx +119 -0
  129. package/src/widgets/ProductCardWidget/ProductCardWidget.tsx +15 -3
  130. package/src/widgets/ProductCardWidget/__tests__/ProductCardWidget.test.tsx +144 -0
  131. package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +12 -1
  132. package/src/widgets/PromptButtonCarouselWithImageWidget/__tests__/PromptButtonCarouselWithImageWidget.test.tsx +179 -0
  133. package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +33 -23
  134. package/src/widgets/PromptCarouselWidget/__tests__/PromptCarouselWidget.test.tsx +150 -0
  135. package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +12 -1
  136. package/src/widgets/SocialProofWidget/__tests__/SocialProofWidget.test.tsx +184 -0
  137. package/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx +12 -0
  138. package/src/widgets/TitledPromptCarouselWidget/__tests__/TitledPromptCarouselWidget.test.tsx +150 -0
  139. package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +19 -2
  140. package/src/widgets/TypingAnimationWidget/__tests__/TypingAnimationWidget.test.tsx +163 -0
  141. package/src/widgets/__tests__/testUtils.tsx +63 -0
  142. package/src/widgets/__tests__/trackEventCanary.test.ts +45 -0
  143. package/src/widgets/utils/functions.ts +16 -0
@@ -1,21 +1,23 @@
1
1
  import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
2
2
  import "../../hocs/withBaseWidget/index.js";
3
3
  import { DebugBar } from "../../debug/debugBar.js";
4
- import { FloatingChatOverlay } from "./FloatingChatOverlay.js";
5
- import useGetWidgetStatus_default from "../hooks/useGetWidgetStatus.js";
6
4
  import { CustomerServiceType } from "../../CXIntegration/types.js";
7
5
  import { FLOATING_BUTTON_ID } from "./constants.js";
8
6
  import { useUnifiedCXButton } from "../../CXIntegration/hooks/useUnifiedCXButton.js";
7
+ import useGetWidgetStatus_default from "../hooks/useGetWidgetStatus.js";
8
+ import { FloatingChatOverlay } from "./FloatingChatOverlay.js";
9
9
  import { useFloatingButtonVisibility } from "./hooks/useFloatingButtonVisibility.js";
10
10
  import { useAutoPopup } from "./hooks/useAutoPopup.js";
11
11
  import { Suspense, lazy, useEffect, useMemo, useRef, useState } from "react";
12
- import { SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
12
+ import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
13
13
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
14
14
  import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
15
15
  import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
16
16
  import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
17
17
  import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
18
18
  import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
19
+ import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
20
+ import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
19
21
  import { FloatingButton } from "@envive-ai/react-toolkit-v3/FloatingButton";
20
22
 
21
23
  //#region src/widgets/FloatingChatWidget/FloatingChatWidget.tsx
@@ -42,15 +44,26 @@ const CXButtonProvider = ({ provider, enabled, suppressMerchantButton, onSwitchT
42
44
  const FloatingChatWidgetHandler = (props) => {
43
45
  const { previewButtonOnly, previewChatAlwaysOpen } = props;
44
46
  const salesAgentData = useSalesAgent();
47
+ const { trackWidgetInteraction } = useWidgetInteraction();
45
48
  const { userHasInteractedValue } = useGetWidgetStatus_default();
46
49
  const { uiConfig, isUiConfigLoading, hardcopyContent } = props;
47
50
  const { customerServiceIntegration, floatingButton, floatingChat } = uiConfig ?? {};
48
51
  const cxProvider = customerServiceIntegration?.provider ?? CustomerServiceType.unsupported;
49
- const { isOpen, openChat, closeChat } = useChatToggle();
52
+ const { isOpen, openChat, closeChat, onHover } = useChatToggle();
50
53
  const [isCXOpen, setIsCXOpen] = useState(false);
51
54
  useEffect(() => {
52
55
  if (isOpen) setIsCXOpen(false);
53
56
  }, [isOpen]);
57
+ const handleClose = (type) => {
58
+ trackWidgetInteraction({
59
+ eventName: EnviveMetricsEventName.WidgetInteraction,
60
+ trigger: {
61
+ widget: WidgetInteractionComponent.FLOATING_CHAT,
62
+ widget_interaction: WidgetInteractionType.WIDGET_COLLAPSED,
63
+ widget_interaction_data: { widget_collapsed: type }
64
+ }
65
+ });
66
+ };
54
67
  const { shouldShowFloatingButton } = useFloatingButtonVisibility({
55
68
  floatingButtonShowConfig: floatingButton?.showOption,
56
69
  isChatOpen: isOpen,
@@ -85,7 +98,10 @@ const FloatingChatWidgetHandler = (props) => {
85
98
  onCXClose: () => setIsCXOpen(false),
86
99
  children: ({ isSwitchEnabled, toggle }) => /* @__PURE__ */ jsxs(Fragment, { children: [(previewChatAlwaysOpen || effectiveIsOpen) && !previewButtonOnly && /* @__PURE__ */ jsx(FloatingChatOverlay, {
87
100
  isOpened: effectiveIsOpen,
88
- onClose: previewChatAlwaysOpen ? () => {} : () => closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_OVERLAY),
101
+ onClose: previewChatAlwaysOpen ? () => {} : () => {
102
+ closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_OVERLAY);
103
+ handleClose({ collapse_source: "body_click" });
104
+ },
89
105
  previewMode: !!previewChatAlwaysOpen,
90
106
  children: /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(FloatingChat, {
91
107
  theme,
@@ -97,7 +113,14 @@ const FloatingChatWidgetHandler = (props) => {
97
113
  isFloatingChatOpen: effectiveIsOpen,
98
114
  onToggleCXButton: toggle,
99
115
  debugBar: /* @__PURE__ */ jsx(DebugBar, {}),
100
- onClose: previewChatAlwaysOpen ? () => {} : () => closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON)
116
+ onSwipeClose: previewChatAlwaysOpen ? () => {} : () => {
117
+ closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON);
118
+ handleClose({ collapse_source: "swipe" });
119
+ },
120
+ onClose: previewChatAlwaysOpen ? () => {} : () => {
121
+ closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON);
122
+ handleClose({ collapse_source: "close_button" });
123
+ }
101
124
  }) })
102
125
  }), buttonShouldRender && /* @__PURE__ */ jsx(FloatingButton, {
103
126
  id: FLOATING_BUTTON_ID,
@@ -105,6 +128,7 @@ const FloatingChatWidgetHandler = (props) => {
105
128
  mode: floatingButton?.mode,
106
129
  backgroundColor: floatingButton?.backgroundColor,
107
130
  onClick: previewButtonOnly ? () => {} : () => openChat(ChatElementDisplayLocationV3.FLOATING_BUTTON),
131
+ onMouseOver: onHover,
108
132
  customIcon: floatingButton?.iconSVGSrc,
109
133
  show: floatingButton?.showOption,
110
134
  location: floatingButton?.position,
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime11 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime18 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts
4
4
 
@@ -8,7 +8,7 @@ interface FullPageSalesAgentBaseWidgetProps {
8
8
  declare const FullPageSalesAgentWidget: {
9
9
  ({
10
10
  widgetConfigId
11
- }: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime11.JSX.Element;
11
+ }: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime18.JSX.Element;
12
12
  displayName: string;
13
13
  };
14
14
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime12 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts
4
4
 
@@ -8,7 +8,7 @@ interface FullPageSalesAgentBaseWidgetProps {
8
8
  declare const FullPageSalesAgentWidget: {
9
9
  ({
10
10
  widgetConfigId
11
- }: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime12.JSX.Element;
11
+ }: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime9.JSX.Element;
12
12
  displayName: string;
13
13
  };
14
14
  //#endregion
@@ -1,6 +1,7 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
2
  const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget.cjs');
3
3
  require('../../hocs/withBaseWidget/index.cjs');
4
+ const require_functions = require('../utils/functions.cjs');
4
5
  let react = require("react");
5
6
  let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
6
7
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -50,14 +51,29 @@ const ProductCardWidgetHandler = (props) => {
50
51
  }
51
52
  });
52
53
  }, [trackEvent, widgetConfigId]);
53
- const handleSelect = (0, react.useCallback)((prompt) => {
54
+ const handleSelect = (0, react.useCallback)((text) => {
55
+ const rawValues = hardcopyContent?.rawValues;
56
+ const stringId = require_functions.getStringIdForText(rawValues, text);
57
+ trackEvent({
58
+ eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetTextClicked,
59
+ eventProps: {
60
+ response_id: hardcopyContent?.responseId,
61
+ string_id: stringId,
62
+ text
63
+ }
64
+ });
54
65
  onTypedMessageSubmitted({
55
- query: prompt,
66
+ query: text,
56
67
  userTyped: false,
57
68
  displayLocation: __envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.PRODUCT_CARD_PROMPT_BUTTON
58
69
  });
59
70
  openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.PRODUCT_CARD_PROMPT_BUTTON);
60
- }, [onTypedMessageSubmitted, openChat]);
71
+ }, [
72
+ hardcopyContent,
73
+ onTypedMessageSubmitted,
74
+ openChat,
75
+ trackEvent
76
+ ]);
61
77
  const handleInputClick = (0, react.useCallback)(() => {
62
78
  openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.PRODUCT_CARD_TEXT_FIELD);
63
79
  }, [openChat]);
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime14 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/ProductCardWidget/ProductCardWidget.d.ts
4
4
  interface ProductCardWidgetProps {
@@ -7,7 +7,7 @@ interface ProductCardWidgetProps {
7
7
  declare const ProductCardWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: ProductCardWidgetProps): react_jsx_runtime14.JSX.Element;
10
+ }: ProductCardWidgetProps): react_jsx_runtime1.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime9 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/ProductCardWidget/ProductCardWidget.d.ts
4
4
  interface ProductCardWidgetProps {
@@ -7,7 +7,7 @@ interface ProductCardWidgetProps {
7
7
  declare const ProductCardWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: ProductCardWidgetProps): react_jsx_runtime9.JSX.Element;
10
+ }: ProductCardWidgetProps): react_jsx_runtime8.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,7 +1,8 @@
1
1
  import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
2
2
  import "../../hocs/withBaseWidget/index.js";
3
+ import { getStringIdForText } from "../utils/functions.js";
3
4
  import { useCallback, useEffect } from "react";
4
- import { SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
5
+ import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
5
6
  import { jsx } from "react/jsx-runtime";
6
7
  import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
7
8
  import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
@@ -49,14 +50,29 @@ const ProductCardWidgetHandler = (props) => {
49
50
  }
50
51
  });
51
52
  }, [trackEvent, widgetConfigId]);
52
- const handleSelect = useCallback((prompt) => {
53
+ const handleSelect = useCallback((text) => {
54
+ const rawValues = hardcopyContent?.rawValues;
55
+ const stringId = getStringIdForText(rawValues, text);
56
+ trackEvent({
57
+ eventName: EnviveMetricsEventName.WidgetTextClicked,
58
+ eventProps: {
59
+ response_id: hardcopyContent?.responseId,
60
+ string_id: stringId,
61
+ text
62
+ }
63
+ });
53
64
  onTypedMessageSubmitted({
54
- query: prompt,
65
+ query: text,
55
66
  userTyped: false,
56
67
  displayLocation: ChatElementDisplayLocationV3.PRODUCT_CARD_PROMPT_BUTTON
57
68
  });
58
69
  openChat(ChatElementDisplayLocationV3.PRODUCT_CARD_PROMPT_BUTTON);
59
- }, [onTypedMessageSubmitted, openChat]);
70
+ }, [
71
+ hardcopyContent,
72
+ onTypedMessageSubmitted,
73
+ openChat,
74
+ trackEvent
75
+ ]);
60
76
  const handleInputClick = useCallback(() => {
61
77
  openChat(ChatElementDisplayLocationV3.PRODUCT_CARD_TEXT_FIELD);
62
78
  }, [openChat]);
@@ -37,6 +37,16 @@ const PromptButtonCarouselWithImageWidgetHandler = (props) => {
37
37
  });
38
38
  }, [trackEvent, widgetConfigId]);
39
39
  const handlePromptButtonClick = (0, react.useCallback)((text) => {
40
+ const rawValues = hardcopyContent?.rawValues;
41
+ const stringId = require_functions.getStringIdForText(rawValues, text);
42
+ trackEvent({
43
+ eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetTextClicked,
44
+ eventProps: {
45
+ response_id: hardcopyContent?.responseId,
46
+ string_id: stringId,
47
+ text
48
+ }
49
+ });
40
50
  onTypedMessageSubmitted({
41
51
  query: text,
42
52
  userTyped: false,
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
- import * as react_jsx_runtime4 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime12 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts
5
5
  declare const PromptButtonCarouselWithImageWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime4.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime12.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface PromptButtonCarouselWithImageWidgetProps {
@@ -12,7 +12,7 @@ interface PromptButtonCarouselWithImageWidgetProps {
12
12
  declare const PromptButtonCarouselWithImageWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime4.JSX.Element;
15
+ }: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime12.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
2
- import * as react_jsx_runtime2 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts
5
5
  declare const PromptButtonCarouselWithImageWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime2.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime6.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface PromptButtonCarouselWithImageWidgetProps {
@@ -12,7 +12,7 @@ interface PromptButtonCarouselWithImageWidgetProps {
12
12
  declare const PromptButtonCarouselWithImageWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime2.JSX.Element;
15
+ }: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime6.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,7 +1,7 @@
1
1
  import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
2
- import { getRecentProductImageUrls } from "../utils/functions.js";
2
+ import { getRecentProductImageUrls, getStringIdForText } from "../utils/functions.js";
3
3
  import { useCallback, useEffect, useMemo } from "react";
4
- import { SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
4
+ import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
7
7
  import { useAtomValue } from "jotai";
@@ -36,6 +36,16 @@ const PromptButtonCarouselWithImageWidgetHandler = (props) => {
36
36
  });
37
37
  }, [trackEvent, widgetConfigId]);
38
38
  const handlePromptButtonClick = useCallback((text) => {
39
+ const rawValues = hardcopyContent?.rawValues;
40
+ const stringId = getStringIdForText(rawValues, text);
41
+ trackEvent({
42
+ eventName: EnviveMetricsEventName.WidgetTextClicked,
43
+ eventProps: {
44
+ response_id: hardcopyContent?.responseId,
45
+ string_id: stringId,
46
+ text
47
+ }
48
+ });
39
49
  onTypedMessageSubmitted({
40
50
  query: text,
41
51
  userTyped: false,
@@ -1,6 +1,7 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
2
  const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget.cjs');
3
3
  require('../../hocs/withBaseWidget/index.cjs');
4
+ const require_functions = require('../utils/functions.cjs');
4
5
  let react = require("react");
5
6
  let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
6
7
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -9,18 +10,11 @@ let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/rea
9
10
  let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
10
11
  let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
11
12
  let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
12
- let __envive_ai_react_toolkit_v3_PromptCarousel_types_types = require("@envive-ai/react-toolkit-v3/PromptCarousel/types/types");
13
+ let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
13
14
  let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
15
+ let __envive_ai_react_toolkit_v3_PromptCarousel_types_types = require("@envive-ai/react-toolkit-v3/PromptCarousel/types/types");
14
16
 
15
17
  //#region src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx
16
- /** Finds the string_id (id) from raw widget text values for the given display text */
17
- function getStringIdForText(rawValues, text) {
18
- if (!rawValues) return void 0;
19
- for (const raw of Object.values(rawValues)) {
20
- const found = (Array.isArray(raw) ? raw : [raw]).find((s) => s.value === text);
21
- if (found) return found.id;
22
- }
23
- }
24
18
  const mockButtonTexts = [
25
19
  "Loading button 1",
26
20
  "Loading button 2",
@@ -32,6 +26,10 @@ const PromptCarouselWidgetHandler = (props) => {
32
26
  const { onTypedMessageSubmitted } = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)();
33
27
  const { openChat } = (0, __envive_ai_react_hooks_hooks_ChatToggle.useChatToggle)();
34
28
  const { hardcopyContent, widgetConfig, isLoading, widgetConfigId } = props;
29
+ const { onClick: onSuggestionClick, onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = (0, __envive_ai_react_toolkit_v3_PromptCarousel.usePromptCarouselAnalytics)(__envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.SUGGESTION_BAR, (text) => {
30
+ const rawValues = hardcopyContent?.rawValues;
31
+ return require_functions.getStringIdForText(rawValues, text);
32
+ });
35
33
  const promptButtonTexts = hardcopyContent?.values?.promptButtonTexts || [];
36
34
  const buttonTexts = isLoading ? mockButtonTexts : promptButtonTexts;
37
35
  const promptCarouselWidgetConfig = widgetConfig;
@@ -52,7 +50,8 @@ const PromptCarouselWidgetHandler = (props) => {
52
50
  }, [trackEvent, widgetConfigId]);
53
51
  const handleButtonClick = (0, react.useCallback)((text) => {
54
52
  const rawValues = hardcopyContent?.rawValues;
55
- const stringId = getStringIdForText(rawValues, text);
53
+ const stringId = require_functions.getStringIdForText(rawValues, text);
54
+ onSuggestionClick(stringId);
56
55
  trackEvent({
57
56
  eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetTextClicked,
58
57
  eventProps: {
@@ -83,6 +82,12 @@ const PromptCarouselWidgetHandler = (props) => {
83
82
  promptCarouselRows,
84
83
  animationSpeed,
85
84
  handleButtonClick,
85
+ handleButtonHover: onHover,
86
+ handleButtonDrag: onDrag,
87
+ handleButtonMouseUp: onMouseUp,
88
+ handleButtonMouseDown: onMouseDown,
89
+ handleButtonTouchStart: onTouchStart,
90
+ handleButtonTouchEnd: onTouchEnd,
86
91
  promptButtonTexts: buttonTexts
87
92
  });
88
93
  };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime6 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts
4
4
  interface PromptCarouselWidgetProps {
@@ -7,7 +7,7 @@ interface PromptCarouselWidgetProps {
7
7
  declare const PromptCarouselWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: PromptCarouselWidgetProps): react_jsx_runtime6.JSX.Element;
10
+ }: PromptCarouselWidgetProps): react_jsx_runtime2.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime15 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime5 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts
4
4
  interface PromptCarouselWidgetProps {
@@ -7,7 +7,7 @@ interface PromptCarouselWidgetProps {
7
7
  declare const PromptCarouselWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: PromptCarouselWidgetProps): react_jsx_runtime15.JSX.Element;
10
+ }: PromptCarouselWidgetProps): react_jsx_runtime5.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,5 +1,6 @@
1
1
  import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
2
2
  import "../../hocs/withBaseWidget/index.js";
3
+ import { getStringIdForText } from "../utils/functions.js";
3
4
  import { useCallback, useEffect } from "react";
4
5
  import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
5
6
  import { jsx } from "react/jsx-runtime";
@@ -8,18 +9,11 @@ import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext
8
9
  import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
9
10
  import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
10
11
  import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
11
- import { AnimationSpeed } from "@envive-ai/react-toolkit-v3/PromptCarousel/types/types";
12
- import { PromptCarousel } from "@envive-ai/react-toolkit-v3/PromptCarousel";
12
+ import { WidgetInteractionComponent } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
13
+ import { PromptCarousel, usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
14
+ import { AnimationSpeed as AnimationSpeed$1 } from "@envive-ai/react-toolkit-v3/PromptCarousel/types/types";
13
15
 
14
16
  //#region src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx
15
- /** Finds the string_id (id) from raw widget text values for the given display text */
16
- function getStringIdForText(rawValues, text) {
17
- if (!rawValues) return void 0;
18
- for (const raw of Object.values(rawValues)) {
19
- const found = (Array.isArray(raw) ? raw : [raw]).find((s) => s.value === text);
20
- if (found) return found.id;
21
- }
22
- }
23
17
  const mockButtonTexts = [
24
18
  "Loading button 1",
25
19
  "Loading button 2",
@@ -31,6 +25,10 @@ const PromptCarouselWidgetHandler = (props) => {
31
25
  const { onTypedMessageSubmitted } = useSalesAgent();
32
26
  const { openChat } = useChatToggle();
33
27
  const { hardcopyContent, widgetConfig, isLoading, widgetConfigId } = props;
28
+ const { onClick: onSuggestionClick, onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = usePromptCarouselAnalytics(WidgetInteractionComponent.SUGGESTION_BAR, (text) => {
29
+ const rawValues = hardcopyContent?.rawValues;
30
+ return getStringIdForText(rawValues, text);
31
+ });
34
32
  const promptButtonTexts = hardcopyContent?.values?.promptButtonTexts || [];
35
33
  const buttonTexts = isLoading ? mockButtonTexts : promptButtonTexts;
36
34
  const promptCarouselWidgetConfig = widgetConfig;
@@ -38,7 +36,7 @@ const PromptCarouselWidgetHandler = (props) => {
38
36
  const boldFirstButton = promptCarouselWidgetConfig?.boldFirstButton;
39
37
  const promptButtonType = promptCarouselWidgetConfig?.promptButtonType;
40
38
  const promptCarouselRows = promptCarouselWidgetConfig?.promptCarouselRows;
41
- const animationSpeed = isLoading ? AnimationSpeed.NONE : promptCarouselWidgetConfig?.animationSpeed;
39
+ const animationSpeed = isLoading ? AnimationSpeed$1.NONE : promptCarouselWidgetConfig?.animationSpeed;
42
40
  const { trackEvent } = useAmplitude();
43
41
  useEffect(() => {
44
42
  trackEvent({
@@ -52,6 +50,7 @@ const PromptCarouselWidgetHandler = (props) => {
52
50
  const handleButtonClick = useCallback((text) => {
53
51
  const rawValues = hardcopyContent?.rawValues;
54
52
  const stringId = getStringIdForText(rawValues, text);
53
+ onSuggestionClick(stringId);
55
54
  trackEvent({
56
55
  eventName: EnviveMetricsEventName.WidgetTextClicked,
57
56
  eventProps: {
@@ -82,6 +81,12 @@ const PromptCarouselWidgetHandler = (props) => {
82
81
  promptCarouselRows,
83
82
  animationSpeed,
84
83
  handleButtonClick,
84
+ handleButtonHover: onHover,
85
+ handleButtonDrag: onDrag,
86
+ handleButtonMouseUp: onMouseUp,
87
+ handleButtonMouseDown: onMouseDown,
88
+ handleButtonTouchStart: onTouchStart,
89
+ handleButtonTouchEnd: onTouchEnd,
85
90
  promptButtonTexts: buttonTexts
86
91
  });
87
92
  };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime3 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts
4
4
  interface SocialProofFlowWidgetProps {
@@ -7,7 +7,7 @@ interface SocialProofFlowWidgetProps {
7
7
  declare const SocialProofFlowWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: SocialProofFlowWidgetProps): react_jsx_runtime3.JSX.Element;
10
+ }: SocialProofFlowWidgetProps): react_jsx_runtime8.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime6 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts
4
4
  interface SocialProofFlowWidgetProps {
@@ -7,7 +7,7 @@ interface SocialProofFlowWidgetProps {
7
7
  declare const SocialProofFlowWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: SocialProofFlowWidgetProps): react_jsx_runtime6.JSX.Element;
10
+ }: SocialProofFlowWidgetProps): react_jsx_runtime2.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -66,6 +66,16 @@ const SocialProofWidgetHandler = (props) => {
66
66
  });
67
67
  }, [trackEvent, widgetConfigId]);
68
68
  const handlePrimaryButtonClick = (0, react.useCallback)((text) => {
69
+ const rawValues = hardcopyContent?.rawValues;
70
+ const stringId = require_functions.getStringIdForText(rawValues, text);
71
+ trackEvent({
72
+ eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetTextClicked,
73
+ eventProps: {
74
+ response_id: hardcopyContent?.responseId,
75
+ string_id: stringId,
76
+ text
77
+ }
78
+ });
69
79
  onTypedMessageSubmitted({
70
80
  query: text,
71
81
  userTyped: false,
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/SocialProofWidget/SocialProofWidget.d.ts
5
5
  declare const SocialProofWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime0.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime10.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface SocialProofWidgetProps {
@@ -12,7 +12,7 @@ interface SocialProofWidgetProps {
12
12
  declare const SocialProofWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: SocialProofWidgetProps): react_jsx_runtime0.JSX.Element;
15
+ }: SocialProofWidgetProps): react_jsx_runtime10.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/SocialProofWidget/SocialProofWidget.d.ts
5
5
  declare const SocialProofWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime0.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime3.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface SocialProofWidgetProps {
@@ -12,7 +12,7 @@ interface SocialProofWidgetProps {
12
12
  declare const SocialProofWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: SocialProofWidgetProps): react_jsx_runtime0.JSX.Element;
15
+ }: SocialProofWidgetProps): react_jsx_runtime3.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,7 +1,7 @@
1
1
  import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
2
- import { getProductImageUrl } from "../utils/functions.js";
2
+ import { getProductImageUrl, getStringIdForText } from "../utils/functions.js";
3
3
  import { useCallback, useEffect, useMemo } from "react";
4
- import { SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
4
+ import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
7
7
  import { useAtomValue, useSetAtom } from "jotai";
@@ -65,6 +65,16 @@ const SocialProofWidgetHandler = (props) => {
65
65
  });
66
66
  }, [trackEvent, widgetConfigId]);
67
67
  const handlePrimaryButtonClick = useCallback((text) => {
68
+ const rawValues = hardcopyContent?.rawValues;
69
+ const stringId = getStringIdForText(rawValues, text);
70
+ trackEvent({
71
+ eventName: EnviveMetricsEventName.WidgetTextClicked,
72
+ eventProps: {
73
+ response_id: hardcopyContent?.responseId,
74
+ string_id: stringId,
75
+ text
76
+ }
77
+ });
68
78
  onTypedMessageSubmitted({
69
79
  query: text,
70
80
  userTyped: false,
@@ -1,6 +1,7 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
2
  const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget.cjs');
3
3
  require('../../hocs/withBaseWidget/index.cjs');
4
+ const require_functions = require('../utils/functions.cjs');
4
5
  let react = require("react");
5
6
  let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
6
7
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -56,6 +57,16 @@ const TitledPromptCarouselWidgetHandler = (props) => {
56
57
  promptCarouselRows,
57
58
  animationSpeed,
58
59
  handleButtonClick: (0, react.useCallback)((text) => {
60
+ const rawValues = hardcopyContent?.rawValues;
61
+ const stringId = require_functions.getStringIdForText(rawValues, text);
62
+ trackEvent({
63
+ eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetTextClicked,
64
+ eventProps: {
65
+ response_id: hardcopyContent?.responseId,
66
+ string_id: stringId,
67
+ text
68
+ }
69
+ });
59
70
  onTypedMessageSubmitted({
60
71
  query: text,
61
72
  userTyped: false,
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime2 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts
4
4
  interface TitledPromptCarouselWidgetProps {
@@ -7,7 +7,7 @@ interface TitledPromptCarouselWidgetProps {
7
7
  declare const TitledPromptCarouselWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: TitledPromptCarouselWidgetProps): react_jsx_runtime2.JSX.Element;
10
+ }: TitledPromptCarouselWidgetProps): react_jsx_runtime9.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion