@envive-ai/react-widgets-v3 0.3.66 → 0.3.68

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 (74) hide show
  1. package/dist/CXIntegration/hooks/useUnifiedCXButton.cjs +1 -1
  2. package/dist/CXIntegration/hooks/useUnifiedCXButton.js +1 -1
  3. package/dist/debug/chatEmbed.cjs +3 -3
  4. package/dist/debug/chatEmbed.js +3 -3
  5. package/dist/debug/reportIssue.cjs +3 -3
  6. package/dist/debug/reportIssue.js +3 -3
  7. package/dist/hocs/withBaseWidget/types.d.ts +1 -1
  8. package/dist/hocs/withBaseWidget/withBaseWidget.cjs +2 -2
  9. package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +2 -2
  10. package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
  11. package/dist/hocs/withBaseWidget/withBaseWidget.js +2 -2
  12. package/dist/packages/widgets/dist/SuggestionButtonContainer/types.d.ts +2 -0
  13. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +8 -8
  14. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
  15. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +3 -3
  16. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +8 -8
  17. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs +3 -3
  18. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
  19. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
  20. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js +3 -3
  21. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +6 -6
  22. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
  23. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
  24. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +6 -6
  25. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +3 -3
  26. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
  27. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +2 -2
  28. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +3 -3
  29. package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.cjs +2 -2
  30. package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.js +2 -2
  31. package/dist/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.cjs +3 -3
  32. package/dist/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.js +3 -3
  33. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.cjs +2 -2
  34. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +2 -2
  35. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
  36. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.js +2 -2
  37. package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +6 -4
  38. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
  39. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
  40. package/dist/widgets/ProductCardWidget/ProductCardWidget.js +6 -4
  41. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +7 -7
  42. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
  43. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
  44. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +7 -7
  45. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +3 -3
  46. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
  47. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
  48. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +3 -3
  49. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.cjs +2 -2
  50. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
  51. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
  52. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +2 -2
  53. package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +9 -9
  54. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
  55. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
  56. package/dist/widgets/SocialProofWidget/SocialProofWidget.js +9 -9
  57. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +2 -2
  58. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
  59. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
  60. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +2 -2
  61. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.cjs +2 -2
  62. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
  63. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
  64. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +2 -2
  65. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +4 -4
  66. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
  67. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
  68. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +4 -4
  69. package/dist/widgets/dist/SuggestionButtonContainer/types.d.cts +2 -0
  70. package/dist/widgets/hooks/useGetWidgetStatus.cjs +1 -1
  71. package/dist/widgets/hooks/useGetWidgetStatus.js +1 -1
  72. package/package.json +1 -1
  73. package/src/widgets/ProductCardWidget/ProductCardWidget.tsx +2 -0
  74. package/src/widgets/ProductCardWidget/__tests__/ProductCardWidget.test.tsx +24 -1
@@ -1,11 +1,11 @@
1
1
  import { ChatPreviewLoadingWidgetWithBaseWidget } from "../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js";
2
- import { ChatPreviewComparisonWidgetWithBaseWidget } from "../ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js";
3
2
  import { ChatPreviewWidgetWithBaseWidget } from "../ChatPreviewWidget/ChatPreviewWidget.js";
4
3
  import useGetWidgetStatus_default from "../hooks/useGetWidgetStatus.js";
4
+ import { ChatPreviewComparisonWidgetWithBaseWidget } from "../ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js";
5
5
  import { TypingAnimationWithBaseWidget } from "../TypingAnimationWidget/TypingAnimationWidget.js";
6
- import { jsx } from "react/jsx-runtime";
7
6
  import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
8
7
  import { ChatPreviewLoading } from "@envive-ai/react-toolkit-v3/ChatPreviewLoading";
8
+ import { jsx } from "react/jsx-runtime";
9
9
 
10
10
  //#region src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.tsx
11
11
  const TypingAnimationFlowWidget = ({ widgetConfigId }) => {
@@ -2,17 +2,17 @@ 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
4
  const require_functions = require('../utils/functions.cjs');
5
+ let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
6
+ let __envive_ai_react_hooks_contexts_featureFlagServiceContext = require("@envive-ai/react-hooks/contexts/featureFlagServiceContext");
7
+ let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
5
8
  let react = require("react");
6
9
  let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
7
- let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
8
- let __envive_ai_react_hooks_contexts_featureFlagServiceContext = require("@envive-ai/react-hooks/contexts/featureFlagServiceContext");
9
10
  let react_jsx_runtime = require("react/jsx-runtime");
10
11
  let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
11
- let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
12
12
  let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
13
- let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
14
13
  let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
15
14
  let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
15
+ let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
16
16
  let __envive_ai_react_toolkit_v3_PromptButton_types = require("@envive-ai/react-toolkit-v3/PromptButton/types");
17
17
  let __envive_ai_react_toolkit_v3_TypingAnimation = require("@envive-ai/react-toolkit-v3/TypingAnimation");
18
18
  let __envive_ai_react_toolkit_v3_WidgetWrapper = require("@envive-ai/react-toolkit-v3/WidgetWrapper");
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
- import * as react_jsx_runtime14 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime17 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_runtime14.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime17.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_runtime14.JSX.Element;
15
+ }: TypingAnimationWidgetProps): 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_runtime2 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime8 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_runtime8.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_runtime8.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,17 +1,17 @@
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 { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
5
+ import { useFeatureFlagService } from "@envive-ai/react-hooks/contexts/featureFlagServiceContext";
6
+ import { ChatElementDisplayLocationV3, FeatureGates } from "@envive-ai/react-hooks/application/models";
4
7
  import { useCallback } from "react";
5
8
  import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
6
- import { ChatElementDisplayLocationV3, FeatureGates } from "@envive-ai/react-hooks/application/models";
7
- import { useFeatureFlagService } from "@envive-ai/react-hooks/contexts/featureFlagServiceContext";
8
9
  import { jsx } from "react/jsx-runtime";
9
10
  import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
10
- import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
11
11
  import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
12
- import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
13
12
  import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
14
13
  import { PromptCarouselRows, usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
14
+ import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
15
15
  import { PromptButtonVariant } from "@envive-ai/react-toolkit-v3/PromptButton/types";
16
16
  import { TypingAnimation } from "@envive-ai/react-toolkit-v3/TypingAnimation";
17
17
  import { WidgetWrapperVariant } from "@envive-ai/react-toolkit-v3/WidgetWrapper";
@@ -13,6 +13,8 @@ interface SuggestionButtonContainerProps extends TestProps {
13
13
  twoRowsOnMobile?: boolean | undefined;
14
14
  animationSpeed?: 'standard' | 'slow' | 'none';
15
15
  buttonBorderRadius?: 'sm' | 'md' | 'lg';
16
+ /** Pauses the auto-scroll animation until toggled back (user pause/play control). */
17
+ isUserPaused?: boolean;
16
18
  }
17
19
  //#endregion
18
20
  //#endregion
@@ -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
+ let jotai = require("jotai");
3
4
  let react = require("react");
4
5
  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
+ import { useAtomValue } from "jotai";
2
3
  import { useMemo } from "react";
3
4
  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.66",
3
+ "version": "0.3.68",
4
4
  "description": "React widget library v3 for Envive services.",
5
5
  "keywords": [
6
6
  "react",
@@ -50,6 +50,7 @@ const ProductCardWidgetHandler = (props: BaseWidgetProps) => {
50
50
  const carouselId = productCardWidgetConfig?.contentId || '';
51
51
  const promptButtonType =
52
52
  (productCardWidgetConfig?.promptButtonType as PromptButtonVariant) || PromptButtonVariant.LIGHT;
53
+ const promptButtonLayout = productCardWidgetConfig?.promptButtonLayout;
53
54
  const italicizeHeadline = productCardWidgetConfig?.italicizeHeadline;
54
55
  const fallbackColor = productCardWidgetConfig?.fallbackColor;
55
56
  const imageSrc = productCardWidgetConfig?.imageSrc || '';
@@ -143,6 +144,7 @@ const ProductCardWidgetHandler = (props: BaseWidgetProps) => {
143
144
  animatedText={animatedText}
144
145
  prompts={prompts}
145
146
  promptButtonType={promptButtonType}
147
+ promptButtonLayout={promptButtonLayout}
146
148
  carouselId={carouselId}
147
149
  placeholder={placeholder}
148
150
  voiceInputEnabled={isVoiceInputEnabled}
@@ -6,6 +6,7 @@ import { ProductCardWidget } from '../ProductCardWidget';
6
6
 
7
7
  const mockTrackEvent = vi.fn();
8
8
  const mockGetHardcopy = vi.fn();
9
+ const mockGetWidgetConfig = vi.fn();
9
10
  const mockUseTrackComponentVisibleEvent = vi.fn(() => ({ isVisible: true }));
10
11
 
11
12
  vi.mock('@envive-ai/react-toolkit-v3/ProductCard', () => ({
@@ -16,14 +17,17 @@ vi.mock('@envive-ai/react-toolkit-v3/ProductCard', () => ({
16
17
  prompts,
17
18
  onSelect,
18
19
  isLoading,
20
+ promptButtonLayout,
19
21
  }: {
20
22
  prompts: string[];
21
23
  onSelect: (text: string) => void;
22
24
  isLoading?: boolean;
25
+ promptButtonLayout?: string;
23
26
  }) => (
24
27
  <div
25
28
  data-testid="product-card-mock"
26
29
  data-loading={String(Boolean(isLoading))}
30
+ data-prompt-button-layout={promptButtonLayout}
27
31
  >
28
32
  {prompts.map(text => (
29
33
  <button
@@ -84,7 +88,7 @@ vi.mock('@envive-ai/react-hooks/contexts/pageContext', () => ({
84
88
 
85
89
  vi.mock('@envive-ai/react-hooks/contexts/widgetConfigContext', () => ({
86
90
  useWidgetConfig: () => ({
87
- getWidgetConfig: vi.fn().mockResolvedValue({}),
91
+ getWidgetConfig: mockGetWidgetConfig,
88
92
  }),
89
93
  }));
90
94
 
@@ -124,6 +128,24 @@ describe('ProductCardWidget analytics', () => {
124
128
  beforeEach(() => {
125
129
  vi.clearAllMocks();
126
130
  mockGetHardcopy.mockResolvedValue(defaultHardcopy);
131
+ mockGetWidgetConfig.mockResolvedValue({});
132
+ });
133
+
134
+ it('passes promptButtonLayout from the widget config through to the ProductCard', async () => {
135
+ mockGetWidgetConfig.mockResolvedValue({
136
+ widgetConfigId: 'layout-1',
137
+ type: WidgetTypeV3.ProductCardV3,
138
+ promptButtonLayout: 'stacked',
139
+ });
140
+
141
+ render(<ProductCardWidget widgetConfigId="layout-1" />);
142
+
143
+ await waitFor(() =>
144
+ expect(screen.getByTestId('product-card-mock')).toHaveAttribute(
145
+ 'data-prompt-button-layout',
146
+ 'stacked',
147
+ ),
148
+ );
127
149
  });
128
150
 
129
151
  it('should track ChatComponentVisible when widget mounts', async () => {
@@ -174,6 +196,7 @@ describe('ProductCardWidget analytics', () => {
174
196
  describe('ProductCardWidget loading state', () => {
175
197
  beforeEach(() => {
176
198
  vi.clearAllMocks();
199
+ mockGetWidgetConfig.mockResolvedValue({});
177
200
  });
178
201
 
179
202
  const hardcopy = {