@microsoft/omnichannel-chat-widget 0.1.0-main.cf54410 → 0.1.0-main.d5846c0
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 -6
- package/lib/cjs/common/telemetry/TelemetryConstants.js +48 -4
- package/lib/cjs/common/telemetry/TelemetryHelper.js +13 -0
- package/lib/cjs/common/telemetry/TelemetryManager.js +17 -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 +33 -13
- package/lib/cjs/common/telemetry/loggers/consoleLogger.js +6 -5
- package/lib/cjs/common/utils.js +30 -2
- package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +14 -0
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +8 -2
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -41
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -2
- package/lib/cjs/components/footerstateful/FooterStateful.js +4 -5
- package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +1 -1
- 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 -21
- package/lib/cjs/components/livechatwidget/common/endChat.js +116 -57
- package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +5 -0
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +32 -7
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +105 -20
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +6 -17
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +6 -5
- package/lib/cjs/components/livechatwidget/common/startChat.js +101 -49
- package/lib/cjs/components/livechatwidget/common/startProactiveChat.js +3 -3
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +132 -30
- 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 +9 -10
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +26 -4
- package/lib/cjs/{assets/assets.d.js → components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.js} +0 -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 +45 -0
- package/lib/cjs/contexts/common/ConversationState.js +3 -2
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +7 -7
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +7 -2
- package/lib/cjs/contexts/createReducer.js +8 -10
- package/lib/cjs/controller/componentController.js +2 -2
- package/lib/cjs/plugins/newMessageEventHandler.js +99 -0
- package/lib/esm/assets/Audios.js +1 -0
- package/lib/esm/assets/Icons.js +11 -0
- package/lib/esm/common/Constants.js +34 -5
- package/lib/esm/common/telemetry/TelemetryConstants.js +44 -3
- package/lib/esm/common/telemetry/TelemetryHelper.js +13 -1
- package/lib/esm/common/telemetry/TelemetryManager.js +15 -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 +36 -14
- package/lib/esm/common/telemetry/loggers/consoleLogger.js +6 -5
- package/lib/esm/common/utils.js +19 -1
- package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +14 -0
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +9 -3
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -37
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -2
- package/lib/esm/components/footerstateful/FooterStateful.js +4 -5
- package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +1 -1
- 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 -22
- package/lib/esm/components/livechatwidget/common/endChat.js +110 -54
- package/lib/esm/components/livechatwidget/common/initCallingSdk.js +3 -0
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +29 -8
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +94 -20
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +5 -14
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +6 -5
- package/lib/esm/components/livechatwidget/common/startChat.js +99 -50
- package/lib/esm/components/livechatwidget/common/startProactiveChat.js +5 -5
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +121 -30
- 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 +9 -10
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +25 -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 +32 -0
- package/lib/esm/contexts/common/ConversationState.js +3 -2
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +7 -7
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +7 -2
- package/lib/esm/contexts/createReducer.js +8 -9
- package/lib/esm/controller/componentController.js +2 -2
- package/lib/esm/plugins/newMessageEventHandler.js +82 -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 -2
- package/lib/types/common/interfaces/IContextDataStore.d.ts +1 -1
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +32 -1
- package/lib/types/common/telemetry/TelemetryHelper.d.ts +2 -0
- package/lib/types/common/telemetry/definitions/Payload.d.ts +12 -9
- package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +3 -3
- package/lib/types/common/utils.d.ts +3 -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/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 +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 +1 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +7 -7
- package/lib/types/plugins/newMessageEventHandler.d.ts +2 -0
- package/package.json +9 -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,10 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.OutOfOfficeHoursPaneStateful = void 0;
|
|
7
7
|
|
|
8
|
+
var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
11
|
|
|
10
12
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
11
13
|
|
|
14
|
+
var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
15
|
+
|
|
12
16
|
var _defaultgeneralOOOHPaneStyleProps = require("./common/defaultStyleProps/defaultgeneralOOOHPaneStyleProps");
|
|
13
17
|
|
|
14
18
|
var _utils = require("../../common/utils");
|
|
@@ -41,6 +45,10 @@ const OutOfOfficeHoursPaneStateful = props => {
|
|
|
41
45
|
if (firstElement && firstElement[0]) {
|
|
42
46
|
firstElement[0].focus();
|
|
43
47
|
}
|
|
48
|
+
|
|
49
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
50
|
+
Event: _TelemetryConstants.TelemetryEvent.OutOfOfficePaneLoaded
|
|
51
|
+
});
|
|
44
52
|
}, []);
|
|
45
53
|
return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.OutOfOfficeHoursPane, {
|
|
46
54
|
componentOverrides: props.componentOverrides,
|
|
@@ -15,6 +15,10 @@ var _utils = require("../../common/utils");
|
|
|
15
15
|
|
|
16
16
|
var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
|
|
17
17
|
|
|
18
|
+
var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
19
|
+
|
|
20
|
+
var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
|
|
21
|
+
|
|
18
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
23
|
|
|
20
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -46,6 +50,10 @@ const PostChatLoadingPaneStateful = props => {
|
|
|
46
50
|
if (firstElement && firstElement[0]) {
|
|
47
51
|
firstElement[0].focus();
|
|
48
52
|
}
|
|
53
|
+
|
|
54
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
55
|
+
Event: _TelemetryConstants.TelemetryEvent.PostChatSurveyLoadingPaneLoaded
|
|
56
|
+
});
|
|
49
57
|
}, []);
|
|
50
58
|
return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.LoadingPane, {
|
|
51
59
|
componentOverrides: props.componentOverrides,
|
|
@@ -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");
|
|
@@ -27,8 +29,6 @@ var _defaultPreChatSurveyLocalizedTexts = require("./common/defaultProps/default
|
|
|
27
29
|
|
|
28
30
|
var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
|
|
29
31
|
|
|
30
|
-
var _DataStoreManager = require("../../common/contextDataStore/DataStoreManager");
|
|
31
|
-
|
|
32
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
33
|
|
|
34
34
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -65,7 +65,7 @@ const PreChatSurveyPaneStateful = props => {
|
|
|
65
65
|
try {
|
|
66
66
|
return (0, _utils.parseAdaptiveCardPayload)(payload, requiredFieldMissingMessage);
|
|
67
67
|
} catch (ex) {
|
|
68
|
-
_TelemetryHelper.TelemetryHelper.
|
|
68
|
+
_TelemetryHelper.TelemetryHelper.logConfigDataEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
69
69
|
Event: _TelemetryConstants.TelemetryEvent.ParseAdaptiveCardFailed,
|
|
70
70
|
Description: "Adaptive Card JSON Parse Failed.",
|
|
71
71
|
ExceptionDetails: {
|
|
@@ -93,9 +93,10 @@ const PreChatSurveyPaneStateful = props => {
|
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
try {
|
|
96
|
-
var _DataStoreManager$cli, _persistedState$domai;
|
|
96
|
+
var _state$domainStates, _state$domainStates$t, _state$domainStates$t2, _DataStoreManager$cli, _persistedState$domai;
|
|
97
97
|
|
|
98
|
-
const
|
|
98
|
+
const widgetStateCacheId = (0, _utils.getWidgetCacheId)(((_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : (_state$domainStates$t = _state$domainStates.telemetryInternalData) === null || _state$domainStates$t === void 0 ? void 0 : _state$domainStates$t.orgId) ?? "", ((_state$domainStates$t2 = state.domainStates.telemetryInternalData) === null || _state$domainStates$t2 === void 0 ? void 0 : _state$domainStates$t2.widgetId) ?? "");
|
|
99
|
+
const widgetStateFromCache = (_DataStoreManager$cli = _DataStoreManager.DataStoreManager.clientDataStore) === null || _DataStoreManager$cli === void 0 ? void 0 : _DataStoreManager$cli.getData(widgetStateCacheId, "localStorage");
|
|
99
100
|
const persistedState = widgetStateFromCache ? JSON.parse(widgetStateFromCache) : undefined;
|
|
100
101
|
let optionalParams = {};
|
|
101
102
|
|
|
@@ -109,9 +110,7 @@ const PreChatSurveyPaneStateful = props => {
|
|
|
109
110
|
} else {
|
|
110
111
|
const prechatResponseValues = (0, _utils.extractPreChatSurveyResponseValues)(state.domainStates.preChatSurveyResponse, values);
|
|
111
112
|
optionalParams = {
|
|
112
|
-
|
|
113
|
-
preChatResponse: prechatResponseValues
|
|
114
|
-
}
|
|
113
|
+
preChatResponse: prechatResponseValues
|
|
115
114
|
};
|
|
116
115
|
setPreChatResponseEmail(values);
|
|
117
116
|
await initStartChat(optionalParams);
|
|
@@ -46,12 +46,20 @@ const ProactiveChatPaneStateful = props => {
|
|
|
46
46
|
const handleProactiveChatInviteTimeout = () => {
|
|
47
47
|
if (!timeoutRemoved) {
|
|
48
48
|
setTimeoutRemoved(true);
|
|
49
|
+
dispatch({
|
|
50
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_PROACTIVE_CHAT_PARAMS,
|
|
51
|
+
payload: {
|
|
52
|
+
proactiveChatBodyTitle: "",
|
|
53
|
+
proactiveChatEnablePrechat: false,
|
|
54
|
+
proactiveChatInNewWindow: false
|
|
55
|
+
}
|
|
56
|
+
});
|
|
49
57
|
dispatch({
|
|
50
58
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
51
59
|
payload: _ConversationState.ConversationState.Closed
|
|
52
60
|
});
|
|
53
61
|
|
|
54
|
-
_TelemetryHelper.TelemetryHelper.
|
|
62
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
55
63
|
Event: _TelemetryConstants.TelemetryEvent.ProactiveChatRejected,
|
|
56
64
|
ElapsedTimeInMilliseconds: _TelemetryManager.TelemetryTimers.LcwLoadToChatButtonTimer.milliSecondsElapsed,
|
|
57
65
|
Description: "Proactive chat invitation timed out."
|
|
@@ -75,14 +83,14 @@ const ProactiveChatPaneStateful = props => {
|
|
|
75
83
|
if (state.appStates.proactiveChatStates.proactiveChatInNewWindow) {
|
|
76
84
|
// TODO: BroadcastService: replace with the sdk broadcast service, when in place
|
|
77
85
|
const startPopoutChatEvent = {
|
|
78
|
-
eventName:
|
|
86
|
+
eventName: _TelemetryConstants.BroadcastEvent.ProactiveChatStartPopoutChat
|
|
79
87
|
};
|
|
80
88
|
|
|
81
89
|
_omnichannelChatComponents.BroadcastService.postMessage(startPopoutChatEvent);
|
|
82
90
|
|
|
83
91
|
dispatch({
|
|
84
|
-
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.
|
|
85
|
-
payload:
|
|
92
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
93
|
+
payload: _ConversationState.ConversationState.Closed
|
|
86
94
|
});
|
|
87
95
|
} 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
96
|
dispatch({
|
|
@@ -94,6 +102,12 @@ const ProactiveChatPaneStateful = props => {
|
|
|
94
102
|
payload: _ConversationState.ConversationState.OutOfOffice
|
|
95
103
|
});
|
|
96
104
|
} else {
|
|
105
|
+
const proactiveChatStarted = {
|
|
106
|
+
eventName: _TelemetryConstants.BroadcastEvent.ProactiveChatStartChat
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
_omnichannelChatComponents.BroadcastService.postMessage(proactiveChatStarted);
|
|
110
|
+
|
|
97
111
|
await startChat();
|
|
98
112
|
}
|
|
99
113
|
},
|
|
@@ -105,6 +119,14 @@ const ProactiveChatPaneStateful = props => {
|
|
|
105
119
|
Description: "Proactive chat closed."
|
|
106
120
|
});
|
|
107
121
|
|
|
122
|
+
dispatch({
|
|
123
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_PROACTIVE_CHAT_PARAMS,
|
|
124
|
+
payload: {
|
|
125
|
+
proactiveChatBodyTitle: "",
|
|
126
|
+
proactiveChatEnablePrechat: false,
|
|
127
|
+
proactiveChatInNewWindow: false
|
|
128
|
+
}
|
|
129
|
+
});
|
|
108
130
|
dispatch({
|
|
109
131
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
110
132
|
payload: _ConversationState.ConversationState.Closed
|
|
File without changes
|
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,45 @@
|
|
|
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
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
|
+
const handleTelemetry = event => {
|
|
15
|
+
const {
|
|
16
|
+
level
|
|
17
|
+
} = event;
|
|
18
|
+
const loglevel = level ? level.toUpperCase() : "";
|
|
19
|
+
|
|
20
|
+
switch (loglevel) {
|
|
21
|
+
case _TelemetryConstants.LogLevel.DEBUG:
|
|
22
|
+
_TelemetryHelper.TelemetryHelper.logWebChatEvent(_TelemetryConstants.LogLevel.DEBUG, event);
|
|
23
|
+
|
|
24
|
+
break;
|
|
25
|
+
|
|
26
|
+
case _TelemetryConstants.LogLevel.WARN:
|
|
27
|
+
_TelemetryHelper.TelemetryHelper.logWebChatEvent(_TelemetryConstants.LogLevel.WARN, event);
|
|
28
|
+
|
|
29
|
+
break;
|
|
30
|
+
|
|
31
|
+
case _TelemetryConstants.LogLevel.ERROR:
|
|
32
|
+
_TelemetryHelper.TelemetryHelper.logWebChatEvent(_TelemetryConstants.LogLevel.ERROR, event);
|
|
33
|
+
|
|
34
|
+
break;
|
|
35
|
+
|
|
36
|
+
case _TelemetryConstants.LogLevel.INFO:
|
|
37
|
+
default:
|
|
38
|
+
_TelemetryHelper.TelemetryHelper.logWebChatEvent(_TelemetryConstants.LogLevel.INFO, event);
|
|
39
|
+
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return handleTelemetry;
|
|
45
|
+
}
|
|
@@ -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 = {}));
|
|
@@ -17,13 +17,13 @@ exports.LiveChatWidgetActionType = LiveChatWidgetActionType;
|
|
|
17
17
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PREVIOUS_FOCUSED_ELEMENT"] = 6] = "SET_PREVIOUS_FOCUSED_ELEMENT";
|
|
18
18
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_OUTSIDE_OPERATING_HOURS"] = 7] = "SET_OUTSIDE_OPERATING_HOURS";
|
|
19
19
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRE_CHAT_SURVEY_RESPONSE"] = 8] = "SET_PRE_CHAT_SURVEY_RESPONSE";
|
|
20
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
21
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
22
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
23
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
24
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
25
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
26
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
20
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CUSTOM_CONTEXT"] = 9] = "SET_CUSTOM_CONTEXT";
|
|
21
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_CONFIRMATION"] = 10] = "SET_SHOW_CONFIRMATION";
|
|
22
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_EMAIL_TRANSCRIPT_PANE"] = 11] = "SET_SHOW_EMAIL_TRANSCRIPT_PANE";
|
|
23
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRECHAT_RESPONSE_EMAIL"] = 12] = "SET_PRECHAT_RESPONSE_EMAIL";
|
|
24
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 13] = "SET_AUDIO_NOTIFICATION";
|
|
25
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 14] = "SET_E2VV_ENABLED";
|
|
26
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 15] = "SET_POST_CHAT_CONTEXT";
|
|
27
27
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 16] = "SHOW_CALLING_CONTAINER";
|
|
28
28
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 17] = "SET_INCOMING_CALL";
|
|
29
29
|
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 18] = "DISABLE_VIDEO_CALL";
|
|
@@ -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,
|
|
@@ -23,7 +27,8 @@ const getLiveChatWidgetContextInitialState = props => {
|
|
|
23
27
|
postChatContext: undefined,
|
|
24
28
|
telemetryInternalData: {},
|
|
25
29
|
globalDir: "ltr",
|
|
26
|
-
liveChatContext: undefined
|
|
30
|
+
liveChatContext: undefined,
|
|
31
|
+
customContext: undefined
|
|
27
32
|
},
|
|
28
33
|
appStates: {
|
|
29
34
|
conversationState: _ConversationState.ConversationState.Closed,
|
|
@@ -56,7 +61,7 @@ const getLiveChatWidgetContextInitialState = props => {
|
|
|
56
61
|
focusChatButton: false
|
|
57
62
|
}
|
|
58
63
|
};
|
|
59
|
-
return
|
|
64
|
+
return LiveChatWidgetContextInitialState;
|
|
60
65
|
};
|
|
61
66
|
|
|
62
67
|
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) => {
|
|
@@ -71,6 +69,14 @@ const createReducer = () => {
|
|
|
71
69
|
}
|
|
72
70
|
};
|
|
73
71
|
|
|
72
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CUSTOM_CONTEXT:
|
|
73
|
+
return { ...state,
|
|
74
|
+
domainStates: { ...state.domainStates,
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
|
+
customContext: action.payload
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
74
80
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_PREVIOUS_FOCUSED_ELEMENT:
|
|
75
81
|
return { ...state,
|
|
76
82
|
appStates: { ...state.appStates,
|
|
@@ -93,13 +99,6 @@ const createReducer = () => {
|
|
|
93
99
|
}
|
|
94
100
|
};
|
|
95
101
|
|
|
96
|
-
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SHOULD_SHOW_POST_CHAT:
|
|
97
|
-
return { ...state,
|
|
98
|
-
appStates: { ...state.appStates,
|
|
99
|
-
shouldShowPostChat: action.payload
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
|
|
103
102
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SHOW_CALLING_CONTAINER:
|
|
104
103
|
return { ...state,
|
|
105
104
|
uiStates: { ...state.uiStates,
|
|
@@ -197,7 +196,6 @@ const createReducer = () => {
|
|
|
197
196
|
};
|
|
198
197
|
|
|
199
198
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_TELEMETRY_DATA:
|
|
200
|
-
_TelemetryManager.TelemetryManager.InternalTelemetryData = action.payload;
|
|
201
199
|
return { ...state,
|
|
202
200
|
domainStates: { ...state.domainStates,
|
|
203
201
|
telemetryInternalData: action.payload
|