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

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 (32) hide show
  1. package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +2 -2
  2. package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
  3. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +3 -3
  4. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
  5. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
  6. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
  7. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
  8. package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.cjs +44 -21
  9. package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.js +44 -21
  10. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +4 -1
  11. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
  12. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +2 -2
  13. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +4 -1
  14. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +2 -2
  15. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
  16. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
  17. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
  18. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
  19. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
  20. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
  21. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
  22. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
  23. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
  24. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
  25. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
  26. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
  27. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
  28. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
  29. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
  30. package/package.json +1 -1
  31. package/src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx +48 -13
  32. package/src/widgets/FloatingChatWidget/FloatingChatWidget.tsx +4 -1
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps, WithBaseWidgetOptions } from "./types.cjs";
2
- import * as react_jsx_runtime19 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/hocs/withBaseWidget/withBaseWidget.d.ts
5
5
  declare function withBaseWidget<P extends BaseWidgetProps>(Widget: React.ComponentType<P>, options?: WithBaseWidgetOptions): {
6
- (props: P): react_jsx_runtime19.JSX.Element;
6
+ (props: P): react_jsx_runtime10.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps, WithBaseWidgetOptions } from "./types.js";
2
- import * as react_jsx_runtime12 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime19 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/hocs/withBaseWidget/withBaseWidget.d.ts
5
5
  declare function withBaseWidget<P extends BaseWidgetProps>(Widget: React.ComponentType<P>, options?: WithBaseWidgetOptions): {
6
- (props: P): react_jsx_runtime12.JSX.Element;
6
+ (props: P): react_jsx_runtime19.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  //#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_runtime14 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts
5
5
  declare const ChatPreviewComparisonWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime4.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime14.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface ChatPreviewComparisonWidgetProps {
@@ -12,7 +12,7 @@ interface ChatPreviewComparisonWidgetProps {
12
12
  declare const ChatPreviewComparisonWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: ChatPreviewComparisonWidgetProps): react_jsx_runtime4.JSX.Element;
15
+ }: ChatPreviewComparisonWidgetProps): react_jsx_runtime14.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
- import * as react_jsx_runtime7 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime15 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts
5
5
  declare const ChatPreviewLoadingWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime7.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime15.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface ChatPreviewLoadingWidgetProps {
@@ -11,6 +11,6 @@ interface ChatPreviewLoadingWidgetProps {
11
11
  }
12
12
  declare const ChatPreviewLoadingWidget: ({
13
13
  widgetConfigId
14
- }: ChatPreviewLoadingWidgetProps) => react_jsx_runtime7.JSX.Element;
14
+ }: ChatPreviewLoadingWidgetProps) => react_jsx_runtime15.JSX.Element;
15
15
  //#endregion
16
16
  export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetProps, ChatPreviewLoadingWidgetWithBaseWidget };
@@ -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_runtime10 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts
5
5
  declare const ChatPreviewLoadingWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime6.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime10.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface ChatPreviewLoadingWidgetProps {
@@ -11,6 +11,6 @@ interface ChatPreviewLoadingWidgetProps {
11
11
  }
12
12
  declare const ChatPreviewLoadingWidget: ({
13
13
  widgetConfigId
14
- }: ChatPreviewLoadingWidgetProps) => react_jsx_runtime6.JSX.Element;
14
+ }: ChatPreviewLoadingWidgetProps) => react_jsx_runtime10.JSX.Element;
15
15
  //#endregion
16
16
  export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetProps, ChatPreviewLoadingWidgetWithBaseWidget };
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
- import * as react_jsx_runtime10 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts
5
5
  declare const ChatPreviewWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime10.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime8.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface ChatPreviewWidgetProps {
@@ -12,7 +12,7 @@ interface ChatPreviewWidgetProps {
12
12
  declare const ChatPreviewWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: ChatPreviewWidgetProps): react_jsx_runtime10.JSX.Element;
15
+ }: ChatPreviewWidgetProps): react_jsx_runtime8.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_runtime9 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime17 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts
5
5
  declare const ChatPreviewWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime9.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime17.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface ChatPreviewWidgetProps {
@@ -12,7 +12,7 @@ interface ChatPreviewWidgetProps {
12
12
  declare const ChatPreviewWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: ChatPreviewWidgetProps): react_jsx_runtime9.JSX.Element;
15
+ }: ChatPreviewWidgetProps): react_jsx_runtime17.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -3,26 +3,59 @@ let react_jsx_runtime = require("react/jsx-runtime");
3
3
  let classnames = require("classnames");
4
4
  classnames = require_rolldown_runtime.__toESM(classnames);
5
5
  let framer_motion = require("framer-motion");
6
+ let __envive_ai_react_toolkit_v3_utils_useCheckIsMobile = require("@envive-ai/react-toolkit-v3/utils/useCheckIsMobile");
6
7
 
7
8
  //#region src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx
8
- const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestId, previewMode = false }) => {
9
+ const ANIMATION_DURATION = .3;
10
+ const useOverlayAnimations = ({ previewMode, isMobile }) => {
11
+ if (previewMode) return {
12
+ overlayExitAnimation: {
13
+ opacity: 0,
14
+ x: 0
15
+ },
16
+ overlayAnimation: {
17
+ opacity: 1,
18
+ x: 0
19
+ }
20
+ };
21
+ if (isMobile) return {
22
+ overlayExitAnimation: { opacity: 0 },
23
+ overlayAnimation: { opacity: 1 }
24
+ };
25
+ return {
26
+ overlayExitAnimation: {
27
+ opacity: 0,
28
+ x: 512
29
+ },
30
+ overlayAnimation: {
31
+ opacity: 1,
32
+ x: 0
33
+ }
34
+ };
35
+ };
36
+ const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestId, previewMode = false, isResultsModalOpen = false }) => {
37
+ const { isMobile } = (0, __envive_ai_react_toolkit_v3_utils_useCheckIsMobile.useCheckIsMobile)();
38
+ const { overlayExitAnimation, overlayAnimation } = useOverlayAnimations({
39
+ previewMode,
40
+ isMobile
41
+ });
9
42
  const overlayClasses = (0, classnames.default)(previewMode ? "envive-tw-absolute" : "envive-tw-fixed", "envive-tw-top-0", "envive-tw-left-0", previewMode ? "envive-tw-h-full" : "envive-tw-h-screen", "envive-tw-w-full", "envive-tw-z-[2147483647]", className);
10
- const backdropClasses = (0, classnames.default)("envive-tw-absolute", "envive-tw-top-0", "envive-tw-left-0", "envive-tw-h-full", "envive-tw-w-full", "envive-tw-bg-black", "envive-tw-opacity-50", "envive-tw-pointer-events-none", "envive-tw-z-0");
43
+ const backdropClasses = (0, classnames.default)("envive-tw-absolute", "envive-tw-top-0", "envive-tw-left-0", "envive-tw-h-full", "envive-tw-w-full", isMobile ? "envive-tw-bg-black" : "", "envive-tw-opacity-50", "envive-tw-pointer-events-none", "envive-tw-z-0");
11
44
  const overlayContentClasses = (0, classnames.default)("envive-tw-relative", "envive-tw-flex", "envive-tw-justify-end", "envive-tw-items-stretch", "envive-tw-h-full", "envive-tw-w-full", "envive-tw-pointer-events-auto", "envive-tw-cursor-pointer", "envive-tw-z-10");
12
- const chatWrapper = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.AnimatePresence, { children: isOpened && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(framer_motion.motion.div, {
45
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.AnimatePresence, { children: isOpened && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(framer_motion.motion.div, {
13
46
  className: overlayClasses,
14
47
  style: { top: "0px" },
15
48
  initial: { opacity: 0 },
16
49
  animate: { opacity: 1 },
17
50
  exit: { opacity: 0 },
18
- transition: { duration: .3 },
51
+ transition: { duration: ANIMATION_DURATION },
19
52
  "data-testid": dataTestId,
20
53
  children: [!previewMode && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
21
54
  className: backdropClasses,
22
55
  initial: { opacity: 0 },
23
56
  animate: { opacity: .5 },
24
57
  exit: { opacity: 0 },
25
- transition: { duration: .3 },
58
+ transition: { duration: ANIMATION_DURATION },
26
59
  "aria-label": "Close chat"
27
60
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
28
61
  className: overlayContentClasses,
@@ -35,22 +68,14 @@ const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestI
35
68
  tabIndex: 0,
36
69
  "aria-label": "Close floating chat",
37
70
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
38
- initial: {
39
- opacity: 0,
40
- x: previewMode ? 0 : 512
41
- },
42
- animate: {
43
- opacity: 1,
44
- x: 0
45
- },
46
- exit: {
47
- opacity: 0,
48
- x: previewMode ? 0 : 512
49
- },
50
- transition: { duration: .3 },
71
+ initial: overlayExitAnimation,
72
+ animate: overlayAnimation,
73
+ exit: overlayExitAnimation,
74
+ transition: { duration: ANIMATION_DURATION },
51
75
  style: {
52
76
  height: previewMode ? "100%" : "100dvh",
53
- cursor: "default"
77
+ cursor: "default",
78
+ margin: isResultsModalOpen ? "0 auto" : "0"
54
79
  },
55
80
  className: "envive-tw-shadow-md",
56
81
  onClick: (e) => e.stopPropagation(),
@@ -58,8 +83,6 @@ const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestI
58
83
  })
59
84
  })]
60
85
  }, "floating-chat-overlay") });
61
- if (previewMode) return chatWrapper;
62
- return chatWrapper;
63
86
  };
64
87
  FloatingChatOverlay.displayName = "FloatingChatOverlay";
65
88
 
@@ -1,26 +1,59 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import classNames from "classnames";
3
3
  import { AnimatePresence, motion } from "framer-motion";
4
+ import { useCheckIsMobile } from "@envive-ai/react-toolkit-v3/utils/useCheckIsMobile";
4
5
 
5
6
  //#region src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx
6
- const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestId, previewMode = false }) => {
7
+ const ANIMATION_DURATION = .3;
8
+ const useOverlayAnimations = ({ previewMode, isMobile }) => {
9
+ if (previewMode) return {
10
+ overlayExitAnimation: {
11
+ opacity: 0,
12
+ x: 0
13
+ },
14
+ overlayAnimation: {
15
+ opacity: 1,
16
+ x: 0
17
+ }
18
+ };
19
+ if (isMobile) return {
20
+ overlayExitAnimation: { opacity: 0 },
21
+ overlayAnimation: { opacity: 1 }
22
+ };
23
+ return {
24
+ overlayExitAnimation: {
25
+ opacity: 0,
26
+ x: 512
27
+ },
28
+ overlayAnimation: {
29
+ opacity: 1,
30
+ x: 0
31
+ }
32
+ };
33
+ };
34
+ const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestId, previewMode = false, isResultsModalOpen = false }) => {
35
+ const { isMobile } = useCheckIsMobile();
36
+ const { overlayExitAnimation, overlayAnimation } = useOverlayAnimations({
37
+ previewMode,
38
+ isMobile
39
+ });
7
40
  const overlayClasses = classNames(previewMode ? "envive-tw-absolute" : "envive-tw-fixed", "envive-tw-top-0", "envive-tw-left-0", previewMode ? "envive-tw-h-full" : "envive-tw-h-screen", "envive-tw-w-full", "envive-tw-z-[2147483647]", className);
8
- const backdropClasses = classNames("envive-tw-absolute", "envive-tw-top-0", "envive-tw-left-0", "envive-tw-h-full", "envive-tw-w-full", "envive-tw-bg-black", "envive-tw-opacity-50", "envive-tw-pointer-events-none", "envive-tw-z-0");
41
+ const backdropClasses = classNames("envive-tw-absolute", "envive-tw-top-0", "envive-tw-left-0", "envive-tw-h-full", "envive-tw-w-full", isMobile ? "envive-tw-bg-black" : "", "envive-tw-opacity-50", "envive-tw-pointer-events-none", "envive-tw-z-0");
9
42
  const overlayContentClasses = classNames("envive-tw-relative", "envive-tw-flex", "envive-tw-justify-end", "envive-tw-items-stretch", "envive-tw-h-full", "envive-tw-w-full", "envive-tw-pointer-events-auto", "envive-tw-cursor-pointer", "envive-tw-z-10");
10
- const chatWrapper = /* @__PURE__ */ jsx(AnimatePresence, { children: isOpened && /* @__PURE__ */ jsxs(motion.div, {
43
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: isOpened && /* @__PURE__ */ jsxs(motion.div, {
11
44
  className: overlayClasses,
12
45
  style: { top: "0px" },
13
46
  initial: { opacity: 0 },
14
47
  animate: { opacity: 1 },
15
48
  exit: { opacity: 0 },
16
- transition: { duration: .3 },
49
+ transition: { duration: ANIMATION_DURATION },
17
50
  "data-testid": dataTestId,
18
51
  children: [!previewMode && /* @__PURE__ */ jsx(motion.div, {
19
52
  className: backdropClasses,
20
53
  initial: { opacity: 0 },
21
54
  animate: { opacity: .5 },
22
55
  exit: { opacity: 0 },
23
- transition: { duration: .3 },
56
+ transition: { duration: ANIMATION_DURATION },
24
57
  "aria-label": "Close chat"
25
58
  }), /* @__PURE__ */ jsx("div", {
26
59
  className: overlayContentClasses,
@@ -33,22 +66,14 @@ const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestI
33
66
  tabIndex: 0,
34
67
  "aria-label": "Close floating chat",
35
68
  children: /* @__PURE__ */ jsx(motion.div, {
36
- initial: {
37
- opacity: 0,
38
- x: previewMode ? 0 : 512
39
- },
40
- animate: {
41
- opacity: 1,
42
- x: 0
43
- },
44
- exit: {
45
- opacity: 0,
46
- x: previewMode ? 0 : 512
47
- },
48
- transition: { duration: .3 },
69
+ initial: overlayExitAnimation,
70
+ animate: overlayAnimation,
71
+ exit: overlayExitAnimation,
72
+ transition: { duration: ANIMATION_DURATION },
49
73
  style: {
50
74
  height: previewMode ? "100%" : "100dvh",
51
- cursor: "default"
75
+ cursor: "default",
76
+ margin: isResultsModalOpen ? "0 auto" : "0"
52
77
  },
53
78
  className: "envive-tw-shadow-md",
54
79
  onClick: (e) => e.stopPropagation(),
@@ -56,8 +81,6 @@ const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestI
56
81
  })
57
82
  })]
58
83
  }, "floating-chat-overlay") });
59
- if (previewMode) return chatWrapper;
60
- return chatWrapper;
61
84
  };
62
85
  FloatingChatOverlay.displayName = "FloatingChatOverlay";
63
86
 
@@ -52,6 +52,7 @@ const FloatingChatWidgetHandler = (props) => {
52
52
  const cxProvider = customerServiceIntegration?.provider ?? require_types.CustomerServiceType.unsupported;
53
53
  const { isOpen, openChat, closeChat, onHover } = (0, __envive_ai_react_hooks_hooks_ChatToggle.useChatToggle)();
54
54
  const [isCXOpen, setIsCXOpen] = (0, react.useState)(false);
55
+ const [isResultsModalOpen, setIsResultsModalOpen] = (0, react.useState)(false);
55
56
  (0, react.useEffect)(() => {
56
57
  if (isOpen) setIsCXOpen(false);
57
58
  }, [isOpen]);
@@ -97,14 +98,16 @@ const FloatingChatWidgetHandler = (props) => {
97
98
  suppressMerchantButton: customerServiceIntegration?.suppressMerchantButton ?? false,
98
99
  onSwitchToAgent: () => setIsCXOpen(true),
99
100
  onCXClose: () => setIsCXOpen(false),
100
- children: ({ isSwitchEnabled, toggle }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(previewChatAlwaysOpen || effectiveIsOpen) && !previewButtonOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FloatingChatOverlay.FloatingChatOverlay, {
101
+ children: ({ isSwitchEnabled, toggle }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [!previewButtonOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FloatingChatOverlay.FloatingChatOverlay, {
101
102
  isOpened: effectiveIsOpen,
103
+ isResultsModalOpen,
102
104
  onClose: previewChatAlwaysOpen ? () => {} : () => {
103
105
  closeChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_OVERLAY);
104
106
  handleClose({ collapse_source: "body_click" });
105
107
  },
106
108
  previewMode: !!previewChatAlwaysOpen,
107
109
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FloatingChat, {
110
+ setIsResultsModalOpen,
108
111
  theme,
109
112
  salesAgentData,
110
113
  hardcopyContent,
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime12 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime13 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts
4
4
  interface FloatingChatWidgetProps {
@@ -9,7 +9,7 @@ declare const FloatingChatWidget: {
9
9
  ({
10
10
  previewButtonOnly,
11
11
  previewChatAlwaysOpen
12
- }?: FloatingChatWidgetProps): react_jsx_runtime12.JSX.Element;
12
+ }?: FloatingChatWidgetProps): react_jsx_runtime13.JSX.Element;
13
13
  displayName: string;
14
14
  };
15
15
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime11 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime16 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts
4
4
  interface FloatingChatWidgetProps {
@@ -9,7 +9,7 @@ declare const FloatingChatWidget: {
9
9
  ({
10
10
  previewButtonOnly,
11
11
  previewChatAlwaysOpen
12
- }?: FloatingChatWidgetProps): react_jsx_runtime11.JSX.Element;
12
+ }?: FloatingChatWidgetProps): react_jsx_runtime16.JSX.Element;
13
13
  displayName: string;
14
14
  };
15
15
  //#endregion
@@ -51,6 +51,7 @@ const FloatingChatWidgetHandler = (props) => {
51
51
  const cxProvider = customerServiceIntegration?.provider ?? CustomerServiceType.unsupported;
52
52
  const { isOpen, openChat, closeChat, onHover } = useChatToggle();
53
53
  const [isCXOpen, setIsCXOpen] = useState(false);
54
+ const [isResultsModalOpen, setIsResultsModalOpen] = useState(false);
54
55
  useEffect(() => {
55
56
  if (isOpen) setIsCXOpen(false);
56
57
  }, [isOpen]);
@@ -96,14 +97,16 @@ const FloatingChatWidgetHandler = (props) => {
96
97
  suppressMerchantButton: customerServiceIntegration?.suppressMerchantButton ?? false,
97
98
  onSwitchToAgent: () => setIsCXOpen(true),
98
99
  onCXClose: () => setIsCXOpen(false),
99
- children: ({ isSwitchEnabled, toggle }) => /* @__PURE__ */ jsxs(Fragment, { children: [(previewChatAlwaysOpen || effectiveIsOpen) && !previewButtonOnly && /* @__PURE__ */ jsx(FloatingChatOverlay, {
100
+ children: ({ isSwitchEnabled, toggle }) => /* @__PURE__ */ jsxs(Fragment, { children: [!previewButtonOnly && /* @__PURE__ */ jsx(FloatingChatOverlay, {
100
101
  isOpened: effectiveIsOpen,
102
+ isResultsModalOpen,
101
103
  onClose: previewChatAlwaysOpen ? () => {} : () => {
102
104
  closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_OVERLAY);
103
105
  handleClose({ collapse_source: "body_click" });
104
106
  },
105
107
  previewMode: !!previewChatAlwaysOpen,
106
108
  children: /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(FloatingChat, {
109
+ setIsResultsModalOpen,
107
110
  theme,
108
111
  salesAgentData,
109
112
  hardcopyContent,
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime11 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_runtime11.JSX.Element;
12
12
  displayName: string;
13
13
  };
14
14
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime13 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 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_runtime13.JSX.Element;
11
+ }: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime0.JSX.Element;
12
12
  displayName: string;
13
13
  };
14
14
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime3 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime14 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_runtime3.JSX.Element;
10
+ }: ProductCardWidgetProps): react_jsx_runtime14.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_runtime12 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_runtime2.JSX.Element;
10
+ }: ProductCardWidgetProps): react_jsx_runtime12.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
- import * as react_jsx_runtime15 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime17 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_runtime15.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime17.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_runtime15.JSX.Element;
15
+ }: PromptButtonCarouselWithImageWidgetProps): 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_runtime17 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime8 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_runtime8.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_runtime8.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime8 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime13 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_runtime8.JSX.Element;
10
+ }: PromptCarouselWidgetProps): react_jsx_runtime13.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime3 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 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_runtime3.JSX.Element;
10
+ }: SocialProofFlowWidgetProps): react_jsx_runtime0.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -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_runtime0 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_runtime17.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime0.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_runtime17.JSX.Element;
15
+ }: SocialProofWidgetProps): react_jsx_runtime0.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_runtime6 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_runtime6.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_runtime6.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime9 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime7 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_runtime9.JSX.Element;
10
+ }: TitledPromptCarouselWidgetProps): react_jsx_runtime7.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts
4
4
  interface TitledPromptCarouselWidgetProps {
@@ -7,7 +7,7 @@ interface TitledPromptCarouselWidgetProps {
7
7
  declare const TitledPromptCarouselWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: TitledPromptCarouselWidgetProps): react_jsx_runtime0.JSX.Element;
10
+ }: TitledPromptCarouselWidgetProps): react_jsx_runtime2.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime2 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime19 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_runtime19.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime19 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_runtime19.JSX.Element;
10
+ }: TypingAnimationFlowWidgetProps): react_jsx_runtime3.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
- import * as react_jsx_runtime13 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime2 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_runtime13.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime2.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_runtime13.JSX.Element;
15
+ }: TypingAnimationWidgetProps): react_jsx_runtime2.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_runtime15 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_runtime15.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_runtime15.JSX.Element;
15
+ }: TypingAnimationWidgetProps): react_jsx_runtime4.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envive-ai/react-widgets-v3",
3
- "version": "0.3.19",
3
+ "version": "0.3.20",
4
4
  "description": "React widget library v3 for Envive services.",
5
5
  "keywords": [
6
6
  "react",
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { AnimatePresence, motion } from 'framer-motion';
3
3
  import classNames from 'classnames';
4
+ import { useCheckIsMobile } from '@envive-ai/react-toolkit-v3/utils/useCheckIsMobile';
4
5
 
5
6
  export interface FloatingChatOverlayProps {
6
7
  children?: ReactNode;
@@ -9,8 +10,36 @@ export interface FloatingChatOverlayProps {
9
10
  className?: string;
10
11
  dataTestId?: string;
11
12
  previewMode?: boolean;
13
+ isResultsModalOpen?: boolean;
12
14
  }
13
15
 
16
+ const ANIMATION_DURATION = 0.3;
17
+
18
+ const useOverlayAnimations = ({
19
+ previewMode,
20
+ isMobile,
21
+ }: {
22
+ previewMode: boolean;
23
+ isMobile: boolean;
24
+ }) => {
25
+ if (previewMode) {
26
+ return {
27
+ overlayExitAnimation: { opacity: 0, x: 0 },
28
+ overlayAnimation: { opacity: 1, x: 0 },
29
+ };
30
+ }
31
+ if (isMobile) {
32
+ return {
33
+ overlayExitAnimation: { opacity: 0 },
34
+ overlayAnimation: { opacity: 1 },
35
+ };
36
+ }
37
+ return {
38
+ overlayExitAnimation: { opacity: 0, x: 512 },
39
+ overlayAnimation: { opacity: 1, x: 0 },
40
+ };
41
+ };
42
+
14
43
  export const FloatingChatOverlay = ({
15
44
  children,
16
45
  isOpened,
@@ -18,7 +47,14 @@ export const FloatingChatOverlay = ({
18
47
  className,
19
48
  dataTestId,
20
49
  previewMode = false,
50
+ isResultsModalOpen = false,
21
51
  }: FloatingChatOverlayProps) => {
52
+ const { isMobile } = useCheckIsMobile();
53
+ const { overlayExitAnimation, overlayAnimation } = useOverlayAnimations({
54
+ previewMode,
55
+ isMobile,
56
+ });
57
+
22
58
  const overlayClasses = classNames(
23
59
  previewMode ? 'envive-tw-absolute' : 'envive-tw-fixed',
24
60
  'envive-tw-top-0',
@@ -35,7 +71,7 @@ export const FloatingChatOverlay = ({
35
71
  'envive-tw-left-0',
36
72
  'envive-tw-h-full',
37
73
  'envive-tw-w-full',
38
- 'envive-tw-bg-black',
74
+ isMobile ? 'envive-tw-bg-black' : '',
39
75
  'envive-tw-opacity-50',
40
76
  'envive-tw-pointer-events-none',
41
77
  'envive-tw-z-0',
@@ -63,7 +99,7 @@ export const FloatingChatOverlay = ({
63
99
  initial={{ opacity: 0 }}
64
100
  animate={{ opacity: 1 }}
65
101
  exit={{ opacity: 0 }}
66
- transition={{ duration: 0.3 }}
102
+ transition={{ duration: ANIMATION_DURATION }}
67
103
  data-testid={dataTestId}
68
104
  >
69
105
  {!previewMode && (
@@ -72,7 +108,7 @@ export const FloatingChatOverlay = ({
72
108
  initial={{ opacity: 0 }}
73
109
  animate={{ opacity: 0.5 }}
74
110
  exit={{ opacity: 0 }}
75
- transition={{ duration: 0.3 }}
111
+ transition={{ duration: ANIMATION_DURATION }}
76
112
  aria-label="Close chat"
77
113
  />
78
114
  )}
@@ -90,11 +126,15 @@ export const FloatingChatOverlay = ({
90
126
  aria-label="Close floating chat"
91
127
  >
92
128
  <motion.div
93
- initial={{ opacity: 0, x: previewMode ? 0 : 512 }}
94
- animate={{ opacity: 1, x: 0 }}
95
- exit={{ opacity: 0, x: previewMode ? 0 : 512 }}
96
- transition={{ duration: 0.3 }}
97
- style={{ height: previewMode ? '100%' : '100dvh', cursor: 'default' }}
129
+ initial={overlayExitAnimation}
130
+ animate={overlayAnimation}
131
+ exit={overlayExitAnimation}
132
+ transition={{ duration: ANIMATION_DURATION }}
133
+ style={{
134
+ height: previewMode ? '100%' : '100dvh',
135
+ cursor: 'default',
136
+ margin: isResultsModalOpen ? '0 auto' : '0',
137
+ }}
98
138
  className="envive-tw-shadow-md"
99
139
  onClick={e => e.stopPropagation()}
100
140
  >
@@ -106,11 +146,6 @@ export const FloatingChatOverlay = ({
106
146
  </AnimatePresence>
107
147
  );
108
148
 
109
- // In preview mode, render inline. Otherwise use portal to body
110
- if (previewMode) {
111
- return chatWrapper;
112
- }
113
-
114
149
  return chatWrapper;
115
150
  };
116
151
 
@@ -96,6 +96,7 @@ const FloatingChatWidgetHandler = (props: FloatingChatWidgetHandlerProps) => {
96
96
  const { isOpen, openChat, closeChat, onHover } = useChatToggle();
97
97
 
98
98
  const [isCXOpen, setIsCXOpen] = useState(false);
99
+ const [isResultsModalOpen, setIsResultsModalOpen] = useState(false);
99
100
 
100
101
  // Reset CX open state when the envive widget is reopened
101
102
  useEffect(() => {
@@ -166,9 +167,10 @@ const FloatingChatWidgetHandler = (props: FloatingChatWidgetHandlerProps) => {
166
167
  {({ isSwitchEnabled, toggle }) => (
167
168
  <>
168
169
  {/* Render chat when always open preview OR when normally open */}
169
- {(previewChatAlwaysOpen || effectiveIsOpen) && !previewButtonOnly && (
170
+ {!previewButtonOnly && (
170
171
  <FloatingChatOverlay
171
172
  isOpened={effectiveIsOpen}
173
+ isResultsModalOpen={isResultsModalOpen}
172
174
  onClose={
173
175
  previewChatAlwaysOpen
174
176
  ? () => {}
@@ -183,6 +185,7 @@ const FloatingChatWidgetHandler = (props: FloatingChatWidgetHandlerProps) => {
183
185
  >
184
186
  <Suspense>
185
187
  <FloatingChat
188
+ setIsResultsModalOpen={setIsResultsModalOpen}
186
189
  theme={theme}
187
190
  salesAgentData={salesAgentData}
188
191
  hardcopyContent={hardcopyContent}