@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.
Files changed (34) hide show
  1. package/lib/cjs/common/telemetry/TelemetryConstants.js +1 -0
  2. package/lib/cjs/common/utils.js +15 -6
  3. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +29 -24
  4. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +3 -6
  5. package/lib/cjs/components/livechatwidget/common/authHelper.js +4 -1
  6. package/lib/cjs/components/livechatwidget/common/endChat.js +9 -30
  7. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +13 -3
  8. package/lib/cjs/components/livechatwidget/common/startChat.js +35 -19
  9. package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +5 -0
  10. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +53 -53
  11. package/lib/cjs/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +4 -2
  12. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +1 -0
  13. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +10 -0
  14. package/lib/cjs/contexts/createReducer.js +653 -345
  15. package/lib/esm/common/telemetry/TelemetryConstants.js +1 -0
  16. package/lib/esm/common/utils.js +12 -4
  17. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +30 -25
  18. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +3 -6
  19. package/lib/esm/components/livechatwidget/common/authHelper.js +4 -1
  20. package/lib/esm/components/livechatwidget/common/endChat.js +10 -31
  21. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +15 -4
  22. package/lib/esm/components/livechatwidget/common/startChat.js +35 -19
  23. package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +5 -0
  24. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +53 -53
  25. package/lib/esm/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +4 -2
  26. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +1 -0
  27. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +10 -0
  28. package/lib/esm/contexts/createReducer.js +650 -343
  29. package/lib/types/common/telemetry/TelemetryConstants.d.ts +2 -1
  30. package/lib/types/common/utils.d.ts +2 -1
  31. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +1 -1
  32. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +2 -1
  33. package/lib/types/contexts/createReducer.d.ts +1 -0
  34. package/package.json +6 -4
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.isMaskingforCustomer = void 0;
7
+ var _utils = require("../../../../common/utils");
7
8
  const isMaskingforCustomer = maskingInfo => {
8
9
  var _maskingInfo$setting;
9
10
  // If the masking info (containing masking setting and masking rules) is missing or empty, return false.
@@ -14,8 +15,9 @@ const isMaskingforCustomer = maskingInfo => {
14
15
 
15
16
  // If the masking rules are provided and;
16
17
  // If the masking setting is NOT null and masking for customer is NOT null, return the configuration
17
- if ((_maskingInfo$setting = maskingInfo.setting) !== null && _maskingInfo$setting !== void 0 && _maskingInfo$setting.msdyn_maskforcustomer) {
18
- return maskingInfo.setting.msdyn_maskforcustomer;
18
+ if (!(0, _utils.isNullOrUndefined)((_maskingInfo$setting = maskingInfo.setting) === null || _maskingInfo$setting === void 0 ? void 0 : _maskingInfo$setting.msdyn_maskforcustomer)) {
19
+ var _maskingInfo$setting2;
20
+ return (0, _utils.parseLowerCaseString)(maskingInfo === null || maskingInfo === void 0 ? void 0 : (_maskingInfo$setting2 = maskingInfo.setting) === null || _maskingInfo$setting2 === void 0 ? void 0 : _maskingInfo$setting2.msdyn_maskforcustomer) === "true";
19
21
  }
20
22
 
21
23
  // 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)
@@ -52,4 +52,5 @@ exports.LiveChatWidgetActionType = LiveChatWidgetActionType;
52
52
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SURVEY_MODE"] = 42] = "SET_SURVEY_MODE";
53
53
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONFIRMATION_STATE"] = 43] = "SET_CONFIRMATION_STATE";
54
54
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_PARTICIPANT_TYPE"] = 44] = "SET_POST_CHAT_PARTICIPANT_TYPE";
55
+ LiveChatWidgetActionType[LiveChatWidgetActionType["GET_IN_MEMORY_STATE"] = 45] = "GET_IN_MEMORY_STATE";
55
56
  })(LiveChatWidgetActionType || (exports.LiveChatWidgetActionType = LiveChatWidgetActionType = {}));
@@ -18,6 +18,16 @@ const getLiveChatWidgetContextInitialState = props => {
18
18
  const initialState = (0, _defaultClientDataStoreProvider.defaultClientDataStoreProvider)(cacheTtlInMins, storageType).getData(widgetCacheId);
19
19
  if (!(0, _utils.isNullOrUndefined)(initialState)) {
20
20
  const initialStateFromCache = JSON.parse(initialState);
21
+
22
+ /*
23
+ * 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
24
+ * and it will be blocking all elements behind it
25
+ * as part of the flow, the pre-chat will be detected and then it will be displayed properly
26
+ * this case is only and only for pre-chat pane.
27
+ * **/
28
+ if (initialStateFromCache.appStates.conversationState === _ConversationState.ConversationState.Prechat) {
29
+ initialStateFromCache.appStates.conversationState = _ConversationState.ConversationState.Closed;
30
+ }
21
31
  return initialStateFromCache;
22
32
  }
23
33
  const LiveChatWidgetContextInitialState = {