@microsoft/omnichannel-chat-widget 1.7.3-main.2f6e3c2 → 1.7.3-main.34ea4da

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.
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = exports.FooterStateful = void 0;
7
7
  var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
8
- var _react = _interopRequireDefault(require("react"));
8
+ var _react = _interopRequireWildcard(require("react"));
9
9
  var _AudioNotificationStateful = _interopRequireDefault(require("./audionotificationstateful/AudioNotificationStateful"));
10
10
  var _Constants = require("../../common/Constants");
11
11
  var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
@@ -18,9 +18,11 @@ var _DownloadTranscriptStateful = require("./downloadtranscriptstateful/Download
18
18
  var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
19
19
  var _useChatSDKStore = _interopRequireDefault(require("../../hooks/useChatSDKStore"));
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+ 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); }
22
+ 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; }
21
23
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
24
  const FooterStateful = props => {
23
- var _footerProps$controlP3, _footerProps$controlP4;
25
+ var _footerProps$controlP3, _footerProps$controlP6;
24
26
  const [state, dispatch] = (0, _useChatContextStore.default)();
25
27
  // hideFooterDisplay - the purpose of this is to keep the footer always "active",
26
28
  // but hide it visually in certain states (e.g., loading state) and show in some other states (e.g. active state).
@@ -87,13 +89,22 @@ const FooterStateful = props => {
87
89
  isAudioMuted: state.appStates.isAudioMuted
88
90
  }
89
91
  };
92
+ (0, _react.useEffect)(() => {
93
+ if (state.appStates.isAudioMuted === null) {
94
+ var _footerProps$controlP4, _footerProps$controlP5;
95
+ dispatch({
96
+ type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_AUDIO_NOTIFICATION,
97
+ payload: (footerProps === null || footerProps === void 0 ? void 0 : (_footerProps$controlP4 = footerProps.controlProps) === null || _footerProps$controlP4 === void 0 ? void 0 : (_footerProps$controlP5 = _footerProps$controlP4.audioNotificationButtonProps) === null || _footerProps$controlP5 === void 0 ? void 0 : _footerProps$controlP5.isAudioMuted) ?? false
98
+ });
99
+ }
100
+ }, []);
90
101
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !hideFooterDisplay && /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.Footer, {
91
102
  componentOverrides: footerProps === null || footerProps === void 0 ? void 0 : footerProps.componentOverrides,
92
103
  controlProps: controlProps,
93
104
  styleProps: footerProps === null || footerProps === void 0 ? void 0 : footerProps.styleProps
94
105
  }), /*#__PURE__*/_react.default.createElement(_AudioNotificationStateful.default, {
95
106
  audioSrc: (audioNotificationProps === null || audioNotificationProps === void 0 ? void 0 : audioNotificationProps.audioSrc) ?? _Audios.NewMessageNotificationSoundBase64,
96
- isAudioMuted: state.appStates.isAudioMuted === null ? (footerProps === null || footerProps === void 0 ? void 0 : (_footerProps$controlP4 = footerProps.controlProps) === null || _footerProps$controlP4 === void 0 ? void 0 : _footerProps$controlP4.hideAudioNotificationButton) ?? false : state.appStates.isAudioMuted ?? false
107
+ isAudioMuted: state.appStates.isAudioMuted === null ? (footerProps === null || footerProps === void 0 ? void 0 : (_footerProps$controlP6 = footerProps.controlProps) === null || _footerProps$controlP6 === void 0 ? void 0 : _footerProps$controlP6.hideAudioNotificationButton) ?? false : state.appStates.isAudioMuted ?? false
97
108
  }));
98
109
  };
99
110
  exports.FooterStateful = FooterStateful;
@@ -11,7 +11,8 @@ const shouldSetPreChatIfPersistentChat = async (chatSDK, conversationMode, showP
11
11
  let skipPreChat = false;
12
12
  if (persistentEnabled) {
13
13
  const reconnectableChatsParams = {
14
- authenticatedUserToken: chatSDK.authenticatedUserToken
14
+ authenticatedUserToken: chatSDK.authenticatedUserToken,
15
+ requestId: chatSDK.requestId
15
16
  };
16
17
  try {
17
18
  const reconnectableChatsResponse = await chatSDK.OCClient.getReconnectableChats(reconnectableChatsParams);
@@ -1,5 +1,5 @@
1
1
  import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
2
- import React from "react";
2
+ import React, { useEffect } from "react";
3
3
  import AudioNotificationStateful from "./audionotificationstateful/AudioNotificationStateful";
4
4
  import { Constants } from "../../common/Constants";
5
5
  import { Footer } from "@microsoft/omnichannel-chat-components";
@@ -14,7 +14,7 @@ import useChatSDKStore from "../../hooks/useChatSDKStore";
14
14
 
15
15
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
16
  export const FooterStateful = props => {
17
- var _footerProps$controlP3, _footerProps$controlP4;
17
+ var _footerProps$controlP3, _footerProps$controlP6;
18
18
  const [state, dispatch] = useChatContextStore();
19
19
  // hideFooterDisplay - the purpose of this is to keep the footer always "active",
20
20
  // but hide it visually in certain states (e.g., loading state) and show in some other states (e.g. active state).
@@ -81,13 +81,22 @@ export const FooterStateful = props => {
81
81
  isAudioMuted: state.appStates.isAudioMuted
82
82
  }
83
83
  };
84
+ useEffect(() => {
85
+ if (state.appStates.isAudioMuted === null) {
86
+ var _footerProps$controlP4, _footerProps$controlP5;
87
+ dispatch({
88
+ type: LiveChatWidgetActionType.SET_AUDIO_NOTIFICATION,
89
+ payload: (footerProps === null || footerProps === void 0 ? void 0 : (_footerProps$controlP4 = footerProps.controlProps) === null || _footerProps$controlP4 === void 0 ? void 0 : (_footerProps$controlP5 = _footerProps$controlP4.audioNotificationButtonProps) === null || _footerProps$controlP5 === void 0 ? void 0 : _footerProps$controlP5.isAudioMuted) ?? false
90
+ });
91
+ }
92
+ }, []);
84
93
  return /*#__PURE__*/React.createElement(React.Fragment, null, !hideFooterDisplay && /*#__PURE__*/React.createElement(Footer, {
85
94
  componentOverrides: footerProps === null || footerProps === void 0 ? void 0 : footerProps.componentOverrides,
86
95
  controlProps: controlProps,
87
96
  styleProps: footerProps === null || footerProps === void 0 ? void 0 : footerProps.styleProps
88
97
  }), /*#__PURE__*/React.createElement(AudioNotificationStateful, {
89
98
  audioSrc: (audioNotificationProps === null || audioNotificationProps === void 0 ? void 0 : audioNotificationProps.audioSrc) ?? NewMessageNotificationSoundBase64,
90
- isAudioMuted: state.appStates.isAudioMuted === null ? (footerProps === null || footerProps === void 0 ? void 0 : (_footerProps$controlP4 = footerProps.controlProps) === null || _footerProps$controlP4 === void 0 ? void 0 : _footerProps$controlP4.hideAudioNotificationButton) ?? false : state.appStates.isAudioMuted ?? false
99
+ isAudioMuted: state.appStates.isAudioMuted === null ? (footerProps === null || footerProps === void 0 ? void 0 : (_footerProps$controlP6 = footerProps.controlProps) === null || _footerProps$controlP6 === void 0 ? void 0 : _footerProps$controlP6.hideAudioNotificationButton) ?? false : state.appStates.isAudioMuted ?? false
91
100
  }));
92
101
  };
93
102
  export default FooterStateful;
@@ -6,7 +6,8 @@ export const shouldSetPreChatIfPersistentChat = async (chatSDK, conversationMode
6
6
  let skipPreChat = false;
7
7
  if (persistentEnabled) {
8
8
  const reconnectableChatsParams = {
9
- authenticatedUserToken: chatSDK.authenticatedUserToken
9
+ authenticatedUserToken: chatSDK.authenticatedUserToken,
10
+ requestId: chatSDK.requestId
10
11
  };
11
12
  try {
12
13
  const reconnectableChatsResponse = await chatSDK.OCClient.getReconnectableChats(reconnectableChatsParams);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "1.7.3-main.2f6e3c2",
3
+ "version": "1.7.3-main.34ea4da",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -75,7 +75,7 @@
75
75
  },
76
76
  "dependencies": {
77
77
  "@microsoft/omnichannel-chat-components": "1.1.5",
78
- "@microsoft/omnichannel-chat-sdk": "^1.10.0",
78
+ "@microsoft/omnichannel-chat-sdk": "^1.10.1",
79
79
  "abort-controller-es5": "^2.0.1",
80
80
  "dompurify": "^2.5.4",
81
81
  "markdown-it": "^12.3.2",