@microsoft/omnichannel-chat-widget 1.2.4-main.9847fc4 → 1.3.0

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 (32) hide show
  1. package/lib/cjs/assets/Icons.js +4 -2
  2. package/lib/cjs/common/Constants.js +15 -1
  3. package/lib/cjs/common/telemetry/TelemetryConstants.js +4 -0
  4. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +9 -7
  5. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +1 -1
  6. package/lib/cjs/components/notificationpanestateful/NotificationPaneStateful.js +177 -0
  7. package/lib/cjs/components/notificationpanestateful/defaultProps/defaultChatDisconnectControlProps.js +41 -0
  8. package/lib/cjs/components/notificationpanestateful/defaultProps/defaultChatDisconnectStyleProps.js +98 -0
  9. package/lib/cjs/components/notificationpanestateful/interfaces/INotificationPaneStatefulProps.js +1 -0
  10. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.js +35 -0
  11. package/lib/esm/assets/Icons.js +2 -1
  12. package/lib/esm/common/Constants.js +13 -0
  13. package/lib/esm/common/telemetry/TelemetryConstants.js +4 -0
  14. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +9 -7
  15. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +1 -1
  16. package/lib/esm/components/notificationpanestateful/NotificationPaneStateful.js +167 -0
  17. package/lib/esm/components/notificationpanestateful/defaultProps/defaultChatDisconnectControlProps.js +34 -0
  18. package/lib/esm/components/notificationpanestateful/defaultProps/defaultChatDisconnectStyleProps.js +91 -0
  19. package/lib/esm/components/notificationpanestateful/interfaces/INotificationPaneStatefulProps.js +1 -0
  20. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.js +28 -0
  21. package/lib/types/assets/Icons.d.ts +1 -0
  22. package/lib/types/common/Constants.d.ts +14 -0
  23. package/lib/types/common/telemetry/TelemetryConstants.d.ts +2 -0
  24. package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +1 -1
  25. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -0
  26. package/lib/types/components/notificationpanestateful/NotificationPaneStateful.d.ts +3 -0
  27. package/lib/types/components/notificationpanestateful/defaultProps/defaultChatDisconnectControlProps.d.ts +2 -0
  28. package/lib/types/components/notificationpanestateful/defaultProps/defaultChatDisconnectStyleProps.d.ts +2 -0
  29. package/lib/types/components/notificationpanestateful/interfaces/INotificationPaneStatefulProps.d.ts +13 -0
  30. package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +1 -0
  31. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.d.ts +3 -0
  32. package/package.json +3 -3
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.WordIcon = exports.VisioIcon = exports.VideoIcon = exports.PowerpointIcon = exports.PDFIcon = exports.OneNoteIcon = exports.ImageIcon = exports.ExcelIcon = exports.BlankIcon = exports.AudioIcon = exports.ArchiveIcon = exports.AlertIcon = void 0;
6
+ exports.WordIcon = exports.VisioIcon = exports.VideoIcon = exports.PowerpointIcon = exports.PDFIcon = exports.OneNoteIcon = exports.NotificationAlertIcon = exports.ImageIcon = exports.ExcelIcon = exports.BlankIcon = exports.AudioIcon = exports.ArchiveIcon = exports.AlertIcon = void 0;
7
7
  const ArchiveIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMDQ4IDIwNDgiIHdpZHRoPSIxMnB4IiBoZWlnaHQ9IjEycHgiPg0KPHBhdGggZD0iTTE3OTIgMHEyNyAwIDUwIDEwdDQwIDI3IDI4IDQxIDEwIDUwdjQ4MHEwIDQ1LTkgNz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My43NUg4Ljc1VjEyLjVaIj48L3BhdGg+PC9zdmc+";
32
+ exports.NotificationAlertIcon = NotificationAlertIcon;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
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.ConversationMode = exports.ConversationEndEntity = exports.Constants = exports.ConfirmationState = exports.ChatSDKError = exports.AriaTelemetryConstants = exports.AMSConstants = void 0;
6
+ exports.WebChatMiddlewareConstants = exports.TranscriptConstants = exports.StorageType = exports.Regex = exports.ParticipantType = exports.NotificationPaneConstants = exports.MimeTypes = exports.LocaleConstants = exports.LiveWorkItemState = exports.HtmlIdNames = exports.HtmlElementSelectors = exports.HtmlClassNames = exports.HtmlAttributeNames = exports.EnvironmentVersion = exports.ElementType = exports.E2VVOptions = exports.ConversationMode = 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); }
@@ -266,6 +266,20 @@ _defineProperty(TranscriptConstants, "AdaptiveCardType", "adaptivecard");
266
266
  _defineProperty(TranscriptConstants, "InternalMode", "internal");
267
267
  _defineProperty(TranscriptConstants, "AgentDialogColor", "#2266E3");
268
268
  _defineProperty(TranscriptConstants, "AgentFontColor", "white");
269
+ class NotificationPaneConstants {}
270
+ exports.NotificationPaneConstants = NotificationPaneConstants;
271
+ _defineProperty(NotificationPaneConstants, "DefaultNotificationPaneId", "lcw-notification-pane");
272
+ _defineProperty(NotificationPaneConstants, "DismissId", "lcw-notification-pane-dismiss-button");
273
+ _defineProperty(NotificationPaneConstants, "DismissText", "Dismiss");
274
+ _defineProperty(NotificationPaneConstants, "DismissAriaLabel", "Notification dismiss");
275
+ _defineProperty(NotificationPaneConstants, "CloseChatId", "lcw-notification-pane-close-chat-button");
276
+ _defineProperty(NotificationPaneConstants, "CloseChatText", "Close Chat");
277
+ _defineProperty(NotificationPaneConstants, "CloseChatAriaLabel", "Close chat");
278
+ _defineProperty(NotificationPaneConstants, "IconId", "lcw-notification-pane-icon");
279
+ _defineProperty(NotificationPaneConstants, "IconText", "Notification Icon");
280
+ _defineProperty(NotificationPaneConstants, "ChatDisconnectTitleText", "Chat disconnected");
281
+ _defineProperty(NotificationPaneConstants, "ChatDisconnectSubtitleText", "For additional assistance, please close the chat and try again.");
282
+ _defineProperty(NotificationPaneConstants, "ChromeCloseIconName", "ChromeClose");
269
283
  class AriaTelemetryConstants {}
270
284
  exports.AriaTelemetryConstants = AriaTelemetryConstants;
271
285
  // Aria Endpoint for different environment types.
@@ -144,6 +144,8 @@ exports.TelemetryEvent = TelemetryEvent;
144
144
  TelemetryEvent["ReconnectChatPaneLoaded"] = "ReconnectChatPaneLoaded";
145
145
  TelemetryEvent["HeaderCloseButtonClicked"] = "HeaderCloseButtonClicked";
146
146
  TelemetryEvent["HeaderMinimizeButtonClicked"] = "HeaderMinimizeButtonClicked";
147
+ TelemetryEvent["NotificationCloseChatButtonClicked"] = "NotificationCloseChatButtonClicked";
148
+ TelemetryEvent["NotificationDismissButtonClicked"] = "NotificationDismissButtonClicked";
147
149
  TelemetryEvent["DownloadTranscriptButtonClicked"] = "DownloadTranscriptButtonClicked";
148
150
  TelemetryEvent["EmailTranscriptButtonClicked"] = "EmailTranscriptButtonClicked";
149
151
  TelemetryEvent["EmailTranscriptCancelButtonClicked"] = "EmailTranscriptCancelButtonClicked";
@@ -254,6 +256,8 @@ class TelemetryConstants {
254
256
  case TelemetryEvent.PreChatSurveyStartChatMethodFailed:
255
257
  case TelemetryEvent.HeaderCloseButtonClicked:
256
258
  case TelemetryEvent.HeaderMinimizeButtonClicked:
259
+ case TelemetryEvent.NotificationCloseChatButtonClicked:
260
+ case TelemetryEvent.NotificationDismissButtonClicked:
257
261
  case TelemetryEvent.MessageSent:
258
262
  case TelemetryEvent.MessageReceived:
259
263
  case TelemetryEvent.CustomContextReceived:
@@ -36,10 +36,11 @@ var _preProcessingMiddleware = _interopRequireDefault(require("../../webchatcont
36
36
  var _sanitizationMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware"));
37
37
  var _dompurify = _interopRequireDefault(require("dompurify"));
38
38
  var _messageSequenceIdOverrideMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware"));
39
+ var _toastMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware"));
39
40
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
40
41
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
- const initWebChatComposer = (props, state, dispatch, chatSDK) => {
42
- var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _props$webChatContain4, _state$domainStates$l4, _state$domainStates$l5, _props$webChatContain9, _props$webChatContain10, _state$domainStates$r, _state$domainStates$r2, _props$webChatContain11, _props$webChatContain12, _state$domainStates$r3, _state$domainStates$r4, _props$webChatContain13, _props$webChatContain14, _defaultWebChatContai, _props$webChatContain15, _props$webChatContain16, _state$domainStates$r5, _state$domainStates$r6, _props$webChatContain17, _props$webChatContain18, _defaultWebChatContai2, _props$webChatContain19, _props$webChatContain20, _defaultWebChatContai3, _props$webChatContain21, _props$webChatContain22;
42
+ const initWebChatComposer = (props, state, dispatch, chatSDK, endChat) => {
43
+ var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _props$webChatContain4, _state$domainStates$l4, _state$domainStates$l5, _props$webChatContain9, _props$webChatContain10, _state$domainStates$r, _state$domainStates$r2, _props$webChatContain11, _props$webChatContain12, _state$domainStates$r3, _state$domainStates$r4, _props$webChatContain13, _props$webChatContain14, _defaultWebChatContai, _props$webChatContain15, _props$webChatContain16, _props$webChatContain17, _props$webChatContain18, _state$domainStates$r5, _state$domainStates$r6, _props$webChatContain19, _props$webChatContain20, _defaultWebChatContai2, _props$webChatContain21, _props$webChatContain22, _defaultWebChatContai3, _props$webChatContain23, _props$webChatContain24;
43
44
  // Add a hook to make all links open a new window
44
45
  postDomPurifyActivities();
45
46
  const localizedTexts = {
@@ -114,14 +115,15 @@ const initWebChatComposer = (props, state, dispatch, chatSDK) => {
114
115
  activityMiddleware: (_props$webChatContain9 = props.webChatContainerProps) !== null && _props$webChatContain9 !== void 0 && (_props$webChatContain10 = _props$webChatContain9.renderingMiddlewareProps) !== null && _props$webChatContain10 !== void 0 && _props$webChatContain10.disableActivityMiddleware ? undefined : (0, _activityMiddleware.createActivityMiddleware)((_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.systemMessageStyleProps, (_state$domainStates$r2 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.userMessageStyleProps),
115
116
  attachmentMiddleware: (_props$webChatContain11 = props.webChatContainerProps) !== null && _props$webChatContain11 !== void 0 && (_props$webChatContain12 = _props$webChatContain11.renderingMiddlewareProps) !== null && _props$webChatContain12 !== void 0 && _props$webChatContain12.disableAttachmentMiddleware ? undefined : (0, _attachmentMiddleware.default)(((_state$domainStates$r3 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r3 === void 0 ? void 0 : (_state$domainStates$r4 = _state$domainStates$r3.attachmentProps) === null || _state$domainStates$r4 === void 0 ? void 0 : _state$domainStates$r4.enableInlinePlaying) ?? _defaultAttachmentProps.defaultAttachmentProps.enableInlinePlaying),
116
117
  activityStatusMiddleware: (_props$webChatContain13 = props.webChatContainerProps) !== null && _props$webChatContain13 !== void 0 && (_props$webChatContain14 = _props$webChatContain13.renderingMiddlewareProps) !== null && _props$webChatContain14 !== void 0 && _props$webChatContain14.disableActivityStatusMiddleware ? undefined : (_defaultWebChatContai = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai === void 0 ? void 0 : _defaultWebChatContai.activityStatusMiddleware,
118
+ toastMiddleware: (_props$webChatContain15 = props.webChatContainerProps) !== null && _props$webChatContain15 !== void 0 && (_props$webChatContain16 = _props$webChatContain15.renderingMiddlewareProps) !== null && _props$webChatContain16 !== void 0 && _props$webChatContain16.disableToastMiddleware ? undefined : (0, _toastMiddleware.default)(props.notificationPaneProps, endChat),
117
119
  renderMarkdown,
118
- avatarMiddleware: (_props$webChatContain15 = props.webChatContainerProps) !== null && _props$webChatContain15 !== void 0 && (_props$webChatContain16 = _props$webChatContain15.renderingMiddlewareProps) !== null && _props$webChatContain16 !== void 0 && _props$webChatContain16.disableAvatarMiddleware ? undefined : (0, _avatarMiddleware.createAvatarMiddleware)((_state$domainStates$r5 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r5 === void 0 ? void 0 : _state$domainStates$r5.avatarStyleProps, (_state$domainStates$r6 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r6 === void 0 ? void 0 : _state$domainStates$r6.avatarTextStyleProps),
119
- groupActivitiesMiddleware: (_props$webChatContain17 = props.webChatContainerProps) !== null && _props$webChatContain17 !== void 0 && (_props$webChatContain18 = _props$webChatContain17.renderingMiddlewareProps) !== null && _props$webChatContain18 !== void 0 && _props$webChatContain18.disableGroupActivitiesMiddleware ? undefined : (_defaultWebChatContai2 = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.groupActivitiesMiddleware,
120
- typingIndicatorMiddleware: (_props$webChatContain19 = props.webChatContainerProps) !== null && _props$webChatContain19 !== void 0 && (_props$webChatContain20 = _props$webChatContain19.renderingMiddlewareProps) !== null && _props$webChatContain20 !== void 0 && _props$webChatContain20.disableTypingIndicatorMiddleware ? undefined : (_defaultWebChatContai3 = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai3 === void 0 ? void 0 : _defaultWebChatContai3.typingIndicatorMiddleware,
120
+ avatarMiddleware: (_props$webChatContain17 = props.webChatContainerProps) !== null && _props$webChatContain17 !== void 0 && (_props$webChatContain18 = _props$webChatContain17.renderingMiddlewareProps) !== null && _props$webChatContain18 !== void 0 && _props$webChatContain18.disableAvatarMiddleware ? undefined : (0, _avatarMiddleware.createAvatarMiddleware)((_state$domainStates$r5 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r5 === void 0 ? void 0 : _state$domainStates$r5.avatarStyleProps, (_state$domainStates$r6 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r6 === void 0 ? void 0 : _state$domainStates$r6.avatarTextStyleProps),
121
+ groupActivitiesMiddleware: (_props$webChatContain19 = props.webChatContainerProps) !== null && _props$webChatContain19 !== void 0 && (_props$webChatContain20 = _props$webChatContain19.renderingMiddlewareProps) !== null && _props$webChatContain20 !== void 0 && _props$webChatContain20.disableGroupActivitiesMiddleware ? undefined : (_defaultWebChatContai2 = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.groupActivitiesMiddleware,
122
+ typingIndicatorMiddleware: (_props$webChatContain21 = props.webChatContainerProps) !== null && _props$webChatContain21 !== void 0 && (_props$webChatContain22 = _props$webChatContain21.renderingMiddlewareProps) !== null && _props$webChatContain22 !== void 0 && _props$webChatContain22.disableTypingIndicatorMiddleware ? undefined : (_defaultWebChatContai3 = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai3 === void 0 ? void 0 : _defaultWebChatContai3.typingIndicatorMiddleware,
121
123
  onTelemetry: (0, _WebChatLogger.createWebChatTelemetry)(),
122
- cardActionMiddleware: (0, _cardActionMiddleware.createCardActionMiddleware)(((_props$webChatContain21 = props.webChatContainerProps) === null || _props$webChatContain21 === void 0 ? void 0 : _props$webChatContain21.botMagicCode) || undefined),
124
+ cardActionMiddleware: (0, _cardActionMiddleware.createCardActionMiddleware)(((_props$webChatContain23 = props.webChatContainerProps) === null || _props$webChatContain23 === void 0 ? void 0 : _props$webChatContain23.botMagicCode) || undefined),
123
125
  sendTypingIndicator: true,
124
- ...((_props$webChatContain22 = props.webChatContainerProps) === null || _props$webChatContain22 === void 0 ? void 0 : _props$webChatContain22.webChatProps)
126
+ ...((_props$webChatContain24 = props.webChatContainerProps) === null || _props$webChatContain24 === void 0 ? void 0 : _props$webChatContain24.webChatProps)
125
127
  };
126
128
  return webChatProps;
127
129
  };
@@ -604,7 +604,6 @@ const LiveChatWidgetStateful = props => {
604
604
  eventName: _TelemetryConstants.BroadcastEvent.ClosePopoutWindow
605
605
  });
606
606
  };
607
- const webChatProps = (0, _initWebChatComposer.initWebChatComposer)(props, state, dispatch, chatSDK);
608
607
  const setPostChatContextRelay = () => (0, _setPostChatContextAndLoadSurvey.setPostChatContextAndLoadSurvey)(chatSDK, dispatch);
609
608
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
610
609
  const endChatRelay = (adapter, skipEndChatSDK, skipCloseChat, postMessageToOtherTab) => (0, _endChat.endChat)(props, chatSDK, state, dispatch, setAdapter, setWebChatStyles, adapter, skipEndChatSDK, skipCloseChat, postMessageToOtherTab, uwid.current);
@@ -614,6 +613,7 @@ const LiveChatWidgetStateful = props => {
614
613
  const confirmationPaneProps = (0, _initConfirmationPropsComposer.initConfirmationPropsComposer)(props);
615
614
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
616
615
  const prepareEndChatRelay = () => (0, _endChat.prepareEndChat)(props, chatSDK, state, dispatch, setAdapter, setWebChatStyles, adapter, uwid.current);
616
+ const webChatProps = (0, _initWebChatComposer.initWebChatComposer)(props, state, dispatch, chatSDK, endChatRelay);
617
617
  const downloadTranscriptProps = (0, _createDownloadTranscriptProps.default)(props.downloadTranscriptProps, {
618
618
  ...(_defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps === null || _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps === void 0 ? void 0 : _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles),
619
619
  ...((_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.webChatStyles)
@@ -0,0 +1,177 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.NotificationPaneStateful = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
9
+ var _botframeworkWebchat = require("botframework-webchat");
10
+ var _NotificationScenarios = require("../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios");
11
+ var _useChatAdapterStore = _interopRequireDefault(require("../../hooks/useChatAdapterStore"));
12
+ var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
13
+ var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
14
+ var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
15
+ var _LiveChatWidgetActionType = require("../../contexts/common/LiveChatWidgetActionType");
16
+ var _Constants = require("../../common/Constants");
17
+ var _defaultChatDisconnectStyleProps = require("./defaultProps/defaultChatDisconnectStyleProps");
18
+ var _defaultChatDisconnectControlProps = require("./defaultProps/defaultChatDisconnectControlProps");
19
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
+ 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); }
21
+ 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; }
22
+ const NotificationPaneStateful = props => {
23
+ var _state$domainStates, _state$domainStates3;
24
+ const {
25
+ notificationPaneProps,
26
+ notificationScenarioType,
27
+ endChat
28
+ } = props;
29
+ const [state, dispatch] = (0, _useChatContextStore.default)();
30
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
+ const [adapter] = (0, _useChatAdapterStore.default)();
32
+ 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);
33
+ const onCloseChatClick = async () => {
34
+ _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
35
+ Event: _TelemetryConstants.TelemetryEvent.NotificationCloseChatButtonClicked,
36
+ Description: "Notification Close Chat button clicked."
37
+ });
38
+ if (localConfirmationPaneState.current !== _Constants.ConfirmationState.Ok) {
39
+ dispatch({
40
+ type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SHOW_CONFIRMATION,
41
+ payload: true
42
+ });
43
+ } else {
44
+ const skipEndChatSDK = true;
45
+ const skipCloseChat = false;
46
+ const postMessageToOtherTabs = true;
47
+ await endChat(adapter, skipEndChatSDK, skipCloseChat, postMessageToOtherTabs);
48
+ }
49
+ };
50
+ (0, _react.useEffect)(() => {
51
+ var _state$domainStates2;
52
+ localConfirmationPaneState.current = state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : _state$domainStates2.confirmationState;
53
+ }, [state === null || state === void 0 ? void 0 : (_state$domainStates3 = state.domainStates) === null || _state$domainStates3 === void 0 ? void 0 : _state$domainStates3.confirmationState]);
54
+ const {
55
+ useDismissNotification
56
+ } = _botframeworkWebchat.hooks;
57
+ const dismissNotification = useDismissNotification();
58
+ const handleDismissNotification = (0, _react.useCallback)(() => {
59
+ _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
60
+ Event: _TelemetryConstants.TelemetryEvent.NotificationDismissButtonClicked,
61
+ Description: `${notificationScenarioType} Notification Dismiss button clicked.`
62
+ });
63
+ dismissNotification(notificationScenarioType ?? "");
64
+ }, [notificationScenarioType]);
65
+
66
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
+ const populateTitleInternalProps = notificationProps => {
68
+ var _notificationProps$co, _notificationProps$co2, _notificationProps$st, _notificationProps$st2, _notificationProps$st3, _defaultChatDisconnec;
69
+ return {
70
+ hideTitle: ((_notificationProps$co = notificationProps.controlProps) === null || _notificationProps$co === void 0 ? void 0 : _notificationProps$co.hideTitle) ?? _defaultChatDisconnectControlProps.defaultChatDisconnectControlProps.hideTitle,
71
+ titleText: ((_notificationProps$co2 = notificationProps.controlProps) === null || _notificationProps$co2 === void 0 ? void 0 : _notificationProps$co2.titleText) ?? _defaultChatDisconnectControlProps.defaultChatDisconnectControlProps.titleText,
72
+ titleStyleProps: Object.assign({}, _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.titleStyleProps, (_notificationProps$st = notificationProps.styleProps) === null || _notificationProps$st === void 0 ? void 0 : _notificationProps$st.titleStyleProps),
73
+ titleClassName: ((_notificationProps$st2 = notificationProps.styleProps) === null || _notificationProps$st2 === void 0 ? void 0 : (_notificationProps$st3 = _notificationProps$st2.classNames) === null || _notificationProps$st3 === void 0 ? void 0 : _notificationProps$st3.titleClassName) ?? ((_defaultChatDisconnec = _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.classNames) === null || _defaultChatDisconnec === void 0 ? void 0 : _defaultChatDisconnec.titleClassName)
74
+ };
75
+ };
76
+
77
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
78
+ const populateSubtitleInternalProps = notificationProps => {
79
+ var _notificationProps$co3, _notificationProps$co4, _notificationProps$st4, _notificationProps$st5, _notificationProps$st6, _defaultChatDisconnec2;
80
+ return {
81
+ hideSubtitle: ((_notificationProps$co3 = notificationProps.controlProps) === null || _notificationProps$co3 === void 0 ? void 0 : _notificationProps$co3.hideSubtitle) ?? _defaultChatDisconnectControlProps.defaultChatDisconnectControlProps.hideSubtitle,
82
+ subtitleText: ((_notificationProps$co4 = notificationProps.controlProps) === null || _notificationProps$co4 === void 0 ? void 0 : _notificationProps$co4.subtitleText) ?? _defaultChatDisconnectControlProps.defaultChatDisconnectControlProps.subtitleText,
83
+ subtitleStyleProps: Object.assign({}, _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.subtitleStyleProps, (_notificationProps$st4 = notificationProps.styleProps) === null || _notificationProps$st4 === void 0 ? void 0 : _notificationProps$st4.subtitleStyleProps),
84
+ subtitleClassName: ((_notificationProps$st5 = notificationProps.styleProps) === null || _notificationProps$st5 === void 0 ? void 0 : (_notificationProps$st6 = _notificationProps$st5.classNames) === null || _notificationProps$st6 === void 0 ? void 0 : _notificationProps$st6.subtitleClassName) ?? ((_defaultChatDisconnec2 = _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.classNames) === null || _defaultChatDisconnec2 === void 0 ? void 0 : _defaultChatDisconnec2.subtitleClassName)
85
+ };
86
+ };
87
+
88
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
89
+ const populateHyperlinkInternalProps = notificationProps => {
90
+ var _notificationProps$co5, _notificationProps$co6, _notificationProps$co7, _notificationProps$co8, _notificationProps$st7, _notificationProps$st8, _notificationProps$st9, _notificationProps$st10, _defaultChatDisconnec3;
91
+ return {
92
+ hideHyperlink: ((_notificationProps$co5 = notificationProps.controlProps) === null || _notificationProps$co5 === void 0 ? void 0 : _notificationProps$co5.hideHyperlink) ?? _defaultChatDisconnectControlProps.defaultChatDisconnectControlProps.hideHyperlink,
93
+ hyperlinkText: ((_notificationProps$co6 = notificationProps.controlProps) === null || _notificationProps$co6 === void 0 ? void 0 : _notificationProps$co6.hyperlinkText) ?? _defaultChatDisconnectControlProps.defaultChatDisconnectControlProps.hyperlinkText,
94
+ hyperlinkAriaLabel: ((_notificationProps$co7 = notificationProps.controlProps) === null || _notificationProps$co7 === void 0 ? void 0 : _notificationProps$co7.hyperlinkAriaLabel) ?? _defaultChatDisconnectControlProps.defaultChatDisconnectControlProps.hyperlinkAriaLabel,
95
+ hyperlinkHref: ((_notificationProps$co8 = notificationProps.controlProps) === null || _notificationProps$co8 === void 0 ? void 0 : _notificationProps$co8.hyperlinkHref) ?? _defaultChatDisconnectControlProps.defaultChatDisconnectControlProps.hyperlinkHref,
96
+ hyperlinkStyleProps: Object.assign({}, _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.hyperlinkStyleProps, (_notificationProps$st7 = notificationProps.styleProps) === null || _notificationProps$st7 === void 0 ? void 0 : _notificationProps$st7.hyperlinkStyleProps),
97
+ hyperlinkHoverStyleProps: Object.assign({}, _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.hyperlinkHoverStyleProps, (_notificationProps$st8 = notificationProps.styleProps) === null || _notificationProps$st8 === void 0 ? void 0 : _notificationProps$st8.hyperlinkHoverStyleProps),
98
+ hyperlinkClassName: ((_notificationProps$st9 = notificationProps.styleProps) === null || _notificationProps$st9 === void 0 ? void 0 : (_notificationProps$st10 = _notificationProps$st9.classNames) === null || _notificationProps$st10 === void 0 ? void 0 : _notificationProps$st10.hyperlinkClassName) ?? ((_defaultChatDisconnec3 = _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.classNames) === null || _defaultChatDisconnec3 === void 0 ? void 0 : _defaultChatDisconnec3.hyperlinkClassName)
99
+ };
100
+ };
101
+
102
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
103
+ const populateNotificationIconInternalProps = notificationProps => {
104
+ var _notificationProps$co9, _notificationProps$co10, _notificationProps$st11, _notificationProps$st12, _notificationProps$st13, _defaultChatDisconnec4, _notificationProps$st14;
105
+ return {
106
+ hideNotificationIcon: ((_notificationProps$co9 = notificationProps.controlProps) === null || _notificationProps$co9 === void 0 ? void 0 : _notificationProps$co9.hideIcon) ?? _defaultChatDisconnectControlProps.defaultChatDisconnectControlProps.hideIcon,
107
+ notificationIconProps: Object.assign({}, _defaultChatDisconnectControlProps.defaultChatDisconnectControlProps.notificationIconProps, (_notificationProps$co10 = notificationProps.controlProps) === null || _notificationProps$co10 === void 0 ? void 0 : _notificationProps$co10.notificationIconProps),
108
+ notificationIconStyleProps: Object.assign({}, _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.notificationIconStyleProps, (_notificationProps$st11 = notificationProps.styleProps) === null || _notificationProps$st11 === void 0 ? void 0 : _notificationProps$st11.notificationIconStyleProps),
109
+ notificationIconClassName: ((_notificationProps$st12 = notificationProps.styleProps) === null || _notificationProps$st12 === void 0 ? void 0 : (_notificationProps$st13 = _notificationProps$st12.classNames) === null || _notificationProps$st13 === void 0 ? void 0 : _notificationProps$st13.notificationIconClassName) ?? ((_defaultChatDisconnec4 = _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.classNames) === null || _defaultChatDisconnec4 === void 0 ? void 0 : _defaultChatDisconnec4.notificationIconClassName),
110
+ notificationIconContainerStyleProps: Object.assign({}, _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.notificationIconContainerStyleProps, (_notificationProps$st14 = notificationProps.styleProps) === null || _notificationProps$st14 === void 0 ? void 0 : _notificationProps$st14.notificationIconContainerStyleProps)
111
+ };
112
+ };
113
+
114
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
115
+ const populateDismissButtonInternalProps = notificationProps => {
116
+ var _notificationProps$co11, _notificationProps$co12, _notificationProps$st15, _notificationProps$st16, _notificationProps$st17, _notificationProps$st18, _defaultChatDisconnec5;
117
+ return {
118
+ hideDismissButton: ((_notificationProps$co11 = notificationProps.controlProps) === null || _notificationProps$co11 === void 0 ? void 0 : _notificationProps$co11.hideDismissButton) ?? _defaultChatDisconnectControlProps.defaultChatDisconnectControlProps.hideDismissButton,
119
+ dismissButtonProps: Object.assign({
120
+ onClick: handleDismissNotification
121
+ }, _defaultChatDisconnectControlProps.defaultChatDisconnectControlProps.dismissButtonProps, (_notificationProps$co12 = notificationProps.controlProps) === null || _notificationProps$co12 === void 0 ? void 0 : _notificationProps$co12.dismissButtonProps),
122
+ dismissButtonStyleProps: Object.assign({}, _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.dismissButtonStyleProps, (_notificationProps$st15 = notificationProps.styleProps) === null || _notificationProps$st15 === void 0 ? void 0 : _notificationProps$st15.dismissButtonStyleProps),
123
+ dismissButtonHoverStyleProps: Object.assign({}, _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.dismissButtonHoverStyleProps, (_notificationProps$st16 = notificationProps.styleProps) === null || _notificationProps$st16 === void 0 ? void 0 : _notificationProps$st16.dismissButtonHoverStyleProps),
124
+ dismissButtonClassName: ((_notificationProps$st17 = notificationProps.styleProps) === null || _notificationProps$st17 === void 0 ? void 0 : (_notificationProps$st18 = _notificationProps$st17.classNames) === null || _notificationProps$st18 === void 0 ? void 0 : _notificationProps$st18.dismissButtonClassName) ?? ((_defaultChatDisconnec5 = _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.classNames) === null || _defaultChatDisconnec5 === void 0 ? void 0 : _defaultChatDisconnec5.dismissButtonClassName)
125
+ };
126
+ };
127
+
128
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
129
+ const populateCloseChatButtonInternalProps = notificationProps => {
130
+ var _notificationProps$co13, _notificationProps$co14, _notificationProps$st19, _notificationProps$st20, _notificationProps$st21, _notificationProps$st22, _defaultChatDisconnec6;
131
+ return {
132
+ hideCloseChatButton: ((_notificationProps$co13 = notificationProps.controlProps) === null || _notificationProps$co13 === void 0 ? void 0 : _notificationProps$co13.hideCloseChatButton) ?? _defaultChatDisconnectControlProps.defaultChatDisconnectControlProps.hideCloseChatButton,
133
+ closeChatButtonProps: Object.assign({
134
+ onClick: onCloseChatClick
135
+ }, _defaultChatDisconnectControlProps.defaultChatDisconnectControlProps.closeChatButtonProps, (_notificationProps$co14 = notificationProps.controlProps) === null || _notificationProps$co14 === void 0 ? void 0 : _notificationProps$co14.closeChatButtonProps),
136
+ closeChatButtonStyleProps: Object.assign({}, _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.closeChatButtonStyleProps, (_notificationProps$st19 = notificationProps.styleProps) === null || _notificationProps$st19 === void 0 ? void 0 : _notificationProps$st19.closeChatButtonStyleProps),
137
+ closeChatButtonHoverStyleProps: Object.assign({}, _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.closeChatButtonHoverStyleProps, (_notificationProps$st20 = notificationProps.styleProps) === null || _notificationProps$st20 === void 0 ? void 0 : _notificationProps$st20.closeChatButtonHoverStyleProps),
138
+ closeChatButtonClassName: ((_notificationProps$st21 = notificationProps.styleProps) === null || _notificationProps$st21 === void 0 ? void 0 : (_notificationProps$st22 = _notificationProps$st21.classNames) === null || _notificationProps$st22 === void 0 ? void 0 : _notificationProps$st22.closeChatButtonClassName) ?? ((_defaultChatDisconnec6 = _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.classNames) === null || _defaultChatDisconnec6 === void 0 ? void 0 : _defaultChatDisconnec6.closeChatButtonClassName)
139
+ };
140
+ };
141
+ let genericPropsObj = {};
142
+
143
+ // Populate INotificationPaneInternal after merging customized props with default props
144
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
145
+ const populateInternalProps = notificationProps => {
146
+ var _notificationProps$st23, _notificationProps$st24, _notificationProps$st25, _defaultChatDisconnec7, _notificationProps$st26, _notificationProps$st27;
147
+ if (!notificationProps) {
148
+ notificationProps = {};
149
+ }
150
+ genericPropsObj = {
151
+ id: notificationProps.id ?? _Constants.NotificationPaneConstants.DefaultNotificationPaneId,
152
+ dir: notificationProps.dir,
153
+ generalStyleProps: Object.assign({}, _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.generalStyleProps, (_notificationProps$st23 = notificationProps.styleProps) === null || _notificationProps$st23 === void 0 ? void 0 : _notificationProps$st23.generalStyleProps),
154
+ containerClassName: ((_notificationProps$st24 = notificationProps.styleProps) === null || _notificationProps$st24 === void 0 ? void 0 : (_notificationProps$st25 = _notificationProps$st24.classNames) === null || _notificationProps$st25 === void 0 ? void 0 : _notificationProps$st25.containerClassName) ?? ((_defaultChatDisconnec7 = _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.classNames) === null || _defaultChatDisconnec7 === void 0 ? void 0 : _defaultChatDisconnec7.containerClassName),
155
+ componentOverrides: notificationProps.componentOverrides,
156
+ infoGroupStyleProps: Object.assign({}, _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.infoGroupStyleProps, (_notificationProps$st26 = notificationProps.styleProps) === null || _notificationProps$st26 === void 0 ? void 0 : _notificationProps$st26.infoGroupStyleProps),
157
+ buttonGroupStyleProps: Object.assign({}, _defaultChatDisconnectStyleProps.defaultChatDisconnectStyleProps.buttonGroupStyleProps, (_notificationProps$st27 = notificationProps.styleProps) === null || _notificationProps$st27 === void 0 ? void 0 : _notificationProps$st27.buttonGroupStyleProps),
158
+ ...populateTitleInternalProps(notificationProps),
159
+ ...populateSubtitleInternalProps(notificationProps),
160
+ ...populateHyperlinkInternalProps(notificationProps),
161
+ ...populateNotificationIconInternalProps(notificationProps),
162
+ ...populateDismissButtonInternalProps(notificationProps),
163
+ ...populateCloseChatButtonInternalProps(notificationProps)
164
+ };
165
+ };
166
+ switch (notificationScenarioType) {
167
+ case _NotificationScenarios.NotificationScenarios.ChatDisconnect:
168
+ populateInternalProps(notificationPaneProps === null || notificationPaneProps === void 0 ? void 0 : notificationPaneProps.chatDisconnectNotificationProps);
169
+ break;
170
+ // TODO additional scenarios to be added...
171
+ }
172
+
173
+ return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.NotificationPane, genericPropsObj);
174
+ };
175
+ exports.NotificationPaneStateful = NotificationPaneStateful;
176
+ var _default = NotificationPaneStateful;
177
+ exports.default = _default;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultChatDisconnectControlProps = void 0;
7
+ var _Constants = require("../../../common/Constants");
8
+ var _Icons = require("../../../assets/Icons");
9
+ const defaultChatDisconnectControlProps = {
10
+ hideTitle: false,
11
+ titleText: _Constants.NotificationPaneConstants.ChatDisconnectTitleText,
12
+ hideSubtitle: false,
13
+ subtitleText: _Constants.NotificationPaneConstants.ChatDisconnectSubtitleText,
14
+ hideIcon: false,
15
+ notificationIconProps: {
16
+ id: _Constants.NotificationPaneConstants.IconId,
17
+ src: _Icons.NotificationAlertIcon,
18
+ alt: _Constants.NotificationPaneConstants.IconText
19
+ },
20
+ hideHyperlink: true,
21
+ hyperlinkText: "Learn more",
22
+ hyperlinkAriaLabel: "Learn more",
23
+ hyperlinkHref: "https://www.microsoft.com",
24
+ hideDismissButton: false,
25
+ dismissButtonProps: {
26
+ id: _Constants.NotificationPaneConstants.DismissId,
27
+ text: _Constants.NotificationPaneConstants.DismissText,
28
+ type: "icon",
29
+ iconName: _Constants.NotificationPaneConstants.ChromeCloseIconName,
30
+ ariaLabel: _Constants.NotificationPaneConstants.DismissAriaLabel
31
+ },
32
+ hideCloseChatButton: false,
33
+ closeChatButtonProps: {
34
+ id: _Constants.NotificationPaneConstants.CloseChatId,
35
+ text: _Constants.NotificationPaneConstants.CloseChatText,
36
+ type: "text",
37
+ iconName: _Constants.NotificationPaneConstants.ChromeCloseIconName,
38
+ ariaLabel: _Constants.NotificationPaneConstants.CloseChatAriaLabel
39
+ }
40
+ };
41
+ exports.defaultChatDisconnectControlProps = defaultChatDisconnectControlProps;
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultChatDisconnectStyleProps = void 0;
7
+ const defaultChatDisconnectStyleProps = {
8
+ generalStyleProps: {
9
+ backgroundColor: "#FFF4CE",
10
+ display: "flex"
11
+ },
12
+ notificationIconStyleProps: {
13
+ display: "flex",
14
+ height: "19px",
15
+ width: "19px"
16
+ },
17
+ notificationIconContainerStyleProps: {
18
+ display: "flex",
19
+ width: "36px",
20
+ height: "32px",
21
+ flexShrink: "0",
22
+ justifyContent: "center",
23
+ alignItems: "center"
24
+ },
25
+ titleStyleProps: {
26
+ fontFamily: "'Segoe UI', Arial, sans-serif",
27
+ fontSize: "87.5%",
28
+ minHeight: "32px",
29
+ fontWeight: "bold"
30
+ },
31
+ subtitleStyleProps: {
32
+ fontFamily: "'Segoe UI', Arial, sans-serif",
33
+ fontSize: "87.5%",
34
+ fontWeight: "normal"
35
+ },
36
+ hyperlinkStyleProps: {
37
+ fontFamily: "'Segoe UI', Arial, sans-serif",
38
+ fontSize: "87.5%",
39
+ textDecoration: "none",
40
+ color: "#0078d4",
41
+ fontWeight: "normal"
42
+ },
43
+ hyperlinkHoverStyleProps: {
44
+ textDecoration: "none",
45
+ color: "#005a9e"
46
+ },
47
+ dismissButtonStyleProps: {
48
+ width: "22px",
49
+ height: "22px",
50
+ borderRadius: "3px",
51
+ border: "0",
52
+ margin: "4px",
53
+ backgroundColor: "transparent",
54
+ color: "black",
55
+ icon: {
56
+ fontSize: "14px"
57
+ }
58
+ },
59
+ dismissButtonHoverStyleProps: {
60
+ filter: "brightness(0.8)",
61
+ icon: {
62
+ color: "black"
63
+ }
64
+ },
65
+ closeChatButtonStyleProps: {
66
+ backgroundColor: "white",
67
+ fontFamily: "Segoe UI, Arial, sans-serif",
68
+ fontSize: "87.5%",
69
+ fontWeight: "500",
70
+ height: "32px",
71
+ width: "80px",
72
+ padding: "0px"
73
+ },
74
+ closeChatButtonHoverStyleProps: {
75
+ filter: "brightness(0.8)"
76
+ },
77
+ infoGroupStyleProps: {
78
+ display: "flex",
79
+ justifyContent: "space-between",
80
+ flex: "1 1 0%",
81
+ marginTop: "2px"
82
+ },
83
+ buttonGroupStyleProps: {
84
+ display: "flex",
85
+ justifyContent: "flex-end",
86
+ margin: "8px"
87
+ },
88
+ classNames: {
89
+ containerClassName: "chat-disconnect-container",
90
+ titleClassName: "chat-disconnect-title",
91
+ subtitleClassName: "chat-disconnect-subtitle",
92
+ dismissButtonClassName: "chat-disconnect-dismiss-button",
93
+ hyperlinkClassName: "chat-disconnect-hyperlink",
94
+ notificationIconClassName: "chat-disconnect-notification-icon",
95
+ closeChatButtonClassName: "chat-disconnect-close-chat-button"
96
+ }
97
+ };
98
+ exports.defaultChatDisconnectStyleProps = defaultChatDisconnectStyleProps;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _NotificationScenarios = require("../../enums/NotificationScenarios");
9
+ var _NotificationPaneStateful = _interopRequireDefault(require("../../../../notificationpanestateful/NotificationPaneStateful"));
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
+ const createToastMiddleware = (notificationPaneProps, endChat) => {
13
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, react/display-name
14
+ const toastMiddleware = () => next => card => {
15
+ const {
16
+ notification
17
+ } = card;
18
+ if (notificationPaneProps) {
19
+ if (notification.id === _NotificationScenarios.NotificationScenarios.ChatDisconnect) {
20
+ return /*#__PURE__*/_react.default.createElement(_NotificationPaneStateful.default, {
21
+ notificationPaneProps: notificationPaneProps,
22
+ notificationScenarioType: _NotificationScenarios.NotificationScenarios.ChatDisconnect,
23
+ endChat: endChat
24
+ });
25
+ }
26
+
27
+ // TODO: additional notification scenarios to be added...
28
+ }
29
+
30
+ return next(card);
31
+ };
32
+ return toastMiddleware;
33
+ };
34
+ var _default = createToastMiddleware;
35
+ exports.default = _default;
@@ -9,4 +9,5 @@ export const PowerpointIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDo
9
9
  export const VideoIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciDQogICAgdmlld0JveD0iMCAwIDIwNDggMjA0OCINCiAgICB3aWR0aD0iMTJweCINCiAgICBoZWlnaHQ9IjEycHgiPg0KICAgIDxwYXRoIGQ9Ik0wIDI1NmgyMDQ4djE0MDhIMFYyNTZ6bTI1NiAxMjgwdi0xMjhIMTI4djEyOGgxMjh6bTAtMjU2di0xMjhIMTI4djEyOGgxMjh6bTAtMjU2Vjg5NkgxMjh2MTI4aDEyOHptMC0yNTZWNjQwSDEyOHYxMjhoMTI4em0wLTI1NlYzODRIMTI4djEyOGgxMjh6bTE0MDggNzg2VjM4NEgzODR2ODIzbDQxMS01NDkgNzQxIDg3OC0zMjktNTU4IDEzNy0xMzcgMzIwIDQ1N3ptMjU2IDIzOHYtMTI4aC0xMjh2MTI4aDEyOHptMC0yNTZ2LTEyOGgtMTI4djEyOGgxMjh6bTAtMjU2Vjg5NmgtMTI4djEyOGgxMjh6bTAtMjU2VjY0MGgtMTI4djEyOGgxMjh6bTAtMjU2VjM4NGgtMTI4djEyOGgxMjh6IiAvPg0KPC9zdmc+";
10
10
  export const VisioIcon = "data:image/svg+xml;base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MuNDc2NkMyLjcxNDg0IDE0LjA3NTUgMy4xMzgwMiAxNC42MjI0IDMuNjMyODEgMTUuMTE3MkM0LjEyNzYgMTUuNjEyIDQuNjc0NDggMTYuMDM1MiA1LjI3MzQ0IDE2LjM4NjdDNS44Nzg5MSAxNi43MzgzIDYuNTI2NjkgMTcuMDExNyA3LjIxNjggMTcuMjA3QzcuOTA2OSAxNy40MDIzIDguNjI2MyAxNy41IDkuMzc1IDE3LjVaTTguNzUgNUgxMFYxMS4yNUg4Ljc1VjVaTTguNzUgMTIuNUgxMFYxMy43NUg4Ljc1VjEyLjVaIj48L3BhdGg+PC9zdmc+";
@@ -239,6 +239,19 @@ _defineProperty(TranscriptConstants, "AdaptiveCardType", "adaptivecard");
239
239
  _defineProperty(TranscriptConstants, "InternalMode", "internal");
240
240
  _defineProperty(TranscriptConstants, "AgentDialogColor", "#2266E3");
241
241
  _defineProperty(TranscriptConstants, "AgentFontColor", "white");
242
+ export class NotificationPaneConstants {}
243
+ _defineProperty(NotificationPaneConstants, "DefaultNotificationPaneId", "lcw-notification-pane");
244
+ _defineProperty(NotificationPaneConstants, "DismissId", "lcw-notification-pane-dismiss-button");
245
+ _defineProperty(NotificationPaneConstants, "DismissText", "Dismiss");
246
+ _defineProperty(NotificationPaneConstants, "DismissAriaLabel", "Notification dismiss");
247
+ _defineProperty(NotificationPaneConstants, "CloseChatId", "lcw-notification-pane-close-chat-button");
248
+ _defineProperty(NotificationPaneConstants, "CloseChatText", "Close Chat");
249
+ _defineProperty(NotificationPaneConstants, "CloseChatAriaLabel", "Close chat");
250
+ _defineProperty(NotificationPaneConstants, "IconId", "lcw-notification-pane-icon");
251
+ _defineProperty(NotificationPaneConstants, "IconText", "Notification Icon");
252
+ _defineProperty(NotificationPaneConstants, "ChatDisconnectTitleText", "Chat disconnected");
253
+ _defineProperty(NotificationPaneConstants, "ChatDisconnectSubtitleText", "For additional assistance, please close the chat and try again.");
254
+ _defineProperty(NotificationPaneConstants, "ChromeCloseIconName", "ChromeClose");
242
255
  export class AriaTelemetryConstants {}
243
256
  // Aria Endpoint for different environment types.
244
257
  _defineProperty(AriaTelemetryConstants, "GERMANY_ENDPOINT", "https://de.pipe.aria.microsoft.com/Collector/3.0/");
@@ -138,6 +138,8 @@ export let TelemetryEvent;
138
138
  TelemetryEvent["ReconnectChatPaneLoaded"] = "ReconnectChatPaneLoaded";
139
139
  TelemetryEvent["HeaderCloseButtonClicked"] = "HeaderCloseButtonClicked";
140
140
  TelemetryEvent["HeaderMinimizeButtonClicked"] = "HeaderMinimizeButtonClicked";
141
+ TelemetryEvent["NotificationCloseChatButtonClicked"] = "NotificationCloseChatButtonClicked";
142
+ TelemetryEvent["NotificationDismissButtonClicked"] = "NotificationDismissButtonClicked";
141
143
  TelemetryEvent["DownloadTranscriptButtonClicked"] = "DownloadTranscriptButtonClicked";
142
144
  TelemetryEvent["EmailTranscriptButtonClicked"] = "EmailTranscriptButtonClicked";
143
145
  TelemetryEvent["EmailTranscriptCancelButtonClicked"] = "EmailTranscriptCancelButtonClicked";
@@ -248,6 +250,8 @@ export class TelemetryConstants {
248
250
  case TelemetryEvent.PreChatSurveyStartChatMethodFailed:
249
251
  case TelemetryEvent.HeaderCloseButtonClicked:
250
252
  case TelemetryEvent.HeaderMinimizeButtonClicked:
253
+ case TelemetryEvent.NotificationCloseChatButtonClicked:
254
+ case TelemetryEvent.NotificationDismissButtonClicked:
251
255
  case TelemetryEvent.MessageSent:
252
256
  case TelemetryEvent.MessageReceived:
253
257
  case TelemetryEvent.CustomContextReceived:
@@ -30,10 +30,11 @@ import preProcessingMiddleware from "../../webchatcontainerstateful/webchatcontr
30
30
  import sanitizationMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware";
31
31
  import DOMPurify from "dompurify";
32
32
  import createMessageSequenceIdOverrideMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware";
33
+ import createToastMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware";
33
34
 
34
35
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
- export const initWebChatComposer = (props, state, dispatch, chatSDK) => {
36
- var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _props$webChatContain4, _state$domainStates$l4, _state$domainStates$l5, _props$webChatContain9, _props$webChatContain10, _state$domainStates$r, _state$domainStates$r2, _props$webChatContain11, _props$webChatContain12, _state$domainStates$r3, _state$domainStates$r4, _props$webChatContain13, _props$webChatContain14, _defaultWebChatContai, _props$webChatContain15, _props$webChatContain16, _state$domainStates$r5, _state$domainStates$r6, _props$webChatContain17, _props$webChatContain18, _defaultWebChatContai2, _props$webChatContain19, _props$webChatContain20, _defaultWebChatContai3, _props$webChatContain21, _props$webChatContain22;
36
+ export const initWebChatComposer = (props, state, dispatch, chatSDK, endChat) => {
37
+ var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _props$webChatContain4, _state$domainStates$l4, _state$domainStates$l5, _props$webChatContain9, _props$webChatContain10, _state$domainStates$r, _state$domainStates$r2, _props$webChatContain11, _props$webChatContain12, _state$domainStates$r3, _state$domainStates$r4, _props$webChatContain13, _props$webChatContain14, _defaultWebChatContai, _props$webChatContain15, _props$webChatContain16, _props$webChatContain17, _props$webChatContain18, _state$domainStates$r5, _state$domainStates$r6, _props$webChatContain19, _props$webChatContain20, _defaultWebChatContai2, _props$webChatContain21, _props$webChatContain22, _defaultWebChatContai3, _props$webChatContain23, _props$webChatContain24;
37
38
  // Add a hook to make all links open a new window
38
39
  postDomPurifyActivities();
39
40
  const localizedTexts = {
@@ -108,14 +109,15 @@ export const initWebChatComposer = (props, state, dispatch, chatSDK) => {
108
109
  activityMiddleware: (_props$webChatContain9 = props.webChatContainerProps) !== null && _props$webChatContain9 !== void 0 && (_props$webChatContain10 = _props$webChatContain9.renderingMiddlewareProps) !== null && _props$webChatContain10 !== void 0 && _props$webChatContain10.disableActivityMiddleware ? undefined : createActivityMiddleware((_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.systemMessageStyleProps, (_state$domainStates$r2 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.userMessageStyleProps),
109
110
  attachmentMiddleware: (_props$webChatContain11 = props.webChatContainerProps) !== null && _props$webChatContain11 !== void 0 && (_props$webChatContain12 = _props$webChatContain11.renderingMiddlewareProps) !== null && _props$webChatContain12 !== void 0 && _props$webChatContain12.disableAttachmentMiddleware ? undefined : createAttachmentMiddleware(((_state$domainStates$r3 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r3 === void 0 ? void 0 : (_state$domainStates$r4 = _state$domainStates$r3.attachmentProps) === null || _state$domainStates$r4 === void 0 ? void 0 : _state$domainStates$r4.enableInlinePlaying) ?? defaultAttachmentProps.enableInlinePlaying),
110
111
  activityStatusMiddleware: (_props$webChatContain13 = props.webChatContainerProps) !== null && _props$webChatContain13 !== void 0 && (_props$webChatContain14 = _props$webChatContain13.renderingMiddlewareProps) !== null && _props$webChatContain14 !== void 0 && _props$webChatContain14.disableActivityStatusMiddleware ? undefined : (_defaultWebChatContai = defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai === void 0 ? void 0 : _defaultWebChatContai.activityStatusMiddleware,
112
+ toastMiddleware: (_props$webChatContain15 = props.webChatContainerProps) !== null && _props$webChatContain15 !== void 0 && (_props$webChatContain16 = _props$webChatContain15.renderingMiddlewareProps) !== null && _props$webChatContain16 !== void 0 && _props$webChatContain16.disableToastMiddleware ? undefined : createToastMiddleware(props.notificationPaneProps, endChat),
111
113
  renderMarkdown,
112
- avatarMiddleware: (_props$webChatContain15 = props.webChatContainerProps) !== null && _props$webChatContain15 !== void 0 && (_props$webChatContain16 = _props$webChatContain15.renderingMiddlewareProps) !== null && _props$webChatContain16 !== void 0 && _props$webChatContain16.disableAvatarMiddleware ? undefined : createAvatarMiddleware((_state$domainStates$r5 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r5 === void 0 ? void 0 : _state$domainStates$r5.avatarStyleProps, (_state$domainStates$r6 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r6 === void 0 ? void 0 : _state$domainStates$r6.avatarTextStyleProps),
113
- groupActivitiesMiddleware: (_props$webChatContain17 = props.webChatContainerProps) !== null && _props$webChatContain17 !== void 0 && (_props$webChatContain18 = _props$webChatContain17.renderingMiddlewareProps) !== null && _props$webChatContain18 !== void 0 && _props$webChatContain18.disableGroupActivitiesMiddleware ? undefined : (_defaultWebChatContai2 = defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.groupActivitiesMiddleware,
114
- typingIndicatorMiddleware: (_props$webChatContain19 = props.webChatContainerProps) !== null && _props$webChatContain19 !== void 0 && (_props$webChatContain20 = _props$webChatContain19.renderingMiddlewareProps) !== null && _props$webChatContain20 !== void 0 && _props$webChatContain20.disableTypingIndicatorMiddleware ? undefined : (_defaultWebChatContai3 = defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai3 === void 0 ? void 0 : _defaultWebChatContai3.typingIndicatorMiddleware,
114
+ avatarMiddleware: (_props$webChatContain17 = props.webChatContainerProps) !== null && _props$webChatContain17 !== void 0 && (_props$webChatContain18 = _props$webChatContain17.renderingMiddlewareProps) !== null && _props$webChatContain18 !== void 0 && _props$webChatContain18.disableAvatarMiddleware ? undefined : createAvatarMiddleware((_state$domainStates$r5 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r5 === void 0 ? void 0 : _state$domainStates$r5.avatarStyleProps, (_state$domainStates$r6 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r6 === void 0 ? void 0 : _state$domainStates$r6.avatarTextStyleProps),
115
+ groupActivitiesMiddleware: (_props$webChatContain19 = props.webChatContainerProps) !== null && _props$webChatContain19 !== void 0 && (_props$webChatContain20 = _props$webChatContain19.renderingMiddlewareProps) !== null && _props$webChatContain20 !== void 0 && _props$webChatContain20.disableGroupActivitiesMiddleware ? undefined : (_defaultWebChatContai2 = defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.groupActivitiesMiddleware,
116
+ typingIndicatorMiddleware: (_props$webChatContain21 = props.webChatContainerProps) !== null && _props$webChatContain21 !== void 0 && (_props$webChatContain22 = _props$webChatContain21.renderingMiddlewareProps) !== null && _props$webChatContain22 !== void 0 && _props$webChatContain22.disableTypingIndicatorMiddleware ? undefined : (_defaultWebChatContai3 = defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai3 === void 0 ? void 0 : _defaultWebChatContai3.typingIndicatorMiddleware,
115
117
  onTelemetry: createWebChatTelemetry(),
116
- cardActionMiddleware: createCardActionMiddleware(((_props$webChatContain21 = props.webChatContainerProps) === null || _props$webChatContain21 === void 0 ? void 0 : _props$webChatContain21.botMagicCode) || undefined),
118
+ cardActionMiddleware: createCardActionMiddleware(((_props$webChatContain23 = props.webChatContainerProps) === null || _props$webChatContain23 === void 0 ? void 0 : _props$webChatContain23.botMagicCode) || undefined),
117
119
  sendTypingIndicator: true,
118
- ...((_props$webChatContain22 = props.webChatContainerProps) === null || _props$webChatContain22 === void 0 ? void 0 : _props$webChatContain22.webChatProps)
120
+ ...((_props$webChatContain24 = props.webChatContainerProps) === null || _props$webChatContain24 === void 0 ? void 0 : _props$webChatContain24.webChatProps)
119
121
  };
120
122
  return webChatProps;
121
123
  };
@@ -596,7 +596,6 @@ export const LiveChatWidgetStateful = props => {
596
596
  eventName: BroadcastEvent.ClosePopoutWindow
597
597
  });
598
598
  };
599
- const webChatProps = initWebChatComposer(props, state, dispatch, chatSDK);
600
599
  const setPostChatContextRelay = () => setPostChatContextAndLoadSurvey(chatSDK, dispatch);
601
600
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
602
601
  const endChatRelay = (adapter, skipEndChatSDK, skipCloseChat, postMessageToOtherTab) => endChat(props, chatSDK, state, dispatch, setAdapter, setWebChatStyles, adapter, skipEndChatSDK, skipCloseChat, postMessageToOtherTab, uwid.current);
@@ -606,6 +605,7 @@ export const LiveChatWidgetStateful = props => {
606
605
  const confirmationPaneProps = initConfirmationPropsComposer(props);
607
606
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
608
607
  const prepareEndChatRelay = () => prepareEndChat(props, chatSDK, state, dispatch, setAdapter, setWebChatStyles, adapter, uwid.current);
608
+ const webChatProps = initWebChatComposer(props, state, dispatch, chatSDK, endChatRelay);
609
609
  const downloadTranscriptProps = createDownloadTranscriptProps(props.downloadTranscriptProps, {
610
610
  ...(defaultWebChatContainerStatefulProps === null || defaultWebChatContainerStatefulProps === void 0 ? void 0 : defaultWebChatContainerStatefulProps.webChatStyles),
611
611
  ...((_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.webChatStyles)
@@ -0,0 +1,167 @@
1
+ import React, { useEffect, useRef } from "react";
2
+ import { NotificationPane } from "@microsoft/omnichannel-chat-components";
3
+ import { hooks } from "botframework-webchat";
4
+ import { useCallback } from "react";
5
+ import { NotificationScenarios } from "../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios";
6
+ import useChatAdapterStore from "../../hooks/useChatAdapterStore";
7
+ import useChatContextStore from "../../hooks/useChatContextStore";
8
+ import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
9
+ import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
10
+ import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
11
+ import { ConfirmationState, NotificationPaneConstants } from "../../common/Constants";
12
+ import { defaultChatDisconnectStyleProps } from "./defaultProps/defaultChatDisconnectStyleProps";
13
+ import { defaultChatDisconnectControlProps } from "./defaultProps/defaultChatDisconnectControlProps";
14
+ export const NotificationPaneStateful = props => {
15
+ var _state$domainStates, _state$domainStates3;
16
+ const {
17
+ notificationPaneProps,
18
+ notificationScenarioType,
19
+ endChat
20
+ } = props;
21
+ const [state, dispatch] = useChatContextStore();
22
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
+ const [adapter] = useChatAdapterStore();
24
+ const localConfirmationPaneState = useRef(state === null || state === void 0 ? void 0 : (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : _state$domainStates.confirmationState);
25
+ const onCloseChatClick = async () => {
26
+ TelemetryHelper.logActionEvent(LogLevel.INFO, {
27
+ Event: TelemetryEvent.NotificationCloseChatButtonClicked,
28
+ Description: "Notification Close Chat button clicked."
29
+ });
30
+ if (localConfirmationPaneState.current !== ConfirmationState.Ok) {
31
+ dispatch({
32
+ type: LiveChatWidgetActionType.SET_SHOW_CONFIRMATION,
33
+ payload: true
34
+ });
35
+ } else {
36
+ const skipEndChatSDK = true;
37
+ const skipCloseChat = false;
38
+ const postMessageToOtherTabs = true;
39
+ await endChat(adapter, skipEndChatSDK, skipCloseChat, postMessageToOtherTabs);
40
+ }
41
+ };
42
+ useEffect(() => {
43
+ var _state$domainStates2;
44
+ localConfirmationPaneState.current = state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : _state$domainStates2.confirmationState;
45
+ }, [state === null || state === void 0 ? void 0 : (_state$domainStates3 = state.domainStates) === null || _state$domainStates3 === void 0 ? void 0 : _state$domainStates3.confirmationState]);
46
+ const {
47
+ useDismissNotification
48
+ } = hooks;
49
+ const dismissNotification = useDismissNotification();
50
+ const handleDismissNotification = useCallback(() => {
51
+ TelemetryHelper.logActionEvent(LogLevel.INFO, {
52
+ Event: TelemetryEvent.NotificationDismissButtonClicked,
53
+ Description: `${notificationScenarioType} Notification Dismiss button clicked.`
54
+ });
55
+ dismissNotification(notificationScenarioType ?? "");
56
+ }, [notificationScenarioType]);
57
+
58
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
59
+ const populateTitleInternalProps = notificationProps => {
60
+ var _notificationProps$co, _notificationProps$co2, _notificationProps$st, _notificationProps$st2, _notificationProps$st3, _defaultChatDisconnec;
61
+ return {
62
+ hideTitle: ((_notificationProps$co = notificationProps.controlProps) === null || _notificationProps$co === void 0 ? void 0 : _notificationProps$co.hideTitle) ?? defaultChatDisconnectControlProps.hideTitle,
63
+ titleText: ((_notificationProps$co2 = notificationProps.controlProps) === null || _notificationProps$co2 === void 0 ? void 0 : _notificationProps$co2.titleText) ?? defaultChatDisconnectControlProps.titleText,
64
+ titleStyleProps: Object.assign({}, defaultChatDisconnectStyleProps.titleStyleProps, (_notificationProps$st = notificationProps.styleProps) === null || _notificationProps$st === void 0 ? void 0 : _notificationProps$st.titleStyleProps),
65
+ titleClassName: ((_notificationProps$st2 = notificationProps.styleProps) === null || _notificationProps$st2 === void 0 ? void 0 : (_notificationProps$st3 = _notificationProps$st2.classNames) === null || _notificationProps$st3 === void 0 ? void 0 : _notificationProps$st3.titleClassName) ?? ((_defaultChatDisconnec = defaultChatDisconnectStyleProps.classNames) === null || _defaultChatDisconnec === void 0 ? void 0 : _defaultChatDisconnec.titleClassName)
66
+ };
67
+ };
68
+
69
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
70
+ const populateSubtitleInternalProps = notificationProps => {
71
+ var _notificationProps$co3, _notificationProps$co4, _notificationProps$st4, _notificationProps$st5, _notificationProps$st6, _defaultChatDisconnec2;
72
+ return {
73
+ hideSubtitle: ((_notificationProps$co3 = notificationProps.controlProps) === null || _notificationProps$co3 === void 0 ? void 0 : _notificationProps$co3.hideSubtitle) ?? defaultChatDisconnectControlProps.hideSubtitle,
74
+ subtitleText: ((_notificationProps$co4 = notificationProps.controlProps) === null || _notificationProps$co4 === void 0 ? void 0 : _notificationProps$co4.subtitleText) ?? defaultChatDisconnectControlProps.subtitleText,
75
+ subtitleStyleProps: Object.assign({}, defaultChatDisconnectStyleProps.subtitleStyleProps, (_notificationProps$st4 = notificationProps.styleProps) === null || _notificationProps$st4 === void 0 ? void 0 : _notificationProps$st4.subtitleStyleProps),
76
+ subtitleClassName: ((_notificationProps$st5 = notificationProps.styleProps) === null || _notificationProps$st5 === void 0 ? void 0 : (_notificationProps$st6 = _notificationProps$st5.classNames) === null || _notificationProps$st6 === void 0 ? void 0 : _notificationProps$st6.subtitleClassName) ?? ((_defaultChatDisconnec2 = defaultChatDisconnectStyleProps.classNames) === null || _defaultChatDisconnec2 === void 0 ? void 0 : _defaultChatDisconnec2.subtitleClassName)
77
+ };
78
+ };
79
+
80
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
81
+ const populateHyperlinkInternalProps = notificationProps => {
82
+ var _notificationProps$co5, _notificationProps$co6, _notificationProps$co7, _notificationProps$co8, _notificationProps$st7, _notificationProps$st8, _notificationProps$st9, _notificationProps$st10, _defaultChatDisconnec3;
83
+ return {
84
+ hideHyperlink: ((_notificationProps$co5 = notificationProps.controlProps) === null || _notificationProps$co5 === void 0 ? void 0 : _notificationProps$co5.hideHyperlink) ?? defaultChatDisconnectControlProps.hideHyperlink,
85
+ hyperlinkText: ((_notificationProps$co6 = notificationProps.controlProps) === null || _notificationProps$co6 === void 0 ? void 0 : _notificationProps$co6.hyperlinkText) ?? defaultChatDisconnectControlProps.hyperlinkText,
86
+ hyperlinkAriaLabel: ((_notificationProps$co7 = notificationProps.controlProps) === null || _notificationProps$co7 === void 0 ? void 0 : _notificationProps$co7.hyperlinkAriaLabel) ?? defaultChatDisconnectControlProps.hyperlinkAriaLabel,
87
+ hyperlinkHref: ((_notificationProps$co8 = notificationProps.controlProps) === null || _notificationProps$co8 === void 0 ? void 0 : _notificationProps$co8.hyperlinkHref) ?? defaultChatDisconnectControlProps.hyperlinkHref,
88
+ hyperlinkStyleProps: Object.assign({}, defaultChatDisconnectStyleProps.hyperlinkStyleProps, (_notificationProps$st7 = notificationProps.styleProps) === null || _notificationProps$st7 === void 0 ? void 0 : _notificationProps$st7.hyperlinkStyleProps),
89
+ hyperlinkHoverStyleProps: Object.assign({}, defaultChatDisconnectStyleProps.hyperlinkHoverStyleProps, (_notificationProps$st8 = notificationProps.styleProps) === null || _notificationProps$st8 === void 0 ? void 0 : _notificationProps$st8.hyperlinkHoverStyleProps),
90
+ hyperlinkClassName: ((_notificationProps$st9 = notificationProps.styleProps) === null || _notificationProps$st9 === void 0 ? void 0 : (_notificationProps$st10 = _notificationProps$st9.classNames) === null || _notificationProps$st10 === void 0 ? void 0 : _notificationProps$st10.hyperlinkClassName) ?? ((_defaultChatDisconnec3 = defaultChatDisconnectStyleProps.classNames) === null || _defaultChatDisconnec3 === void 0 ? void 0 : _defaultChatDisconnec3.hyperlinkClassName)
91
+ };
92
+ };
93
+
94
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
95
+ const populateNotificationIconInternalProps = notificationProps => {
96
+ var _notificationProps$co9, _notificationProps$co10, _notificationProps$st11, _notificationProps$st12, _notificationProps$st13, _defaultChatDisconnec4, _notificationProps$st14;
97
+ return {
98
+ hideNotificationIcon: ((_notificationProps$co9 = notificationProps.controlProps) === null || _notificationProps$co9 === void 0 ? void 0 : _notificationProps$co9.hideIcon) ?? defaultChatDisconnectControlProps.hideIcon,
99
+ notificationIconProps: Object.assign({}, defaultChatDisconnectControlProps.notificationIconProps, (_notificationProps$co10 = notificationProps.controlProps) === null || _notificationProps$co10 === void 0 ? void 0 : _notificationProps$co10.notificationIconProps),
100
+ notificationIconStyleProps: Object.assign({}, defaultChatDisconnectStyleProps.notificationIconStyleProps, (_notificationProps$st11 = notificationProps.styleProps) === null || _notificationProps$st11 === void 0 ? void 0 : _notificationProps$st11.notificationIconStyleProps),
101
+ notificationIconClassName: ((_notificationProps$st12 = notificationProps.styleProps) === null || _notificationProps$st12 === void 0 ? void 0 : (_notificationProps$st13 = _notificationProps$st12.classNames) === null || _notificationProps$st13 === void 0 ? void 0 : _notificationProps$st13.notificationIconClassName) ?? ((_defaultChatDisconnec4 = defaultChatDisconnectStyleProps.classNames) === null || _defaultChatDisconnec4 === void 0 ? void 0 : _defaultChatDisconnec4.notificationIconClassName),
102
+ notificationIconContainerStyleProps: Object.assign({}, defaultChatDisconnectStyleProps.notificationIconContainerStyleProps, (_notificationProps$st14 = notificationProps.styleProps) === null || _notificationProps$st14 === void 0 ? void 0 : _notificationProps$st14.notificationIconContainerStyleProps)
103
+ };
104
+ };
105
+
106
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
107
+ const populateDismissButtonInternalProps = notificationProps => {
108
+ var _notificationProps$co11, _notificationProps$co12, _notificationProps$st15, _notificationProps$st16, _notificationProps$st17, _notificationProps$st18, _defaultChatDisconnec5;
109
+ return {
110
+ hideDismissButton: ((_notificationProps$co11 = notificationProps.controlProps) === null || _notificationProps$co11 === void 0 ? void 0 : _notificationProps$co11.hideDismissButton) ?? defaultChatDisconnectControlProps.hideDismissButton,
111
+ dismissButtonProps: Object.assign({
112
+ onClick: handleDismissNotification
113
+ }, defaultChatDisconnectControlProps.dismissButtonProps, (_notificationProps$co12 = notificationProps.controlProps) === null || _notificationProps$co12 === void 0 ? void 0 : _notificationProps$co12.dismissButtonProps),
114
+ dismissButtonStyleProps: Object.assign({}, defaultChatDisconnectStyleProps.dismissButtonStyleProps, (_notificationProps$st15 = notificationProps.styleProps) === null || _notificationProps$st15 === void 0 ? void 0 : _notificationProps$st15.dismissButtonStyleProps),
115
+ dismissButtonHoverStyleProps: Object.assign({}, defaultChatDisconnectStyleProps.dismissButtonHoverStyleProps, (_notificationProps$st16 = notificationProps.styleProps) === null || _notificationProps$st16 === void 0 ? void 0 : _notificationProps$st16.dismissButtonHoverStyleProps),
116
+ dismissButtonClassName: ((_notificationProps$st17 = notificationProps.styleProps) === null || _notificationProps$st17 === void 0 ? void 0 : (_notificationProps$st18 = _notificationProps$st17.classNames) === null || _notificationProps$st18 === void 0 ? void 0 : _notificationProps$st18.dismissButtonClassName) ?? ((_defaultChatDisconnec5 = defaultChatDisconnectStyleProps.classNames) === null || _defaultChatDisconnec5 === void 0 ? void 0 : _defaultChatDisconnec5.dismissButtonClassName)
117
+ };
118
+ };
119
+
120
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
121
+ const populateCloseChatButtonInternalProps = notificationProps => {
122
+ var _notificationProps$co13, _notificationProps$co14, _notificationProps$st19, _notificationProps$st20, _notificationProps$st21, _notificationProps$st22, _defaultChatDisconnec6;
123
+ return {
124
+ hideCloseChatButton: ((_notificationProps$co13 = notificationProps.controlProps) === null || _notificationProps$co13 === void 0 ? void 0 : _notificationProps$co13.hideCloseChatButton) ?? defaultChatDisconnectControlProps.hideCloseChatButton,
125
+ closeChatButtonProps: Object.assign({
126
+ onClick: onCloseChatClick
127
+ }, defaultChatDisconnectControlProps.closeChatButtonProps, (_notificationProps$co14 = notificationProps.controlProps) === null || _notificationProps$co14 === void 0 ? void 0 : _notificationProps$co14.closeChatButtonProps),
128
+ closeChatButtonStyleProps: Object.assign({}, defaultChatDisconnectStyleProps.closeChatButtonStyleProps, (_notificationProps$st19 = notificationProps.styleProps) === null || _notificationProps$st19 === void 0 ? void 0 : _notificationProps$st19.closeChatButtonStyleProps),
129
+ closeChatButtonHoverStyleProps: Object.assign({}, defaultChatDisconnectStyleProps.closeChatButtonHoverStyleProps, (_notificationProps$st20 = notificationProps.styleProps) === null || _notificationProps$st20 === void 0 ? void 0 : _notificationProps$st20.closeChatButtonHoverStyleProps),
130
+ closeChatButtonClassName: ((_notificationProps$st21 = notificationProps.styleProps) === null || _notificationProps$st21 === void 0 ? void 0 : (_notificationProps$st22 = _notificationProps$st21.classNames) === null || _notificationProps$st22 === void 0 ? void 0 : _notificationProps$st22.closeChatButtonClassName) ?? ((_defaultChatDisconnec6 = defaultChatDisconnectStyleProps.classNames) === null || _defaultChatDisconnec6 === void 0 ? void 0 : _defaultChatDisconnec6.closeChatButtonClassName)
131
+ };
132
+ };
133
+ let genericPropsObj = {};
134
+
135
+ // Populate INotificationPaneInternal after merging customized props with default props
136
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
137
+ const populateInternalProps = notificationProps => {
138
+ var _notificationProps$st23, _notificationProps$st24, _notificationProps$st25, _defaultChatDisconnec7, _notificationProps$st26, _notificationProps$st27;
139
+ if (!notificationProps) {
140
+ notificationProps = {};
141
+ }
142
+ genericPropsObj = {
143
+ id: notificationProps.id ?? NotificationPaneConstants.DefaultNotificationPaneId,
144
+ dir: notificationProps.dir,
145
+ generalStyleProps: Object.assign({}, defaultChatDisconnectStyleProps.generalStyleProps, (_notificationProps$st23 = notificationProps.styleProps) === null || _notificationProps$st23 === void 0 ? void 0 : _notificationProps$st23.generalStyleProps),
146
+ containerClassName: ((_notificationProps$st24 = notificationProps.styleProps) === null || _notificationProps$st24 === void 0 ? void 0 : (_notificationProps$st25 = _notificationProps$st24.classNames) === null || _notificationProps$st25 === void 0 ? void 0 : _notificationProps$st25.containerClassName) ?? ((_defaultChatDisconnec7 = defaultChatDisconnectStyleProps.classNames) === null || _defaultChatDisconnec7 === void 0 ? void 0 : _defaultChatDisconnec7.containerClassName),
147
+ componentOverrides: notificationProps.componentOverrides,
148
+ infoGroupStyleProps: Object.assign({}, defaultChatDisconnectStyleProps.infoGroupStyleProps, (_notificationProps$st26 = notificationProps.styleProps) === null || _notificationProps$st26 === void 0 ? void 0 : _notificationProps$st26.infoGroupStyleProps),
149
+ buttonGroupStyleProps: Object.assign({}, defaultChatDisconnectStyleProps.buttonGroupStyleProps, (_notificationProps$st27 = notificationProps.styleProps) === null || _notificationProps$st27 === void 0 ? void 0 : _notificationProps$st27.buttonGroupStyleProps),
150
+ ...populateTitleInternalProps(notificationProps),
151
+ ...populateSubtitleInternalProps(notificationProps),
152
+ ...populateHyperlinkInternalProps(notificationProps),
153
+ ...populateNotificationIconInternalProps(notificationProps),
154
+ ...populateDismissButtonInternalProps(notificationProps),
155
+ ...populateCloseChatButtonInternalProps(notificationProps)
156
+ };
157
+ };
158
+ switch (notificationScenarioType) {
159
+ case NotificationScenarios.ChatDisconnect:
160
+ populateInternalProps(notificationPaneProps === null || notificationPaneProps === void 0 ? void 0 : notificationPaneProps.chatDisconnectNotificationProps);
161
+ break;
162
+ // TODO additional scenarios to be added...
163
+ }
164
+
165
+ return /*#__PURE__*/React.createElement(NotificationPane, genericPropsObj);
166
+ };
167
+ export default NotificationPaneStateful;
@@ -0,0 +1,34 @@
1
+ import { NotificationPaneConstants } from "../../../common/Constants";
2
+ import { NotificationAlertIcon } from "../../../assets/Icons";
3
+ export const defaultChatDisconnectControlProps = {
4
+ hideTitle: false,
5
+ titleText: NotificationPaneConstants.ChatDisconnectTitleText,
6
+ hideSubtitle: false,
7
+ subtitleText: NotificationPaneConstants.ChatDisconnectSubtitleText,
8
+ hideIcon: false,
9
+ notificationIconProps: {
10
+ id: NotificationPaneConstants.IconId,
11
+ src: NotificationAlertIcon,
12
+ alt: NotificationPaneConstants.IconText
13
+ },
14
+ hideHyperlink: true,
15
+ hyperlinkText: "Learn more",
16
+ hyperlinkAriaLabel: "Learn more",
17
+ hyperlinkHref: "https://www.microsoft.com",
18
+ hideDismissButton: false,
19
+ dismissButtonProps: {
20
+ id: NotificationPaneConstants.DismissId,
21
+ text: NotificationPaneConstants.DismissText,
22
+ type: "icon",
23
+ iconName: NotificationPaneConstants.ChromeCloseIconName,
24
+ ariaLabel: NotificationPaneConstants.DismissAriaLabel
25
+ },
26
+ hideCloseChatButton: false,
27
+ closeChatButtonProps: {
28
+ id: NotificationPaneConstants.CloseChatId,
29
+ text: NotificationPaneConstants.CloseChatText,
30
+ type: "text",
31
+ iconName: NotificationPaneConstants.ChromeCloseIconName,
32
+ ariaLabel: NotificationPaneConstants.CloseChatAriaLabel
33
+ }
34
+ };
@@ -0,0 +1,91 @@
1
+ export const defaultChatDisconnectStyleProps = {
2
+ generalStyleProps: {
3
+ backgroundColor: "#FFF4CE",
4
+ display: "flex"
5
+ },
6
+ notificationIconStyleProps: {
7
+ display: "flex",
8
+ height: "19px",
9
+ width: "19px"
10
+ },
11
+ notificationIconContainerStyleProps: {
12
+ display: "flex",
13
+ width: "36px",
14
+ height: "32px",
15
+ flexShrink: "0",
16
+ justifyContent: "center",
17
+ alignItems: "center"
18
+ },
19
+ titleStyleProps: {
20
+ fontFamily: "'Segoe UI', Arial, sans-serif",
21
+ fontSize: "87.5%",
22
+ minHeight: "32px",
23
+ fontWeight: "bold"
24
+ },
25
+ subtitleStyleProps: {
26
+ fontFamily: "'Segoe UI', Arial, sans-serif",
27
+ fontSize: "87.5%",
28
+ fontWeight: "normal"
29
+ },
30
+ hyperlinkStyleProps: {
31
+ fontFamily: "'Segoe UI', Arial, sans-serif",
32
+ fontSize: "87.5%",
33
+ textDecoration: "none",
34
+ color: "#0078d4",
35
+ fontWeight: "normal"
36
+ },
37
+ hyperlinkHoverStyleProps: {
38
+ textDecoration: "none",
39
+ color: "#005a9e"
40
+ },
41
+ dismissButtonStyleProps: {
42
+ width: "22px",
43
+ height: "22px",
44
+ borderRadius: "3px",
45
+ border: "0",
46
+ margin: "4px",
47
+ backgroundColor: "transparent",
48
+ color: "black",
49
+ icon: {
50
+ fontSize: "14px"
51
+ }
52
+ },
53
+ dismissButtonHoverStyleProps: {
54
+ filter: "brightness(0.8)",
55
+ icon: {
56
+ color: "black"
57
+ }
58
+ },
59
+ closeChatButtonStyleProps: {
60
+ backgroundColor: "white",
61
+ fontFamily: "Segoe UI, Arial, sans-serif",
62
+ fontSize: "87.5%",
63
+ fontWeight: "500",
64
+ height: "32px",
65
+ width: "80px",
66
+ padding: "0px"
67
+ },
68
+ closeChatButtonHoverStyleProps: {
69
+ filter: "brightness(0.8)"
70
+ },
71
+ infoGroupStyleProps: {
72
+ display: "flex",
73
+ justifyContent: "space-between",
74
+ flex: "1 1 0%",
75
+ marginTop: "2px"
76
+ },
77
+ buttonGroupStyleProps: {
78
+ display: "flex",
79
+ justifyContent: "flex-end",
80
+ margin: "8px"
81
+ },
82
+ classNames: {
83
+ containerClassName: "chat-disconnect-container",
84
+ titleClassName: "chat-disconnect-title",
85
+ subtitleClassName: "chat-disconnect-subtitle",
86
+ dismissButtonClassName: "chat-disconnect-dismiss-button",
87
+ hyperlinkClassName: "chat-disconnect-hyperlink",
88
+ notificationIconClassName: "chat-disconnect-notification-icon",
89
+ closeChatButtonClassName: "chat-disconnect-close-chat-button"
90
+ }
91
+ };
@@ -0,0 +1,28 @@
1
+ import React from "react";
2
+ import { NotificationScenarios } from "../../enums/NotificationScenarios";
3
+ import NotificationPaneStateful from "../../../../notificationpanestateful/NotificationPaneStateful";
4
+
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+ const createToastMiddleware = (notificationPaneProps, endChat) => {
7
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, react/display-name
8
+ const toastMiddleware = () => next => card => {
9
+ const {
10
+ notification
11
+ } = card;
12
+ if (notificationPaneProps) {
13
+ if (notification.id === NotificationScenarios.ChatDisconnect) {
14
+ return /*#__PURE__*/React.createElement(NotificationPaneStateful, {
15
+ notificationPaneProps: notificationPaneProps,
16
+ notificationScenarioType: NotificationScenarios.ChatDisconnect,
17
+ endChat: endChat
18
+ });
19
+ }
20
+
21
+ // TODO: additional notification scenarios to be added...
22
+ }
23
+
24
+ return next(card);
25
+ };
26
+ return toastMiddleware;
27
+ };
28
+ export default createToastMiddleware;
@@ -10,3 +10,4 @@ export declare const VideoIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0
10
10
  export declare const VisioIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciDQogICAgdmlld0JveD0iMCAwIDIwNDggMjA0OCINCiAgICB3aWR0aD0iMTJweCINCiAgICBoZWlnaHQ9IjEycHgiPg0KICAgIDxwYXRoIGQ9Ik0yMDQ4IDQ3NXYxNDQ1cTAgMjctMTAgNTB0LTI3IDQwLTQxIDI4LTUwIDEwSDY0MHEtMjcgMC01MC0xMHQtNDAtMjctMjgtNDEtMTAtNTB2LTI1NkgxMTVxLTI0IDAtNDQtOXQtMzctMjUtMjUtMzYtOS00NVY2MjdxMC0yNCA5LTQ0dDI1LTM3IDM2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cxNDg0IDE0LjA3NTUgMy4xMzgwMiAxNC42MjI0IDMuNjMyODEgMTUuMTE3MkM0LjEyNzYgMTUuNjEyIDQuNjc0NDggMTYuMDM1MiA1LjI3MzQ0IDE2LjM4NjdDNS44Nzg5MSAxNi43MzgzIDYuNTI2NjkgMTcuMDExNyA3LjIxNjggMTcuMjA3QzcuOTA2OSAxNy40MDIzIDguNjI2MyAxNy41IDkuMzc1IDE3LjVaTTguNzUgNUgxMFYxMS4yNUg4Ljc1VjVaTTguNzUgMTIuNUgxMFYxMy43NUg4Ljc1VjEyLjVaIj48L3BhdGg+PC9zdmc+";
@@ -217,6 +217,20 @@ export declare class TranscriptConstants {
217
217
  static readonly AgentDialogColor = "#2266E3";
218
218
  static readonly AgentFontColor = "white";
219
219
  }
220
+ export declare class NotificationPaneConstants {
221
+ static readonly DefaultNotificationPaneId = "lcw-notification-pane";
222
+ static readonly DismissId = "lcw-notification-pane-dismiss-button";
223
+ static readonly DismissText = "Dismiss";
224
+ static readonly DismissAriaLabel = "Notification dismiss";
225
+ static readonly CloseChatId = "lcw-notification-pane-close-chat-button";
226
+ static readonly CloseChatText = "Close Chat";
227
+ static readonly CloseChatAriaLabel = "Close chat";
228
+ static readonly IconId = "lcw-notification-pane-icon";
229
+ static readonly IconText = "Notification Icon";
230
+ static readonly ChatDisconnectTitleText = "Chat disconnected";
231
+ static readonly ChatDisconnectSubtitleText = "For additional assistance, please close the chat and try again.";
232
+ static readonly ChromeCloseIconName = "ChromeClose";
233
+ }
220
234
  export declare class AriaTelemetryConstants {
221
235
  static readonly GERMANY_ENDPOINT: string;
222
236
  static readonly GCCH_ENDPOINT: string;
@@ -131,6 +131,8 @@ export declare enum TelemetryEvent {
131
131
  ReconnectChatPaneLoaded = "ReconnectChatPaneLoaded",
132
132
  HeaderCloseButtonClicked = "HeaderCloseButtonClicked",
133
133
  HeaderMinimizeButtonClicked = "HeaderMinimizeButtonClicked",
134
+ NotificationCloseChatButtonClicked = "NotificationCloseChatButtonClicked",
135
+ NotificationDismissButtonClicked = "NotificationDismissButtonClicked",
134
136
  DownloadTranscriptButtonClicked = "DownloadTranscriptButtonClicked",
135
137
  EmailTranscriptButtonClicked = "EmailTranscriptButtonClicked",
136
138
  EmailTranscriptCancelButtonClicked = "EmailTranscriptCancelButtonClicked",
@@ -3,4 +3,4 @@ import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetA
3
3
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
4
4
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
5
  import { IWebChatProps } from "../../webchatcontainerstateful/interfaces/IWebChatProps";
6
- export declare const initWebChatComposer: (props: ILiveChatWidgetProps, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, chatSDK: any) => IWebChatProps;
6
+ export declare const initWebChatComposer: (props: ILiveChatWidgetProps, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, chatSDK: any, endChat: any) => IWebChatProps;
@@ -24,6 +24,7 @@ import { IContextDataStore } from "../../../common/interfaces/IContextDataStore"
24
24
  import { IPostChatSurveyPaneStatefulProps } from "../../postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps";
25
25
  import { IScrollBarProps } from "./IScrollBarProps";
26
26
  import { IDraggableChatWidgetProps } from "./IDraggableChatWidgetProps";
27
+ import { INotificationPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/notificationpane/interfaces/INotificationPaneProps";
27
28
  export interface ILiveChatWidgetProps {
28
29
  audioNotificationProps?: IAudioNotificationProps;
29
30
  callingContainerProps?: ICallingContainerProps;
@@ -50,6 +51,7 @@ export interface ILiveChatWidgetProps {
50
51
  startChatErrorPaneProps?: IStartChatErrorPaneProps;
51
52
  styleProps?: ILiveChatWidgetStyleProps;
52
53
  telemetryConfig: ITelemetryConfig;
54
+ notificationPaneProps?: INotificationPaneProps;
53
55
  webChatContainerProps?: IWebChatContainerStatefulProps;
54
56
  liveChatContextFromCache?: ILiveChatWidgetContext;
55
57
  contextDataStore?: IContextDataStore;
@@ -0,0 +1,3 @@
1
+ import { INotificationPaneStatefulProps } from "./interfaces/INotificationPaneStatefulProps";
2
+ export declare const NotificationPaneStateful: (props: INotificationPaneStatefulProps) => JSX.Element;
3
+ export default NotificationPaneStateful;
@@ -0,0 +1,2 @@
1
+ import { IChatDisconnectControlProps } from "@microsoft/omnichannel-chat-components/lib/types/components/notificationpane/interfaces/chatdisconnect/IChatDisconnectControlProps";
2
+ export declare const defaultChatDisconnectControlProps: IChatDisconnectControlProps;
@@ -0,0 +1,2 @@
1
+ import { IChatDisconnectStyleProps } from "@microsoft/omnichannel-chat-components/lib/types/components/notificationpane/interfaces/chatdisconnect/IChatDisconnectStyleProps";
2
+ export declare const defaultChatDisconnectStyleProps: IChatDisconnectStyleProps;
@@ -0,0 +1,13 @@
1
+ import { INotificationPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/notificationpane/interfaces/INotificationPaneProps";
2
+ export interface INotificationPaneStatefulProps extends INotificationPaneProps {
3
+ notificationPaneProps?: INotificationPaneProps;
4
+ notificationScenarioType?: string;
5
+ /**
6
+ * endChat: Internal Prop injected for triggering end of a chat using chatSDK
7
+ * @param adapter : The chat adapter for the live chat session
8
+ * @param skipEndChatSDK : If set to true endchat will skip chatSDK endChat call
9
+ * @param skipCloseChat : If set to true endchat will skip closing the live chat instance
10
+ * @param postMessageToOtherTab : If set to true endchat will send a message to other tabs(multi-tabs)
11
+ */
12
+ endChat: (adapter: any, skipEndChatSDK?: boolean, skipCloseChat?: boolean, postMessageToOtherTab?: boolean) => Promise<void>;
13
+ }
@@ -9,6 +9,7 @@ export interface IRenderingMiddlewareProps {
9
9
  disableGroupActivitiesMiddleware?: boolean;
10
10
  disableTypingIndicatorMiddleware?: boolean;
11
11
  disableThirdPartyCookiesAlert?: boolean;
12
+ disableToastMiddleware?: boolean;
12
13
  hideSendboxOnConversationEnd?: boolean;
13
14
  userMessageStyleProps?: React.CSSProperties;
14
15
  systemMessageStyleProps?: React.CSSProperties;
@@ -0,0 +1,3 @@
1
+ import { INotificationPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/notificationpane/interfaces/INotificationPaneProps";
2
+ declare const createToastMiddleware: (notificationPaneProps: INotificationPaneProps | undefined, endChat: any) => () => (next: any) => (card: any) => any;
3
+ export default createToastMiddleware;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "1.2.4-main.9847fc4",
3
+ "version": "1.3.0",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -74,8 +74,8 @@
74
74
  "webpack-cli": "^4.9.2"
75
75
  },
76
76
  "dependencies": {
77
- "@microsoft/omnichannel-chat-components": "^1.0.6",
78
- "@microsoft/omnichannel-chat-sdk": "1.4.6",
77
+ "@microsoft/omnichannel-chat-components": "^1.0.7",
78
+ "@microsoft/omnichannel-chat-sdk": "1.4.7",
79
79
  "abort-controller-es5": "^2.0.1",
80
80
  "dompurify": "^2.3.4",
81
81
  "markdown-it": "^12.3.2",