@microsoft/omnichannel-chat-widget 0.1.0-main.89c6531 → 0.1.0-main.ae3aa42
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 +227 -0
- package/lib/cjs/assets/Audios.js +8 -0
- package/lib/cjs/assets/Icons.js +28 -0
- package/lib/cjs/common/Constants.js +38 -4
- 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 +37 -4
- package/lib/cjs/common/telemetry/TelemetryHelper.js +13 -0
- package/lib/cjs/common/telemetry/TelemetryManager.js +11 -6
- package/lib/cjs/common/telemetry/defaultConfigs/defaultAriaConfig.js +1 -1
- package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
- package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +31 -10
- package/lib/cjs/common/utils.js +15 -2
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -54
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -2
- package/lib/cjs/components/footerstateful/FooterStateful.js +4 -5
- package/lib/cjs/components/headerstateful/HeaderStateful.js +11 -8
- package/lib/cjs/components/livechatwidget/common/createMarkdown.js +3 -4
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +16 -9
- package/lib/cjs/components/livechatwidget/common/endChat.js +102 -50
- package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +5 -0
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +29 -9
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +105 -20
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +11 -5
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +26 -24
- package/lib/cjs/components/livechatwidget/common/startChat.js +113 -54
- package/lib/cjs/components/livechatwidget/common/startProactiveChat.js +3 -3
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +98 -37
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
- package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +8 -0
- package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.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/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +44 -0
- package/lib/cjs/contexts/common/ConversationState.js +3 -2
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +15 -13
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +9 -3
- package/lib/cjs/contexts/createReducer.js +20 -10
- 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 +34 -3
- 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 +33 -3
- package/lib/esm/common/telemetry/TelemetryHelper.js +13 -1
- package/lib/esm/common/telemetry/TelemetryManager.js +10 -6
- package/lib/esm/common/telemetry/defaultConfigs/defaultAriaConfig.js +1 -1
- package/lib/esm/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
- package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +33 -13
- package/lib/esm/common/utils.js +11 -1
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -50
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -2
- package/lib/esm/components/footerstateful/FooterStateful.js +4 -5
- package/lib/esm/components/headerstateful/HeaderStateful.js +12 -9
- package/lib/esm/components/livechatwidget/common/createMarkdown.js +3 -3
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +14 -10
- package/lib/esm/components/livechatwidget/common/endChat.js +100 -47
- package/lib/esm/components/livechatwidget/common/initCallingSdk.js +3 -0
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +25 -9
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +94 -20
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +10 -4
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +23 -22
- package/lib/esm/components/livechatwidget/common/startChat.js +108 -51
- package/lib/esm/components/livechatwidget/common/startProactiveChat.js +5 -5
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +92 -36
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
- package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +6 -0
- package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.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/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +31 -0
- package/lib/esm/contexts/common/ConversationState.js +3 -2
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +15 -13
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +9 -3
- package/lib/esm/contexts/createReducer.js +20 -9
- 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 +19 -1
- 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 +23 -1
- package/lib/types/common/telemetry/TelemetryHelper.d.ts +1 -0
- package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +3 -3
- package/lib/types/common/utils.d.ts +1 -0
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +5 -2
- package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationStatefulParams.d.ts +0 -1
- package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +4 -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/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/ILiveChatWidgetComponentOverrides.d.ts +1 -0
- 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/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +1 -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/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.d.ts +1 -0
- package/lib/types/contexts/common/ConversationState.d.ts +3 -2
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +15 -13
- package/lib/types/plugins/newMessageEventHandler.d.ts +2 -0
- package/package.json +11 -11
- 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
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.PreChatSurveyPaneStateful = void 0;
|
|
7
7
|
|
|
8
|
+
var _Constants = require("../../common/Constants");
|
|
9
|
+
|
|
8
10
|
var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
|
|
9
11
|
|
|
10
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -13,12 +15,12 @@ var _utils = require("../../common/utils");
|
|
|
13
15
|
|
|
14
16
|
var _ConversationState = require("../../contexts/common/ConversationState");
|
|
15
17
|
|
|
18
|
+
var _DataStoreManager = require("../../common/contextDataStore/DataStoreManager");
|
|
19
|
+
|
|
16
20
|
var _LiveChatWidgetActionType = require("../../contexts/common/LiveChatWidgetActionType");
|
|
17
21
|
|
|
18
22
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
19
23
|
|
|
20
|
-
var _Constants = require("../../common/Constants");
|
|
21
|
-
|
|
22
24
|
var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
23
25
|
|
|
24
26
|
var _defaultGeneralPreChatSurveyPaneStyleProps = require("./common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps");
|
|
@@ -63,7 +65,7 @@ const PreChatSurveyPaneStateful = props => {
|
|
|
63
65
|
try {
|
|
64
66
|
return (0, _utils.parseAdaptiveCardPayload)(payload, requiredFieldMissingMessage);
|
|
65
67
|
} catch (ex) {
|
|
66
|
-
_TelemetryHelper.TelemetryHelper.
|
|
68
|
+
_TelemetryHelper.TelemetryHelper.logConfigDataEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
67
69
|
Event: _TelemetryConstants.TelemetryEvent.ParseAdaptiveCardFailed,
|
|
68
70
|
Description: "Adaptive Card JSON Parse Failed.",
|
|
69
71
|
ExceptionDetails: {
|
|
@@ -91,14 +93,29 @@ const PreChatSurveyPaneStateful = props => {
|
|
|
91
93
|
});
|
|
92
94
|
|
|
93
95
|
try {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
96
|
+
var _DataStoreManager$cli, _persistedState$domai;
|
|
97
|
+
|
|
98
|
+
const widgetStateFromCache = (_DataStoreManager$cli = _DataStoreManager.DataStoreManager.clientDataStore) === null || _DataStoreManager$cli === void 0 ? void 0 : _DataStoreManager$cli.getData(_Constants.Constants.widgetStateDataKey, "localStorage");
|
|
99
|
+
const persistedState = widgetStateFromCache ? JSON.parse(widgetStateFromCache) : undefined;
|
|
100
|
+
let optionalParams = {};
|
|
101
|
+
|
|
102
|
+
if (persistedState !== null && persistedState !== void 0 && (_persistedState$domai = persistedState.domainStates) !== null && _persistedState$domai !== void 0 && _persistedState$domai.liveChatContext) {
|
|
103
|
+
var _persistedState$domai2;
|
|
104
|
+
|
|
105
|
+
optionalParams = {
|
|
106
|
+
liveChatContext: persistedState === null || persistedState === void 0 ? void 0 : (_persistedState$domai2 = persistedState.domainStates) === null || _persistedState$domai2 === void 0 ? void 0 : _persistedState$domai2.liveChatContext
|
|
107
|
+
};
|
|
108
|
+
await initStartChat(optionalParams, persistedState);
|
|
109
|
+
} else {
|
|
110
|
+
const prechatResponseValues = (0, _utils.extractPreChatSurveyResponseValues)(state.domainStates.preChatSurveyResponse, values);
|
|
111
|
+
optionalParams = {
|
|
112
|
+
initContext: {
|
|
113
|
+
preChatResponse: prechatResponseValues
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
setPreChatResponseEmail(values);
|
|
117
|
+
await initStartChat(optionalParams);
|
|
118
|
+
}
|
|
102
119
|
} catch (ex) {
|
|
103
120
|
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
104
121
|
Event: _TelemetryConstants.TelemetryEvent.PreChatSurveyStartChatMethodFailed,
|
|
@@ -51,7 +51,7 @@ const ProactiveChatPaneStateful = props => {
|
|
|
51
51
|
payload: _ConversationState.ConversationState.Closed
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
_TelemetryHelper.TelemetryHelper.
|
|
54
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
55
55
|
Event: _TelemetryConstants.TelemetryEvent.ProactiveChatRejected,
|
|
56
56
|
ElapsedTimeInMilliseconds: _TelemetryManager.TelemetryTimers.LcwLoadToChatButtonTimer.milliSecondsElapsed,
|
|
57
57
|
Description: "Proactive chat invitation timed out."
|
|
@@ -75,14 +75,14 @@ const ProactiveChatPaneStateful = props => {
|
|
|
75
75
|
if (state.appStates.proactiveChatStates.proactiveChatInNewWindow) {
|
|
76
76
|
// TODO: BroadcastService: replace with the sdk broadcast service, when in place
|
|
77
77
|
const startPopoutChatEvent = {
|
|
78
|
-
eventName:
|
|
78
|
+
eventName: _TelemetryConstants.BroadcastEvent.ProactiveChatStartPopoutChat
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
_omnichannelChatComponents.BroadcastService.postMessage(startPopoutChatEvent);
|
|
82
82
|
|
|
83
83
|
dispatch({
|
|
84
|
-
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.
|
|
85
|
-
payload:
|
|
84
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
85
|
+
payload: _ConversationState.ConversationState.Closed
|
|
86
86
|
});
|
|
87
87
|
} else if (((_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") {
|
|
88
88
|
dispatch({
|
|
@@ -94,6 +94,12 @@ const ProactiveChatPaneStateful = props => {
|
|
|
94
94
|
payload: _ConversationState.ConversationState.OutOfOffice
|
|
95
95
|
});
|
|
96
96
|
} else {
|
|
97
|
+
const proactiveChatStarted = {
|
|
98
|
+
eventName: _TelemetryConstants.BroadcastEvent.ProactiveChatStartChat
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
_omnichannelChatComponents.BroadcastService.postMessage(proactiveChatStarted);
|
|
102
|
+
|
|
97
103
|
await startChat();
|
|
98
104
|
}
|
|
99
105
|
},
|
package/lib/cjs/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js
CHANGED
|
@@ -5,85 +5,63 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.isInlineMediaSupported = exports.getFileAttachmentIconData = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _Icons = require("../../../../assets/Icons");
|
|
9
9
|
|
|
10
10
|
var _BrowserInfo = require("./BrowserInfo");
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
var _audioIcon = _interopRequireDefault(require("../../../../assets/icons/audioIcon.svg"));
|
|
15
|
-
|
|
16
|
-
var _blankIcon = _interopRequireDefault(require("../../../../assets/icons/blankIcon.svg"));
|
|
17
|
-
|
|
18
|
-
var _videoIcon = _interopRequireDefault(require("../../../../assets/icons/videoIcon.svg"));
|
|
19
|
-
|
|
20
|
-
var _imageIcon = _interopRequireDefault(require("../../../../assets/icons/imageIcon.svg"));
|
|
21
|
-
|
|
22
|
-
var _wordIcon = _interopRequireDefault(require("../../../../assets/icons/wordIcon.svg"));
|
|
23
|
-
|
|
24
|
-
var _oneNoteIcon = _interopRequireDefault(require("../../../../assets/icons/oneNoteIcon.svg"));
|
|
25
|
-
|
|
26
|
-
var _powerpointIcon = _interopRequireDefault(require("../../../../assets/icons/powerpointIcon.svg"));
|
|
27
|
-
|
|
28
|
-
var _visioIcon = _interopRequireDefault(require("../../../../assets/icons/visioIcon.svg"));
|
|
29
|
-
|
|
30
|
-
var _pdfIcon = _interopRequireDefault(require("../../../../assets/icons/pdfIcon.svg"));
|
|
31
|
-
|
|
32
|
-
var _excelIcon = _interopRequireDefault(require("../../../../assets/icons/excelIcon.svg"));
|
|
12
|
+
var _BrowserVendor = require("../../webchatcontroller/enums/BrowserVendor");
|
|
33
13
|
|
|
34
14
|
var _Constants = require("../../../../common/Constants");
|
|
35
15
|
|
|
36
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
|
-
|
|
38
16
|
const FileAttachmentIconMap = {
|
|
39
|
-
"aac":
|
|
40
|
-
"aiff":
|
|
41
|
-
"alac":
|
|
42
|
-
"avchd":
|
|
43
|
-
"avi":
|
|
44
|
-
"bmp":
|
|
45
|
-
"doc":
|
|
46
|
-
"docx":
|
|
47
|
-
"flac":
|
|
48
|
-
"flv":
|
|
49
|
-
"gif":
|
|
50
|
-
"jiff":
|
|
51
|
-
"jpeg":
|
|
52
|
-
"jpg":
|
|
53
|
-
"mpe":
|
|
54
|
-
"mpeg":
|
|
55
|
-
"mpg":
|
|
56
|
-
"mpv":
|
|
57
|
-
"mp2":
|
|
58
|
-
"mp3":
|
|
59
|
-
"mp4":
|
|
60
|
-
"m4p":
|
|
61
|
-
"m4v":
|
|
62
|
-
"mov":
|
|
63
|
-
"one":
|
|
64
|
-
"pcm":
|
|
65
|
-
"pdf":
|
|
66
|
-
"png":
|
|
67
|
-
"ppt":
|
|
68
|
-
"pptx":
|
|
69
|
-
"qt":
|
|
70
|
-
"rar":
|
|
71
|
-
"swf":
|
|
72
|
-
"tar":
|
|
73
|
-
"tar.gz":
|
|
74
|
-
"tgz":
|
|
75
|
-
"txt":
|
|
76
|
-
"vsd":
|
|
77
|
-
"vsdx":
|
|
78
|
-
"wav":
|
|
79
|
-
"webm":
|
|
80
|
-
"wma":
|
|
81
|
-
"wmv":
|
|
82
|
-
"xls":
|
|
83
|
-
"xlsx":
|
|
84
|
-
"zip":
|
|
85
|
-
"zipx":
|
|
86
|
-
"7z":
|
|
17
|
+
"aac": _Icons.AudioIcon,
|
|
18
|
+
"aiff": _Icons.AudioIcon,
|
|
19
|
+
"alac": _Icons.AudioIcon,
|
|
20
|
+
"avchd": _Icons.VideoIcon,
|
|
21
|
+
"avi": _Icons.VideoIcon,
|
|
22
|
+
"bmp": _Icons.ImageIcon,
|
|
23
|
+
"doc": _Icons.WordIcon,
|
|
24
|
+
"docx": _Icons.WordIcon,
|
|
25
|
+
"flac": _Icons.AudioIcon,
|
|
26
|
+
"flv": _Icons.VideoIcon,
|
|
27
|
+
"gif": _Icons.ImageIcon,
|
|
28
|
+
"jiff": _Icons.ImageIcon,
|
|
29
|
+
"jpeg": _Icons.ImageIcon,
|
|
30
|
+
"jpg": _Icons.ImageIcon,
|
|
31
|
+
"mpe": _Icons.VideoIcon,
|
|
32
|
+
"mpeg": _Icons.VideoIcon,
|
|
33
|
+
"mpg": _Icons.VideoIcon,
|
|
34
|
+
"mpv": _Icons.VideoIcon,
|
|
35
|
+
"mp2": _Icons.AudioIcon,
|
|
36
|
+
"mp3": _Icons.AudioIcon,
|
|
37
|
+
"mp4": _Icons.VideoIcon,
|
|
38
|
+
"m4p": _Icons.VideoIcon,
|
|
39
|
+
"m4v": _Icons.VideoIcon,
|
|
40
|
+
"mov": _Icons.VideoIcon,
|
|
41
|
+
"one": _Icons.OneNoteIcon,
|
|
42
|
+
"pcm": _Icons.AudioIcon,
|
|
43
|
+
"pdf": _Icons.PDFIcon,
|
|
44
|
+
"png": _Icons.ImageIcon,
|
|
45
|
+
"ppt": _Icons.PowerpointIcon,
|
|
46
|
+
"pptx": _Icons.PowerpointIcon,
|
|
47
|
+
"qt": _Icons.VideoIcon,
|
|
48
|
+
"rar": _Icons.ArchiveIcon,
|
|
49
|
+
"swf": _Icons.VideoIcon,
|
|
50
|
+
"tar": _Icons.ArchiveIcon,
|
|
51
|
+
"tar.gz": _Icons.ArchiveIcon,
|
|
52
|
+
"tgz": _Icons.ArchiveIcon,
|
|
53
|
+
"txt": _Icons.BlankIcon,
|
|
54
|
+
"vsd": _Icons.VisioIcon,
|
|
55
|
+
"vsdx": _Icons.VisioIcon,
|
|
56
|
+
"wav": _Icons.AudioIcon,
|
|
57
|
+
"webm": _Icons.VideoIcon,
|
|
58
|
+
"wma": _Icons.AudioIcon,
|
|
59
|
+
"wmv": _Icons.VideoIcon,
|
|
60
|
+
"xls": _Icons.ExcelIcon,
|
|
61
|
+
"xlsx": _Icons.ExcelIcon,
|
|
62
|
+
"zip": _Icons.ArchiveIcon,
|
|
63
|
+
"zipx": _Icons.ArchiveIcon,
|
|
64
|
+
"7z": _Icons.ArchiveIcon
|
|
87
65
|
};
|
|
88
66
|
/**
|
|
89
67
|
* Get file attachment icon image depending on extension.
|
|
@@ -94,7 +72,7 @@ const FileAttachmentIconMap = {
|
|
|
94
72
|
const getFileAttachmentIconData = extension => {
|
|
95
73
|
const key = extension.startsWith(".") ? extension.slice(1) : extension || "";
|
|
96
74
|
|
|
97
|
-
const icon = FileAttachmentIconMap[key.toLowerCase()] ||
|
|
75
|
+
const icon = FileAttachmentIconMap[key.toLowerCase()] || _Icons.BlankIcon;
|
|
98
76
|
|
|
99
77
|
return icon;
|
|
100
78
|
}; // Check if browser supports inline media playing for current media format
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.createActivityMiddleware = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _TelemetryConstants = require("../../../../../common/telemetry/TelemetryConstants");
|
|
9
9
|
|
|
10
10
|
var _Constants = require("../../../../../common/Constants");
|
|
11
11
|
|
|
@@ -15,16 +15,16 @@ var _DirectLineSenderRole = require("../../enums/DirectLineSenderRole");
|
|
|
15
15
|
|
|
16
16
|
var _MessageType = require("../../enums/MessageType");
|
|
17
17
|
|
|
18
|
+
var _react = _interopRequireDefault(require("react"));
|
|
19
|
+
|
|
20
|
+
var _TelemetryHelper = require("../../../../../common/telemetry/TelemetryHelper");
|
|
21
|
+
|
|
18
22
|
var _defaultSystemMessageStyles = require("./defaultStyles/defaultSystemMessageStyles");
|
|
19
23
|
|
|
20
24
|
var _defaultUserMessageStyles = require("./defaultStyles/defaultUserMessageStyles");
|
|
21
25
|
|
|
22
26
|
var _utils = require("../../../../../common/utils");
|
|
23
27
|
|
|
24
|
-
var _TelemetryHelper = require("../../../../../common/telemetry/TelemetryHelper");
|
|
25
|
-
|
|
26
|
-
var _TelemetryConstants = require("../../../../../common/telemetry/TelemetryConstants");
|
|
27
|
-
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
29
|
|
|
30
30
|
/******
|
|
@@ -34,49 +34,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
34
34
|
* 1. Renders system messages differently, according to Microsoft LiveChatWidget styles
|
|
35
35
|
* 2. Changes the font size of user messages
|
|
36
36
|
* 3. Decodes certain html characters that came through from chat services
|
|
37
|
-
* 4. Triggers end conversation sequence when the chat thread is deleted
|
|
38
37
|
******/
|
|
39
38
|
const loggedSystemMessages = new Array(); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
39
|
|
|
41
|
-
const handleThreadUpdate = channelData => {
|
|
42
|
-
var _channelData$properti, _channelData$properti2;
|
|
43
|
-
|
|
44
|
-
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
45
|
-
Event: _TelemetryConstants.TelemetryEvent.IC3ThreadUpdateEventReceived,
|
|
46
|
-
Description: "IC3 ThreadUpdateEvent Received"
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
const postConversationEndedAction = () => {
|
|
50
|
-
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
51
|
-
Event: _TelemetryConstants.TelemetryEvent.ConversationEndedThreadEventReceived,
|
|
52
|
-
Description: "Conversation is ended by agent side or by timeout."
|
|
53
|
-
});
|
|
54
|
-
}; // If the Thread is deleted, then display post conversation survey if enabled.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const isThreadDeleted = (channelData === null || channelData === void 0 ? void 0 : (_channelData$properti = channelData.properties) === null || _channelData$properti === void 0 ? void 0 : (_channelData$properti2 = _channelData$properti.isdeleted) === null || _channelData$properti2 === void 0 ? void 0 : _channelData$properti2.toLowerCase()) === _Constants.Constants.true;
|
|
58
|
-
|
|
59
|
-
if (isThreadDeleted) {
|
|
60
|
-
postConversationEndedAction();
|
|
61
|
-
return;
|
|
62
|
-
} //check if customer is still in the thread
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (channelData.members && channelData.members.length > 0) {
|
|
66
|
-
for (let i = 0; i < channelData.members.length; i++) {
|
|
67
|
-
const id = channelData.members[i].id;
|
|
68
|
-
const tag = channelData.members[i].tag; // In case of ACS customer is not removed from thread and has "left" tag
|
|
69
|
-
|
|
70
|
-
if (id.startsWith(_Constants.Constants.visitorIdPrefix) && tag !== _Constants.Constants.left) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
postConversationEndedAction();
|
|
77
|
-
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
78
|
-
|
|
79
|
-
|
|
80
40
|
const handleSystemMessage = (next, args, card, systemMessageStyleProps) => {
|
|
81
41
|
var _card$activity, _card$activity$channe, _card$activity$channe2, _card$activity2, _card$activity2$chann, _card$activity3, _card$activity3$chann, _card$activity3$chann2, _card$activity4, _card$activity4$chann, _card$activity5, _card$activity5$chann, _card$nextVisibleActi, _card$nextVisibleActi2, _card$activity6, _card$activity6$chann, _card$activity7, _card$nextVisibleActi3, _card$activity8;
|
|
82
42
|
|
|
@@ -129,7 +89,10 @@ const createActivityMiddleware = (systemMessageStyleProps, userMessageStyleProps
|
|
|
129
89
|
var _card$activity$channe3;
|
|
130
90
|
|
|
131
91
|
if (((_card$activity$channe3 = card.activity.channelData) === null || _card$activity$channe3 === void 0 ? void 0 : _card$activity$channe3.type) === _MessageType.MessageTypes.Thread) {
|
|
132
|
-
|
|
92
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
93
|
+
Event: _TelemetryConstants.TelemetryEvent.IC3ThreadUpdateEventReceived,
|
|
94
|
+
Description: "IC3 ThreadUpdateEvent Received"
|
|
95
|
+
});
|
|
133
96
|
}
|
|
134
97
|
|
|
135
98
|
return () => false;
|
|
@@ -11,6 +11,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _FileAttachmentIconManager = require("../../../common/utils/FileAttachmentIconManager");
|
|
13
13
|
|
|
14
|
+
var _TelemetryConstants = require("../../../../../common/telemetry/TelemetryConstants");
|
|
15
|
+
|
|
14
16
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
15
17
|
|
|
16
18
|
var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
@@ -211,7 +213,7 @@ const createAttachmentMiddleware = enableInlinePlaying => {
|
|
|
211
213
|
const errorData = "Unable to parse the adaptive card format";
|
|
212
214
|
|
|
213
215
|
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
214
|
-
eventName:
|
|
216
|
+
eventName: _TelemetryConstants.BroadcastEvent.InvalidAdaptiveCardFormat,
|
|
215
217
|
payload: {
|
|
216
218
|
Message: errorData,
|
|
217
219
|
ExceptionDetails: e
|
|
@@ -28,22 +28,22 @@ const createConversationEndMiddleware = conversationEndCallback => _ref => {
|
|
|
28
28
|
var _action$payload;
|
|
29
29
|
|
|
30
30
|
if ((action === null || action === void 0 ? void 0 : action.type) == _WebChatActionType.WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY && (_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.activity) {
|
|
31
|
-
var _activity$from, _activity$from2, _activity$
|
|
31
|
+
var _activity$from, _activity$from2, _activity$channelData7, _activity$channelData8;
|
|
32
32
|
|
|
33
33
|
const activity = action.payload.activity;
|
|
34
34
|
|
|
35
35
|
if (((_activity$from = activity.from) === null || _activity$from === void 0 ? void 0 : _activity$from.role) === _DirectLineSenderRole.DirectLineSenderRole.Bot && activity.channelId === "ACS_CHANNEL") {
|
|
36
|
-
var _activity$channelData, _activity$channelData2, _activity$channelData3, _activity$channelData4;
|
|
36
|
+
var _activity$channelData, _activity$channelData2, _activity$channelData3, _activity$channelData4, _activity$channelData5, _activity$channelData6;
|
|
37
37
|
|
|
38
38
|
// ACS
|
|
39
|
-
if ((_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$channelData2 = _activity$channelData.tags) !== null && _activity$channelData2 !== void 0 && _activity$channelData2.includes(_Constants.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.Constants.agentEndConversationMessageTag)) {
|
|
39
|
+
if ((_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$channelData2 = _activity$channelData.tags) !== null && _activity$channelData2 !== void 0 && _activity$channelData2.includes(_Constants.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.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.Constants.supervisorForceCloseMessageTag))) {
|
|
40
40
|
conversationEndCallback();
|
|
41
41
|
}
|
|
42
|
-
} else if (((_activity$from2 = activity.from) === null || _activity$from2 === void 0 ? void 0 : _activity$from2.role) === _DirectLineSenderRole.DirectLineSenderRole.Channel && ((_activity$
|
|
43
|
-
var _activity$
|
|
42
|
+
} else if (((_activity$from2 = activity.from) === null || _activity$from2 === void 0 ? void 0 : _activity$from2.role) === _DirectLineSenderRole.DirectLineSenderRole.Channel && ((_activity$channelData7 = activity.channelData) === null || _activity$channelData7 === void 0 ? void 0 : _activity$channelData7.type) === _MessageType.MessageTypes.Thread && (_activity$channelData8 = activity.channelData) !== null && _activity$channelData8 !== void 0 && _activity$channelData8.properties) {
|
|
43
|
+
var _activity$channelData9, _activity$channelData10, _activity$channelData11, _activity$channelData12;
|
|
44
44
|
|
|
45
45
|
// IC3
|
|
46
|
-
if (((_activity$
|
|
46
|
+
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.Constants.truePascal || !((_activity$channelData11 = activity.channelData) !== null && _activity$channelData11 !== void 0 && (_activity$channelData12 = _activity$channelData11.properties) !== null && _activity$channelData12 !== void 0 && _activity$channelData12.containsExternalEntitiesListeningAll)) {
|
|
47
47
|
conversationEndCallback();
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createWebChatTelemetry = createWebChatTelemetry;
|
|
7
|
+
|
|
8
|
+
var _TelemetryConstants = require("../../../../common/telemetry/TelemetryConstants");
|
|
9
|
+
|
|
10
|
+
var _TelemetryHelper = require("../../../../common/telemetry/TelemetryHelper");
|
|
11
|
+
|
|
12
|
+
function createWebChatTelemetry() {
|
|
13
|
+
const handleTelemetry = event => {
|
|
14
|
+
const {
|
|
15
|
+
level
|
|
16
|
+
} = event;
|
|
17
|
+
const loglevel = level ? level.toUpperCase() : "";
|
|
18
|
+
|
|
19
|
+
switch (loglevel) {
|
|
20
|
+
case _TelemetryConstants.LogLevel.DEBUG:
|
|
21
|
+
_TelemetryHelper.TelemetryHelper.logWebChatEvent(_TelemetryConstants.LogLevel.DEBUG, event);
|
|
22
|
+
|
|
23
|
+
break;
|
|
24
|
+
|
|
25
|
+
case _TelemetryConstants.LogLevel.WARN:
|
|
26
|
+
_TelemetryHelper.TelemetryHelper.logWebChatEvent(_TelemetryConstants.LogLevel.WARN, event);
|
|
27
|
+
|
|
28
|
+
break;
|
|
29
|
+
|
|
30
|
+
case _TelemetryConstants.LogLevel.ERROR:
|
|
31
|
+
_TelemetryHelper.TelemetryHelper.logWebChatEvent(_TelemetryConstants.LogLevel.ERROR, event);
|
|
32
|
+
|
|
33
|
+
break;
|
|
34
|
+
|
|
35
|
+
case _TelemetryConstants.LogLevel.INFO:
|
|
36
|
+
default:
|
|
37
|
+
_TelemetryHelper.TelemetryHelper.logWebChatEvent(_TelemetryConstants.LogLevel.INFO, event);
|
|
38
|
+
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return handleTelemetry;
|
|
44
|
+
}
|
|
@@ -14,6 +14,7 @@ exports.ConversationState = ConversationState;
|
|
|
14
14
|
ConversationState[ConversationState["OutOfOffice"] = 3] = "OutOfOffice";
|
|
15
15
|
ConversationState[ConversationState["ProactiveChat"] = 4] = "ProactiveChat";
|
|
16
16
|
ConversationState[ConversationState["Active"] = 5] = "Active";
|
|
17
|
-
ConversationState[ConversationState["
|
|
18
|
-
ConversationState[ConversationState["
|
|
17
|
+
ConversationState[ConversationState["InActive"] = 6] = "InActive";
|
|
18
|
+
ConversationState[ConversationState["Postchat"] = 7] = "Postchat";
|
|
19
|
+
ConversationState[ConversationState["Closed"] = 8] = "Closed";
|
|
19
20
|
})(ConversationState || (exports.ConversationState = ConversationState = {}));
|
|
@@ -23,17 +23,19 @@ exports.LiveChatWidgetActionType = LiveChatWidgetActionType;
|
|
|
23
23
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 12] = "SET_AUDIO_NOTIFICATION";
|
|
24
24
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 13] = "SET_E2VV_ENABLED";
|
|
25
25
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 14] = "SET_POST_CHAT_CONTEXT";
|
|
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["
|
|
35
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
36
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
37
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
38
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
26
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 15] = "SHOW_CALLING_CONTAINER";
|
|
27
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 16] = "SET_INCOMING_CALL";
|
|
28
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 17] = "DISABLE_VIDEO_CALL";
|
|
29
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 18] = "DISABLE_LOCAL_VIDEO";
|
|
30
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 19] = "DISABLE_REMOTE_VIDEO";
|
|
31
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 20] = "SET_CHAT_TOKEN";
|
|
32
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SKIP_CHAT_BUTTON_RENDERING"] = 21] = "SET_SKIP_CHAT_BUTTON_RENDERING";
|
|
33
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 22] = "SET_PROACTIVE_CHAT_PARAMS";
|
|
34
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 23] = "SET_TELEMETRY_DATA";
|
|
35
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 24] = "SET_RECONNECT_ID";
|
|
36
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 25] = "SET_UNREAD_MESSAGE_COUNT";
|
|
37
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 26] = "SET_FOCUS_CHAT_BUTTON";
|
|
38
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT"] = 27] = "SET_CONVERSATION_ENDED_BY_AGENT";
|
|
39
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 28] = "SET_WIDGET_STATE";
|
|
40
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 29] = "SET_LIVE_CHAT_CONTEXT";
|
|
39
41
|
})(LiveChatWidgetActionType || (exports.LiveChatWidgetActionType = LiveChatWidgetActionType = {}));
|
|
@@ -12,6 +12,10 @@ var _defaultMiddlewareLocalizedTexts = require("../../components/webchatcontaine
|
|
|
12
12
|
const getLiveChatWidgetContextInitialState = props => {
|
|
13
13
|
var _props$webChatContain;
|
|
14
14
|
|
|
15
|
+
if (props !== null && props !== void 0 && props.liveChatContextFromCache) {
|
|
16
|
+
return props === null || props === void 0 ? void 0 : props.liveChatContextFromCache;
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
const LiveChatWidgetContextInitialState = {
|
|
16
20
|
domainStates: {
|
|
17
21
|
liveChatConfig: props.chatConfig,
|
|
@@ -22,7 +26,8 @@ const getLiveChatWidgetContextInitialState = props => {
|
|
|
22
26
|
chatToken: undefined,
|
|
23
27
|
postChatContext: undefined,
|
|
24
28
|
telemetryInternalData: {},
|
|
25
|
-
globalDir: "ltr"
|
|
29
|
+
globalDir: "ltr",
|
|
30
|
+
liveChatContext: undefined
|
|
26
31
|
},
|
|
27
32
|
appStates: {
|
|
28
33
|
conversationState: _ConversationState.ConversationState.Closed,
|
|
@@ -41,7 +46,8 @@ const getLiveChatWidgetContextInitialState = props => {
|
|
|
41
46
|
proactiveChatInNewWindow: false
|
|
42
47
|
},
|
|
43
48
|
e2vvEnabled: false,
|
|
44
|
-
unreadMessageCount: 0
|
|
49
|
+
unreadMessageCount: 0,
|
|
50
|
+
conversationEndedByAgent: false
|
|
45
51
|
},
|
|
46
52
|
uiStates: {
|
|
47
53
|
showConfirmationPane: false,
|
|
@@ -54,7 +60,7 @@ const getLiveChatWidgetContextInitialState = props => {
|
|
|
54
60
|
focusChatButton: false
|
|
55
61
|
}
|
|
56
62
|
};
|
|
57
|
-
return
|
|
63
|
+
return LiveChatWidgetContextInitialState;
|
|
58
64
|
};
|
|
59
65
|
|
|
60
66
|
exports.getLiveChatWidgetContextInitialState = getLiveChatWidgetContextInitialState;
|
|
@@ -7,8 +7,6 @@ exports.createReducer = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _LiveChatWidgetActionType = require("./common/LiveChatWidgetActionType");
|
|
9
9
|
|
|
10
|
-
var _TelemetryManager = require("../common/telemetry/TelemetryManager");
|
|
11
|
-
|
|
12
10
|
/* eslint-disable indent */
|
|
13
11
|
const createReducer = () => {
|
|
14
12
|
const reducer = (state, action) => {
|
|
@@ -93,13 +91,6 @@ const createReducer = () => {
|
|
|
93
91
|
}
|
|
94
92
|
};
|
|
95
93
|
|
|
96
|
-
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SHOULD_SHOW_POST_CHAT:
|
|
97
|
-
return { ...state,
|
|
98
|
-
appStates: { ...state.appStates,
|
|
99
|
-
shouldShowPostChat: action.payload
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
|
|
103
94
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SHOW_CALLING_CONTAINER:
|
|
104
95
|
return { ...state,
|
|
105
96
|
uiStates: { ...state.uiStates,
|
|
@@ -145,6 +136,7 @@ const createReducer = () => {
|
|
|
145
136
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CHAT_TOKEN:
|
|
146
137
|
return { ...state,
|
|
147
138
|
domainStates: { ...state.domainStates,
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
148
140
|
chatToken: action.payload
|
|
149
141
|
}
|
|
150
142
|
};
|
|
@@ -196,7 +188,6 @@ const createReducer = () => {
|
|
|
196
188
|
};
|
|
197
189
|
|
|
198
190
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_TELEMETRY_DATA:
|
|
199
|
-
_TelemetryManager.TelemetryManager.InternalTelemetryData = action.payload;
|
|
200
191
|
return { ...state,
|
|
201
192
|
domainStates: { ...state.domainStates,
|
|
202
193
|
telemetryInternalData: action.payload
|
|
@@ -217,6 +208,25 @@ const createReducer = () => {
|
|
|
217
208
|
}
|
|
218
209
|
};
|
|
219
210
|
|
|
211
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT:
|
|
212
|
+
return { ...state,
|
|
213
|
+
domainStates: { ...state.domainStates,
|
|
214
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
215
|
+
liveChatContext: action.payload
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_WIDGET_STATE:
|
|
220
|
+
return { ...action.payload
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY_AGENT:
|
|
224
|
+
return { ...state,
|
|
225
|
+
appStates: { ...state.appStates,
|
|
226
|
+
conversationEndedByAgent: action.payload
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
|
|
220
230
|
default:
|
|
221
231
|
return state;
|
|
222
232
|
}
|
|
@@ -26,7 +26,7 @@ const shouldShowHeader = state => {
|
|
|
26
26
|
exports.shouldShowHeader = shouldShowHeader;
|
|
27
27
|
|
|
28
28
|
const shouldShowFooter = state => {
|
|
29
|
-
return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.Active;
|
|
29
|
+
return !state.appStates.isMinimized && (state.appStates.conversationState === _ConversationState.ConversationState.Active || state.appStates.conversationState === _ConversationState.ConversationState.InActive);
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
exports.shouldShowFooter = shouldShowFooter;
|
|
@@ -38,7 +38,7 @@ const shouldShowEmailTranscriptPane = state => {
|
|
|
38
38
|
exports.shouldShowEmailTranscriptPane = shouldShowEmailTranscriptPane;
|
|
39
39
|
|
|
40
40
|
const shouldShowWebChatContainer = state => {
|
|
41
|
-
return state.appStates.conversationState === _ConversationState.ConversationState.Active;
|
|
41
|
+
return state.appStates.conversationState === _ConversationState.ConversationState.Active || state.appStates.conversationState === _ConversationState.ConversationState.InActive;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
exports.shouldShowWebChatContainer = shouldShowWebChatContainer;
|