@envive-ai/react-widgets-v3 0.3.15 → 0.3.16

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 (49) hide show
  1. package/dist/debug/chatEmbed.cjs +1 -1
  2. package/dist/debug/chatEmbed.js +1 -1
  3. package/dist/debug/reportIssue.cjs +1 -1
  4. package/dist/debug/reportIssue.js +1 -1
  5. package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
  6. package/dist/packages/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.ts +2 -2
  7. package/dist/packages/widgets/dist/SuggestionBar/SuggestionBar.d.ts +2 -2
  8. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +36 -5
  9. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
  10. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +36 -5
  11. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
  12. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
  13. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +34 -4
  14. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
  15. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +35 -5
  16. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +3 -3
  17. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
  18. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +2 -2
  19. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +3 -3
  20. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
  21. package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +25 -3
  22. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
  23. package/dist/widgets/ProductCardWidget/ProductCardWidget.js +25 -3
  24. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +5 -5
  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 +5 -5
  28. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +2 -2
  29. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
  30. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +2 -2
  31. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
  32. package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +6 -6
  33. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
  34. package/dist/widgets/SocialProofWidget/SocialProofWidget.js +6 -6
  35. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +1 -1
  36. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +1 -1
  37. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
  38. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +23 -2
  39. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
  40. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +24 -3
  41. package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.cts +2 -2
  42. package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.cts +2 -2
  43. package/dist/widgets/hooks/useGetWidgetStatus.cjs +1 -1
  44. package/dist/widgets/hooks/useGetWidgetStatus.js +1 -1
  45. package/package.json +1 -1
  46. package/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx +59 -8
  47. package/src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx +55 -7
  48. package/src/widgets/ProductCardWidget/ProductCardWidget.tsx +37 -4
  49. package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +45 -10
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime5 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime15 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_runtime5.JSX.Element;
10
+ }: ProductCardWidgetProps): react_jsx_runtime15.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -4,13 +4,16 @@ import { getStringIdForText } from "../utils/functions.js";
4
4
  import { useCallback, useEffect } from "react";
5
5
  import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
6
6
  import { jsx } from "react/jsx-runtime";
7
- import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
8
7
  import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
8
+ import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
9
9
  import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
10
- import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
11
10
  import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
12
- import { PromptButtonVariant } from "@envive-ai/react-toolkit-v3/PromptButton/types";
11
+ import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
12
+ import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
13
+ import { usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
14
+ import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
13
15
  import { ProductCard } from "@envive-ai/react-toolkit-v3/ProductCard";
16
+ import { PromptButtonVariant } from "@envive-ai/react-toolkit-v3/PromptButton/types";
14
17
 
15
18
  //#region src/widgets/ProductCardWidget/ProductCardWidget.tsx
16
19
  const mockPrompts = [
@@ -40,6 +43,11 @@ const ProductCardWidgetHandler = (props) => {
40
43
  const fallbackColor = productCardWidgetConfig?.fallbackColor;
41
44
  const imageSrc = productCardWidgetConfig?.imageSrc || "";
42
45
  const { trackEvent } = useAmplitude();
46
+ const { trackWidgetInteraction } = useWidgetInteraction();
47
+ const { onClick: onSuggestionClick, onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = usePromptCarouselAnalytics(WidgetInteractionComponent.IMAGE_PROMPT_CARD, (text) => {
48
+ const rawValues = hardcopyContent?.rawValues;
49
+ return getStringIdForText(rawValues, text);
50
+ });
43
51
  const { widgetConfigId } = props;
44
52
  useEffect(() => {
45
53
  trackEvent({
@@ -67,6 +75,7 @@ const ProductCardWidgetHandler = (props) => {
67
75
  displayLocation: ChatElementDisplayLocationV3.PRODUCT_CARD_PROMPT_BUTTON
68
76
  });
69
77
  openChat(ChatElementDisplayLocationV3.PRODUCT_CARD_PROMPT_BUTTON);
78
+ onSuggestionClick(text);
70
79
  }, [
71
80
  hardcopyContent,
72
81
  onTypedMessageSubmitted,
@@ -75,6 +84,13 @@ const ProductCardWidgetHandler = (props) => {
75
84
  ]);
76
85
  const handleInputClick = useCallback(() => {
77
86
  openChat(ChatElementDisplayLocationV3.PRODUCT_CARD_TEXT_FIELD);
87
+ trackWidgetInteraction({
88
+ eventName: EnviveMetricsEventName.WidgetInteraction,
89
+ trigger: {
90
+ widget: WidgetInteractionComponent.IMAGE_PROMPT_CARD,
91
+ widget_interaction: WidgetInteractionType.QUERY_INPUT_CLICKED
92
+ }
93
+ });
78
94
  }, [openChat]);
79
95
  return /* @__PURE__ */ jsx(ProductCard, {
80
96
  theme: Theme.GLOBAL_CUSTOM,
@@ -90,6 +106,12 @@ const ProductCardWidgetHandler = (props) => {
90
106
  textTypingDuration: 800,
91
107
  textTransition: 2e3,
92
108
  onSelect: handleSelect,
109
+ onDrag,
110
+ onHover,
111
+ onMouseDown,
112
+ onMouseUp,
113
+ onTouchStart,
114
+ onTouchEnd,
93
115
  onInputClick: handleInputClick
94
116
  });
95
117
  };
@@ -4,17 +4,17 @@ const require_functions = require('../utils/functions.cjs');
4
4
  let react = require("react");
5
5
  let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
6
6
  let react_jsx_runtime = require("react/jsx-runtime");
7
- let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
8
- let jotai = require("jotai");
7
+ let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
9
8
  let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
9
+ let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
10
10
  let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
11
- let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
12
- let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
11
+ let jotai = require("jotai");
13
12
  let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
14
13
  let __envive_ai_react_hooks_atoms_app = require("@envive-ai/react-hooks/atoms/app");
14
+ let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
15
15
  let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
16
16
  let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
17
- let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
17
+ let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
18
18
  let __envive_ai_react_toolkit_v3_PromptButtonCarouselWithImage = require("@envive-ai/react-toolkit-v3/PromptButtonCarouselWithImage");
19
19
 
20
20
  //#region src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx
@@ -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_runtime18 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_runtime18.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_runtime18.JSX.Element;
15
+ }: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime11.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -3,17 +3,17 @@ import { getRecentProductImageUrls, getStringIdForText } from "../utils/function
3
3
  import { useCallback, useEffect, useMemo } from "react";
4
4
  import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
5
5
  import { jsx } from "react/jsx-runtime";
6
- import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
7
- import { useAtomValue } from "jotai";
6
+ import { lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
8
7
  import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
8
+ import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
9
9
  import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
10
- import { lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
11
- import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
10
+ import { useAtomValue } from "jotai";
12
11
  import { ChatElementDisplayLocationV3, VariantTypeEnum } from "@envive-ai/react-hooks/application/models";
13
12
  import { variantInfoAtom } from "@envive-ai/react-hooks/atoms/app";
13
+ import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
14
14
  import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
15
15
  import { usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
16
- import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
16
+ import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
17
17
  import { PromptButtonCarouselWithImage } from "@envive-ai/react-toolkit-v3/PromptButtonCarouselWithImage";
18
18
 
19
19
  //#region src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx
@@ -5,13 +5,13 @@ const require_functions = require('../utils/functions.cjs');
5
5
  let react = require("react");
6
6
  let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
7
7
  let react_jsx_runtime = require("react/jsx-runtime");
8
- let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
9
8
  let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
9
+ let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
10
10
  let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
11
- let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
12
11
  let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
13
12
  let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
14
13
  let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
14
+ let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
15
15
  let __envive_ai_react_toolkit_v3_PromptCarousel_types_types = require("@envive-ai/react-toolkit-v3/PromptCarousel/types/types");
16
16
 
17
17
  //#region src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime11 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime9 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_runtime11.JSX.Element;
10
+ }: PromptCarouselWidgetProps): react_jsx_runtime9.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -4,13 +4,13 @@ import { getStringIdForText } from "../utils/functions.js";
4
4
  import { useCallback, useEffect } from "react";
5
5
  import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
6
6
  import { jsx } from "react/jsx-runtime";
7
- import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
8
7
  import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
8
+ import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
9
9
  import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
10
- import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
11
10
  import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
12
11
  import { WidgetInteractionComponent } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
13
12
  import { PromptCarousel, usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
13
+ import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
14
14
  import { AnimationSpeed as AnimationSpeed$1 } from "@envive-ai/react-toolkit-v3/PromptCarousel/types/types";
15
15
 
16
16
  //#region src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime5 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime10 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_runtime5.JSX.Element;
10
+ }: SocialProofFlowWidgetProps): react_jsx_runtime10.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -4,18 +4,18 @@ const require_functions = require('../utils/functions.cjs');
4
4
  let react = require("react");
5
5
  let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
6
6
  let react_jsx_runtime = require("react/jsx-runtime");
7
- let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
8
- let jotai = require("jotai");
9
7
  let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
8
+ let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
10
9
  let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
11
- let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
10
+ let jotai = require("jotai");
12
11
  let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
13
12
  let __envive_ai_react_hooks_atoms_app = require("@envive-ai/react-hooks/atoms/app");
14
- let __envive_ai_react_toolkit_v3_ChatPreviewLoading = require("@envive-ai/react-toolkit-v3/ChatPreviewLoading");
15
- let __envive_ai_react_hooks_atoms_widget = require("@envive-ai/react-hooks/atoms/widget");
13
+ let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
16
14
  let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
17
15
  let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
18
- let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
16
+ let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
17
+ let __envive_ai_react_toolkit_v3_ChatPreviewLoading = require("@envive-ai/react-toolkit-v3/ChatPreviewLoading");
18
+ let __envive_ai_react_hooks_atoms_widget = require("@envive-ai/react-hooks/atoms/widget");
19
19
  let __envive_ai_react_toolkit_v3_SocialProof = require("@envive-ai/react-toolkit-v3/SocialProof");
20
20
  let __envive_ai_react_hooks_hooks_ProductImageUrl = require("@envive-ai/react-hooks/hooks/ProductImageUrl");
21
21
 
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
- import * as react_jsx_runtime12 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_runtime12.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_runtime12.JSX.Element;
15
+ }: SocialProofWidgetProps): react_jsx_runtime17.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -3,18 +3,18 @@ import { getStringIdForText } from "../utils/functions.js";
3
3
  import { useCallback, useEffect, useMemo } from "react";
4
4
  import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
5
5
  import { jsx } from "react/jsx-runtime";
6
- import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
7
- import { useAtomValue, useSetAtom } from "jotai";
8
6
  import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
7
+ import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
9
8
  import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
10
- import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
9
+ import { useAtomValue, useSetAtom } from "jotai";
11
10
  import { ChatElementDisplayLocationV3, VariantTypeEnum } from "@envive-ai/react-hooks/application/models";
12
11
  import { variantInfoAtom } from "@envive-ai/react-hooks/atoms/app";
13
- import { ChatPreviewLoading } from "@envive-ai/react-toolkit-v3/ChatPreviewLoading";
14
- import { chatPreviewLoadingDataAtom } from "@envive-ai/react-hooks/atoms/widget";
12
+ import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
15
13
  import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
16
14
  import { usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
17
- import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
15
+ import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
16
+ import { ChatPreviewLoading } from "@envive-ai/react-toolkit-v3/ChatPreviewLoading";
17
+ import { chatPreviewLoadingDataAtom } from "@envive-ai/react-hooks/atoms/widget";
18
18
  import { PageVariant, SocialProof, WidgetKind } from "@envive-ai/react-toolkit-v3/SocialProof";
19
19
  import { useProductImageUrl } from "@envive-ai/react-hooks/hooks/ProductImageUrl";
20
20
 
@@ -5,8 +5,8 @@ const require_functions = require('../utils/functions.cjs');
5
5
  let react = require("react");
6
6
  let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
7
7
  let react_jsx_runtime = require("react/jsx-runtime");
8
- let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
9
8
  let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
9
+ let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
10
10
  let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
11
11
  let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
12
12
  let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
@@ -4,8 +4,8 @@ import { getStringIdForText } from "../utils/functions.js";
4
4
  import { useCallback, useEffect } from "react";
5
5
  import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
6
6
  import { jsx } from "react/jsx-runtime";
7
- import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
8
7
  import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
8
+ import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
9
9
  import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
10
10
  import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
11
11
  import { WidgetInteractionComponent } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime2 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime3 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_runtime2.JSX.Element;
10
+ }: TypingAnimationFlowWidgetProps): react_jsx_runtime3.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -5,15 +5,17 @@ const require_functions = require('../utils/functions.cjs');
5
5
  let react = require("react");
6
6
  let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
7
7
  let react_jsx_runtime = require("react/jsx-runtime");
8
+ let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
8
9
  let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
9
10
  let jotai = require("jotai");
10
- let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
11
11
  let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
12
+ let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
13
+ let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
12
14
  let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
13
15
  let __envive_ai_react_hooks_atoms_chat_chatState = require("@envive-ai/react-hooks/atoms/chat/chatState");
14
16
  let __envive_ai_react_toolkit_v3_PromptButton_types = require("@envive-ai/react-toolkit-v3/PromptButton/types");
15
- let __envive_ai_react_toolkit_v3_WidgetWrapper = require("@envive-ai/react-toolkit-v3/WidgetWrapper");
16
17
  let __envive_ai_react_toolkit_v3_TypingAnimation = require("@envive-ai/react-toolkit-v3/TypingAnimation");
18
+ let __envive_ai_react_toolkit_v3_WidgetWrapper = require("@envive-ai/react-toolkit-v3/WidgetWrapper");
17
19
 
18
20
  //#region src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx
19
21
  const mockButtonTexts = [
@@ -47,6 +49,11 @@ const TypingAnimationWidgetHandler = (props) => {
47
49
  const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
48
50
  const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
49
51
  const { trackEvent } = (0, __envive_ai_react_hooks_contexts_amplitudeContext.useAmplitude)();
52
+ const { trackWidgetInteraction } = (0, __envive_ai_react_hooks_hooks_WidgetInteraction.useWidgetInteraction)();
53
+ const { onClick: onPromptClicked, onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = (0, __envive_ai_react_toolkit_v3_PromptCarousel.usePromptCarouselAnalytics)(__envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.EMBEDDED_WIDGET, (text) => {
54
+ const rawValues = hardcopyContent?.rawValues;
55
+ return require_functions.getStringIdForText(rawValues, text);
56
+ });
50
57
  (0, react.useEffect)(() => {
51
58
  trackEvent({
52
59
  eventName: __envive_ai_react_hooks_contexts_amplitudeContext.SpiffyMetricsEventName.ChatComponentVisible,
@@ -73,6 +80,7 @@ const TypingAnimationWidgetHandler = (props) => {
73
80
  displayLocation: __envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.TYPING_ANIMATION
74
81
  });
75
82
  onToggle(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.TYPING_ANIMATION);
83
+ onPromptClicked(text);
76
84
  }, [
77
85
  hardcopyContent,
78
86
  trackEvent,
@@ -81,6 +89,13 @@ const TypingAnimationWidgetHandler = (props) => {
81
89
  ]);
82
90
  const handleTextFieldClick = (0, react.useCallback)(() => {
83
91
  onToggle(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.TYPING_ANIMATION);
92
+ trackWidgetInteraction({
93
+ eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
94
+ trigger: {
95
+ widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.EMBEDDED_WIDGET,
96
+ widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.QUERY_INPUT_CLICKED
97
+ }
98
+ });
84
99
  }, [onToggle]);
85
100
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_TypingAnimation.TypingAnimation, {
86
101
  baseProps: { id },
@@ -104,6 +119,12 @@ const TypingAnimationWidgetHandler = (props) => {
104
119
  },
105
120
  widgetEventProps: {
106
121
  handleButtonClick,
122
+ handleButtonDrag: onDrag,
123
+ handleButtonHover: onHover,
124
+ handleButtonMouseDown: onMouseDown,
125
+ handleButtonMouseUp: onMouseUp,
126
+ handleButtonTouchStart: onTouchStart,
127
+ handleButtonTouchEnd: onTouchEnd,
107
128
  handleTextFieldClick
108
129
  }
109
130
  });
@@ -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_runtime4 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_runtime0.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime4.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_runtime0.JSX.Element;
15
+ }: TypingAnimationWidgetProps): react_jsx_runtime4.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -4,15 +4,17 @@ import { getStringIdForText } from "../utils/functions.js";
4
4
  import { useCallback, useEffect } from "react";
5
5
  import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
6
6
  import { jsx } from "react/jsx-runtime";
7
+ import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
7
8
  import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
8
9
  import { useSetAtom } from "jotai";
9
- import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
10
10
  import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
11
- import { PromptCarouselRows } from "@envive-ai/react-toolkit-v3/PromptCarousel";
11
+ import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
12
+ import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
13
+ import { PromptCarouselRows, usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
12
14
  import { chatOnToggleAtom } from "@envive-ai/react-hooks/atoms/chat/chatState";
13
15
  import { PromptButtonVariant } from "@envive-ai/react-toolkit-v3/PromptButton/types";
14
- import { WidgetWrapperVariant } from "@envive-ai/react-toolkit-v3/WidgetWrapper";
15
16
  import { TypingAnimation } from "@envive-ai/react-toolkit-v3/TypingAnimation";
17
+ import { WidgetWrapperVariant } from "@envive-ai/react-toolkit-v3/WidgetWrapper";
16
18
 
17
19
  //#region src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx
18
20
  const mockButtonTexts = [
@@ -46,6 +48,11 @@ const TypingAnimationWidgetHandler = (props) => {
46
48
  const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
47
49
  const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
48
50
  const { trackEvent } = useAmplitude();
51
+ const { trackWidgetInteraction } = useWidgetInteraction();
52
+ const { onClick: onPromptClicked, onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = usePromptCarouselAnalytics(WidgetInteractionComponent.EMBEDDED_WIDGET, (text) => {
53
+ const rawValues = hardcopyContent?.rawValues;
54
+ return getStringIdForText(rawValues, text);
55
+ });
49
56
  useEffect(() => {
50
57
  trackEvent({
51
58
  eventName: SpiffyMetricsEventName.ChatComponentVisible,
@@ -72,6 +79,7 @@ const TypingAnimationWidgetHandler = (props) => {
72
79
  displayLocation: ChatElementDisplayLocationV3.TYPING_ANIMATION
73
80
  });
74
81
  onToggle(ChatElementDisplayLocationV3.TYPING_ANIMATION);
82
+ onPromptClicked(text);
75
83
  }, [
76
84
  hardcopyContent,
77
85
  trackEvent,
@@ -80,6 +88,13 @@ const TypingAnimationWidgetHandler = (props) => {
80
88
  ]);
81
89
  const handleTextFieldClick = useCallback(() => {
82
90
  onToggle(ChatElementDisplayLocationV3.TYPING_ANIMATION);
91
+ trackWidgetInteraction({
92
+ eventName: EnviveMetricsEventName.WidgetInteraction,
93
+ trigger: {
94
+ widget: WidgetInteractionComponent.EMBEDDED_WIDGET,
95
+ widget_interaction: WidgetInteractionType.QUERY_INPUT_CLICKED
96
+ }
97
+ });
83
98
  }, [onToggle]);
84
99
  return /* @__PURE__ */ jsx(TypingAnimation, {
85
100
  baseProps: { id },
@@ -103,6 +118,12 @@ const TypingAnimationWidgetHandler = (props) => {
103
118
  },
104
119
  widgetEventProps: {
105
120
  handleButtonClick,
121
+ handleButtonDrag: onDrag,
122
+ handleButtonHover: onHover,
123
+ handleButtonMouseDown: onMouseDown,
124
+ handleButtonMouseUp: onMouseUp,
125
+ handleButtonTouchStart: onTouchStart,
126
+ handleButtonTouchEnd: onTouchEnd,
106
127
  handleTextFieldClick
107
128
  }
108
129
  });
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime2 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
2
2
 
3
3
  //#region ../widgets/dist/SearchZeroState/SearchZeroStateWidget.d.ts
4
4
  //#region src/SearchZeroState/SearchZeroStateWidget.d.ts
@@ -11,7 +11,7 @@ declare const SearchZeroStateWidget: ({
11
11
  initialIsOpen,
12
12
  widgetConfigId,
13
13
  entryPointRef
14
- }: SearchZeroStateWidgetProps) => react_jsx_runtime2.JSX.Element;
14
+ }: SearchZeroStateWidgetProps) => react_jsx_runtime3.JSX.Element;
15
15
  //#endregion
16
16
 
17
17
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { SuggestionBarLocationForMetrics } from "./types.cjs";
2
- import * as react_jsx_runtime3 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
3
3
  import { SuggestionButtonVariant } from "@envive-ai/react-hooks/contexts/types";
4
4
  import { Message } from "postcss";
5
5
 
@@ -30,7 +30,7 @@ declare function SuggestionBar({
30
30
  buttonBorderRadius,
31
31
  handleReply,
32
32
  dataTestId
33
- }: Readonly<SuggestionBarProps>): react_jsx_runtime3.JSX.Element;
33
+ }: Readonly<SuggestionBarProps>): react_jsx_runtime2.JSX.Element;
34
34
  //#endregion
35
35
  //#endregion
36
36
  export { SuggestionBar };
@@ -1,8 +1,8 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
2
  const require_functions = require('../utils/functions.cjs');
3
3
  let react = require("react");
4
- let jotai = require("jotai");
5
4
  let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
5
+ let jotai = require("jotai");
6
6
  let __envive_ai_react_hooks_atoms_chat_chatState = require("@envive-ai/react-hooks/atoms/chat/chatState");
7
7
 
8
8
  //#region src/widgets/hooks/useGetWidgetStatus.tsx
@@ -1,7 +1,7 @@
1
1
  import { isLoading, isProductComparison, userHasInteracted, userHasNotInteracted } from "../utils/functions.js";
2
2
  import { useMemo } from "react";
3
- import { useAtomValue } from "jotai";
4
3
  import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
4
+ import { useAtomValue } from "jotai";
5
5
  import { responseStreamingAtom } from "@envive-ai/react-hooks/atoms/chat/chatState";
6
6
 
7
7
  //#region src/widgets/hooks/useGetWidgetStatus.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envive-ai/react-widgets-v3",
3
- "version": "0.3.15",
3
+ "version": "0.3.16",
4
4
  "description": "React widget library v3 for Envive services.",
5
5
  "keywords": [
6
6
  "react",