@envive-ai/react-widgets-v3 0.3.12 → 0.3.13

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 (47) hide show
  1. package/dist/CXIntegration/implementations/useEightByEightUnifiedCXButton.cjs +54 -0
  2. package/dist/CXIntegration/implementations/useEightByEightUnifiedCXButton.js +53 -0
  3. package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.cjs +2 -2
  4. package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.js +2 -2
  5. package/dist/CXIntegration/types.cjs +1 -0
  6. package/dist/CXIntegration/types.js +1 -0
  7. package/dist/CXIntegration/utils/functions.cjs +2 -0
  8. package/dist/CXIntegration/utils/functions.js +2 -0
  9. package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +2 -2
  10. package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
  11. package/dist/packages/widgets/dist/SearchResults/SearchResultsWidget.d.ts +2 -2
  12. package/dist/packages/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.ts +2 -2
  13. package/dist/packages/widgets/dist/SuggestionBar/SuggestionBar.d.ts +2 -2
  14. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
  15. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
  16. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +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/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
  20. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
  21. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
  22. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
  23. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
  24. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
  25. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
  26. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.cjs +8 -8
  27. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
  28. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
  29. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +8 -8
  30. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
  31. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
  32. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
  33. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.cjs +8 -8
  34. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
  35. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +8 -8
  36. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
  37. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
  38. package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.cts +2 -2
  39. package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.cts +2 -2
  40. package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.cts +2 -2
  41. package/package.json +1 -1
  42. package/src/CXIntegration/implementations/useEightByEightUnifiedCXButton.ts +91 -0
  43. package/src/CXIntegration/implementations/useZendeskUnifiedCXButton.ts +4 -2
  44. package/src/CXIntegration/types.ts +1 -0
  45. package/src/CXIntegration/utils/functions.ts +4 -0
  46. package/src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.tsx +12 -12
  47. package/src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.tsx +12 -12
@@ -0,0 +1,54 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ const require_constants = require('../../widgets/FloatingChatWidget/constants.cjs');
3
+ let __envive_ai_react_hooks_application_utils = require("@envive-ai/react-hooks/application/utils");
4
+ let __envive_ai_react_hooks_hooks_ElementObserver = require("@envive-ai/react-hooks/hooks/ElementObserver");
5
+
6
+ //#region src/CXIntegration/implementations/useEightByEightUnifiedCXButton.ts
7
+ const EIGHT_BY_EIGHT_BUBBLE_SELECTOR = "div[id^=\"__8x8-chat-button-container-script\"]";
8
+ const EIGHT_BY_EIGHT_BUTTON_SELECTOR = `${EIGHT_BY_EIGHT_BUBBLE_SELECTOR} a[data-type="online"], ${EIGHT_BY_EIGHT_BUBBLE_SELECTOR} a[data-type="offline"]`;
9
+ const EIGHT_BY_EIGHT_CHAT_WINDOW_SELECTOR = "div.__8x8Chat-Container";
10
+ const useEightByEightUnifiedCXButton = ({ onSwitchToAgent, onCXClose, suppressMerchantButton }) => {
11
+ const eightByEightBubble = (0, __envive_ai_react_hooks_hooks_ElementObserver.useElementObserver)(__envive_ai_react_hooks_application_utils.SelectorFactory.query(EIGHT_BY_EIGHT_BUBBLE_SELECTOR));
12
+ const eightByEightChatWindow = (0, __envive_ai_react_hooks_hooks_ElementObserver.useElementObserver)(__envive_ai_react_hooks_application_utils.SelectorFactory.query(EIGHT_BY_EIGHT_CHAT_WINDOW_SELECTOR));
13
+ const enviveFloatingButton = (0, __envive_ai_react_hooks_hooks_ElementObserver.useElementObserver)(__envive_ai_react_hooks_application_utils.SelectorFactory.id(require_constants.FLOATING_BUTTON_ID));
14
+ const isEightByEightEnabled = () => !!document.querySelector(EIGHT_BY_EIGHT_BUTTON_SELECTOR);
15
+ const toggle = () => {
16
+ const button = document.querySelector(EIGHT_BY_EIGHT_BUTTON_SELECTOR);
17
+ if (!button) return;
18
+ onSwitchToAgent();
19
+ enviveFloatingButton.hide();
20
+ button.click();
21
+ };
22
+ const isSwitchEnabled = () => isEightByEightEnabled();
23
+ eightByEightBubble.onAdd((el) => {
24
+ if (suppressMerchantButton && el) eightByEightBubble.hide();
25
+ enviveFloatingButton.show();
26
+ });
27
+ eightByEightBubble.onChange((el) => {
28
+ if (!el || !suppressMerchantButton) return;
29
+ if (window.getComputedStyle(el).getPropertyValue("display") !== "none") eightByEightBubble.hide();
30
+ });
31
+ eightByEightChatWindow.onChange((el) => {
32
+ if (!el) return;
33
+ const rect = el.getBoundingClientRect();
34
+ if (rect.width > 50 && rect.height > 50) {
35
+ enviveFloatingButton.hide();
36
+ return;
37
+ }
38
+ onCXClose?.();
39
+ if (suppressMerchantButton) eightByEightBubble.hide();
40
+ enviveFloatingButton.show();
41
+ });
42
+ eightByEightChatWindow.onRemove(() => {
43
+ onCXClose?.();
44
+ if (suppressMerchantButton) eightByEightBubble.hide();
45
+ enviveFloatingButton.show();
46
+ });
47
+ return {
48
+ toggle,
49
+ isSwitchEnabled
50
+ };
51
+ };
52
+
53
+ //#endregion
54
+ exports.useEightByEightUnifiedCXButton = useEightByEightUnifiedCXButton;
@@ -0,0 +1,53 @@
1
+ import { FLOATING_BUTTON_ID } from "../../widgets/FloatingChatWidget/constants.js";
2
+ import { SelectorFactory } from "@envive-ai/react-hooks/application/utils";
3
+ import { useElementObserver } from "@envive-ai/react-hooks/hooks/ElementObserver";
4
+
5
+ //#region src/CXIntegration/implementations/useEightByEightUnifiedCXButton.ts
6
+ const EIGHT_BY_EIGHT_BUBBLE_SELECTOR = "div[id^=\"__8x8-chat-button-container-script\"]";
7
+ const EIGHT_BY_EIGHT_BUTTON_SELECTOR = `${EIGHT_BY_EIGHT_BUBBLE_SELECTOR} a[data-type="online"], ${EIGHT_BY_EIGHT_BUBBLE_SELECTOR} a[data-type="offline"]`;
8
+ const EIGHT_BY_EIGHT_CHAT_WINDOW_SELECTOR = "div.__8x8Chat-Container";
9
+ const useEightByEightUnifiedCXButton = ({ onSwitchToAgent, onCXClose, suppressMerchantButton }) => {
10
+ const eightByEightBubble = useElementObserver(SelectorFactory.query(EIGHT_BY_EIGHT_BUBBLE_SELECTOR));
11
+ const eightByEightChatWindow = useElementObserver(SelectorFactory.query(EIGHT_BY_EIGHT_CHAT_WINDOW_SELECTOR));
12
+ const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
13
+ const isEightByEightEnabled = () => !!document.querySelector(EIGHT_BY_EIGHT_BUTTON_SELECTOR);
14
+ const toggle = () => {
15
+ const button = document.querySelector(EIGHT_BY_EIGHT_BUTTON_SELECTOR);
16
+ if (!button) return;
17
+ onSwitchToAgent();
18
+ enviveFloatingButton.hide();
19
+ button.click();
20
+ };
21
+ const isSwitchEnabled = () => isEightByEightEnabled();
22
+ eightByEightBubble.onAdd((el) => {
23
+ if (suppressMerchantButton && el) eightByEightBubble.hide();
24
+ enviveFloatingButton.show();
25
+ });
26
+ eightByEightBubble.onChange((el) => {
27
+ if (!el || !suppressMerchantButton) return;
28
+ if (window.getComputedStyle(el).getPropertyValue("display") !== "none") eightByEightBubble.hide();
29
+ });
30
+ eightByEightChatWindow.onChange((el) => {
31
+ if (!el) return;
32
+ const rect = el.getBoundingClientRect();
33
+ if (rect.width > 50 && rect.height > 50) {
34
+ enviveFloatingButton.hide();
35
+ return;
36
+ }
37
+ onCXClose?.();
38
+ if (suppressMerchantButton) eightByEightBubble.hide();
39
+ enviveFloatingButton.show();
40
+ });
41
+ eightByEightChatWindow.onRemove(() => {
42
+ onCXClose?.();
43
+ if (suppressMerchantButton) eightByEightBubble.hide();
44
+ enviveFloatingButton.show();
45
+ });
46
+ return {
47
+ toggle,
48
+ isSwitchEnabled
49
+ };
50
+ };
51
+
52
+ //#endregion
53
+ export { useEightByEightUnifiedCXButton };
@@ -5,10 +5,10 @@ let __envive_ai_react_hooks_hooks_ElementObserver = require("@envive-ai/react-ho
5
5
 
6
6
  //#region src/CXIntegration/implementations/useZendeskUnifiedCXButton.ts
7
7
  const useZendeskUnifiedCXButton = ({ onSwitchToAgent, onCXClose, suppressMerchantButton }) => {
8
- const zendeskButton = (0, __envive_ai_react_hooks_hooks_ElementObserver.useElementObserver)(__envive_ai_react_hooks_application_utils.SelectorFactory.chain("id|launcher @ query|button"));
8
+ const zendeskButton = (0, __envive_ai_react_hooks_hooks_ElementObserver.useElementObserver)(__envive_ai_react_hooks_application_utils.SelectorFactory.chain("query|iframe#launcher @ query|button"));
9
9
  const zendeskAlternativeIframe = (0, __envive_ai_react_hooks_hooks_ElementObserver.useElementObserver)(__envive_ai_react_hooks_application_utils.SelectorFactory.chain("id|webWidget"));
10
10
  const enviveFloatingButton = (0, __envive_ai_react_hooks_hooks_ElementObserver.useElementObserver)(__envive_ai_react_hooks_application_utils.SelectorFactory.id(require_constants.FLOATING_BUTTON_ID));
11
- const zendeskIframe = (0, __envive_ai_react_hooks_hooks_ElementObserver.useElementObserver)(__envive_ai_react_hooks_application_utils.SelectorFactory.id("launcher"));
11
+ const zendeskIframe = (0, __envive_ai_react_hooks_hooks_ElementObserver.useElementObserver)(__envive_ai_react_hooks_application_utils.SelectorFactory.query("iframe#launcher"));
12
12
  const toggle = () => {
13
13
  zendeskIframe.hide();
14
14
  onSwitchToAgent();
@@ -4,10 +4,10 @@ import { useElementObserver } from "@envive-ai/react-hooks/hooks/ElementObserver
4
4
 
5
5
  //#region src/CXIntegration/implementations/useZendeskUnifiedCXButton.ts
6
6
  const useZendeskUnifiedCXButton = ({ onSwitchToAgent, onCXClose, suppressMerchantButton }) => {
7
- const zendeskButton = useElementObserver(SelectorFactory.chain("id|launcher @ query|button"));
7
+ const zendeskButton = useElementObserver(SelectorFactory.chain("query|iframe#launcher @ query|button"));
8
8
  const zendeskAlternativeIframe = useElementObserver(SelectorFactory.chain("id|webWidget"));
9
9
  const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
10
- const zendeskIframe = useElementObserver(SelectorFactory.id("launcher"));
10
+ const zendeskIframe = useElementObserver(SelectorFactory.query("iframe#launcher"));
11
11
  const toggle = () => {
12
12
  zendeskIframe.hide();
13
13
  onSwitchToAgent();
@@ -11,6 +11,7 @@ let CustomerServiceType = /* @__PURE__ */ function(CustomerServiceType$1) {
11
11
  CustomerServiceType$1["gladly"] = "gladly";
12
12
  CustomerServiceType$1["richpanel"] = "richpanel";
13
13
  CustomerServiceType$1["zendesk"] = "zendesk";
14
+ CustomerServiceType$1["eightByEight"] = "8x8";
14
15
  CustomerServiceType$1["unsupported"] = "unsupported";
15
16
  return CustomerServiceType$1;
16
17
  }({});
@@ -10,6 +10,7 @@ let CustomerServiceType = /* @__PURE__ */ function(CustomerServiceType$1) {
10
10
  CustomerServiceType$1["gladly"] = "gladly";
11
11
  CustomerServiceType$1["richpanel"] = "richpanel";
12
12
  CustomerServiceType$1["zendesk"] = "zendesk";
13
+ CustomerServiceType$1["eightByEight"] = "8x8";
13
14
  CustomerServiceType$1["unsupported"] = "unsupported";
14
15
  return CustomerServiceType$1;
15
16
  }({});
@@ -9,6 +9,7 @@ const require_useReDoUnifiedCXButton = require('../implementations/useReDoUnifie
9
9
  const require_useRichpanelUnifiedCXButton = require('../implementations/useRichpanelUnifiedCXButton.cjs');
10
10
  const require_useZendeskUnifiedCXButton = require('../implementations/useZendeskUnifiedCXButton.cjs');
11
11
  const require_useKustomerUnifiedCXButton = require('../implementations/useKustomerUnifiedCXButton.cjs');
12
+ const require_useEightByEightUnifiedCXButton = require('../implementations/useEightByEightUnifiedCXButton.cjs');
12
13
  const require_useDefaultUnifiedCXButton = require('../implementations/useDefaultUnifiedCXButton.cjs');
13
14
 
14
15
  //#region src/CXIntegration/utils/functions.ts
@@ -23,6 +24,7 @@ const findCustomerServiceImpl = (provider) => {
23
24
  if (provider === require_types.CustomerServiceType.redo) return require_useReDoUnifiedCXButton.useReDoUnifiedCXButton;
24
25
  if (provider === require_types.CustomerServiceType.richpanel) return require_useRichpanelUnifiedCXButton.useRichpanelUnifiedCXButton;
25
26
  if (provider === require_types.CustomerServiceType.zendesk) return require_useZendeskUnifiedCXButton.useZendeskUnifiedCXButton;
27
+ if (provider === require_types.CustomerServiceType.eightByEight) return require_useEightByEightUnifiedCXButton.useEightByEightUnifiedCXButton;
26
28
  return require_useDefaultUnifiedCXButton.useDefaultUnifiedCXButton;
27
29
  };
28
30
 
@@ -9,6 +9,7 @@ import { useReDoUnifiedCXButton } from "../implementations/useReDoUnifiedCXButto
9
9
  import { useRichpanelUnifiedCXButton } from "../implementations/useRichpanelUnifiedCXButton.js";
10
10
  import { useZendeskUnifiedCXButton } from "../implementations/useZendeskUnifiedCXButton.js";
11
11
  import { useKustomerUnifiedCXButton } from "../implementations/useKustomerUnifiedCXButton.js";
12
+ import { useEightByEightUnifiedCXButton } from "../implementations/useEightByEightUnifiedCXButton.js";
12
13
  import { useDefaultUnifiedCXButton } from "../implementations/useDefaultUnifiedCXButton.js";
13
14
 
14
15
  //#region src/CXIntegration/utils/functions.ts
@@ -23,6 +24,7 @@ const findCustomerServiceImpl = (provider) => {
23
24
  if (provider === CustomerServiceType.redo) return useReDoUnifiedCXButton;
24
25
  if (provider === CustomerServiceType.richpanel) return useRichpanelUnifiedCXButton;
25
26
  if (provider === CustomerServiceType.zendesk) return useZendeskUnifiedCXButton;
27
+ if (provider === CustomerServiceType.eightByEight) return useEightByEightUnifiedCXButton;
26
28
  return useDefaultUnifiedCXButton;
27
29
  };
28
30
 
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps, WithBaseWidgetOptions } from "./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/hocs/withBaseWidget/withBaseWidget.d.ts
5
5
  declare function withBaseWidget<P extends BaseWidgetProps>(Widget: React.ComponentType<P>, options?: WithBaseWidgetOptions): {
6
- (props: P): react_jsx_runtime14.JSX.Element;
6
+ (props: P): react_jsx_runtime17.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_runtime15 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime11 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_runtime15.JSX.Element;
6
+ (props: P): react_jsx_runtime11.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  //#endregion
@@ -1,8 +1,8 @@
1
- import * as react_jsx_runtime1 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
 
3
3
  //#region ../widgets/dist/SearchResults/SearchResultsWidget.d.ts
4
4
  //#region src/SearchResults/SearchResultsWidget.d.ts
5
- declare const SearchResultsWidget: () => react_jsx_runtime1.JSX.Element;
5
+ declare const SearchResultsWidget: () => react_jsx_runtime0.JSX.Element;
6
6
  //#endregion
7
7
 
8
8
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime3 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime2 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_runtime3.JSX.Element;
14
+ }: SearchZeroStateWidgetProps) => react_jsx_runtime2.JSX.Element;
15
15
  //#endregion
16
16
 
17
17
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { SuggestionBarLocationForMetrics } from "./types.js";
2
- import * as react_jsx_runtime2 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime3 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_runtime2.JSX.Element;
33
+ }: Readonly<SuggestionBarProps>): react_jsx_runtime3.JSX.Element;
34
34
  //#endregion
35
35
  //#endregion
36
36
  export { SuggestionBar };
@@ -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_runtime7 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_runtime17.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime7.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_runtime17.JSX.Element;
15
+ }: ChatPreviewComparisonWidgetProps): react_jsx_runtime7.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_runtime4 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime9 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_runtime4.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime9.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_runtime4.JSX.Element;
14
+ }: ChatPreviewLoadingWidgetProps) => react_jsx_runtime9.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_runtime13 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime4 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_runtime13.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime4.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_runtime13.JSX.Element;
14
+ }: ChatPreviewLoadingWidgetProps) => react_jsx_runtime4.JSX.Element;
15
15
  //#endregion
16
16
  export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetProps, ChatPreviewLoadingWidgetWithBaseWidget };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime19 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_runtime19.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_runtime3 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime14 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_runtime3.JSX.Element;
12
+ }?: FloatingChatWidgetProps): react_jsx_runtime14.JSX.Element;
13
13
  displayName: string;
14
14
  };
15
15
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime9 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime12 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_runtime9.JSX.Element;
11
+ }: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime12.JSX.Element;
12
12
  displayName: string;
13
13
  };
14
14
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime7 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_runtime7.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_runtime7 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/ProductCardWidget/ProductCardWidget.d.ts
4
4
  interface ProductCardWidgetProps {
@@ -7,7 +7,7 @@ interface ProductCardWidgetProps {
7
7
  declare const ProductCardWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: ProductCardWidgetProps): react_jsx_runtime7.JSX.Element;
10
+ }: ProductCardWidgetProps): react_jsx_runtime9.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_runtime8 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts
5
5
  declare const PromptButtonCarouselWithImageWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime8.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime4.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface PromptButtonCarouselWithImageWidgetProps {
@@ -12,7 +12,7 @@ interface PromptButtonCarouselWithImageWidgetProps {
12
12
  declare const PromptButtonCarouselWithImageWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime8.JSX.Element;
15
+ }: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime4.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_runtime11 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime2 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_runtime11.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime2.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_runtime11.JSX.Element;
15
+ }: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime2.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime10 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime6 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_runtime10.JSX.Element;
10
+ }: PromptCarouselWidgetProps): react_jsx_runtime6.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_runtime15 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts
4
4
  interface PromptCarouselWidgetProps {
@@ -7,7 +7,7 @@ interface PromptCarouselWidgetProps {
7
7
  declare const PromptCarouselWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: PromptCarouselWidgetProps): react_jsx_runtime0.JSX.Element;
10
+ }: PromptCarouselWidgetProps): react_jsx_runtime15.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -11,21 +11,21 @@ let __envive_ai_react_toolkit_v3_ChatPreviewLoading = require("@envive-ai/react-
11
11
  //#region src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.tsx
12
12
  const SocialProofFlowWidget = ({ widgetConfigId }) => {
13
13
  const { userHasInteractedValue, userHasNotInteractedValue, isLoadingValue, isProductComparisonValue } = require_useGetWidgetStatus.default();
14
- if (userHasInteractedValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewWidget.ChatPreviewWidgetWithBaseWidget, {
14
+ if (userHasInteractedValue && isLoadingValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewLoadingWidget.ChatPreviewLoadingWidgetWithBaseWidget, {
15
15
  widgetConfigId,
16
- widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewV3
16
+ widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewLoadingV3
17
17
  });
18
- if (userHasNotInteractedValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SocialProofWidget.SocialProofWidgetWithBaseWidget, {
18
+ if (userHasInteractedValue && isProductComparisonValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewComparisonWidget.ChatPreviewComparisonWidgetWithBaseWidget, {
19
19
  widgetConfigId,
20
- widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.SocialProofV3
20
+ widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewComparisonV3
21
21
  });
22
- if (isLoadingValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewLoadingWidget.ChatPreviewLoadingWidgetWithBaseWidget, {
22
+ if (userHasInteractedValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewWidget.ChatPreviewWidgetWithBaseWidget, {
23
23
  widgetConfigId,
24
- widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewLoadingV3
24
+ widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewV3
25
25
  });
26
- if (isProductComparisonValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewComparisonWidget.ChatPreviewComparisonWidgetWithBaseWidget, {
26
+ if (userHasNotInteractedValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SocialProofWidget.SocialProofWidgetWithBaseWidget, {
27
27
  widgetConfigId,
28
- widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewComparisonV3
28
+ widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.SocialProofV3
29
29
  });
30
30
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_ChatPreviewLoading.ChatPreviewLoading, { fullIsLoading: true });
31
31
  };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime13 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime3 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_runtime13.JSX.Element;
10
+ }: SocialProofFlowWidgetProps): react_jsx_runtime3.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime4 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime6 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_runtime4.JSX.Element;
10
+ }: SocialProofFlowWidgetProps): react_jsx_runtime6.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -10,21 +10,21 @@ import { ChatPreviewLoading } from "@envive-ai/react-toolkit-v3/ChatPreviewLoadi
10
10
  //#region src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.tsx
11
11
  const SocialProofFlowWidget = ({ widgetConfigId }) => {
12
12
  const { userHasInteractedValue, userHasNotInteractedValue, isLoadingValue, isProductComparisonValue } = useGetWidgetStatus_default();
13
- if (userHasInteractedValue) return /* @__PURE__ */ jsx(ChatPreviewWidgetWithBaseWidget, {
13
+ if (userHasInteractedValue && isLoadingValue) return /* @__PURE__ */ jsx(ChatPreviewLoadingWidgetWithBaseWidget, {
14
14
  widgetConfigId,
15
- widgetType: WidgetTypeV3.ChatPreviewV3
15
+ widgetType: WidgetTypeV3.ChatPreviewLoadingV3
16
16
  });
17
- if (userHasNotInteractedValue) return /* @__PURE__ */ jsx(SocialProofWidgetWithBaseWidget, {
17
+ if (userHasInteractedValue && isProductComparisonValue) return /* @__PURE__ */ jsx(ChatPreviewComparisonWidgetWithBaseWidget, {
18
18
  widgetConfigId,
19
- widgetType: WidgetTypeV3.SocialProofV3
19
+ widgetType: WidgetTypeV3.ChatPreviewComparisonV3
20
20
  });
21
- if (isLoadingValue) return /* @__PURE__ */ jsx(ChatPreviewLoadingWidgetWithBaseWidget, {
21
+ if (userHasInteractedValue) return /* @__PURE__ */ jsx(ChatPreviewWidgetWithBaseWidget, {
22
22
  widgetConfigId,
23
- widgetType: WidgetTypeV3.ChatPreviewLoadingV3
23
+ widgetType: WidgetTypeV3.ChatPreviewV3
24
24
  });
25
- if (isProductComparisonValue) return /* @__PURE__ */ jsx(ChatPreviewComparisonWidgetWithBaseWidget, {
25
+ if (userHasNotInteractedValue) return /* @__PURE__ */ jsx(SocialProofWidgetWithBaseWidget, {
26
26
  widgetConfigId,
27
- widgetType: WidgetTypeV3.ChatPreviewComparisonV3
27
+ widgetType: WidgetTypeV3.SocialProofV3
28
28
  });
29
29
  return /* @__PURE__ */ jsx(ChatPreviewLoading, { fullIsLoading: true });
30
30
  };
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
2
- import * as react_jsx_runtime1 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_runtime1.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_runtime1.JSX.Element;
15
+ }: SocialProofWidgetProps): react_jsx_runtime0.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime6 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_runtime6.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_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts
4
4
  interface TitledPromptCarouselWidgetProps {
@@ -7,7 +7,7 @@ interface TitledPromptCarouselWidgetProps {
7
7
  declare const TitledPromptCarouselWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: TitledPromptCarouselWidgetProps): react_jsx_runtime0.JSX.Element;
10
+ }: TitledPromptCarouselWidgetProps): react_jsx_runtime1.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -11,21 +11,21 @@ let __envive_ai_react_toolkit_v3_ChatPreviewLoading = require("@envive-ai/react-
11
11
  //#region src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.tsx
12
12
  const TypingAnimationFlowWidget = ({ widgetConfigId }) => {
13
13
  const { userHasInteractedValue, userHasNotInteractedValue, isLoadingValue, isProductComparisonValue } = require_useGetWidgetStatus.default();
14
- if (userHasInteractedValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewWidget.ChatPreviewWidgetWithBaseWidget, {
14
+ if (userHasInteractedValue && isLoadingValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewLoadingWidget.ChatPreviewLoadingWidgetWithBaseWidget, {
15
15
  widgetConfigId,
16
- widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewV3
16
+ widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewLoadingV3
17
17
  });
18
- if (userHasNotInteractedValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TypingAnimationWidget.TypingAnimationWithBaseWidget, {
18
+ if (userHasInteractedValue && isProductComparisonValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewComparisonWidget.ChatPreviewComparisonWidgetWithBaseWidget, {
19
19
  widgetConfigId,
20
- widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.TypingAnimationV3
20
+ widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewComparisonV3
21
21
  });
22
- if (isLoadingValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewLoadingWidget.ChatPreviewLoadingWidgetWithBaseWidget, {
22
+ if (userHasInteractedValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewWidget.ChatPreviewWidgetWithBaseWidget, {
23
23
  widgetConfigId,
24
- widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewLoadingV3
24
+ widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewV3
25
25
  });
26
- if (isProductComparisonValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewComparisonWidget.ChatPreviewComparisonWidgetWithBaseWidget, {
26
+ if (userHasNotInteractedValue) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TypingAnimationWidget.TypingAnimationWithBaseWidget, {
27
27
  widgetConfigId,
28
- widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewComparisonV3
28
+ widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.TypingAnimationV3
29
29
  });
30
30
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_ChatPreviewLoading.ChatPreviewLoading, { fullIsLoading: true });
31
31
  };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime8 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime10 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_runtime8.JSX.Element;
10
+ }: TypingAnimationFlowWidgetProps): react_jsx_runtime10.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -10,21 +10,21 @@ import { ChatPreviewLoading } from "@envive-ai/react-toolkit-v3/ChatPreviewLoadi
10
10
  //#region src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.tsx
11
11
  const TypingAnimationFlowWidget = ({ widgetConfigId }) => {
12
12
  const { userHasInteractedValue, userHasNotInteractedValue, isLoadingValue, isProductComparisonValue } = useGetWidgetStatus_default();
13
- if (userHasInteractedValue) return /* @__PURE__ */ jsx(ChatPreviewWidgetWithBaseWidget, {
13
+ if (userHasInteractedValue && isLoadingValue) return /* @__PURE__ */ jsx(ChatPreviewLoadingWidgetWithBaseWidget, {
14
14
  widgetConfigId,
15
- widgetType: WidgetTypeV3.ChatPreviewV3
15
+ widgetType: WidgetTypeV3.ChatPreviewLoadingV3
16
16
  });
17
- if (userHasNotInteractedValue) return /* @__PURE__ */ jsx(TypingAnimationWithBaseWidget, {
17
+ if (userHasInteractedValue && isProductComparisonValue) return /* @__PURE__ */ jsx(ChatPreviewComparisonWidgetWithBaseWidget, {
18
18
  widgetConfigId,
19
- widgetType: WidgetTypeV3.TypingAnimationV3
19
+ widgetType: WidgetTypeV3.ChatPreviewComparisonV3
20
20
  });
21
- if (isLoadingValue) return /* @__PURE__ */ jsx(ChatPreviewLoadingWidgetWithBaseWidget, {
21
+ if (userHasInteractedValue) return /* @__PURE__ */ jsx(ChatPreviewWidgetWithBaseWidget, {
22
22
  widgetConfigId,
23
- widgetType: WidgetTypeV3.ChatPreviewLoadingV3
23
+ widgetType: WidgetTypeV3.ChatPreviewV3
24
24
  });
25
- if (isProductComparisonValue) return /* @__PURE__ */ jsx(ChatPreviewComparisonWidgetWithBaseWidget, {
25
+ if (userHasNotInteractedValue) return /* @__PURE__ */ jsx(TypingAnimationWithBaseWidget, {
26
26
  widgetConfigId,
27
- widgetType: WidgetTypeV3.ChatPreviewComparisonV3
27
+ widgetType: WidgetTypeV3.TypingAnimationV3
28
28
  });
29
29
  return /* @__PURE__ */ jsx(ChatPreviewLoading, { fullIsLoading: true });
30
30
  };
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
- import * as react_jsx_runtime2 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime18 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_runtime18.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_runtime18.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
2
- import * as react_jsx_runtime5 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime7 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_runtime5.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime7.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_runtime5.JSX.Element;
15
+ }: TypingAnimationWidgetProps): react_jsx_runtime7.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,8 +1,8 @@
1
- import * as react_jsx_runtime1 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
 
3
3
  //#region ../widgets/dist/SearchResults/SearchResultsWidget.d.ts
4
4
  //#region src/SearchResults/SearchResultsWidget.d.ts
5
- declare const SearchResultsWidget: () => react_jsx_runtime1.JSX.Element;
5
+ declare const SearchResultsWidget: () => react_jsx_runtime0.JSX.Element;
6
6
  //#endregion
7
7
 
8
8
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime3 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime2 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_runtime3.JSX.Element;
14
+ }: SearchZeroStateWidgetProps) => react_jsx_runtime2.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_runtime2 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime3 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_runtime2.JSX.Element;
33
+ }: Readonly<SuggestionBarProps>): react_jsx_runtime3.JSX.Element;
34
34
  //#endregion
35
35
  //#endregion
36
36
  export { SuggestionBar };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envive-ai/react-widgets-v3",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "description": "React widget library v3 for Envive services.",
5
5
  "keywords": [
6
6
  "react",
@@ -0,0 +1,91 @@
1
+ import { SelectorFactory } from '@envive-ai/react-hooks/application/utils';
2
+ import { useElementObserver } from '@envive-ai/react-hooks/hooks/ElementObserver';
3
+ import { FLOATING_BUTTON_ID } from '../../widgets/FloatingChatWidget/constants';
4
+ import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
5
+
6
+ interface UseEightByEightUnifiedCXButtonProps extends CustomerServiceImplProps {}
7
+
8
+ const EIGHT_BY_EIGHT_BUBBLE_SELECTOR = 'div[id^="__8x8-chat-button-container-script"]';
9
+
10
+ const EIGHT_BY_EIGHT_BUTTON_SELECTOR = `${EIGHT_BY_EIGHT_BUBBLE_SELECTOR} a[data-type="online"], ${EIGHT_BY_EIGHT_BUBBLE_SELECTOR} a[data-type="offline"]`;
11
+
12
+ const EIGHT_BY_EIGHT_CHAT_WINDOW_SELECTOR = 'div.__8x8Chat-Container';
13
+
14
+ export const useEightByEightUnifiedCXButton = ({
15
+ onSwitchToAgent,
16
+ onCXClose,
17
+ suppressMerchantButton,
18
+ }: UseEightByEightUnifiedCXButtonProps): UnifiedCXButton => {
19
+ const eightByEightBubble = useElementObserver(
20
+ SelectorFactory.query(EIGHT_BY_EIGHT_BUBBLE_SELECTOR),
21
+ );
22
+ const eightByEightChatWindow = useElementObserver(
23
+ SelectorFactory.query(EIGHT_BY_EIGHT_CHAT_WINDOW_SELECTOR),
24
+ );
25
+ const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
26
+
27
+ const isEightByEightEnabled = () => !!document.querySelector(EIGHT_BY_EIGHT_BUTTON_SELECTOR);
28
+
29
+ const toggle = () => {
30
+ const button = document.querySelector(EIGHT_BY_EIGHT_BUTTON_SELECTOR) as HTMLElement | null;
31
+
32
+ if (!button) {
33
+ return;
34
+ }
35
+
36
+ onSwitchToAgent();
37
+ enviveFloatingButton.hide();
38
+
39
+ button.click();
40
+ };
41
+
42
+ const isSwitchEnabled = () => isEightByEightEnabled();
43
+
44
+ eightByEightBubble.onAdd(el => {
45
+ if (suppressMerchantButton && el) {
46
+ eightByEightBubble.hide();
47
+ }
48
+ enviveFloatingButton.show();
49
+ });
50
+
51
+ eightByEightBubble.onChange(el => {
52
+ if (!el || !suppressMerchantButton) return;
53
+
54
+ const styles = window.getComputedStyle(el);
55
+ const display = styles.getPropertyValue('display');
56
+ if (display !== 'none') {
57
+ eightByEightBubble.hide();
58
+ }
59
+ });
60
+
61
+ eightByEightChatWindow.onChange(el => {
62
+ if (!el) return;
63
+
64
+ const rect = el.getBoundingClientRect();
65
+ const isOpen = rect.width > 50 && rect.height > 50;
66
+
67
+ if (isOpen) {
68
+ enviveFloatingButton.hide();
69
+ return;
70
+ }
71
+
72
+ onCXClose?.();
73
+ if (suppressMerchantButton) {
74
+ eightByEightBubble.hide();
75
+ }
76
+ enviveFloatingButton.show();
77
+ });
78
+
79
+ eightByEightChatWindow.onRemove(() => {
80
+ onCXClose?.();
81
+ if (suppressMerchantButton) {
82
+ eightByEightBubble.hide();
83
+ }
84
+ enviveFloatingButton.show();
85
+ });
86
+
87
+ return {
88
+ toggle,
89
+ isSwitchEnabled,
90
+ };
91
+ };
@@ -10,10 +10,12 @@ export const useZendeskUnifiedCXButton = ({
10
10
  onCXClose,
11
11
  suppressMerchantButton,
12
12
  }: UseZendeskUnifiedCXButtonProps): UnifiedCXButton => {
13
- const zendeskButton = useElementObserver(SelectorFactory.chain('id|launcher @ query|button'));
13
+ const zendeskButton = useElementObserver(
14
+ SelectorFactory.chain('query|iframe#launcher @ query|button'),
15
+ );
14
16
  const zendeskAlternativeIframe = useElementObserver(SelectorFactory.chain('id|webWidget'));
15
17
  const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
16
- const zendeskIframe = useElementObserver(SelectorFactory.id('launcher'));
18
+ const zendeskIframe = useElementObserver(SelectorFactory.query('iframe#launcher'));
17
19
 
18
20
  const toggle = () => {
19
21
  zendeskIframe.hide();
@@ -9,6 +9,7 @@ export enum CustomerServiceType {
9
9
  gladly = 'gladly',
10
10
  richpanel = 'richpanel',
11
11
  zendesk = 'zendesk',
12
+ eightByEight = '8x8',
12
13
  unsupported = 'unsupported',
13
14
  }
14
15
 
@@ -10,6 +10,7 @@ import { useReDoUnifiedCXButton } from '../implementations/useReDoUnifiedCXButto
10
10
  import { useRichpanelUnifiedCXButton } from '../implementations/useRichpanelUnifiedCXButton';
11
11
  import { useZendeskUnifiedCXButton } from '../implementations/useZendeskUnifiedCXButton';
12
12
  import { useKustomerUnifiedCXButton } from '../implementations/useKustomerUnifiedCXButton';
13
+ import { useEightByEightUnifiedCXButton } from '../implementations/useEightByEightUnifiedCXButton';
13
14
  import { useDefaultUnifiedCXButton } from '../implementations/useDefaultUnifiedCXButton';
14
15
 
15
16
  export const findCustomerServiceImpl = (
@@ -45,6 +46,9 @@ export const findCustomerServiceImpl = (
45
46
  if (provider === CustomerServiceType.zendesk) {
46
47
  return useZendeskUnifiedCXButton;
47
48
  }
49
+ if (provider === CustomerServiceType.eightByEight) {
50
+ return useEightByEightUnifiedCXButton;
51
+ }
48
52
 
49
53
  return useDefaultUnifiedCXButton;
50
54
  };
@@ -19,38 +19,38 @@ export const SocialProofFlowWidget = ({ widgetConfigId }: SocialProofFlowWidgetP
19
19
  isProductComparisonValue,
20
20
  } = useGetWidgetStatus();
21
21
 
22
- if (userHasInteractedValue) {
22
+ if (userHasInteractedValue && isLoadingValue) {
23
23
  return (
24
- <ChatPreviewWidgetWithBaseWidget
24
+ <ChatPreviewLoadingWidgetWithBaseWidget
25
25
  widgetConfigId={widgetConfigId}
26
- widgetType={WidgetTypeV3.ChatPreviewV3}
26
+ widgetType={WidgetTypeV3.ChatPreviewLoadingV3}
27
27
  />
28
28
  );
29
29
  }
30
30
 
31
- if (userHasNotInteractedValue) {
31
+ if (userHasInteractedValue && isProductComparisonValue) {
32
32
  return (
33
- <SocialProofWidgetWithBaseWidget
33
+ <ChatPreviewComparisonWidgetWithBaseWidget
34
34
  widgetConfigId={widgetConfigId}
35
- widgetType={WidgetTypeV3.SocialProofV3}
35
+ widgetType={WidgetTypeV3.ChatPreviewComparisonV3}
36
36
  />
37
37
  );
38
38
  }
39
39
 
40
- if (isLoadingValue) {
40
+ if (userHasInteractedValue) {
41
41
  return (
42
- <ChatPreviewLoadingWidgetWithBaseWidget
42
+ <ChatPreviewWidgetWithBaseWidget
43
43
  widgetConfigId={widgetConfigId}
44
- widgetType={WidgetTypeV3.ChatPreviewLoadingV3}
44
+ widgetType={WidgetTypeV3.ChatPreviewV3}
45
45
  />
46
46
  );
47
47
  }
48
48
 
49
- if (isProductComparisonValue) {
49
+ if (userHasNotInteractedValue) {
50
50
  return (
51
- <ChatPreviewComparisonWidgetWithBaseWidget
51
+ <SocialProofWidgetWithBaseWidget
52
52
  widgetConfigId={widgetConfigId}
53
- widgetType={WidgetTypeV3.ChatPreviewComparisonV3}
53
+ widgetType={WidgetTypeV3.SocialProofV3}
54
54
  />
55
55
  );
56
56
  }
@@ -19,38 +19,38 @@ export const TypingAnimationFlowWidget = ({ widgetConfigId }: TypingAnimationFlo
19
19
  isProductComparisonValue,
20
20
  } = useGetWidgetStatus();
21
21
 
22
- if (userHasInteractedValue) {
22
+ if (userHasInteractedValue && isLoadingValue) {
23
23
  return (
24
- <ChatPreviewWidgetWithBaseWidget
24
+ <ChatPreviewLoadingWidgetWithBaseWidget
25
25
  widgetConfigId={widgetConfigId}
26
- widgetType={WidgetTypeV3.ChatPreviewV3}
26
+ widgetType={WidgetTypeV3.ChatPreviewLoadingV3}
27
27
  />
28
28
  );
29
29
  }
30
30
 
31
- if (userHasNotInteractedValue) {
31
+ if (userHasInteractedValue && isProductComparisonValue) {
32
32
  return (
33
- <TypingAnimationWithBaseWidget
33
+ <ChatPreviewComparisonWidgetWithBaseWidget
34
34
  widgetConfigId={widgetConfigId}
35
- widgetType={WidgetTypeV3.TypingAnimationV3}
35
+ widgetType={WidgetTypeV3.ChatPreviewComparisonV3}
36
36
  />
37
37
  );
38
38
  }
39
39
 
40
- if (isLoadingValue) {
40
+ if (userHasInteractedValue) {
41
41
  return (
42
- <ChatPreviewLoadingWidgetWithBaseWidget
42
+ <ChatPreviewWidgetWithBaseWidget
43
43
  widgetConfigId={widgetConfigId}
44
- widgetType={WidgetTypeV3.ChatPreviewLoadingV3}
44
+ widgetType={WidgetTypeV3.ChatPreviewV3}
45
45
  />
46
46
  );
47
47
  }
48
48
 
49
- if (isProductComparisonValue) {
49
+ if (userHasNotInteractedValue) {
50
50
  return (
51
- <ChatPreviewComparisonWidgetWithBaseWidget
51
+ <TypingAnimationWithBaseWidget
52
52
  widgetConfigId={widgetConfigId}
53
- widgetType={WidgetTypeV3.ChatPreviewComparisonV3}
53
+ widgetType={WidgetTypeV3.TypingAnimationV3}
54
54
  />
55
55
  );
56
56
  }