@envive-ai/react-widgets-v3 0.3.13 → 0.3.14
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/implementations/useHelpScoutUnifiedCXButton.cjs +65 -0
- package/dist/CXIntegration/implementations/useHelpScoutUnifiedCXButton.js +64 -0
- package/dist/CXIntegration/implementations/useTalkdeskUnifiedCXButton.cjs +64 -0
- package/dist/CXIntegration/implementations/useTalkdeskUnifiedCXButton.js +63 -0
- package/dist/CXIntegration/types.cjs +2 -0
- package/dist/CXIntegration/types.js +2 -0
- package/dist/CXIntegration/utils/functions.cjs +4 -0
- package/dist/CXIntegration/utils/functions.js +4 -0
- package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +2 -2
- package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
- package/dist/packages/widgets/dist/SearchResults/SearchResults.d.ts +2 -2
- package/dist/packages/widgets/dist/SearchResults/SearchResultsWidget.d.ts +2 -2
- package/dist/packages/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.ts +2 -2
- package/dist/packages/widgets/dist/SuggestionBar/SuggestionBar.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/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +2 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +2 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +19 -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 +20 -4
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +10 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +12 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +2 -9
- 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 -8
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
- package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +10 -0
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.js +12 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +11 -0
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +12 -1
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +23 -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 +24 -4
- package/dist/widgets/dist/SearchResults/SearchResults.d.cts +2 -2
- package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.cts +2 -2
- package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.cts +2 -2
- package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.cts +2 -2
- package/dist/widgets/utils/functions.cjs +9 -0
- package/dist/widgets/utils/functions.js +9 -1
- package/package.json +1 -1
- package/src/CXIntegration/implementations/useHelpScoutUnifiedCXButton.ts +108 -0
- package/src/CXIntegration/implementations/useTalkdeskUnifiedCXButton.ts +94 -0
- package/src/CXIntegration/types.ts +2 -0
- package/src/CXIntegration/utils/functions.ts +8 -0
- package/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.tsx +15 -3
- package/src/widgets/ChatPreviewWidget/__tests__/ChatPreviewWidget.test.tsx +114 -0
- package/src/widgets/FloatingChatWidget/__tests__/FloatingChatWidget.test.tsx +119 -0
- package/src/widgets/ProductCardWidget/ProductCardWidget.tsx +15 -3
- package/src/widgets/ProductCardWidget/__tests__/ProductCardWidget.test.tsx +144 -0
- package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +12 -1
- package/src/widgets/PromptButtonCarouselWithImageWidget/__tests__/PromptButtonCarouselWithImageWidget.test.tsx +179 -0
- package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +1 -14
- package/src/widgets/PromptCarouselWidget/__tests__/PromptCarouselWidget.test.tsx +150 -0
- package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +12 -1
- package/src/widgets/SocialProofWidget/__tests__/SocialProofWidget.test.tsx +184 -0
- package/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx +12 -0
- package/src/widgets/TitledPromptCarouselWidget/__tests__/TitledPromptCarouselWidget.test.tsx +150 -0
- package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +19 -2
- package/src/widgets/TypingAnimationWidget/__tests__/TypingAnimationWidget.test.tsx +163 -0
- package/src/widgets/__tests__/testUtils.tsx +63 -0
- package/src/widgets/__tests__/trackEventCanary.test.ts +45 -0
- package/src/widgets/utils/functions.ts +16 -0
|
@@ -0,0 +1,65 @@
|
|
|
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/useHelpScoutUnifiedCXButton.ts
|
|
7
|
+
const BEACON_CONTAINER_ID = "beacon-container";
|
|
8
|
+
const useHelpScoutUnifiedCXButton = ({ onSwitchToAgent, suppressMerchantButton }) => {
|
|
9
|
+
const beaconContainer = (0, __envive_ai_react_hooks_hooks_ElementObserver.useElementObserver)(__envive_ai_react_hooks_application_utils.SelectorFactory.id(BEACON_CONTAINER_ID));
|
|
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 toggle = () => {
|
|
12
|
+
onSwitchToAgent();
|
|
13
|
+
if (typeof window.Beacon !== "undefined") window.Beacon("open");
|
|
14
|
+
else {
|
|
15
|
+
const fabButton = document.getElementById(BEACON_CONTAINER_ID)?.querySelector(".BeaconFabButtonFrame");
|
|
16
|
+
if (fabButton) {
|
|
17
|
+
fabButton.style.display = "";
|
|
18
|
+
fabButton.click();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (suppressMerchantButton) enviveFloatingButton.hide();
|
|
22
|
+
};
|
|
23
|
+
const isHelpScoutButtonEnabled = () => {
|
|
24
|
+
const beaconContainerEl = document.getElementById("beacon-container");
|
|
25
|
+
if (!beaconContainerEl) return false;
|
|
26
|
+
const fabButton = beaconContainerEl.querySelector(".BeaconFabButtonFrame");
|
|
27
|
+
const hasBeaconAPI = typeof window.Beacon !== "undefined";
|
|
28
|
+
return !!(fabButton || hasBeaconAPI);
|
|
29
|
+
};
|
|
30
|
+
const isSwitchEnabled = () => isHelpScoutButtonEnabled();
|
|
31
|
+
beaconContainer.onAdd(() => {
|
|
32
|
+
if (suppressMerchantButton) {
|
|
33
|
+
const fabButton = document.getElementById(BEACON_CONTAINER_ID)?.querySelector(".BeaconFabButtonFrame");
|
|
34
|
+
if (fabButton) fabButton.style.display = "none";
|
|
35
|
+
enviveFloatingButton.show();
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
beaconContainer.onChange((el) => {
|
|
39
|
+
if (el && suppressMerchantButton) {
|
|
40
|
+
const beaconWidget = el.querySelector(".BeaconContainer");
|
|
41
|
+
const fabButton = el.querySelector(".BeaconFabButtonFrame");
|
|
42
|
+
if (beaconWidget && fabButton) {
|
|
43
|
+
const { classList } = beaconWidget;
|
|
44
|
+
if (classList.contains("BeaconContainer-enter-done") || classList.contains("BeaconContainer-enter-active")) {
|
|
45
|
+
fabButton.style.display = "";
|
|
46
|
+
enviveFloatingButton.hide();
|
|
47
|
+
}
|
|
48
|
+
if (classList.contains("BeaconContainer-exit") || classList.contains("BeaconContainer-exit-active")) {
|
|
49
|
+
fabButton.style.display = "none";
|
|
50
|
+
enviveFloatingButton.show();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
beaconContainer.onRemove(() => {
|
|
56
|
+
if (suppressMerchantButton) enviveFloatingButton.show();
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
59
|
+
toggle,
|
|
60
|
+
isSwitchEnabled
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
exports.useHelpScoutUnifiedCXButton = useHelpScoutUnifiedCXButton;
|
|
@@ -0,0 +1,64 @@
|
|
|
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/useHelpScoutUnifiedCXButton.ts
|
|
6
|
+
const BEACON_CONTAINER_ID = "beacon-container";
|
|
7
|
+
const useHelpScoutUnifiedCXButton = ({ onSwitchToAgent, suppressMerchantButton }) => {
|
|
8
|
+
const beaconContainer = useElementObserver(SelectorFactory.id(BEACON_CONTAINER_ID));
|
|
9
|
+
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
10
|
+
const toggle = () => {
|
|
11
|
+
onSwitchToAgent();
|
|
12
|
+
if (typeof window.Beacon !== "undefined") window.Beacon("open");
|
|
13
|
+
else {
|
|
14
|
+
const fabButton = document.getElementById(BEACON_CONTAINER_ID)?.querySelector(".BeaconFabButtonFrame");
|
|
15
|
+
if (fabButton) {
|
|
16
|
+
fabButton.style.display = "";
|
|
17
|
+
fabButton.click();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (suppressMerchantButton) enviveFloatingButton.hide();
|
|
21
|
+
};
|
|
22
|
+
const isHelpScoutButtonEnabled = () => {
|
|
23
|
+
const beaconContainerEl = document.getElementById("beacon-container");
|
|
24
|
+
if (!beaconContainerEl) return false;
|
|
25
|
+
const fabButton = beaconContainerEl.querySelector(".BeaconFabButtonFrame");
|
|
26
|
+
const hasBeaconAPI = typeof window.Beacon !== "undefined";
|
|
27
|
+
return !!(fabButton || hasBeaconAPI);
|
|
28
|
+
};
|
|
29
|
+
const isSwitchEnabled = () => isHelpScoutButtonEnabled();
|
|
30
|
+
beaconContainer.onAdd(() => {
|
|
31
|
+
if (suppressMerchantButton) {
|
|
32
|
+
const fabButton = document.getElementById(BEACON_CONTAINER_ID)?.querySelector(".BeaconFabButtonFrame");
|
|
33
|
+
if (fabButton) fabButton.style.display = "none";
|
|
34
|
+
enviveFloatingButton.show();
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
beaconContainer.onChange((el) => {
|
|
38
|
+
if (el && suppressMerchantButton) {
|
|
39
|
+
const beaconWidget = el.querySelector(".BeaconContainer");
|
|
40
|
+
const fabButton = el.querySelector(".BeaconFabButtonFrame");
|
|
41
|
+
if (beaconWidget && fabButton) {
|
|
42
|
+
const { classList } = beaconWidget;
|
|
43
|
+
if (classList.contains("BeaconContainer-enter-done") || classList.contains("BeaconContainer-enter-active")) {
|
|
44
|
+
fabButton.style.display = "";
|
|
45
|
+
enviveFloatingButton.hide();
|
|
46
|
+
}
|
|
47
|
+
if (classList.contains("BeaconContainer-exit") || classList.contains("BeaconContainer-exit-active")) {
|
|
48
|
+
fabButton.style.display = "none";
|
|
49
|
+
enviveFloatingButton.show();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
beaconContainer.onRemove(() => {
|
|
55
|
+
if (suppressMerchantButton) enviveFloatingButton.show();
|
|
56
|
+
});
|
|
57
|
+
return {
|
|
58
|
+
toggle,
|
|
59
|
+
isSwitchEnabled
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
export { useHelpScoutUnifiedCXButton };
|
|
@@ -0,0 +1,64 @@
|
|
|
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/useTalkdeskUnifiedCXButton.ts
|
|
7
|
+
const useTalkdeskUnifiedCXButton = ({ onSwitchToAgent, suppressMerchantButton }) => {
|
|
8
|
+
const talkdeskButton = (0, __envive_ai_react_hooks_hooks_ElementObserver.useElementObserver)(__envive_ai_react_hooks_application_utils.SelectorFactory.id("talkdesk-chat-widget-trigger"));
|
|
9
|
+
const talkdeskWidget = (0, __envive_ai_react_hooks_hooks_ElementObserver.useElementObserver)(__envive_ai_react_hooks_application_utils.SelectorFactory.id("talkdesk-chat-widget"));
|
|
10
|
+
const talkdeskContainer = (0, __envive_ai_react_hooks_hooks_ElementObserver.useElementObserver)(__envive_ai_react_hooks_application_utils.SelectorFactory.id("tdWebchat"));
|
|
11
|
+
const enviveFloatingButton = (0, __envive_ai_react_hooks_hooks_ElementObserver.useElementObserver)(__envive_ai_react_hooks_application_utils.SelectorFactory.id(require_constants.FLOATING_BUTTON_ID));
|
|
12
|
+
const toggle = () => {
|
|
13
|
+
onSwitchToAgent();
|
|
14
|
+
if (suppressMerchantButton) enviveFloatingButton.hide();
|
|
15
|
+
talkdeskButton.show();
|
|
16
|
+
talkdeskButton.fire("click");
|
|
17
|
+
};
|
|
18
|
+
const isTalkdeskButtonEnabled = () => {
|
|
19
|
+
if (!document.getElementById("tdWebchat")) return false;
|
|
20
|
+
return !!document.getElementById("talkdesk-chat-widget-trigger");
|
|
21
|
+
};
|
|
22
|
+
const isSwitchEnabled = () => isTalkdeskButtonEnabled();
|
|
23
|
+
talkdeskButton.onAdd(() => {
|
|
24
|
+
if (suppressMerchantButton) {
|
|
25
|
+
talkdeskButton.hide();
|
|
26
|
+
enviveFloatingButton.show();
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
talkdeskWidget.onAdd((el) => {
|
|
30
|
+
if (el && suppressMerchantButton) if (el.getAttribute("aria-hidden") === "false") {
|
|
31
|
+
talkdeskButton.show();
|
|
32
|
+
enviveFloatingButton.hide();
|
|
33
|
+
} else {
|
|
34
|
+
talkdeskButton.hide();
|
|
35
|
+
enviveFloatingButton.show();
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
talkdeskWidget.onChange((el) => {
|
|
39
|
+
if (el && suppressMerchantButton) {
|
|
40
|
+
const ariaHidden = el.getAttribute("aria-hidden");
|
|
41
|
+
if (ariaHidden === "false") {
|
|
42
|
+
talkdeskButton.show();
|
|
43
|
+
enviveFloatingButton.hide();
|
|
44
|
+
}
|
|
45
|
+
if (ariaHidden === "true") {
|
|
46
|
+
talkdeskButton.hide();
|
|
47
|
+
enviveFloatingButton.show();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
talkdeskContainer.onRemove(() => {
|
|
52
|
+
if (suppressMerchantButton) {
|
|
53
|
+
talkdeskButton.hide();
|
|
54
|
+
enviveFloatingButton.show();
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return {
|
|
58
|
+
toggle,
|
|
59
|
+
isSwitchEnabled
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
exports.useTalkdeskUnifiedCXButton = useTalkdeskUnifiedCXButton;
|
|
@@ -0,0 +1,63 @@
|
|
|
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/useTalkdeskUnifiedCXButton.ts
|
|
6
|
+
const useTalkdeskUnifiedCXButton = ({ onSwitchToAgent, suppressMerchantButton }) => {
|
|
7
|
+
const talkdeskButton = useElementObserver(SelectorFactory.id("talkdesk-chat-widget-trigger"));
|
|
8
|
+
const talkdeskWidget = useElementObserver(SelectorFactory.id("talkdesk-chat-widget"));
|
|
9
|
+
const talkdeskContainer = useElementObserver(SelectorFactory.id("tdWebchat"));
|
|
10
|
+
const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
|
|
11
|
+
const toggle = () => {
|
|
12
|
+
onSwitchToAgent();
|
|
13
|
+
if (suppressMerchantButton) enviveFloatingButton.hide();
|
|
14
|
+
talkdeskButton.show();
|
|
15
|
+
talkdeskButton.fire("click");
|
|
16
|
+
};
|
|
17
|
+
const isTalkdeskButtonEnabled = () => {
|
|
18
|
+
if (!document.getElementById("tdWebchat")) return false;
|
|
19
|
+
return !!document.getElementById("talkdesk-chat-widget-trigger");
|
|
20
|
+
};
|
|
21
|
+
const isSwitchEnabled = () => isTalkdeskButtonEnabled();
|
|
22
|
+
talkdeskButton.onAdd(() => {
|
|
23
|
+
if (suppressMerchantButton) {
|
|
24
|
+
talkdeskButton.hide();
|
|
25
|
+
enviveFloatingButton.show();
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
talkdeskWidget.onAdd((el) => {
|
|
29
|
+
if (el && suppressMerchantButton) if (el.getAttribute("aria-hidden") === "false") {
|
|
30
|
+
talkdeskButton.show();
|
|
31
|
+
enviveFloatingButton.hide();
|
|
32
|
+
} else {
|
|
33
|
+
talkdeskButton.hide();
|
|
34
|
+
enviveFloatingButton.show();
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
talkdeskWidget.onChange((el) => {
|
|
38
|
+
if (el && suppressMerchantButton) {
|
|
39
|
+
const ariaHidden = el.getAttribute("aria-hidden");
|
|
40
|
+
if (ariaHidden === "false") {
|
|
41
|
+
talkdeskButton.show();
|
|
42
|
+
enviveFloatingButton.hide();
|
|
43
|
+
}
|
|
44
|
+
if (ariaHidden === "true") {
|
|
45
|
+
talkdeskButton.hide();
|
|
46
|
+
enviveFloatingButton.show();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
talkdeskContainer.onRemove(() => {
|
|
51
|
+
if (suppressMerchantButton) {
|
|
52
|
+
talkdeskButton.hide();
|
|
53
|
+
enviveFloatingButton.show();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return {
|
|
57
|
+
toggle,
|
|
58
|
+
isSwitchEnabled
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
export { useTalkdeskUnifiedCXButton };
|
|
@@ -11,6 +11,8 @@ 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["helpscout"] = "helpscout";
|
|
15
|
+
CustomerServiceType$1["talkdesk"] = "talkdesk";
|
|
14
16
|
CustomerServiceType$1["eightByEight"] = "8x8";
|
|
15
17
|
CustomerServiceType$1["unsupported"] = "unsupported";
|
|
16
18
|
return CustomerServiceType$1;
|
|
@@ -10,6 +10,8 @@ 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["helpscout"] = "helpscout";
|
|
14
|
+
CustomerServiceType$1["talkdesk"] = "talkdesk";
|
|
13
15
|
CustomerServiceType$1["eightByEight"] = "8x8";
|
|
14
16
|
CustomerServiceType$1["unsupported"] = "unsupported";
|
|
15
17
|
return CustomerServiceType$1;
|
|
@@ -9,6 +9,8 @@ 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_useHelpScoutUnifiedCXButton = require('../implementations/useHelpScoutUnifiedCXButton.cjs');
|
|
13
|
+
const require_useTalkdeskUnifiedCXButton = require('../implementations/useTalkdeskUnifiedCXButton.cjs');
|
|
12
14
|
const require_useEightByEightUnifiedCXButton = require('../implementations/useEightByEightUnifiedCXButton.cjs');
|
|
13
15
|
const require_useDefaultUnifiedCXButton = require('../implementations/useDefaultUnifiedCXButton.cjs');
|
|
14
16
|
|
|
@@ -24,6 +26,8 @@ const findCustomerServiceImpl = (provider) => {
|
|
|
24
26
|
if (provider === require_types.CustomerServiceType.redo) return require_useReDoUnifiedCXButton.useReDoUnifiedCXButton;
|
|
25
27
|
if (provider === require_types.CustomerServiceType.richpanel) return require_useRichpanelUnifiedCXButton.useRichpanelUnifiedCXButton;
|
|
26
28
|
if (provider === require_types.CustomerServiceType.zendesk) return require_useZendeskUnifiedCXButton.useZendeskUnifiedCXButton;
|
|
29
|
+
if (provider === require_types.CustomerServiceType.helpscout) return require_useHelpScoutUnifiedCXButton.useHelpScoutUnifiedCXButton;
|
|
30
|
+
if (provider === require_types.CustomerServiceType.talkdesk) return require_useTalkdeskUnifiedCXButton.useTalkdeskUnifiedCXButton;
|
|
27
31
|
if (provider === require_types.CustomerServiceType.eightByEight) return require_useEightByEightUnifiedCXButton.useEightByEightUnifiedCXButton;
|
|
28
32
|
return require_useDefaultUnifiedCXButton.useDefaultUnifiedCXButton;
|
|
29
33
|
};
|
|
@@ -9,6 +9,8 @@ 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 { useHelpScoutUnifiedCXButton } from "../implementations/useHelpScoutUnifiedCXButton.js";
|
|
13
|
+
import { useTalkdeskUnifiedCXButton } from "../implementations/useTalkdeskUnifiedCXButton.js";
|
|
12
14
|
import { useEightByEightUnifiedCXButton } from "../implementations/useEightByEightUnifiedCXButton.js";
|
|
13
15
|
import { useDefaultUnifiedCXButton } from "../implementations/useDefaultUnifiedCXButton.js";
|
|
14
16
|
|
|
@@ -24,6 +26,8 @@ const findCustomerServiceImpl = (provider) => {
|
|
|
24
26
|
if (provider === CustomerServiceType.redo) return useReDoUnifiedCXButton;
|
|
25
27
|
if (provider === CustomerServiceType.richpanel) return useRichpanelUnifiedCXButton;
|
|
26
28
|
if (provider === CustomerServiceType.zendesk) return useZendeskUnifiedCXButton;
|
|
29
|
+
if (provider === CustomerServiceType.helpscout) return useHelpScoutUnifiedCXButton;
|
|
30
|
+
if (provider === CustomerServiceType.talkdesk) return useTalkdeskUnifiedCXButton;
|
|
27
31
|
if (provider === CustomerServiceType.eightByEight) return useEightByEightUnifiedCXButton;
|
|
28
32
|
return useDefaultUnifiedCXButton;
|
|
29
33
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps, WithBaseWidgetOptions } from "./types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime7 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_runtime7.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_runtime15 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_runtime15.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SearchResultsEntryPointWidgetConfig } from "./types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
3
|
import { SearchResultsHocProps } from "@envive-ai/react-hooks/hooks/Search";
|
|
4
4
|
|
|
5
5
|
//#region ../widgets/dist/SearchResults/SearchResults.d.ts
|
|
@@ -7,7 +7,7 @@ import { SearchResultsHocProps } from "@envive-ai/react-hooks/hooks/Search";
|
|
|
7
7
|
interface SearchResultsProps extends SearchResultsHocProps {
|
|
8
8
|
widgetConfig: SearchResultsEntryPointWidgetConfig;
|
|
9
9
|
}
|
|
10
|
-
declare const SearchResults: (props: Omit<SearchResultsProps, string | number | symbol>) =>
|
|
10
|
+
declare const SearchResults: (props: Omit<SearchResultsProps, string | number | symbol>) => react_jsx_runtime1.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime3 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_runtime3.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 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_runtime0.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
|
|
17
17
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SuggestionBarLocationForMetrics } from "./types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 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>):
|
|
33
|
+
}: Readonly<SuggestionBarProps>): react_jsx_runtime0.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
|
|
2
|
+
import * as react_jsx_runtime9 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_runtime9.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_runtime9.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_runtime11 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_runtime11.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_runtime11.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_runtime13 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_runtime13.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_runtime13.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_runtime13 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_runtime13.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_runtime13.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_runtime11 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_runtime11.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_runtime11.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_runtime7 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_runtime7.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_runtime7.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime6 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):
|
|
12
|
+
}?: FloatingChatWidgetProps): react_jsx_runtime6.JSX.Element;
|
|
13
13
|
displayName: string;
|
|
14
14
|
};
|
|
15
15
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime4 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):
|
|
12
|
+
}?: FloatingChatWidgetProps): react_jsx_runtime4.JSX.Element;
|
|
13
13
|
displayName: string;
|
|
14
14
|
};
|
|
15
15
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime4 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):
|
|
11
|
+
}: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime4.JSX.Element;
|
|
12
12
|
displayName: string;
|
|
13
13
|
};
|
|
14
14
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime5 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):
|
|
11
|
+
}: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime5.JSX.Element;
|
|
12
12
|
displayName: string;
|
|
13
13
|
};
|
|
14
14
|
//#endregion
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget.cjs');
|
|
3
3
|
require('../../hocs/withBaseWidget/index.cjs');
|
|
4
|
+
const require_functions = require('../utils/functions.cjs');
|
|
4
5
|
let react = require("react");
|
|
5
6
|
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
6
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -50,14 +51,29 @@ const ProductCardWidgetHandler = (props) => {
|
|
|
50
51
|
}
|
|
51
52
|
});
|
|
52
53
|
}, [trackEvent, widgetConfigId]);
|
|
53
|
-
const handleSelect = (0, react.useCallback)((
|
|
54
|
+
const handleSelect = (0, react.useCallback)((text) => {
|
|
55
|
+
const rawValues = hardcopyContent?.rawValues;
|
|
56
|
+
const stringId = require_functions.getStringIdForText(rawValues, text);
|
|
57
|
+
trackEvent({
|
|
58
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetTextClicked,
|
|
59
|
+
eventProps: {
|
|
60
|
+
response_id: hardcopyContent?.responseId,
|
|
61
|
+
string_id: stringId,
|
|
62
|
+
text
|
|
63
|
+
}
|
|
64
|
+
});
|
|
54
65
|
onTypedMessageSubmitted({
|
|
55
|
-
query:
|
|
66
|
+
query: text,
|
|
56
67
|
userTyped: false,
|
|
57
68
|
displayLocation: __envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.PRODUCT_CARD_PROMPT_BUTTON
|
|
58
69
|
});
|
|
59
70
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.PRODUCT_CARD_PROMPT_BUTTON);
|
|
60
|
-
}, [
|
|
71
|
+
}, [
|
|
72
|
+
hardcopyContent,
|
|
73
|
+
onTypedMessageSubmitted,
|
|
74
|
+
openChat,
|
|
75
|
+
trackEvent
|
|
76
|
+
]);
|
|
61
77
|
const handleInputClick = (0, react.useCallback)(() => {
|
|
62
78
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.PRODUCT_CARD_TEXT_FIELD);
|
|
63
79
|
}, [openChat]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 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):
|
|
10
|
+
}: ProductCardWidgetProps): react_jsx_runtime0.JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|