@envive-ai/react-widgets-v3 0.3.25 → 0.3.26
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 +1 -1
- package/dist/CXIntegration/hooks/useUnifiedCXButton.js +1 -1
- package/dist/CXIntegration/implementations/useTidioUnifiedCXButton.cjs +24 -5
- package/dist/CXIntegration/implementations/useTidioUnifiedCXButton.js +24 -5
- package/dist/debug/MessageContent.cjs +1 -1
- package/dist/debug/MessageContent.js +1 -1
- package/dist/debug/chatEmbed.cjs +3 -3
- package/dist/debug/chatEmbed.js +2 -2
- package/dist/debug/reportIssue.cjs +2 -2
- package/dist/debug/reportIssue.js +2 -2
- package/dist/hocs/withBaseWidget/types.d.ts +1 -1
- package/dist/hocs/withBaseWidget/withBaseWidget.cjs +1 -1
- package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +2 -2
- package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
- package/dist/hocs/withBaseWidget/withBaseWidget.js +1 -1
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs +1 -1
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js +1 -1
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +3 -3
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +4 -4
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +4 -4
- package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.cjs +1 -1
- package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.js +1 -1
- package/dist/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.cjs +1 -1
- package/dist/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.js +1 -1
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.cjs +1 -1
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +2 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.js +1 -1
- package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +3 -3
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.js +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +3 -3
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +3 -3
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +3 -3
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.cjs +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +2 -2
- package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.js +3 -3
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +3 -3
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +3 -3
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.cjs +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +2 -2
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +3 -3
- package/dist/widgets/hooks/useGetWidgetStatus.cjs +1 -1
- package/dist/widgets/hooks/useGetWidgetStatus.js +1 -1
- package/package.json +1 -1
- package/src/CXIntegration/implementations/useTidioUnifiedCXButton.ts +29 -7
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
|
|
2
|
-
import * as
|
|
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):
|
|
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):
|
|
15
|
+
}: TypingAnimationWidgetProps): react_jsx_runtime18.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
2
|
import "../../hocs/withBaseWidget/index.js";
|
|
3
3
|
import { getStringIdForText } from "../utils/functions.js";
|
|
4
|
+
import { useCallback } from "react";
|
|
5
|
+
import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
7
|
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
5
8
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
6
9
|
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
7
10
|
import { useFeatureFlagService } from "@envive-ai/react-hooks/contexts/featureFlagServiceContext";
|
|
8
11
|
import { ChatElementDisplayLocationV3, FeatureGates } from "@envive-ai/react-hooks/application/models";
|
|
9
|
-
import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
10
12
|
import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
|
|
11
13
|
import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
12
14
|
import { PromptCarouselRows, usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
13
|
-
import { useCallback } from "react";
|
|
14
|
-
import { jsx } from "react/jsx-runtime";
|
|
15
15
|
import { PromptButtonVariant } from "@envive-ai/react-toolkit-v3/PromptButton/types";
|
|
16
16
|
import { TypingAnimation } from "@envive-ai/react-toolkit-v3/TypingAnimation";
|
|
17
17
|
import { WidgetWrapperVariant } from "@envive-ai/react-toolkit-v3/WidgetWrapper";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_functions = require('../utils/functions.cjs');
|
|
3
|
+
let react = require("react");
|
|
3
4
|
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
4
5
|
let jotai = require("jotai");
|
|
5
|
-
let react = require("react");
|
|
6
6
|
let __envive_ai_react_hooks_atoms_chat_chatState = require("@envive-ai/react-hooks/atoms/chat/chatState");
|
|
7
7
|
|
|
8
8
|
//#region src/widgets/hooks/useGetWidgetStatus.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isLoading, isProductComparison, userHasInteracted, userHasNotInteracted } from "../utils/functions.js";
|
|
2
|
+
import { useMemo } from "react";
|
|
2
3
|
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
3
4
|
import { useAtomValue } from "jotai";
|
|
4
|
-
import { useMemo } from "react";
|
|
5
5
|
import { responseStreamingAtom } from "@envive-ai/react-hooks/atoms/chat/chatState";
|
|
6
6
|
|
|
7
7
|
//#region src/widgets/hooks/useGetWidgetStatus.tsx
|
package/package.json
CHANGED
|
@@ -3,6 +3,9 @@ import { useElementObserver } from '@envive-ai/react-hooks/hooks/ElementObserver
|
|
|
3
3
|
import { FLOATING_BUTTON_ID } from '../../widgets/FloatingChatWidget/constants';
|
|
4
4
|
import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
|
|
5
5
|
|
|
6
|
+
const CHAT_BUTTON_ID = 'tidio-chat';
|
|
7
|
+
const CHAT_BUTTON_SELECTOR = 'id|tidio-chat @ id|button';
|
|
8
|
+
|
|
6
9
|
declare global {
|
|
7
10
|
interface Window {
|
|
8
11
|
tidioChatApi?: {
|
|
@@ -16,21 +19,40 @@ interface UseTidioUnifiedCXButtonProps extends CustomerServiceImplProps {}
|
|
|
16
19
|
|
|
17
20
|
export const useTidioUnifiedCXButton = ({
|
|
18
21
|
onSwitchToAgent,
|
|
22
|
+
onCXClose,
|
|
23
|
+
suppressMerchantButton,
|
|
19
24
|
}: UseTidioUnifiedCXButtonProps): UnifiedCXButton => {
|
|
20
|
-
const
|
|
25
|
+
const tidioApi = window.tidioChatApi;
|
|
21
26
|
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
27
|
+
const tidioChatButton = useElementObserver(SelectorFactory.chain(CHAT_BUTTON_SELECTOR));
|
|
28
|
+
const tidioFrame = useElementObserver(SelectorFactory.id(CHAT_BUTTON_ID));
|
|
29
|
+
|
|
30
|
+
const chatButtonControl = (el: HTMLElement | null) => {
|
|
31
|
+
if (el) {
|
|
32
|
+
if (el.className.includes('chat-closed')) {
|
|
33
|
+
onCXClose?.();
|
|
34
|
+
if (suppressMerchantButton) {
|
|
35
|
+
tidioFrame.hide();
|
|
36
|
+
}
|
|
37
|
+
enviveFloatingButton.show();
|
|
38
|
+
}
|
|
39
|
+
if (el.className.includes('chat-open')) {
|
|
40
|
+
tidioFrame.show();
|
|
41
|
+
enviveFloatingButton.show();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
tidioChatButton.onAdd(chatButtonControl);
|
|
46
|
+
tidioChatButton.onChange(chatButtonControl);
|
|
22
47
|
|
|
23
48
|
const toggle = () => {
|
|
24
49
|
onSwitchToAgent();
|
|
25
50
|
enviveFloatingButton.hide();
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
51
|
+
tidioFrame.show();
|
|
52
|
+
tidioApi?.open();
|
|
29
53
|
};
|
|
30
54
|
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
const isSwitchEnabled = () => isTidioButtonEnabled();
|
|
55
|
+
const isSwitchEnabled = () => !!SelectorFactory.chain(CHAT_BUTTON_SELECTOR).parse();
|
|
34
56
|
|
|
35
57
|
return {
|
|
36
58
|
toggle,
|