@microsoft/omnichannel-chat-widget 1.0.3-main.527f8c3 → 1.0.3-main.c925679
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 +6 -0
- package/lib/cjs/common/utils.js +27 -5
- 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 +8 -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 +4 -2
- package/lib/cjs/components/livechatwidget/common/endChat.js +197 -99
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +41 -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 +70 -57
- 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 +15 -5
- 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 +6 -0
- package/lib/esm/common/utils.js +25 -4
- 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 +8 -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 +4 -2
- package/lib/esm/components/livechatwidget/common/endChat.js +196 -99
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +41 -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 +71 -58
- 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 +15 -5
- 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 +6 -0
- 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
|
@@ -23,27 +23,34 @@ _defineProperty(Constants, "false", "false");
|
|
|
23
23
|
_defineProperty(Constants, "maximumUnreadMessageCount", 99);
|
|
24
24
|
_defineProperty(Constants, "userParticipantTypeTag", "User");
|
|
25
25
|
_defineProperty(Constants, "botParticipantTypeTag", "Bot");
|
|
26
|
+
// channelDataMiddleware
|
|
26
27
|
_defineProperty(Constants, "channelIdKey", "ChannelId-");
|
|
27
28
|
_defineProperty(Constants, "ChannelId", "lcw");
|
|
28
29
|
_defineProperty(Constants, "CustomerTag", "FromCustomer");
|
|
30
|
+
// gifUploadMiddleware
|
|
29
31
|
_defineProperty(Constants, "GifContentType", "image/gif");
|
|
32
|
+
// htmlPlayerMiddleware
|
|
30
33
|
_defineProperty(Constants, "video", "video");
|
|
31
34
|
_defineProperty(Constants, "audio", "audio");
|
|
32
35
|
_defineProperty(Constants, "controlsList", "controlsList");
|
|
33
36
|
_defineProperty(Constants, "nodownload", "nodownload");
|
|
37
|
+
// htmlTextMiddleware
|
|
34
38
|
_defineProperty(Constants, "activity", "activity");
|
|
35
39
|
_defineProperty(Constants, "payload", "payload");
|
|
36
40
|
_defineProperty(Constants, "text", "text");
|
|
37
41
|
_defineProperty(Constants, "blank", "_blank");
|
|
42
|
+
// activityMiddleware
|
|
38
43
|
_defineProperty(Constants, "visitorIdPrefix", "8:");
|
|
39
44
|
_defineProperty(Constants, "left", "left");
|
|
40
45
|
_defineProperty(Constants, "queuePositionMessageTag", "queueposition");
|
|
41
46
|
_defineProperty(Constants, "averageWaitTimeMessageTag", "averagewaittime");
|
|
42
47
|
_defineProperty(Constants, "message", "message");
|
|
43
48
|
_defineProperty(Constants, "hiddenTag", "Hidden");
|
|
49
|
+
// messageTimestampMiddleware
|
|
44
50
|
_defineProperty(Constants, "prefixTimestampTag", "ServerMessageTimestamp_");
|
|
45
51
|
_defineProperty(Constants, "acsChannel", "ACS_CHANNEL");
|
|
46
52
|
_defineProperty(Constants, "publicMessageTag", "public");
|
|
53
|
+
//attachmentMiddleware
|
|
47
54
|
_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"]);
|
|
48
55
|
_defineProperty(Constants, "maxUploadFileSize", "500000");
|
|
49
56
|
_defineProperty(Constants, "imageRegex", /(\.)(jpeg|jpg|jiff|png|gif|bmp|webp)$/i);
|
|
@@ -51,6 +58,7 @@ _defineProperty(Constants, "audioMediaRegex", /(\.)(aac|aiff|alac|amr|flac|mp2|m
|
|
|
51
58
|
_defineProperty(Constants, "videoMediaRegex", /(\.)(avchd|avi|flv|mpe|mpeg|mpg|mpv|mp4|m4p|m4v|mov|qt|swf|webm|wmv)$/i);
|
|
52
59
|
_defineProperty(Constants, "chromeSupportedInlineMediaRegex", /(\.)(aac|mp3|wav|mp4)$/i);
|
|
53
60
|
_defineProperty(Constants, "firefoxSupportedInlineMediaRegex", /(\.)(aac|flac|mp3|wav|mp4|mov)$/i);
|
|
61
|
+
// calling container event names
|
|
54
62
|
_defineProperty(Constants, "CallAdded", "callAdded");
|
|
55
63
|
_defineProperty(Constants, "LocalVideoStreamAdded", "localVideoStreamAdded");
|
|
56
64
|
_defineProperty(Constants, "LocalVideoStreamRemoved", "localVideoStreamRemoved");
|
|
@@ -65,12 +73,18 @@ _defineProperty(Constants, "VoiceVideoNotLoaded", "voiceVideoNotLoaded");
|
|
|
65
73
|
_defineProperty(Constants, "VoiceVideoLoadingException", "voiceVideoLoadingOnException");
|
|
66
74
|
_defineProperty(Constants, "VoiceVideoAcceptCallException", "voiceVideoAcceptCallOnException");
|
|
67
75
|
_defineProperty(Constants, "VoiceVideoAcceptCallWithVideoException", "voiceVideoAcceptCallWithVideoException");
|
|
76
|
+
// download transcript
|
|
68
77
|
_defineProperty(Constants, "defaultDownloadTranscriptError", "Download transcript failed.");
|
|
78
|
+
// proactive chat
|
|
69
79
|
_defineProperty(Constants, "ProactiveChatInviteTimeoutInMs", 60000);
|
|
80
|
+
// 1 minute
|
|
81
|
+
// prechat survey
|
|
70
82
|
_defineProperty(Constants, "InputSubmit", "InputSubmit");
|
|
83
|
+
// reconnect chat
|
|
71
84
|
_defineProperty(Constants, "ReconnectIdAttributeName", "oc.reconnectid");
|
|
72
85
|
_defineProperty(Constants, "LiveChatWidget", "LiveChatWidgetNew");
|
|
73
86
|
_defineProperty(Constants, "GuidPattern", "xx-x-4m-ym-xxx");
|
|
87
|
+
// Markdown plugin
|
|
74
88
|
_defineProperty(Constants, "Default", "default");
|
|
75
89
|
_defineProperty(Constants, "Zero", "zero");
|
|
76
90
|
_defineProperty(Constants, "Title", "title");
|
|
@@ -78,13 +92,18 @@ _defineProperty(Constants, "Target", "target");
|
|
|
78
92
|
_defineProperty(Constants, "Blank", "_blank");
|
|
79
93
|
_defineProperty(Constants, "TargetRelationship", "rel");
|
|
80
94
|
_defineProperty(Constants, "TargetRelationshipAttributes", "noopener noreferrer");
|
|
95
|
+
// Markdown icons
|
|
81
96
|
_defineProperty(Constants, "OpenLinkIconCssClass", "webchat__markdown__external-link-icon");
|
|
97
|
+
// internet connection test
|
|
82
98
|
_defineProperty(Constants, "internetConnectionTestUrl", "https://ocsdk-prod.azureedge.net/public/connecttest.txt");
|
|
83
99
|
_defineProperty(Constants, "internetConnectionTestUrlText", "Omnichannel Connect Test");
|
|
84
100
|
_defineProperty(Constants, "ChatWidgetStateChangedPrefix", "ChatWidgetStateChanged");
|
|
85
101
|
_defineProperty(Constants, "PostChatLoadingDurationInMs", 2000);
|
|
86
102
|
_defineProperty(Constants, "BrowserUnloadConfirmationMessage", "Do you want to leave chat?");
|
|
87
103
|
_defineProperty(Constants, "CacheTtlInMinutes", 15);
|
|
104
|
+
_defineProperty(Constants, "SessionCacheSuffix", "session");
|
|
105
|
+
_defineProperty(Constants, "PopoutCacheSuffix", "popout");
|
|
106
|
+
// Visibility timeout for conversation details
|
|
88
107
|
_defineProperty(Constants, "LWICheckOnVisibilityTimeout", 3 * 60 * 1000);
|
|
89
108
|
export 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);
|
|
90
109
|
export class HtmlIdNames {}
|
|
@@ -130,11 +149,13 @@ _defineProperty(HtmlAttributeNames, "adaptiveCardActionSetClassName", "ac-action
|
|
|
130
149
|
export class WebChatMiddlewareConstants {}
|
|
131
150
|
_defineProperty(WebChatMiddlewareConstants, "nextVisibleActivity", "nextVisibleActivity");
|
|
132
151
|
_defineProperty(WebChatMiddlewareConstants, "timeBetweenTimestampGroups", 300000);
|
|
152
|
+
//5 minutes
|
|
133
153
|
_defineProperty(WebChatMiddlewareConstants, "maxTextLength", 6000);
|
|
134
154
|
_defineProperty(WebChatMiddlewareConstants, "adaptiveCard", "AdaptiveCard");
|
|
135
155
|
export class AMSConstants {}
|
|
136
156
|
_defineProperty(AMSConstants, "supportedImagesMimeTypes", ["image/jpeg", "image/png", "image/gif", "image/heic", "image/webp"]);
|
|
137
157
|
_defineProperty(AMSConstants, "maxSupportedImageSize", 20);
|
|
158
|
+
// AMS max file limit outside of supported Images MIME Types.
|
|
138
159
|
_defineProperty(AMSConstants, "maxSupportedFileSize", 300);
|
|
139
160
|
export class MimeTypes {}
|
|
140
161
|
_defineProperty(MimeTypes, "UnknownFileType", "application/octet-stream");
|
|
@@ -169,6 +190,29 @@ export let LiveWorkItemState;
|
|
|
169
190
|
LiveWorkItemState["Waiting"] = "Waiting";
|
|
170
191
|
LiveWorkItemState["WrapUp"] = "WrapUp";
|
|
171
192
|
})(LiveWorkItemState || (LiveWorkItemState = {}));
|
|
193
|
+
export let StorageType;
|
|
194
|
+
(function (StorageType) {
|
|
195
|
+
StorageType[StorageType["localStorage"] = 0] = "localStorage";
|
|
196
|
+
StorageType[StorageType["sessionStorage"] = 1] = "sessionStorage";
|
|
197
|
+
})(StorageType || (StorageType = {}));
|
|
198
|
+
export let ParticipantType;
|
|
199
|
+
(function (ParticipantType) {
|
|
200
|
+
ParticipantType["User"] = "User";
|
|
201
|
+
ParticipantType["Bot"] = "Bot";
|
|
202
|
+
})(ParticipantType || (ParticipantType = {}));
|
|
203
|
+
export let ConversationEndEntity;
|
|
204
|
+
(function (ConversationEndEntity) {
|
|
205
|
+
ConversationEndEntity["Customer"] = "Customer";
|
|
206
|
+
ConversationEndEntity["Agent"] = "Agent";
|
|
207
|
+
ConversationEndEntity["Bot"] = "Bot";
|
|
208
|
+
ConversationEndEntity["NotSet"] = "NotSet";
|
|
209
|
+
})(ConversationEndEntity || (ConversationEndEntity = {}));
|
|
210
|
+
export let ConfirmationState;
|
|
211
|
+
(function (ConfirmationState) {
|
|
212
|
+
ConfirmationState["Ok"] = "Ok";
|
|
213
|
+
ConfirmationState["Cancel"] = "Cancel";
|
|
214
|
+
ConfirmationState["NotSet"] = "NotSet";
|
|
215
|
+
})(ConfirmationState || (ConfirmationState = {}));
|
|
172
216
|
export class TranscriptConstants {}
|
|
173
217
|
_defineProperty(TranscriptConstants, "ChatTranscriptsBodyColor", "#F5F5F5");
|
|
174
218
|
_defineProperty(TranscriptConstants, "TranscriptMessageEmojiMessageType", "http://schema.skype.com/emoji");
|
|
@@ -181,11 +225,16 @@ _defineProperty(TranscriptConstants, "InternalMode", "internal");
|
|
|
181
225
|
_defineProperty(TranscriptConstants, "AgentDialogColor", "#2266E3");
|
|
182
226
|
_defineProperty(TranscriptConstants, "AgentFontColor", "white");
|
|
183
227
|
export class AriaTelemetryConstants {}
|
|
228
|
+
// Aria Endpoint for different environment types.
|
|
184
229
|
_defineProperty(AriaTelemetryConstants, "GERMANY_ENDPOINT", "https://de.pipe.aria.microsoft.com/Collector/3.0/");
|
|
185
230
|
_defineProperty(AriaTelemetryConstants, "GCCH_ENDPOINT", "https://tb.pipe.aria.microsoft.com/Collector/3.0/");
|
|
186
231
|
_defineProperty(AriaTelemetryConstants, "DOD_ENDPOINT", "https://pf.pipe.aria.microsoft.com/Collector/3.0");
|
|
187
232
|
_defineProperty(AriaTelemetryConstants, "EUROPE_ENDPOINT", "https://eu-mobile.events.data.microsoft.com/Collector/3.0/");
|
|
233
|
+
// EUDB Collector URL
|
|
188
234
|
_defineProperty(AriaTelemetryConstants, "MOONCAKE_ENDPOINT", "");
|
|
235
|
+
// Add MoonCake ARIA Endpoint whenever available
|
|
236
|
+
// Environment types
|
|
189
237
|
_defineProperty(AriaTelemetryConstants, "Public", "Public");
|
|
190
238
|
_defineProperty(AriaTelemetryConstants, "EU", "Europe");
|
|
239
|
+
// EUR: crm4; FRA: crm12; GER: crm16; CHE: crm17; NOR: crm19
|
|
191
240
|
_defineProperty(AriaTelemetryConstants, "lcwEUDomainNames", ["crm4.omnichannelengagementhub.com", "crm12.omnichannelengagementhub.com", "crm16.omnichannelengagementhub.com", "crm17.omnichannelengagementhub.com", "crm19.omnichannelengagementhub.com"]);
|
|
@@ -2,15 +2,16 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
2
2
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
3
|
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); }
|
|
4
4
|
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
5
|
-
import { getWidgetCacheId } from "../../utils";
|
|
6
5
|
import { defaultClientDataStoreProvider } from "./defaultClientDataStoreProvider";
|
|
7
6
|
export class defaultCacheManager {}
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
10
|
_defineProperty(defaultCacheManager, "InternalCache", {});
|
|
9
|
-
export const
|
|
10
|
-
const widgetCacheId = getWidgetCacheId(orgid, widgetId, widgetInstanceId);
|
|
11
|
+
export const registerBroadcastServiceForStorage = (widgetCacheId, ttlInMins, storageType) => {
|
|
11
12
|
BroadcastService.getMessageByEventName(widgetCacheId).subscribe(msg => {
|
|
12
13
|
try {
|
|
13
|
-
defaultClientDataStoreProvider(ttlInMins).setData(widgetCacheId, JSON.stringify(msg.payload)
|
|
14
|
+
defaultClientDataStoreProvider(ttlInMins, storageType).setData(widgetCacheId, JSON.stringify(msg.payload));
|
|
14
15
|
} catch (error) {
|
|
15
16
|
console.error("Error in setting data to localstorage", error);
|
|
16
17
|
}
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
import { LogLevel, TelemetryEvent } from "../../telemetry/TelemetryConstants";
|
|
4
4
|
import { TelemetryHelper } from "../../telemetry/TelemetryHelper";
|
|
5
5
|
import { inMemoryDataStore } from "./defaultInMemoryDataStore";
|
|
6
|
+
import { StorageType } from "../../Constants";
|
|
6
7
|
export const defaultClientDataStoreProvider = function () {
|
|
7
8
|
let cacheTtlinMins = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
9
|
+
let storageType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : StorageType.localStorage;
|
|
8
10
|
let ttlInMs = 0;
|
|
9
11
|
const isCookieAllowed = () => {
|
|
10
12
|
try {
|
|
@@ -24,7 +26,7 @@ export const defaultClientDataStoreProvider = function () {
|
|
|
24
26
|
}
|
|
25
27
|
const dataStoreProvider = {
|
|
26
28
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
-
setData: (key, data
|
|
29
|
+
setData: (key, data) => {
|
|
28
30
|
if (isCookieAllowed()) {
|
|
29
31
|
try {
|
|
30
32
|
if (key) {
|
|
@@ -34,7 +36,7 @@ export const defaultClientDataStoreProvider = function () {
|
|
|
34
36
|
expiry: now.getTime() + ttlInMs
|
|
35
37
|
};
|
|
36
38
|
const strItem = JSON.stringify(item);
|
|
37
|
-
if (
|
|
39
|
+
if (storageType === StorageType.localStorage) {
|
|
38
40
|
localStorage.setItem(key, strItem);
|
|
39
41
|
} else {
|
|
40
42
|
sessionStorage.setItem(key, strItem);
|
|
@@ -51,16 +53,16 @@ export const defaultClientDataStoreProvider = function () {
|
|
|
51
53
|
const dataToCache = {
|
|
52
54
|
key: key,
|
|
53
55
|
data: data,
|
|
54
|
-
type:
|
|
56
|
+
type: storageType == StorageType.localStorage ? "localStorage" : "sessionStorage"
|
|
55
57
|
};
|
|
56
58
|
parent.postMessage(dataToCache, "*");
|
|
57
59
|
}
|
|
58
60
|
},
|
|
59
61
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60
|
-
getData:
|
|
62
|
+
getData: key => {
|
|
61
63
|
if (isCookieAllowed()) {
|
|
62
64
|
let item;
|
|
63
|
-
if (
|
|
65
|
+
if (storageType === StorageType.localStorage) {
|
|
64
66
|
item = localStorage.getItem(key);
|
|
65
67
|
} else {
|
|
66
68
|
item = sessionStorage.getItem(key);
|
|
@@ -85,10 +87,10 @@ export const defaultClientDataStoreProvider = function () {
|
|
|
85
87
|
}
|
|
86
88
|
},
|
|
87
89
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
88
|
-
removeData:
|
|
90
|
+
removeData: key => {
|
|
89
91
|
if (isCookieAllowed()) {
|
|
90
92
|
if (key) {
|
|
91
|
-
if (
|
|
93
|
+
if (storageType === StorageType.localStorage) {
|
|
92
94
|
return localStorage.removeItem(key);
|
|
93
95
|
} else {
|
|
94
96
|
return sessionStorage.removeItem(key);
|
|
@@ -54,6 +54,8 @@ export let BroadcastEvent;
|
|
|
54
54
|
BroadcastEvent["SigninCardReceived"] = "SignInCardReceived";
|
|
55
55
|
BroadcastEvent["BotAuthConfigRequest"] = "BotAuthConfigRequest";
|
|
56
56
|
BroadcastEvent["BotAuthConfigResponse"] = "BotAuthConfigResponse";
|
|
57
|
+
BroadcastEvent["RemoveWidgetDataFromCache"] = "RemoveWidgetDataFromCache";
|
|
58
|
+
BroadcastEvent["InitiateStartChatInPopoutMode"] = "InitiateStartChatInPopoutMode";
|
|
57
59
|
BroadcastEvent["HideChatVisibilityChangeEvent"] = "hideChatVisibilityChangeEvent";
|
|
58
60
|
BroadcastEvent["UpdateSessionDataForTelemetry"] = "UpdateSessionDataForTelemetry";
|
|
59
61
|
BroadcastEvent["UpdateConversationDataForTelemetry"] = "UpdateConversationDataForTelemetry";
|
|
@@ -89,13 +91,17 @@ export let TelemetryEvent;
|
|
|
89
91
|
TelemetryEvent["CallingSDKInitFailed"] = "CallingSDKInitFailed";
|
|
90
92
|
TelemetryEvent["CallingSDKLoadSuccess"] = "CallingSDKLoadSuccess";
|
|
91
93
|
TelemetryEvent["CallingSDKLoadFailed"] = "CallingSDKLoadFailed";
|
|
94
|
+
TelemetryEvent["GetConversationDetailsCallStarted"] = "GetConversationDetailsCallStarted";
|
|
92
95
|
TelemetryEvent["GetConversationDetailsCallFailed"] = "GetConversationDetailsCallFailed";
|
|
93
96
|
TelemetryEvent["EndChatSDKCallFailed"] = "EndChatSDKCallFailed";
|
|
97
|
+
TelemetryEvent["GetChatReconnectContextSDKCallStarted"] = "GetChatReconnectContextSDKCallStarted";
|
|
94
98
|
TelemetryEvent["GetChatReconnectContextSDKCallFailed"] = "GetChatReconnectContextSDKCallFailed";
|
|
95
99
|
TelemetryEvent["ParseAdaptiveCardFailed"] = "ParseAdaptiveCardFailed";
|
|
96
100
|
TelemetryEvent["ClientDataStoreProviderFailed"] = "ClientDataStoreProviderFailed";
|
|
97
101
|
TelemetryEvent["InMemoryDataStoreFailed"] = "InMemoryDataStoreFailed";
|
|
98
102
|
TelemetryEvent["ChatVisibilityChanged"] = "ChatVisibilityChanged";
|
|
103
|
+
TelemetryEvent["EndChatSucceeded"] = "EndChatSucceeded";
|
|
104
|
+
TelemetryEvent["EndChatFailed"] = "EndChatFailed";
|
|
99
105
|
TelemetryEvent["WebChatLoaded"] = "WebChatLoaded";
|
|
100
106
|
TelemetryEvent["LCWChatButtonClicked"] = "LCWChatButtonClicked";
|
|
101
107
|
TelemetryEvent["LCWChatButtonShow"] = "LCWChatButtonShow";
|
package/lib/esm/common/utils.js
CHANGED
|
@@ -258,7 +258,11 @@ export const getDomain = hostValue => {
|
|
|
258
258
|
}
|
|
259
259
|
return AriaTelemetryConstants.Public;
|
|
260
260
|
};
|
|
261
|
-
export const getWidgetCacheId = (orgId, widgetId, widgetInstanceId)
|
|
261
|
+
export const getWidgetCacheId = function (orgId, widgetId, widgetInstanceId) {
|
|
262
|
+
let popoutChat = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
263
|
+
if (popoutChat) {
|
|
264
|
+
widgetInstanceId = widgetInstanceId + Constants.PopoutCacheSuffix;
|
|
265
|
+
}
|
|
262
266
|
const widgetCacheId = `${widgetInstanceId}_${orgId}_${widgetId}`;
|
|
263
267
|
return Md5.init(widgetCacheId);
|
|
264
268
|
};
|
|
@@ -270,13 +274,13 @@ export const getWidgetEndChatEventName = (orgId, widgetId, widgetInstanceId) =>
|
|
|
270
274
|
};
|
|
271
275
|
|
|
272
276
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
273
|
-
export const getStateFromCache =
|
|
277
|
+
export const getStateFromCache = widgetCacheId => {
|
|
274
278
|
// Getting updated state from cache
|
|
275
279
|
try {
|
|
276
280
|
if (DataStoreManager.clientDataStore) {
|
|
277
281
|
var _DataStoreManager$cli;
|
|
278
|
-
const widgetStateEventName =
|
|
279
|
-
const widgetStateFromCache = (_DataStoreManager$cli = DataStoreManager.clientDataStore) === null || _DataStoreManager$cli === void 0 ? void 0 : _DataStoreManager$cli.getData(widgetStateEventName
|
|
282
|
+
const widgetStateEventName = widgetCacheId;
|
|
283
|
+
const widgetStateFromCache = (_DataStoreManager$cli = DataStoreManager.clientDataStore) === null || _DataStoreManager$cli === void 0 ? void 0 : _DataStoreManager$cli.getData(widgetStateEventName);
|
|
280
284
|
const persistedState = widgetStateFromCache ? JSON.parse(widgetStateFromCache) : undefined;
|
|
281
285
|
return persistedState;
|
|
282
286
|
} else {
|
|
@@ -308,6 +312,23 @@ export const getBroadcastChannelName = (widgetId, widgetInstanceId) => {
|
|
|
308
312
|
return widgetInstanceId && !isNullOrEmptyString(widgetInstanceId) ? `${widgetInstanceId}_${widgetId}` : widgetId;
|
|
309
313
|
};
|
|
310
314
|
|
|
315
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
316
|
+
export const getWidgetCacheIdfromProps = function (props) {
|
|
317
|
+
var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$controlProps, _props$controlProps2;
|
|
318
|
+
let popoutChat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
319
|
+
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;
|
|
320
|
+
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;
|
|
321
|
+
let widgetInstanceId = (props === null || props === void 0 ? void 0 : (_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.widgetInstanceId) ?? "";
|
|
322
|
+
if (props.useSessionStorage) {
|
|
323
|
+
widgetInstanceId = widgetInstanceId + Constants.SessionCacheSuffix;
|
|
324
|
+
}
|
|
325
|
+
if (props !== null && props !== void 0 && (_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.hideStartChatButton || popoutChat === true) {
|
|
326
|
+
popoutChat = true;
|
|
327
|
+
}
|
|
328
|
+
const widgetCacheId = getWidgetCacheId(orgId, widgetId, widgetInstanceId, popoutChat);
|
|
329
|
+
return widgetCacheId;
|
|
330
|
+
};
|
|
331
|
+
|
|
311
332
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
312
333
|
export const debounceLeading = function (fn) {
|
|
313
334
|
let ms = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3000;
|
|
@@ -5,9 +5,8 @@ import { findAllFocusableElement, findParentFocusableElementsWithoutChildContain
|
|
|
5
5
|
import { DimLayer } from "../dimlayer/DimLayer";
|
|
6
6
|
import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
|
|
7
7
|
import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
8
|
-
import useChatAdapterStore from "../../hooks/useChatAdapterStore";
|
|
9
8
|
import useChatContextStore from "../../hooks/useChatContextStore";
|
|
10
|
-
import {
|
|
9
|
+
import { ConfirmationState } from "../../common/Constants";
|
|
11
10
|
|
|
12
11
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
12
|
export const ConfirmationPaneStateful = props => {
|
|
@@ -15,7 +14,6 @@ export const ConfirmationPaneStateful = props => {
|
|
|
15
14
|
let elements = [];
|
|
16
15
|
const [state, dispatch] = useChatContextStore();
|
|
17
16
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
18
|
-
const [adapter] = useChatAdapterStore();
|
|
19
17
|
const controlProps = {
|
|
20
18
|
id: "oc-lcw-confirmation-pane",
|
|
21
19
|
dir: state.domainStates.globalDir,
|
|
@@ -28,11 +26,11 @@ export const ConfirmationPaneStateful = props => {
|
|
|
28
26
|
type: LiveChatWidgetActionType.SET_SHOW_CONFIRMATION,
|
|
29
27
|
payload: false
|
|
30
28
|
});
|
|
31
|
-
setTabIndices(elements, initialTabIndexMap, true);
|
|
32
29
|
dispatch({
|
|
33
|
-
type: LiveChatWidgetActionType.
|
|
34
|
-
payload:
|
|
30
|
+
type: LiveChatWidgetActionType.SET_CONFIRMATION_STATE,
|
|
31
|
+
payload: ConfirmationState.Ok
|
|
35
32
|
});
|
|
33
|
+
setTabIndices(elements, initialTabIndexMap, true);
|
|
36
34
|
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
37
35
|
Event: TelemetryEvent.ConversationEndedByCustomer,
|
|
38
36
|
Description: "Conversation is ended by customer."
|
|
@@ -47,6 +45,10 @@ export const ConfirmationPaneStateful = props => {
|
|
|
47
45
|
type: LiveChatWidgetActionType.SET_SHOW_CONFIRMATION,
|
|
48
46
|
payload: false
|
|
49
47
|
});
|
|
48
|
+
dispatch({
|
|
49
|
+
type: LiveChatWidgetActionType.SET_CONFIRMATION_STATE,
|
|
50
|
+
payload: ConfirmationState.Cancel
|
|
51
|
+
});
|
|
50
52
|
const previousFocusedElementId = state.appStates.previousElementIdOnFocusBeforeModalOpen;
|
|
51
53
|
if (previousFocusedElementId) {
|
|
52
54
|
setFocusOnElement("#" + previousFocusedElementId);
|
|
@@ -36,7 +36,7 @@ export const FooterStateful = props => {
|
|
|
36
36
|
Event: TelemetryEvent.DownloadTranscriptButtonClicked,
|
|
37
37
|
Description: "Download Transcript button clicked."
|
|
38
38
|
});
|
|
39
|
-
await 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);
|
|
39
|
+
await 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);
|
|
40
40
|
} catch (ex) {
|
|
41
41
|
TelemetryHelper.logActionEvent(LogLevel.ERROR, {
|
|
42
42
|
Event: TelemetryEvent.DownloadTranscriptFailed,
|
package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js
CHANGED
|
@@ -151,8 +151,15 @@ const beautifyChatTranscripts = (chatTranscripts, renderMarkDown, attachmentMess
|
|
|
151
151
|
};
|
|
152
152
|
|
|
153
153
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
154
|
-
export const downloadTranscript = async (chatSDK, renderMarkDown, bannerMessageOnError, attachmentMessage) => {
|
|
154
|
+
export const downloadTranscript = async (chatSDK, renderMarkDown, bannerMessageOnError, attachmentMessage, state) => {
|
|
155
|
+
var _state$domainStates, _state$domainStates2, _state$domainStates2$;
|
|
156
|
+
// Need to keep existing request id for scenarios when trnascript is downloaded after endchat
|
|
157
|
+
const existingRequestId = chatSDK.requestId;
|
|
158
|
+
chatSDK.chatToken = state === null || state === void 0 ? void 0 : (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : _state$domainStates.chatToken;
|
|
159
|
+
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;
|
|
155
160
|
let data = await (chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.getLiveChatTranscript());
|
|
161
|
+
// This is used for allowing to start next chat
|
|
162
|
+
chatSDK.requestId = existingRequestId;
|
|
156
163
|
if (typeof data === Constants.String) {
|
|
157
164
|
data = JSON.parse(data);
|
|
158
165
|
}
|
|
@@ -7,9 +7,9 @@ import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
|
7
7
|
import { defaultOutOfOfficeHeaderStyleProps } from "./common/styleProps/defaultOutOfOfficeHeaderStyleProps";
|
|
8
8
|
import useChatAdapterStore from "../../hooks/useChatAdapterStore";
|
|
9
9
|
import useChatContextStore from "../../hooks/useChatContextStore";
|
|
10
|
-
import {
|
|
10
|
+
import { ConfirmationState } from "../../common/Constants";
|
|
11
11
|
export const HeaderStateful = props => {
|
|
12
|
-
var _state$domainStates$l, _state$domainStates$l2, _headerProps$controlP, _headerProps$controlP2, _headerProps$controlP3, _outOfOfficeHeaderPro;
|
|
12
|
+
var _state$domainStates$l, _state$domainStates$l2, _state$domainStates, _headerProps$controlP, _headerProps$controlP2, _headerProps$controlP3, _outOfOfficeHeaderPro, _state$domainStates3;
|
|
13
13
|
const [state, dispatch] = useChatContextStore();
|
|
14
14
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
15
|
const [adapter] = useChatAdapterStore();
|
|
@@ -21,8 +21,9 @@ export const HeaderStateful = props => {
|
|
|
21
21
|
//Setting OutOfOperatingHours Flag
|
|
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
|
-
|
|
25
|
-
|
|
24
|
+
|
|
25
|
+
// For some reason state object is not getting updated values in this component
|
|
26
|
+
const localConfirmationPaneState = useRef(state === null || state === void 0 ? void 0 : (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : _state$domainStates.confirmationState);
|
|
26
27
|
const controlProps = {
|
|
27
28
|
id: "oc-lcw-header",
|
|
28
29
|
dir: state.domainStates.globalDir,
|
|
@@ -42,7 +43,7 @@ export const HeaderStateful = props => {
|
|
|
42
43
|
Event: TelemetryEvent.HeaderCloseButtonClicked,
|
|
43
44
|
Description: "Header Close button clicked."
|
|
44
45
|
});
|
|
45
|
-
if (
|
|
46
|
+
if (localConfirmationPaneState.current !== ConfirmationState.Ok) {
|
|
46
47
|
dispatch({
|
|
47
48
|
type: LiveChatWidgetActionType.SET_SHOW_CONFIRMATION,
|
|
48
49
|
payload: true
|
|
@@ -62,9 +63,9 @@ export const HeaderStateful = props => {
|
|
|
62
63
|
}
|
|
63
64
|
},
|
|
64
65
|
...(headerProps === null || headerProps === void 0 ? void 0 : headerProps.controlProps),
|
|
65
|
-
hideTitle: state.appStates.conversationState === ConversationState.Loading && !state.appStates.
|
|
66
|
-
hideIcon: state.appStates.conversationState === ConversationState.Loading && !state.appStates.
|
|
67
|
-
hideCloseButton: state.appStates.conversationState === ConversationState.Loading && !state.appStates.
|
|
66
|
+
hideTitle: state.appStates.conversationState === ConversationState.Loading && !state.appStates.startChatFailed || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP = headerProps.controlProps) === null || _headerProps$controlP === void 0 ? void 0 : _headerProps$controlP.hideTitle),
|
|
67
|
+
hideIcon: state.appStates.conversationState === ConversationState.Loading && !state.appStates.startChatFailed || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP2 = headerProps.controlProps) === null || _headerProps$controlP2 === void 0 ? void 0 : _headerProps$controlP2.hideIcon),
|
|
68
|
+
hideCloseButton: state.appStates.conversationState === ConversationState.Loading && !state.appStates.startChatFailed || state.appStates.conversationState === ConversationState.PostchatLoading || state.appStates.conversationState === ConversationState.Prechat || state.appStates.conversationState === ConversationState.ReconnectChat || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP3 = headerProps.controlProps) === null || _headerProps$controlP3 === void 0 ? void 0 : _headerProps$controlP3.hideCloseButton)
|
|
68
69
|
};
|
|
69
70
|
const outOfOfficeControlProps = {
|
|
70
71
|
id: "oc-lcw-header",
|
|
@@ -85,11 +86,11 @@ export const HeaderStateful = props => {
|
|
|
85
86
|
if (state.appStates.outsideOperatingHours) {
|
|
86
87
|
setOutOfOperatingHours(true);
|
|
87
88
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}, [state.
|
|
89
|
+
}, []);
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
var _state$domainStates2;
|
|
92
|
+
localConfirmationPaneState.current = state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : _state$domainStates2.confirmationState;
|
|
93
|
+
}, [state === null || state === void 0 ? void 0 : (_state$domainStates3 = state.domainStates) === null || _state$domainStates3 === void 0 ? void 0 : _state$domainStates3.confirmationState]);
|
|
93
94
|
return /*#__PURE__*/React.createElement(Header, {
|
|
94
95
|
componentOverrides: headerProps === null || headerProps === void 0 ? void 0 : headerProps.componentOverrides,
|
|
95
96
|
controlProps: outOfOperatingHours || state.appStates.conversationState === ConversationState.OutOfOffice ? outOfOfficeControlProps : controlProps,
|
package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js
CHANGED
|
@@ -3,6 +3,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
|
|
|
3
3
|
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); }
|
|
4
4
|
export class DefaultActivitySubscriber {
|
|
5
5
|
constructor() {
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
7
|
_defineProperty(this, "observer", void 0);
|
|
7
8
|
}
|
|
8
9
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js
CHANGED
|
@@ -4,6 +4,7 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
|
4
4
|
import { ActivityStreamHandler } from "../ActivityStreamHandler";
|
|
5
5
|
export class PauseActivitySubscriber {
|
|
6
6
|
constructor() {
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
8
|
_defineProperty(this, "observer", void 0);
|
|
8
9
|
}
|
|
9
10
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -10,9 +10,11 @@ export class Deferred {
|
|
|
10
10
|
_defineProperty(this, "_reject", () => {
|
|
11
11
|
return;
|
|
12
12
|
});
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
14
|
_defineProperty(this, "resolve", value => {
|
|
14
15
|
this._resolve(value);
|
|
15
16
|
});
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
18
|
_defineProperty(this, "reject", value => {
|
|
17
19
|
this._reject(value);
|
|
18
20
|
});
|
|
@@ -21,9 +23,6 @@ export class Deferred {
|
|
|
21
23
|
this._reject = reject;
|
|
22
24
|
});
|
|
23
25
|
}
|
|
24
|
-
|
|
25
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
|
-
|
|
27
26
|
get promise() {
|
|
28
27
|
return this._promise;
|
|
29
28
|
}
|
|
@@ -1785,8 +1785,10 @@ export const dummyDefaultProps = {
|
|
|
1785
1785
|
adaptiveCardStyles: {
|
|
1786
1786
|
background: "white",
|
|
1787
1787
|
color: "black"
|
|
1788
|
-
}
|
|
1788
|
+
},
|
|
1789
|
+
hyperlinkTextOverride: false
|
|
1789
1790
|
},
|
|
1790
1791
|
telemetryConfig: undefined,
|
|
1791
|
-
getAuthToken: undefined
|
|
1792
|
+
getAuthToken: undefined,
|
|
1793
|
+
initialCustomContext: undefined
|
|
1792
1794
|
};
|