@microsoft/omnichannel-chat-widget 1.6.3 → 1.6.4-main.0fc902c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +1 -1
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +4 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +5 -6
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDownloadIconStyles.js +1 -1
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +1 -1
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +4 -4
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +5 -6
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDownloadIconStyles.js +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +1 -1
- package/package.json +3 -3
|
@@ -122,7 +122,7 @@ const initWebChatComposer = (props, state, dispatch, chatSDK, endChat) => {
|
|
|
122
122
|
dir: state.domainStates.globalDir,
|
|
123
123
|
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
124
|
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),
|
|
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)(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
126
|
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
127
|
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
128
|
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),
|
|
@@ -726,6 +726,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
726
726
|
::-webkit-scrollbar-thumb:hover {
|
|
727
727
|
background: ${scrollbarProps.thumbHoverColor};
|
|
728
728
|
}
|
|
729
|
+
}
|
|
729
730
|
`), /*#__PURE__*/_react2.default.createElement(_DraggableChatWidget.default, chatWidgetDraggableConfig, /*#__PURE__*/_react2.default.createElement(Composer, _extends({}, webChatProps, {
|
|
730
731
|
styleOptions: {
|
|
731
732
|
...webChatStyles,
|
|
@@ -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,
|
|
190
|
-
height:
|
|
191
|
-
|
|
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+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg5MjNMMTcuOTk4NyAxNi43Mzg0VjEzLjIzMjFDMTcuOTk4NyAxMi44MTc5IDE4LjMzNDUgMTIuNDgyMSAxOC43NDg3IDEyLjQ4MjFDMTkuMTI4NCAxMi40ODIxIDE5LjQ0MjIgMTIuNzY0MyAxOS40OTE4IDEzLjEzMDNMMTkuNDk4NyAxMy4yMzIxVjE2LjczODRDMTkuNDk4NyAxOC43NDA3IDE3LjkyOTMgMjAuMzc2OSAxNS45NTI4IDIwLjQ4MjlMMTUuNzUzOCAyMC40ODg0TDcuMjU4MjcgMjAuNTAwMUw3LjA1NDk1IDIwLjQ5NDlDNS4xNDIzOSAyMC4zOTU0IDMuNjA4OTUgMTguODYyNyAzLjUwODM3IDE2Ljk1MDJMMy41MDMxMi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DAxNDZaIiBmaWxsPSIjMjEyMTIxIiAvPjwvc3ZnPg==) !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 {
|
|
@@ -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,14 @@ 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",
|
|
58
57
|
dangerouslySetInnerHTML: {
|
|
59
|
-
__html:
|
|
58
|
+
__html: card.activity.text
|
|
60
59
|
}
|
|
61
60
|
});
|
|
62
61
|
};
|
|
@@ -72,7 +71,7 @@ const isDataTagsPresent = card => {
|
|
|
72
71
|
};
|
|
73
72
|
|
|
74
73
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
75
|
-
const createActivityMiddleware = (systemMessageStyleProps, userMessageStyleProps) => () => next => function () {
|
|
74
|
+
const createActivityMiddleware = (renderMarkdown, systemMessageStyleProps, userMessageStyleProps) => () => next => function () {
|
|
76
75
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
77
76
|
args[_key] = arguments[_key];
|
|
78
77
|
}
|
|
@@ -86,7 +85,7 @@ const createActivityMiddleware = (systemMessageStyleProps, userMessageStyleProps
|
|
|
86
85
|
return () => false;
|
|
87
86
|
}
|
|
88
87
|
if (isTagIncluded(card, _Constants.Constants.systemMessageTag)) {
|
|
89
|
-
return handleSystemMessage(next, args, card, systemMessageStyleProps);
|
|
88
|
+
return handleSystemMessage(next, args, card, renderMarkdown, systemMessageStyleProps);
|
|
90
89
|
} else if (card.activity.text && card.activity.type === _DirectLineActivityType.DirectLineActivityType.Message) {
|
|
91
90
|
if (!card.activity.channelData.isHtmlEncoded && card.activity.channelId === _Constants.Constants.webchatChannelId) {
|
|
92
91
|
card.activity.text = (0, _utils.escapeHtml)(card.activity.text);
|
|
@@ -9,6 +9,6 @@ const defaultAttachmentDownloadIconStyles = {
|
|
|
9
9
|
width: "12px",
|
|
10
10
|
marginLeft: "auto !important",
|
|
11
11
|
padding: "2px !important",
|
|
12
|
-
fill: "#000000
|
|
12
|
+
fill: "#000000"
|
|
13
13
|
};
|
|
14
14
|
exports.defaultAttachmentDownloadIconStyles = defaultAttachmentDownloadIconStyles;
|
|
@@ -116,7 +116,7 @@ export const initWebChatComposer = (props, state, dispatch, chatSDK, endChat) =>
|
|
|
116
116
|
dir: state.domainStates.globalDir,
|
|
117
117
|
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
118
|
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),
|
|
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(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
120
|
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
121
|
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
122
|
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),
|
|
@@ -718,6 +718,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
718
718
|
::-webkit-scrollbar-thumb:hover {
|
|
719
719
|
background: ${scrollbarProps.thumbHoverColor};
|
|
720
720
|
}
|
|
721
|
+
}
|
|
721
722
|
`), /*#__PURE__*/React.createElement(DraggableChatWidget, chatWidgetDraggableConfig, /*#__PURE__*/React.createElement(Composer, _extends({}, webChatProps, {
|
|
722
723
|
styleOptions: {
|
|
723
724
|
...webChatStyles,
|
|
@@ -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,
|
|
182
|
-
height:
|
|
183
|
-
|
|
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,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44Mz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MuMDY4MDNDMjAuNjEyMiAzLjA5MTIyIDIwLjY2MzQgMy4xMjE2MyAyMC43MTExIDMuMTU4ODVMMjAuNzgwNCAzLjIyMTU2TDIwLjg2NDEgMy4zMjAxNEwyMC45MTgzIDMuNDEwMjVMMjAuOTU3IDMuNTAwNTdMMjAuOTc2MiAzLjU2NDc2TDIwLjk4OTggMy42Mjg2MkwyMC45OTkyIDMuNzIyODJMMjAuOTk5NyAxMC4yNTU0QzIwLjk5OTcgMTAuNjY5NiAyMC42NjM5IDExLjAwNTQgMjAuMjQ5NyAxMS4wMDU0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjMjEyMTIxIiAvPjwvc3ZnPg==) !important;
|
|
182
|
+
height: .75em;
|
|
183
|
+
margin-left: .25em;
|
|
184
184
|
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 === null || defaultReceivedMessageAnchorStyles === void 0 ? void 0 : defaultReceivedMessageAnchorStyles.filter)};
|
|
185
185
|
}
|
|
186
186
|
pre {
|
|
@@ -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,14 @@ 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",
|
|
51
50
|
dangerouslySetInnerHTML: {
|
|
52
|
-
__html:
|
|
51
|
+
__html: card.activity.text
|
|
53
52
|
}
|
|
54
53
|
});
|
|
55
54
|
};
|
|
@@ -65,7 +64,7 @@ const isDataTagsPresent = card => {
|
|
|
65
64
|
};
|
|
66
65
|
|
|
67
66
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
68
|
-
export const createActivityMiddleware = (systemMessageStyleProps, userMessageStyleProps) => () => next => function () {
|
|
67
|
+
export const createActivityMiddleware = (renderMarkdown, systemMessageStyleProps, userMessageStyleProps) => () => next => function () {
|
|
69
68
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
70
69
|
args[_key] = arguments[_key];
|
|
71
70
|
}
|
|
@@ -79,7 +78,7 @@ export const createActivityMiddleware = (systemMessageStyleProps, userMessageSty
|
|
|
79
78
|
return () => false;
|
|
80
79
|
}
|
|
81
80
|
if (isTagIncluded(card, Constants.systemMessageTag)) {
|
|
82
|
-
return handleSystemMessage(next, args, card, systemMessageStyleProps);
|
|
81
|
+
return handleSystemMessage(next, args, card, renderMarkdown, systemMessageStyleProps);
|
|
83
82
|
} else if (card.activity.text && card.activity.type === DirectLineActivityType.Message) {
|
|
84
83
|
if (!card.activity.channelData.isHtmlEncoded && card.activity.channelId === Constants.webchatChannelId) {
|
|
85
84
|
card.activity.text = escapeHtml(card.activity.text);
|
|
@@ -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.
|
|
3
|
+
"version": "1.6.4-main.0fc902c",
|
|
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.1.
|
|
78
|
-
"@microsoft/omnichannel-chat-sdk": "^1.
|
|
77
|
+
"@microsoft/omnichannel-chat-components": "1.1.5",
|
|
78
|
+
"@microsoft/omnichannel-chat-sdk": "^1.8.0",
|
|
79
79
|
"abort-controller-es5": "^2.0.1",
|
|
80
80
|
"dompurify": "^2.3.4",
|
|
81
81
|
"markdown-it": "^12.3.2",
|