@envive-ai/react-widgets-v3 0.3.13 → 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 (80) 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/withBaseWidget.d.cts +2 -2
  10. package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
  11. package/dist/packages/widgets/dist/SearchResults/SearchResults.d.ts +2 -2
  12. package/dist/packages/widgets/dist/SearchResults/SearchResultsWidget.d.ts +2 -2
  13. package/dist/packages/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.ts +2 -2
  14. package/dist/packages/widgets/dist/SuggestionBar/SuggestionBar.d.ts +2 -2
  15. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
  16. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +3 -3
  17. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
  18. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
  19. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
  20. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
  21. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
  22. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +2 -2
  23. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +2 -2
  24. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
  25. package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +19 -3
  26. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
  27. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
  28. package/dist/widgets/ProductCardWidget/ProductCardWidget.js +20 -4
  29. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +10 -0
  30. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
  31. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
  32. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +12 -2
  33. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +2 -9
  34. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
  35. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
  36. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +1 -8
  37. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
  38. package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +10 -0
  39. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
  40. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
  41. package/dist/widgets/SocialProofWidget/SocialProofWidget.js +12 -2
  42. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +11 -0
  43. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
  44. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
  45. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +12 -1
  46. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
  47. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
  48. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +23 -3
  49. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
  50. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
  51. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +24 -4
  52. package/dist/widgets/dist/SearchResults/SearchResults.d.cts +2 -2
  53. package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.cts +2 -2
  54. package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.cts +2 -2
  55. package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.cts +2 -2
  56. package/dist/widgets/utils/functions.cjs +9 -0
  57. package/dist/widgets/utils/functions.js +9 -1
  58. package/package.json +1 -1
  59. package/src/CXIntegration/implementations/useHelpScoutUnifiedCXButton.ts +108 -0
  60. package/src/CXIntegration/implementations/useTalkdeskUnifiedCXButton.ts +94 -0
  61. package/src/CXIntegration/types.ts +2 -0
  62. package/src/CXIntegration/utils/functions.ts +8 -0
  63. package/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.tsx +15 -3
  64. package/src/widgets/ChatPreviewWidget/__tests__/ChatPreviewWidget.test.tsx +114 -0
  65. package/src/widgets/FloatingChatWidget/__tests__/FloatingChatWidget.test.tsx +119 -0
  66. package/src/widgets/ProductCardWidget/ProductCardWidget.tsx +15 -3
  67. package/src/widgets/ProductCardWidget/__tests__/ProductCardWidget.test.tsx +144 -0
  68. package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +12 -1
  69. package/src/widgets/PromptButtonCarouselWithImageWidget/__tests__/PromptButtonCarouselWithImageWidget.test.tsx +179 -0
  70. package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +1 -14
  71. package/src/widgets/PromptCarouselWidget/__tests__/PromptCarouselWidget.test.tsx +150 -0
  72. package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +12 -1
  73. package/src/widgets/SocialProofWidget/__tests__/SocialProofWidget.test.tsx +184 -0
  74. package/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx +12 -0
  75. package/src/widgets/TitledPromptCarouselWidget/__tests__/TitledPromptCarouselWidget.test.tsx +150 -0
  76. package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +19 -2
  77. package/src/widgets/TypingAnimationWidget/__tests__/TypingAnimationWidget.test.tsx +163 -0
  78. package/src/widgets/__tests__/testUtils.tsx +63 -0
  79. package/src/widgets/__tests__/trackEventCanary.test.ts +45 -0
  80. package/src/widgets/utils/functions.ts +16 -0
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime9 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_runtime9.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_runtime4 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_runtime4.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_runtime4.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_runtime2 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_runtime2.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_runtime2.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_runtime6 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_runtime6.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_runtime15 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_runtime15.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",
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime6 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_runtime6.JSX.Element;
10
+ }: SocialProofFlowWidgetProps): react_jsx_runtime17.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_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_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,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_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_runtime2.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_runtime1 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_runtime1.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,
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime1 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts
4
4
  interface TypingAnimationFlowWidgetProps {
@@ -7,7 +7,7 @@ interface TypingAnimationFlowWidgetProps {
7
7
  declare const TypingAnimationFlowWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: TypingAnimationFlowWidgetProps): react_jsx_runtime1.JSX.Element;
10
+ }: TypingAnimationFlowWidgetProps): react_jsx_runtime0.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime10 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts
4
4
  interface TypingAnimationFlowWidgetProps {
@@ -7,7 +7,7 @@ interface TypingAnimationFlowWidgetProps {
7
7
  declare const TypingAnimationFlowWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: TypingAnimationFlowWidgetProps): react_jsx_runtime10.JSX.Element;
10
+ }: TypingAnimationFlowWidgetProps): react_jsx_runtime1.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#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");
@@ -28,7 +29,7 @@ const mockHintText = "Ask me anything";
28
29
  const TypingAnimationWidgetHandler = (props) => {
29
30
  const { onTypedMessageSubmitted } = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)();
30
31
  const onToggle = (0, jotai.useSetAtom)(__envive_ai_react_hooks_atoms_chat_chatState.chatOnToggleAtom);
31
- const { hardcopyContent, widgetConfig, isLoading, widgetConfigId } = props;
32
+ const { hardcopyContent, widgetConfig, uiConfig, isLoading, widgetConfigId } = props;
32
33
  const titleLabel = hardcopyContent?.values?.titleLabel || "";
33
34
  const headlineText = hardcopyContent?.values?.headlineText || "";
34
35
  const animatedTextSequence = hardcopyContent?.values?.animatedTextSequence || [];
@@ -43,6 +44,8 @@ const TypingAnimationWidgetHandler = (props) => {
43
44
  const promptButtonType = typingAnimationWidgetConfig?.promptButtonType || __envive_ai_react_toolkit_v3_PromptButton_types.PromptButtonVariant.LIGHT;
44
45
  const promptCarouselRows = typingAnimationWidgetConfig?.promptCarouselRows || __envive_ai_react_toolkit_v3_PromptCarousel.PromptCarouselRows.ALWAYS_ONE;
45
46
  const showTextField = typingAnimationWidgetConfig?.showTextField !== false;
47
+ const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
48
+ const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
46
49
  const { trackEvent } = (0, __envive_ai_react_hooks_contexts_amplitudeContext.useAmplitude)();
47
50
  (0, react.useEffect)(() => {
48
51
  trackEvent({
@@ -54,13 +57,28 @@ const TypingAnimationWidgetHandler = (props) => {
54
57
  });
55
58
  }, [trackEvent, widgetConfigId]);
56
59
  const 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
+ });
57
70
  onTypedMessageSubmitted({
58
71
  query: text,
59
72
  userTyped: false,
60
73
  displayLocation: __envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.TYPING_ANIMATION
61
74
  });
62
75
  onToggle(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.TYPING_ANIMATION);
63
- }, [onTypedMessageSubmitted, onToggle]);
76
+ }, [
77
+ hardcopyContent,
78
+ trackEvent,
79
+ onTypedMessageSubmitted,
80
+ onToggle
81
+ ]);
64
82
  const handleTextFieldClick = (0, react.useCallback)(() => {
65
83
  onToggle(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.TYPING_ANIMATION);
66
84
  }, [onToggle]);
@@ -72,7 +90,9 @@ const TypingAnimationWidgetHandler = (props) => {
72
90
  animatedTextSequence: isLoading ? mockAnimatedTextSequence : animatedTextSequence,
73
91
  promptButtonTexts: buttonTexts,
74
92
  hintText: isLoading ? mockHintText : hintText,
75
- textFieldAriaLabel
93
+ textFieldAriaLabel,
94
+ logoSrc: logoSrc ?? void 0,
95
+ hideLogo: hideLogo ?? false
76
96
  },
77
97
  widgetStyleProps: {
78
98
  widgetVariant,
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
- import * as react_jsx_runtime18 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime16 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts
5
5
  declare const TypingAnimationWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime18.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime16.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface TypingAnimationWidgetProps {
@@ -12,7 +12,7 @@ interface TypingAnimationWidgetProps {
12
12
  declare const TypingAnimationWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: TypingAnimationWidgetProps): react_jsx_runtime18.JSX.Element;
15
+ }: TypingAnimationWidgetProps): react_jsx_runtime16.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_runtime7 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts
5
5
  declare const TypingAnimationWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime7.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime0.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface TypingAnimationWidgetProps {
@@ -12,7 +12,7 @@ interface TypingAnimationWidgetProps {
12
12
  declare const TypingAnimationWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: TypingAnimationWidgetProps): react_jsx_runtime7.JSX.Element;
15
+ }: TypingAnimationWidgetProps): react_jsx_runtime0.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#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 { useSetAtom } from "jotai";
@@ -27,7 +28,7 @@ const mockHintText = "Ask me anything";
27
28
  const TypingAnimationWidgetHandler = (props) => {
28
29
  const { onTypedMessageSubmitted } = useSalesAgent();
29
30
  const onToggle = useSetAtom(chatOnToggleAtom);
30
- const { hardcopyContent, widgetConfig, isLoading, widgetConfigId } = props;
31
+ const { hardcopyContent, widgetConfig, uiConfig, isLoading, widgetConfigId } = props;
31
32
  const titleLabel = hardcopyContent?.values?.titleLabel || "";
32
33
  const headlineText = hardcopyContent?.values?.headlineText || "";
33
34
  const animatedTextSequence = hardcopyContent?.values?.animatedTextSequence || [];
@@ -42,6 +43,8 @@ const TypingAnimationWidgetHandler = (props) => {
42
43
  const promptButtonType = typingAnimationWidgetConfig?.promptButtonType || PromptButtonVariant.LIGHT;
43
44
  const promptCarouselRows = typingAnimationWidgetConfig?.promptCarouselRows || PromptCarouselRows.ALWAYS_ONE;
44
45
  const showTextField = typingAnimationWidgetConfig?.showTextField !== false;
46
+ const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
47
+ const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
45
48
  const { trackEvent } = useAmplitude();
46
49
  useEffect(() => {
47
50
  trackEvent({
@@ -53,13 +56,28 @@ const TypingAnimationWidgetHandler = (props) => {
53
56
  });
54
57
  }, [trackEvent, widgetConfigId]);
55
58
  const 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
+ });
56
69
  onTypedMessageSubmitted({
57
70
  query: text,
58
71
  userTyped: false,
59
72
  displayLocation: ChatElementDisplayLocationV3.TYPING_ANIMATION
60
73
  });
61
74
  onToggle(ChatElementDisplayLocationV3.TYPING_ANIMATION);
62
- }, [onTypedMessageSubmitted, onToggle]);
75
+ }, [
76
+ hardcopyContent,
77
+ trackEvent,
78
+ onTypedMessageSubmitted,
79
+ onToggle
80
+ ]);
63
81
  const handleTextFieldClick = useCallback(() => {
64
82
  onToggle(ChatElementDisplayLocationV3.TYPING_ANIMATION);
65
83
  }, [onToggle]);
@@ -71,7 +89,9 @@ const TypingAnimationWidgetHandler = (props) => {
71
89
  animatedTextSequence: isLoading ? mockAnimatedTextSequence : animatedTextSequence,
72
90
  promptButtonTexts: buttonTexts,
73
91
  hintText: isLoading ? mockHintText : hintText,
74
- textFieldAriaLabel
92
+ textFieldAriaLabel,
93
+ logoSrc: logoSrc ?? void 0,
94
+ hideLogo: hideLogo ?? false
75
95
  },
76
96
  widgetStyleProps: {
77
97
  widgetVariant,
@@ -1,5 +1,5 @@
1
1
  import { SearchResultsEntryPointWidgetConfig } from "./types.cjs";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
3
3
  import { SearchResultsHocProps } from "@envive-ai/react-hooks/hooks/Search";
4
4
 
5
5
  //#region ../widgets/dist/SearchResults/SearchResults.d.ts
@@ -7,7 +7,7 @@ import { SearchResultsHocProps } from "@envive-ai/react-hooks/hooks/Search";
7
7
  interface SearchResultsProps extends SearchResultsHocProps {
8
8
  widgetConfig: SearchResultsEntryPointWidgetConfig;
9
9
  }
10
- declare const SearchResults: (props: Omit<SearchResultsProps, string | number | symbol>) => react_jsx_runtime0.JSX.Element;
10
+ declare const SearchResults: (props: Omit<SearchResultsProps, string | number | symbol>) => react_jsx_runtime1.JSX.Element;
11
11
  //#endregion
12
12
 
13
13
  //#endregion