@microsoft/omnichannel-chat-widget 1.0.3-main.527f8c3 → 1.0.3-main.87088f3
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/lib/cjs/common/Constants.js +54 -1
- package/lib/cjs/common/storage/default/defaultCacheManager.js +7 -6
- package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +9 -7
- package/lib/cjs/common/telemetry/TelemetryConstants.js +7 -1
- package/lib/cjs/common/utils.js +27 -5
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +1 -10
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -6
- package/lib/cjs/components/footerstateful/FooterStateful.js +1 -1
- package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +12 -1
- package/lib/cjs/components/headerstateful/HeaderStateful.js +14 -13
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +1 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +1 -0
- package/lib/cjs/components/livechatwidget/common/Deferred.js +2 -3
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +11 -3
- package/lib/cjs/components/livechatwidget/common/endChat.js +197 -99
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +44 -21
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +11 -8
- package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +139 -0
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +2 -255
- package/lib/cjs/components/livechatwidget/common/startChat.js +85 -69
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +162 -100
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +2 -2
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +18 -8
- package/lib/cjs/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +1 -2
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +5 -4
- package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +4 -1
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +62 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +8 -6
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +25 -12
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +7 -1
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +2 -0
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +16 -13
- package/lib/cjs/contexts/createReducer.js +13 -23
- package/lib/cjs/controller/componentController.js +2 -1
- package/lib/cjs/index.js +20 -0
- package/lib/esm/common/Constants.js +49 -0
- package/lib/esm/common/storage/default/defaultCacheManager.js +5 -4
- package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +9 -7
- package/lib/esm/common/telemetry/TelemetryConstants.js +7 -1
- package/lib/esm/common/utils.js +25 -4
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +4 -13
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -6
- package/lib/esm/components/footerstateful/FooterStateful.js +1 -1
- package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +11 -1
- package/lib/esm/components/headerstateful/HeaderStateful.js +14 -13
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +1 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +1 -0
- package/lib/esm/components/livechatwidget/common/Deferred.js +2 -3
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +11 -3
- package/lib/esm/components/livechatwidget/common/endChat.js +196 -99
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +44 -21
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +11 -8
- package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +130 -0
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -255
- package/lib/esm/components/livechatwidget/common/startChat.js +86 -70
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +164 -102
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +2 -2
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +18 -8
- package/lib/esm/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +1 -2
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +5 -4
- package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +4 -1
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +54 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +8 -6
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +25 -12
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +7 -1
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +2 -0
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +18 -15
- package/lib/esm/contexts/createReducer.js +13 -23
- package/lib/esm/controller/componentController.js +2 -1
- package/lib/esm/index.js +4 -1
- package/lib/types/common/Constants.d.ts +21 -0
- package/lib/types/common/interfaces/IContextDataStore.d.ts +3 -3
- package/lib/types/common/storage/default/defaultCacheManager.d.ts +2 -1
- package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +2 -1
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +7 -1
- package/lib/types/common/utils.d.ts +3 -2
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +6 -0
- package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +2 -1
- package/lib/types/components/livechatwidget/common/endChat.d.ts +4 -3
- package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/renderSurveyHelpers.d.ts +9 -0
- package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +1 -6
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +3 -1
- package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.d.ts +9 -0
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +8 -7
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +3 -1
- package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +2 -1
- package/lib/types/index.d.ts +3 -0
- package/package.json +2 -1
- package/lib/cjs/components/livechatwidget/common/agentEndConversationHelper.js +0 -36
- package/lib/cjs/contexts/common/ConversationEndEntity.js +0 -12
- package/lib/esm/components/livechatwidget/common/agentEndConversationHelper.js +0 -30
- package/lib/esm/contexts/common/ConversationEndEntity.js +0 -5
- package/lib/types/components/livechatwidget/common/agentEndConversationHelper.d.ts +0 -6
- package/lib/types/contexts/common/ConversationEndEntity.d.ts +0 -4
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.WebChatMiddlewareConstants = exports.TranscriptConstants = exports.Regex = exports.MimeTypes = exports.LocaleConstants = exports.LiveWorkItemState = exports.HtmlIdNames = exports.HtmlElementSelectors = exports.HtmlClassNames = exports.HtmlAttributeNames = exports.EnvironmentVersion = exports.ElementType = exports.E2VVOptions = exports.Constants = exports.ChatSDKError = exports.AriaTelemetryConstants = exports.AMSConstants = void 0;
|
|
6
|
+
exports.WebChatMiddlewareConstants = exports.TranscriptConstants = exports.StorageType = exports.Regex = exports.ParticipantType = exports.MimeTypes = exports.LocaleConstants = exports.LiveWorkItemState = exports.HtmlIdNames = exports.HtmlElementSelectors = exports.HtmlClassNames = exports.HtmlAttributeNames = exports.EnvironmentVersion = exports.ElementType = exports.E2VVOptions = exports.ConversationEndEntity = exports.Constants = exports.ConfirmationState = exports.ChatSDKError = exports.AriaTelemetryConstants = exports.AMSConstants = void 0;
|
|
7
7
|
var _class;
|
|
8
8
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
9
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
@@ -30,27 +30,34 @@ _defineProperty(Constants, "false", "false");
|
|
|
30
30
|
_defineProperty(Constants, "maximumUnreadMessageCount", 99);
|
|
31
31
|
_defineProperty(Constants, "userParticipantTypeTag", "User");
|
|
32
32
|
_defineProperty(Constants, "botParticipantTypeTag", "Bot");
|
|
33
|
+
// channelDataMiddleware
|
|
33
34
|
_defineProperty(Constants, "channelIdKey", "ChannelId-");
|
|
34
35
|
_defineProperty(Constants, "ChannelId", "lcw");
|
|
35
36
|
_defineProperty(Constants, "CustomerTag", "FromCustomer");
|
|
37
|
+
// gifUploadMiddleware
|
|
36
38
|
_defineProperty(Constants, "GifContentType", "image/gif");
|
|
39
|
+
// htmlPlayerMiddleware
|
|
37
40
|
_defineProperty(Constants, "video", "video");
|
|
38
41
|
_defineProperty(Constants, "audio", "audio");
|
|
39
42
|
_defineProperty(Constants, "controlsList", "controlsList");
|
|
40
43
|
_defineProperty(Constants, "nodownload", "nodownload");
|
|
44
|
+
// htmlTextMiddleware
|
|
41
45
|
_defineProperty(Constants, "activity", "activity");
|
|
42
46
|
_defineProperty(Constants, "payload", "payload");
|
|
43
47
|
_defineProperty(Constants, "text", "text");
|
|
44
48
|
_defineProperty(Constants, "blank", "_blank");
|
|
49
|
+
// activityMiddleware
|
|
45
50
|
_defineProperty(Constants, "visitorIdPrefix", "8:");
|
|
46
51
|
_defineProperty(Constants, "left", "left");
|
|
47
52
|
_defineProperty(Constants, "queuePositionMessageTag", "queueposition");
|
|
48
53
|
_defineProperty(Constants, "averageWaitTimeMessageTag", "averagewaittime");
|
|
49
54
|
_defineProperty(Constants, "message", "message");
|
|
50
55
|
_defineProperty(Constants, "hiddenTag", "Hidden");
|
|
56
|
+
// messageTimestampMiddleware
|
|
51
57
|
_defineProperty(Constants, "prefixTimestampTag", "ServerMessageTimestamp_");
|
|
52
58
|
_defineProperty(Constants, "acsChannel", "ACS_CHANNEL");
|
|
53
59
|
_defineProperty(Constants, "publicMessageTag", "public");
|
|
60
|
+
//attachmentMiddleware
|
|
54
61
|
_defineProperty(Constants, "supportedAdaptiveCardContentTypes", ["application/vnd.microsoft.card.adaptive", "application/vnd.microsoft.card.audio", "application/vnd.microsoft.card.hero", "application/vnd.microsoft.card.receipt", "application/vnd.microsoft.card.thumbnail", "application/vnd.microsoft.card.signin", "application/vnd.microsoft.card.oauth"]);
|
|
55
62
|
_defineProperty(Constants, "maxUploadFileSize", "500000");
|
|
56
63
|
_defineProperty(Constants, "imageRegex", /(\.)(jpeg|jpg|jiff|png|gif|bmp|webp)$/i);
|
|
@@ -58,6 +65,7 @@ _defineProperty(Constants, "audioMediaRegex", /(\.)(aac|aiff|alac|amr|flac|mp2|m
|
|
|
58
65
|
_defineProperty(Constants, "videoMediaRegex", /(\.)(avchd|avi|flv|mpe|mpeg|mpg|mpv|mp4|m4p|m4v|mov|qt|swf|webm|wmv)$/i);
|
|
59
66
|
_defineProperty(Constants, "chromeSupportedInlineMediaRegex", /(\.)(aac|mp3|wav|mp4)$/i);
|
|
60
67
|
_defineProperty(Constants, "firefoxSupportedInlineMediaRegex", /(\.)(aac|flac|mp3|wav|mp4|mov)$/i);
|
|
68
|
+
// calling container event names
|
|
61
69
|
_defineProperty(Constants, "CallAdded", "callAdded");
|
|
62
70
|
_defineProperty(Constants, "LocalVideoStreamAdded", "localVideoStreamAdded");
|
|
63
71
|
_defineProperty(Constants, "LocalVideoStreamRemoved", "localVideoStreamRemoved");
|
|
@@ -72,12 +80,18 @@ _defineProperty(Constants, "VoiceVideoNotLoaded", "voiceVideoNotLoaded");
|
|
|
72
80
|
_defineProperty(Constants, "VoiceVideoLoadingException", "voiceVideoLoadingOnException");
|
|
73
81
|
_defineProperty(Constants, "VoiceVideoAcceptCallException", "voiceVideoAcceptCallOnException");
|
|
74
82
|
_defineProperty(Constants, "VoiceVideoAcceptCallWithVideoException", "voiceVideoAcceptCallWithVideoException");
|
|
83
|
+
// download transcript
|
|
75
84
|
_defineProperty(Constants, "defaultDownloadTranscriptError", "Download transcript failed.");
|
|
85
|
+
// proactive chat
|
|
76
86
|
_defineProperty(Constants, "ProactiveChatInviteTimeoutInMs", 60000);
|
|
87
|
+
// 1 minute
|
|
88
|
+
// prechat survey
|
|
77
89
|
_defineProperty(Constants, "InputSubmit", "InputSubmit");
|
|
90
|
+
// reconnect chat
|
|
78
91
|
_defineProperty(Constants, "ReconnectIdAttributeName", "oc.reconnectid");
|
|
79
92
|
_defineProperty(Constants, "LiveChatWidget", "LiveChatWidgetNew");
|
|
80
93
|
_defineProperty(Constants, "GuidPattern", "xx-x-4m-ym-xxx");
|
|
94
|
+
// Markdown plugin
|
|
81
95
|
_defineProperty(Constants, "Default", "default");
|
|
82
96
|
_defineProperty(Constants, "Zero", "zero");
|
|
83
97
|
_defineProperty(Constants, "Title", "title");
|
|
@@ -85,13 +99,18 @@ _defineProperty(Constants, "Target", "target");
|
|
|
85
99
|
_defineProperty(Constants, "Blank", "_blank");
|
|
86
100
|
_defineProperty(Constants, "TargetRelationship", "rel");
|
|
87
101
|
_defineProperty(Constants, "TargetRelationshipAttributes", "noopener noreferrer");
|
|
102
|
+
// Markdown icons
|
|
88
103
|
_defineProperty(Constants, "OpenLinkIconCssClass", "webchat__markdown__external-link-icon");
|
|
104
|
+
// internet connection test
|
|
89
105
|
_defineProperty(Constants, "internetConnectionTestUrl", "https://ocsdk-prod.azureedge.net/public/connecttest.txt");
|
|
90
106
|
_defineProperty(Constants, "internetConnectionTestUrlText", "Omnichannel Connect Test");
|
|
91
107
|
_defineProperty(Constants, "ChatWidgetStateChangedPrefix", "ChatWidgetStateChanged");
|
|
92
108
|
_defineProperty(Constants, "PostChatLoadingDurationInMs", 2000);
|
|
93
109
|
_defineProperty(Constants, "BrowserUnloadConfirmationMessage", "Do you want to leave chat?");
|
|
94
110
|
_defineProperty(Constants, "CacheTtlInMinutes", 15);
|
|
111
|
+
_defineProperty(Constants, "SessionCacheSuffix", "session");
|
|
112
|
+
_defineProperty(Constants, "PopoutCacheSuffix", "popout");
|
|
113
|
+
// Visibility timeout for conversation details
|
|
95
114
|
_defineProperty(Constants, "LWICheckOnVisibilityTimeout", 3 * 60 * 1000);
|
|
96
115
|
const Regex = (_class = class Regex {}, _defineProperty(_class, "EmailRegex", "(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])"), _class);
|
|
97
116
|
exports.Regex = Regex;
|
|
@@ -143,12 +162,14 @@ class WebChatMiddlewareConstants {}
|
|
|
143
162
|
exports.WebChatMiddlewareConstants = WebChatMiddlewareConstants;
|
|
144
163
|
_defineProperty(WebChatMiddlewareConstants, "nextVisibleActivity", "nextVisibleActivity");
|
|
145
164
|
_defineProperty(WebChatMiddlewareConstants, "timeBetweenTimestampGroups", 300000);
|
|
165
|
+
//5 minutes
|
|
146
166
|
_defineProperty(WebChatMiddlewareConstants, "maxTextLength", 6000);
|
|
147
167
|
_defineProperty(WebChatMiddlewareConstants, "adaptiveCard", "AdaptiveCard");
|
|
148
168
|
class AMSConstants {}
|
|
149
169
|
exports.AMSConstants = AMSConstants;
|
|
150
170
|
_defineProperty(AMSConstants, "supportedImagesMimeTypes", ["image/jpeg", "image/png", "image/gif", "image/heic", "image/webp"]);
|
|
151
171
|
_defineProperty(AMSConstants, "maxSupportedImageSize", 20);
|
|
172
|
+
// AMS max file limit outside of supported Images MIME Types.
|
|
152
173
|
_defineProperty(AMSConstants, "maxSupportedFileSize", 300);
|
|
153
174
|
class MimeTypes {}
|
|
154
175
|
exports.MimeTypes = MimeTypes;
|
|
@@ -190,6 +211,33 @@ exports.LiveWorkItemState = LiveWorkItemState;
|
|
|
190
211
|
LiveWorkItemState["Waiting"] = "Waiting";
|
|
191
212
|
LiveWorkItemState["WrapUp"] = "WrapUp";
|
|
192
213
|
})(LiveWorkItemState || (exports.LiveWorkItemState = LiveWorkItemState = {}));
|
|
214
|
+
let StorageType;
|
|
215
|
+
exports.StorageType = StorageType;
|
|
216
|
+
(function (StorageType) {
|
|
217
|
+
StorageType[StorageType["localStorage"] = 0] = "localStorage";
|
|
218
|
+
StorageType[StorageType["sessionStorage"] = 1] = "sessionStorage";
|
|
219
|
+
})(StorageType || (exports.StorageType = StorageType = {}));
|
|
220
|
+
let ParticipantType;
|
|
221
|
+
exports.ParticipantType = ParticipantType;
|
|
222
|
+
(function (ParticipantType) {
|
|
223
|
+
ParticipantType["User"] = "User";
|
|
224
|
+
ParticipantType["Bot"] = "Bot";
|
|
225
|
+
})(ParticipantType || (exports.ParticipantType = ParticipantType = {}));
|
|
226
|
+
let ConversationEndEntity;
|
|
227
|
+
exports.ConversationEndEntity = ConversationEndEntity;
|
|
228
|
+
(function (ConversationEndEntity) {
|
|
229
|
+
ConversationEndEntity["Customer"] = "Customer";
|
|
230
|
+
ConversationEndEntity["Agent"] = "Agent";
|
|
231
|
+
ConversationEndEntity["Bot"] = "Bot";
|
|
232
|
+
ConversationEndEntity["NotSet"] = "NotSet";
|
|
233
|
+
})(ConversationEndEntity || (exports.ConversationEndEntity = ConversationEndEntity = {}));
|
|
234
|
+
let ConfirmationState;
|
|
235
|
+
exports.ConfirmationState = ConfirmationState;
|
|
236
|
+
(function (ConfirmationState) {
|
|
237
|
+
ConfirmationState["Ok"] = "Ok";
|
|
238
|
+
ConfirmationState["Cancel"] = "Cancel";
|
|
239
|
+
ConfirmationState["NotSet"] = "NotSet";
|
|
240
|
+
})(ConfirmationState || (exports.ConfirmationState = ConfirmationState = {}));
|
|
193
241
|
class TranscriptConstants {}
|
|
194
242
|
exports.TranscriptConstants = TranscriptConstants;
|
|
195
243
|
_defineProperty(TranscriptConstants, "ChatTranscriptsBodyColor", "#F5F5F5");
|
|
@@ -204,11 +252,16 @@ _defineProperty(TranscriptConstants, "AgentDialogColor", "#2266E3");
|
|
|
204
252
|
_defineProperty(TranscriptConstants, "AgentFontColor", "white");
|
|
205
253
|
class AriaTelemetryConstants {}
|
|
206
254
|
exports.AriaTelemetryConstants = AriaTelemetryConstants;
|
|
255
|
+
// Aria Endpoint for different environment types.
|
|
207
256
|
_defineProperty(AriaTelemetryConstants, "GERMANY_ENDPOINT", "https://de.pipe.aria.microsoft.com/Collector/3.0/");
|
|
208
257
|
_defineProperty(AriaTelemetryConstants, "GCCH_ENDPOINT", "https://tb.pipe.aria.microsoft.com/Collector/3.0/");
|
|
209
258
|
_defineProperty(AriaTelemetryConstants, "DOD_ENDPOINT", "https://pf.pipe.aria.microsoft.com/Collector/3.0");
|
|
210
259
|
_defineProperty(AriaTelemetryConstants, "EUROPE_ENDPOINT", "https://eu-mobile.events.data.microsoft.com/Collector/3.0/");
|
|
260
|
+
// EUDB Collector URL
|
|
211
261
|
_defineProperty(AriaTelemetryConstants, "MOONCAKE_ENDPOINT", "");
|
|
262
|
+
// Add MoonCake ARIA Endpoint whenever available
|
|
263
|
+
// Environment types
|
|
212
264
|
_defineProperty(AriaTelemetryConstants, "Public", "Public");
|
|
213
265
|
_defineProperty(AriaTelemetryConstants, "EU", "Europe");
|
|
266
|
+
// EUR: crm4; FRA: crm12; GER: crm16; CHE: crm17; NOR: crm19
|
|
214
267
|
_defineProperty(AriaTelemetryConstants, "lcwEUDomainNames", ["crm4.omnichannelengagementhub.com", "crm12.omnichannelengagementhub.com", "crm16.omnichannelengagementhub.com", "crm17.omnichannelengagementhub.com", "crm19.omnichannelengagementhub.com"]);
|
|
@@ -3,24 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.registerBroadcastServiceForStorage = exports.defaultCacheManager = void 0;
|
|
7
7
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
8
|
-
var _utils = require("../../utils");
|
|
9
8
|
var _defaultClientDataStoreProvider = require("./defaultClientDataStoreProvider");
|
|
10
9
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
10
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
12
11
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
12
|
class defaultCacheManager {}
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
15
|
exports.defaultCacheManager = defaultCacheManager;
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
17
|
_defineProperty(defaultCacheManager, "InternalCache", {});
|
|
16
|
-
const
|
|
17
|
-
const widgetCacheId = (0, _utils.getWidgetCacheId)(orgid, widgetId, widgetInstanceId);
|
|
18
|
+
const registerBroadcastServiceForStorage = (widgetCacheId, ttlInMins, storageType) => {
|
|
18
19
|
_omnichannelChatComponents.BroadcastService.getMessageByEventName(widgetCacheId).subscribe(msg => {
|
|
19
20
|
try {
|
|
20
|
-
(0, _defaultClientDataStoreProvider.defaultClientDataStoreProvider)(ttlInMins).setData(widgetCacheId, JSON.stringify(msg.payload)
|
|
21
|
+
(0, _defaultClientDataStoreProvider.defaultClientDataStoreProvider)(ttlInMins, storageType).setData(widgetCacheId, JSON.stringify(msg.payload));
|
|
21
22
|
} catch (error) {
|
|
22
23
|
console.error("Error in setting data to localstorage", error);
|
|
23
24
|
}
|
|
24
25
|
});
|
|
25
26
|
};
|
|
26
|
-
exports.
|
|
27
|
+
exports.registerBroadcastServiceForStorage = registerBroadcastServiceForStorage;
|
|
@@ -7,10 +7,12 @@ exports.defaultClientDataStoreProvider = void 0;
|
|
|
7
7
|
var _TelemetryConstants = require("../../telemetry/TelemetryConstants");
|
|
8
8
|
var _TelemetryHelper = require("../../telemetry/TelemetryHelper");
|
|
9
9
|
var _defaultInMemoryDataStore = require("./defaultInMemoryDataStore");
|
|
10
|
+
var _Constants = require("../../Constants");
|
|
10
11
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
11
12
|
|
|
12
13
|
const defaultClientDataStoreProvider = function () {
|
|
13
14
|
let cacheTtlinMins = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
15
|
+
let storageType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _Constants.StorageType.localStorage;
|
|
14
16
|
let ttlInMs = 0;
|
|
15
17
|
const isCookieAllowed = () => {
|
|
16
18
|
try {
|
|
@@ -30,7 +32,7 @@ const defaultClientDataStoreProvider = function () {
|
|
|
30
32
|
}
|
|
31
33
|
const dataStoreProvider = {
|
|
32
34
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
-
setData: (key, data
|
|
35
|
+
setData: (key, data) => {
|
|
34
36
|
if (isCookieAllowed()) {
|
|
35
37
|
try {
|
|
36
38
|
if (key) {
|
|
@@ -40,7 +42,7 @@ const defaultClientDataStoreProvider = function () {
|
|
|
40
42
|
expiry: now.getTime() + ttlInMs
|
|
41
43
|
};
|
|
42
44
|
const strItem = JSON.stringify(item);
|
|
43
|
-
if (
|
|
45
|
+
if (storageType === _Constants.StorageType.localStorage) {
|
|
44
46
|
localStorage.setItem(key, strItem);
|
|
45
47
|
} else {
|
|
46
48
|
sessionStorage.setItem(key, strItem);
|
|
@@ -57,16 +59,16 @@ const defaultClientDataStoreProvider = function () {
|
|
|
57
59
|
const dataToCache = {
|
|
58
60
|
key: key,
|
|
59
61
|
data: data,
|
|
60
|
-
type:
|
|
62
|
+
type: storageType == _Constants.StorageType.localStorage ? "localStorage" : "sessionStorage"
|
|
61
63
|
};
|
|
62
64
|
parent.postMessage(dataToCache, "*");
|
|
63
65
|
}
|
|
64
66
|
},
|
|
65
67
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
66
|
-
getData:
|
|
68
|
+
getData: key => {
|
|
67
69
|
if (isCookieAllowed()) {
|
|
68
70
|
let item;
|
|
69
|
-
if (
|
|
71
|
+
if (storageType === _Constants.StorageType.localStorage) {
|
|
70
72
|
item = localStorage.getItem(key);
|
|
71
73
|
} else {
|
|
72
74
|
item = sessionStorage.getItem(key);
|
|
@@ -91,10 +93,10 @@ const defaultClientDataStoreProvider = function () {
|
|
|
91
93
|
}
|
|
92
94
|
},
|
|
93
95
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
94
|
-
removeData:
|
|
96
|
+
removeData: key => {
|
|
95
97
|
if (isCookieAllowed()) {
|
|
96
98
|
if (key) {
|
|
97
|
-
if (
|
|
99
|
+
if (storageType === _Constants.StorageType.localStorage) {
|
|
98
100
|
return localStorage.removeItem(key);
|
|
99
101
|
} else {
|
|
100
102
|
return sessionStorage.removeItem(key);
|
|
@@ -36,7 +36,6 @@ exports.BroadcastEvent = BroadcastEvent;
|
|
|
36
36
|
BroadcastEvent["StartProactiveChat"] = "StartProactiveChat";
|
|
37
37
|
BroadcastEvent["ProactiveChatStartChat"] = "ProactiveChatStartChat";
|
|
38
38
|
BroadcastEvent["ProactiveChatStartPopoutChat"] = "ProactiveChatStartPopoutChat";
|
|
39
|
-
BroadcastEvent["ProactiveChatIsInPopoutMode"] = "ProactiveChatIsInPopoutMode";
|
|
40
39
|
BroadcastEvent["ResetProactiveChatParams"] = "ResetProactiveChatParams";
|
|
41
40
|
BroadcastEvent["InvalidAdaptiveCardFormat"] = "InvalidAdaptiveCardFormat";
|
|
42
41
|
BroadcastEvent["NewMessageSent"] = "NewMessageSent";
|
|
@@ -59,6 +58,8 @@ exports.BroadcastEvent = BroadcastEvent;
|
|
|
59
58
|
BroadcastEvent["SigninCardReceived"] = "SignInCardReceived";
|
|
60
59
|
BroadcastEvent["BotAuthConfigRequest"] = "BotAuthConfigRequest";
|
|
61
60
|
BroadcastEvent["BotAuthConfigResponse"] = "BotAuthConfigResponse";
|
|
61
|
+
BroadcastEvent["RemoveWidgetDataFromCache"] = "RemoveWidgetDataFromCache";
|
|
62
|
+
BroadcastEvent["InitiateStartChatInPopoutMode"] = "InitiateStartChatInPopoutMode";
|
|
62
63
|
BroadcastEvent["HideChatVisibilityChangeEvent"] = "hideChatVisibilityChangeEvent";
|
|
63
64
|
BroadcastEvent["UpdateSessionDataForTelemetry"] = "UpdateSessionDataForTelemetry";
|
|
64
65
|
BroadcastEvent["UpdateConversationDataForTelemetry"] = "UpdateConversationDataForTelemetry";
|
|
@@ -95,13 +96,18 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
95
96
|
TelemetryEvent["CallingSDKInitFailed"] = "CallingSDKInitFailed";
|
|
96
97
|
TelemetryEvent["CallingSDKLoadSuccess"] = "CallingSDKLoadSuccess";
|
|
97
98
|
TelemetryEvent["CallingSDKLoadFailed"] = "CallingSDKLoadFailed";
|
|
99
|
+
TelemetryEvent["GetConversationDetailsCallStarted"] = "GetConversationDetailsCallStarted";
|
|
98
100
|
TelemetryEvent["GetConversationDetailsCallFailed"] = "GetConversationDetailsCallFailed";
|
|
99
101
|
TelemetryEvent["EndChatSDKCallFailed"] = "EndChatSDKCallFailed";
|
|
102
|
+
TelemetryEvent["GetChatReconnectContextSDKCallStarted"] = "GetChatReconnectContextSDKCallStarted";
|
|
100
103
|
TelemetryEvent["GetChatReconnectContextSDKCallFailed"] = "GetChatReconnectContextSDKCallFailed";
|
|
101
104
|
TelemetryEvent["ParseAdaptiveCardFailed"] = "ParseAdaptiveCardFailed";
|
|
102
105
|
TelemetryEvent["ClientDataStoreProviderFailed"] = "ClientDataStoreProviderFailed";
|
|
103
106
|
TelemetryEvent["InMemoryDataStoreFailed"] = "InMemoryDataStoreFailed";
|
|
104
107
|
TelemetryEvent["ChatVisibilityChanged"] = "ChatVisibilityChanged";
|
|
108
|
+
TelemetryEvent["EndChatSucceeded"] = "EndChatSucceeded";
|
|
109
|
+
TelemetryEvent["EndChatFailed"] = "EndChatFailed";
|
|
110
|
+
TelemetryEvent["SetCustomContext"] = "SetCustomContext";
|
|
105
111
|
TelemetryEvent["WebChatLoaded"] = "WebChatLoaded";
|
|
106
112
|
TelemetryEvent["LCWChatButtonClicked"] = "LCWChatButtonClicked";
|
|
107
113
|
TelemetryEvent["LCWChatButtonShow"] = "LCWChatButtonShow";
|
package/lib/cjs/common/utils.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.setTabIndices = exports.setFocusOnSendBox = exports.setFocusOnElement = exports.preventFocusToMoveOutOfElement = exports.parseAdaptiveCardPayload = exports.newGuid = exports.isUndefinedOrEmpty = exports.isNullOrUndefined = exports.isNullOrEmptyString = exports.getWidgetEndChatEventName = exports.getWidgetCacheId = exports.getTimestampHourMinute = exports.getStateFromCache = exports.getLocaleDirection = exports.getIconText = exports.getDomain = exports.getConversationDetailsCall = exports.getBroadcastChannelName = exports.findParentFocusableElementsWithoutChildContainer = exports.findAllFocusableElement = exports.extractPreChatSurveyResponseValues = exports.escapeHtml = exports.debounceLeading = exports.createTimer = exports.changeLanguageCodeFormatForWebChat = exports.addDelayInMs = void 0;
|
|
6
|
+
exports.setTabIndices = exports.setFocusOnSendBox = exports.setFocusOnElement = exports.preventFocusToMoveOutOfElement = exports.parseAdaptiveCardPayload = exports.newGuid = exports.isUndefinedOrEmpty = exports.isNullOrUndefined = exports.isNullOrEmptyString = exports.getWidgetEndChatEventName = exports.getWidgetCacheIdfromProps = exports.getWidgetCacheId = exports.getTimestampHourMinute = exports.getStateFromCache = exports.getLocaleDirection = exports.getIconText = exports.getDomain = exports.getConversationDetailsCall = exports.getBroadcastChannelName = exports.findParentFocusableElementsWithoutChildContainer = exports.findAllFocusableElement = exports.extractPreChatSurveyResponseValues = exports.escapeHtml = exports.debounceLeading = exports.createTimer = exports.changeLanguageCodeFormatForWebChat = exports.addDelayInMs = void 0;
|
|
7
7
|
var _Constants = require("./Constants");
|
|
8
8
|
var _TelemetryConstants = require("./telemetry/TelemetryConstants");
|
|
9
9
|
var _DataStoreManager = require("./contextDataStore/DataStoreManager");
|
|
@@ -282,7 +282,11 @@ const getDomain = hostValue => {
|
|
|
282
282
|
return _Constants.AriaTelemetryConstants.Public;
|
|
283
283
|
};
|
|
284
284
|
exports.getDomain = getDomain;
|
|
285
|
-
const getWidgetCacheId = (orgId, widgetId, widgetInstanceId)
|
|
285
|
+
const getWidgetCacheId = function (orgId, widgetId, widgetInstanceId) {
|
|
286
|
+
let popoutChat = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
287
|
+
if (popoutChat) {
|
|
288
|
+
widgetInstanceId = widgetInstanceId + _Constants.Constants.PopoutCacheSuffix;
|
|
289
|
+
}
|
|
286
290
|
const widgetCacheId = `${widgetInstanceId}_${orgId}_${widgetId}`;
|
|
287
291
|
return _md5Typescript.Md5.init(widgetCacheId);
|
|
288
292
|
};
|
|
@@ -296,13 +300,13 @@ const getWidgetEndChatEventName = (orgId, widgetId, widgetInstanceId) => {
|
|
|
296
300
|
|
|
297
301
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
298
302
|
exports.getWidgetEndChatEventName = getWidgetEndChatEventName;
|
|
299
|
-
const getStateFromCache =
|
|
303
|
+
const getStateFromCache = widgetCacheId => {
|
|
300
304
|
// Getting updated state from cache
|
|
301
305
|
try {
|
|
302
306
|
if (_DataStoreManager.DataStoreManager.clientDataStore) {
|
|
303
307
|
var _DataStoreManager$cli;
|
|
304
|
-
const widgetStateEventName =
|
|
305
|
-
const widgetStateFromCache = (_DataStoreManager$cli = _DataStoreManager.DataStoreManager.clientDataStore) === null || _DataStoreManager$cli === void 0 ? void 0 : _DataStoreManager$cli.getData(widgetStateEventName
|
|
308
|
+
const widgetStateEventName = widgetCacheId;
|
|
309
|
+
const widgetStateFromCache = (_DataStoreManager$cli = _DataStoreManager.DataStoreManager.clientDataStore) === null || _DataStoreManager$cli === void 0 ? void 0 : _DataStoreManager$cli.getData(widgetStateEventName);
|
|
306
310
|
const persistedState = widgetStateFromCache ? JSON.parse(widgetStateFromCache) : undefined;
|
|
307
311
|
return persistedState;
|
|
308
312
|
} else {
|
|
@@ -339,6 +343,24 @@ const getBroadcastChannelName = (widgetId, widgetInstanceId) => {
|
|
|
339
343
|
|
|
340
344
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
341
345
|
exports.getBroadcastChannelName = getBroadcastChannelName;
|
|
346
|
+
const getWidgetCacheIdfromProps = function (props) {
|
|
347
|
+
var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$controlProps, _props$controlProps2;
|
|
348
|
+
let popoutChat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
349
|
+
const orgId = props === null || props === void 0 ? void 0 : (_props$chatSDK = props.chatSDK) === null || _props$chatSDK === void 0 ? void 0 : (_props$chatSDK$omnich = _props$chatSDK.omnichannelConfig) === null || _props$chatSDK$omnich === void 0 ? void 0 : _props$chatSDK$omnich.orgId;
|
|
350
|
+
const widgetId = props === null || props === void 0 ? void 0 : (_props$chatSDK2 = props.chatSDK) === null || _props$chatSDK2 === void 0 ? void 0 : (_props$chatSDK2$omnic = _props$chatSDK2.omnichannelConfig) === null || _props$chatSDK2$omnic === void 0 ? void 0 : _props$chatSDK2$omnic.widgetId;
|
|
351
|
+
let widgetInstanceId = (props === null || props === void 0 ? void 0 : (_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.widgetInstanceId) ?? "";
|
|
352
|
+
if (props.useSessionStorage) {
|
|
353
|
+
widgetInstanceId = widgetInstanceId + _Constants.Constants.SessionCacheSuffix;
|
|
354
|
+
}
|
|
355
|
+
if (props !== null && props !== void 0 && (_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.hideStartChatButton || popoutChat === true) {
|
|
356
|
+
popoutChat = true;
|
|
357
|
+
}
|
|
358
|
+
const widgetCacheId = getWidgetCacheId(orgId, widgetId, widgetInstanceId, popoutChat);
|
|
359
|
+
return widgetCacheId;
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
363
|
+
exports.getWidgetCacheIdfromProps = getWidgetCacheIdfromProps;
|
|
342
364
|
const debounceLeading = function (fn) {
|
|
343
365
|
let ms = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3000;
|
|
344
366
|
let timeoutId;
|
|
@@ -28,7 +28,6 @@ const ChatButtonStateful = props => {
|
|
|
28
28
|
} = props;
|
|
29
29
|
//Setting OutOfOperatingHours Flag
|
|
30
30
|
const [outOfOperatingHours, setOutOfOperatingHours] = (0, _react.useState)(((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.OutOfOperatingHours) === "True");
|
|
31
|
-
const proactiveChatInNewWindow = (0, _react.useRef)(state.appStates.proactiveChatStates.proactiveChatInNewWindow);
|
|
32
31
|
const outOfOfficeStyleProps = Object.assign({}, _defaultOutOfOfficeChatButtonStyleProps.defaultOutOfOfficeChatButtonStyleProps, outOfOfficeButtonProps === null || outOfOfficeButtonProps === void 0 ? void 0 : outOfOfficeButtonProps.styleProps);
|
|
33
32
|
const controlProps = {
|
|
34
33
|
id: "oc-lcw-chat-button",
|
|
@@ -41,12 +40,7 @@ const ChatButtonStateful = props => {
|
|
|
41
40
|
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
42
41
|
Event: _TelemetryConstants.TelemetryEvent.LCWChatButtonClicked
|
|
43
42
|
});
|
|
44
|
-
if (
|
|
45
|
-
const proactiveChatIsInPopoutModeEvent = {
|
|
46
|
-
eventName: _TelemetryConstants.BroadcastEvent.ProactiveChatIsInPopoutMode
|
|
47
|
-
};
|
|
48
|
-
_omnichannelChatComponents.BroadcastService.postMessage(proactiveChatIsInPopoutModeEvent);
|
|
49
|
-
} else if (state.appStates.isMinimized) {
|
|
43
|
+
if (state.appStates.isMinimized) {
|
|
50
44
|
dispatch({
|
|
51
45
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MINIMIZED,
|
|
52
46
|
payload: false
|
|
@@ -99,9 +93,6 @@ const ChatButtonStateful = props => {
|
|
|
99
93
|
});
|
|
100
94
|
}
|
|
101
95
|
}, []);
|
|
102
|
-
(0, _react.useEffect)(() => {
|
|
103
|
-
proactiveChatInNewWindow.current = state.appStates.proactiveChatStates.proactiveChatInNewWindow;
|
|
104
|
-
}, [state.appStates.proactiveChatStates.proactiveChatInNewWindow]);
|
|
105
96
|
return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.ChatButton, {
|
|
106
97
|
componentOverrides: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.componentOverrides,
|
|
107
98
|
controlProps: outOfOperatingHours ? outOfOfficeControlProps : controlProps,
|
|
@@ -11,9 +11,8 @@ var _utils = require("../../common/utils");
|
|
|
11
11
|
var _DimLayer = require("../dimlayer/DimLayer");
|
|
12
12
|
var _LiveChatWidgetActionType = require("../../contexts/common/LiveChatWidgetActionType");
|
|
13
13
|
var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
14
|
-
var _useChatAdapterStore = _interopRequireDefault(require("../../hooks/useChatAdapterStore"));
|
|
15
14
|
var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
|
|
16
|
-
var
|
|
15
|
+
var _Constants = require("../../common/Constants");
|
|
17
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
17
|
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); }
|
|
19
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -23,7 +22,6 @@ const ConfirmationPaneStateful = props => {
|
|
|
23
22
|
let elements = [];
|
|
24
23
|
const [state, dispatch] = (0, _useChatContextStore.default)();
|
|
25
24
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
26
|
-
const [adapter] = (0, _useChatAdapterStore.default)();
|
|
27
25
|
const controlProps = {
|
|
28
26
|
id: "oc-lcw-confirmation-pane",
|
|
29
27
|
dir: state.domainStates.globalDir,
|
|
@@ -36,11 +34,11 @@ const ConfirmationPaneStateful = props => {
|
|
|
36
34
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SHOW_CONFIRMATION,
|
|
37
35
|
payload: false
|
|
38
36
|
});
|
|
39
|
-
(0, _utils.setTabIndices)(elements, initialTabIndexMap, true);
|
|
40
37
|
dispatch({
|
|
41
|
-
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.
|
|
42
|
-
payload:
|
|
38
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONFIRMATION_STATE,
|
|
39
|
+
payload: _Constants.ConfirmationState.Ok
|
|
43
40
|
});
|
|
41
|
+
(0, _utils.setTabIndices)(elements, initialTabIndexMap, true);
|
|
44
42
|
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
45
43
|
Event: _TelemetryConstants.TelemetryEvent.ConversationEndedByCustomer,
|
|
46
44
|
Description: "Conversation is ended by customer."
|
|
@@ -55,6 +53,10 @@ const ConfirmationPaneStateful = props => {
|
|
|
55
53
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SHOW_CONFIRMATION,
|
|
56
54
|
payload: false
|
|
57
55
|
});
|
|
56
|
+
dispatch({
|
|
57
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONFIRMATION_STATE,
|
|
58
|
+
payload: _Constants.ConfirmationState.Cancel
|
|
59
|
+
});
|
|
58
60
|
const previousFocusedElementId = state.appStates.previousElementIdOnFocusBeforeModalOpen;
|
|
59
61
|
if (previousFocusedElementId) {
|
|
60
62
|
(0, _utils.setFocusOnElement)("#" + previousFocusedElementId);
|
|
@@ -42,7 +42,7 @@ const FooterStateful = props => {
|
|
|
42
42
|
Event: _TelemetryConstants.TelemetryEvent.DownloadTranscriptButtonClicked,
|
|
43
43
|
Description: "Download Transcript button clicked."
|
|
44
44
|
});
|
|
45
|
-
await (0, _DownloadTranscriptStateful.downloadTranscript)(chatSDK, downloadTranscriptProps === null || downloadTranscriptProps === void 0 ? void 0 : downloadTranscriptProps.renderMarkDown, downloadTranscriptProps === null || downloadTranscriptProps === void 0 ? void 0 : downloadTranscriptProps.bannerMessageOnError, downloadTranscriptProps === null || downloadTranscriptProps === void 0 ? void 0 : downloadTranscriptProps.attachmentMessage);
|
|
45
|
+
await (0, _DownloadTranscriptStateful.downloadTranscript)(chatSDK, downloadTranscriptProps === null || downloadTranscriptProps === void 0 ? void 0 : downloadTranscriptProps.renderMarkDown, downloadTranscriptProps === null || downloadTranscriptProps === void 0 ? void 0 : downloadTranscriptProps.bannerMessageOnError, downloadTranscriptProps === null || downloadTranscriptProps === void 0 ? void 0 : downloadTranscriptProps.attachmentMessage, state);
|
|
46
46
|
} catch (ex) {
|
|
47
47
|
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
48
48
|
Event: _TelemetryConstants.TelemetryEvent.DownloadTranscriptFailed,
|
package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js
CHANGED
|
@@ -9,6 +9,8 @@ var _NotificationScenarios = require("../../webchatcontainerstateful/webchatcont
|
|
|
9
9
|
var _NotificationHandler = require("../../webchatcontainerstateful/webchatcontroller/notification/NotificationHandler");
|
|
10
10
|
var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
11
11
|
var _TelemetryConstants = require("../../../common/telemetry/TelemetryConstants");
|
|
12
|
+
var _dompurify = _interopRequireDefault(require("dompurify"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
14
|
const processDisplayName = displayName => {
|
|
13
15
|
// if displayname matches "teamsvisitor:<some alphanumeric string>", we replace it with "Customer"
|
|
14
16
|
const displayNameRegex = ".+:.+";
|
|
@@ -64,6 +66,8 @@ const processContent = (transcriptContent, isAgentChat, renderMarkDown) => {
|
|
|
64
66
|
}
|
|
65
67
|
if (renderMarkDown) {
|
|
66
68
|
transcriptContent = renderMarkDown(transcriptContent);
|
|
69
|
+
} else {
|
|
70
|
+
transcriptContent = _dompurify.default.sanitize(transcriptContent);
|
|
67
71
|
}
|
|
68
72
|
return transcriptContent;
|
|
69
73
|
};
|
|
@@ -157,8 +161,15 @@ const beautifyChatTranscripts = (chatTranscripts, renderMarkDown, attachmentMess
|
|
|
157
161
|
};
|
|
158
162
|
|
|
159
163
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
160
|
-
const downloadTranscript = async (chatSDK, renderMarkDown, bannerMessageOnError, attachmentMessage) => {
|
|
164
|
+
const downloadTranscript = async (chatSDK, renderMarkDown, bannerMessageOnError, attachmentMessage, state) => {
|
|
165
|
+
var _state$domainStates, _state$domainStates2, _state$domainStates2$;
|
|
166
|
+
// Need to keep existing request id for scenarios when trnascript is downloaded after endchat
|
|
167
|
+
const existingRequestId = chatSDK.requestId;
|
|
168
|
+
chatSDK.chatToken = state === null || state === void 0 ? void 0 : (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : _state$domainStates.chatToken;
|
|
169
|
+
chatSDK.requestId = state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : (_state$domainStates2$ = _state$domainStates2.chatToken) === null || _state$domainStates2$ === void 0 ? void 0 : _state$domainStates2$.requestId;
|
|
161
170
|
let data = await (chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.getLiveChatTranscript());
|
|
171
|
+
// This is used for allowing to start next chat
|
|
172
|
+
chatSDK.requestId = existingRequestId;
|
|
162
173
|
if (typeof data === _Constants.Constants.String) {
|
|
163
174
|
data = JSON.parse(data);
|
|
164
175
|
}
|
|
@@ -13,12 +13,12 @@ var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
|
13
13
|
var _defaultOutOfOfficeHeaderStyleProps = require("./common/styleProps/defaultOutOfOfficeHeaderStyleProps");
|
|
14
14
|
var _useChatAdapterStore = _interopRequireDefault(require("../../hooks/useChatAdapterStore"));
|
|
15
15
|
var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
|
|
16
|
-
var
|
|
16
|
+
var _Constants = require("../../common/Constants");
|
|
17
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
18
|
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); }
|
|
19
19
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
20
|
const HeaderStateful = props => {
|
|
21
|
-
var _state$domainStates$l, _state$domainStates$l2, _headerProps$controlP, _headerProps$controlP2, _headerProps$controlP3, _outOfOfficeHeaderPro;
|
|
21
|
+
var _state$domainStates$l, _state$domainStates$l2, _state$domainStates, _headerProps$controlP, _headerProps$controlP2, _headerProps$controlP3, _outOfOfficeHeaderPro, _state$domainStates3;
|
|
22
22
|
const [state, dispatch] = (0, _useChatContextStore.default)();
|
|
23
23
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
24
|
const [adapter] = (0, _useChatAdapterStore.default)();
|
|
@@ -30,8 +30,9 @@ const HeaderStateful = props => {
|
|
|
30
30
|
//Setting OutOfOperatingHours Flag
|
|
31
31
|
const [outOfOperatingHours, setOutOfOperatingHours] = (0, _react.useState)(((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.OutOfOperatingHours) === "True");
|
|
32
32
|
const outOfOfficeStyleProps = Object.assign({}, _defaultOutOfOfficeHeaderStyleProps.defaultOutOfOfficeHeaderStyleProps, outOfOfficeHeaderProps === null || outOfOfficeHeaderProps === void 0 ? void 0 : outOfOfficeHeaderProps.styleProps);
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
|
|
34
|
+
// For some reason state object is not getting updated values in this component
|
|
35
|
+
const localConfirmationPaneState = (0, _react.useRef)(state === null || state === void 0 ? void 0 : (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : _state$domainStates.confirmationState);
|
|
35
36
|
const controlProps = {
|
|
36
37
|
id: "oc-lcw-header",
|
|
37
38
|
dir: state.domainStates.globalDir,
|
|
@@ -51,7 +52,7 @@ const HeaderStateful = props => {
|
|
|
51
52
|
Event: _TelemetryConstants.TelemetryEvent.HeaderCloseButtonClicked,
|
|
52
53
|
Description: "Header Close button clicked."
|
|
53
54
|
});
|
|
54
|
-
if (
|
|
55
|
+
if (localConfirmationPaneState.current !== _Constants.ConfirmationState.Ok) {
|
|
55
56
|
dispatch({
|
|
56
57
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SHOW_CONFIRMATION,
|
|
57
58
|
payload: true
|
|
@@ -71,9 +72,9 @@ const HeaderStateful = props => {
|
|
|
71
72
|
}
|
|
72
73
|
},
|
|
73
74
|
...(headerProps === null || headerProps === void 0 ? void 0 : headerProps.controlProps),
|
|
74
|
-
hideTitle: state.appStates.conversationState === _ConversationState.ConversationState.Loading && !state.appStates.
|
|
75
|
-
hideIcon: state.appStates.conversationState === _ConversationState.ConversationState.Loading && !state.appStates.
|
|
76
|
-
hideCloseButton: state.appStates.conversationState === _ConversationState.ConversationState.Loading && !state.appStates.
|
|
75
|
+
hideTitle: state.appStates.conversationState === _ConversationState.ConversationState.Loading && !state.appStates.startChatFailed || state.appStates.conversationState === _ConversationState.ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP = headerProps.controlProps) === null || _headerProps$controlP === void 0 ? void 0 : _headerProps$controlP.hideTitle),
|
|
76
|
+
hideIcon: state.appStates.conversationState === _ConversationState.ConversationState.Loading && !state.appStates.startChatFailed || state.appStates.conversationState === _ConversationState.ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP2 = headerProps.controlProps) === null || _headerProps$controlP2 === void 0 ? void 0 : _headerProps$controlP2.hideIcon),
|
|
77
|
+
hideCloseButton: state.appStates.conversationState === _ConversationState.ConversationState.Loading && !state.appStates.startChatFailed || state.appStates.conversationState === _ConversationState.ConversationState.PostchatLoading || state.appStates.conversationState === _ConversationState.ConversationState.Prechat || state.appStates.conversationState === _ConversationState.ConversationState.ReconnectChat || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP3 = headerProps.controlProps) === null || _headerProps$controlP3 === void 0 ? void 0 : _headerProps$controlP3.hideCloseButton)
|
|
77
78
|
};
|
|
78
79
|
const outOfOfficeControlProps = {
|
|
79
80
|
id: "oc-lcw-header",
|
|
@@ -94,11 +95,11 @@ const HeaderStateful = props => {
|
|
|
94
95
|
if (state.appStates.outsideOperatingHours) {
|
|
95
96
|
setOutOfOperatingHours(true);
|
|
96
97
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}, [state.
|
|
98
|
+
}, []);
|
|
99
|
+
(0, _react.useEffect)(() => {
|
|
100
|
+
var _state$domainStates2;
|
|
101
|
+
localConfirmationPaneState.current = state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : _state$domainStates2.confirmationState;
|
|
102
|
+
}, [state === null || state === void 0 ? void 0 : (_state$domainStates3 = state.domainStates) === null || _state$domainStates3 === void 0 ? void 0 : _state$domainStates3.confirmationState]);
|
|
102
103
|
return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.Header, {
|
|
103
104
|
componentOverrides: headerProps === null || headerProps === void 0 ? void 0 : headerProps.componentOverrides,
|
|
104
105
|
controlProps: outOfOperatingHours || state.appStates.conversationState === _ConversationState.ConversationState.OutOfOffice ? outOfOfficeControlProps : controlProps,
|
package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js
CHANGED
|
@@ -9,6 +9,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
|
|
|
9
9
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
10
10
|
class DefaultActivitySubscriber {
|
|
11
11
|
constructor() {
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
13
|
_defineProperty(this, "observer", void 0);
|
|
13
14
|
}
|
|
14
15
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js
CHANGED
|
@@ -10,6 +10,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
|
|
|
10
10
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
11
|
class PauseActivitySubscriber {
|
|
12
12
|
constructor() {
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
14
|
_defineProperty(this, "observer", void 0);
|
|
14
15
|
}
|
|
15
16
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -16,9 +16,11 @@ class Deferred {
|
|
|
16
16
|
_defineProperty(this, "_reject", () => {
|
|
17
17
|
return;
|
|
18
18
|
});
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
20
|
_defineProperty(this, "resolve", value => {
|
|
20
21
|
this._resolve(value);
|
|
21
22
|
});
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
24
|
_defineProperty(this, "reject", value => {
|
|
23
25
|
this._reject(value);
|
|
24
26
|
});
|
|
@@ -27,9 +29,6 @@ class Deferred {
|
|
|
27
29
|
this._reject = reject;
|
|
28
30
|
});
|
|
29
31
|
}
|
|
30
|
-
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
|
-
|
|
33
32
|
get promise() {
|
|
34
33
|
return this._promise;
|
|
35
34
|
}
|
|
@@ -1196,7 +1196,13 @@ const dummyDefaultProps = {
|
|
|
1196
1196
|
borderRadius: "0 0 4px 4px",
|
|
1197
1197
|
borderWidth: "3px",
|
|
1198
1198
|
backgroundColor: "#FFFFFF",
|
|
1199
|
-
borderColor: "#F1F1F1"
|
|
1199
|
+
borderColor: "#F1F1F1",
|
|
1200
|
+
position: "initial",
|
|
1201
|
+
height: "100%",
|
|
1202
|
+
width: "100%",
|
|
1203
|
+
left: "0%",
|
|
1204
|
+
top: "0%",
|
|
1205
|
+
display: "contents"
|
|
1200
1206
|
}
|
|
1201
1207
|
},
|
|
1202
1208
|
isCustomerVoiceSurveyCompact: undefined
|
|
@@ -1791,9 +1797,11 @@ const dummyDefaultProps = {
|
|
|
1791
1797
|
adaptiveCardStyles: {
|
|
1792
1798
|
background: "white",
|
|
1793
1799
|
color: "black"
|
|
1794
|
-
}
|
|
1800
|
+
},
|
|
1801
|
+
hyperlinkTextOverride: false
|
|
1795
1802
|
},
|
|
1796
1803
|
telemetryConfig: undefined,
|
|
1797
|
-
getAuthToken: undefined
|
|
1804
|
+
getAuthToken: undefined,
|
|
1805
|
+
initialCustomContext: undefined
|
|
1798
1806
|
};
|
|
1799
1807
|
exports.dummyDefaultProps = dummyDefaultProps;
|