@microsoft/omnichannel-chat-widget 0.1.0-main.7a3ed6a → 0.1.0-main.84a7035
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 -3
- package/lib/cjs/common/telemetry/TelemetryHelper.js +22 -4
- package/lib/cjs/common/telemetry/TelemetryManager.js +22 -9
- package/lib/cjs/common/telemetry/defaultConfigs/defaultAriaConfig.js +3 -3
- package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
- package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +31 -1
- package/lib/cjs/common/telemetry/loggers/consoleLogger.js +3 -0
- package/lib/cjs/common/utils.js +15 -2
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +8 -1
- 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 +43 -35
- package/lib/cjs/components/livechatwidget/common/disposeTelemetryLoggers.js +14 -0
- 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 -7
- 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 +101 -32
- 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 -12
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +11 -4
- package/lib/cjs/contexts/createReducer.js +27 -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 -2
- package/lib/esm/common/telemetry/TelemetryHelper.js +22 -5
- package/lib/esm/common/telemetry/TelemetryManager.js +17 -9
- package/lib/esm/common/telemetry/defaultConfigs/defaultAriaConfig.js +3 -3
- package/lib/esm/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
- package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +32 -3
- package/lib/esm/common/telemetry/loggers/consoleLogger.js +3 -0
- package/lib/esm/common/utils.js +11 -1
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +9 -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 +41 -36
- package/lib/esm/components/livechatwidget/common/disposeTelemetryLoggers.js +4 -0
- 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 -3
- 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 +94 -33
- 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 -12
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +11 -4
- package/lib/esm/contexts/createReducer.js +27 -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 +24 -1
- package/lib/types/common/telemetry/TelemetryHelper.d.ts +1 -0
- 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/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/disposeTelemetryLoggers.d.ts +1 -0
- 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 +3 -1
- 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 +3 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +15 -12
- 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
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
3
|
+
export class DataStoreManager {}
|
|
4
|
+
|
|
5
|
+
_defineProperty(DataStoreManager, "clientDataStore", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -13,7 +13,7 @@ export let ScenarioType;
|
|
|
13
13
|
ScenarioType["ACS_ADAPTER"] = "LCW_ACSAdapterEvents";
|
|
14
14
|
})(ScenarioType || (ScenarioType = {}));
|
|
15
15
|
|
|
16
|
-
export let LogLevel;
|
|
16
|
+
export let LogLevel; // Events used in certain functionalities that are not being logged
|
|
17
17
|
|
|
18
18
|
(function (LogLevel) {
|
|
19
19
|
LogLevel["INFO"] = "INFO";
|
|
@@ -22,6 +22,24 @@ export let LogLevel;
|
|
|
22
22
|
LogLevel["ERROR"] = "ERROR";
|
|
23
23
|
})(LogLevel || (LogLevel = {}));
|
|
24
24
|
|
|
25
|
+
export let BroadcastEvent; // Events being logged
|
|
26
|
+
|
|
27
|
+
(function (BroadcastEvent) {
|
|
28
|
+
BroadcastEvent["LoadPostChatSurvey"] = "LoadPostChatSurvey";
|
|
29
|
+
BroadcastEvent["EndChat"] = "ChatEnded";
|
|
30
|
+
BroadcastEvent["NewMessageNotification"] = "NewMessageNotification";
|
|
31
|
+
BroadcastEvent["UnreadMessageCount"] = "UnreadMessageCount";
|
|
32
|
+
BroadcastEvent["ChatWidgetStateChanged"] = "ChatWidgetStateChanged";
|
|
33
|
+
BroadcastEvent["ProactiveChatStartChat"] = "ProactiveChatStartChat";
|
|
34
|
+
BroadcastEvent["ProactiveChatStartPopoutChat"] = "ProactiveChatStartPopoutChat";
|
|
35
|
+
BroadcastEvent["InvalidAdaptiveCardFormat"] = "InvalidAdaptiveCardFormat";
|
|
36
|
+
BroadcastEvent["NewMessageSent"] = "NewMessageSent";
|
|
37
|
+
BroadcastEvent["NewMessageReceived"] = "NewMessageReceived";
|
|
38
|
+
BroadcastEvent["RedirectPageRequest"] = "RedirectPageRequest";
|
|
39
|
+
BroadcastEvent["StartChatSkippingChatButtonRendering"] = "StartChatSkippingChatButtonRendering";
|
|
40
|
+
BroadcastEvent["StartUnauthenticatedReconnectChat"] = "StartUnauthenticatedReconnectChat";
|
|
41
|
+
})(BroadcastEvent || (BroadcastEvent = {}));
|
|
42
|
+
|
|
25
43
|
export let TelemetryEvent;
|
|
26
44
|
|
|
27
45
|
(function (TelemetryEvent) {
|
|
@@ -70,7 +88,9 @@ export let TelemetryEvent;
|
|
|
70
88
|
TelemetryEvent["PrechatSurveyLoaded"] = "PrechatSurveyLoaded";
|
|
71
89
|
TelemetryEvent["PrechatSubmitted"] = "PrechatSubmitted";
|
|
72
90
|
TelemetryEvent["StartChatSDKCall"] = "StartChatCall";
|
|
91
|
+
TelemetryEvent["StartChatEventRecevied"] = "StartChatEventReceived";
|
|
73
92
|
TelemetryEvent["EndChatSDKCall"] = "EndChatCall";
|
|
93
|
+
TelemetryEvent["EndChatEventReceived"] = "EndChatEventReceived";
|
|
74
94
|
TelemetryEvent["OnNewMessageFailed"] = "OnNewMessageFailed";
|
|
75
95
|
TelemetryEvent["OnNewMessageAudioNotificationFailed"] = "OnNewMessageAudioNotificationFailed";
|
|
76
96
|
TelemetryEvent["DownloadTranscriptResponseNullOrUndefined"] = "DownloadTranscriptResponseNullOrUndefined";
|
|
@@ -84,6 +104,7 @@ export let TelemetryEvent;
|
|
|
84
104
|
TelemetryEvent["LoadingPaneLoaded"] = "LoadingPaneLoaded";
|
|
85
105
|
TelemetryEvent["EmailTranscriptLoaded"] = "EmailTranscriptLoaded";
|
|
86
106
|
TelemetryEvent["OutOfOfficePaneLoaded"] = "OutOfOfficePaneLoaded";
|
|
107
|
+
TelemetryEvent["PostChatSurveyLoadingPaneLoaded"] = "PostChatSurveyLoadingPaneLoaded";
|
|
87
108
|
TelemetryEvent["PostChatSurveyLoaded"] = "PostChatSurveyLoaded";
|
|
88
109
|
TelemetryEvent["ConfirmationPaneLoaded"] = "ConfirmationPaneLoaded";
|
|
89
110
|
TelemetryEvent["ProactiveChatPaneLoaded"] = "ProactiveChatPaneLoaded";
|
|
@@ -105,7 +126,10 @@ export let TelemetryEvent;
|
|
|
105
126
|
TelemetryEvent["InvalidConfiguration"] = "InvalidConfiguration";
|
|
106
127
|
TelemetryEvent["SendTypingIndicatorSucceeded"] = "SendTypingIndicatorSucceeded";
|
|
107
128
|
TelemetryEvent["SendTypingIndicatorFailed"] = "SendTypingIndicatorFailed";
|
|
129
|
+
TelemetryEvent["WebChatEvent"] = "WebChatEvent";
|
|
108
130
|
TelemetryEvent["PreChatSurveyStartChatMethodFailed"] = "PreChatSurveyStartChatMethodFailed";
|
|
131
|
+
TelemetryEvent["ChatAlreadyTriggered"] = "ChatAlreadyTriggered";
|
|
132
|
+
TelemetryEvent["StartProactiveChatEventReceived"] = "StartProactiveChatEventReceived";
|
|
109
133
|
TelemetryEvent["StartProactiveChatMethodFailed"] = "StartProactiveChatMethodFailed";
|
|
110
134
|
TelemetryEvent["ProactiveChatAccepted"] = "ProactiveChatAccepted";
|
|
111
135
|
TelemetryEvent["ProactiveChatRejected"] = "ProactiveChatRejected";
|
|
@@ -114,12 +138,13 @@ export let TelemetryEvent;
|
|
|
114
138
|
TelemetryEvent["ReconnectChatContinueConversation"] = "ReconnectChatContinueConversation";
|
|
115
139
|
TelemetryEvent["ReconnectChatStartNewConversation"] = "ReconnectChatStartNewConversation";
|
|
116
140
|
TelemetryEvent["ReconnectChatMinimize"] = "ReconnectChatMinimize";
|
|
141
|
+
TelemetryEvent["MessageSent"] = "MessageSent";
|
|
142
|
+
TelemetryEvent["MessageReceived"] = "MessageReceived";
|
|
117
143
|
})(TelemetryEvent || (TelemetryEvent = {}));
|
|
118
144
|
|
|
119
145
|
export class TelemetryConstants {
|
|
120
146
|
static map(eventTypeOrScenarioType) {
|
|
121
147
|
switch (eventTypeOrScenarioType) {
|
|
122
|
-
case TelemetryEvent.StartChatSDKCall:
|
|
123
148
|
case TelemetryEvent.ParseAdaptiveCardFailed:
|
|
124
149
|
return ScenarioType.CONFIG_VALIDATION;
|
|
125
150
|
|
|
@@ -130,6 +155,7 @@ export class TelemetryConstants {
|
|
|
130
155
|
case TelemetryEvent.LCWChatButtonShow:
|
|
131
156
|
case TelemetryEvent.PrechatSurveyLoaded:
|
|
132
157
|
case TelemetryEvent.LoadingPaneLoaded:
|
|
158
|
+
case TelemetryEvent.PostChatSurveyLoadingPaneLoaded:
|
|
133
159
|
case TelemetryEvent.PostChatSurveyLoaded:
|
|
134
160
|
case TelemetryEvent.EmailTranscriptLoaded:
|
|
135
161
|
case TelemetryEvent.OutOfOfficePaneLoaded:
|
|
@@ -158,12 +184,17 @@ export class TelemetryConstants {
|
|
|
158
184
|
case TelemetryEvent.HeaderMinimizeButtonClicked:
|
|
159
185
|
return ScenarioType.ACTIONS;
|
|
160
186
|
|
|
187
|
+
case TelemetryEvent.StartChatSDKCall:
|
|
188
|
+
case TelemetryEvent.StartChatEventRecevied:
|
|
161
189
|
case TelemetryEvent.StartChatMethodException:
|
|
162
190
|
case TelemetryEvent.CloseChatMethodException:
|
|
191
|
+
case TelemetryEvent.StartProactiveChatEventReceived:
|
|
163
192
|
case TelemetryEvent.StartProactiveChatMethodFailed:
|
|
164
193
|
case TelemetryEvent.OnNewMessageFailed:
|
|
165
194
|
case TelemetryEvent.OnNewMessageAudioNotificationFailed:
|
|
166
195
|
case TelemetryEvent.GetConversationDetailsCallFailed:
|
|
196
|
+
case TelemetryEvent.EndChatSDKCall:
|
|
197
|
+
case TelemetryEvent.EndChatEventReceived:
|
|
167
198
|
case TelemetryEvent.EndChatSDKCallFailed:
|
|
168
199
|
case TelemetryEvent.PostChatContextCallFailed:
|
|
169
200
|
case TelemetryEvent.PostChatContextCallSucceed:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
2
|
|
|
3
|
-
import { ScenarioType } from "./TelemetryConstants";
|
|
3
|
+
import { ScenarioType, TelemetryEvent } from "./TelemetryConstants";
|
|
4
4
|
import { newGuid } from "../utils";
|
|
5
5
|
import { TelemetryManager } from "./TelemetryManager";
|
|
6
6
|
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
@@ -98,6 +98,8 @@ export class TelemetryHelper {
|
|
|
98
98
|
static conformToLoadContract(level, input) {
|
|
99
99
|
const payload = input.payload;
|
|
100
100
|
return TelemetryHelper.populate(level, payload, event => {
|
|
101
|
+
var _TelemetryManager$Int11, _TelemetryManager$Int12, _TelemetryManager$Int13;
|
|
102
|
+
|
|
101
103
|
event.Event = payload.Event;
|
|
102
104
|
event.ResourcePath = payload.ResourcePath;
|
|
103
105
|
event.WidgetState = payload.WidgetState;
|
|
@@ -105,16 +107,19 @@ export class TelemetryHelper {
|
|
|
105
107
|
event.ChatType = payload.ChatType;
|
|
106
108
|
event.ElapsedTimeInMilliseconds = payload.ElapsedTimeInMilliseconds;
|
|
107
109
|
event.ExceptionDetails = JSON.stringify(payload.ExceptionDetails);
|
|
110
|
+
event.OCChatSDKVersion = ((_TelemetryManager$Int11 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int11 === void 0 ? void 0 : _TelemetryManager$Int11.OCChatSDKVersion) ?? "";
|
|
111
|
+
event.OCChatWidgetVersion = ((_TelemetryManager$Int12 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int12 === void 0 ? void 0 : _TelemetryManager$Int12.chatWidgetVersion) ?? "";
|
|
112
|
+
event.OCChatComponentsVersion = ((_TelemetryManager$Int13 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int13 === void 0 ? void 0 : _TelemetryManager$Int13.chatComponentVersion) ?? "";
|
|
108
113
|
});
|
|
109
114
|
}
|
|
110
115
|
|
|
111
116
|
static conformToIC3ClientContract(level, input) {
|
|
112
117
|
const payload = input.payload;
|
|
113
118
|
return TelemetryHelper.populate(level, payload, event => {
|
|
114
|
-
var _TelemetryManager$
|
|
119
|
+
var _TelemetryManager$Int14;
|
|
115
120
|
|
|
116
121
|
event.Event = payload.Event;
|
|
117
|
-
event.IC3ClientVersion = (_TelemetryManager$
|
|
122
|
+
event.IC3ClientVersion = (_TelemetryManager$Int14 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int14 === void 0 ? void 0 : _TelemetryManager$Int14.IC3ClientVersion;
|
|
118
123
|
event.SubscriptionId = payload.SubscriptionId;
|
|
119
124
|
event.EndpointUrl = payload.EndpointUrl;
|
|
120
125
|
event.EndpointId = payload.EndpointId;
|
|
@@ -233,14 +238,14 @@ _defineProperty(TelemetryHelper, "logActionEvent", (logLevel, payload) => {
|
|
|
233
238
|
});
|
|
234
239
|
|
|
235
240
|
_defineProperty(TelemetryHelper, "logSDKEvent", (logLevel, payload) => {
|
|
236
|
-
var _TelemetryManager$
|
|
241
|
+
var _TelemetryManager$Int15;
|
|
237
242
|
|
|
238
243
|
const telemetryEvent = {
|
|
239
244
|
eventName: (payload === null || payload === void 0 ? void 0 : payload.Event) ?? "",
|
|
240
245
|
logLevel: logLevel,
|
|
241
246
|
payload: { ...payload,
|
|
242
247
|
TransactionId: newGuid(),
|
|
243
|
-
RequestId: (_TelemetryManager$
|
|
248
|
+
RequestId: (_TelemetryManager$Int15 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int15 === void 0 ? void 0 : _TelemetryManager$Int15.currentRequestId
|
|
244
249
|
}
|
|
245
250
|
};
|
|
246
251
|
BroadcastService.postMessage(telemetryEvent);
|
|
@@ -254,4 +259,16 @@ _defineProperty(TelemetryHelper, "logConfigDataEvent", (logLevel, payload) => {
|
|
|
254
259
|
}
|
|
255
260
|
};
|
|
256
261
|
BroadcastService.postMessage(telemetryEvent);
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
_defineProperty(TelemetryHelper, "logWebChatEvent", (logLevel, payload) => {
|
|
265
|
+
const telemetryEvent = {
|
|
266
|
+
eventName: TelemetryEvent.WebChatEvent,
|
|
267
|
+
logLevel: logLevel,
|
|
268
|
+
payload: { ...payload,
|
|
269
|
+
type: TelemetryEvent.WebChatEvent,
|
|
270
|
+
scenarioType: ScenarioType.WEBCHAT
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
BroadcastService.postMessage(telemetryEvent);
|
|
257
274
|
});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
2
|
|
|
3
|
-
import { LogLevel, ScenarioType, TelemetryConstants } from "./TelemetryConstants";
|
|
3
|
+
import { LogLevel, ScenarioType, TelemetryConstants, TelemetryEvent } from "./TelemetryConstants";
|
|
4
4
|
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
5
5
|
import { ariaTelemetryLogger } from "./loggers/ariaTelemetryLogger";
|
|
6
6
|
import { consoleLogger } from "./loggers/consoleLogger";
|
|
7
|
+
import { defaultAriaConfig } from "./defaultConfigs/defaultAriaConfig";
|
|
7
8
|
export class TelemetryTimers {}
|
|
8
9
|
|
|
9
10
|
_defineProperty(TelemetryTimers, "LcwLoadToChatButtonTimer", void 0);
|
|
@@ -16,31 +17,35 @@ export class TelemetryManager {}
|
|
|
16
17
|
|
|
17
18
|
_defineProperty(TelemetryManager, "InternalTelemetryData", void 0);
|
|
18
19
|
|
|
20
|
+
const loggers = [];
|
|
21
|
+
export const disposeLoggers = () => {
|
|
22
|
+
loggers.map(logger => {
|
|
23
|
+
logger.dispose();
|
|
24
|
+
});
|
|
25
|
+
};
|
|
19
26
|
export const RegisterLoggers = () => {
|
|
20
|
-
const loggers = [];
|
|
21
|
-
|
|
22
27
|
const registerLoggers = () => {
|
|
23
28
|
var _TelemetryManager$Int, _TelemetryManager$Int2, _TelemetryManager$Int3, _TelemetryManager$Int4, _TelemetryManager$Int5, _TelemetryManager$Int6, _TelemetryManager$Int7, _TelemetryManager$Int8;
|
|
24
29
|
|
|
25
|
-
if (
|
|
30
|
+
if (((_TelemetryManager$Int = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : (_TelemetryManager$Int2 = _TelemetryManager$Int.telemetryConfig) === null || _TelemetryManager$Int2 === void 0 ? void 0 : _TelemetryManager$Int2.disableConsoleLog) === false || ((_TelemetryManager$Int3 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int3 === void 0 ? void 0 : (_TelemetryManager$Int4 = _TelemetryManager$Int3.telemetryConfig) === null || _TelemetryManager$Int4 === void 0 ? void 0 : _TelemetryManager$Int4.telemetryDisabled) === false) {
|
|
26
31
|
BroadcastService.getAnyMessage().subscribe(event => {
|
|
27
|
-
if (event.payload) {
|
|
32
|
+
if (event.payload && event.eventName in TelemetryEvent) {
|
|
28
33
|
logTelemetry(event);
|
|
29
34
|
}
|
|
30
35
|
});
|
|
31
36
|
}
|
|
32
37
|
|
|
33
|
-
if (
|
|
38
|
+
if (((_TelemetryManager$Int5 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int5 === void 0 ? void 0 : (_TelemetryManager$Int6 = _TelemetryManager$Int5.telemetryConfig) === null || _TelemetryManager$Int6 === void 0 ? void 0 : _TelemetryManager$Int6.disableConsoleLog) === false) {
|
|
34
39
|
loggers.push(consoleLogger());
|
|
35
40
|
}
|
|
36
41
|
|
|
37
|
-
if (
|
|
42
|
+
if (((_TelemetryManager$Int7 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int7 === void 0 ? void 0 : (_TelemetryManager$Int8 = _TelemetryManager$Int7.telemetryConfig) === null || _TelemetryManager$Int8 === void 0 ? void 0 : _TelemetryManager$Int8.telemetryDisabled) === false) {
|
|
38
43
|
var _TelemetryManager$Int9, _TelemetryManager$Int18, _TelemetryManager$Int19;
|
|
39
44
|
|
|
40
45
|
if ((_TelemetryManager$Int9 = TelemetryManager.InternalTelemetryData) !== null && _TelemetryManager$Int9 !== void 0 && _TelemetryManager$Int9.ariaConfig) {
|
|
41
46
|
var _TelemetryManager$Int10, _TelemetryManager$Int11, _TelemetryManager$Int12, _TelemetryManager$Int13, _TelemetryManager$Int14, _TelemetryManager$Int15, _TelemetryManager$Int16, _TelemetryManager$Int17;
|
|
42
47
|
|
|
43
|
-
loggers.push(ariaTelemetryLogger(((_TelemetryManager$Int10 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int10 === void 0 ? void 0 : (_TelemetryManager$Int11 = _TelemetryManager$Int10.ariaConfig) === null || _TelemetryManager$Int11 === void 0 ? void 0 : _TelemetryManager$Int11.ariaTelemetryKey) ??
|
|
48
|
+
loggers.push(ariaTelemetryLogger(((_TelemetryManager$Int10 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int10 === void 0 ? void 0 : (_TelemetryManager$Int11 = _TelemetryManager$Int10.ariaConfig) === null || _TelemetryManager$Int11 === void 0 ? void 0 : _TelemetryManager$Int11.ariaTelemetryKey) ?? defaultAriaConfig.ariaTelemetryKey, ((_TelemetryManager$Int12 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int12 === void 0 ? void 0 : (_TelemetryManager$Int13 = _TelemetryManager$Int12.ariaConfig) === null || _TelemetryManager$Int13 === void 0 ? void 0 : _TelemetryManager$Int13.disableCookieUsage) ?? defaultAriaConfig.disableCookieUsage, ((_TelemetryManager$Int14 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int14 === void 0 ? void 0 : (_TelemetryManager$Int15 = _TelemetryManager$Int14.ariaConfig) === null || _TelemetryManager$Int15 === void 0 ? void 0 : _TelemetryManager$Int15.collectorUriForTelemetry) ?? defaultAriaConfig.collectorUriForTelemetry, ((_TelemetryManager$Int16 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int16 === void 0 ? void 0 : (_TelemetryManager$Int17 = _TelemetryManager$Int16.ariaConfig) === null || _TelemetryManager$Int17 === void 0 ? void 0 : _TelemetryManager$Int17.ariaTelemetryApplicationName) ?? defaultAriaConfig.ariaTelemetryApplicationName));
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
const customLoggers = (_TelemetryManager$Int18 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int18 === void 0 ? void 0 : (_TelemetryManager$Int19 = _TelemetryManager$Int18.telemetryConfig) === null || _TelemetryManager$Int19 === void 0 ? void 0 : _TelemetryManager$Int19.telemetryLoggers;
|
|
@@ -63,8 +68,11 @@ export const RegisterLoggers = () => {
|
|
|
63
68
|
|
|
64
69
|
const logTelemetry = telemetryEvent => {
|
|
65
70
|
loggers.map(logger => {
|
|
71
|
+
var _payload;
|
|
72
|
+
|
|
66
73
|
const logLevel = telemetryEvent.logLevel ?? LogLevel.INFO;
|
|
67
|
-
|
|
74
|
+
const scenarioType = ((_payload = telemetryEvent.payload) === null || _payload === void 0 ? void 0 : _payload.scenarioType) ?? ScenarioType.UNDEFINED;
|
|
75
|
+
logger.log(logLevel, parseInput(telemetryEvent === null || telemetryEvent === void 0 ? void 0 : telemetryEvent.payload, scenarioType));
|
|
68
76
|
});
|
|
69
77
|
};
|
|
70
78
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const defaultAriaConfig = {
|
|
2
|
-
collectorUriForTelemetry: "
|
|
3
|
-
ariaTelemetryKey: "
|
|
4
|
-
ariaTelemetryApplicationName: "
|
|
2
|
+
collectorUriForTelemetry: "",
|
|
3
|
+
ariaTelemetryKey: "c7655518acf1403f93ff6b9f77942f0a-d01a02fd-6b50-4de3-a566-62eda11f93bc-7083",
|
|
4
|
+
ariaTelemetryApplicationName: "D365_Omnichannel_Client_Public_Prod",
|
|
5
5
|
disableCookieUsage: true
|
|
6
6
|
};
|
|
@@ -3,5 +3,8 @@ export const defaultTelemetryConfiguration = {
|
|
|
3
3
|
telemetryDisabled: false,
|
|
4
4
|
disableConsoleLog: false,
|
|
5
5
|
telemetryLoggers: [],
|
|
6
|
-
ariaConfigurations: defaultAriaConfig
|
|
6
|
+
ariaConfigurations: defaultAriaConfig,
|
|
7
|
+
chatWidgetVersion: "0.0.0-0",
|
|
8
|
+
chatComponentVersion: "0.0.0-0",
|
|
9
|
+
OCChatSDKVersion: "0.0.0-0"
|
|
7
10
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { isNullOrEmptyString, isNullOrUndefined } from "../../utils";
|
|
1
|
+
import { getDomain, isNullOrEmptyString, isNullOrUndefined } from "../../utils";
|
|
2
2
|
import AWTEventProperties from "@microsoft/omnichannel-chat-sdk/lib/external/aria/webjs/AWTEventProperties";
|
|
3
3
|
import AWTLogManager from "@microsoft/omnichannel-chat-sdk/lib/external/aria/webjs/AWTLogManager";
|
|
4
4
|
import { AWTPiiKind } from "@microsoft/omnichannel-chat-sdk/lib/external/aria/common/Enums";
|
|
5
|
-
import { Constants } from "../../Constants";
|
|
5
|
+
import { Constants, AriaTelemetryConstants, EnvironmentVersion } from "../../Constants";
|
|
6
6
|
import { TelemetryHelper } from "../TelemetryHelper";
|
|
7
|
+
import { TelemetryManager } from "../TelemetryManager";
|
|
7
8
|
export const ariaTelemetryLogger = (ariaTelemetryKey, disabledCookieUsage, collectiorUriForTelemetry, ariaTelemetryApplicationName) => {
|
|
8
9
|
let _logger;
|
|
9
10
|
|
|
@@ -15,9 +16,32 @@ export const ariaTelemetryLogger = (ariaTelemetryKey, disabledCookieUsage, colle
|
|
|
15
16
|
|
|
16
17
|
if (!isNullOrEmptyString(collectiorUriForTelemetry)) {
|
|
17
18
|
configuration.collectorUri = collectiorUriForTelemetry;
|
|
19
|
+
} else {
|
|
20
|
+
if (TelemetryManager.InternalTelemetryData.environmentVersion == EnvironmentVersion.prod) {
|
|
21
|
+
var _TelemetryManager$Int;
|
|
22
|
+
|
|
23
|
+
const orgUrl = (_TelemetryManager$Int = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.orgUrl;
|
|
24
|
+
|
|
25
|
+
if (!isNullOrUndefined(orgUrl)) {
|
|
26
|
+
// If the given org is a Production EU org, modify the Aria collector uri
|
|
27
|
+
const region = getDomain(orgUrl);
|
|
28
|
+
|
|
29
|
+
if (region === AriaTelemetryConstants.EU) {
|
|
30
|
+
configuration.collectorUri = AriaTelemetryConstants.EUROPE_ENDPOINT;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
18
34
|
}
|
|
19
35
|
|
|
20
|
-
|
|
36
|
+
try {
|
|
37
|
+
_logger = AWTLogManager.initialize(ariaTelemetryKey, configuration);
|
|
38
|
+
|
|
39
|
+
if (_logger === undefined) {
|
|
40
|
+
_logger = AWTLogManager.getLogger(ariaTelemetryKey);
|
|
41
|
+
}
|
|
42
|
+
} catch (error) {
|
|
43
|
+
console.log(error);
|
|
44
|
+
}
|
|
21
45
|
}
|
|
22
46
|
|
|
23
47
|
return _logger;
|
|
@@ -37,6 +61,11 @@ export const ariaTelemetryLogger = (ariaTelemetryKey, disabledCookieUsage, colle
|
|
|
37
61
|
|
|
38
62
|
eventProperties.setPropertyWithPii(ariaTelemetryApplicationName, Constants.LiveChatWidget, AWTPiiKind.GenericData);
|
|
39
63
|
logger() ? logger().logEvent(eventProperties) : console.log("Unable to initialize aria logger");
|
|
64
|
+
},
|
|
65
|
+
dispose: () => {
|
|
66
|
+
AWTLogManager.flush(function () {
|
|
67
|
+
console.log("Aria logger disposed");
|
|
68
|
+
});
|
|
40
69
|
}
|
|
41
70
|
};
|
|
42
71
|
return ariaLogger;
|
package/lib/esm/common/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Constants, LocaleConstants } from "./Constants";
|
|
1
|
+
import { AriaTelemetryConstants, Constants, LocaleConstants } from "./Constants";
|
|
2
2
|
import { KeyCodes } from "./KeyCodes";
|
|
3
3
|
|
|
4
4
|
const getElementBySelector = selector => {
|
|
@@ -276,4 +276,14 @@ export const createTimer = () => {
|
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
};
|
|
279
|
+
}; // Returns the domain of the org
|
|
280
|
+
|
|
281
|
+
export const getDomain = hostValue => {
|
|
282
|
+
for (let i = 0; i < AriaTelemetryConstants.lcwEUDomainNames.length; i++) {
|
|
283
|
+
if (hostValue.endsWith(AriaTelemetryConstants.lcwEUDomainNames[i])) {
|
|
284
|
+
return AriaTelemetryConstants.EU;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
return AriaTelemetryConstants.Public;
|
|
279
289
|
};
|
|
@@ -73,7 +73,15 @@ export const ChatButtonStateful = props => {
|
|
|
73
73
|
Event: TelemetryEvent.LCWChatButtonShow,
|
|
74
74
|
ElapsedTimeInMilliseconds: TelemetryTimers.LcwLoadToChatButtonTimer.milliSecondsElapsed
|
|
75
75
|
});
|
|
76
|
-
|
|
76
|
+
|
|
77
|
+
if (state.uiStates.focusChatButton) {
|
|
78
|
+
setFocusOnElement(document.getElementById((controlProps === null || controlProps === void 0 ? void 0 : controlProps.id) ?? "oc-lcw-chat-button"));
|
|
79
|
+
} else {
|
|
80
|
+
dispatch({
|
|
81
|
+
type: LiveChatWidgetActionType.SET_FOCUS_CHAT_BUTTON,
|
|
82
|
+
payload: true
|
|
83
|
+
});
|
|
84
|
+
}
|
|
77
85
|
}, []);
|
|
78
86
|
return /*#__PURE__*/React.createElement(ChatButton, {
|
|
79
87
|
componentOverrides: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.componentOverrides,
|
|
@@ -1,40 +1,30 @@
|
|
|
1
1
|
import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
2
|
+
import { ConfirmationPane } from "@microsoft/omnichannel-chat-components";
|
|
2
3
|
import React, { useEffect } from "react";
|
|
3
4
|
import { findAllFocusableElement, findParentFocusableElementsWithoutChildContainer, preventFocusToMoveOutOfElement, setFocusOnElement, setFocusOnSendBox, setTabIndices } from "../../common/utils";
|
|
4
|
-
import { ConfirmationPane } from "@microsoft/omnichannel-chat-components";
|
|
5
|
-
import { Constants } from "../../common/Constants";
|
|
6
|
-
import { ConversationState } from "../../contexts/common/ConversationState";
|
|
7
5
|
import { DimLayer } from "../dimlayer/DimLayer";
|
|
8
6
|
import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
|
|
9
7
|
import { NotificationHandler } from "../webchatcontainerstateful/webchatcontroller/notification/NotificationHandler";
|
|
10
8
|
import { NotificationScenarios } from "../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios";
|
|
11
|
-
import { PostChatSurveyMode } from "../postchatsurveypanestateful/enums/PostChatSurveyMode";
|
|
12
9
|
import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
13
10
|
import useChatAdapterStore from "../../hooks/useChatAdapterStore";
|
|
14
|
-
import useChatContextStore from "../../hooks/useChatContextStore";
|
|
15
|
-
import useChatSDKStore from "../../hooks/useChatSDKStore"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
import useChatContextStore from "../../hooks/useChatContextStore"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
12
|
|
|
17
13
|
export const ConfirmationPaneStateful = props => {
|
|
18
|
-
var _state$domainStates$l, _state$domainStates$l2, _state$domainStates$l3, _state$domainStates$l4;
|
|
19
|
-
|
|
20
14
|
const initialTabIndexMap = new Map();
|
|
21
15
|
let elements = [];
|
|
22
16
|
const [state, dispatch] = useChatContextStore();
|
|
23
17
|
const {
|
|
24
|
-
|
|
25
|
-
endChat
|
|
18
|
+
prepareEndChat
|
|
26
19
|
} = props; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
-
|
|
28
|
-
const chatSDK = useChatSDKStore(); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
21
|
|
|
30
22
|
const [adapter] = useChatAdapterStore();
|
|
31
|
-
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;
|
|
32
|
-
const postChatSurveyMode = (_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : (_state$domainStates$l4 = _state$domainStates$l3.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l4 === void 0 ? void 0 : _state$domainStates$l4.msdyn_postconversationsurveymode;
|
|
33
23
|
const controlProps = {
|
|
34
24
|
id: "oc-lcw-confirmation-pane",
|
|
35
25
|
dir: state.domainStates.globalDir,
|
|
36
26
|
onConfirm: async () => {
|
|
37
|
-
TelemetryHelper.
|
|
27
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
38
28
|
Event: TelemetryEvent.ConfirmationConfirmButtonClicked,
|
|
39
29
|
Description: "Confirmation pane Confirm button clicked"
|
|
40
30
|
});
|
|
@@ -44,40 +34,8 @@ export const ConfirmationPaneStateful = props => {
|
|
|
44
34
|
});
|
|
45
35
|
|
|
46
36
|
try {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (isPostChatEnabled === "true" && postChatSurveyMode === PostChatSurveyMode.Embed && conversationDetails.canRenderPostChat === Constants.truePascal) {
|
|
51
|
-
dispatch({
|
|
52
|
-
type: LiveChatWidgetActionType.SET_SHOULD_SHOW_POST_CHAT,
|
|
53
|
-
payload: true
|
|
54
|
-
});
|
|
55
|
-
dispatch({
|
|
56
|
-
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
57
|
-
payload: ConversationState.Loading
|
|
58
|
-
});
|
|
59
|
-
await setPostChatContext();
|
|
60
|
-
|
|
61
|
-
if (state.domainStates.postChatContext) {
|
|
62
|
-
dispatch({
|
|
63
|
-
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
64
|
-
payload: ConversationState.Postchat
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
} else {
|
|
68
|
-
setTabIndices(elements, initialTabIndexMap, true);
|
|
69
|
-
|
|
70
|
-
try {
|
|
71
|
-
await endChat(adapter);
|
|
72
|
-
} catch (error) {
|
|
73
|
-
TelemetryHelper.logSDKEvent(LogLevel.ERROR, {
|
|
74
|
-
Event: TelemetryEvent.CloseChatMethodException,
|
|
75
|
-
ExceptionDetails: {
|
|
76
|
-
exception: `Failed to endChat: ${error}`
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
37
|
+
setTabIndices(elements, initialTabIndexMap, true);
|
|
38
|
+
await prepareEndChat(adapter, state);
|
|
81
39
|
} catch (ex) {
|
|
82
40
|
TelemetryHelper.logSDKEvent(LogLevel.ERROR, {
|
|
83
41
|
Event: TelemetryEvent.GetConversationDetailsCallFailed,
|
|
@@ -89,7 +47,7 @@ export const ConfirmationPaneStateful = props => {
|
|
|
89
47
|
}
|
|
90
48
|
},
|
|
91
49
|
onCancel: () => {
|
|
92
|
-
TelemetryHelper.
|
|
50
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
93
51
|
Event: TelemetryEvent.ConfirmationCancelButtonClicked,
|
|
94
52
|
Description: "Confirmation pane Cancel button clicked."
|
|
95
53
|
});
|
|
@@ -68,8 +68,8 @@ export const EmailTranscriptPaneStateful = props => {
|
|
|
68
68
|
},
|
|
69
69
|
onCancel: () => {
|
|
70
70
|
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
71
|
-
Event: TelemetryEvent.
|
|
72
|
-
Description: "Email Transcript button clicked."
|
|
71
|
+
Event: TelemetryEvent.EmailTranscriptCancelButtonClicked,
|
|
72
|
+
Description: "Email Transcript cancel button clicked."
|
|
73
73
|
});
|
|
74
74
|
closeEmailTranscriptPane();
|
|
75
75
|
},
|
|
@@ -4,13 +4,13 @@ import AudioNotificationStateful from "./audionotificationstateful/AudioNotifica
|
|
|
4
4
|
import { Constants } from "../../common/Constants";
|
|
5
5
|
import { Footer } from "@microsoft/omnichannel-chat-components";
|
|
6
6
|
import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
|
|
7
|
+
import { NewMessageNotificationSoundBase64 } from "../../assets/Audios";
|
|
7
8
|
import { NotificationHandler } from "../webchatcontainerstateful/webchatcontroller/notification/NotificationHandler";
|
|
8
9
|
import { NotificationScenarios } from "../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios";
|
|
9
10
|
import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
10
11
|
import { downloadTranscript } from "./downloadtranscriptstateful/DownloadTranscriptStateful";
|
|
11
12
|
import useChatContextStore from "../../hooks/useChatContextStore";
|
|
12
|
-
import useChatSDKStore from "../../hooks/useChatSDKStore";
|
|
13
|
-
import newMessageNotification from "../../assets/audios/newMessageNotification.mp3"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
|
+
import useChatSDKStore from "../../hooks/useChatSDKStore"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
14
|
|
|
15
15
|
export const FooterStateful = props => {
|
|
16
16
|
var _footerProps$controlP3, _footerProps$controlP4;
|
|
@@ -96,9 +96,8 @@ export const FooterStateful = props => {
|
|
|
96
96
|
controlProps: controlProps,
|
|
97
97
|
styleProps: footerProps === null || footerProps === void 0 ? void 0 : footerProps.styleProps
|
|
98
98
|
}), /*#__PURE__*/React.createElement(AudioNotificationStateful, {
|
|
99
|
-
audioSrc: (audioNotificationProps === null || audioNotificationProps === void 0 ? void 0 : audioNotificationProps.audioSrc) ??
|
|
100
|
-
|
|
101
|
-
isAudioMuted: state.appStates.isAudioMuted ?? false
|
|
99
|
+
audioSrc: (audioNotificationProps === null || audioNotificationProps === void 0 ? void 0 : audioNotificationProps.audioSrc) ?? NewMessageNotificationSoundBase64,
|
|
100
|
+
isAudioMuted: state.appStates.isAudioMuted === null ? (footerProps === null || footerProps === void 0 ? void 0 : (_footerProps$controlP4 = footerProps.controlProps) === null || _footerProps$controlP4 === void 0 ? void 0 : _footerProps$controlP4.hideAudioNotificationButton) ?? false : state.appStates.isAudioMuted ?? false
|
|
102
101
|
}));
|
|
103
102
|
};
|
|
104
103
|
export default FooterStateful;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
2
|
-
import React, { useEffect, useState } from "react";
|
|
2
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
3
3
|
import { ConversationState } from "../../contexts/common/ConversationState";
|
|
4
4
|
import { Header } from "@microsoft/omnichannel-chat-components";
|
|
5
5
|
import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
|
|
@@ -21,6 +21,7 @@ export const HeaderStateful = props => {
|
|
|
21
21
|
|
|
22
22
|
const [outOfOperatingHours, setOutOfOperatingHours] = 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");
|
|
23
23
|
const outOfOfficeStyleProps = Object.assign({}, defaultOutOfOfficeHeaderStyleProps, outOfOfficeHeaderProps === null || outOfOfficeHeaderProps === void 0 ? void 0 : outOfOfficeHeaderProps.styleProps);
|
|
24
|
+
const conversationState = useRef(state.appStates.conversationState);
|
|
24
25
|
const controlProps = {
|
|
25
26
|
id: "oc-lcw-header",
|
|
26
27
|
dir: state.domainStates.globalDir,
|
|
@@ -40,17 +41,15 @@ export const HeaderStateful = props => {
|
|
|
40
41
|
Description: "Header Close button clicked."
|
|
41
42
|
});
|
|
42
43
|
|
|
43
|
-
if (
|
|
44
|
+
if (conversationState.current === ConversationState.Active) {
|
|
44
45
|
dispatch({
|
|
45
46
|
type: LiveChatWidgetActionType.SET_SHOW_CONFIRMATION,
|
|
46
47
|
payload: true
|
|
47
48
|
});
|
|
48
|
-
} else
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
53
|
-
await endChat(adapter);
|
|
49
|
+
} else {
|
|
50
|
+
const skipEndChatSDK = true;
|
|
51
|
+
const skipCloseChat = false;
|
|
52
|
+
await endChat(adapter, skipEndChatSDK, skipCloseChat);
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
dispatch({
|
|
@@ -82,7 +81,11 @@ export const HeaderStateful = props => {
|
|
|
82
81
|
if (state.appStates.outsideOperatingHours) {
|
|
83
82
|
setOutOfOperatingHours(true);
|
|
84
83
|
}
|
|
85
|
-
|
|
84
|
+
|
|
85
|
+
if (state.appStates.conversationState) {
|
|
86
|
+
conversationState.current = state.appStates.conversationState;
|
|
87
|
+
}
|
|
88
|
+
}, [state.appStates]);
|
|
86
89
|
return /*#__PURE__*/React.createElement(Header, {
|
|
87
90
|
componentOverrides: headerProps === null || headerProps === void 0 ? void 0 : headerProps.componentOverrides,
|
|
88
91
|
controlProps: outOfOperatingHours || state.appStates.conversationState === ConversationState.OutOfOffice ? outOfOfficeControlProps : controlProps,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import MarkdownIt from "markdown-it";
|
|
2
|
-
import MarkdownSlack from "slack-markdown-it";
|
|
3
2
|
import MarkdownItForInline from "markdown-it-for-inline";
|
|
4
3
|
import { defaultMarkdownLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts";
|
|
5
4
|
import { Constants } from "../../../common/Constants"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -12,8 +11,9 @@ export const createMarkdown = (disableMarkdownMessageFormatting, disableNewLineM
|
|
|
12
11
|
html: true,
|
|
13
12
|
linkify: true,
|
|
14
13
|
breaks: !disableNewLineMarkdownSupport
|
|
15
|
-
});
|
|
16
|
-
markdown.use(MarkdownSlack);
|
|
14
|
+
}); // ToDo: Commenting below usage of plugin until deferred bug is resolved: https://github.com/mayashavin/markdown-it-slack/issues/1
|
|
15
|
+
// markdown.use(MarkdownSlack);
|
|
16
|
+
// Markdown override for open link in new tab
|
|
17
17
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, quotes
|
|
18
18
|
|
|
19
19
|
markdown.use(MarkdownItForInline, "url_new_win", "link_open", function (tokens, idx, env) {
|