@envive-ai/react-widgets-v3 0.3.11 → 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.
- package/dist/CXIntegration/hooks/useUnifiedCXButton.cjs +2 -1
- package/dist/CXIntegration/hooks/useUnifiedCXButton.js +2 -1
- package/dist/CXIntegration/implementations/useEightByEightUnifiedCXButton.cjs +54 -0
- package/dist/CXIntegration/implementations/useEightByEightUnifiedCXButton.js +53 -0
- package/dist/CXIntegration/implementations/useGladlyUnifiedCXButton.cjs +6 -0
- package/dist/CXIntegration/implementations/useGladlyUnifiedCXButton.js +6 -0
- package/dist/CXIntegration/implementations/useGorgiasUnifiedCXButton.cjs +7 -6
- package/dist/CXIntegration/implementations/useGorgiasUnifiedCXButton.js +7 -6
- package/dist/CXIntegration/implementations/useGrooveUnifiedCXButton.cjs +10 -11
- package/dist/CXIntegration/implementations/useGrooveUnifiedCXButton.js +10 -11
- package/dist/CXIntegration/implementations/useKustomerUnifiedCXButton.cjs +10 -7
- package/dist/CXIntegration/implementations/useKustomerUnifiedCXButton.js +10 -7
- package/dist/CXIntegration/implementations/useReDoUnifiedCXButton.cjs +2 -2
- package/dist/CXIntegration/implementations/useReDoUnifiedCXButton.js +2 -2
- package/dist/CXIntegration/implementations/useRichpanelUnifiedCXButton.cjs +9 -7
- package/dist/CXIntegration/implementations/useRichpanelUnifiedCXButton.js +9 -7
- package/dist/CXIntegration/implementations/useShopifyChatUnifiedCXButton.cjs +13 -16
- package/dist/CXIntegration/implementations/useShopifyChatUnifiedCXButton.js +13 -16
- package/dist/CXIntegration/implementations/useTidioUnifiedCXButton.cjs +6 -0
- package/dist/CXIntegration/implementations/useTidioUnifiedCXButton.js +6 -0
- package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.cjs +9 -7
- package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.js +9 -7
- package/dist/CXIntegration/implementations/useZowieUnifiedCXButton.cjs +6 -0
- package/dist/CXIntegration/implementations/useZowieUnifiedCXButton.js +6 -0
- package/dist/CXIntegration/types.cjs +1 -0
- package/dist/CXIntegration/types.js +1 -0
- package/dist/CXIntegration/utils/functions.cjs +2 -0
- package/dist/CXIntegration/utils/functions.js +2 -0
- package/dist/debug/debugBar.cjs +0 -1
- package/dist/debug/debugBar.js +0 -1
- package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +2 -2
- package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingRequest.cjs +4 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/WidgetTextRequest.cjs +2 -0
- package/dist/packages/widgets/dist/SearchResults/SearchResultsWidget.d.ts +2 -2
- package/dist/packages/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.ts +2 -2
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +64 -36
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +65 -37
- package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.cjs +50 -0
- package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.js +49 -0
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +1 -1
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +1 -1
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.cjs +8 -8
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +8 -8
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +1 -1
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +1 -1
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.cjs +8 -8
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +8 -8
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
- package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.cts +2 -2
- package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.cts +2 -2
- package/package.json +1 -1
- package/src/CXIntegration/hooks/useUnifiedCXButton.ts +4 -1
- package/src/CXIntegration/implementations/useEightByEightUnifiedCXButton.ts +91 -0
- package/src/CXIntegration/implementations/useGladlyUnifiedCXButton.ts +5 -0
- package/src/CXIntegration/implementations/useGorgiasUnifiedCXButton.ts +11 -8
- package/src/CXIntegration/implementations/useGrooveUnifiedCXButton.ts +12 -15
- package/src/CXIntegration/implementations/useKustomerUnifiedCXButton.ts +11 -11
- package/src/CXIntegration/implementations/useReDoUnifiedCXButton.ts +2 -4
- package/src/CXIntegration/implementations/useRichpanelUnifiedCXButton.ts +9 -10
- package/src/CXIntegration/implementations/useShopifyChatUnifiedCXButton.ts +18 -28
- package/src/CXIntegration/implementations/useTidioUnifiedCXButton.ts +5 -0
- package/src/CXIntegration/implementations/useZendeskUnifiedCXButton.ts +15 -8
- package/src/CXIntegration/implementations/useZowieUnifiedCXButton.ts +5 -0
- package/src/CXIntegration/types.ts +2 -0
- package/src/CXIntegration/utils/functions.ts +4 -0
- package/src/debug/debugBar.tsx +0 -1
- package/src/widgets/FloatingChatWidget/FloatingChatWidget.tsx +109 -66
- package/src/widgets/FloatingChatWidget/hooks/useAutoPopup.ts +65 -0
- package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +1 -1
- package/src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.tsx +12 -12
- package/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx +1 -1
- package/src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.tsx +12 -12
|
@@ -3,12 +3,12 @@ import { SelectorFactory } from "@envive-ai/react-hooks/application/utils";
|
|
|
3
3
|
import { useElementObserver } from "@envive-ai/react-hooks/hooks/ElementObserver";
|
|
4
4
|
|
|
5
5
|
//#region src/CXIntegration/implementations/useShopifyChatUnifiedCXButton.ts
|
|
6
|
-
const useShopifyChatUnifiedCXButton = ({ onSwitchToAgent, suppressMerchantButton }) => {
|
|
6
|
+
const useShopifyChatUnifiedCXButton = ({ onSwitchToAgent, onCXClose, suppressMerchantButton }) => {
|
|
7
7
|
const shopifyChatContainer = useElementObserver(SelectorFactory.id("ShopifyChat"));
|
|
8
8
|
const shopifyButton = useElementObserver(SelectorFactory.chain("id|ShopifyChat @ query|.chat-app > button"));
|
|
9
9
|
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
10
10
|
const toggle = () => {
|
|
11
|
-
|
|
11
|
+
enviveFloatingButton.hide();
|
|
12
12
|
shopifyButton.show();
|
|
13
13
|
onSwitchToAgent();
|
|
14
14
|
shopifyButton.fire("click");
|
|
@@ -17,30 +17,27 @@ const useShopifyChatUnifiedCXButton = ({ onSwitchToAgent, suppressMerchantButton
|
|
|
17
17
|
return !!shopifyButton;
|
|
18
18
|
};
|
|
19
19
|
const isSwitchEnabled = () => isShopifyButtonEnabled();
|
|
20
|
-
const hideEnviveFloatingButton = () => {
|
|
21
|
-
enviveFloatingButton.hide();
|
|
22
|
-
shopifyButton.show();
|
|
23
|
-
};
|
|
24
|
-
const showEnviveFloatingButton = () => {
|
|
25
|
-
enviveFloatingButton.show();
|
|
26
|
-
shopifyButton.hide();
|
|
27
|
-
shopifyChatContainer.hide();
|
|
28
|
-
};
|
|
29
20
|
const handleChatStateChange = async (isOpen) => {
|
|
30
21
|
if (isOpen) {
|
|
31
|
-
|
|
22
|
+
enviveFloatingButton.hide();
|
|
23
|
+
if (suppressMerchantButton) shopifyButton.show();
|
|
32
24
|
return;
|
|
33
25
|
}
|
|
34
|
-
|
|
26
|
+
onCXClose?.();
|
|
27
|
+
enviveFloatingButton.show();
|
|
28
|
+
if (suppressMerchantButton) {
|
|
29
|
+
shopifyButton.hide();
|
|
30
|
+
shopifyChatContainer.hide();
|
|
31
|
+
}
|
|
35
32
|
};
|
|
36
33
|
shopifyButton.onAdd(() => {
|
|
37
|
-
|
|
34
|
+
handleChatStateChange(shopifyChatContainer.targetNode?.getAttribute("is-open") === "true");
|
|
38
35
|
});
|
|
39
36
|
shopifyChatContainer.onAdd((el) => {
|
|
40
|
-
|
|
37
|
+
handleChatStateChange(el?.getAttribute("is-open") === "true");
|
|
41
38
|
});
|
|
42
39
|
shopifyChatContainer.onChange((el) => {
|
|
43
|
-
|
|
40
|
+
handleChatStateChange(el?.getAttribute("is-open") === "true");
|
|
44
41
|
});
|
|
45
42
|
return {
|
|
46
43
|
toggle,
|
|
@@ -1,9 +1,15 @@
|
|
|
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");
|
|
1
5
|
|
|
2
6
|
//#region src/CXIntegration/implementations/useTidioUnifiedCXButton.ts
|
|
3
7
|
const useTidioUnifiedCXButton = ({ onSwitchToAgent }) => {
|
|
4
8
|
const tidioButton = window.tidioChatApi;
|
|
9
|
+
const enviveFloatingButton = (0, __envive_ai_react_hooks_hooks_ElementObserver.useElementObserver)(__envive_ai_react_hooks_application_utils.SelectorFactory.id(require_constants.FLOATING_BUTTON_ID));
|
|
5
10
|
const toggle = () => {
|
|
6
11
|
onSwitchToAgent();
|
|
12
|
+
enviveFloatingButton.hide();
|
|
7
13
|
if (tidioButton) tidioButton.open();
|
|
8
14
|
};
|
|
9
15
|
const isTidioButtonEnabled = () => !!document.getElementById("tidio-chat-iframe");
|
|
@@ -1,8 +1,14 @@
|
|
|
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
|
+
|
|
1
5
|
//#region src/CXIntegration/implementations/useTidioUnifiedCXButton.ts
|
|
2
6
|
const useTidioUnifiedCXButton = ({ onSwitchToAgent }) => {
|
|
3
7
|
const tidioButton = window.tidioChatApi;
|
|
8
|
+
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
4
9
|
const toggle = () => {
|
|
5
10
|
onSwitchToAgent();
|
|
11
|
+
enviveFloatingButton.hide();
|
|
6
12
|
if (tidioButton) tidioButton.open();
|
|
7
13
|
};
|
|
8
14
|
const isTidioButtonEnabled = () => !!document.getElementById("tidio-chat-iframe");
|
|
@@ -4,16 +4,16 @@ let __envive_ai_react_hooks_application_utils = require("@envive-ai/react-hooks/
|
|
|
4
4
|
let __envive_ai_react_hooks_hooks_ElementObserver = require("@envive-ai/react-hooks/hooks/ElementObserver");
|
|
5
5
|
|
|
6
6
|
//#region src/CXIntegration/implementations/useZendeskUnifiedCXButton.ts
|
|
7
|
-
const useZendeskUnifiedCXButton = ({ onSwitchToAgent, suppressMerchantButton }) => {
|
|
8
|
-
const zendeskButton = (0, __envive_ai_react_hooks_hooks_ElementObserver.useElementObserver)(__envive_ai_react_hooks_application_utils.SelectorFactory.chain("
|
|
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("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.
|
|
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();
|
|
15
15
|
zendeskButton.fire("click");
|
|
16
|
-
|
|
16
|
+
enviveFloatingButton.hide();
|
|
17
17
|
};
|
|
18
18
|
const isZendeskButtonEnabled = () => {
|
|
19
19
|
return !!(document?.getElementById("launcher"))?.contentWindow?.document?.querySelector("button");
|
|
@@ -26,19 +26,21 @@ const useZendeskUnifiedCXButton = ({ onSwitchToAgent, suppressMerchantButton })
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
zendeskButton.onChange((el) => {
|
|
29
|
-
if (el
|
|
29
|
+
if (el) {
|
|
30
30
|
const ariaLabel = el.getAttribute("aria-label");
|
|
31
31
|
if (ariaLabel === "Open messaging window") {
|
|
32
|
+
onCXClose?.();
|
|
32
33
|
enviveFloatingButton.show();
|
|
33
|
-
zendeskIframe.hide();
|
|
34
|
+
if (suppressMerchantButton) zendeskIframe.hide();
|
|
34
35
|
}
|
|
35
36
|
if (ariaLabel === "Close messaging window") {
|
|
36
37
|
enviveFloatingButton.hide();
|
|
37
|
-
zendeskIframe.show();
|
|
38
|
+
if (suppressMerchantButton) zendeskIframe.show();
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
});
|
|
41
42
|
zendeskAlternativeIframe.onRemove(() => {
|
|
43
|
+
onCXClose?.();
|
|
42
44
|
if (suppressMerchantButton) {
|
|
43
45
|
enviveFloatingButton.show();
|
|
44
46
|
zendeskIframe.hide();
|
|
@@ -3,16 +3,16 @@ import { SelectorFactory } from "@envive-ai/react-hooks/application/utils";
|
|
|
3
3
|
import { useElementObserver } from "@envive-ai/react-hooks/hooks/ElementObserver";
|
|
4
4
|
|
|
5
5
|
//#region src/CXIntegration/implementations/useZendeskUnifiedCXButton.ts
|
|
6
|
-
const useZendeskUnifiedCXButton = ({ onSwitchToAgent, suppressMerchantButton }) => {
|
|
7
|
-
const zendeskButton = useElementObserver(SelectorFactory.chain("
|
|
6
|
+
const useZendeskUnifiedCXButton = ({ onSwitchToAgent, onCXClose, suppressMerchantButton }) => {
|
|
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.
|
|
10
|
+
const zendeskIframe = useElementObserver(SelectorFactory.query("iframe#launcher"));
|
|
11
11
|
const toggle = () => {
|
|
12
12
|
zendeskIframe.hide();
|
|
13
13
|
onSwitchToAgent();
|
|
14
14
|
zendeskButton.fire("click");
|
|
15
|
-
|
|
15
|
+
enviveFloatingButton.hide();
|
|
16
16
|
};
|
|
17
17
|
const isZendeskButtonEnabled = () => {
|
|
18
18
|
return !!(document?.getElementById("launcher"))?.contentWindow?.document?.querySelector("button");
|
|
@@ -25,19 +25,21 @@ const useZendeskUnifiedCXButton = ({ onSwitchToAgent, suppressMerchantButton })
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
zendeskButton.onChange((el) => {
|
|
28
|
-
if (el
|
|
28
|
+
if (el) {
|
|
29
29
|
const ariaLabel = el.getAttribute("aria-label");
|
|
30
30
|
if (ariaLabel === "Open messaging window") {
|
|
31
|
+
onCXClose?.();
|
|
31
32
|
enviveFloatingButton.show();
|
|
32
|
-
zendeskIframe.hide();
|
|
33
|
+
if (suppressMerchantButton) zendeskIframe.hide();
|
|
33
34
|
}
|
|
34
35
|
if (ariaLabel === "Close messaging window") {
|
|
35
36
|
enviveFloatingButton.hide();
|
|
36
|
-
zendeskIframe.show();
|
|
37
|
+
if (suppressMerchantButton) zendeskIframe.show();
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
});
|
|
40
41
|
zendeskAlternativeIframe.onRemove(() => {
|
|
42
|
+
onCXClose?.();
|
|
41
43
|
if (suppressMerchantButton) {
|
|
42
44
|
enviveFloatingButton.show();
|
|
43
45
|
zendeskIframe.hide();
|
|
@@ -1,9 +1,15 @@
|
|
|
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");
|
|
1
5
|
|
|
2
6
|
//#region src/CXIntegration/implementations/useZowieUnifiedCXButton.ts
|
|
3
7
|
const useZowieUnifiedCXButton = ({ onSwitchToAgent }) => {
|
|
4
8
|
const zowieButton = window?.Zowie;
|
|
9
|
+
const enviveFloatingButton = (0, __envive_ai_react_hooks_hooks_ElementObserver.useElementObserver)(__envive_ai_react_hooks_application_utils.SelectorFactory.id(require_constants.FLOATING_BUTTON_ID));
|
|
5
10
|
const toggle = () => {
|
|
6
11
|
onSwitchToAgent();
|
|
12
|
+
enviveFloatingButton.hide();
|
|
7
13
|
if (zowieButton) zowieButton?.open();
|
|
8
14
|
};
|
|
9
15
|
const isZowieButtonEnabled = () => !!zowieButton;
|
|
@@ -1,8 +1,14 @@
|
|
|
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
|
+
|
|
1
5
|
//#region src/CXIntegration/implementations/useZowieUnifiedCXButton.ts
|
|
2
6
|
const useZowieUnifiedCXButton = ({ onSwitchToAgent }) => {
|
|
3
7
|
const zowieButton = window?.Zowie;
|
|
8
|
+
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
4
9
|
const toggle = () => {
|
|
5
10
|
onSwitchToAgent();
|
|
11
|
+
enviveFloatingButton.hide();
|
|
6
12
|
if (zowieButton) zowieButton?.open();
|
|
7
13
|
};
|
|
8
14
|
const isZowieButtonEnabled = () => !!zowieButton;
|
|
@@ -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
|
|
package/dist/debug/debugBar.cjs
CHANGED
|
@@ -6,7 +6,6 @@ let __envive_ai_react_hooks_hooks_SystemSettingsContext = require("@envive-ai/re
|
|
|
6
6
|
//#region src/debug/debugBar.tsx
|
|
7
7
|
const DebugBar = () => {
|
|
8
8
|
const { showDebugBar } = (0, __envive_ai_react_hooks_hooks_SystemSettingsContext.useSystemSettingsContext)();
|
|
9
|
-
console.log("=== showDebugBar ===", showDebugBar);
|
|
10
9
|
if (!showDebugBar) return null;
|
|
11
10
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
12
11
|
className: "envive-tw-flex envive-tw-items-center envive-tw-p-[4px]",
|
package/dist/debug/debugBar.js
CHANGED
|
@@ -5,7 +5,6 @@ import { useSystemSettingsContext } from "@envive-ai/react-hooks/hooks/SystemSet
|
|
|
5
5
|
//#region src/debug/debugBar.tsx
|
|
6
6
|
const DebugBar = () => {
|
|
7
7
|
const { showDebugBar } = useSystemSettingsContext();
|
|
8
|
-
console.log("=== showDebugBar ===", showDebugBar);
|
|
9
8
|
if (!showDebugBar) return null;
|
|
10
9
|
return /* @__PURE__ */ jsx("div", {
|
|
11
10
|
className: "envive-tw-flex envive-tw-items-center envive-tw-p-[4px]",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps, WithBaseWidgetOptions } from "./types.cjs";
|
|
2
|
-
import * as
|
|
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):
|
|
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
|
|
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):
|
|
6
|
+
(props: P): react_jsx_runtime11.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
//#endregion
|
package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingRequest.cjs
CHANGED
|
@@ -40,6 +40,8 @@ var require_UrlResolvingRequest = /* @__PURE__ */ require_rolldown_runtime.__com
|
|
|
40
40
|
return {
|
|
41
41
|
"context": (0, Context_1.ContextFromJSON)(json["context"]),
|
|
42
42
|
"feature_gates": json["feature_gates"],
|
|
43
|
+
"org_base_config_version": json["org_base_config_version"] == null ? void 0 : json["org_base_config_version"],
|
|
44
|
+
"override_config_version": json["override_config_version"] == null ? void 0 : json["override_config_version"],
|
|
43
45
|
"url": json["url"]
|
|
44
46
|
};
|
|
45
47
|
}
|
|
@@ -51,6 +53,8 @@ var require_UrlResolvingRequest = /* @__PURE__ */ require_rolldown_runtime.__com
|
|
|
51
53
|
return {
|
|
52
54
|
"context": (0, Context_1.ContextToJSON)(value["context"]),
|
|
53
55
|
"feature_gates": value["feature_gates"],
|
|
56
|
+
"org_base_config_version": value["org_base_config_version"],
|
|
57
|
+
"override_config_version": value["override_config_version"],
|
|
54
58
|
"url": value["url"]
|
|
55
59
|
};
|
|
56
60
|
}
|
|
@@ -44,6 +44,7 @@ var require_WidgetTextRequest = /* @__PURE__ */ require_rolldown_runtime.__commo
|
|
|
44
44
|
"feature_flags": json["feature_flags"] == null ? void 0 : json["feature_flags"],
|
|
45
45
|
"id": json["id"] == null ? void 0 : json["id"],
|
|
46
46
|
"language": json["language"],
|
|
47
|
+
"org_base_config_version": json["org_base_config_version"] == null ? void 0 : json["org_base_config_version"],
|
|
47
48
|
"url": json["url"],
|
|
48
49
|
"widget_type": (0, WidgetType_1.WidgetTypeFromJSON)(json["widget_type"])
|
|
49
50
|
};
|
|
@@ -58,6 +59,7 @@ var require_WidgetTextRequest = /* @__PURE__ */ require_rolldown_runtime.__commo
|
|
|
58
59
|
"feature_flags": value["feature_flags"],
|
|
59
60
|
"id": value["id"],
|
|
60
61
|
"language": value["language"],
|
|
62
|
+
"org_base_config_version": value["org_base_config_version"],
|
|
61
63
|
"url": value["url"],
|
|
62
64
|
"widget_type": (0, WidgetType_1.WidgetTypeToJSON)(value["widget_type"])
|
|
63
65
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
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: () =>
|
|
5
|
+
declare const SearchResultsWidget: () => react_jsx_runtime0.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
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) =>
|
|
14
|
+
}: SearchZeroStateWidgetProps) => react_jsx_runtime2.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
|
|
17
17
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
-
import * as
|
|
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):
|
|
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):
|
|
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.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime16 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts
|
|
5
5
|
declare const ChatPreviewComparisonWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime16.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):
|
|
15
|
+
}: ChatPreviewComparisonWidgetProps): react_jsx_runtime16.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
|
|
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):
|
|
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) =>
|
|
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
|
|
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):
|
|
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) =>
|
|
14
|
+
}: ChatPreviewLoadingWidgetProps) => react_jsx_runtime4.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
|
|
2
|
+
import * as react_jsx_runtime15 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts
|
|
5
5
|
declare const ChatPreviewWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime15.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):
|
|
15
|
+
}: ChatPreviewWidgetProps): react_jsx_runtime15.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -8,6 +8,7 @@ const require_types = require('../../CXIntegration/types.cjs');
|
|
|
8
8
|
const require_constants = require('./constants.cjs');
|
|
9
9
|
const require_useUnifiedCXButton = require('../../CXIntegration/hooks/useUnifiedCXButton.cjs');
|
|
10
10
|
const require_useFloatingButtonVisibility = require('./hooks/useFloatingButtonVisibility.cjs');
|
|
11
|
+
const require_useAutoPopup = require('./hooks/useAutoPopup.cjs');
|
|
11
12
|
let react = require("react");
|
|
12
13
|
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
13
14
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -20,29 +21,49 @@ let __envive_ai_react_toolkit_v3_FloatingButton = require("@envive-ai/react-tool
|
|
|
20
21
|
|
|
21
22
|
//#region src/widgets/FloatingChatWidget/FloatingChatWidget.tsx
|
|
22
23
|
const FloatingChat = (0, react.lazy)(async () => ({ default: (await import("@envive-ai/react-toolkit-v3/FloatingChat")).FloatingChat }));
|
|
24
|
+
/**
|
|
25
|
+
* Wrapper component that isolates the useUnifiedCXButton hook call.
|
|
26
|
+
* Provider implementations use different React hooks internally, so the
|
|
27
|
+
* provider value must be stable across renders. Use a `key` prop based on
|
|
28
|
+
* provider to force a clean remount when the provider changes.
|
|
29
|
+
*/
|
|
30
|
+
const CXButtonProvider = ({ provider, enabled, suppressMerchantButton, onSwitchToAgent, onCXClose, children }) => {
|
|
31
|
+
const { isSwitchEnabled, toggle } = require_useUnifiedCXButton.useUnifiedCXButton({
|
|
32
|
+
provider,
|
|
33
|
+
enabled,
|
|
34
|
+
suppressMerchantButton,
|
|
35
|
+
onSwitchToAgent,
|
|
36
|
+
onCXClose
|
|
37
|
+
}) ?? {};
|
|
38
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: children({
|
|
39
|
+
isSwitchEnabled,
|
|
40
|
+
toggle
|
|
41
|
+
}) });
|
|
42
|
+
};
|
|
23
43
|
const FloatingChatWidgetHandler = (props) => {
|
|
24
44
|
const { previewButtonOnly, previewChatAlwaysOpen } = props;
|
|
25
45
|
const salesAgentData = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)();
|
|
26
46
|
const { userHasInteractedValue } = require_useGetWidgetStatus.default();
|
|
27
47
|
const { uiConfig, isUiConfigLoading, hardcopyContent } = props;
|
|
28
|
-
const {
|
|
29
|
-
|
|
30
|
-
enabled: false,
|
|
31
|
-
suppressMerchantButton: false
|
|
32
|
-
}) ?? {};
|
|
33
|
-
const { floatingButton } = uiConfig ?? {};
|
|
48
|
+
const { customerServiceIntegration, floatingButton, floatingChat } = uiConfig ?? {};
|
|
49
|
+
const cxProvider = customerServiceIntegration?.provider ?? require_types.CustomerServiceType.unsupported;
|
|
34
50
|
const { isOpen, openChat, closeChat } = (0, __envive_ai_react_hooks_hooks_ChatToggle.useChatToggle)();
|
|
51
|
+
const [isCXOpen, setIsCXOpen] = (0, react.useState)(false);
|
|
52
|
+
(0, react.useEffect)(() => {
|
|
53
|
+
if (isOpen) setIsCXOpen(false);
|
|
54
|
+
}, [isOpen]);
|
|
35
55
|
const { shouldShowFloatingButton } = require_useFloatingButtonVisibility.useFloatingButtonVisibility({
|
|
36
56
|
floatingButtonShowConfig: floatingButton?.showOption,
|
|
37
57
|
isChatOpen: isOpen,
|
|
38
58
|
userHasInteracted: userHasInteractedValue
|
|
39
59
|
});
|
|
40
60
|
const effectiveIsOpen = previewChatAlwaysOpen ? true : isOpen;
|
|
41
|
-
const buttonShouldRender = previewButtonOnly ? true : !effectiveIsOpen && shouldShowFloatingButton;
|
|
61
|
+
const buttonShouldRender = previewButtonOnly ? true : !effectiveIsOpen && shouldShowFloatingButton && !isCXOpen;
|
|
42
62
|
const theme = (0, react.useMemo)(() => {
|
|
43
63
|
if (isUiConfigLoading || !uiConfig) return __envive_ai_react_toolkit_v3_Tokens.Theme.STANDARD;
|
|
44
64
|
return uiConfig?.lookAndFeel?.theme ?? __envive_ai_react_toolkit_v3_Tokens.Theme.GLOBAL_CUSTOM;
|
|
45
65
|
}, [isUiConfigLoading, uiConfig]);
|
|
66
|
+
require_useAutoPopup.useAutoPopup({ autoPopupConfig: floatingChat?.autoPopupConfig });
|
|
46
67
|
const { trackEvent } = (0, __envive_ai_react_hooks_contexts_amplitudeContext.useAmplitude)();
|
|
47
68
|
const hasTrackedEvent = (0, react.useRef)(false);
|
|
48
69
|
(0, react.useEffect)(() => {
|
|
@@ -57,35 +78,42 @@ const FloatingChatWidgetHandler = (props) => {
|
|
|
57
78
|
hasTrackedEvent.current = true;
|
|
58
79
|
}
|
|
59
80
|
}, [trackEvent, buttonShouldRender]);
|
|
60
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CXButtonProvider, {
|
|
82
|
+
provider: cxProvider,
|
|
83
|
+
enabled: customerServiceIntegration?.enabled ?? false,
|
|
84
|
+
suppressMerchantButton: customerServiceIntegration?.suppressMerchantButton ?? false,
|
|
85
|
+
onSwitchToAgent: () => setIsCXOpen(true),
|
|
86
|
+
onCXClose: () => setIsCXOpen(false),
|
|
87
|
+
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, {
|
|
88
|
+
isOpened: effectiveIsOpen,
|
|
89
|
+
onClose: previewChatAlwaysOpen ? () => {} : () => closeChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_OVERLAY),
|
|
90
|
+
previewMode: !!previewChatAlwaysOpen,
|
|
91
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FloatingChat, {
|
|
92
|
+
theme,
|
|
93
|
+
salesAgentData,
|
|
94
|
+
hardcopyContent,
|
|
95
|
+
floatingChatConfig: uiConfig?.floatingChat ?? {},
|
|
96
|
+
lookAndFeelConfig: uiConfig?.lookAndFeel ?? {},
|
|
97
|
+
isCXButtonSwitchEnabled: !!isSwitchEnabled?.(),
|
|
98
|
+
isFloatingChatOpen: effectiveIsOpen,
|
|
99
|
+
onToggleCXButton: toggle,
|
|
100
|
+
debugBar: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_debugBar.DebugBar, {}),
|
|
101
|
+
onClose: previewChatAlwaysOpen ? () => {} : () => closeChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON)
|
|
102
|
+
}) })
|
|
103
|
+
}), buttonShouldRender && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_FloatingButton.FloatingButton, {
|
|
104
|
+
id: require_constants.FLOATING_BUTTON_ID,
|
|
105
|
+
variant: floatingButton?.style,
|
|
106
|
+
mode: floatingButton?.mode,
|
|
107
|
+
backgroundColor: floatingButton?.backgroundColor,
|
|
108
|
+
onClick: previewButtonOnly ? () => {} : () => openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_BUTTON),
|
|
109
|
+
customIcon: floatingButton?.iconSVGSrc,
|
|
110
|
+
show: floatingButton?.showOption,
|
|
111
|
+
location: floatingButton?.position,
|
|
112
|
+
hasInteractionHappened: userHasInteractedValue,
|
|
113
|
+
ariaLabel: "Open chat",
|
|
114
|
+
previewMode: !!previewButtonOnly
|
|
115
|
+
})] })
|
|
116
|
+
}, cxProvider);
|
|
89
117
|
};
|
|
90
118
|
const FloatingChatWidgetWithBaseWidget = require_withBaseWidget.withBaseWidget(FloatingChatWidgetHandler);
|
|
91
119
|
const FloatingChatWidget = ({ previewButtonOnly, previewChatAlwaysOpen } = {}) => {
|