@envive-ai/react-widgets-v3 0.3.20 → 0.3.22

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 (66) hide show
  1. package/dist/hocs/withBaseWidget/types.d.cts +5 -6
  2. package/dist/hocs/withBaseWidget/types.d.ts +5 -6
  3. package/dist/hocs/withBaseWidget/withBaseWidget.cjs +37 -43
  4. package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
  5. package/dist/hocs/withBaseWidget/withBaseWidget.js +39 -45
  6. package/dist/packages/widgets/dist/SearchResults/SearchResultsWidget.d.ts +2 -2
  7. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
  8. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +3 -3
  9. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
  10. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
  11. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +0 -9
  12. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
  13. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
  14. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +2 -11
  15. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +24 -28
  16. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
  17. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +2 -2
  18. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +25 -29
  19. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
  20. package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +0 -10
  21. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
  22. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
  23. package/dist/widgets/ProductCardWidget/ProductCardWidget.js +2 -12
  24. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +0 -9
  25. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
  26. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
  27. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +2 -11
  28. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +0 -9
  29. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
  30. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
  31. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +2 -11
  32. package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +0 -9
  33. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
  34. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
  35. package/dist/widgets/SocialProofWidget/SocialProofWidget.js +2 -11
  36. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +0 -9
  37. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
  38. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
  39. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +2 -11
  40. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
  41. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +0 -9
  42. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
  43. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
  44. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +2 -11
  45. package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.cts +2 -2
  46. package/package.json +1 -1
  47. package/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.tsx +68 -302
  48. package/src/hocs/withBaseWidget/types.ts +6 -6
  49. package/src/hocs/withBaseWidget/withBaseWidget.tsx +46 -61
  50. package/src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx +1 -13
  51. package/src/widgets/ChatPreviewWidget/__tests__/ChatPreviewWidget.test.tsx +11 -5
  52. package/src/widgets/FloatingChatWidget/FloatingChatWidget.tsx +36 -36
  53. package/src/widgets/FloatingChatWidget/__tests__/FloatingChatWidget.test.tsx +11 -5
  54. package/src/widgets/ProductCardWidget/ProductCardWidget.tsx +1 -13
  55. package/src/widgets/ProductCardWidget/__tests__/ProductCardWidget.test.tsx +12 -8
  56. package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +1 -12
  57. package/src/widgets/PromptButtonCarouselWithImageWidget/__tests__/PromptButtonCarouselWithImageWidget.test.tsx +19 -8
  58. package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +1 -12
  59. package/src/widgets/PromptCarouselWidget/__tests__/PromptCarouselWidget.test.tsx +21 -8
  60. package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +1 -12
  61. package/src/widgets/SocialProofWidget/__tests__/SocialProofWidget.test.tsx +19 -8
  62. package/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx +1 -12
  63. package/src/widgets/TitledPromptCarouselWidget/__tests__/TitledPromptCarouselWidget.test.tsx +19 -8
  64. package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +1 -12
  65. package/src/widgets/TypingAnimationWidget/__tests__/TypingAnimationWidget.test.tsx +19 -8
  66. package/src/widgets/__tests__/trackEventCanary.test.ts +1 -1
@@ -9,7 +9,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 { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
12
+ import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
13
+ import { useTrackComponentVisibleEvent } from "@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent";
13
14
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
14
15
  import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
15
16
  import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
@@ -77,20 +78,12 @@ const FloatingChatWidgetHandler = (props) => {
77
78
  return uiConfig?.lookAndFeel?.theme ?? Theme.GLOBAL_CUSTOM;
78
79
  }, [isUiConfigLoading, uiConfig]);
79
80
  useAutoPopup({ autoPopupConfig: floatingChat?.autoPopupConfig });
80
- const { trackEvent } = useAmplitude();
81
- const hasTrackedEvent = useRef(false);
82
- useEffect(() => {
83
- if (buttonShouldRender && !hasTrackedEvent.current) {
84
- trackEvent({
85
- eventName: SpiffyMetricsEventName.ChatComponentVisible,
86
- eventProps: {
87
- widget_config_id: "floating-button",
88
- widget_type: WidgetTypeV3.FloatingButtonV3
89
- }
90
- });
91
- hasTrackedEvent.current = true;
92
- }
93
- }, [trackEvent, buttonShouldRender]);
81
+ const { isReady } = useAmplitude();
82
+ const floatingButtonVisibilityRef = useRef(null);
83
+ useTrackComponentVisibleEvent(floatingButtonVisibilityRef, {
84
+ widget_config_id: "floating-button",
85
+ widget_type: WidgetTypeV3.FloatingButtonV3
86
+ }, "0px", isReady && buttonShouldRender);
94
87
  return /* @__PURE__ */ jsx(CXButtonProvider, {
95
88
  provider: cxProvider,
96
89
  enabled: customerServiceIntegration?.enabled ?? false,
@@ -125,23 +118,26 @@ const FloatingChatWidgetHandler = (props) => {
125
118
  handleClose({ collapse_source: "close_button" });
126
119
  }
127
120
  }) })
128
- }), buttonShouldRender && /* @__PURE__ */ jsx(FloatingButton, {
129
- id: FLOATING_BUTTON_ID,
130
- variant: floatingButton?.style,
131
- mode: floatingButton?.mode,
132
- backgroundColor: floatingButton?.backgroundColor,
133
- onClick: previewButtonOnly ? () => {} : () => openChat(ChatElementDisplayLocationV3.FLOATING_BUTTON),
134
- onMouseOver: onHover,
135
- customIcon: floatingButton?.iconSVGSrc,
136
- show: floatingButton?.showOption,
137
- location: floatingButton?.position,
138
- hasInteractionHappened: userHasInteractedValue,
139
- ariaLabel: "Open chat",
140
- previewMode: !!previewButtonOnly
121
+ }), buttonShouldRender && /* @__PURE__ */ jsx("div", {
122
+ ref: floatingButtonVisibilityRef,
123
+ children: /* @__PURE__ */ jsx(FloatingButton, {
124
+ id: FLOATING_BUTTON_ID,
125
+ variant: floatingButton?.style,
126
+ mode: floatingButton?.mode,
127
+ backgroundColor: floatingButton?.backgroundColor,
128
+ onClick: previewButtonOnly ? () => {} : () => openChat(ChatElementDisplayLocationV3.FLOATING_BUTTON),
129
+ onMouseOver: onHover,
130
+ customIcon: floatingButton?.iconSVGSrc,
131
+ show: floatingButton?.showOption,
132
+ location: floatingButton?.position,
133
+ hasInteractionHappened: userHasInteractedValue,
134
+ ariaLabel: "Open chat",
135
+ previewMode: !!previewButtonOnly
136
+ })
141
137
  })] })
142
138
  }, cxProvider);
143
139
  };
144
- const FloatingChatWidgetWithBaseWidget = withBaseWidget(FloatingChatWidgetHandler);
140
+ const FloatingChatWidgetWithBaseWidget = withBaseWidget(FloatingChatWidgetHandler, { deferLoading: false });
145
141
  const FloatingChatWidget = ({ previewButtonOnly, previewChatAlwaysOpen } = {}) => {
146
142
  return /* @__PURE__ */ jsx(FloatingChatWidgetWithBaseWidget, {
147
143
  widgetType: WidgetTypeV3.FloatingChatV3,
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime1 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_runtime0.JSX.Element;
11
+ }: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime1.JSX.Element;
12
12
  displayName: string;
13
13
  };
14
14
  //#endregion
@@ -49,16 +49,6 @@ const ProductCardWidgetHandler = (props) => {
49
49
  const rawValues = hardcopyContent?.rawValues;
50
50
  return require_functions.getStringIdForText(rawValues, text);
51
51
  });
52
- const { widgetConfigId } = props;
53
- (0, react.useEffect)(() => {
54
- trackEvent({
55
- eventName: __envive_ai_react_hooks_contexts_amplitudeContext.SpiffyMetricsEventName.ChatComponentVisible,
56
- eventProps: {
57
- widget_config_id: widgetConfigId,
58
- widget_type: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ProductCardV3
59
- }
60
- });
61
- }, [trackEvent, widgetConfigId]);
62
52
  const handleSelect = (0, react.useCallback)((text) => {
63
53
  const rawValues = hardcopyContent?.rawValues;
64
54
  const stringId = require_functions.getStringIdForText(rawValues, text);
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime14 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime9 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_runtime9.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime12 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime7 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_runtime12.JSX.Element;
10
+ }: ProductCardWidgetProps): react_jsx_runtime7.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,8 +1,8 @@
1
1
  import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
2
2
  import "../../hocs/withBaseWidget/index.js";
3
3
  import { getStringIdForText } from "../utils/functions.js";
4
- import { useCallback, useEffect } from "react";
5
- import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
4
+ import { useCallback } from "react";
5
+ import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
8
8
  import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
@@ -48,16 +48,6 @@ const ProductCardWidgetHandler = (props) => {
48
48
  const rawValues = hardcopyContent?.rawValues;
49
49
  return getStringIdForText(rawValues, text);
50
50
  });
51
- const { widgetConfigId } = props;
52
- useEffect(() => {
53
- trackEvent({
54
- eventName: SpiffyMetricsEventName.ChatComponentVisible,
55
- eventProps: {
56
- widget_config_id: widgetConfigId,
57
- widget_type: WidgetTypeV3.ProductCardV3
58
- }
59
- });
60
- }, [trackEvent, widgetConfigId]);
61
51
  const handleSelect = useCallback((text) => {
62
52
  const rawValues = hardcopyContent?.rawValues;
63
53
  const stringId = getStringIdForText(rawValues, text);
@@ -32,15 +32,6 @@ const PromptButtonCarouselWithImageWidgetHandler = (props) => {
32
32
  textFieldPlaceholder: hardcopyContent?.values?.textFieldPlaceholderText
33
33
  };
34
34
  const { trackEvent } = (0, __envive_ai_react_hooks_contexts_amplitudeContext.useAmplitude)();
35
- (0, react.useEffect)(() => {
36
- trackEvent({
37
- eventName: __envive_ai_react_hooks_contexts_amplitudeContext.SpiffyMetricsEventName.ChatComponentVisible,
38
- eventProps: {
39
- widget_config_id: widgetConfigId,
40
- widget_type: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.PromptButtonCarouselWithImageV3
41
- }
42
- });
43
- }, [trackEvent, widgetConfigId]);
44
35
  const handlePromptButtonClick = (0, react.useCallback)((text) => {
45
36
  const rawValues = hardcopyContent?.rawValues;
46
37
  const stringId = require_functions.getStringIdForText(rawValues, text);
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
- import * as react_jsx_runtime17 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime5 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_runtime17.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime5.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_runtime17.JSX.Element;
15
+ }: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime5.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_runtime8 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime11 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_runtime11.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_runtime11.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
2
  import { getRecentProductImageUrls, getStringIdForText } from "../utils/functions.js";
3
- import { useCallback, useEffect, useMemo } from "react";
4
- import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
3
+ import { useCallback, useMemo } from "react";
4
+ import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import { lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
7
7
  import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
@@ -31,15 +31,6 @@ const PromptButtonCarouselWithImageWidgetHandler = (props) => {
31
31
  textFieldPlaceholder: hardcopyContent?.values?.textFieldPlaceholderText
32
32
  };
33
33
  const { trackEvent } = useAmplitude();
34
- useEffect(() => {
35
- trackEvent({
36
- eventName: SpiffyMetricsEventName.ChatComponentVisible,
37
- eventProps: {
38
- widget_config_id: widgetConfigId,
39
- widget_type: WidgetTypeV3.PromptButtonCarouselWithImageV3
40
- }
41
- });
42
- }, [trackEvent, widgetConfigId]);
43
34
  const handlePromptButtonClick = useCallback((text) => {
44
35
  const rawValues = hardcopyContent?.rawValues;
45
36
  const stringId = getStringIdForText(rawValues, text);
@@ -39,15 +39,6 @@ const PromptCarouselWidgetHandler = (props) => {
39
39
  const promptCarouselRows = promptCarouselWidgetConfig?.promptCarouselRows;
40
40
  const animationSpeed = isLoading ? __envive_ai_react_toolkit_v3_PromptCarousel_types_types.AnimationSpeed.NONE : promptCarouselWidgetConfig?.animationSpeed;
41
41
  const { trackEvent } = (0, __envive_ai_react_hooks_contexts_amplitudeContext.useAmplitude)();
42
- (0, react.useEffect)(() => {
43
- trackEvent({
44
- eventName: __envive_ai_react_hooks_contexts_amplitudeContext.SpiffyMetricsEventName.ChatComponentVisible,
45
- eventProps: {
46
- widget_config_id: widgetConfigId,
47
- widget_type: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.PromptCarouselV3
48
- }
49
- });
50
- }, [trackEvent, widgetConfigId]);
51
42
  const handleButtonClick = (0, react.useCallback)((text) => {
52
43
  const rawValues = hardcopyContent?.rawValues;
53
44
  const stringId = require_functions.getStringIdForText(rawValues, text);
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime4 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_runtime4.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_runtime13 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_runtime13.JSX.Element;
10
+ }: PromptCarouselWidgetProps): react_jsx_runtime15.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,8 +1,8 @@
1
1
  import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
2
2
  import "../../hocs/withBaseWidget/index.js";
3
3
  import { getStringIdForText } from "../utils/functions.js";
4
- import { useCallback, useEffect } from "react";
5
- import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
4
+ import { useCallback } from "react";
5
+ import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
8
8
  import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
@@ -38,15 +38,6 @@ const PromptCarouselWidgetHandler = (props) => {
38
38
  const promptCarouselRows = promptCarouselWidgetConfig?.promptCarouselRows;
39
39
  const animationSpeed = isLoading ? AnimationSpeed$1.NONE : promptCarouselWidgetConfig?.animationSpeed;
40
40
  const { trackEvent } = useAmplitude();
41
- useEffect(() => {
42
- trackEvent({
43
- eventName: SpiffyMetricsEventName.ChatComponentVisible,
44
- eventProps: {
45
- widget_config_id: widgetConfigId,
46
- widget_type: WidgetTypeV3.PromptCarouselV3
47
- }
48
- });
49
- }, [trackEvent, widgetConfigId]);
50
41
  const handleButtonClick = useCallback((text) => {
51
42
  const rawValues = hardcopyContent?.rawValues;
52
43
  const stringId = getStringIdForText(rawValues, text);
@@ -60,15 +60,6 @@ const SocialProofWidgetHandler = (props) => {
60
60
  alt: "Product Image"
61
61
  }];
62
62
  const { trackEvent } = (0, __envive_ai_react_hooks_contexts_amplitudeContext.useAmplitude)();
63
- (0, react.useEffect)(() => {
64
- trackEvent({
65
- eventName: __envive_ai_react_hooks_contexts_amplitudeContext.SpiffyMetricsEventName.ChatComponentVisible,
66
- eventProps: {
67
- widget_config_id: widgetConfigId,
68
- widget_type: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.SocialProofV3
69
- }
70
- });
71
- }, [trackEvent, widgetConfigId]);
72
63
  const handlePrimaryButtonClick = (0, react.useCallback)((text) => {
73
64
  const rawValues = hardcopyContent?.rawValues;
74
65
  const stringId = require_functions.getStringIdForText(rawValues, text);
@@ -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_runtime17 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_runtime17.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_runtime17.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_runtime6 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime5 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_runtime6.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime5.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_runtime6.JSX.Element;
15
+ }: SocialProofWidgetProps): react_jsx_runtime5.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
2
  import { getStringIdForText } from "../utils/functions.js";
3
- import { useCallback, useEffect, useMemo } from "react";
4
- import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
3
+ import { useCallback, useMemo } from "react";
4
+ import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
7
7
  import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
@@ -59,15 +59,6 @@ const SocialProofWidgetHandler = (props) => {
59
59
  alt: "Product Image"
60
60
  }];
61
61
  const { trackEvent } = useAmplitude();
62
- useEffect(() => {
63
- trackEvent({
64
- eventName: SpiffyMetricsEventName.ChatComponentVisible,
65
- eventProps: {
66
- widget_config_id: widgetConfigId,
67
- widget_type: WidgetTypeV3.SocialProofV3
68
- }
69
- });
70
- }, [trackEvent, widgetConfigId]);
71
62
  const handlePrimaryButtonClick = useCallback((text) => {
72
63
  const rawValues = hardcopyContent?.rawValues;
73
64
  const stringId = getStringIdForText(rawValues, text);
@@ -40,15 +40,6 @@ const TitledPromptCarouselWidgetHandler = (props) => {
40
40
  const promptCarouselRows = titledPromptCarouselWidgetConfig?.promptCarouselRows;
41
41
  const animationSpeed = isLoading ? __envive_ai_react_toolkit_v3_PromptCarousel.AnimationSpeed.NONE : titledPromptCarouselWidgetConfig?.animationSpeed;
42
42
  const { trackEvent } = (0, __envive_ai_react_hooks_contexts_amplitudeContext.useAmplitude)();
43
- (0, react.useEffect)(() => {
44
- trackEvent({
45
- eventName: __envive_ai_react_hooks_contexts_amplitudeContext.SpiffyMetricsEventName.ChatComponentVisible,
46
- eventProps: {
47
- widget_config_id: widgetConfigId,
48
- widget_type: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.TitledPromptCarouselV3
49
- }
50
- });
51
- }, [trackEvent, widgetConfigId]);
52
43
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_TitledPromptCarousel.TitledPromptCarousel, {
53
44
  id,
54
45
  titleLabel,
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime7 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime1 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_runtime7.JSX.Element;
10
+ }: TitledPromptCarouselWidgetProps): react_jsx_runtime1.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime2 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime4 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_runtime4.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,8 +1,8 @@
1
1
  import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
2
2
  import "../../hocs/withBaseWidget/index.js";
3
3
  import { getStringIdForText } from "../utils/functions.js";
4
- import { useCallback, useEffect } from "react";
5
- import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
4
+ import { useCallback } from "react";
5
+ import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
8
8
  import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
@@ -39,15 +39,6 @@ const TitledPromptCarouselWidgetHandler = (props) => {
39
39
  const promptCarouselRows = titledPromptCarouselWidgetConfig?.promptCarouselRows;
40
40
  const animationSpeed = isLoading ? AnimationSpeed.NONE : titledPromptCarouselWidgetConfig?.animationSpeed;
41
41
  const { trackEvent } = useAmplitude();
42
- useEffect(() => {
43
- trackEvent({
44
- eventName: SpiffyMetricsEventName.ChatComponentVisible,
45
- eventProps: {
46
- widget_config_id: widgetConfigId,
47
- widget_type: WidgetTypeV3.TitledPromptCarouselV3
48
- }
49
- });
50
- }, [trackEvent, widgetConfigId]);
51
42
  return /* @__PURE__ */ jsx(TitledPromptCarousel, {
52
43
  id,
53
44
  titleLabel,
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime19 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_runtime19.JSX.Element;
10
+ }: TypingAnimationFlowWidgetProps): react_jsx_runtime0.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -54,15 +54,6 @@ const TypingAnimationWidgetHandler = (props) => {
54
54
  const rawValues = hardcopyContent?.rawValues;
55
55
  return require_functions.getStringIdForText(rawValues, text);
56
56
  });
57
- (0, react.useEffect)(() => {
58
- trackEvent({
59
- eventName: __envive_ai_react_hooks_contexts_amplitudeContext.SpiffyMetricsEventName.ChatComponentVisible,
60
- eventProps: {
61
- widget_config_id: widgetConfigId,
62
- widget_type: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.TypingAnimationV3
63
- }
64
- });
65
- }, [trackEvent, widgetConfigId]);
66
57
  const handleButtonClick = (0, react.useCallback)((text) => {
67
58
  const rawValues = hardcopyContent?.rawValues;
68
59
  const stringId = require_functions.getStringIdForText(rawValues, text);
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
- import * as react_jsx_runtime2 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime15 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_runtime2.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime15.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_runtime2.JSX.Element;
15
+ }: TypingAnimationWidgetProps): react_jsx_runtime15.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_runtime4 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime9 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_runtime4.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime9.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_runtime4.JSX.Element;
15
+ }: TypingAnimationWidgetProps): react_jsx_runtime9.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,8 +1,8 @@
1
1
  import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
2
2
  import "../../hocs/withBaseWidget/index.js";
3
3
  import { getStringIdForText } from "../utils/functions.js";
4
- import { useCallback, useEffect } from "react";
5
- import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
4
+ import { useCallback } from "react";
5
+ import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
8
8
  import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
@@ -53,15 +53,6 @@ const TypingAnimationWidgetHandler = (props) => {
53
53
  const rawValues = hardcopyContent?.rawValues;
54
54
  return getStringIdForText(rawValues, text);
55
55
  });
56
- useEffect(() => {
57
- trackEvent({
58
- eventName: SpiffyMetricsEventName.ChatComponentVisible,
59
- eventProps: {
60
- widget_config_id: widgetConfigId,
61
- widget_type: WidgetTypeV3.TypingAnimationV3
62
- }
63
- });
64
- }, [trackEvent, widgetConfigId]);
65
56
  const handleButtonClick = useCallback((text) => {
66
57
  const rawValues = hardcopyContent?.rawValues;
67
58
  const stringId = getStringIdForText(rawValues, text);
@@ -1,8 +1,8 @@
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 ../widgets/dist/SearchResults/SearchResultsWidget.d.ts
4
4
  //#region src/SearchResults/SearchResultsWidget.d.ts
5
- declare const SearchResultsWidget: () => react_jsx_runtime1.JSX.Element;
5
+ declare const SearchResultsWidget: () => react_jsx_runtime0.JSX.Element;
6
6
  //#endregion
7
7
 
8
8
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envive-ai/react-widgets-v3",
3
- "version": "0.3.20",
3
+ "version": "0.3.22",
4
4
  "description": "React widget library v3 for Envive services.",
5
5
  "keywords": [
6
6
  "react",