@envive-ai/react-widgets-v3 0.3.12 → 0.3.14

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 (91) hide show
  1. package/dist/CXIntegration/implementations/useEightByEightUnifiedCXButton.cjs +54 -0
  2. package/dist/CXIntegration/implementations/useEightByEightUnifiedCXButton.js +53 -0
  3. package/dist/CXIntegration/implementations/useHelpScoutUnifiedCXButton.cjs +65 -0
  4. package/dist/CXIntegration/implementations/useHelpScoutUnifiedCXButton.js +64 -0
  5. package/dist/CXIntegration/implementations/useTalkdeskUnifiedCXButton.cjs +64 -0
  6. package/dist/CXIntegration/implementations/useTalkdeskUnifiedCXButton.js +63 -0
  7. package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.cjs +2 -2
  8. package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.js +2 -2
  9. package/dist/CXIntegration/types.cjs +3 -0
  10. package/dist/CXIntegration/types.js +3 -0
  11. package/dist/CXIntegration/utils/functions.cjs +6 -0
  12. package/dist/CXIntegration/utils/functions.js +6 -0
  13. package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +2 -2
  14. package/dist/packages/widgets/dist/SearchResults/SearchResults.d.ts +2 -2
  15. package/dist/packages/widgets/dist/SearchResults/SearchResultsWidget.d.ts +2 -2
  16. package/dist/packages/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.ts +2 -2
  17. package/dist/packages/widgets/dist/SuggestionBar/SuggestionBar.d.ts +2 -2
  18. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
  19. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +3 -3
  20. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
  21. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
  22. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
  23. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
  24. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +2 -2
  25. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +2 -2
  26. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
  27. package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +19 -3
  28. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
  29. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
  30. package/dist/widgets/ProductCardWidget/ProductCardWidget.js +20 -4
  31. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +10 -0
  32. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
  33. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
  34. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +12 -2
  35. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +2 -9
  36. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
  37. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
  38. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +1 -8
  39. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.cjs +8 -8
  40. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
  41. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
  42. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +8 -8
  43. package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +10 -0
  44. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
  45. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
  46. package/dist/widgets/SocialProofWidget/SocialProofWidget.js +12 -2
  47. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +11 -0
  48. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
  49. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
  50. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +12 -1
  51. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.cjs +8 -8
  52. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
  53. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
  54. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +8 -8
  55. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +23 -3
  56. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
  57. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
  58. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +24 -4
  59. package/dist/widgets/dist/SearchResults/SearchResults.d.cts +2 -2
  60. package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.cts +2 -2
  61. package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.cts +2 -2
  62. package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.cts +2 -2
  63. package/dist/widgets/utils/functions.cjs +9 -0
  64. package/dist/widgets/utils/functions.js +9 -1
  65. package/package.json +1 -1
  66. package/src/CXIntegration/implementations/useEightByEightUnifiedCXButton.ts +91 -0
  67. package/src/CXIntegration/implementations/useHelpScoutUnifiedCXButton.ts +108 -0
  68. package/src/CXIntegration/implementations/useTalkdeskUnifiedCXButton.ts +94 -0
  69. package/src/CXIntegration/implementations/useZendeskUnifiedCXButton.ts +4 -2
  70. package/src/CXIntegration/types.ts +3 -0
  71. package/src/CXIntegration/utils/functions.ts +12 -0
  72. package/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.tsx +15 -3
  73. package/src/widgets/ChatPreviewWidget/__tests__/ChatPreviewWidget.test.tsx +114 -0
  74. package/src/widgets/FloatingChatWidget/__tests__/FloatingChatWidget.test.tsx +119 -0
  75. package/src/widgets/ProductCardWidget/ProductCardWidget.tsx +15 -3
  76. package/src/widgets/ProductCardWidget/__tests__/ProductCardWidget.test.tsx +144 -0
  77. package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +12 -1
  78. package/src/widgets/PromptButtonCarouselWithImageWidget/__tests__/PromptButtonCarouselWithImageWidget.test.tsx +179 -0
  79. package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +1 -14
  80. package/src/widgets/PromptCarouselWidget/__tests__/PromptCarouselWidget.test.tsx +150 -0
  81. package/src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.tsx +12 -12
  82. package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +12 -1
  83. package/src/widgets/SocialProofWidget/__tests__/SocialProofWidget.test.tsx +184 -0
  84. package/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx +12 -0
  85. package/src/widgets/TitledPromptCarouselWidget/__tests__/TitledPromptCarouselWidget.test.tsx +150 -0
  86. package/src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.tsx +12 -12
  87. package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +19 -2
  88. package/src/widgets/TypingAnimationWidget/__tests__/TypingAnimationWidget.test.tsx +163 -0
  89. package/src/widgets/__tests__/testUtils.tsx +63 -0
  90. package/src/widgets/__tests__/trackEventCanary.test.ts +45 -0
  91. package/src/widgets/utils/functions.ts +16 -0
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime19 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts
4
4
  interface FloatingChatWidgetProps {
@@ -9,7 +9,7 @@ declare const FloatingChatWidget: {
9
9
  ({
10
10
  previewButtonOnly,
11
11
  previewChatAlwaysOpen
12
- }?: FloatingChatWidgetProps): react_jsx_runtime19.JSX.Element;
12
+ }?: FloatingChatWidgetProps): react_jsx_runtime6.JSX.Element;
13
13
  displayName: string;
14
14
  };
15
15
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime3 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts
4
4
  interface FloatingChatWidgetProps {
@@ -9,7 +9,7 @@ declare const FloatingChatWidget: {
9
9
  ({
10
10
  previewButtonOnly,
11
11
  previewChatAlwaysOpen
12
- }?: FloatingChatWidgetProps): react_jsx_runtime3.JSX.Element;
12
+ }?: FloatingChatWidgetProps): react_jsx_runtime4.JSX.Element;
13
13
  displayName: string;
14
14
  };
15
15
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime11 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime4 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_runtime4.JSX.Element;
12
12
  displayName: string;
13
13
  };
14
14
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime9 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime5 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_runtime9.JSX.Element;
11
+ }: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime5.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_runtime7 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 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_runtime7.JSX.Element;
10
+ }: ProductCardWidgetProps): react_jsx_runtime0.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime7 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime3 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_runtime7.JSX.Element;
10
+ }: ProductCardWidgetProps): react_jsx_runtime3.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_runtime8 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime1 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_runtime8.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime1.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_runtime8.JSX.Element;
15
+ }: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime1.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_runtime11 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime9 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_runtime11.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime9.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_runtime11.JSX.Element;
15
+ }: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime9.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");
@@ -13,14 +14,6 @@ let __envive_ai_react_toolkit_v3_PromptCarousel_types_types = require("@envive-a
13
14
  let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
14
15
 
15
16
  //#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
17
  const mockButtonTexts = [
25
18
  "Loading button 1",
26
19
  "Loading button 2",
@@ -52,7 +45,7 @@ const PromptCarouselWidgetHandler = (props) => {
52
45
  }, [trackEvent, widgetConfigId]);
53
46
  const handleButtonClick = (0, react.useCallback)((text) => {
54
47
  const rawValues = hardcopyContent?.rawValues;
55
- const stringId = getStringIdForText(rawValues, text);
48
+ const stringId = require_functions.getStringIdForText(rawValues, text);
56
49
  trackEvent({
57
50
  eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetTextClicked,
58
51
  eventProps: {
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime10 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime15 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_runtime10.JSX.Element;
10
+ }: PromptCarouselWidgetProps): react_jsx_runtime15.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime16 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_runtime0.JSX.Element;
10
+ }: PromptCarouselWidgetProps): react_jsx_runtime16.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";
@@ -12,14 +13,6 @@ import { AnimationSpeed } from "@envive-ai/react-toolkit-v3/PromptCarousel/types
12
13
  import { PromptCarousel } from "@envive-ai/react-toolkit-v3/PromptCarousel";
13
14
 
14
15
  //#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
16
  const mockButtonTexts = [
24
17
  "Loading button 1",
25
18
  "Loading button 2",
@@ -11,21 +11,21 @@ let __envive_ai_react_toolkit_v3_ChatPreviewLoading = require("@envive-ai/react-
11
11
  //#region src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.tsx
12
12
  const SocialProofFlowWidget = ({ widgetConfigId }) => {
13
13
  const { userHasInteractedValue, userHasNotInteractedValue, isLoadingValue, isProductComparisonValue } = require_useGetWidgetStatus.default();
14
- if (userHasInteractedValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewWidget.ChatPreviewWidgetWithBaseWidget, {
14
+ if (userHasInteractedValue && isLoadingValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewLoadingWidget.ChatPreviewLoadingWidgetWithBaseWidget, {
15
15
  widgetConfigId,
16
- widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewV3
16
+ widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewLoadingV3
17
17
  });
18
- if (userHasNotInteractedValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SocialProofWidget.SocialProofWidgetWithBaseWidget, {
18
+ if (userHasInteractedValue && isProductComparisonValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewComparisonWidget.ChatPreviewComparisonWidgetWithBaseWidget, {
19
19
  widgetConfigId,
20
- widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.SocialProofV3
20
+ widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewComparisonV3
21
21
  });
22
- if (isLoadingValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewLoadingWidget.ChatPreviewLoadingWidgetWithBaseWidget, {
22
+ if (userHasInteractedValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewWidget.ChatPreviewWidgetWithBaseWidget, {
23
23
  widgetConfigId,
24
- widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewLoadingV3
24
+ widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewV3
25
25
  });
26
- if (isProductComparisonValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewComparisonWidget.ChatPreviewComparisonWidgetWithBaseWidget, {
26
+ if (userHasNotInteractedValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SocialProofWidget.SocialProofWidgetWithBaseWidget, {
27
27
  widgetConfigId,
28
- widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewComparisonV3
28
+ widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.SocialProofV3
29
29
  });
30
30
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_ChatPreviewLoading.ChatPreviewLoading, { fullIsLoading: true });
31
31
  };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime13 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime3 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_runtime13.JSX.Element;
10
+ }: SocialProofFlowWidgetProps): react_jsx_runtime3.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime4 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime17 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_runtime4.JSX.Element;
10
+ }: SocialProofFlowWidgetProps): react_jsx_runtime17.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -10,21 +10,21 @@ import { ChatPreviewLoading } from "@envive-ai/react-toolkit-v3/ChatPreviewLoadi
10
10
  //#region src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.tsx
11
11
  const SocialProofFlowWidget = ({ widgetConfigId }) => {
12
12
  const { userHasInteractedValue, userHasNotInteractedValue, isLoadingValue, isProductComparisonValue } = useGetWidgetStatus_default();
13
- if (userHasInteractedValue) return /* @__PURE__ */ jsx(ChatPreviewWidgetWithBaseWidget, {
13
+ if (userHasInteractedValue && isLoadingValue) return /* @__PURE__ */ jsx(ChatPreviewLoadingWidgetWithBaseWidget, {
14
14
  widgetConfigId,
15
- widgetType: WidgetTypeV3.ChatPreviewV3
15
+ widgetType: WidgetTypeV3.ChatPreviewLoadingV3
16
16
  });
17
- if (userHasNotInteractedValue) return /* @__PURE__ */ jsx(SocialProofWidgetWithBaseWidget, {
17
+ if (userHasInteractedValue && isProductComparisonValue) return /* @__PURE__ */ jsx(ChatPreviewComparisonWidgetWithBaseWidget, {
18
18
  widgetConfigId,
19
- widgetType: WidgetTypeV3.SocialProofV3
19
+ widgetType: WidgetTypeV3.ChatPreviewComparisonV3
20
20
  });
21
- if (isLoadingValue) return /* @__PURE__ */ jsx(ChatPreviewLoadingWidgetWithBaseWidget, {
21
+ if (userHasInteractedValue) return /* @__PURE__ */ jsx(ChatPreviewWidgetWithBaseWidget, {
22
22
  widgetConfigId,
23
- widgetType: WidgetTypeV3.ChatPreviewLoadingV3
23
+ widgetType: WidgetTypeV3.ChatPreviewV3
24
24
  });
25
- if (isProductComparisonValue) return /* @__PURE__ */ jsx(ChatPreviewComparisonWidgetWithBaseWidget, {
25
+ if (userHasNotInteractedValue) return /* @__PURE__ */ jsx(SocialProofWidgetWithBaseWidget, {
26
26
  widgetConfigId,
27
- widgetType: WidgetTypeV3.ChatPreviewComparisonV3
27
+ widgetType: WidgetTypeV3.SocialProofV3
28
28
  });
29
29
  return /* @__PURE__ */ jsx(ChatPreviewLoading, { fullIsLoading: true });
30
30
  };
@@ -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_runtime18 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_runtime18.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_runtime18.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_runtime1 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime18 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_runtime1.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime18.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_runtime1.JSX.Element;
15
+ }: SocialProofWidgetProps): react_jsx_runtime18.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_runtime6 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime8 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_runtime6.JSX.Element;
10
+ }: TitledPromptCarouselWidgetProps): react_jsx_runtime8.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime2 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_runtime0.JSX.Element;
10
+ }: TitledPromptCarouselWidgetProps): react_jsx_runtime2.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";
@@ -55,6 +56,16 @@ const TitledPromptCarouselWidgetHandler = (props) => {
55
56
  promptCarouselRows,
56
57
  animationSpeed,
57
58
  handleButtonClick: useCallback((text) => {
59
+ const rawValues = hardcopyContent?.rawValues;
60
+ const stringId = getStringIdForText(rawValues, text);
61
+ trackEvent({
62
+ eventName: EnviveMetricsEventName.WidgetTextClicked,
63
+ eventProps: {
64
+ response_id: hardcopyContent?.responseId,
65
+ string_id: stringId,
66
+ text
67
+ }
68
+ });
58
69
  onTypedMessageSubmitted({
59
70
  query: text,
60
71
  userTyped: false,