@microsoft/omnichannel-chat-widget 1.6.2 → 1.6.3-main.24dce14
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/telemetry/TelemetryConstants.js +1 -0
- package/lib/cjs/common/utils.js +15 -6
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +29 -24
- package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +3 -6
- package/lib/cjs/components/livechatwidget/common/authHelper.js +4 -1
- package/lib/cjs/components/livechatwidget/common/endChat.js +9 -30
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +13 -3
- package/lib/cjs/components/livechatwidget/common/startChat.js +35 -19
- package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +5 -0
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +53 -53
- package/lib/cjs/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +4 -2
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +1 -0
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +10 -0
- package/lib/cjs/contexts/createReducer.js +653 -345
- package/lib/esm/common/telemetry/TelemetryConstants.js +1 -0
- package/lib/esm/common/utils.js +12 -4
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +30 -25
- package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +3 -6
- package/lib/esm/components/livechatwidget/common/authHelper.js +4 -1
- package/lib/esm/components/livechatwidget/common/endChat.js +10 -31
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +15 -4
- package/lib/esm/components/livechatwidget/common/startChat.js +35 -19
- package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +5 -0
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +53 -53
- package/lib/esm/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +4 -2
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +1 -0
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +10 -0
- package/lib/esm/contexts/createReducer.js +650 -343
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +2 -1
- package/lib/types/common/utils.d.ts +2 -1
- package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +1 -1
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +2 -1
- package/lib/types/contexts/createReducer.d.ts +1 -0
- package/package.json +6 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isNullOrUndefined, parseLowerCaseString } from "../../../../common/utils";
|
|
1
2
|
export const isMaskingforCustomer = maskingInfo => {
|
|
2
3
|
var _maskingInfo$setting;
|
|
3
4
|
// If the masking info (containing masking setting and masking rules) is missing or empty, return false.
|
|
@@ -8,8 +9,9 @@ export const isMaskingforCustomer = maskingInfo => {
|
|
|
8
9
|
|
|
9
10
|
// If the masking rules are provided and;
|
|
10
11
|
// If the masking setting is NOT null and masking for customer is NOT null, return the configuration
|
|
11
|
-
if ((_maskingInfo$setting = maskingInfo.setting)
|
|
12
|
-
|
|
12
|
+
if (!isNullOrUndefined((_maskingInfo$setting = maskingInfo.setting) === null || _maskingInfo$setting === void 0 ? void 0 : _maskingInfo$setting.msdyn_maskforcustomer)) {
|
|
13
|
+
var _maskingInfo$setting2;
|
|
14
|
+
return parseLowerCaseString(maskingInfo === null || maskingInfo === void 0 ? void 0 : (_maskingInfo$setting2 = maskingInfo.setting) === null || _maskingInfo$setting2 === void 0 ? void 0 : _maskingInfo$setting2.msdyn_maskforcustomer) === "true";
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
// In all other cases, even if masking setting is missing, return true to apply the masking for backward compatibility (i.e. in old versions, OC does not have masking info settings)
|
|
@@ -45,4 +45,5 @@ export let LiveChatWidgetActionType;
|
|
|
45
45
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SURVEY_MODE"] = 42] = "SET_SURVEY_MODE";
|
|
46
46
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONFIRMATION_STATE"] = 43] = "SET_CONFIRMATION_STATE";
|
|
47
47
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_PARTICIPANT_TYPE"] = 44] = "SET_POST_CHAT_PARTICIPANT_TYPE";
|
|
48
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["GET_IN_MEMORY_STATE"] = 45] = "GET_IN_MEMORY_STATE";
|
|
48
49
|
})(LiveChatWidgetActionType || (LiveChatWidgetActionType = {}));
|
|
@@ -12,6 +12,16 @@ export const getLiveChatWidgetContextInitialState = props => {
|
|
|
12
12
|
const initialState = defaultClientDataStoreProvider(cacheTtlInMins, storageType).getData(widgetCacheId);
|
|
13
13
|
if (!isNullOrUndefined(initialState)) {
|
|
14
14
|
const initialStateFromCache = JSON.parse(initialState);
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
* this step is needed to avoid the pre-chat pane to be injected in the DOM when the widget is reloaded, because wont be visible
|
|
18
|
+
* and it will be blocking all elements behind it
|
|
19
|
+
* as part of the flow, the pre-chat will be detected and then it will be displayed properly
|
|
20
|
+
* this case is only and only for pre-chat pane.
|
|
21
|
+
* **/
|
|
22
|
+
if (initialStateFromCache.appStates.conversationState === ConversationState.Prechat) {
|
|
23
|
+
initialStateFromCache.appStates.conversationState = ConversationState.Closed;
|
|
24
|
+
}
|
|
15
25
|
return initialStateFromCache;
|
|
16
26
|
}
|
|
17
27
|
const LiveChatWidgetContextInitialState = {
|