@microsoft/omnichannel-chat-widget 1.6.4-main.635e255 → 1.6.4

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.
@@ -22,6 +22,7 @@ _defineProperty(Constants, "sentMessageClassName", "ms_lcw_webchat_sent_message"
22
22
  _defineProperty(Constants, "webchatChannelId", "webchat");
23
23
  _defineProperty(Constants, "markdown", "markdown");
24
24
  _defineProperty(Constants, "actionType", "actionType");
25
+ _defineProperty(Constants, "markDownSystemMessageClass", "webchat__basic-transcript__activity-markdown-body");
25
26
  _defineProperty(Constants, "String", "string");
26
27
  _defineProperty(Constants, "ChatMessagesJson", "chatMessagesJson");
27
28
  _defineProperty(Constants, "truePascal", "True");
@@ -268,15 +268,17 @@ exports.chatSDKStateCleanUp = chatSDKStateCleanUp;
268
268
  const endVoiceVideoCallIfOngoing = async (chatSDK, dispatch) => {
269
269
  let callId = "";
270
270
  try {
271
- const voiceVideoCallingSdk = await chatSDK.getVoiceVideoCalling();
272
- if (voiceVideoCallingSdk && voiceVideoCallingSdk.isInACall()) {
273
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
274
- callId = voiceVideoCallingSdk.callId;
275
- voiceVideoCallingSdk.stopCall();
276
- _TelemetryHelper.TelemetryHelper.logCallingEvent(_TelemetryConstants.LogLevel.INFO, {
277
- Event: _TelemetryConstants.TelemetryEvent.EndCallButtonClick
278
- }, callId);
279
- callingStateCleanUp(dispatch);
271
+ if (chatSDK.isVoiceVideoCallingEnabled()) {
272
+ const voiceVideoCallingSdk = await chatSDK.getVoiceVideoCalling();
273
+ if (voiceVideoCallingSdk && voiceVideoCallingSdk.isInACall()) {
274
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
275
+ callId = voiceVideoCallingSdk.callId;
276
+ voiceVideoCallingSdk.stopCall();
277
+ _TelemetryHelper.TelemetryHelper.logCallingEvent(_TelemetryConstants.LogLevel.INFO, {
278
+ Event: _TelemetryConstants.TelemetryEvent.EndCallButtonClick
279
+ }, callId);
280
+ callingStateCleanUp(dispatch);
281
+ }
280
282
  }
281
283
  } catch (error) {
282
284
  _TelemetryHelper.TelemetryHelper.logCallingEvent(_TelemetryConstants.LogLevel.ERROR, {
@@ -40,7 +40,7 @@ var _toastMiddleware = _interopRequireDefault(require("../../webchatcontainersta
40
40
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41
41
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
42
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
+ var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _props$webChatContain4, _state$domainStates$c, _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;
44
44
  // Add a hook to make all links open a new window
45
45
  postDomPurifyActivities();
46
46
  const localizedTexts = {
@@ -49,8 +49,9 @@ const initWebChatComposer = (props, state, dispatch, chatSDK, endChat) => {
49
49
  };
50
50
  const hyperlinkTextOverride = ((_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 ? void 0 : _props$webChatContain2.hyperlinkTextOverride) ?? _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.hyperlinkTextOverride;
51
51
  const disableNewLineMarkdownSupport = ((_props$webChatContain3 = props.webChatContainerProps) === null || _props$webChatContain3 === void 0 ? void 0 : _props$webChatContain3.disableNewLineMarkdownSupport) ?? _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.disableNewLineMarkdownSupport;
52
+ const disableMarkdownMessageFormatting = ((_props$webChatContain4 = props.webChatContainerProps) === null || _props$webChatContain4 === void 0 ? void 0 : _props$webChatContain4.disableMarkdownMessageFormatting) ?? _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.disableMarkdownMessageFormatting;
52
53
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
53
- const markdown = (0, _createMarkdown.createMarkdown)(((_props$webChatContain4 = props.webChatContainerProps) === null || _props$webChatContain4 === void 0 ? void 0 : _props$webChatContain4.disableMarkdownMessageFormatting) ?? _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.disableMarkdownMessageFormatting, disableNewLineMarkdownSupport);
54
+ const markdown = (0, _createMarkdown.createMarkdown)(disableMarkdownMessageFormatting, disableNewLineMarkdownSupport);
54
55
  // Initialize Web Chat's redux store
55
56
  let webChatStore = _WebChatStoreLoader.WebChatStoreLoader.store;
56
57
  if (!webChatStore) {
@@ -99,7 +100,7 @@ const initWebChatComposer = (props, state, dispatch, chatSDK, endChat) => {
99
100
  var _props$webChatContain8;
100
101
  text = (_props$webChatContain8 = props.webChatContainerProps) === null || _props$webChatContain8 === void 0 ? void 0 : _props$webChatContain8.webChatProps.renderMarkdown(text);
101
102
  } else {
102
- const render = disableNewLineMarkdownSupport ? markdown.renderInline.bind(markdown) : markdown.render.bind(markdown);
103
+ const render = disableMarkdownMessageFormatting ? markdown.renderInline.bind(markdown) : markdown.render.bind(markdown);
103
104
  text = render(text);
104
105
  }
105
106
  markdownRenderers.forEach(renderer => {
@@ -119,10 +120,11 @@ const initWebChatComposer = (props, state, dispatch, chatSDK, endChat) => {
119
120
  // Initialize the remaining Web Chat props
120
121
  const webChatProps = {
121
122
  ..._defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatProps,
123
+ userID: ((_state$domainStates$c = state.domainStates.chatToken) === null || _state$domainStates$c === void 0 ? void 0 : _state$domainStates$c.visitorId) || "teamsvisitor",
122
124
  dir: state.domainStates.globalDir,
123
125
  locale: (0, _utils.changeLanguageCodeFormatForWebChat)((0, _omnichannelChatSdk.getLocaleStringFromId)((_state$domainStates$l4 = state.domainStates.liveChatConfig) === null || _state$domainStates$l4 === void 0 ? void 0 : (_state$domainStates$l5 = _state$domainStates$l4.ChatWidgetLanguage) === null || _state$domainStates$l5 === void 0 ? void 0 : _state$domainStates$l5.msdyn_localeid)),
124
126
  store: webChatStore,
125
- 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),
127
+ 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)(renderMarkdown, (_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),
126
128
  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),
127
129
  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,
128
130
  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),
@@ -63,7 +63,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
63
63
  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; }
64
64
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
65
65
  const LiveChatWidgetStateful = props => {
66
- var _props$webChatContain, _props$styleProps, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain5, _state$appStates14, _props$webChatContain6, _props$controlProps12, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _props$webChatContain7, _props$webChatContain8, _props$webChatContain9, _props$webChatContain10, _livechatProps$webCha, _livechatProps$styleP, _livechatProps$contro, _livechatProps$contro2, _livechatProps$compon, _livechatProps$contro3, _livechatProps$compon2, _livechatProps$contro4, _livechatProps$compon3, _livechatProps$contro5, _livechatProps$compon4, _livechatProps$contro6, _livechatProps$compon5, _livechatProps$contro7, _livechatProps$compon6, _livechatProps$contro8, _livechatProps$compon7, _livechatProps$contro9, _livechatProps$compon8, _livechatProps$contro10, _livechatProps$contro11, _livechatProps$compon9, _livechatProps$contro12, _livechatProps$compon10, _livechatProps$contro13, _livechatProps$compon11, _livechatProps$compon12, _livechatProps$compon13;
66
+ var _props$webChatContain, _props$styleProps, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain5, _state$appStates14, _props$webChatContain7, _props$webChatContain8, _props$controlProps12, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _props$webChatContain9, _props$webChatContain10, _props$webChatContain11, _props$webChatContain12, _livechatProps$webCha, _livechatProps$styleP, _livechatProps$contro, _livechatProps$contro2, _livechatProps$compon, _livechatProps$contro3, _livechatProps$compon2, _livechatProps$contro4, _livechatProps$compon3, _livechatProps$contro5, _livechatProps$compon4, _livechatProps$contro6, _livechatProps$compon5, _livechatProps$contro7, _livechatProps$compon6, _livechatProps$contro8, _livechatProps$compon7, _livechatProps$contro9, _livechatProps$compon8, _livechatProps$contro10, _livechatProps$contro11, _livechatProps$compon9, _livechatProps$contro12, _livechatProps$compon10, _livechatProps$contro13, _livechatProps$compon11, _livechatProps$compon12, _livechatProps$compon13;
67
67
  const [state, dispatch] = (0, _useChatContextStore.default)();
68
68
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
69
69
  const [adapter, setAdapter] = (0, _useChatAdapterStore.default)();
@@ -652,6 +652,15 @@ const LiveChatWidgetStateful = props => {
652
652
  (0, _react2.useEffect)(() => {
653
653
  (0, _chatDisconnectHelper.handleChatDisconnect)(props, state, setWebChatStyles);
654
654
  }, [state.appStates.chatDisconnectEventReceived]);
655
+
656
+ // if props state gets updates we need to update the renderingMiddlewareProps in the state
657
+ (0, _react2.useEffect)(() => {
658
+ var _props$webChatContain6;
659
+ dispatch({
660
+ type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_RENDERING_MIDDLEWARE_PROPS,
661
+ payload: (_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.renderingMiddlewareProps
662
+ });
663
+ }, [(_props$webChatContain7 = props.webChatContainerProps) === null || _props$webChatContain7 === void 0 ? void 0 : _props$webChatContain7.renderingMiddlewareProps]);
655
664
  const initiateEndChatOnBrowserUnload = () => {
656
665
  var _DataStoreManager$cli;
657
666
  _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
@@ -687,7 +696,7 @@ const LiveChatWidgetStateful = props => {
687
696
  const webChatProps = (0, _initWebChatComposer.initWebChatComposer)(props, state, dispatch, chatSDK, endChatRelay);
688
697
  const downloadTranscriptProps = (0, _createDownloadTranscriptProps.default)(props.downloadTranscriptProps, {
689
698
  ...(_defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps === null || _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps === void 0 ? void 0 : _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles),
690
- ...((_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.webChatStyles)
699
+ ...((_props$webChatContain8 = props.webChatContainerProps) === null || _props$webChatContain8 === void 0 ? void 0 : _props$webChatContain8.webChatStyles)
691
700
  }, props.webChatContainerProps);
692
701
  const livechatProps = {
693
702
  ...props,
@@ -726,11 +735,20 @@ const LiveChatWidgetStateful = props => {
726
735
  ::-webkit-scrollbar-thumb:hover {
727
736
  background: ${scrollbarProps.thumbHoverColor};
728
737
  }
738
+
739
+ .webchat__basic-transcript__activity-markdown-body > :last-child {
740
+ margin-bottom: 0px;
741
+ }
742
+
743
+ .webchat__basic-transcript__activity-markdown-body > :first-child {
744
+ margin-top: 0px;
745
+ }
746
+ }
729
747
  `), /*#__PURE__*/_react2.default.createElement(_DraggableChatWidget.default, chatWidgetDraggableConfig, /*#__PURE__*/_react2.default.createElement(Composer, _extends({}, webChatProps, {
730
748
  styleOptions: {
731
749
  ...webChatStyles,
732
- bubbleBackground: ((_props$webChatContain7 = props.webChatContainerProps) === null || _props$webChatContain7 === void 0 ? void 0 : (_props$webChatContain8 = _props$webChatContain7.adaptiveCardStyles) === null || _props$webChatContain8 === void 0 ? void 0 : _props$webChatContain8.background) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.background,
733
- bubbleTextColor: ((_props$webChatContain9 = props.webChatContainerProps) === null || _props$webChatContain9 === void 0 ? void 0 : (_props$webChatContain10 = _props$webChatContain9.adaptiveCardStyles) === null || _props$webChatContain10 === void 0 ? void 0 : _props$webChatContain10.color) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.color
750
+ bubbleBackground: ((_props$webChatContain9 = props.webChatContainerProps) === null || _props$webChatContain9 === void 0 ? void 0 : (_props$webChatContain10 = _props$webChatContain9.adaptiveCardStyles) === null || _props$webChatContain10 === void 0 ? void 0 : _props$webChatContain10.background) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.background,
751
+ bubbleTextColor: ((_props$webChatContain11 = props.webChatContainerProps) === null || _props$webChatContain11 === void 0 ? void 0 : (_props$webChatContain12 = _props$webChatContain11.adaptiveCardStyles) === null || _props$webChatContain12 === void 0 ? void 0 : _props$webChatContain12.color) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.color
734
752
  },
735
753
  directLine: ((_livechatProps$webCha = livechatProps.webChatContainerProps) === null || _livechatProps$webCha === void 0 ? void 0 : _livechatProps$webCha.directLine) ?? adapter ?? _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.directLine
736
754
  }), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
@@ -55,7 +55,7 @@ const createMagicCodeSuccessResponse = signin => {
55
55
  };
56
56
  };
57
57
  const WebChatContainerStateful = props => {
58
- var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _props$webChatContain5, _props$webChatContain6, _defaultWebChatContai, _props$webChatContain7, _props$webChatContain8, _defaultWebChatContai2, _webChatContainerProp7, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14;
58
+ var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _props$webChatContain5, _props$webChatContain6, _defaultWebChatContai, _props$webChatContain7, _props$webChatContain8, _defaultWebChatContai2, _webChatContainerProp7, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _props$webChatContain9, _props$webChatContain10;
59
59
  const {
60
60
  BasicWebChat
61
61
  } = _botframeworkWebchat.Components;
@@ -185,10 +185,10 @@ const WebChatContainerStateful = props => {
185
185
 
186
186
  .webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp8 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp8 === void 0 ? void 0 : _webChatContainerProp8.buttonWhiteSpace) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.buttonWhiteSpace} !important;}
187
187
 
188
- .ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon {
189
- background-image : url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03LjI1MDEgNC41MDAxN0gxMC43NDk1QzExLjE2MzcgNC41MDAxNyAxMS40OTk1IDQuODM1OTYgMTEuNDk5NSA1LjI1MDE3QzExLjQ5OTUgNS42Mjk4NiAxMS4yMTczIDUuOTQzNjYgMTAuODUxMyA1Ljk5MzMyTDEwLjc0OTUgNi4wMDAxN0g3LjI0OTc0QzYuMDcwNzkgNS45OTk2MSA1LjEwMzQ5IDYuOTA2NTYgNS4wMDc4NiA4LjA2MTEyTDUuMDAwMjggOC4yMjAwM0w1LjAwMzEyIDE2Ljc1MDdDNS4wMDM0MyAxNy45NDE1IDUuOTI4ODUgMTguOTE2MSA3LjA5OTY2IDE4Ljk5NDlMNy4yNTM3MSAxOS4wMDAxTDE1Ljc1MTggMTguOTg4NEMxNi45NDE1IDE4Ljk4NjggMTcuOTE0NSAxOC4wNjIgMTcuOTkzNSAxNi44OTIzT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E5LjQ5ODkgNS41NjE0N0wxMi4yNzk3IDEyLjc4NDdDMTIuMDEzNCAxMy4wNTEgMTEuNTk2OCAxMy4wNzUzIDExLjMwMzEgMTIuODU3NUwxMS4yMTkgMTIuNzg0OUMxMC45NTI3IDEyLjUxODcgMTAuOTI4NCAxMi4xMDIxIDExLjE0NjIgMTEuODA4NEwxMS4yMTg4IDExLjcyNDNMMTguNDM2OSA0LjUwMTQ2SDEzLjc0ODFDMTMuMzY4NCA0LjUwMTQ2IDEzLjA1NDYgNC4yMTkzMSAxMy4wMDUgMy44NTMyNEwxMi45OTgxIDMuNzUxNDZDMTIuOTk4MSAzLjM3MTc3IDEzLjI4MDMgMy4wNTc5NyAxMy42NDY0IDMuMDA4MzFMMTMuNzQ4MSAzLjAwMTQ2WiIgZmlsbD0iI0ZGRkZGRiIgLz48L3N2Zz4) !important;
190
- height: '.75em';
191
- marginLeft: '.25em';
188
+ .ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon, img.webchat__render-markdown__external-link-icon {
189
+ background-image : url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1Mzcx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0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjMjEyMTIxIiAvPjwvc3ZnPg==) !important;
190
+ height: .75em;
191
+ margin-left: .25em;
192
192
  filter:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp9 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp9 === void 0 ? void 0 : (_webChatContainerProp10 = _webChatContainerProp9.receivedMessageAnchorStyles) === null || _webChatContainerProp10 === void 0 ? void 0 : _webChatContainerProp10.filter) ?? (_defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === null || _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === void 0 ? void 0 : _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles.filter)};
193
193
  }
194
194
  pre {
@@ -214,8 +214,13 @@ const WebChatContainerStateful = props => {
214
214
  .webchat__bubble:not(.webchat__bubble--from-user) .webchat__bubble__content {
215
215
  border-radius: 0 !important; /* Override border-radius */
216
216
  }
217
+
218
+ .webchat__stacked-layout_container>div {
219
+ background: ${(props === null || props === void 0 ? void 0 : (_props$webChatContain9 = props.webChatContainerProps) === null || _props$webChatContain9 === void 0 ? void 0 : (_props$webChatContain10 = _props$webChatContain9.containerStyles) === null || _props$webChatContain10 === void 0 ? void 0 : _props$webChatContain10.background) ?? ""}
220
+ }
217
221
  `), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
218
- styles: containerStyles
222
+ styles: containerStyles,
223
+ className: "webchat__stacked-layout_container"
219
224
  }, /*#__PURE__*/_react2.default.createElement(BasicWebChat, null)));
220
225
  };
221
226
  exports.WebChatContainerStateful = WebChatContainerStateful;
@@ -24,9 +24,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
24
24
  ******/
25
25
 
26
26
  const loggedSystemMessages = new Array();
27
-
28
27
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
- const handleSystemMessage = (next, args, card, systemMessageStyleProps) => {
28
+ const handleSystemMessage = (next, args, card, renderMarkdown, systemMessageStyleProps) => {
30
29
  var _card$activity, _card$activity$channe, _card$activity$channe2, _card$activity2, _card$activity2$chann, _card$activity3, _card$activity3$chann, _card$activity3$chann2, _card$activity4, _card$activity4$chann, _card$activity5, _card$activity5$chann, _card$nextVisibleActi, _card$nextVisibleActi2, _card$activity6, _card$activity6$chann, _card$activity7, _card$nextVisibleActi3, _card$activity8;
31
30
  const systemMessageStyles = {
32
31
  ..._defaultSystemMessageStyles.defaultSystemMessageStyles,
@@ -49,14 +48,15 @@ const handleSystemMessage = (next, args, card, systemMessageStyleProps) => {
49
48
  if ((_card$activity5 = card.activity) !== null && _card$activity5 !== void 0 && (_card$activity5$chann = _card$activity5.channelData) !== null && _card$activity5$chann !== void 0 && _card$activity5$chann.clientmessageid && ((_card$nextVisibleActi = card.nextVisibleActivity) === null || _card$nextVisibleActi === void 0 ? void 0 : (_card$nextVisibleActi2 = _card$nextVisibleActi.channelData) === null || _card$nextVisibleActi2 === void 0 ? void 0 : _card$nextVisibleActi2.clientmessageid) === ((_card$activity6 = card.activity) === null || _card$activity6 === void 0 ? void 0 : (_card$activity6$chann = _card$activity6.channelData) === null || _card$activity6$chann === void 0 ? void 0 : _card$activity6$chann.clientmessageid) || (_card$activity7 = card.activity) !== null && _card$activity7 !== void 0 && _card$activity7.messageid && ((_card$nextVisibleActi3 = card.nextVisibleActivity) === null || _card$nextVisibleActi3 === void 0 ? void 0 : _card$nextVisibleActi3.messageid) === ((_card$activity8 = card.activity) === null || _card$activity8 === void 0 ? void 0 : _card$activity8.messageid)) {
50
49
  return () => false;
51
50
  }
52
-
51
+ card.activity.text = renderMarkdown(card.activity.text);
53
52
  // eslint-disable-next-line react/display-name
54
53
  return () => /*#__PURE__*/_react.default.createElement("div", {
55
54
  key: card.activity.id,
56
55
  style: systemMessageStyles,
57
56
  "aria-hidden": "false",
57
+ className: _Constants.Constants.markDownSystemMessageClass,
58
58
  dangerouslySetInnerHTML: {
59
- __html: (0, _utils.escapeHtml)(card.activity.text)
59
+ __html: card.activity.text
60
60
  }
61
61
  });
62
62
  };
@@ -72,7 +72,7 @@ const isDataTagsPresent = card => {
72
72
  };
73
73
 
74
74
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
75
- const createActivityMiddleware = (systemMessageStyleProps, userMessageStyleProps) => () => next => function () {
75
+ const createActivityMiddleware = (renderMarkdown, systemMessageStyleProps, userMessageStyleProps) => () => next => function () {
76
76
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
77
77
  args[_key] = arguments[_key];
78
78
  }
@@ -86,7 +86,7 @@ const createActivityMiddleware = (systemMessageStyleProps, userMessageStyleProps
86
86
  return () => false;
87
87
  }
88
88
  if (isTagIncluded(card, _Constants.Constants.systemMessageTag)) {
89
- return handleSystemMessage(next, args, card, systemMessageStyleProps);
89
+ return handleSystemMessage(next, args, card, renderMarkdown, systemMessageStyleProps);
90
90
  } else if (card.activity.text && card.activity.type === _DirectLineActivityType.DirectLineActivityType.Message) {
91
91
  if (!card.activity.channelData.isHtmlEncoded && card.activity.channelId === _Constants.Constants.webchatChannelId) {
92
92
  card.activity.text = (0, _utils.escapeHtml)(card.activity.text);
@@ -9,6 +9,7 @@ var _dompurify = _interopRequireDefault(require("dompurify"));
9
9
  var _WebChatActionType = require("../../enums/WebChatActionType");
10
10
  var _TelemetryHelper = require("../../../../../common/telemetry/TelemetryHelper");
11
11
  var _TelemetryConstants = require("../../../../../common/telemetry/TelemetryConstants");
12
+ var _simpleUpdateIn = _interopRequireDefault(require("simple-update-in"));
12
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
14
  /******
14
15
  * HTMLTextMiddleware
@@ -70,7 +71,7 @@ const processHTMLText = (action, text) => {
70
71
  }
71
72
 
72
73
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
73
- action = window.simpleUpdateIn(action, [_Constants.Constants.payload, _Constants.Constants.activity, _Constants.Constants.text], () => htmlNode.innerHTML);
74
+ action = (0, _simpleUpdateIn.default)(action, [_Constants.Constants.payload, _Constants.Constants.activity, _Constants.Constants.text], () => htmlNode.innerHTML);
74
75
  } catch (e) {
75
76
  let errorMessage = "Failed to apply action: ";
76
77
  try {
@@ -15,6 +15,7 @@ _defineProperty(Constants, "sentMessageClassName", "ms_lcw_webchat_sent_message"
15
15
  _defineProperty(Constants, "webchatChannelId", "webchat");
16
16
  _defineProperty(Constants, "markdown", "markdown");
17
17
  _defineProperty(Constants, "actionType", "actionType");
18
+ _defineProperty(Constants, "markDownSystemMessageClass", "webchat__basic-transcript__activity-markdown-body");
18
19
  _defineProperty(Constants, "String", "string");
19
20
  _defineProperty(Constants, "ChatMessagesJson", "chatMessagesJson");
20
21
  _defineProperty(Constants, "truePascal", "True");
@@ -257,15 +257,17 @@ export const chatSDKStateCleanUp = chatSDK => {
257
257
  export const endVoiceVideoCallIfOngoing = async (chatSDK, dispatch) => {
258
258
  let callId = "";
259
259
  try {
260
- const voiceVideoCallingSdk = await chatSDK.getVoiceVideoCalling();
261
- if (voiceVideoCallingSdk && voiceVideoCallingSdk.isInACall()) {
262
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
263
- callId = voiceVideoCallingSdk.callId;
264
- voiceVideoCallingSdk.stopCall();
265
- TelemetryHelper.logCallingEvent(LogLevel.INFO, {
266
- Event: TelemetryEvent.EndCallButtonClick
267
- }, callId);
268
- callingStateCleanUp(dispatch);
260
+ if (chatSDK.isVoiceVideoCallingEnabled()) {
261
+ const voiceVideoCallingSdk = await chatSDK.getVoiceVideoCalling();
262
+ if (voiceVideoCallingSdk && voiceVideoCallingSdk.isInACall()) {
263
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
264
+ callId = voiceVideoCallingSdk.callId;
265
+ voiceVideoCallingSdk.stopCall();
266
+ TelemetryHelper.logCallingEvent(LogLevel.INFO, {
267
+ Event: TelemetryEvent.EndCallButtonClick
268
+ }, callId);
269
+ callingStateCleanUp(dispatch);
270
+ }
269
271
  }
270
272
  } catch (error) {
271
273
  TelemetryHelper.logCallingEvent(LogLevel.ERROR, {
@@ -34,7 +34,7 @@ import createToastMiddleware from "../../webchatcontainerstateful/webchatcontrol
34
34
 
35
35
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
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
+ var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _props$webChatContain4, _state$domainStates$c, _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;
38
38
  // Add a hook to make all links open a new window
39
39
  postDomPurifyActivities();
40
40
  const localizedTexts = {
@@ -43,8 +43,9 @@ export const initWebChatComposer = (props, state, dispatch, chatSDK, endChat) =>
43
43
  };
44
44
  const hyperlinkTextOverride = ((_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 ? void 0 : _props$webChatContain2.hyperlinkTextOverride) ?? defaultWebChatContainerStatefulProps.hyperlinkTextOverride;
45
45
  const disableNewLineMarkdownSupport = ((_props$webChatContain3 = props.webChatContainerProps) === null || _props$webChatContain3 === void 0 ? void 0 : _props$webChatContain3.disableNewLineMarkdownSupport) ?? defaultWebChatContainerStatefulProps.disableNewLineMarkdownSupport;
46
+ const disableMarkdownMessageFormatting = ((_props$webChatContain4 = props.webChatContainerProps) === null || _props$webChatContain4 === void 0 ? void 0 : _props$webChatContain4.disableMarkdownMessageFormatting) ?? defaultWebChatContainerStatefulProps.disableMarkdownMessageFormatting;
46
47
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
47
- const markdown = createMarkdown(((_props$webChatContain4 = props.webChatContainerProps) === null || _props$webChatContain4 === void 0 ? void 0 : _props$webChatContain4.disableMarkdownMessageFormatting) ?? defaultWebChatContainerStatefulProps.disableMarkdownMessageFormatting, disableNewLineMarkdownSupport);
48
+ const markdown = createMarkdown(disableMarkdownMessageFormatting, disableNewLineMarkdownSupport);
48
49
  // Initialize Web Chat's redux store
49
50
  let webChatStore = WebChatStoreLoader.store;
50
51
  if (!webChatStore) {
@@ -93,7 +94,7 @@ export const initWebChatComposer = (props, state, dispatch, chatSDK, endChat) =>
93
94
  var _props$webChatContain8;
94
95
  text = (_props$webChatContain8 = props.webChatContainerProps) === null || _props$webChatContain8 === void 0 ? void 0 : _props$webChatContain8.webChatProps.renderMarkdown(text);
95
96
  } else {
96
- const render = disableNewLineMarkdownSupport ? markdown.renderInline.bind(markdown) : markdown.render.bind(markdown);
97
+ const render = disableMarkdownMessageFormatting ? markdown.renderInline.bind(markdown) : markdown.render.bind(markdown);
97
98
  text = render(text);
98
99
  }
99
100
  markdownRenderers.forEach(renderer => {
@@ -113,10 +114,11 @@ export const initWebChatComposer = (props, state, dispatch, chatSDK, endChat) =>
113
114
  // Initialize the remaining Web Chat props
114
115
  const webChatProps = {
115
116
  ...defaultWebChatContainerStatefulProps.webChatProps,
117
+ userID: ((_state$domainStates$c = state.domainStates.chatToken) === null || _state$domainStates$c === void 0 ? void 0 : _state$domainStates$c.visitorId) || "teamsvisitor",
116
118
  dir: state.domainStates.globalDir,
117
119
  locale: changeLanguageCodeFormatForWebChat(getLocaleStringFromId((_state$domainStates$l4 = state.domainStates.liveChatConfig) === null || _state$domainStates$l4 === void 0 ? void 0 : (_state$domainStates$l5 = _state$domainStates$l4.ChatWidgetLanguage) === null || _state$domainStates$l5 === void 0 ? void 0 : _state$domainStates$l5.msdyn_localeid)),
118
120
  store: webChatStore,
119
- 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),
121
+ 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(renderMarkdown, (_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),
120
122
  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),
121
123
  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,
122
124
  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),
@@ -55,7 +55,7 @@ import StartChatErrorPaneStateful from "../../startchaterrorpanestateful/StartCh
55
55
  import { StartChatFailureType } from "../../../contexts/common/StartChatFailureType";
56
56
  import { executeReducer } from "../../../contexts/createReducer";
57
57
  export const LiveChatWidgetStateful = props => {
58
- var _props$webChatContain, _props$styleProps, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain5, _state$appStates14, _props$webChatContain6, _props$controlProps12, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _props$webChatContain7, _props$webChatContain8, _props$webChatContain9, _props$webChatContain10, _livechatProps$webCha, _livechatProps$styleP, _livechatProps$contro, _livechatProps$contro2, _livechatProps$compon, _livechatProps$contro3, _livechatProps$compon2, _livechatProps$contro4, _livechatProps$compon3, _livechatProps$contro5, _livechatProps$compon4, _livechatProps$contro6, _livechatProps$compon5, _livechatProps$contro7, _livechatProps$compon6, _livechatProps$contro8, _livechatProps$compon7, _livechatProps$contro9, _livechatProps$compon8, _livechatProps$contro10, _livechatProps$contro11, _livechatProps$compon9, _livechatProps$contro12, _livechatProps$compon10, _livechatProps$contro13, _livechatProps$compon11, _livechatProps$compon12, _livechatProps$compon13;
58
+ var _props$webChatContain, _props$styleProps, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain5, _state$appStates14, _props$webChatContain7, _props$webChatContain8, _props$controlProps12, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _props$webChatContain9, _props$webChatContain10, _props$webChatContain11, _props$webChatContain12, _livechatProps$webCha, _livechatProps$styleP, _livechatProps$contro, _livechatProps$contro2, _livechatProps$compon, _livechatProps$contro3, _livechatProps$compon2, _livechatProps$contro4, _livechatProps$compon3, _livechatProps$contro5, _livechatProps$compon4, _livechatProps$contro6, _livechatProps$compon5, _livechatProps$contro7, _livechatProps$compon6, _livechatProps$contro8, _livechatProps$compon7, _livechatProps$contro9, _livechatProps$compon8, _livechatProps$contro10, _livechatProps$contro11, _livechatProps$compon9, _livechatProps$contro12, _livechatProps$compon10, _livechatProps$contro13, _livechatProps$compon11, _livechatProps$compon12, _livechatProps$compon13;
59
59
  const [state, dispatch] = useChatContextStore();
60
60
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
61
61
  const [adapter, setAdapter] = useChatAdapterStore();
@@ -644,6 +644,15 @@ export const LiveChatWidgetStateful = props => {
644
644
  useEffect(() => {
645
645
  handleChatDisconnect(props, state, setWebChatStyles);
646
646
  }, [state.appStates.chatDisconnectEventReceived]);
647
+
648
+ // if props state gets updates we need to update the renderingMiddlewareProps in the state
649
+ useEffect(() => {
650
+ var _props$webChatContain6;
651
+ dispatch({
652
+ type: LiveChatWidgetActionType.SET_RENDERING_MIDDLEWARE_PROPS,
653
+ payload: (_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.renderingMiddlewareProps
654
+ });
655
+ }, [(_props$webChatContain7 = props.webChatContainerProps) === null || _props$webChatContain7 === void 0 ? void 0 : _props$webChatContain7.renderingMiddlewareProps]);
647
656
  const initiateEndChatOnBrowserUnload = () => {
648
657
  var _DataStoreManager$cli;
649
658
  TelemetryHelper.logActionEvent(LogLevel.INFO, {
@@ -679,7 +688,7 @@ export const LiveChatWidgetStateful = props => {
679
688
  const webChatProps = initWebChatComposer(props, state, dispatch, chatSDK, endChatRelay);
680
689
  const downloadTranscriptProps = createDownloadTranscriptProps(props.downloadTranscriptProps, {
681
690
  ...(defaultWebChatContainerStatefulProps === null || defaultWebChatContainerStatefulProps === void 0 ? void 0 : defaultWebChatContainerStatefulProps.webChatStyles),
682
- ...((_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.webChatStyles)
691
+ ...((_props$webChatContain8 = props.webChatContainerProps) === null || _props$webChatContain8 === void 0 ? void 0 : _props$webChatContain8.webChatStyles)
683
692
  }, props.webChatContainerProps);
684
693
  const livechatProps = {
685
694
  ...props,
@@ -718,11 +727,20 @@ export const LiveChatWidgetStateful = props => {
718
727
  ::-webkit-scrollbar-thumb:hover {
719
728
  background: ${scrollbarProps.thumbHoverColor};
720
729
  }
730
+
731
+ .webchat__basic-transcript__activity-markdown-body > :last-child {
732
+ margin-bottom: 0px;
733
+ }
734
+
735
+ .webchat__basic-transcript__activity-markdown-body > :first-child {
736
+ margin-top: 0px;
737
+ }
738
+ }
721
739
  `), /*#__PURE__*/React.createElement(DraggableChatWidget, chatWidgetDraggableConfig, /*#__PURE__*/React.createElement(Composer, _extends({}, webChatProps, {
722
740
  styleOptions: {
723
741
  ...webChatStyles,
724
- bubbleBackground: ((_props$webChatContain7 = props.webChatContainerProps) === null || _props$webChatContain7 === void 0 ? void 0 : (_props$webChatContain8 = _props$webChatContain7.adaptiveCardStyles) === null || _props$webChatContain8 === void 0 ? void 0 : _props$webChatContain8.background) ?? defaultAdaptiveCardStyles.background,
725
- bubbleTextColor: ((_props$webChatContain9 = props.webChatContainerProps) === null || _props$webChatContain9 === void 0 ? void 0 : (_props$webChatContain10 = _props$webChatContain9.adaptiveCardStyles) === null || _props$webChatContain10 === void 0 ? void 0 : _props$webChatContain10.color) ?? defaultAdaptiveCardStyles.color
742
+ bubbleBackground: ((_props$webChatContain9 = props.webChatContainerProps) === null || _props$webChatContain9 === void 0 ? void 0 : (_props$webChatContain10 = _props$webChatContain9.adaptiveCardStyles) === null || _props$webChatContain10 === void 0 ? void 0 : _props$webChatContain10.background) ?? defaultAdaptiveCardStyles.background,
743
+ bubbleTextColor: ((_props$webChatContain11 = props.webChatContainerProps) === null || _props$webChatContain11 === void 0 ? void 0 : (_props$webChatContain12 = _props$webChatContain11.adaptiveCardStyles) === null || _props$webChatContain12 === void 0 ? void 0 : _props$webChatContain12.color) ?? defaultAdaptiveCardStyles.color
726
744
  },
727
745
  directLine: ((_livechatProps$webCha = livechatProps.webChatContainerProps) === null || _livechatProps$webCha === void 0 ? void 0 : _livechatProps$webCha.directLine) ?? adapter ?? defaultWebChatContainerStatefulProps.directLine
728
746
  }), /*#__PURE__*/React.createElement(Stack, {
@@ -47,7 +47,7 @@ const createMagicCodeSuccessResponse = signin => {
47
47
  };
48
48
  };
49
49
  export const WebChatContainerStateful = props => {
50
- var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _props$webChatContain5, _props$webChatContain6, _defaultWebChatContai, _props$webChatContain7, _props$webChatContain8, _defaultWebChatContai2, _webChatContainerProp7, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14;
50
+ var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _props$webChatContain5, _props$webChatContain6, _defaultWebChatContai, _props$webChatContain7, _props$webChatContain8, _defaultWebChatContai2, _webChatContainerProp7, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _props$webChatContain9, _props$webChatContain10;
51
51
  const {
52
52
  BasicWebChat
53
53
  } = Components;
@@ -177,10 +177,10 @@ export const WebChatContainerStateful = props => {
177
177
 
178
178
  .webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp8 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp8 === void 0 ? void 0 : _webChatContainerProp8.buttonWhiteSpace) ?? defaultAdaptiveCardStyles.buttonWhiteSpace} !important;}
179
179
 
180
- .ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon {
181
- background-image : url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03L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LjMwMTggMy4wMDE5N0wyMC40MDE0IDMuMDE1NzVMMjAuNTAyMiAzLjA0MzkzTDIwLjU1OSAzLjA2ODAzQzIwLjYxMjIgMy4wOTEyMiAyMC42NjM0IDMuMTIxNjMgMjAuNzExMSAzLjE1ODg1TDIwLjc4MDQgMy4yMjE1NkwyMC44NjQxIDMuMzIwMTRMMjAuOTE4MyAzLjQxMDI1TDIwLjk1NyAzLjUwMDU3TDIwLjk3NjIgMy41NjQ3NkwyMC45ODk4IDMuNjI4NjJMMjAuOTk5MiAzLjcyMjgyTDIwLjk5OTcgMTAuMjU1NEMyMC45OTk3IDEwLjY2OTYgMjAuNjYzOSAxMS4wMDU0IDIwLjI0OTcgMTEuMDA1NEMxOS44NyAxMS4wMDU0IDE5LjU1NjIgMTAuNzIzMiAxOS41MDY1IDEwLjM1NzFMMTkuNDk5NyAxMC4yNTU0TDE5LjQ5ODkgNS41NjE0N0wxMi4yNzk3IDEyLjc4NDdDMTIuMDEzNCAxMy4wNTEgMTEuNTk2OCAxMy4wNzUzIDExLjMwMzEgMTIuODU3NUwxMS4yMTkgMTIuNzg0OUMxMC45NTI3IDEyLjUxODcgMTAuOTI4NCAxMi4xMDIxIDExLjE0NjIgMTEuODA4NEwxMS4yMTg4IDExLjcyNDNMMTguNDM2OSA0LjUwMTQ2SDEzLjc0ODFDMTMuMzY4NCA0LjUwMTQ2IDEzLjA1NDYgNC4yMTkzMSAxMy4wMDUgMy44NTMyNEwxMi45OTgxIDMuNzUxNDZDMTIuOTk4MSAzLjM3MTc3IDEzLjI4MDMgMy4wNTc5NyAxMy42NDY0IDMuMDA4MzFMMTMuNzQ4MSAzLjAwMTQ2WiIgZmlsbD0iI0ZGRkZGRiIgLz48L3N2Zz4) !important;
182
- height: '.75em';
183
- marginLeft: '.25em';
180
+ .ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon, img.webchat__render-markdown__external-link-icon {
181
+ background-image : url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSI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ps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp9 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp9 === void 0 ? void 0 : (_webChatContainerProp10 = _webChatContainerProp9.receivedMessageAnchorStyles) === null || _webChatContainerProp10 === void 0 ? void 0 : _webChatContainerProp10.filter) ?? (defaultReceivedMessageAnchorStyles === null || defaultReceivedMessageAnchorStyles === void 0 ? void 0 : defaultReceivedMessageAnchorStyles.filter)};
185
185
  }
186
186
  pre {
@@ -206,8 +206,13 @@ export const WebChatContainerStateful = props => {
206
206
  .webchat__bubble:not(.webchat__bubble--from-user) .webchat__bubble__content {
207
207
  border-radius: 0 !important; /* Override border-radius */
208
208
  }
209
+
210
+ .webchat__stacked-layout_container>div {
211
+ background: ${(props === null || props === void 0 ? void 0 : (_props$webChatContain9 = props.webChatContainerProps) === null || _props$webChatContain9 === void 0 ? void 0 : (_props$webChatContain10 = _props$webChatContain9.containerStyles) === null || _props$webChatContain10 === void 0 ? void 0 : _props$webChatContain10.background) ?? ""}
212
+ }
209
213
  `), /*#__PURE__*/React.createElement(Stack, {
210
- styles: containerStyles
214
+ styles: containerStyles,
215
+ className: "webchat__stacked-layout_container"
211
216
  }, /*#__PURE__*/React.createElement(BasicWebChat, null)));
212
217
  };
213
218
  export default WebChatContainerStateful;
@@ -17,9 +17,8 @@ import { defaultSystemMessageStyles } from "./defaultStyles/defaultSystemMessage
17
17
  import { defaultUserMessageStyles } from "./defaultStyles/defaultUserMessageStyles";
18
18
  import { escapeHtml } from "../../../../../common/utils";
19
19
  const loggedSystemMessages = new Array();
20
-
21
20
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
- const handleSystemMessage = (next, args, card, systemMessageStyleProps) => {
21
+ const handleSystemMessage = (next, args, card, renderMarkdown, systemMessageStyleProps) => {
23
22
  var _card$activity, _card$activity$channe, _card$activity$channe2, _card$activity2, _card$activity2$chann, _card$activity3, _card$activity3$chann, _card$activity3$chann2, _card$activity4, _card$activity4$chann, _card$activity5, _card$activity5$chann, _card$nextVisibleActi, _card$nextVisibleActi2, _card$activity6, _card$activity6$chann, _card$activity7, _card$nextVisibleActi3, _card$activity8;
24
23
  const systemMessageStyles = {
25
24
  ...defaultSystemMessageStyles,
@@ -42,14 +41,15 @@ const handleSystemMessage = (next, args, card, systemMessageStyleProps) => {
42
41
  if ((_card$activity5 = card.activity) !== null && _card$activity5 !== void 0 && (_card$activity5$chann = _card$activity5.channelData) !== null && _card$activity5$chann !== void 0 && _card$activity5$chann.clientmessageid && ((_card$nextVisibleActi = card.nextVisibleActivity) === null || _card$nextVisibleActi === void 0 ? void 0 : (_card$nextVisibleActi2 = _card$nextVisibleActi.channelData) === null || _card$nextVisibleActi2 === void 0 ? void 0 : _card$nextVisibleActi2.clientmessageid) === ((_card$activity6 = card.activity) === null || _card$activity6 === void 0 ? void 0 : (_card$activity6$chann = _card$activity6.channelData) === null || _card$activity6$chann === void 0 ? void 0 : _card$activity6$chann.clientmessageid) || (_card$activity7 = card.activity) !== null && _card$activity7 !== void 0 && _card$activity7.messageid && ((_card$nextVisibleActi3 = card.nextVisibleActivity) === null || _card$nextVisibleActi3 === void 0 ? void 0 : _card$nextVisibleActi3.messageid) === ((_card$activity8 = card.activity) === null || _card$activity8 === void 0 ? void 0 : _card$activity8.messageid)) {
43
42
  return () => false;
44
43
  }
45
-
44
+ card.activity.text = renderMarkdown(card.activity.text);
46
45
  // eslint-disable-next-line react/display-name
47
46
  return () => /*#__PURE__*/React.createElement("div", {
48
47
  key: card.activity.id,
49
48
  style: systemMessageStyles,
50
49
  "aria-hidden": "false",
50
+ className: Constants.markDownSystemMessageClass,
51
51
  dangerouslySetInnerHTML: {
52
- __html: escapeHtml(card.activity.text)
52
+ __html: card.activity.text
53
53
  }
54
54
  });
55
55
  };
@@ -65,7 +65,7 @@ const isDataTagsPresent = card => {
65
65
  };
66
66
 
67
67
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
68
- export const createActivityMiddleware = (systemMessageStyleProps, userMessageStyleProps) => () => next => function () {
68
+ export const createActivityMiddleware = (renderMarkdown, systemMessageStyleProps, userMessageStyleProps) => () => next => function () {
69
69
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
70
70
  args[_key] = arguments[_key];
71
71
  }
@@ -79,7 +79,7 @@ export const createActivityMiddleware = (systemMessageStyleProps, userMessageSty
79
79
  return () => false;
80
80
  }
81
81
  if (isTagIncluded(card, Constants.systemMessageTag)) {
82
- return handleSystemMessage(next, args, card, systemMessageStyleProps);
82
+ return handleSystemMessage(next, args, card, renderMarkdown, systemMessageStyleProps);
83
83
  } else if (card.activity.text && card.activity.type === DirectLineActivityType.Message) {
84
84
  if (!card.activity.channelData.isHtmlEncoded && card.activity.channelId === Constants.webchatChannelId) {
85
85
  card.activity.text = escapeHtml(card.activity.text);
@@ -9,6 +9,7 @@ import DOMPurify from "dompurify";
9
9
  import { WebChatActionType } from "../../enums/WebChatActionType";
10
10
  import { TelemetryHelper } from "../../../../../common/telemetry/TelemetryHelper";
11
11
  import { LogLevel, TelemetryEvent } from "../../../../../common/telemetry/TelemetryConstants";
12
+ import updateIn from "simple-update-in";
12
13
 
13
14
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
15
  const convertTextToHtmlNode = text => {
@@ -64,7 +65,7 @@ const processHTMLText = (action, text) => {
64
65
  }
65
66
 
66
67
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
- action = window.simpleUpdateIn(action, [Constants.payload, Constants.activity, Constants.text], () => htmlNode.innerHTML);
68
+ action = updateIn(action, [Constants.payload, Constants.activity, Constants.text], () => htmlNode.innerHTML);
68
69
  } catch (e) {
69
70
  let errorMessage = "Failed to apply action: ";
70
71
  try {
@@ -11,6 +11,7 @@ export declare class Constants {
11
11
  static readonly webchatChannelId = "webchat";
12
12
  static readonly markdown = "markdown";
13
13
  static readonly actionType = "actionType";
14
+ static readonly markDownSystemMessageClass = "webchat__basic-transcript__activity-markdown-body";
14
15
  static readonly String = "string";
15
16
  static readonly ChatMessagesJson = "chatMessagesJson";
16
17
  static readonly truePascal = "True";
@@ -7,4 +7,4 @@
7
7
  * 3. Decodes certain html characters that came through from chat services
8
8
  ******/
9
9
  import React from "react";
10
- export declare const createActivityMiddleware: (systemMessageStyleProps?: React.CSSProperties | undefined, userMessageStyleProps?: React.CSSProperties | undefined) => () => (next: any) => (...args: any) => any;
10
+ export declare const createActivityMiddleware: (renderMarkdown: (text: string) => string, systemMessageStyleProps?: React.CSSProperties | undefined, userMessageStyleProps?: React.CSSProperties | undefined) => () => (next: any) => (...args: any) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "1.6.4-main.635e255",
3
+ "version": "1.6.4",
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.8.0",
78
+ "@microsoft/omnichannel-chat-sdk": "^1.8.1",
79
79
  "abort-controller-es5": "^2.0.1",
80
80
  "dompurify": "^2.3.4",
81
81
  "markdown-it": "^12.3.2",
@@ -85,7 +85,8 @@
85
85
  "md5-typescript": "^1.0.5",
86
86
  "p-defer-es5": "^2.0.1",
87
87
  "sanitize-html": "2.12.1",
88
- "slack-markdown-it": "^1.0.5"
88
+ "slack-markdown-it": "^1.0.5",
89
+ "simple-update-in":"2.2.0"
89
90
  },
90
91
  "scripts": {
91
92
  "storybook": "start-storybook -p 6006",