@microsoft/omnichannel-chat-widget 0.1.0-main.0ec5410 → 0.1.0-main.106d830
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/README.md +3 -11
- package/lib/cjs/common/Constants.js +34 -4
- package/lib/cjs/common/telemetry/TelemetryConstants.js +13 -1
- package/lib/cjs/common/telemetry/TelemetryHelper.js +13 -0
- package/lib/cjs/common/telemetry/TelemetryManager.js +10 -5
- package/lib/cjs/common/telemetry/defaultConfigs/defaultAriaConfig.js +1 -1
- package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +21 -2
- package/lib/cjs/common/utils.js +15 -2
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +4 -39
- package/lib/cjs/components/footerstateful/FooterStateful.js +1 -2
- package/lib/cjs/components/headerstateful/HeaderStateful.js +1 -7
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +5 -2
- package/lib/cjs/components/livechatwidget/common/endChat.js +37 -1
- package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +1 -1
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +3 -0
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +105 -20
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +7 -6
- package/lib/cjs/components/livechatwidget/common/startChat.js +38 -29
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +55 -11
- package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +8 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +6 -6
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +44 -0
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +15 -16
- package/lib/cjs/contexts/createReducer.js +0 -10
- package/lib/esm/common/Constants.js +30 -3
- package/lib/esm/common/telemetry/TelemetryConstants.js +13 -1
- package/lib/esm/common/telemetry/TelemetryHelper.js +13 -1
- package/lib/esm/common/telemetry/TelemetryManager.js +9 -5
- package/lib/esm/common/telemetry/defaultConfigs/defaultAriaConfig.js +1 -1
- package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +18 -1
- package/lib/esm/common/utils.js +11 -1
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +7 -37
- package/lib/esm/components/footerstateful/FooterStateful.js +1 -2
- package/lib/esm/components/headerstateful/HeaderStateful.js +1 -7
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +5 -3
- package/lib/esm/components/livechatwidget/common/endChat.js +37 -3
- package/lib/esm/components/livechatwidget/common/initCallingSdk.js +1 -1
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +2 -0
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +94 -20
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +4 -3
- package/lib/esm/components/livechatwidget/common/startChat.js +39 -30
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +53 -13
- package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +6 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +6 -6
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +31 -0
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +15 -16
- package/lib/esm/contexts/createReducer.js +0 -9
- package/lib/types/common/Constants.d.ts +17 -1
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +9 -2
- package/lib/types/common/telemetry/TelemetryHelper.d.ts +1 -0
- package/lib/types/common/utils.d.ts +1 -0
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +4 -4
- package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationStatefulParams.d.ts +0 -1
- package/lib/types/components/livechatwidget/common/endChat.d.ts +4 -1
- package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +5 -2
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts +1 -0
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.d.ts +1 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +15 -16
- package/package.json +3 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { LiveChatWidgetActionType } from "../../../contexts/common/LiveChatWidgetActionType";
|
|
2
1
|
import { RegisterLoggers, TelemetryManager } from "../../../common/telemetry/TelemetryManager";
|
|
2
|
+
import { LiveChatWidgetActionType } from "../../../contexts/common/LiveChatWidgetActionType";
|
|
3
3
|
import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
|
|
4
|
+
import { version as chatComponentVersion } from "@microsoft/omnichannel-chat-components/package.json";
|
|
5
|
+
import { version as chatSdkVersion } from "@microsoft/omnichannel-chat-sdk/package.json";
|
|
4
6
|
import { defaultAriaConfig } from "../../../common/telemetry/defaultConfigs/defaultAriaConfig";
|
|
5
7
|
import { defaultInternalTelemetryData } from "../../../common/telemetry/defaultConfigs/defaultTelemetryInternalData";
|
|
6
8
|
import { defaultTelemetryConfiguration } from "../../../common/telemetry/defaultConfigs/defaultTelemetryConfiguration";
|
|
7
|
-
import { version as chatComponentVersion } from "@microsoft/omnichannel-chat-components/package.json";
|
|
8
|
-
import { version as chatSdkVersion } from "@microsoft/omnichannel-chat-sdk/package.json";
|
|
9
9
|
export const registerTelemetryLoggers = (props, dispatch) => {
|
|
10
10
|
var _props$liveChatContex, _props$liveChatContex2;
|
|
11
11
|
|
|
@@ -44,6 +44,7 @@ export const registerTelemetryLoggers = (props, dispatch) => {
|
|
|
44
44
|
telemetryData.orgId = (_props$chatSDK = props.chatSDK) === null || _props$chatSDK === void 0 ? void 0 : (_props$chatSDK$omnich = _props$chatSDK.omnichannelConfig) === null || _props$chatSDK$omnich === void 0 ? void 0 : _props$chatSDK$omnich.orgId;
|
|
45
45
|
telemetryData.widgetId = (_props$chatSDK2 = props.chatSDK) === null || _props$chatSDK2 === void 0 ? void 0 : (_props$chatSDK2$omnic = _props$chatSDK2.omnichannelConfig) === null || _props$chatSDK2$omnic === void 0 ? void 0 : _props$chatSDK2$omnic.widgetId;
|
|
46
46
|
telemetryData.orgUrl = (_props$chatSDK3 = props.chatSDK) === null || _props$chatSDK3 === void 0 ? void 0 : (_props$chatSDK3$omnic = _props$chatSDK3.omnichannelConfig) === null || _props$chatSDK3$omnic === void 0 ? void 0 : _props$chatSDK3$omnic.orgUrl;
|
|
47
|
+
TelemetryManager.InternalTelemetryData = telemetryData;
|
|
47
48
|
dispatch({
|
|
48
49
|
type: LiveChatWidgetActionType.SET_TELEMETRY_DATA,
|
|
49
50
|
payload: telemetryData
|
|
@@ -10,46 +10,55 @@ import { TelemetryTimers } from "../../../common/telemetry/TelemetryManager";
|
|
|
10
10
|
import { createAdapter } from "./createAdapter";
|
|
11
11
|
import { createOnNewAdapterActivityHandler } from "../../../plugins/newMessageEventHandler";
|
|
12
12
|
import { createTimer } from "../../../common/utils";
|
|
13
|
-
import { getReconnectIdForAuthenticatedChat } from "./reconnectChatHelper";
|
|
13
|
+
import { getReconnectIdForAuthenticatedChat, handleRedirectUnauthenticatedReconnectChat } from "./reconnectChatHelper";
|
|
14
14
|
import { setPostChatContextAndLoadSurvey } from "./setPostChatContextAndLoadSurvey";
|
|
15
15
|
import { updateSessionDataForTelemetry } from "./updateSessionDataForTelemetry"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
16
|
|
|
17
17
|
const prepareStartChat = async (props, chatSDK, state, dispatch, setAdapter) => {
|
|
18
|
+
var _props$reconnectChatP;
|
|
19
|
+
|
|
18
20
|
if (await canConnectToExistingChat(props, chatSDK, state, dispatch, setAdapter)) {
|
|
19
21
|
return;
|
|
20
|
-
} //
|
|
21
|
-
|
|
22
|
+
} // Redirecting if unauthenticated reconnect chat expired
|
|
22
23
|
|
|
23
|
-
const parseToJson = false;
|
|
24
|
-
const preChatSurveyResponse = await chatSDK.getPreChatSurvey(parseToJson);
|
|
25
|
-
const showPrechat = state.appStates.conversationState === ConversationState.ProactiveChat ? preChatSurveyResponse && state.appStates.proactiveChatStates.proactiveChatEnablePrechat : preChatSurveyResponse; // Getting reconnectId for authenticated chat
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
if ((_props$reconnectChatP = props.reconnectChatPaneProps) !== null && _props$reconnectChatP !== void 0 && _props$reconnectChatP.reconnectId) {
|
|
26
|
+
var _props$reconnectChatP2, _props$reconnectChatP3;
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
dispatch({
|
|
31
|
-
type: LiveChatWidgetActionType.SET_RECONNECT_ID,
|
|
32
|
-
payload: reconnectId
|
|
33
|
-
});
|
|
34
|
-
dispatch({
|
|
35
|
-
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
36
|
-
payload: ConversationState.ReconnectChat
|
|
37
|
-
});
|
|
38
|
-
} else if (showPrechat) {
|
|
39
|
-
dispatch({
|
|
40
|
-
type: LiveChatWidgetActionType.SET_PRE_CHAT_SURVEY_RESPONSE,
|
|
41
|
-
payload: preChatSurveyResponse
|
|
42
|
-
});
|
|
43
|
-
dispatch({
|
|
44
|
-
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
45
|
-
payload: ConversationState.Prechat
|
|
46
|
-
});
|
|
28
|
+
await handleRedirectUnauthenticatedReconnectChat(chatSDK, dispatch, setAdapter, initStartChat, (_props$reconnectChatP2 = props.reconnectChatPaneProps) === null || _props$reconnectChatP2 === void 0 ? void 0 : _props$reconnectChatP2.reconnectId, (_props$reconnectChatP3 = props.reconnectChatPaneProps) === null || _props$reconnectChatP3 === void 0 ? void 0 : _props$reconnectChatP3.redirectInSameWindow);
|
|
47
29
|
} else {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
30
|
+
// Getting PreChat Survey Context
|
|
31
|
+
const parseToJson = false;
|
|
32
|
+
const preChatSurveyResponse = await chatSDK.getPreChatSurvey(parseToJson);
|
|
33
|
+
const showPrechat = state.appStates.conversationState === ConversationState.ProactiveChat ? preChatSurveyResponse && state.appStates.proactiveChatStates.proactiveChatEnablePrechat : preChatSurveyResponse; // Getting reconnectId for authenticated chat
|
|
34
|
+
|
|
35
|
+
const reconnectId = await getReconnectIdForAuthenticatedChat(props, chatSDK);
|
|
36
|
+
|
|
37
|
+
if (reconnectId) {
|
|
38
|
+
dispatch({
|
|
39
|
+
type: LiveChatWidgetActionType.SET_RECONNECT_ID,
|
|
40
|
+
payload: reconnectId
|
|
41
|
+
});
|
|
42
|
+
dispatch({
|
|
43
|
+
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
44
|
+
payload: ConversationState.ReconnectChat
|
|
45
|
+
});
|
|
46
|
+
} else if (showPrechat) {
|
|
47
|
+
dispatch({
|
|
48
|
+
type: LiveChatWidgetActionType.SET_PRE_CHAT_SURVEY_RESPONSE,
|
|
49
|
+
payload: preChatSurveyResponse
|
|
50
|
+
});
|
|
51
|
+
dispatch({
|
|
52
|
+
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
53
|
+
payload: ConversationState.Prechat
|
|
54
|
+
});
|
|
55
|
+
} else {
|
|
56
|
+
dispatch({
|
|
57
|
+
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
58
|
+
payload: ConversationState.Loading
|
|
59
|
+
});
|
|
60
|
+
await initStartChat(chatSDK, dispatch, setAdapter);
|
|
61
|
+
}
|
|
53
62
|
}
|
|
54
63
|
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
64
|
|
|
@@ -5,7 +5,7 @@ import { BroadcastService, decodeComponentString } from "@microsoft/omnichannel-
|
|
|
5
5
|
import { Stack } from "@fluentui/react";
|
|
6
6
|
import React, { useEffect, useRef, useState } from "react";
|
|
7
7
|
import { createTimer, getLocaleDirection } from "../../../common/utils";
|
|
8
|
-
import { getReconnectIdForAuthenticatedChat, handleUnauthenticatedReconnectChat } from "../common/reconnectChatHelper";
|
|
8
|
+
import { getReconnectIdForAuthenticatedChat, handleUnauthenticatedReconnectChat, startUnauthenticatedReconnectChat } from "../common/reconnectChatHelper";
|
|
9
9
|
import { initStartChat, prepareStartChat } from "../common/startChat";
|
|
10
10
|
import { shouldShowCallingContainer, shouldShowChatButton, shouldShowConfirmationPane, shouldShowEmailTranscriptPane, shouldShowHeader, shouldShowLoadingPane, shouldShowOutOfOfficeHoursPane, shouldShowPostChatLoadingPane, shouldShowPostChatSurveyPane, shouldShowPreChatSurveyPane, shouldShowProactiveChatPane, shouldShowReconnectChatPane, shouldShowWebChatContainer } from "../../../controller/componentController";
|
|
11
11
|
import CallingContainerStateful from "../../callingcontainerstateful/CallingContainerStateful";
|
|
@@ -32,7 +32,7 @@ import { createFooter } from "../common/createFooter";
|
|
|
32
32
|
import { createInternetConnectionChangeHandler } from "../common/createInternetConnectionChangeHandler";
|
|
33
33
|
import { defaultWebChatContainerStatefulProps } from "../../webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps";
|
|
34
34
|
import { disposeTelemetryLoggers } from "../common/disposeTelemetryLoggers";
|
|
35
|
-
import { endChat } from "../common/endChat";
|
|
35
|
+
import { endChat, prepareEndChat } from "../common/endChat";
|
|
36
36
|
import { getGeneralStylesForButton } from "../common/getGeneralStylesForButton";
|
|
37
37
|
import { initCallingSdk } from "../common/initCallingSdk";
|
|
38
38
|
import { initConfirmationPropsComposer } from "../common/initConfirmationPropsComposer";
|
|
@@ -44,7 +44,7 @@ import useChatAdapterStore from "../../../hooks/useChatAdapterStore";
|
|
|
44
44
|
import useChatContextStore from "../../../hooks/useChatContextStore";
|
|
45
45
|
import useChatSDKStore from "../../../hooks/useChatSDKStore";
|
|
46
46
|
export const LiveChatWidgetStateful = props => {
|
|
47
|
-
var _props$webChatContain, _props$styleProps, _props$controlProps, _props$webChatContain3, _props$webChatContain4, _props$styleProps2, _props$controlProps5, _props$componentOverr, _props$controlProps6, _props$componentOverr2, _props$controlProps7, _props$componentOverr3, _props$controlProps8, _props$componentOverr4, _props$controlProps9, _props$componentOverr5, _props$controlProps10, _props$componentOverr6, _props$controlProps11, _props$controlProps12, _props$controlProps13, _props$
|
|
47
|
+
var _props$webChatContain, _props$styleProps, _props$controlProps, _props$webChatContain3, _props$webChatContain4, _props$styleProps2, _props$controlProps5, _props$componentOverr, _props$controlProps6, _props$componentOverr2, _props$controlProps7, _props$componentOverr3, _props$controlProps8, _props$componentOverr4, _props$controlProps9, _props$componentOverr5, _props$controlProps10, _props$componentOverr6, _props$controlProps11, _props$componentOverr7, _props$controlProps12, _props$controlProps13, _props$componentOverr8, _props$controlProps14, _props$componentOverr9, _props$controlProps15, _props$componentOverr10, _props$componentOverr11, _props$componentOverr12;
|
|
48
48
|
|
|
49
49
|
const [state, dispatch] = useChatContextStore(); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50
50
|
|
|
@@ -58,7 +58,8 @@ export const LiveChatWidgetStateful = props => {
|
|
|
58
58
|
const {
|
|
59
59
|
Composer
|
|
60
60
|
} = Components;
|
|
61
|
-
const canStartProactiveChat = useRef(true);
|
|
61
|
+
const canStartProactiveChat = useRef(true);
|
|
62
|
+
const canEndChat = useRef(true); // Process general styles
|
|
62
63
|
|
|
63
64
|
const generalStyles = {
|
|
64
65
|
root: Object.assign({}, getGeneralStylesForButton(state), (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyles)
|
|
@@ -90,7 +91,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
90
91
|
if (!((_props$controlProps3 = props.controlProps) !== null && _props$controlProps3 !== void 0 && _props$controlProps3.skipChatButtonRendering) && (_props$reconnectChatP = props.reconnectChatPaneProps) !== null && _props$reconnectChatP !== void 0 && _props$reconnectChatP.reconnectId) {
|
|
91
92
|
var _props$reconnectChatP2;
|
|
92
93
|
|
|
93
|
-
|
|
94
|
+
startUnauthenticatedReconnectChat(chatSDK, dispatch, setAdapter, (_props$reconnectChatP2 = props.reconnectChatPaneProps) === null || _props$reconnectChatP2 === void 0 ? void 0 : _props$reconnectChatP2.reconnectId, initStartChat);
|
|
94
95
|
} // Initialize global dir
|
|
95
96
|
|
|
96
97
|
|
|
@@ -116,9 +117,9 @@ export const LiveChatWidgetStateful = props => {
|
|
|
116
117
|
var _props$reconnectChatP3;
|
|
117
118
|
|
|
118
119
|
if ((_props$reconnectChatP3 = props.reconnectChatPaneProps) !== null && _props$reconnectChatP3 !== void 0 && _props$reconnectChatP3.reconnectId && !state.appStates.reconnectId) {
|
|
119
|
-
var _props$reconnectChatP4;
|
|
120
|
+
var _props$reconnectChatP4, _props$reconnectChatP5;
|
|
120
121
|
|
|
121
|
-
handleUnauthenticatedReconnectChat(dispatch, (_props$reconnectChatP4 = props.reconnectChatPaneProps) === null || _props$reconnectChatP4 === void 0 ? void 0 : _props$reconnectChatP4.reconnectId, initStartChat);
|
|
122
|
+
handleUnauthenticatedReconnectChat(chatSDK, dispatch, setAdapter, (_props$reconnectChatP4 = props.reconnectChatPaneProps) === null || _props$reconnectChatP4 === void 0 ? void 0 : _props$reconnectChatP4.reconnectId, initStartChat, (_props$reconnectChatP5 = props.reconnectChatPaneProps) === null || _props$reconnectChatP5 === void 0 ? void 0 : _props$reconnectChatP5.redirectInSameWindow);
|
|
122
123
|
} else {
|
|
123
124
|
getReconnectIdForAuthenticatedChat(props, chatSDK).then(authReconnectId => {
|
|
124
125
|
if (authReconnectId && !state.appStates.reconnectId) {
|
|
@@ -131,6 +132,10 @@ export const LiveChatWidgetStateful = props => {
|
|
|
131
132
|
payload: ConversationState.ReconnectChat
|
|
132
133
|
});
|
|
133
134
|
} else {
|
|
135
|
+
const chatStartedSkippingChatButtonRendering = {
|
|
136
|
+
eventName: BroadcastEvent.StartChatSkippingChatButtonRendering
|
|
137
|
+
};
|
|
138
|
+
BroadcastService.postMessage(chatStartedSkippingChatButtonRendering);
|
|
134
139
|
dispatch({
|
|
135
140
|
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
136
141
|
payload: ConversationState.Loading
|
|
@@ -158,6 +163,37 @@ export const LiveChatWidgetStateful = props => {
|
|
|
158
163
|
Description: "Start proactive chat method called, when chat was already triggered."
|
|
159
164
|
});
|
|
160
165
|
}
|
|
166
|
+
}); // start chat from SDK Event
|
|
167
|
+
|
|
168
|
+
BroadcastService.getMessageByEventName("StartChat").subscribe(() => {
|
|
169
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
170
|
+
Event: TelemetryEvent.StartChatEventRecevied,
|
|
171
|
+
Description: "Start chat event received."
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
if (state.appStates.isMinimized) {
|
|
175
|
+
dispatch({
|
|
176
|
+
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
177
|
+
payload: false
|
|
178
|
+
});
|
|
179
|
+
} else {
|
|
180
|
+
prepareStartChat(props, chatSDK, state, dispatch, setAdapter);
|
|
181
|
+
}
|
|
182
|
+
}); // end chat from SDK Event
|
|
183
|
+
|
|
184
|
+
BroadcastService.getMessageByEventName("EndChat").subscribe(async () => {
|
|
185
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
186
|
+
Event: TelemetryEvent.EndChatEventReceived,
|
|
187
|
+
Description: "End chat event received."
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
if (canEndChat.current) {
|
|
191
|
+
prepareEndChat(props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, state);
|
|
192
|
+
} else {
|
|
193
|
+
const skipEndChatSDK = true;
|
|
194
|
+
const skipCloseChat = false;
|
|
195
|
+
endChat(props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, skipEndChatSDK, skipCloseChat);
|
|
196
|
+
}
|
|
161
197
|
});
|
|
162
198
|
window.addEventListener("beforeunload", () => {
|
|
163
199
|
disposeTelemetryLoggers();
|
|
@@ -169,6 +205,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
169
205
|
}, []);
|
|
170
206
|
useEffect(() => {
|
|
171
207
|
canStartProactiveChat.current = state.appStates.conversationState === ConversationState.Closed;
|
|
208
|
+
canEndChat.current = state.appStates.conversationState === ConversationState.Active;
|
|
172
209
|
|
|
173
210
|
if (state.appStates.conversationState === ConversationState.Active) {
|
|
174
211
|
chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.onNewMessage(() => {
|
|
@@ -226,7 +263,10 @@ export const LiveChatWidgetStateful = props => {
|
|
|
226
263
|
const setPostChatContextRelay = () => setPostChatContextAndLoadSurvey(chatSDK, dispatch); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
227
264
|
|
|
228
265
|
|
|
229
|
-
const endChatRelay = (adapter, skipEndChatSDK, skipCloseChat) => endChat(props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, skipEndChatSDK, skipCloseChat);
|
|
266
|
+
const endChatRelay = (adapter, skipEndChatSDK, skipCloseChat) => endChat(props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, skipEndChatSDK, skipCloseChat); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
const prepareEndChatRelay = (adapter, state) => prepareEndChat(props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, state);
|
|
230
270
|
|
|
231
271
|
const prepareStartChatRelay = () => prepareStartChat(props, chatSDK, state, dispatch, setAdapter); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
232
272
|
|
|
@@ -264,14 +304,14 @@ export const LiveChatWidgetStateful = props => {
|
|
|
264
304
|
})), !((_props$controlProps8 = props.controlProps) !== null && _props$controlProps8 !== void 0 && _props$controlProps8.hideLoadingPane) && shouldShowLoadingPane(state) && (decodeComponentString((_props$componentOverr4 = props.componentOverrides) === null || _props$componentOverr4 === void 0 ? void 0 : _props$componentOverr4.loadingPane) || /*#__PURE__*/React.createElement(LoadingPaneStateful, props.loadingPaneProps)), !((_props$controlProps9 = props.controlProps) !== null && _props$controlProps9 !== void 0 && _props$controlProps9.hideOutOfOfficeHoursPane) && shouldShowOutOfOfficeHoursPane(state) && (decodeComponentString((_props$componentOverr5 = props.componentOverrides) === null || _props$componentOverr5 === void 0 ? void 0 : _props$componentOverr5.outOfOfficeHoursPane) || /*#__PURE__*/React.createElement(OutOfOfficeHoursPaneStateful, props.outOfOfficeHoursPaneProps)), !((_props$controlProps10 = props.controlProps) !== null && _props$controlProps10 !== void 0 && _props$controlProps10.hideReconnectChatPane) && shouldShowReconnectChatPane(state) && (decodeComponentString((_props$componentOverr6 = props.componentOverrides) === null || _props$componentOverr6 === void 0 ? void 0 : _props$componentOverr6.reconnectChatPane) || /*#__PURE__*/React.createElement(ReconnectChatPaneStateful, {
|
|
265
305
|
reconnectChatProps: props.reconnectChatPaneProps,
|
|
266
306
|
initStartChat: initStartChatRelay
|
|
267
|
-
})), !((_props$controlProps11 = props.controlProps) !== null && _props$controlProps11 !== void 0 && _props$controlProps11.hidePreChatSurveyPane) && shouldShowPreChatSurveyPane(state) && /*#__PURE__*/React.createElement(PreChatSurveyPaneStateful, {
|
|
307
|
+
})), !((_props$controlProps11 = props.controlProps) !== null && _props$controlProps11 !== void 0 && _props$controlProps11.hidePreChatSurveyPane) && shouldShowPreChatSurveyPane(state) && (decodeComponentString((_props$componentOverr7 = props.componentOverrides) === null || _props$componentOverr7 === void 0 ? void 0 : _props$componentOverr7.preChatSurveyPane) || /*#__PURE__*/React.createElement(PreChatSurveyPaneStateful, {
|
|
268
308
|
surveyProps: props.preChatSurveyPaneProps,
|
|
269
309
|
initStartChat: initStartChatRelay
|
|
270
|
-
}), !((_props$controlProps12 = props.controlProps) !== null && _props$controlProps12 !== void 0 && _props$controlProps12.hideCallingContainer) && shouldShowCallingContainer(state) && /*#__PURE__*/React.createElement(CallingContainerStateful, _extends({
|
|
310
|
+
})), !((_props$controlProps12 = props.controlProps) !== null && _props$controlProps12 !== void 0 && _props$controlProps12.hideCallingContainer) && shouldShowCallingContainer(state) && /*#__PURE__*/React.createElement(CallingContainerStateful, _extends({
|
|
271
311
|
voiceVideoCallingSdk: voiceVideoCallingSDK
|
|
272
|
-
}, props.callingContainerProps)), !((_props$controlProps13 = props.controlProps) !== null && _props$controlProps13 !== void 0 && _props$controlProps13.hideWebChatContainer) && shouldShowWebChatContainer(state) && (decodeComponentString((_props$
|
|
312
|
+
}, props.callingContainerProps)), !((_props$controlProps13 = props.controlProps) !== null && _props$controlProps13 !== void 0 && _props$controlProps13.hideWebChatContainer) && shouldShowWebChatContainer(state) && (decodeComponentString((_props$componentOverr8 = props.componentOverrides) === null || _props$componentOverr8 === void 0 ? void 0 : _props$componentOverr8.webChatContainer) || /*#__PURE__*/React.createElement(WebChatContainerStateful, props.webChatContainerProps)), !((_props$controlProps14 = props.controlProps) !== null && _props$controlProps14 !== void 0 && _props$controlProps14.hideConfirmationPane) && shouldShowConfirmationPane(state) && (decodeComponentString((_props$componentOverr9 = props.componentOverrides) === null || _props$componentOverr9 === void 0 ? void 0 : _props$componentOverr9.confirmationPane) || /*#__PURE__*/React.createElement(ConfirmationPaneStateful, _extends({}, confirmationPaneProps, {
|
|
273
313
|
setPostChatContext: setPostChatContextRelay,
|
|
274
|
-
|
|
275
|
-
}))), !((_props$controlProps15 = props.controlProps) !== null && _props$controlProps15 !== void 0 && _props$controlProps15.hidePostChatLoadingPane) && shouldShowPostChatLoadingPane(state) && (decodeComponentString((_props$
|
|
314
|
+
prepareEndChat: prepareEndChatRelay
|
|
315
|
+
}))), !((_props$controlProps15 = props.controlProps) !== null && _props$controlProps15 !== void 0 && _props$controlProps15.hidePostChatLoadingPane) && shouldShowPostChatLoadingPane(state) && (decodeComponentString((_props$componentOverr10 = props.componentOverrides) === null || _props$componentOverr10 === void 0 ? void 0 : _props$componentOverr10.postChatLoadingPane) || /*#__PURE__*/React.createElement(PostChatLoadingPaneStateful, props.postChatLoadingPaneProps)), shouldShowPostChatSurveyPane(state) && (decodeComponentString((_props$componentOverr11 = props.componentOverrides) === null || _props$componentOverr11 === void 0 ? void 0 : _props$componentOverr11.postChatSurveyPane) || /*#__PURE__*/React.createElement(PostChatSurveyPaneStateful, _extends({}, props.postChatSurveyPaneProps, props.chatSDK))), createFooter(props, state), shouldShowEmailTranscriptPane(state) && (decodeComponentString((_props$componentOverr12 = props.componentOverrides) === null || _props$componentOverr12 === void 0 ? void 0 : _props$componentOverr12.emailTranscriptPane) || /*#__PURE__*/React.createElement(EmailTranscriptPaneStateful, props.emailTranscriptPane))));
|
|
276
316
|
};
|
|
277
317
|
export default LiveChatWidgetStateful;
|
|
@@ -3,6 +3,8 @@ import { LoadingPane } from "@microsoft/omnichannel-chat-components";
|
|
|
3
3
|
import { defaultGeneralPostChatLoadingPaneStyleProps } from "./common/defaultgeneralPostChatLoadingPaneStyleProps";
|
|
4
4
|
import { findAllFocusableElement } from "../../common/utils";
|
|
5
5
|
import useChatContextStore from "../../hooks/useChatContextStore";
|
|
6
|
+
import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
7
|
+
import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
6
8
|
export const PostChatLoadingPaneStateful = props => {
|
|
7
9
|
var _props$styleProps;
|
|
8
10
|
|
|
@@ -28,6 +30,10 @@ export const PostChatLoadingPaneStateful = props => {
|
|
|
28
30
|
if (firstElement && firstElement[0]) {
|
|
29
31
|
firstElement[0].focus();
|
|
30
32
|
}
|
|
33
|
+
|
|
34
|
+
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
35
|
+
Event: TelemetryEvent.PostChatSurveyLoadingPaneLoaded
|
|
36
|
+
});
|
|
31
37
|
}, []);
|
|
32
38
|
return /*#__PURE__*/React.createElement(LoadingPane, {
|
|
33
39
|
componentOverrides: props.componentOverrides,
|
|
@@ -17,22 +17,22 @@ const createConversationEndMiddleware = conversationEndCallback => _ref => {
|
|
|
17
17
|
var _action$payload;
|
|
18
18
|
|
|
19
19
|
if ((action === null || action === void 0 ? void 0 : action.type) == WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY && (_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.activity) {
|
|
20
|
-
var _activity$from, _activity$from2, _activity$
|
|
20
|
+
var _activity$from, _activity$from2, _activity$channelData7, _activity$channelData8;
|
|
21
21
|
|
|
22
22
|
const activity = action.payload.activity;
|
|
23
23
|
|
|
24
24
|
if (((_activity$from = activity.from) === null || _activity$from === void 0 ? void 0 : _activity$from.role) === DirectLineSenderRole.Bot && activity.channelId === "ACS_CHANNEL") {
|
|
25
|
-
var _activity$channelData, _activity$channelData2, _activity$channelData3, _activity$channelData4;
|
|
25
|
+
var _activity$channelData, _activity$channelData2, _activity$channelData3, _activity$channelData4, _activity$channelData5, _activity$channelData6;
|
|
26
26
|
|
|
27
27
|
// ACS
|
|
28
|
-
if ((_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$channelData2 = _activity$channelData.tags) !== null && _activity$channelData2 !== void 0 && _activity$channelData2.includes(Constants.systemMessageTag) && (_activity$channelData3 = activity.channelData) !== null && _activity$channelData3 !== void 0 && (_activity$channelData4 = _activity$channelData3.tags) !== null && _activity$channelData4 !== void 0 && _activity$channelData4.includes(Constants.agentEndConversationMessageTag)) {
|
|
28
|
+
if ((_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$channelData2 = _activity$channelData.tags) !== null && _activity$channelData2 !== void 0 && _activity$channelData2.includes(Constants.systemMessageTag) && ((_activity$channelData3 = activity.channelData) !== null && _activity$channelData3 !== void 0 && (_activity$channelData4 = _activity$channelData3.tags) !== null && _activity$channelData4 !== void 0 && _activity$channelData4.includes(Constants.agentEndConversationMessageTag) || (_activity$channelData5 = activity.channelData) !== null && _activity$channelData5 !== void 0 && (_activity$channelData6 = _activity$channelData5.tags) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.includes(Constants.supervisorForceCloseMessageTag))) {
|
|
29
29
|
conversationEndCallback();
|
|
30
30
|
}
|
|
31
|
-
} else if (((_activity$from2 = activity.from) === null || _activity$from2 === void 0 ? void 0 : _activity$from2.role) === DirectLineSenderRole.Channel && ((_activity$
|
|
32
|
-
var _activity$
|
|
31
|
+
} else if (((_activity$from2 = activity.from) === null || _activity$from2 === void 0 ? void 0 : _activity$from2.role) === DirectLineSenderRole.Channel && ((_activity$channelData7 = activity.channelData) === null || _activity$channelData7 === void 0 ? void 0 : _activity$channelData7.type) === MessageTypes.Thread && (_activity$channelData8 = activity.channelData) !== null && _activity$channelData8 !== void 0 && _activity$channelData8.properties) {
|
|
32
|
+
var _activity$channelData9, _activity$channelData10, _activity$channelData11, _activity$channelData12;
|
|
33
33
|
|
|
34
34
|
// IC3
|
|
35
|
-
if (((_activity$
|
|
35
|
+
if (((_activity$channelData9 = activity.channelData) === null || _activity$channelData9 === void 0 ? void 0 : (_activity$channelData10 = _activity$channelData9.properties) === null || _activity$channelData10 === void 0 ? void 0 : _activity$channelData10.isdeleted) === Constants.truePascal || !((_activity$channelData11 = activity.channelData) !== null && _activity$channelData11 !== void 0 && (_activity$channelData12 = _activity$channelData11.properties) !== null && _activity$channelData12 !== void 0 && _activity$channelData12.containsExternalEntitiesListeningAll)) {
|
|
36
36
|
conversationEndCallback();
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { LogLevel } from "../../../../common/telemetry/TelemetryConstants";
|
|
2
|
+
import { TelemetryHelper } from "../../../../common/telemetry/TelemetryHelper";
|
|
3
|
+
export function createWebChatTelemetry() {
|
|
4
|
+
const handleTelemetry = event => {
|
|
5
|
+
const {
|
|
6
|
+
level
|
|
7
|
+
} = event;
|
|
8
|
+
const loglevel = level ? level.toUpperCase() : "";
|
|
9
|
+
|
|
10
|
+
switch (loglevel) {
|
|
11
|
+
case LogLevel.DEBUG:
|
|
12
|
+
TelemetryHelper.logWebChatEvent(LogLevel.DEBUG, event);
|
|
13
|
+
break;
|
|
14
|
+
|
|
15
|
+
case LogLevel.WARN:
|
|
16
|
+
TelemetryHelper.logWebChatEvent(LogLevel.WARN, event);
|
|
17
|
+
break;
|
|
18
|
+
|
|
19
|
+
case LogLevel.ERROR:
|
|
20
|
+
TelemetryHelper.logWebChatEvent(LogLevel.ERROR, event);
|
|
21
|
+
break;
|
|
22
|
+
|
|
23
|
+
case LogLevel.INFO:
|
|
24
|
+
default:
|
|
25
|
+
TelemetryHelper.logWebChatEvent(LogLevel.INFO, event);
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return handleTelemetry;
|
|
31
|
+
}
|
|
@@ -16,20 +16,19 @@ export let LiveChatWidgetActionType;
|
|
|
16
16
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 12] = "SET_AUDIO_NOTIFICATION";
|
|
17
17
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 13] = "SET_E2VV_ENABLED";
|
|
18
18
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 14] = "SET_POST_CHAT_CONTEXT";
|
|
19
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
20
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
21
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
22
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
23
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
24
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
25
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
26
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
27
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
28
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
29
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
30
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
31
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
32
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
33
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
34
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 30] = "SET_LIVE_CHAT_CONTEXT";
|
|
19
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 15] = "SHOW_CALLING_CONTAINER";
|
|
20
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 16] = "SET_INCOMING_CALL";
|
|
21
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 17] = "DISABLE_VIDEO_CALL";
|
|
22
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 18] = "DISABLE_LOCAL_VIDEO";
|
|
23
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 19] = "DISABLE_REMOTE_VIDEO";
|
|
24
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 20] = "SET_CHAT_TOKEN";
|
|
25
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SKIP_CHAT_BUTTON_RENDERING"] = 21] = "SET_SKIP_CHAT_BUTTON_RENDERING";
|
|
26
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 22] = "SET_PROACTIVE_CHAT_PARAMS";
|
|
27
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 23] = "SET_TELEMETRY_DATA";
|
|
28
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 24] = "SET_RECONNECT_ID";
|
|
29
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 25] = "SET_UNREAD_MESSAGE_COUNT";
|
|
30
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 26] = "SET_FOCUS_CHAT_BUTTON";
|
|
31
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT"] = 27] = "SET_CONVERSATION_ENDED_BY_AGENT";
|
|
32
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 28] = "SET_WIDGET_STATE";
|
|
33
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 29] = "SET_LIVE_CHAT_CONTEXT";
|
|
35
34
|
})(LiveChatWidgetActionType || (LiveChatWidgetActionType = {}));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* eslint-disable indent */
|
|
2
2
|
import { LiveChatWidgetActionType } from "./common/LiveChatWidgetActionType";
|
|
3
|
-
import { TelemetryManager } from "../common/telemetry/TelemetryManager";
|
|
4
3
|
export const createReducer = () => {
|
|
5
4
|
const reducer = (state, action) => {
|
|
6
5
|
var _action$payload, _action$payload2, _action$payload3;
|
|
@@ -84,13 +83,6 @@ export const createReducer = () => {
|
|
|
84
83
|
}
|
|
85
84
|
};
|
|
86
85
|
|
|
87
|
-
case LiveChatWidgetActionType.SET_SHOULD_SHOW_POST_CHAT:
|
|
88
|
-
return { ...state,
|
|
89
|
-
appStates: { ...state.appStates,
|
|
90
|
-
shouldShowPostChat: action.payload
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
|
|
94
86
|
case LiveChatWidgetActionType.SHOW_CALLING_CONTAINER:
|
|
95
87
|
return { ...state,
|
|
96
88
|
uiStates: { ...state.uiStates,
|
|
@@ -188,7 +180,6 @@ export const createReducer = () => {
|
|
|
188
180
|
};
|
|
189
181
|
|
|
190
182
|
case LiveChatWidgetActionType.SET_TELEMETRY_DATA:
|
|
191
|
-
TelemetryManager.InternalTelemetryData = action.payload;
|
|
192
183
|
return { ...state,
|
|
193
184
|
domainStates: { ...state.domainStates,
|
|
194
185
|
telemetryInternalData: action.payload
|
|
@@ -3,6 +3,7 @@ export declare class Constants {
|
|
|
3
3
|
static readonly userMessageTag = "user";
|
|
4
4
|
static readonly historyMessageTag = "history";
|
|
5
5
|
static readonly agentEndConversationMessageTag = "agentendconversation";
|
|
6
|
+
static readonly supervisorForceCloseMessageTag = "supervisorforceclosedconversation";
|
|
6
7
|
static readonly receivedMessageClassName = "ms_lcw_webchat_received_message";
|
|
7
8
|
static readonly sentMessageClassName = "ms_lcw_webchat_sent_message";
|
|
8
9
|
static readonly webchatChannelId = "webchat";
|
|
@@ -57,7 +58,6 @@ export declare class Constants {
|
|
|
57
58
|
static readonly ProactiveChatInviteTimeoutInMs = 60000;
|
|
58
59
|
static readonly InputSubmit = "InputSubmit";
|
|
59
60
|
static readonly ReconnectIdAttributeName = "oc.reconnectid";
|
|
60
|
-
static readonly redirectPageRequest = "redirectPageRequest";
|
|
61
61
|
static readonly LiveChatWidget = "LiveChatWidgetNew";
|
|
62
62
|
static readonly GuidPattern = "xx-x-4m-ym-xxx";
|
|
63
63
|
static readonly Default = "default";
|
|
@@ -136,6 +136,12 @@ export declare enum ElementType {
|
|
|
136
136
|
export declare enum ChatSDKError {
|
|
137
137
|
WidgetUseOutsideOperatingHour = "WidgetUseOutsideOperatingHour"
|
|
138
138
|
}
|
|
139
|
+
export declare enum EnvironmentVersion {
|
|
140
|
+
prod = "prod",
|
|
141
|
+
dogfood = "df",
|
|
142
|
+
int = "int",
|
|
143
|
+
test = "test"
|
|
144
|
+
}
|
|
139
145
|
export declare class TranscriptConstants {
|
|
140
146
|
static readonly ChatTranscriptsBodyColor = "#F5F5F5";
|
|
141
147
|
static readonly TranscriptMessageEmojiMessageType = "http://schema.skype.com/emoji";
|
|
@@ -148,3 +154,13 @@ export declare class TranscriptConstants {
|
|
|
148
154
|
static readonly AgentDialogColor = "#2266E3";
|
|
149
155
|
static readonly AgentFontColor = "white";
|
|
150
156
|
}
|
|
157
|
+
export declare class AriaTelemetryConstants {
|
|
158
|
+
static readonly GERMANY_ENDPOINT: string;
|
|
159
|
+
static readonly GCCH_ENDPOINT: string;
|
|
160
|
+
static readonly DOD_ENDPOINT: string;
|
|
161
|
+
static readonly EUROPE_ENDPOINT: string;
|
|
162
|
+
static readonly MOONCAKE_ENDPOINT: string;
|
|
163
|
+
static readonly Public: string;
|
|
164
|
+
static readonly EU: string;
|
|
165
|
+
static readonly lcwEUDomainNames: Array<string>;
|
|
166
|
+
}
|
|
@@ -19,7 +19,7 @@ export declare enum LogLevel {
|
|
|
19
19
|
}
|
|
20
20
|
export declare enum BroadcastEvent {
|
|
21
21
|
LoadPostChatSurvey = "LoadPostChatSurvey",
|
|
22
|
-
EndChat = "
|
|
22
|
+
EndChat = "ChatEnded",
|
|
23
23
|
NewMessageNotification = "NewMessageNotification",
|
|
24
24
|
UnreadMessageCount = "UnreadMessageCount",
|
|
25
25
|
ChatWidgetStateChanged = "ChatWidgetStateChanged",
|
|
@@ -27,7 +27,10 @@ export declare enum BroadcastEvent {
|
|
|
27
27
|
ProactiveChatStartPopoutChat = "ProactiveChatStartPopoutChat",
|
|
28
28
|
InvalidAdaptiveCardFormat = "InvalidAdaptiveCardFormat",
|
|
29
29
|
NewMessageSent = "NewMessageSent",
|
|
30
|
-
NewMessageReceived = "NewMessageReceived"
|
|
30
|
+
NewMessageReceived = "NewMessageReceived",
|
|
31
|
+
RedirectPageRequest = "RedirectPageRequest",
|
|
32
|
+
StartChatSkippingChatButtonRendering = "StartChatSkippingChatButtonRendering",
|
|
33
|
+
StartUnauthenticatedReconnectChat = "StartUnauthenticatedReconnectChat"
|
|
31
34
|
}
|
|
32
35
|
export declare enum TelemetryEvent {
|
|
33
36
|
CallAdded = "CallAdded",
|
|
@@ -75,7 +78,9 @@ export declare enum TelemetryEvent {
|
|
|
75
78
|
PrechatSurveyLoaded = "PrechatSurveyLoaded",
|
|
76
79
|
PrechatSubmitted = "PrechatSubmitted",
|
|
77
80
|
StartChatSDKCall = "StartChatCall",
|
|
81
|
+
StartChatEventRecevied = "StartChatEventReceived",
|
|
78
82
|
EndChatSDKCall = "EndChatCall",
|
|
83
|
+
EndChatEventReceived = "EndChatEventReceived",
|
|
79
84
|
OnNewMessageFailed = "OnNewMessageFailed",
|
|
80
85
|
OnNewMessageAudioNotificationFailed = "OnNewMessageAudioNotificationFailed",
|
|
81
86
|
DownloadTranscriptResponseNullOrUndefined = "DownloadTranscriptResponseNullOrUndefined",
|
|
@@ -89,6 +94,7 @@ export declare enum TelemetryEvent {
|
|
|
89
94
|
LoadingPaneLoaded = "LoadingPaneLoaded",
|
|
90
95
|
EmailTranscriptLoaded = "EmailTranscriptLoaded",
|
|
91
96
|
OutOfOfficePaneLoaded = "OutOfOfficePaneLoaded",
|
|
97
|
+
PostChatSurveyLoadingPaneLoaded = "PostChatSurveyLoadingPaneLoaded",
|
|
92
98
|
PostChatSurveyLoaded = "PostChatSurveyLoaded",
|
|
93
99
|
ConfirmationPaneLoaded = "ConfirmationPaneLoaded",
|
|
94
100
|
ProactiveChatPaneLoaded = "ProactiveChatPaneLoaded",
|
|
@@ -110,6 +116,7 @@ export declare enum TelemetryEvent {
|
|
|
110
116
|
InvalidConfiguration = "InvalidConfiguration",
|
|
111
117
|
SendTypingIndicatorSucceeded = "SendTypingIndicatorSucceeded",
|
|
112
118
|
SendTypingIndicatorFailed = "SendTypingIndicatorFailed",
|
|
119
|
+
WebChatEvent = "WebChatEvent",
|
|
113
120
|
PreChatSurveyStartChatMethodFailed = "PreChatSurveyStartChatMethodFailed",
|
|
114
121
|
ChatAlreadyTriggered = "ChatAlreadyTriggered",
|
|
115
122
|
StartProactiveChatEventReceived = "StartProactiveChatEventReceived",
|
|
@@ -35,4 +35,5 @@ export declare class TelemetryHelper {
|
|
|
35
35
|
static logActionEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
|
|
36
36
|
static logSDKEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
|
|
37
37
|
static logConfigDataEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
|
|
38
|
+
static logWebChatEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
|
|
38
39
|
}
|
|
@@ -21,3 +21,4 @@ export declare const isNullOrUndefined: (obj: any) => boolean;
|
|
|
21
21
|
export declare const isNullOrEmptyString: (s: string) => boolean;
|
|
22
22
|
export declare const newGuid: () => string;
|
|
23
23
|
export declare const createTimer: () => ITimer;
|
|
24
|
+
export declare const getDomain: (hostValue: any) => string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
|
|
1
2
|
import { IConfirmationPaneStatefulProps } from "./IConfirmationPaneStatefulProps";
|
|
2
3
|
export interface IConfirmationPaneStatefulParams extends IConfirmationPaneStatefulProps {
|
|
3
4
|
/**
|
|
@@ -5,10 +6,9 @@ export interface IConfirmationPaneStatefulParams extends IConfirmationPaneStatef
|
|
|
5
6
|
*/
|
|
6
7
|
setPostChatContext: () => Promise<void>;
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* prepareEndChat: Internal Prop injected for checking PostChat contexts and trigerring end of chat
|
|
9
10
|
* @param adapter : The chat adapter for the live chat session
|
|
10
|
-
* @param
|
|
11
|
-
* @param skipCloseChat : If set to true endchat will skip closing the live chat instance
|
|
11
|
+
* @param state : The chat state where the conversation is currently in
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
prepareEndChat: (adapter: any, state: ILiveChatWidgetContext) => Promise<void>;
|
|
14
14
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { Dispatch } from "react";
|
|
2
2
|
import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
|
|
3
3
|
import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
4
|
-
|
|
4
|
+
import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
|
|
5
|
+
declare const prepareEndChat: (props: ILiveChatWidgetProps, chatSDK: any, setAdapter: any, setWebChatStyles: any, dispatch: Dispatch<ILiveChatWidgetAction>, adapter: any, state: ILiveChatWidgetContext) => Promise<void>;
|
|
6
|
+
declare const endChat: (props: ILiveChatWidgetProps, chatSDK: any, setAdapter: any, setWebChatStyles: any, dispatch: Dispatch<ILiveChatWidgetAction>, adapter: any, skipEndChatSDK?: boolean | undefined, skipCloseChat?: boolean | undefined) => Promise<void>;
|
|
7
|
+
export { prepareEndChat, endChat };
|
|
@@ -2,6 +2,9 @@ import "regenerator-runtime/runtime";
|
|
|
2
2
|
import { Dispatch } from "react";
|
|
3
3
|
import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
|
|
4
4
|
import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
5
|
+
declare const getChatReconnectContext: (chatSDK: any, reconnectId?: string | undefined) => Promise<any>;
|
|
5
6
|
declare const getReconnectIdForAuthenticatedChat: (props: ILiveChatWidgetProps, chatSDK: any) => Promise<string | undefined>;
|
|
6
|
-
declare const handleUnauthenticatedReconnectChat: (dispatch: Dispatch<ILiveChatWidgetAction>, reconnectId: string, initStartChat: any) => Promise<void>;
|
|
7
|
-
|
|
7
|
+
declare const handleUnauthenticatedReconnectChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, reconnectId: string, initStartChat: any, redirectInSameWindow: boolean | undefined) => Promise<void>;
|
|
8
|
+
declare const startUnauthenticatedReconnectChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, reconnectId: string, initStartChat: any) => Promise<void>;
|
|
9
|
+
declare const handleRedirectUnauthenticatedReconnectChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, initStartChat: any, reconnectId: string, redirectInSameWindow: boolean | undefined) => Promise<void>;
|
|
10
|
+
export { getChatReconnectContext, getReconnectIdForAuthenticatedChat, handleUnauthenticatedReconnectChat, startUnauthenticatedReconnectChat, handleRedirectUnauthenticatedReconnectChat };
|
package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface ILiveChatWidgetComponentOverrides {
|
|
|
9
9
|
outOfOfficeHoursPane?: ReactNode | string;
|
|
10
10
|
postChatLoadingPane?: ReactNode | string;
|
|
11
11
|
postChatSurveyPane?: ReactNode | string;
|
|
12
|
+
preChatSurveyPane?: ReactNode | string;
|
|
12
13
|
proactiveChatPane?: ReactNode | string;
|
|
13
14
|
reconnectChatPane?: ReactNode | string;
|
|
14
15
|
webChatContainer?: ReactNode | string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createWebChatTelemetry(): (event: any) => void;
|