@microsoft/omnichannel-chat-widget 1.7.3-main.fee24eb → 1.7.4-main.0574a04
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/common/Constants.js +1 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +3 -0
- package/lib/cjs/components/footerstateful/FooterStateful.js +17 -3
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +15 -6
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +77 -0
- package/lib/cjs/components/livechatwidget/common/chatDisconnectHelper.js +2 -2
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +15 -2
- package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +6 -2
- package/lib/cjs/components/livechatwidget/common/createMarkdown.js +2 -2
- package/lib/cjs/components/livechatwidget/common/endChat.js +20 -9
- package/lib/cjs/components/livechatwidget/common/helpers/markdownHelper.js +23 -0
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +8 -4
- package/lib/cjs/components/livechatwidget/common/persistentChatHelper.js +2 -1
- package/lib/cjs/components/livechatwidget/common/startChat.js +9 -3
- package/lib/cjs/components/livechatwidget/interfaces/IBotAuthActivitySubscriberOptionalParams.js +1 -0
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +49 -0
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +11 -6
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +4 -4
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +31 -0
- package/lib/cjs/components/webchatcontainerstateful/interfaces/IBotAuthConfig.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +2 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +8 -0
- package/lib/cjs/index.js +7 -0
- package/lib/cjs/plugins/createChatTranscript.js +84 -0
- package/lib/esm/common/Constants.js +1 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +3 -0
- package/lib/esm/components/footerstateful/FooterStateful.js +15 -3
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +15 -6
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +70 -0
- package/lib/esm/components/livechatwidget/common/chatDisconnectHelper.js +3 -2
- package/lib/esm/components/livechatwidget/common/createAdapter.js +14 -2
- package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +6 -2
- package/lib/esm/components/livechatwidget/common/createMarkdown.js +2 -2
- package/lib/esm/components/livechatwidget/common/endChat.js +20 -9
- package/lib/esm/components/livechatwidget/common/helpers/markdownHelper.js +15 -0
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +8 -4
- package/lib/esm/components/livechatwidget/common/persistentChatHelper.js +2 -1
- package/lib/esm/components/livechatwidget/common/startChat.js +9 -3
- package/lib/esm/components/livechatwidget/interfaces/IBotAuthActivitySubscriberOptionalParams.js +1 -0
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +50 -1
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +11 -6
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +4 -4
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +31 -0
- package/lib/esm/components/webchatcontainerstateful/interfaces/IBotAuthConfig.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +8 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/plugins/createChatTranscript.js +84 -0
- package/lib/types/common/Constants.d.ts +1 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +5 -2
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.d.ts +4 -1
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.d.ts +7 -0
- package/lib/types/components/livechatwidget/common/createAdapter.d.ts +2 -1
- package/lib/types/components/livechatwidget/common/helpers/markdownHelper.d.ts +2 -0
- package/lib/types/components/livechatwidget/interfaces/IBotAuthActivitySubscriberOptionalParams.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +25 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IBotAuthConfig.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +2 -0
- package/lib/types/index.d.ts +1 -0
- package/package.json +4 -2
|
@@ -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,
|
|
58
|
+
var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _props$webChatContain5, _props$webChatContain6, _defaultWebChatContai, _props$webChatContain7, _props$webChatContain8, _defaultWebChatContai2, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15, _props$webChatContain9, _props$webChatContain10;
|
|
59
59
|
const {
|
|
60
60
|
BasicWebChat
|
|
61
61
|
} = _botframeworkWebchat.Components;
|
|
@@ -171,6 +171,11 @@ const WebChatContainerStateful = props => {
|
|
|
171
171
|
div[class="ac-textBlock"] *,
|
|
172
172
|
div[class="ac-input-container"] * {white-space:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp6 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp6 === void 0 ? void 0 : _webChatContainerProp6.textWhiteSpace) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.textWhiteSpace}}
|
|
173
173
|
|
|
174
|
+
div[class="ac-input-container"] input.ac-multichoiceInput,
|
|
175
|
+
div[class="ac-input-container"] select.ac-multichoiceInput {
|
|
176
|
+
${webChatContainerProps !== null && webChatContainerProps !== void 0 && (_webChatContainerProp7 = webChatContainerProps.adaptiveCardStyles) !== null && _webChatContainerProp7 !== void 0 && _webChatContainerProp7.choiceInputPadding ? `padding: ${webChatContainerProps.adaptiveCardStyles.choiceInputPadding} !important;` : ""}
|
|
177
|
+
}
|
|
178
|
+
|
|
174
179
|
.ms_lcw_webchat_received_message>div.webchat__stacked-layout>div.webchat__stacked-layout__main>div.webchat__stacked-layout__content>div.webchat__stacked-layout__message-row>[class^=webchat]:not(.webchat__bubble--from-user)>.webchat__bubble__content {
|
|
175
180
|
background-color: ${((_props$webChatContain5 = props.webChatContainerProps) === null || _props$webChatContain5 === void 0 ? void 0 : (_props$webChatContain6 = _props$webChatContain5.webChatStyles) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.bubbleBackground) ?? ((_defaultWebChatContai = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai === void 0 ? void 0 : _defaultWebChatContai.bubbleBackground)};
|
|
176
181
|
color:${((_props$webChatContain7 = props.webChatContainerProps) === null || _props$webChatContain7 === void 0 ? void 0 : (_props$webChatContain8 = _props$webChatContain7.webChatStyles) === null || _props$webChatContain8 === void 0 ? void 0 : _props$webChatContain8.bubbleTextColor) ?? ((_defaultWebChatContai2 = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.bubbleTextColor)};
|
|
@@ -180,16 +185,16 @@ const WebChatContainerStateful = props => {
|
|
|
180
185
|
div[class="ac-textBlock"] a:visited,
|
|
181
186
|
div[class="ac-textBlock"] a:hover,
|
|
182
187
|
div[class="ac-textBlock"] a:active {
|
|
183
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
188
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp8 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp8 === void 0 ? void 0 : _webChatContainerProp8.anchorColor) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.anchorColor};
|
|
184
189
|
}
|
|
185
190
|
|
|
186
|
-
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
191
|
+
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp9 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp9 === void 0 ? void 0 : _webChatContainerProp9.buttonWhiteSpace) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.buttonWhiteSpace} !important;}
|
|
187
192
|
|
|
188
193
|
.ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon {
|
|
189
194
|
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03LjI1MDEgNC41MDAxN0gxMC43NDk1QzExLjE2MzcgNC41MDAxNyAxMS40OTk1IDQuODM1OTYgMTEuNDk5NSA1LjI1MDE3QzExLjQ5OTUgNS42Mjk4NiAxMS4yMTczIDUuOTQzNjYgMTAuODUxMyA1Ljk5MzMyTDEwLjc0OTUgNi4wMDAxN0g3LjI0OTc0QzYuMDcwNzkgNS45OTk2MSA1LjEwMzQ5IDYuOTA2NTYgNS4wMDc4NiA4LjA2MTEyTDUuMDAwMjggOC4yMjAwM0w1LjAwMzEyIDE2Ljc1MDdDNS4wMDM0MyAxNy45NDE1IDUuOTI4ODUgMTguOTE2MSA3LjA5OTY2IDE4Ljk5NDlMNy4yNTM3MSAxOS4wMDAxTDE1Ljc1MTggMTguOTg4NEMxNi45NDE1IDE4Ljk4NjggMTcuOTE0NSAxOC4wNjIgMTcuOTkzNSAxNi44OTIzTDE3Ljk5ODcgMTYuNzM4NFYxMy4yMzIxQzE3Ljk5ODcgMTIuODE3OSAxOC4zMzQ1IDEyLjQ4MjEgMTguNzQ4NyAxMi40ODIxQzE5LjEyODQgMTIuNDgyMSAxOS40NDIyIDEyLjc2NDMgMTkuNDkxOCAxMy4xMzAzTDE5LjQ5ODcgMTMuMjMyMVYxNi43Mzg0QzE5LjQ5ODcgMTguNzQwNyAxNy45MjkzIDIwLjM3NjkgMTUuOTUyOCAyMC40ODI5TDE1Ljc1MzggMjAuNDg4NEw3LjI1ODI3IDIwLjUwMDFMNy4wNTQ5NSAyMC40OTQ5QzUuMTQyMzkgMjAuMzk1NCAzLjYwODk1IDE4Ljg2MjcgMy41MDgzNyAxNi45NTAyTDMuNTAzMTIgMTYuNzUxMUwzLjUwMDg5IDguMjUyN0wzLjUwNTI5IDguMDUwMkMzLjYwNTM5IDYuMTM3NDkgNS4xMzg2NyA0LjYwNDQ5IDcuMDUwOTYgNC41MDUyN0w3LjI1MDEgNC41MDAxN0gxMC43NDk1SDcuMjUwMVpNMTMuNzQ4MSAzLjAwMTQ2TDIwLjMwMTggMy4wMDE5N0wyMC40MDE0IDMuMDE1NzVMMjAuNTAyMiAzLjA0MzkzTDIwLjU1OSAzLjA2ODAzQzIwLjYxMjIgMy4wOTEyMiAyMC42NjM0IDMuMTIxNjMgMjAuNzExMSAzLjE1ODg1TDIwLjc4MDQgMy4yMjE1NkwyMC44NjQxIDMuMzIwMTRMMjAuOTE4MyAzLjQxMDI1TDIwLjk1NyAzLjUwMDU3TDIwLjk3NjIgMy41NjQ3NkwyMC45ODk4IDMuNjI4NjJMMjAuOTk5MiAzLjcyMjgyTDIwLjk5OTcgMTAuMjU1NEMyMC45OTk3IDEwLjY2OTYgMjAuNjYzOSAxMS4wMDU0IDIwLjI0OTcgMTEuMDA1NEMxOS44NyAxMS4wMDU0IDE5LjU1NjIgMTAuNzIzMiAxOS41MDY1IDEwLjM1NzFMMTkuNDk5NyAxMC4yNTU0TDE5LjQ5ODkgNS41NjE0N0wxMi4yNzk3IDEyLjc4NDdDMTIuMDEzNCAxMy4wNTEgMTEuNTk2OCAxMy4wNzUzIDExLjMwMzEgMTIuODU3NUwxMS4yMTkgMTIuNzg0OUMxMC45NTI3IDEyLjUxODcgMTAuOTI4NCAxMi4xMDIxIDExLjE0NjIgMTEuODA4NEwxMS4yMTg4IDExLjcyNDNMMTguNDM2OSA0LjUwMTQ2SDEzLjc0ODFDMTMuMzY4NCA0LjUwMTQ2IDEzLjA1NDYgNC4yMTkzMSAxMy4wMDUgMy44NTMyNEwxMi45OTgxIDMuNzUxNDZDMTIuOTk4MSAzLjM3MTc3IDEzLjI4MDMgMy4wNTc5NyAxMy42NDY0IDMuMDA4MzFMMTMuNzQ4MSAzLjAwMTQ2WiIgZmlsbD0iI0ZGRkZGRiIgLz48L3N2Zz4) !important;
|
|
190
195
|
height: .75em;
|
|
191
196
|
margin-left: .25em;
|
|
192
|
-
filter:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
197
|
+
filter:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp10 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp10 === void 0 ? void 0 : (_webChatContainerProp11 = _webChatContainerProp10.receivedMessageAnchorStyles) === null || _webChatContainerProp11 === void 0 ? void 0 : _webChatContainerProp11.filter) ?? (_defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === null || _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === void 0 ? void 0 : _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles.filter)};
|
|
193
198
|
}
|
|
194
199
|
pre {
|
|
195
200
|
white-space: pre-wrap;
|
|
@@ -202,13 +207,13 @@ const WebChatContainerStateful = props => {
|
|
|
202
207
|
.ms_lcw_webchat_received_message a:visited,
|
|
203
208
|
.ms_lcw_webchat_received_message a:hover,
|
|
204
209
|
.ms_lcw_webchat_received_message a:active {
|
|
205
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
210
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp12 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp12 === void 0 ? void 0 : (_webChatContainerProp13 = _webChatContainerProp12.receivedMessageAnchorStyles) === null || _webChatContainerProp13 === void 0 ? void 0 : _webChatContainerProp13.color) ?? (_defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === null || _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === void 0 ? void 0 : _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles.color)};
|
|
206
211
|
}
|
|
207
212
|
.ms_lcw_webchat_sent_message a:link,
|
|
208
213
|
.ms_lcw_webchat_sent_message a:visited,
|
|
209
214
|
.ms_lcw_webchat_sent_message a:hover,
|
|
210
215
|
.ms_lcw_webchat_sent_message a:active {
|
|
211
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
216
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp14 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp14 === void 0 ? void 0 : (_webChatContainerProp15 = _webChatContainerProp14.sentMessageAnchorStyles) === null || _webChatContainerProp15 === void 0 ? void 0 : _webChatContainerProp15.color) ?? (_defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === null || _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === void 0 ? void 0 : _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles.color)};
|
|
212
217
|
}
|
|
213
218
|
|
|
214
219
|
.webchat__bubble:not(.webchat__bubble--from-user) .webchat__bubble__content {
|
|
@@ -12,11 +12,11 @@ class DesignerChatAdapter extends _mockadapter.default {
|
|
|
12
12
|
constructor() {
|
|
13
13
|
super();
|
|
14
14
|
setTimeout(() => {
|
|
15
|
-
(0, _chatAdapterUtils.postBotMessageActivity)(this.activityObserver, "
|
|
16
|
-
this.postUserActivity("
|
|
17
|
-
(0, _chatAdapterUtils.
|
|
15
|
+
(0, _chatAdapterUtils.postBotMessageActivity)(this.activityObserver, "Thank you for contacting us! How can I help you today?", undefined, 0);
|
|
16
|
+
this.postUserActivity("I need to change my address.", 0);
|
|
17
|
+
(0, _chatAdapterUtils.postBotMessageActivity)(this.activityObserver, "Okay, let me connect you with a live agent.", undefined, 100);
|
|
18
18
|
(0, _chatAdapterUtils.postSystemMessageActivity)(this.activityObserver, "John has joined the chat", 100);
|
|
19
|
-
(0, _chatAdapterUtils.postBotMessageActivity)(this.activityObserver, "
|
|
19
|
+
(0, _chatAdapterUtils.postBotMessageActivity)(this.activityObserver, "I'd be happy to help you update your account.", undefined, 100);
|
|
20
20
|
}, 1000);
|
|
21
21
|
}
|
|
22
22
|
postUserActivity(text) {
|
|
@@ -6,12 +6,43 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.DesignerChatSDK = void 0;
|
|
7
7
|
var _DesignerChatAdapter = require("./DesignerChatAdapter");
|
|
8
8
|
var _mockchatsdk = require("./mockchatsdk");
|
|
9
|
+
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; }
|
|
10
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
11
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
12
|
class DesignerChatSDK extends _mockchatsdk.MockChatSDK {
|
|
10
13
|
constructor() {
|
|
11
14
|
super();
|
|
15
|
+
_defineProperty(this, "localeId", this.getLiveChatConfig().ChatWidgetLanguage.msdyn_localeid);
|
|
12
16
|
}
|
|
13
17
|
createChatAdapter() {
|
|
14
18
|
return new _DesignerChatAdapter.DesignerChatAdapter();
|
|
15
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* If the widget is running in designer mode, we mock the initialize response. We don't want
|
|
22
|
+
* any interactions with a real server in when designing LCW widget visually in Modern Admin.
|
|
23
|
+
*
|
|
24
|
+
* - All GUIDs were changed to 00000000-0000-0000-0000-000000000000.
|
|
25
|
+
* - msdyn_callingoptions was changed to disable calling functionality
|
|
26
|
+
*/
|
|
27
|
+
getLiveChatConfig() {
|
|
28
|
+
return {
|
|
29
|
+
LiveWSAndLiveChatEngJoin: {
|
|
30
|
+
msdyn_widgetthemecolor: "19236002",
|
|
31
|
+
// msdyn_callingoptions was changed to disable calling functionality
|
|
32
|
+
msdyn_callingoptions: "192350000",
|
|
33
|
+
msdyn_widgettitle: "Let\u0027s chat",
|
|
34
|
+
msdyn_conversationmode: "192350000",
|
|
35
|
+
msdyn_avatarurl: "https://oc-cdn-ocprod.azureedge.net/livechatwidget/images/chatIcon.svg",
|
|
36
|
+
msdyn_name: "Let's Chat",
|
|
37
|
+
msdyn_postconversationsurveyenable: "false",
|
|
38
|
+
OutOfOperatingHours: "False",
|
|
39
|
+
ShowWidget: "True"
|
|
40
|
+
},
|
|
41
|
+
ChatWidgetLanguage: {
|
|
42
|
+
msdyn_localeid: "1033",
|
|
43
|
+
msdyn_languagename: "English - United States"
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
16
47
|
}
|
|
17
48
|
exports.DesignerChatSDK = DesignerChatSDK;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -87,7 +87,8 @@ const createActivityMiddleware = (renderMarkdown, systemMessageStyleProps, userM
|
|
|
87
87
|
}
|
|
88
88
|
if (isTagIncluded(card, _Constants.Constants.systemMessageTag)) {
|
|
89
89
|
return handleSystemMessage(next, args, card, renderMarkdown, systemMessageStyleProps);
|
|
90
|
-
}
|
|
90
|
+
}
|
|
91
|
+
if (card.activity.text && card.activity.type === _DirectLineActivityType.DirectLineActivityType.Message) {
|
|
91
92
|
if (!card.activity.channelData.isHtmlEncoded && card.activity.channelId === _Constants.Constants.webchatChannelId) {
|
|
92
93
|
card.activity.text = (0, _utils.escapeHtml)(card.activity.text);
|
|
93
94
|
card.activity.channelData.isHtmlEncoded = true;
|
|
@@ -9,6 +9,8 @@ var _NotificationLevel = require("../enums/NotificationLevel");
|
|
|
9
9
|
var _WebChatActionType = require("../enums/WebChatActionType");
|
|
10
10
|
var _WebChatStoreLoader = require("../WebChatStoreLoader");
|
|
11
11
|
var _utils = require("../../../../common/utils");
|
|
12
|
+
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
13
|
+
var _TelemetryConstants = require("../../../../common/telemetry/TelemetryConstants");
|
|
12
14
|
class NotificationHandler {
|
|
13
15
|
static notify(id, level, message) {
|
|
14
16
|
if (_WebChatStoreLoader.WebChatStoreLoader.store) {
|
|
@@ -34,6 +36,12 @@ class NotificationHandler {
|
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
38
|
static notifyError(id, message) {
|
|
39
|
+
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
40
|
+
eventName: _TelemetryConstants.BroadcastEvent.OnWidgetError,
|
|
41
|
+
payload: {
|
|
42
|
+
errorMessage: message
|
|
43
|
+
}
|
|
44
|
+
});
|
|
37
45
|
this.notify(id, _NotificationLevel.NotificationLevel.Error, message);
|
|
38
46
|
}
|
|
39
47
|
static notifyWarning(id, message) {
|
package/lib/cjs/index.js
CHANGED
|
@@ -33,6 +33,12 @@ Object.defineProperty(exports, "encodeComponentString", {
|
|
|
33
33
|
return _omnichannelChatComponents.encodeComponentString;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
+
Object.defineProperty(exports, "getMockChatSDKIfApplicable", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _getMockChatSDKIfApplicable.getMockChatSDKIfApplicable;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
36
42
|
Object.defineProperty(exports, "getWidgetCacheId", {
|
|
37
43
|
enumerable: true,
|
|
38
44
|
get: function () {
|
|
@@ -63,4 +69,5 @@ var _useChatSDKStore = _interopRequireDefault(require("./hooks/useChatSDKStore")
|
|
|
63
69
|
var _utils = require("./common/utils");
|
|
64
70
|
var _ConversationState = require("./contexts/common/ConversationState");
|
|
65
71
|
var _LiveChatWidget = _interopRequireDefault(require("./components/livechatwidget/LiveChatWidget"));
|
|
72
|
+
var _getMockChatSDKIfApplicable = require("./components/livechatwidget/common/getMockChatSDKIfApplicable");
|
|
66
73
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -376,6 +376,90 @@ class TranscriptHTMLBuilder {
|
|
|
376
376
|
window.addEventListener("online", () => {
|
|
377
377
|
document.body.innerHTML = \`${this.networkOnlineMessage} <button onclick="window.location.reload()"> Refresh </button>\`;
|
|
378
378
|
});
|
|
379
|
+
|
|
380
|
+
document.addEventListener("copy", (event) => {
|
|
381
|
+
const clonedSelectedContent = window.getSelection().getRangeAt(0).cloneContents();
|
|
382
|
+
const copiedContent = document.createElement("div");
|
|
383
|
+
copiedContent.appendChild(clonedSelectedContent);
|
|
384
|
+
|
|
385
|
+
event.clipboardData.setData("text/plain", getAllText(copiedContent));
|
|
386
|
+
event.preventDefault();
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
getAllText = (element) => {
|
|
391
|
+
let plainText = "";
|
|
392
|
+
Array.from(element.childNodes).forEach((node) => {
|
|
393
|
+
// ignore aria-hidden elements and keyboard help text
|
|
394
|
+
const ariaHiddenAttr = node.attributes ? node.attributes.getNamedItem("aria-hidden") : null;
|
|
395
|
+
if ((ariaHiddenAttr && ariaHiddenAttr.value === "true") || node.classList && node.classList.contains("webchat__keyboard-help")) {
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// get all texts inside activity body, including message, translated message, attachment name, adaptive card content, status footer, etc.
|
|
400
|
+
if (node.classList && node.classList.contains("webchat__basic-transcript__activity-body")) {
|
|
401
|
+
plainText += this.processTranscriptActivityNode(node);
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
405
|
+
plainText += node.textContent + '\\n';
|
|
406
|
+
} else {
|
|
407
|
+
plainText += this.getAllText(node);
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
return plainText;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
processTranscriptActivityNode = (node) => {
|
|
414
|
+
const divs = node.getElementsByTagName("div");
|
|
415
|
+
let plainText = "";
|
|
416
|
+
|
|
417
|
+
if (divs && divs.length > 1 && divs[1]) {
|
|
418
|
+
const messageRow = node.querySelector(".webchat__stacked-layout__message-row[aria-roledescription='message']");
|
|
419
|
+
const author = node.querySelector(".message-name");
|
|
420
|
+
const attachmentRow = node.querySelector(".webchat__stacked-layout__attachment-row[aria-roledescription='attachment']");
|
|
421
|
+
|
|
422
|
+
if (messageRow) {
|
|
423
|
+
let message = messageRow.getElementsByClassName("webchat__text-content__markdown");
|
|
424
|
+
|
|
425
|
+
if (message.length === 0) {
|
|
426
|
+
message = messageRow.getElementsByClassName("markdown");
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
if (message.length > 0) {
|
|
430
|
+
plainText += author.textContent + '\\n' + message[0].textContent + '\\n';
|
|
431
|
+
}
|
|
432
|
+
} else if (attachmentRow) {
|
|
433
|
+
const attachment = attachmentRow.getElementsByClassName("webchat__fileContent__fileName");
|
|
434
|
+
const adaptiveCard = this.getAdaptiveCardContent(attachmentRow.querySelector(".ac-container.ac-adaptiveCard"));
|
|
435
|
+
|
|
436
|
+
plainText += attachment && attachment.length > 0 ? author.textContent +'\\n' + attachment[0].textContent +'\\n': author.textContent +'\\n' + adaptiveCard +'\\n';
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
const statusElements = node.getElementsByClassName("webchat__stacked-layout__status");
|
|
440
|
+
if (statusElements.length > 0) {
|
|
441
|
+
const timestampelement = statusElements[0].querySelector(".message-timestamp");
|
|
442
|
+
plainText += timestampelement ? timestampelement.textContent+'\\n\\n' : '\\n';
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
return plainText;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
getAdaptiveCardContent = (node) => {
|
|
450
|
+
if (!node) {
|
|
451
|
+
return undefined;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
let plainText = "";
|
|
455
|
+
const rows = node.querySelectorAll(".ac-textBlock p");
|
|
456
|
+
rows.forEach((row) => {
|
|
457
|
+
plainText += row.textContent+ '\\n';
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
return plainText;
|
|
461
|
+
}
|
|
462
|
+
|
|
379
463
|
<\/script>
|
|
380
464
|
<div id="transcript"></div>
|
|
381
465
|
<script>
|
|
@@ -276,6 +276,7 @@ _defineProperty(WidgetLoadTelemetryMessage, "PersistedStateRetrievedMessage", "P
|
|
|
276
276
|
export class WidgetLoadCustomErrorString {}
|
|
277
277
|
_defineProperty(WidgetLoadCustomErrorString, "AuthenticationFailedErrorString", "Authentication was not successful");
|
|
278
278
|
_defineProperty(WidgetLoadCustomErrorString, "NetworkErrorString", "Network Error");
|
|
279
|
+
_defineProperty(WidgetLoadCustomErrorString, "CloseAdapterAfterDisconnectionErrorString", "Error trying to end/close chat adapter after the widget is back on-line, for an already disconnected session");
|
|
279
280
|
export class PrepareEndChatDescriptionConstants {}
|
|
280
281
|
_defineProperty(PrepareEndChatDescriptionConstants, "ConversationEndedByCustomerWithoutPostChat", "Conversation ended by customer. Post chat not configured or should not show.");
|
|
281
282
|
_defineProperty(PrepareEndChatDescriptionConstants, "ConversationEndedByCustomerWithInvalidPostChat", "Conversation ended by customer. Post chat context is invalid.");
|
|
@@ -60,6 +60,7 @@ export let BroadcastEvent;
|
|
|
60
60
|
BroadcastEvent["UpdateConversationDataForTelemetry"] = "UpdateConversationDataForTelemetry";
|
|
61
61
|
BroadcastEvent["ContactIdNotFound"] = "ContactIdNotFound";
|
|
62
62
|
BroadcastEvent["SyncMinimize"] = "SyncMinimize";
|
|
63
|
+
BroadcastEvent["OnWidgetError"] = "OnWidgetError";
|
|
63
64
|
})(BroadcastEvent || (BroadcastEvent = {}));
|
|
64
65
|
export let TelemetryEvent;
|
|
65
66
|
(function (TelemetryEvent) {
|
|
@@ -209,6 +210,8 @@ export let TelemetryEvent;
|
|
|
209
210
|
TelemetryEvent["PostChatSurveyLoadingPaneLoaded"] = "PostChatSurveyLoadingPaneLoaded";
|
|
210
211
|
TelemetryEvent["PostChatSurveyLoaded"] = "PostChatSurveyLoaded";
|
|
211
212
|
TelemetryEvent["ChatDisconnectThreadEventReceived"] = "ChatDisconnectThreadEventReceived";
|
|
213
|
+
TelemetryEvent["HiddenAdaptiveCardMessageReceived"] = "HiddenAdaptiveCardMessageReceived";
|
|
214
|
+
TelemetryEvent["EndingAdapterAfterDisconnectionError"] = "EndingAdapterAfterDisconnectionError";
|
|
212
215
|
})(TelemetryEvent || (TelemetryEvent = {}));
|
|
213
216
|
export class TelemetryConstants {
|
|
214
217
|
static map(eventTypeOrScenarioType) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
2
|
-
import React from "react";
|
|
2
|
+
import React, { useEffect } from "react";
|
|
3
3
|
import AudioNotificationStateful from "./audionotificationstateful/AudioNotificationStateful";
|
|
4
4
|
import { Constants } from "../../common/Constants";
|
|
5
5
|
import { Footer } from "@microsoft/omnichannel-chat-components";
|
|
@@ -11,10 +11,11 @@ import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
|
11
11
|
import { downloadTranscript } from "./downloadtranscriptstateful/DownloadTranscriptStateful";
|
|
12
12
|
import useChatContextStore from "../../hooks/useChatContextStore";
|
|
13
13
|
import useChatSDKStore from "../../hooks/useChatSDKStore";
|
|
14
|
+
import { ConversationState } from "../../contexts/common/ConversationState";
|
|
14
15
|
|
|
15
16
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
17
|
export const FooterStateful = props => {
|
|
17
|
-
var _footerProps$controlP3
|
|
18
|
+
var _footerProps$controlP3;
|
|
18
19
|
const [state, dispatch] = useChatContextStore();
|
|
19
20
|
// hideFooterDisplay - the purpose of this is to keep the footer always "active",
|
|
20
21
|
// but hide it visually in certain states (e.g., loading state) and show in some other states (e.g. active state).
|
|
@@ -81,13 +82,24 @@ export const FooterStateful = props => {
|
|
|
81
82
|
isAudioMuted: state.appStates.isAudioMuted
|
|
82
83
|
}
|
|
83
84
|
};
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (state.appStates.conversationState === ConversationState.Active) {
|
|
87
|
+
if (state.appStates.isAudioMuted === null) {
|
|
88
|
+
var _footerProps$controlP4, _footerProps$controlP5, _footerProps$controlP6;
|
|
89
|
+
dispatch({
|
|
90
|
+
type: LiveChatWidgetActionType.SET_AUDIO_NOTIFICATION,
|
|
91
|
+
payload: footerProps !== null && footerProps !== void 0 && (_footerProps$controlP4 = footerProps.controlProps) !== null && _footerProps$controlP4 !== void 0 && _footerProps$controlP4.hideAudioNotificationButton ? true : (footerProps === null || footerProps === void 0 ? void 0 : (_footerProps$controlP5 = footerProps.controlProps) === null || _footerProps$controlP5 === void 0 ? void 0 : (_footerProps$controlP6 = _footerProps$controlP5.audioNotificationButtonProps) === null || _footerProps$controlP6 === void 0 ? void 0 : _footerProps$controlP6.isAudioMuted) ?? false
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}, [state.appStates.conversationState]);
|
|
84
96
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !hideFooterDisplay && /*#__PURE__*/React.createElement(Footer, {
|
|
85
97
|
componentOverrides: footerProps === null || footerProps === void 0 ? void 0 : footerProps.componentOverrides,
|
|
86
98
|
controlProps: controlProps,
|
|
87
99
|
styleProps: footerProps === null || footerProps === void 0 ? void 0 : footerProps.styleProps
|
|
88
100
|
}), /*#__PURE__*/React.createElement(AudioNotificationStateful, {
|
|
89
101
|
audioSrc: (audioNotificationProps === null || audioNotificationProps === void 0 ? void 0 : audioNotificationProps.audioSrc) ?? NewMessageNotificationSoundBase64,
|
|
90
|
-
isAudioMuted: state.appStates.isAudioMuted
|
|
102
|
+
isAudioMuted: state.appStates.isAudioMuted ?? false
|
|
91
103
|
}));
|
|
92
104
|
};
|
|
93
105
|
export default FooterStateful;
|
package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js
CHANGED
|
@@ -9,8 +9,6 @@ import { TelemetryHelper } from "../../../../common/telemetry/TelemetryHelper";
|
|
|
9
9
|
const supportedSignInCardContentTypes = ["application/vnd.microsoft.card.signin", "application/vnd.microsoft.card.oauth"];
|
|
10
10
|
const botOauthUrlRegex = /[\S]+.botframework.com\/api\/oauth\/signin\?signin=([\S]+)/;
|
|
11
11
|
const delay = t => new Promise(resolve => setTimeout(resolve, t));
|
|
12
|
-
const fetchBotAuthConfigRetries = 3;
|
|
13
|
-
const fetchBotAuthConfigRetryInterval = 1000;
|
|
14
12
|
let response;
|
|
15
13
|
const extractSignInId = signInUrl => {
|
|
16
14
|
const result = botOauthUrlRegex.exec(signInUrl);
|
|
@@ -39,7 +37,7 @@ const extractSasUrl = async attachment => {
|
|
|
39
37
|
}
|
|
40
38
|
return sasUrl;
|
|
41
39
|
};
|
|
42
|
-
const fetchBotAuthConfig = async retries => {
|
|
40
|
+
const fetchBotAuthConfig = async (retries, interval) => {
|
|
43
41
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
44
42
|
Event: TelemetryEvent.SetBotAuthProviderFetchConfig
|
|
45
43
|
});
|
|
@@ -60,14 +58,25 @@ const fetchBotAuthConfig = async retries => {
|
|
|
60
58
|
// Base Case
|
|
61
59
|
throw new Error();
|
|
62
60
|
}
|
|
63
|
-
await delay(
|
|
64
|
-
return await fetchBotAuthConfig(--retries);
|
|
61
|
+
await delay(interval);
|
|
62
|
+
return await fetchBotAuthConfig(--retries, interval);
|
|
65
63
|
};
|
|
66
64
|
export class BotAuthActivitySubscriber {
|
|
67
65
|
constructor() {
|
|
66
|
+
let optionalParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
68
67
|
_defineProperty(this, "observer", void 0);
|
|
69
68
|
_defineProperty(this, "signInCardSeen", void 0);
|
|
69
|
+
_defineProperty(this, "fetchBotAuthConfigRetries", void 0);
|
|
70
|
+
_defineProperty(this, "fetchBotAuthConfigRetryInterval", void 0);
|
|
70
71
|
this.signInCardSeen = new Set();
|
|
72
|
+
this.fetchBotAuthConfigRetries = 3;
|
|
73
|
+
this.fetchBotAuthConfigRetryInterval = 1000;
|
|
74
|
+
if (optionalParams.fetchBotAuthConfigRetries) {
|
|
75
|
+
this.fetchBotAuthConfigRetries = optionalParams.fetchBotAuthConfigRetries;
|
|
76
|
+
}
|
|
77
|
+
if (optionalParams.fetchBotAuthConfigRetryInterval) {
|
|
78
|
+
this.fetchBotAuthConfigRetryInterval = optionalParams.fetchBotAuthConfigRetryInterval;
|
|
79
|
+
}
|
|
71
80
|
}
|
|
72
81
|
applicable(activity) {
|
|
73
82
|
var _activity$attachments;
|
|
@@ -106,7 +115,7 @@ export class BotAuthActivitySubscriber {
|
|
|
106
115
|
BroadcastService.postMessage(event);
|
|
107
116
|
}
|
|
108
117
|
try {
|
|
109
|
-
const response = await fetchBotAuthConfig(fetchBotAuthConfigRetries);
|
|
118
|
+
const response = await fetchBotAuthConfig(this.fetchBotAuthConfigRetries, this.fetchBotAuthConfigRetryInterval);
|
|
110
119
|
if (response === false) {
|
|
111
120
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
112
121
|
Event: TelemetryEvent.SetBotAuthProviderHideCard
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
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; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
+
import { Constants } from "../../../../common/Constants";
|
|
5
|
+
import { BroadcastEvent, LogLevel, TelemetryEvent } from "../../../../common/telemetry/TelemetryConstants";
|
|
6
|
+
import { TelemetryHelper } from "../../../../common/telemetry/TelemetryHelper";
|
|
7
|
+
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
8
|
+
export class HiddenAdaptiveCardActivitySubscriber {
|
|
9
|
+
constructor() {
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
_defineProperty(this, "observer", void 0);
|
|
12
|
+
}
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
|
+
async apply(activity) {
|
|
15
|
+
const {
|
|
16
|
+
attachments,
|
|
17
|
+
attachment
|
|
18
|
+
} = activity;
|
|
19
|
+
this.observer.next(false);
|
|
20
|
+
BroadcastService.postMessage({
|
|
21
|
+
eventName: BroadcastEvent.NewMessageReceived,
|
|
22
|
+
payload: {
|
|
23
|
+
attachments: attachments || [attachment],
|
|
24
|
+
text: "Custom Event"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
|
|
31
|
+
applicable(activity) {
|
|
32
|
+
const {
|
|
33
|
+
attachments,
|
|
34
|
+
attachment
|
|
35
|
+
} = activity;
|
|
36
|
+
|
|
37
|
+
// Use `attachments` or `attachment` (whichever exists)
|
|
38
|
+
const cards = attachments || [attachment];
|
|
39
|
+
|
|
40
|
+
// Check if contentType is "AdaptiveCard"
|
|
41
|
+
const adaptiveCard = cards === null || cards === void 0 ? void 0 : cards.find(
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
|
+
item => Constants.supportedAdaptiveCardContentTypes.indexOf(item === null || item === void 0 ? void 0 : item.contentType) >= 0);
|
|
44
|
+
if (adaptiveCard && adaptiveCard.content) {
|
|
45
|
+
const {
|
|
46
|
+
body
|
|
47
|
+
} = adaptiveCard.content;
|
|
48
|
+
if (Array.isArray(body)) {
|
|
49
|
+
// Check if all elements in `body` have `isVisible: false`
|
|
50
|
+
const allInvisible = body.every(item => item.isVisible === false);
|
|
51
|
+
if (allInvisible) {
|
|
52
|
+
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
53
|
+
Event: TelemetryEvent.HiddenAdaptiveCardMessageReceived,
|
|
54
|
+
Description: "All elements in AdaptiveCard are invisible"
|
|
55
|
+
});
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
|
+
async next(activity) {
|
|
65
|
+
if (this.applicable(activity)) {
|
|
66
|
+
return await this.apply(activity);
|
|
67
|
+
}
|
|
68
|
+
return activity;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
1
2
|
import { NotificationHandler } from "../../webchatcontainerstateful/webchatcontroller/notification/NotificationHandler";
|
|
2
3
|
import { NotificationScenarios } from "../../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios";
|
|
3
|
-
import { defaultMiddlewareLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
4
|
-
import { LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
5
4
|
import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
|
|
5
|
+
import { defaultMiddlewareLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
6
|
+
|
|
6
7
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
8
|
const handleChatDisconnect = (props, state, setWebChatStyles) => {
|
|
8
9
|
var _state$appStates, _state$domainStates, _state$domainStates$m, _props$webChatContain, _props$webChatContain2;
|
|
@@ -5,9 +5,14 @@ import { defaultMiddlewareLocalizedTexts } from "../../webchatcontainerstateful/
|
|
|
5
5
|
import { ChatAdapterShim } from "./ChatAdapterShim";
|
|
6
6
|
import { PauseActivitySubscriber } from "./ActivitySubscriber/PauseActivitySubscriber";
|
|
7
7
|
import { BotAuthActivitySubscriber } from "./ActivitySubscriber/BotAuthActivitySubscriber";
|
|
8
|
+
import { HiddenAdaptiveCardActivitySubscriber } from "./ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber";
|
|
9
|
+
const defaultBotAuthConfig = {
|
|
10
|
+
fetchBotAuthConfigRetries: 3,
|
|
11
|
+
fetchBotAuthConfigRetryInterval: 1000
|
|
12
|
+
};
|
|
8
13
|
|
|
9
14
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
export const createAdapter = async chatSDK => {
|
|
15
|
+
export const createAdapter = async (chatSDK, props) => {
|
|
11
16
|
const chatAdapterOptionalParams = {
|
|
12
17
|
IC3Adapter: {
|
|
13
18
|
options: {
|
|
@@ -33,9 +38,16 @@ export const createAdapter = async chatSDK => {
|
|
|
33
38
|
let adapter = await chatSDK.createChatAdapter(chatAdapterOptionalParams);
|
|
34
39
|
//so far, there is no need to convert to the shim adapter when using visual tests
|
|
35
40
|
if (chatSDK.isMockModeOn !== true) {
|
|
41
|
+
var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _props$webChatContain4;
|
|
42
|
+
const botAuthActivitySubscriberOptionalParams = {
|
|
43
|
+
fetchBotAuthConfigRetries: (props === null || props === void 0 ? void 0 : (_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : (_props$webChatContain2 = _props$webChatContain.botAuthConfig) === null || _props$webChatContain2 === void 0 ? void 0 : _props$webChatContain2.fetchBotAuthConfigRetries) || defaultBotAuthConfig.fetchBotAuthConfigRetries,
|
|
44
|
+
fetchBotAuthConfigRetryInterval: (props === null || props === void 0 ? void 0 : (_props$webChatContain3 = props.webChatContainerProps) === null || _props$webChatContain3 === void 0 ? void 0 : (_props$webChatContain4 = _props$webChatContain3.botAuthConfig) === null || _props$webChatContain4 === void 0 ? void 0 : _props$webChatContain4.fetchBotAuthConfigRetryInterval) || defaultBotAuthConfig.fetchBotAuthConfigRetryInterval
|
|
45
|
+
};
|
|
36
46
|
adapter = new ChatAdapterShim(adapter);
|
|
37
47
|
adapter.addSubscriber(new PauseActivitySubscriber());
|
|
38
|
-
adapter.addSubscriber(new BotAuthActivitySubscriber());
|
|
48
|
+
adapter.addSubscriber(new BotAuthActivitySubscriber(botAuthActivitySubscriberOptionalParams));
|
|
49
|
+
// Remove this code after ICM ID:544623085 is fixed
|
|
50
|
+
adapter.addSubscriber(new HiddenAdaptiveCardActivitySubscriber());
|
|
39
51
|
return adapter.chatAdapter;
|
|
40
52
|
}
|
|
41
53
|
return adapter;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { BroadcastEvent, LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
2
|
+
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
1
3
|
import { Constants } from "../../../common/Constants";
|
|
2
4
|
import { NotificationHandler } from "../../webchatcontainerstateful/webchatcontroller/notification/NotificationHandler";
|
|
3
5
|
import { NotificationScenarios } from "../../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios";
|
|
4
|
-
import { defaultMiddlewareLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
5
6
|
import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
|
|
6
|
-
import {
|
|
7
|
+
import { defaultMiddlewareLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
7
8
|
const isInternetConnected = async () => {
|
|
8
9
|
try {
|
|
9
10
|
const response = await fetch(Constants.internetConnectionTestUrl);
|
|
@@ -26,6 +27,9 @@ export const createInternetConnectionChangeHandler = async () => {
|
|
|
26
27
|
Event: TelemetryEvent.NetworkReconnected
|
|
27
28
|
});
|
|
28
29
|
NotificationHandler.notifySuccess(NotificationScenarios.InternetConnection, defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_INTERNET_BACK_ONLINE);
|
|
30
|
+
BroadcastService.postMessage({
|
|
31
|
+
eventName: BroadcastEvent.NetworkReconnected
|
|
32
|
+
});
|
|
29
33
|
}
|
|
30
34
|
};
|
|
31
35
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Constants } from "../../../common/Constants";
|
|
2
2
|
import MarkdownIt from "markdown-it";
|
|
3
3
|
import MarkdownItForInline from "markdown-it-for-inline";
|
|
4
|
-
import MarkdownSlack from "slack-markdown-it";
|
|
5
4
|
import { defaultMarkdownLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts";
|
|
5
|
+
import { addSlackMarkdownIt } from "./helpers/markdownHelper";
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
8
|
export const createMarkdown = (disableMarkdownMessageFormatting, disableNewLineMarkdownSupport) => {
|
|
@@ -13,7 +13,7 @@ export const createMarkdown = (disableMarkdownMessageFormatting, disableNewLineM
|
|
|
13
13
|
linkify: true,
|
|
14
14
|
breaks: !disableNewLineMarkdownSupport
|
|
15
15
|
});
|
|
16
|
-
markdown
|
|
16
|
+
markdown = addSlackMarkdownIt(markdown);
|
|
17
17
|
} else {
|
|
18
18
|
markdown = new MarkdownIt(Constants.Zero, {
|
|
19
19
|
html: true,
|