@microsoft/omnichannel-chat-widget 0.1.0-main.86df755 → 0.1.0-main.c461296
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 +235 -0
- package/lib/cjs/assets/Audios.js +8 -0
- package/lib/cjs/assets/Icons.js +28 -0
- package/lib/cjs/common/Constants.js +6 -0
- package/lib/cjs/common/contextDataStore/DataStoreManager.js +14 -0
- package/lib/cjs/{assets/assets.d.js → common/interfaces/IContextDataStore.js} +0 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +25 -3
- package/lib/cjs/common/telemetry/TelemetryHelper.js +9 -4
- package/lib/cjs/common/telemetry/TelemetryManager.js +12 -4
- package/lib/cjs/common/telemetry/defaultConfigs/defaultAriaConfig.js +3 -3
- package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +14 -1
- package/lib/cjs/common/telemetry/loggers/consoleLogger.js +3 -0
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +8 -1
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +24 -35
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -2
- package/lib/cjs/components/footerstateful/FooterStateful.js +3 -3
- package/lib/cjs/components/headerstateful/HeaderStateful.js +12 -3
- package/lib/cjs/components/livechatwidget/common/createMarkdown.js +3 -4
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +38 -33
- package/lib/cjs/components/livechatwidget/common/disposeTelemetryLoggers.js +14 -0
- package/lib/cjs/components/livechatwidget/common/endChat.js +65 -49
- package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +5 -0
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +26 -9
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +18 -3
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +26 -24
- package/lib/cjs/components/livechatwidget/common/startChat.js +77 -27
- package/lib/cjs/components/livechatwidget/common/startProactiveChat.js +3 -3
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +45 -18
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
- package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +8 -0
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +28 -11
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +10 -4
- package/lib/cjs/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +4 -0
- package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +51 -73
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +9 -46
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +6 -6
- package/lib/cjs/contexts/common/ConversationState.js +3 -2
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +4 -0
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +11 -4
- package/lib/cjs/contexts/createReducer.js +27 -0
- package/lib/cjs/controller/componentController.js +2 -2
- package/lib/cjs/plugins/newMessageEventHandler.js +102 -0
- package/lib/esm/assets/Audios.js +1 -0
- package/lib/esm/assets/Icons.js +11 -0
- package/lib/esm/common/Constants.js +6 -0
- package/lib/esm/common/contextDataStore/DataStoreManager.js +5 -0
- package/lib/esm/common/interfaces/IContextDataStore.js +1 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +21 -2
- package/lib/esm/common/telemetry/TelemetryHelper.js +9 -4
- package/lib/esm/common/telemetry/TelemetryManager.js +8 -4
- package/lib/esm/common/telemetry/defaultConfigs/defaultAriaConfig.js +3 -3
- package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +14 -1
- package/lib/esm/common/telemetry/loggers/consoleLogger.js +3 -0
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +9 -1
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +22 -34
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -2
- package/lib/esm/components/footerstateful/FooterStateful.js +3 -3
- package/lib/esm/components/headerstateful/HeaderStateful.js +13 -4
- package/lib/esm/components/livechatwidget/common/createMarkdown.js +3 -3
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +36 -33
- package/lib/esm/components/livechatwidget/common/disposeTelemetryLoggers.js +4 -0
- package/lib/esm/components/livechatwidget/common/endChat.js +64 -45
- package/lib/esm/components/livechatwidget/common/initCallingSdk.js +3 -0
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +23 -9
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +18 -2
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +23 -22
- package/lib/esm/components/livechatwidget/common/startChat.js +71 -23
- package/lib/esm/components/livechatwidget/common/startProactiveChat.js +5 -5
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +40 -17
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
- package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +6 -0
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +26 -10
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +9 -5
- package/lib/esm/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +4 -0
- package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +2 -12
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +7 -44
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +6 -6
- package/lib/esm/contexts/common/ConversationState.js +3 -2
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +4 -0
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +11 -4
- package/lib/esm/contexts/createReducer.js +27 -0
- package/lib/esm/controller/componentController.js +2 -2
- package/lib/esm/plugins/newMessageEventHandler.js +84 -0
- package/lib/types/assets/Audios.d.ts +1 -0
- package/lib/types/assets/Icons.d.ts +11 -0
- package/lib/types/common/Constants.d.ts +3 -0
- package/lib/types/common/contextDataStore/DataStoreManager.d.ts +4 -0
- package/lib/types/common/interfaces/IContextDataStore.d.ts +14 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +17 -1
- package/lib/types/common/telemetry/TelemetryManager.d.ts +1 -0
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +3 -0
- package/lib/types/common/telemetry/definitions/Payload.d.ts +3 -0
- package/lib/types/common/telemetry/interfaces/IChatSDKLogger.d.ts +1 -0
- package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +2 -0
- package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +12 -0
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +4 -1
- package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +4 -1
- package/lib/types/components/livechatwidget/common/disposeTelemetryLoggers.d.ts +1 -0
- package/lib/types/components/livechatwidget/common/endChat.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/startChat.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/startProactiveChat.d.ts +2 -1
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -0
- package/lib/types/components/prechatsurveypanestateful/interfaces/IPreChatSurveyPaneStatefulParams.d.ts +1 -1
- package/lib/types/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.d.ts +3 -0
- package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +0 -1
- package/lib/types/contexts/common/ConversationState.d.ts +3 -2
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +3 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +5 -1
- package/lib/types/plugins/newMessageEventHandler.d.ts +2 -0
- package/package.json +7 -6
- package/lib/cjs/assets/audios/newMessageNotification.mp3 +0 -0
- package/lib/cjs/assets/icons/archiveIcon.svg +0 -3
- package/lib/cjs/assets/icons/audioIcon.svg +0 -6
- package/lib/cjs/assets/icons/blankIcon.svg +0 -6
- package/lib/cjs/assets/icons/excelIcon.svg +0 -6
- package/lib/cjs/assets/icons/imageIcon.svg +0 -6
- package/lib/cjs/assets/icons/oneNoteIcon.svg +0 -6
- package/lib/cjs/assets/icons/pdfIcon.svg +0 -6
- package/lib/cjs/assets/icons/powerpointIcon.svg +0 -6
- package/lib/cjs/assets/icons/videoIcon.svg +0 -6
- package/lib/cjs/assets/icons/visioIcon.svg +0 -6
- package/lib/cjs/assets/icons/wordIcon.svg +0 -6
- package/lib/esm/assets/assets.d.js +0 -0
- package/lib/esm/assets/audios/newMessageNotification.mp3 +0 -0
- package/lib/esm/assets/icons/archiveIcon.svg +0 -3
- package/lib/esm/assets/icons/audioIcon.svg +0 -6
- package/lib/esm/assets/icons/blankIcon.svg +0 -6
- package/lib/esm/assets/icons/excelIcon.svg +0 -6
- package/lib/esm/assets/icons/imageIcon.svg +0 -6
- package/lib/esm/assets/icons/oneNoteIcon.svg +0 -6
- package/lib/esm/assets/icons/pdfIcon.svg +0 -6
- package/lib/esm/assets/icons/powerpointIcon.svg +0 -6
- package/lib/esm/assets/icons/videoIcon.svg +0 -6
- package/lib/esm/assets/icons/visioIcon.svg +0 -6
- package/lib/esm/assets/icons/wordIcon.svg +0 -6
|
@@ -7,12 +7,12 @@ exports.default = exports.ConfirmationPaneStateful = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
|
|
9
9
|
|
|
10
|
+
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
11
|
+
|
|
10
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
13
|
|
|
12
14
|
var _utils = require("../../common/utils");
|
|
13
15
|
|
|
14
|
-
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
15
|
-
|
|
16
16
|
var _Constants = require("../../common/Constants");
|
|
17
17
|
|
|
18
18
|
var _ConversationState = require("../../contexts/common/ConversationState");
|
|
@@ -46,14 +46,14 @@ const ConfirmationPaneStateful = props => {
|
|
|
46
46
|
var _state$domainStates$l, _state$domainStates$l2, _state$domainStates$l3, _state$domainStates$l4;
|
|
47
47
|
|
|
48
48
|
const initialTabIndexMap = new Map();
|
|
49
|
-
let elements = [];
|
|
49
|
+
let elements = []; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50
|
+
|
|
51
|
+
const chatSDK = (0, _useChatSDKStore.default)();
|
|
50
52
|
const [state, dispatch] = (0, _useChatContextStore.default)();
|
|
51
53
|
const {
|
|
52
|
-
setPostChatContext,
|
|
53
54
|
endChat
|
|
54
55
|
} = props; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
|
-
|
|
56
|
-
const chatSDK = (0, _useChatSDKStore.default)(); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
57
|
|
|
58
58
|
const [adapter] = (0, _useChatAdapterStore.default)();
|
|
59
59
|
const isPostChatEnabled = (_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.msdyn_postconversationsurveyenable;
|
|
@@ -62,7 +62,7 @@ const ConfirmationPaneStateful = props => {
|
|
|
62
62
|
id: "oc-lcw-confirmation-pane",
|
|
63
63
|
dir: state.domainStates.globalDir,
|
|
64
64
|
onConfirm: async () => {
|
|
65
|
-
_TelemetryHelper.TelemetryHelper.
|
|
65
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
66
66
|
Event: _TelemetryConstants.TelemetryEvent.ConfirmationConfirmButtonClicked,
|
|
67
67
|
Description: "Confirmation pane Confirm button clicked"
|
|
68
68
|
});
|
|
@@ -73,39 +73,28 @@ const ConfirmationPaneStateful = props => {
|
|
|
73
73
|
});
|
|
74
74
|
|
|
75
75
|
try {
|
|
76
|
-
//
|
|
77
|
-
const conversationDetails = await chatSDK.getConversationDetails();
|
|
78
|
-
|
|
79
|
-
if (isPostChatEnabled === "true" &&
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (state.domainStates.postChatContext) {
|
|
76
|
+
// check agent has joined conversation
|
|
77
|
+
const conversationDetails = await chatSDK.getConversationDetails();
|
|
78
|
+
|
|
79
|
+
if (isPostChatEnabled === "true" && (conversationDetails === null || conversationDetails === void 0 ? void 0 : conversationDetails.canRenderPostChat) === _Constants.Constants.truePascal) {
|
|
80
|
+
if (postChatSurveyMode === _PostChatSurveyMode.PostChatSurveyMode.Embed) {
|
|
81
|
+
const loadPostChatEvent = {
|
|
82
|
+
eventName: _TelemetryConstants.BroadcastEvent.LoadPostChatSurvey
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
_omnichannelChatComponents.BroadcastService.postMessage(loadPostChatEvent);
|
|
86
|
+
} else if (postChatSurveyMode === _PostChatSurveyMode.PostChatSurveyMode.Link) {
|
|
87
|
+
const skipEndChatSDK = false;
|
|
88
|
+
const skipCloseChat = true;
|
|
89
|
+
await endChat(adapter, skipEndChatSDK, skipCloseChat);
|
|
91
90
|
dispatch({
|
|
92
91
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
93
|
-
payload: _ConversationState.ConversationState.
|
|
92
|
+
payload: _ConversationState.ConversationState.InActive
|
|
94
93
|
});
|
|
95
94
|
}
|
|
96
95
|
} else {
|
|
97
96
|
(0, _utils.setTabIndices)(elements, initialTabIndexMap, true);
|
|
98
|
-
|
|
99
|
-
try {
|
|
100
|
-
await endChat(adapter);
|
|
101
|
-
} catch (error) {
|
|
102
|
-
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
103
|
-
Event: _TelemetryConstants.TelemetryEvent.CloseChatMethodException,
|
|
104
|
-
ExceptionDetails: {
|
|
105
|
-
exception: `Failed to endChat: ${error}`
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
}
|
|
97
|
+
await endChat(adapter);
|
|
109
98
|
}
|
|
110
99
|
} catch (ex) {
|
|
111
100
|
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
@@ -119,7 +108,7 @@ const ConfirmationPaneStateful = props => {
|
|
|
119
108
|
}
|
|
120
109
|
},
|
|
121
110
|
onCancel: () => {
|
|
122
|
-
_TelemetryHelper.TelemetryHelper.
|
|
111
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
123
112
|
Event: _TelemetryConstants.TelemetryEvent.ConfirmationCancelButtonClicked,
|
|
124
113
|
Description: "Confirmation pane Cancel button clicked."
|
|
125
114
|
});
|
|
@@ -95,8 +95,8 @@ const EmailTranscriptPaneStateful = props => {
|
|
|
95
95
|
},
|
|
96
96
|
onCancel: () => {
|
|
97
97
|
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
98
|
-
Event: _TelemetryConstants.TelemetryEvent.
|
|
99
|
-
Description: "Email Transcript button clicked."
|
|
98
|
+
Event: _TelemetryConstants.TelemetryEvent.EmailTranscriptCancelButtonClicked,
|
|
99
|
+
Description: "Email Transcript cancel button clicked."
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
closeEmailTranscriptPane();
|
|
@@ -17,6 +17,8 @@ var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components
|
|
|
17
17
|
|
|
18
18
|
var _LiveChatWidgetActionType = require("../../contexts/common/LiveChatWidgetActionType");
|
|
19
19
|
|
|
20
|
+
var _Audios = require("../../assets/Audios");
|
|
21
|
+
|
|
20
22
|
var _NotificationHandler = require("../webchatcontainerstateful/webchatcontroller/notification/NotificationHandler");
|
|
21
23
|
|
|
22
24
|
var _NotificationScenarios = require("../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios");
|
|
@@ -29,8 +31,6 @@ var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatCo
|
|
|
29
31
|
|
|
30
32
|
var _useChatSDKStore = _interopRequireDefault(require("../../hooks/useChatSDKStore"));
|
|
31
33
|
|
|
32
|
-
var _newMessageNotification = _interopRequireDefault(require("../../assets/audios/newMessageNotification.mp3"));
|
|
33
|
-
|
|
34
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
35
|
|
|
36
36
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -122,7 +122,7 @@ const FooterStateful = props => {
|
|
|
122
122
|
controlProps: controlProps,
|
|
123
123
|
styleProps: footerProps === null || footerProps === void 0 ? void 0 : footerProps.styleProps
|
|
124
124
|
}), /*#__PURE__*/_react.default.createElement(_AudioNotificationStateful.default, {
|
|
125
|
-
audioSrc: (audioNotificationProps === null || audioNotificationProps === void 0 ? void 0 : audioNotificationProps.audioSrc) ??
|
|
125
|
+
audioSrc: (audioNotificationProps === null || audioNotificationProps === void 0 ? void 0 : audioNotificationProps.audioSrc) ?? _Audios.NewMessageNotificationSoundBase64,
|
|
126
126
|
hideAudioNotificationButton: (footerProps === null || footerProps === void 0 ? void 0 : (_footerProps$controlP4 = footerProps.controlProps) === null || _footerProps$controlP4 === void 0 ? void 0 : _footerProps$controlP4.hideAudioNotificationButton) ?? false,
|
|
127
127
|
isAudioMuted: state.appStates.isAudioMuted ?? false
|
|
128
128
|
}));
|
|
@@ -43,6 +43,7 @@ const HeaderStateful = props => {
|
|
|
43
43
|
|
|
44
44
|
const [outOfOperatingHours, setOutOfOperatingHours] = (0, _react.useState)(((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.OutOfOperatingHours) === "True");
|
|
45
45
|
const outOfOfficeStyleProps = Object.assign({}, _defaultOutOfOfficeHeaderStyleProps.defaultOutOfOfficeHeaderStyleProps, outOfOfficeHeaderProps === null || outOfOfficeHeaderProps === void 0 ? void 0 : outOfOfficeHeaderProps.styleProps);
|
|
46
|
+
const conversationState = (0, _react.useRef)(state.appStates.conversationState);
|
|
46
47
|
const controlProps = {
|
|
47
48
|
id: "oc-lcw-header",
|
|
48
49
|
dir: state.domainStates.globalDir,
|
|
@@ -63,17 +64,21 @@ const HeaderStateful = props => {
|
|
|
63
64
|
Description: "Header Close button clicked."
|
|
64
65
|
});
|
|
65
66
|
|
|
66
|
-
if (
|
|
67
|
+
if (conversationState.current === _ConversationState.ConversationState.Active) {
|
|
67
68
|
dispatch({
|
|
68
69
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SHOW_CONFIRMATION,
|
|
69
70
|
payload: true
|
|
70
71
|
});
|
|
71
|
-
} else if (
|
|
72
|
+
} else if (conversationState.current === _ConversationState.ConversationState.Postchat) {
|
|
72
73
|
dispatch({
|
|
73
74
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SHOULD_SHOW_POST_CHAT,
|
|
74
75
|
payload: false
|
|
75
76
|
});
|
|
76
77
|
await endChat(adapter);
|
|
78
|
+
} else if (conversationState.current === _ConversationState.ConversationState.InActive) {
|
|
79
|
+
const skipEndChatSDK = true;
|
|
80
|
+
const skipCloseChat = false;
|
|
81
|
+
await endChat(adapter, skipEndChatSDK, skipCloseChat);
|
|
77
82
|
}
|
|
78
83
|
|
|
79
84
|
dispatch({
|
|
@@ -105,7 +110,11 @@ const HeaderStateful = props => {
|
|
|
105
110
|
if (state.appStates.outsideOperatingHours) {
|
|
106
111
|
setOutOfOperatingHours(true);
|
|
107
112
|
}
|
|
108
|
-
|
|
113
|
+
|
|
114
|
+
if (state.appStates.conversationState) {
|
|
115
|
+
conversationState.current = state.appStates.conversationState;
|
|
116
|
+
}
|
|
117
|
+
}, [state.appStates]);
|
|
109
118
|
return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.Header, {
|
|
110
119
|
componentOverrides: headerProps === null || headerProps === void 0 ? void 0 : headerProps.componentOverrides,
|
|
111
120
|
controlProps: outOfOperatingHours || state.appStates.conversationState === _ConversationState.ConversationState.OutOfOffice ? outOfOfficeControlProps : controlProps,
|
|
@@ -7,8 +7,6 @@ exports.createMarkdown = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _markdownIt = _interopRequireDefault(require("markdown-it"));
|
|
9
9
|
|
|
10
|
-
var _slackMarkdownIt = _interopRequireDefault(require("slack-markdown-it"));
|
|
11
|
-
|
|
12
10
|
var _markdownItForInline = _interopRequireDefault(require("markdown-it-for-inline"));
|
|
13
11
|
|
|
14
12
|
var _defaultMarkdownLocalizedTexts = require("../../webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts");
|
|
@@ -26,8 +24,9 @@ const createMarkdown = (disableMarkdownMessageFormatting, disableNewLineMarkdown
|
|
|
26
24
|
html: true,
|
|
27
25
|
linkify: true,
|
|
28
26
|
breaks: !disableNewLineMarkdownSupport
|
|
29
|
-
});
|
|
30
|
-
markdown.use(
|
|
27
|
+
}); // ToDo: Commenting below usage of plugin until deferred bug is resolved: https://github.com/mayashavin/markdown-it-slack/issues/1
|
|
28
|
+
// markdown.use(MarkdownSlack);
|
|
29
|
+
// Markdown override for open link in new tab
|
|
31
30
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, quotes
|
|
32
31
|
|
|
33
32
|
markdown.use(_markdownItForInline.default, "url_new_win", "link_open", function (tokens, idx, env) {
|
|
@@ -5,8 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.dummyDefaultProps = void 0;
|
|
7
7
|
|
|
8
|
+
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
9
|
+
|
|
8
10
|
var _mockadapter = _interopRequireDefault(require("../../../webchatcontainerstateful/common/mockadapter"));
|
|
9
11
|
|
|
12
|
+
var _Audios = require("../../../../assets/Audios");
|
|
13
|
+
|
|
10
14
|
var _WebChatStoreLoader = require("../../../webchatcontainerstateful/webchatcontroller/WebChatStoreLoader");
|
|
11
15
|
|
|
12
16
|
var _activityStatusMiddleware = require("../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware");
|
|
@@ -29,7 +33,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
29
33
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
30
34
|
const dummyDefaultProps = {
|
|
31
35
|
audioNotificationProps: {
|
|
32
|
-
audioSrc:
|
|
36
|
+
audioSrc: _Audios.NewMessageNotificationSoundBase64
|
|
33
37
|
},
|
|
34
38
|
callingContainerProps: {
|
|
35
39
|
controlProps: {
|
|
@@ -150,7 +154,7 @@ const dummyDefaultProps = {
|
|
|
150
154
|
id: "oc-lcw-CurrentCall-timer",
|
|
151
155
|
showHours: false,
|
|
152
156
|
timerStyles: {
|
|
153
|
-
color: "
|
|
157
|
+
color: "#FFFFFF",
|
|
154
158
|
textAlign: "center",
|
|
155
159
|
backgroundColor: "#3d3c3c",
|
|
156
160
|
height: "45px",
|
|
@@ -181,8 +185,8 @@ const dummyDefaultProps = {
|
|
|
181
185
|
},
|
|
182
186
|
audioCallButtonStyleProps: {
|
|
183
187
|
borderRadius: "50%",
|
|
184
|
-
color: "
|
|
185
|
-
backgroundColor: "
|
|
188
|
+
color: "#FFFFFF",
|
|
189
|
+
backgroundColor: "#008000",
|
|
186
190
|
lineHeight: "40px",
|
|
187
191
|
height: "40px",
|
|
188
192
|
width: "40px",
|
|
@@ -193,8 +197,8 @@ const dummyDefaultProps = {
|
|
|
193
197
|
},
|
|
194
198
|
videoCallButtonStyleProps: {
|
|
195
199
|
borderRadius: "50%",
|
|
196
|
-
color: "
|
|
197
|
-
backgroundColor: "
|
|
200
|
+
color: "#FFFFFF",
|
|
201
|
+
backgroundColor: "#008000",
|
|
198
202
|
lineHeight: "40px",
|
|
199
203
|
height: "40px",
|
|
200
204
|
width: "40px",
|
|
@@ -209,8 +213,8 @@ const dummyDefaultProps = {
|
|
|
209
213
|
},
|
|
210
214
|
declineCallButtonStyleProps: {
|
|
211
215
|
borderRadius: "50%",
|
|
212
|
-
color: "
|
|
213
|
-
backgroundColor: "
|
|
216
|
+
color: "#FFFFFF",
|
|
217
|
+
backgroundColor: "#DC0000",
|
|
214
218
|
lineHeight: "40px",
|
|
215
219
|
height: "40px",
|
|
216
220
|
width: "40px",
|
|
@@ -219,12 +223,12 @@ const dummyDefaultProps = {
|
|
|
219
223
|
},
|
|
220
224
|
incomingCallTitleStyleProps: {
|
|
221
225
|
margin: "0 5px",
|
|
222
|
-
color: "
|
|
226
|
+
color: "#FFFFFF",
|
|
223
227
|
fontSize: 12,
|
|
224
228
|
fontFamily: "Segoe UI, Arial, sans-serif"
|
|
225
229
|
},
|
|
226
230
|
itemFocusStyleProps: {
|
|
227
|
-
outline: "2px solid
|
|
231
|
+
outline: "2px solid #FFFFFF"
|
|
228
232
|
}
|
|
229
233
|
},
|
|
230
234
|
currentCallStyleProps: {
|
|
@@ -236,7 +240,7 @@ const dummyDefaultProps = {
|
|
|
236
240
|
},
|
|
237
241
|
micButtonStyleProps: {
|
|
238
242
|
borderRadius: "2px",
|
|
239
|
-
color: "
|
|
243
|
+
color: "#FFFFFF",
|
|
240
244
|
backgroundColor: "#3d3c3c",
|
|
241
245
|
height: "45px",
|
|
242
246
|
width: "50px",
|
|
@@ -247,7 +251,7 @@ const dummyDefaultProps = {
|
|
|
247
251
|
},
|
|
248
252
|
videoOffButtonStyleProps: {
|
|
249
253
|
borderRadius: "2px",
|
|
250
|
-
color: "
|
|
254
|
+
color: "#FFFFFF",
|
|
251
255
|
backgroundColor: "#3d3c3c",
|
|
252
256
|
height: "45px",
|
|
253
257
|
width: "50px",
|
|
@@ -261,8 +265,8 @@ const dummyDefaultProps = {
|
|
|
261
265
|
},
|
|
262
266
|
endCallButtonStyleProps: {
|
|
263
267
|
borderRadius: "2px",
|
|
264
|
-
color: "
|
|
265
|
-
backgroundColor: "
|
|
268
|
+
color: "#FFFFFF",
|
|
269
|
+
backgroundColor: "#DC0000",
|
|
266
270
|
lineHeight: "50px",
|
|
267
271
|
height: "45px",
|
|
268
272
|
width: "50px",
|
|
@@ -271,7 +275,7 @@ const dummyDefaultProps = {
|
|
|
271
275
|
currentCallTimerStyleProps: {
|
|
272
276
|
borderRadius: "2px",
|
|
273
277
|
margin: "1px",
|
|
274
|
-
color: "
|
|
278
|
+
color: "#FFFFFF",
|
|
275
279
|
paddingTop: "18px",
|
|
276
280
|
fontSize: 12,
|
|
277
281
|
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
@@ -384,7 +388,7 @@ const dummyDefaultProps = {
|
|
|
384
388
|
margin: "-2px -2px -2px -3px",
|
|
385
389
|
justifyContent: "center",
|
|
386
390
|
backgroundSize: "65% 65%",
|
|
387
|
-
backgroundImage:
|
|
391
|
+
backgroundImage: `url(${_omnichannelChatComponents.ModernChatIconBase64})`,
|
|
388
392
|
display: "flex",
|
|
389
393
|
backgroundRepeat: "no-repeat",
|
|
390
394
|
backgroundPosition: "center"
|
|
@@ -493,7 +497,7 @@ const dummyDefaultProps = {
|
|
|
493
497
|
},
|
|
494
498
|
styleProps: {
|
|
495
499
|
generalStyleProps: {
|
|
496
|
-
backgroundColor: "
|
|
500
|
+
backgroundColor: "#FFFFFF",
|
|
497
501
|
borderRadius: "2px",
|
|
498
502
|
color: "black",
|
|
499
503
|
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
@@ -535,7 +539,7 @@ const dummyDefaultProps = {
|
|
|
535
539
|
},
|
|
536
540
|
confirmButtonStyleProps: {
|
|
537
541
|
backgroundColor: "rgba(9,72,159,1)",
|
|
538
|
-
color: "
|
|
542
|
+
color: "#FFFFFF",
|
|
539
543
|
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
540
544
|
fontSize: "14px",
|
|
541
545
|
fontWeight: "500",
|
|
@@ -549,7 +553,7 @@ const dummyDefaultProps = {
|
|
|
549
553
|
border: "2px dotted #000"
|
|
550
554
|
},
|
|
551
555
|
cancelButtonStyleProps: {
|
|
552
|
-
backgroundColor: "
|
|
556
|
+
backgroundColor: "#FFFFFF",
|
|
553
557
|
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
554
558
|
fontSize: "14px",
|
|
555
559
|
fontWeight: "500",
|
|
@@ -905,7 +909,7 @@ const dummyDefaultProps = {
|
|
|
905
909
|
},
|
|
906
910
|
headerIconProps: {
|
|
907
911
|
id: "oc-lcw-header-icon",
|
|
908
|
-
src:
|
|
912
|
+
src: _omnichannelChatComponents.ModernChatIconBase64,
|
|
909
913
|
alt: "Chat Icon",
|
|
910
914
|
className: undefined
|
|
911
915
|
},
|
|
@@ -934,16 +938,16 @@ const dummyDefaultProps = {
|
|
|
934
938
|
fontSize: 16,
|
|
935
939
|
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
936
940
|
fontWeight: "450",
|
|
937
|
-
color: "
|
|
941
|
+
color: "#FFFFFF",
|
|
938
942
|
padding: "3px 0"
|
|
939
943
|
},
|
|
940
944
|
minimizeButtonStyleProps: {
|
|
941
|
-
color: "
|
|
945
|
+
color: "#FFFFFF",
|
|
942
946
|
margin: "5px 0",
|
|
943
947
|
fontSize: "12px"
|
|
944
948
|
},
|
|
945
949
|
closeButtonStyleProps: {
|
|
946
|
-
color: "
|
|
950
|
+
color: "#FFFFFF",
|
|
947
951
|
margin: "5px 0",
|
|
948
952
|
fontSize: "12px"
|
|
949
953
|
},
|
|
@@ -1030,7 +1034,7 @@ const dummyDefaultProps = {
|
|
|
1030
1034
|
alignSelf: "auto"
|
|
1031
1035
|
},
|
|
1032
1036
|
iconImageProps: {
|
|
1033
|
-
src: "
|
|
1037
|
+
src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2lpKSI+DQo8cGF0aCBkPSJNMTUuMTk3MSAxNi4yNzI1VjI1Ljg1MjRDMTUuMTk3MSAyNy4zODExIDE1Ljg0MDEgMjcuNTIwMSAxNi45ODMyIDI3LjUyMDFMMjYuNzA4NCAyNy41NjQ5TDMxLjAwMzkgMzIuMzEyM1YyNy41NjQ5SDMxLjg5N0MzMi4xNzQzIDI3LjU2MzcgMzIuNDQ4NyAyNy41MDc3IDMyLjcwNDUgMjcuNDAwMUMzMi45NjAzIDI3LjI5MjQgMzMuMTkyNSAyNy4xMzUzIDMzLjM4NzggMjYuOTM3NUMzMy41ODMxIDI2LjczOTggMzMuNzM3NyAyN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IjEiIHN0b3AtY29sb3I9IndoaXRlIi8+DQo8L2xpbmVhckdyYWRpZW50Pg0KPC9kZWZzPg0KPC9zdmc+DQo=",
|
|
1034
1038
|
imageFit: 0,
|
|
1035
1039
|
width: "86px",
|
|
1036
1040
|
height: "86px",
|
|
@@ -1105,7 +1109,7 @@ const dummyDefaultProps = {
|
|
|
1105
1109
|
titleStyleProps: {
|
|
1106
1110
|
// ...[Existing chat button title style props]
|
|
1107
1111
|
margin: "0 0 0 10px",
|
|
1108
|
-
color: "
|
|
1112
|
+
color: "#FFFFFF"
|
|
1109
1113
|
}
|
|
1110
1114
|
}
|
|
1111
1115
|
},
|
|
@@ -1238,7 +1242,7 @@ const dummyDefaultProps = {
|
|
|
1238
1242
|
},
|
|
1239
1243
|
headerContainerStyleProps: {
|
|
1240
1244
|
backgroundColor: "rgb(49, 95, 162)",
|
|
1241
|
-
backgroundImage:
|
|
1245
|
+
backgroundImage: `url(${_omnichannelChatComponents.ProactiveChatBannerBase64})`,
|
|
1242
1246
|
backgroundPosition: "initial",
|
|
1243
1247
|
backgroundRepeat: "no-repeat",
|
|
1244
1248
|
borderTopLeftRadius: "inherit",
|
|
@@ -1266,7 +1270,7 @@ const dummyDefaultProps = {
|
|
|
1266
1270
|
fontWeight: "600"
|
|
1267
1271
|
},
|
|
1268
1272
|
closeButtonStyleProps: {
|
|
1269
|
-
backgroundImage:
|
|
1273
|
+
backgroundImage: `url(${_omnichannelChatComponents.CloseChatButtonIconBase64})`,
|
|
1270
1274
|
backgroundPosition: "center",
|
|
1271
1275
|
backgroundRepeat: "no-repeat",
|
|
1272
1276
|
color: "#605e5c",
|
|
@@ -1389,7 +1393,7 @@ const dummyDefaultProps = {
|
|
|
1389
1393
|
lineHeight: "19px"
|
|
1390
1394
|
},
|
|
1391
1395
|
iconStyleProps: {
|
|
1392
|
-
backgroundImage:
|
|
1396
|
+
backgroundImage: `url(${_omnichannelChatComponents.ChatReconnectIconBase64})`,
|
|
1393
1397
|
backgroundPosition: "center",
|
|
1394
1398
|
backgroundRepeat: "no-repeat",
|
|
1395
1399
|
backgroundSize: "200px",
|
|
@@ -1471,7 +1475,7 @@ const dummyDefaultProps = {
|
|
|
1471
1475
|
bubbleBackground: "#315FA2",
|
|
1472
1476
|
bubbleBorderRadius: 4,
|
|
1473
1477
|
bubbleBorderWidth: 0,
|
|
1474
|
-
bubbleFromUserBackground: "
|
|
1478
|
+
bubbleFromUserBackground: "#FFFFFF",
|
|
1475
1479
|
bubbleFromUserBorderRadius: 4,
|
|
1476
1480
|
bubbleFromUserBorderWidth: 1,
|
|
1477
1481
|
bubbleFromUserTextColor: "Black",
|
|
@@ -1479,7 +1483,7 @@ const dummyDefaultProps = {
|
|
|
1479
1483
|
bubbleMaxWidth: 250,
|
|
1480
1484
|
bubbleMinHeight: 34,
|
|
1481
1485
|
bubbleMinWidth: 20,
|
|
1482
|
-
bubbleTextColor: "
|
|
1486
|
+
bubbleTextColor: "#FFFFFF",
|
|
1483
1487
|
hideSendBox: false,
|
|
1484
1488
|
hideUploadButton: true,
|
|
1485
1489
|
primaryFont: "Segoe UI, Arial, sans-serif",
|
|
@@ -1488,7 +1492,7 @@ const dummyDefaultProps = {
|
|
|
1488
1492
|
sendBoxTextWrap: true,
|
|
1489
1493
|
sendBoxHeight: 60,
|
|
1490
1494
|
sendBoxMaxHeight: 96,
|
|
1491
|
-
sendBoxBackground: "
|
|
1495
|
+
sendBoxBackground: "#FFFFFF",
|
|
1492
1496
|
showAvatarInGroup: true,
|
|
1493
1497
|
suggestedActionsStackedHeight: 125,
|
|
1494
1498
|
suggestedActionsStackedOverflow: "scroll",
|
|
@@ -1599,7 +1603,7 @@ const dummyDefaultProps = {
|
|
|
1599
1603
|
fontWeight: 600,
|
|
1600
1604
|
fontSize: "13px",
|
|
1601
1605
|
lineHeight: "18px",
|
|
1602
|
-
color: "
|
|
1606
|
+
color: "#FFFFFF",
|
|
1603
1607
|
paddingTop: "7px",
|
|
1604
1608
|
WebkitUserSelect: "none",
|
|
1605
1609
|
MozUserSelect: "none",
|
|
@@ -1703,6 +1707,7 @@ const dummyDefaultProps = {
|
|
|
1703
1707
|
PRECHAT_REQUIRED_FIELD_MISSING_MESSAGE: "{0} field is required",
|
|
1704
1708
|
MARKDOWN_EXTERNAL_LINK_ALT: "Opens in a new window; external."
|
|
1705
1709
|
}
|
|
1706
|
-
}
|
|
1710
|
+
},
|
|
1711
|
+
telemetryConfig: undefined
|
|
1707
1712
|
};
|
|
1708
1713
|
exports.dummyDefaultProps = dummyDefaultProps;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.disposeTelemetryLoggers = void 0;
|
|
7
|
+
|
|
8
|
+
var _TelemetryManager = require("../../../common/telemetry/TelemetryManager");
|
|
9
|
+
|
|
10
|
+
const disposeTelemetryLoggers = () => {
|
|
11
|
+
(0, _TelemetryManager.disposeLoggers)();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.disposeTelemetryLoggers = disposeTelemetryLoggers;
|
|
@@ -7,67 +7,83 @@ exports.endChat = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _TelemetryConstants = require("../../../common/telemetry/TelemetryConstants");
|
|
9
9
|
|
|
10
|
+
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
11
|
+
|
|
10
12
|
var _ConversationState = require("../../../contexts/common/ConversationState");
|
|
11
13
|
|
|
12
14
|
var _LiveChatWidgetActionType = require("../../../contexts/common/LiveChatWidgetActionType");
|
|
13
15
|
|
|
14
|
-
var _NotificationHandler = require("../../webchatcontainerstateful/webchatcontroller/notification/NotificationHandler");
|
|
15
|
-
|
|
16
|
-
var _NotificationScenarios = require("../../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios");
|
|
17
|
-
|
|
18
16
|
var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
19
17
|
|
|
20
18
|
var _WebChatStoreLoader = require("../../webchatcontainerstateful/webchatcontroller/WebChatStoreLoader");
|
|
21
19
|
|
|
22
20
|
var _defaultWebChatContainerStatefulProps = require("../../webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps");
|
|
23
21
|
|
|
24
|
-
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
25
|
-
|
|
26
22
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
-
const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
payload: _ConversationState.ConversationState.Closed
|
|
45
|
-
});
|
|
46
|
-
dispatch({
|
|
47
|
-
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_RECONNECT_ID,
|
|
48
|
-
payload: undefined
|
|
49
|
-
});
|
|
50
|
-
dispatch({
|
|
51
|
-
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_AUDIO_NOTIFICATION,
|
|
52
|
-
payload: null
|
|
53
|
-
});
|
|
54
|
-
dispatch({
|
|
55
|
-
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CHAT_TOKEN,
|
|
56
|
-
payload: undefined
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
60
|
-
eventName: "EndChat"
|
|
61
|
-
});
|
|
62
|
-
} catch (ex) {
|
|
63
|
-
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
64
|
-
Event: _TelemetryConstants.TelemetryEvent.EndChatSDKCallFailed,
|
|
65
|
-
ExceptionDetails: {
|
|
66
|
-
exception: ex
|
|
67
|
-
}
|
|
68
|
-
});
|
|
23
|
+
const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, skipEndChatSDK, skipCloseChat) => {
|
|
24
|
+
if (!skipEndChatSDK) {
|
|
25
|
+
try {
|
|
26
|
+
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
27
|
+
Event: _TelemetryConstants.TelemetryEvent.EndChatSDKCall
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
await (chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.endChat());
|
|
31
|
+
} catch (ex) {
|
|
32
|
+
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
33
|
+
Event: _TelemetryConstants.TelemetryEvent.EndChatSDKCallFailed,
|
|
34
|
+
ExceptionDetails: {
|
|
35
|
+
exception: ex
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
69
40
|
|
|
70
|
-
|
|
41
|
+
if (!skipCloseChat) {
|
|
42
|
+
try {
|
|
43
|
+
var _props$webChatContain;
|
|
44
|
+
|
|
45
|
+
adapter === null || adapter === void 0 ? void 0 : adapter.end();
|
|
46
|
+
setAdapter(undefined);
|
|
47
|
+
setWebChatStyles({ ..._defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles,
|
|
48
|
+
...((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.webChatStyles)
|
|
49
|
+
});
|
|
50
|
+
_WebChatStoreLoader.WebChatStoreLoader.store = null;
|
|
51
|
+
dispatch({
|
|
52
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
53
|
+
payload: _ConversationState.ConversationState.Closed
|
|
54
|
+
});
|
|
55
|
+
dispatch({
|
|
56
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY_AGENT,
|
|
57
|
+
payload: false
|
|
58
|
+
});
|
|
59
|
+
dispatch({
|
|
60
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_RECONNECT_ID,
|
|
61
|
+
payload: undefined
|
|
62
|
+
});
|
|
63
|
+
dispatch({
|
|
64
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_AUDIO_NOTIFICATION,
|
|
65
|
+
payload: null
|
|
66
|
+
});
|
|
67
|
+
dispatch({
|
|
68
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CHAT_TOKEN,
|
|
69
|
+
payload: undefined
|
|
70
|
+
});
|
|
71
|
+
dispatch({
|
|
72
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT,
|
|
73
|
+
payload: undefined
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
77
|
+
eventName: _TelemetryConstants.BroadcastEvent.EndChat
|
|
78
|
+
});
|
|
79
|
+
} catch (error) {
|
|
80
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
81
|
+
Event: _TelemetryConstants.TelemetryEvent.CloseChatMethodException,
|
|
82
|
+
ExceptionDetails: {
|
|
83
|
+
exception: `Failed to endChat: ${error}`
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
71
87
|
}
|
|
72
88
|
};
|
|
73
89
|
|
|
@@ -17,6 +17,11 @@ const initCallingSdk = async (chatSDK, setVoiceVideoCallingSDK) => {
|
|
|
17
17
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
18
|
const callingSDK = await chatSDK.getVoiceVideoCalling();
|
|
19
19
|
setVoiceVideoCallingSDK(callingSDK);
|
|
20
|
+
|
|
21
|
+
_TelemetryHelper.TelemetryHelper.logCallingEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
22
|
+
Event: _TelemetryConstants.TelemetryEvent.CallingSDKLoadSuccess
|
|
23
|
+
});
|
|
24
|
+
|
|
20
25
|
return true;
|
|
21
26
|
}
|
|
22
27
|
|