@microsoft/omnichannel-chat-widget 1.7.3 → 1.7.4-main.a36bdf2
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/telemetry/TelemetryConstants.js +1 -0
- package/lib/cjs/components/footerstateful/FooterStateful.js +12 -9
- package/lib/cjs/components/livechatwidget/common/endChat.js +7 -0
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +8 -4
- package/lib/cjs/components/livechatwidget/common/startChat.js +6 -0
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +20 -1
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +11 -6
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +24 -1
- 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/esm/common/telemetry/TelemetryConstants.js +1 -0
- package/lib/esm/components/footerstateful/FooterStateful.js +12 -9
- package/lib/esm/components/livechatwidget/common/endChat.js +8 -1
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +8 -4
- package/lib/esm/components/livechatwidget/common/startChat.js +6 -0
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +20 -1
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +11 -6
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +24 -1
- 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/types/common/telemetry/TelemetryConstants.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +20 -1
- package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +1 -0
- package/lib/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -65,6 +65,7 @@ exports.BroadcastEvent = BroadcastEvent;
|
|
|
65
65
|
BroadcastEvent["UpdateConversationDataForTelemetry"] = "UpdateConversationDataForTelemetry";
|
|
66
66
|
BroadcastEvent["ContactIdNotFound"] = "ContactIdNotFound";
|
|
67
67
|
BroadcastEvent["SyncMinimize"] = "SyncMinimize";
|
|
68
|
+
BroadcastEvent["OnWidgetError"] = "OnWidgetError";
|
|
68
69
|
})(BroadcastEvent || (exports.BroadcastEvent = BroadcastEvent = {}));
|
|
69
70
|
let TelemetryEvent;
|
|
70
71
|
exports.TelemetryEvent = TelemetryEvent;
|
|
@@ -17,12 +17,13 @@ var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
|
17
17
|
var _DownloadTranscriptStateful = require("./downloadtranscriptstateful/DownloadTranscriptStateful");
|
|
18
18
|
var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
|
|
19
19
|
var _useChatSDKStore = _interopRequireDefault(require("../../hooks/useChatSDKStore"));
|
|
20
|
+
var _ConversationState = require("../../contexts/common/ConversationState");
|
|
20
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
23
|
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; }
|
|
23
24
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
25
|
const FooterStateful = props => {
|
|
25
|
-
var _footerProps$controlP3
|
|
26
|
+
var _footerProps$controlP3;
|
|
26
27
|
const [state, dispatch] = (0, _useChatContextStore.default)();
|
|
27
28
|
// hideFooterDisplay - the purpose of this is to keep the footer always "active",
|
|
28
29
|
// but hide it visually in certain states (e.g., loading state) and show in some other states (e.g. active state).
|
|
@@ -90,21 +91,23 @@ const FooterStateful = props => {
|
|
|
90
91
|
}
|
|
91
92
|
};
|
|
92
93
|
(0, _react.useEffect)(() => {
|
|
93
|
-
if (state.appStates.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
if (state.appStates.conversationState === _ConversationState.ConversationState.Active) {
|
|
95
|
+
if (state.appStates.isAudioMuted === null) {
|
|
96
|
+
var _footerProps$controlP4, _footerProps$controlP5, _footerProps$controlP6;
|
|
97
|
+
dispatch({
|
|
98
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_AUDIO_NOTIFICATION,
|
|
99
|
+
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
|
|
100
|
+
});
|
|
101
|
+
}
|
|
99
102
|
}
|
|
100
|
-
}, []);
|
|
103
|
+
}, [state.appStates.conversationState]);
|
|
101
104
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !hideFooterDisplay && /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.Footer, {
|
|
102
105
|
componentOverrides: footerProps === null || footerProps === void 0 ? void 0 : footerProps.componentOverrides,
|
|
103
106
|
controlProps: controlProps,
|
|
104
107
|
styleProps: footerProps === null || footerProps === void 0 ? void 0 : footerProps.styleProps
|
|
105
108
|
}), /*#__PURE__*/_react.default.createElement(_AudioNotificationStateful.default, {
|
|
106
109
|
audioSrc: (audioNotificationProps === null || audioNotificationProps === void 0 ? void 0 : audioNotificationProps.audioSrc) ?? _Audios.NewMessageNotificationSoundBase64,
|
|
107
|
-
isAudioMuted: state.appStates.isAudioMuted
|
|
110
|
+
isAudioMuted: state.appStates.isAudioMuted ?? false
|
|
108
111
|
}));
|
|
109
112
|
};
|
|
110
113
|
exports.FooterStateful = FooterStateful;
|
|
@@ -60,6 +60,13 @@ const prepareEndChat = async (props, chatSDK, state, dispatch, setAdapter, setWe
|
|
|
60
60
|
const postchatContext = (await (0, _renderSurveyHelpers.getPostChatContext)(chatSDK, state, dispatch)) ?? (state === null || state === void 0 ? void 0 : (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : _state$domainStates.postChatContext);
|
|
61
61
|
if (postchatContext === undefined) {
|
|
62
62
|
var _state$appStates2;
|
|
63
|
+
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
64
|
+
eventName: _TelemetryConstants.BroadcastEvent.OnWidgetError,
|
|
65
|
+
payload: {
|
|
66
|
+
errorMessage: "Widget did not display post chat survey as getPostChatContext returned undefined."
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
63
70
|
// For Customer intiated conversations, just close chat widget
|
|
64
71
|
if ((state === null || state === void 0 ? void 0 : (_state$appStates2 = state.appStates) === null || _state$appStates2 === void 0 ? void 0 : _state$appStates2.conversationEndedBy) === _Constants.ConversationEndEntity.Customer) {
|
|
65
72
|
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
@@ -7,6 +7,7 @@ exports.initWebChatComposer = void 0;
|
|
|
7
7
|
var _Constants = require("../../../common/Constants");
|
|
8
8
|
var _TelemetryConstants = require("../../../common/telemetry/TelemetryConstants");
|
|
9
9
|
var _utils = require("../../../common/utils");
|
|
10
|
+
var _dompurify = _interopRequireDefault(require("dompurify"));
|
|
10
11
|
var _HyperlinkTextOverrideRenderer = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer"));
|
|
11
12
|
var _LiveChatWidgetActionType = require("../../../contexts/common/LiveChatWidgetActionType");
|
|
12
13
|
var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
@@ -22,8 +23,10 @@ var _conversationEndMiddleware = _interopRequireDefault(require("../../webchatco
|
|
|
22
23
|
var _dataMaskingMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware"));
|
|
23
24
|
var _createMarkdown = require("./createMarkdown");
|
|
24
25
|
var _maxMessageSizeValidator = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator"));
|
|
26
|
+
var _messageSequenceIdOverrideMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware"));
|
|
25
27
|
var _messageTimestampMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware"));
|
|
26
28
|
var _botframeworkWebchat = require("botframework-webchat");
|
|
29
|
+
var _toastMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware"));
|
|
27
30
|
var _WebChatLogger = require("../../webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger");
|
|
28
31
|
var _defaultAttachmentProps = require("../../webchatcontainerstateful/common/defaultProps/defaultAttachmentProps");
|
|
29
32
|
var _defaultMiddlewareLocalizedTexts = require("../../webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
@@ -34,9 +37,6 @@ var _htmlPlayerMiddleware = _interopRequireDefault(require("../../webchatcontain
|
|
|
34
37
|
var _htmlTextMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware"));
|
|
35
38
|
var _preProcessingMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware"));
|
|
36
39
|
var _sanitizationMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware"));
|
|
37
|
-
var _dompurify = _interopRequireDefault(require("dompurify"));
|
|
38
|
-
var _messageSequenceIdOverrideMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware"));
|
|
39
|
-
var _toastMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware"));
|
|
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) => {
|
|
@@ -106,7 +106,11 @@ const initWebChatComposer = (props, state, dispatch, chatSDK, endChat) => {
|
|
|
106
106
|
markdownRenderers.forEach(renderer => {
|
|
107
107
|
text = renderer.render(text);
|
|
108
108
|
});
|
|
109
|
-
|
|
109
|
+
const config = {
|
|
110
|
+
FORBID_TAGS: ["form", "button", "script", "div"],
|
|
111
|
+
FORBID_ATTR: ["action"]
|
|
112
|
+
};
|
|
113
|
+
text = _dompurify.default.sanitize(text, config);
|
|
110
114
|
return text;
|
|
111
115
|
};
|
|
112
116
|
function postDomPurifyActivities() {
|
|
@@ -206,6 +206,12 @@ const initStartChat = async (chatSDK, dispatch, setAdapter, state, props, params
|
|
|
206
206
|
exception: `Failed to setup startChat: ${error}`
|
|
207
207
|
}
|
|
208
208
|
});
|
|
209
|
+
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
210
|
+
eventName: _TelemetryConstants.BroadcastEvent.OnWidgetError,
|
|
211
|
+
payload: {
|
|
212
|
+
errorMessage: error
|
|
213
|
+
}
|
|
214
|
+
});
|
|
209
215
|
isStartChatSuccessful = false;
|
|
210
216
|
throw error;
|
|
211
217
|
}
|
|
@@ -155,6 +155,12 @@ const LiveChatWidgetStateful = props => {
|
|
|
155
155
|
}
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
|
+
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
159
|
+
eventName: _TelemetryConstants.BroadcastEvent.OnWidgetError,
|
|
160
|
+
payload: {
|
|
161
|
+
errorMessage: "Chat found in cache but invalid as the conversation status is inactive."
|
|
162
|
+
}
|
|
163
|
+
});
|
|
158
164
|
}
|
|
159
165
|
if (isChatValid === false) {
|
|
160
166
|
if (localState) {
|
|
@@ -274,6 +280,12 @@ const LiveChatWidgetStateful = props => {
|
|
|
274
280
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
275
281
|
payload: _ConversationState.ConversationState.OutOfOffice
|
|
276
282
|
});
|
|
283
|
+
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
284
|
+
eventName: _TelemetryConstants.BroadcastEvent.OnWidgetError,
|
|
285
|
+
payload: {
|
|
286
|
+
errorMessage: "Out-of-office hours status is shown."
|
|
287
|
+
}
|
|
288
|
+
});
|
|
277
289
|
return;
|
|
278
290
|
}
|
|
279
291
|
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
@@ -365,9 +377,16 @@ const LiveChatWidgetStateful = props => {
|
|
|
365
377
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CHAT_DISCONNECT_EVENT_RECEIVED,
|
|
366
378
|
payload: true
|
|
367
379
|
});
|
|
380
|
+
const desc = "Chat disconnected due to timeout, user went offline or blocked the device (including closing laptop)";
|
|
368
381
|
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
369
382
|
Event: _TelemetryConstants.TelemetryEvent.ChatDisconnectThreadEventReceived,
|
|
370
|
-
Description:
|
|
383
|
+
Description: desc
|
|
384
|
+
});
|
|
385
|
+
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
386
|
+
eventName: _TelemetryConstants.BroadcastEvent.OnWidgetError,
|
|
387
|
+
payload: {
|
|
388
|
+
errorMessage: desc
|
|
389
|
+
}
|
|
371
390
|
});
|
|
372
391
|
}
|
|
373
392
|
});
|
|
@@ -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 {
|
|
@@ -6,18 +6,41 @@ 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
|
+
*/
|
|
16
27
|
getLiveChatConfig() {
|
|
17
28
|
return {
|
|
18
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",
|
|
19
37
|
msdyn_postconversationsurveyenable: "false",
|
|
20
|
-
|
|
38
|
+
OutOfOperatingHours: "False",
|
|
39
|
+
ShowWidget: "True"
|
|
40
|
+
},
|
|
41
|
+
ChatWidgetLanguage: {
|
|
42
|
+
msdyn_localeid: "1033",
|
|
43
|
+
msdyn_languagename: "English - United States"
|
|
21
44
|
}
|
|
22
45
|
};
|
|
23
46
|
}
|
|
@@ -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 }; }
|
|
@@ -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) {
|
|
@@ -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).
|
|
@@ -82,21 +83,23 @@ export const FooterStateful = props => {
|
|
|
82
83
|
}
|
|
83
84
|
};
|
|
84
85
|
useEffect(() => {
|
|
85
|
-
if (state.appStates.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
+
}
|
|
91
94
|
}
|
|
92
|
-
}, []);
|
|
95
|
+
}, [state.appStates.conversationState]);
|
|
93
96
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !hideFooterDisplay && /*#__PURE__*/React.createElement(Footer, {
|
|
94
97
|
componentOverrides: footerProps === null || footerProps === void 0 ? void 0 : footerProps.componentOverrides,
|
|
95
98
|
controlProps: controlProps,
|
|
96
99
|
styleProps: footerProps === null || footerProps === void 0 ? void 0 : footerProps.styleProps
|
|
97
100
|
}), /*#__PURE__*/React.createElement(AudioNotificationStateful, {
|
|
98
101
|
audioSrc: (audioNotificationProps === null || audioNotificationProps === void 0 ? void 0 : audioNotificationProps.audioSrc) ?? NewMessageNotificationSoundBase64,
|
|
99
|
-
isAudioMuted: state.appStates.isAudioMuted
|
|
102
|
+
isAudioMuted: state.appStates.isAudioMuted ?? false
|
|
100
103
|
}));
|
|
101
104
|
};
|
|
102
105
|
export default FooterStateful;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfirmationState, Constants, ConversationEndEntity, ParticipantType, PrepareEndChatDescriptionConstants } from "../../../common/Constants";
|
|
2
|
-
import { LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
2
|
+
import { BroadcastEvent, LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
3
3
|
import { getConversationDetailsCall, getWidgetEndChatEventName } from "../../../common/utils";
|
|
4
4
|
import { getPostChatContext, initiatePostChat } from "./renderSurveyHelpers";
|
|
5
5
|
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
@@ -55,6 +55,13 @@ const prepareEndChat = async (props, chatSDK, state, dispatch, setAdapter, setWe
|
|
|
55
55
|
const postchatContext = (await getPostChatContext(chatSDK, state, dispatch)) ?? (state === null || state === void 0 ? void 0 : (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : _state$domainStates.postChatContext);
|
|
56
56
|
if (postchatContext === undefined) {
|
|
57
57
|
var _state$appStates2;
|
|
58
|
+
BroadcastService.postMessage({
|
|
59
|
+
eventName: BroadcastEvent.OnWidgetError,
|
|
60
|
+
payload: {
|
|
61
|
+
errorMessage: "Widget did not display post chat survey as getPostChatContext returned undefined."
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
58
65
|
// For Customer intiated conversations, just close chat widget
|
|
59
66
|
if ((state === null || state === void 0 ? void 0 : (_state$appStates2 = state.appStates) === null || _state$appStates2 === void 0 ? void 0 : _state$appStates2.conversationEndedBy) === ConversationEndEntity.Customer) {
|
|
60
67
|
TelemetryHelper.logSDKEvent(LogLevel.INFO, {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ConversationEndEntity, ParticipantType } from "../../../common/Constants";
|
|
2
2
|
import { LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
3
3
|
import { changeLanguageCodeFormatForWebChat, getConversationDetailsCall } from "../../../common/utils";
|
|
4
|
+
import DOMPurify from "dompurify";
|
|
4
5
|
import HyperlinkTextOverrideRenderer from "../../webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer";
|
|
5
6
|
import { LiveChatWidgetActionType } from "../../../contexts/common/LiveChatWidgetActionType";
|
|
6
7
|
import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
|
|
@@ -16,8 +17,10 @@ import createConversationEndMiddleware from "../../webchatcontainerstateful/webc
|
|
|
16
17
|
import createDataMaskingMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware";
|
|
17
18
|
import { createMarkdown } from "./createMarkdown";
|
|
18
19
|
import createMaxMessageSizeValidator from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator";
|
|
20
|
+
import createMessageSequenceIdOverrideMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware";
|
|
19
21
|
import createMessageTimeStampMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware";
|
|
20
22
|
import { createStore } from "botframework-webchat";
|
|
23
|
+
import createToastMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware";
|
|
21
24
|
import { createWebChatTelemetry } from "../../webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger";
|
|
22
25
|
import { defaultAttachmentProps } from "../../webchatcontainerstateful/common/defaultProps/defaultAttachmentProps";
|
|
23
26
|
import { defaultMiddlewareLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
@@ -28,9 +31,6 @@ import htmlPlayerMiddleware from "../../webchatcontainerstateful/webchatcontroll
|
|
|
28
31
|
import htmlTextMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware";
|
|
29
32
|
import preProcessingMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware";
|
|
30
33
|
import sanitizationMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware";
|
|
31
|
-
import DOMPurify from "dompurify";
|
|
32
|
-
import createMessageSequenceIdOverrideMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware";
|
|
33
|
-
import createToastMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware";
|
|
34
34
|
|
|
35
35
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
36
36
|
export const initWebChatComposer = (props, state, dispatch, chatSDK, endChat) => {
|
|
@@ -100,7 +100,11 @@ export const initWebChatComposer = (props, state, dispatch, chatSDK, endChat) =>
|
|
|
100
100
|
markdownRenderers.forEach(renderer => {
|
|
101
101
|
text = renderer.render(text);
|
|
102
102
|
});
|
|
103
|
-
|
|
103
|
+
const config = {
|
|
104
|
+
FORBID_TAGS: ["form", "button", "script", "div"],
|
|
105
|
+
FORBID_ATTR: ["action"]
|
|
106
|
+
};
|
|
107
|
+
text = DOMPurify.sanitize(text, config);
|
|
104
108
|
return text;
|
|
105
109
|
};
|
|
106
110
|
function postDomPurifyActivities() {
|
|
@@ -199,6 +199,12 @@ const initStartChat = async (chatSDK, dispatch, setAdapter, state, props, params
|
|
|
199
199
|
exception: `Failed to setup startChat: ${error}`
|
|
200
200
|
}
|
|
201
201
|
});
|
|
202
|
+
BroadcastService.postMessage({
|
|
203
|
+
eventName: BroadcastEvent.OnWidgetError,
|
|
204
|
+
payload: {
|
|
205
|
+
errorMessage: error
|
|
206
|
+
}
|
|
207
|
+
});
|
|
202
208
|
isStartChatSuccessful = false;
|
|
203
209
|
throw error;
|
|
204
210
|
}
|
|
@@ -147,6 +147,12 @@ export const LiveChatWidgetStateful = props => {
|
|
|
147
147
|
}
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
|
+
BroadcastService.postMessage({
|
|
151
|
+
eventName: BroadcastEvent.OnWidgetError,
|
|
152
|
+
payload: {
|
|
153
|
+
errorMessage: "Chat found in cache but invalid as the conversation status is inactive."
|
|
154
|
+
}
|
|
155
|
+
});
|
|
150
156
|
}
|
|
151
157
|
if (isChatValid === false) {
|
|
152
158
|
if (localState) {
|
|
@@ -266,6 +272,12 @@ export const LiveChatWidgetStateful = props => {
|
|
|
266
272
|
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
267
273
|
payload: ConversationState.OutOfOffice
|
|
268
274
|
});
|
|
275
|
+
BroadcastService.postMessage({
|
|
276
|
+
eventName: BroadcastEvent.OnWidgetError,
|
|
277
|
+
payload: {
|
|
278
|
+
errorMessage: "Out-of-office hours status is shown."
|
|
279
|
+
}
|
|
280
|
+
});
|
|
269
281
|
return;
|
|
270
282
|
}
|
|
271
283
|
BroadcastService.postMessage({
|
|
@@ -357,9 +369,16 @@ export const LiveChatWidgetStateful = props => {
|
|
|
357
369
|
type: LiveChatWidgetActionType.SET_CHAT_DISCONNECT_EVENT_RECEIVED,
|
|
358
370
|
payload: true
|
|
359
371
|
});
|
|
372
|
+
const desc = "Chat disconnected due to timeout, user went offline or blocked the device (including closing laptop)";
|
|
360
373
|
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
361
374
|
Event: TelemetryEvent.ChatDisconnectThreadEventReceived,
|
|
362
|
-
Description:
|
|
375
|
+
Description: desc
|
|
376
|
+
});
|
|
377
|
+
BroadcastService.postMessage({
|
|
378
|
+
eventName: BroadcastEvent.OnWidgetError,
|
|
379
|
+
payload: {
|
|
380
|
+
errorMessage: desc
|
|
381
|
+
}
|
|
363
382
|
});
|
|
364
383
|
}
|
|
365
384
|
});
|
|
@@ -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,
|
|
50
|
+
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;
|
|
51
51
|
const {
|
|
52
52
|
BasicWebChat
|
|
53
53
|
} = Components;
|
|
@@ -163,6 +163,11 @@ export const WebChatContainerStateful = props => {
|
|
|
163
163
|
div[class="ac-textBlock"] *,
|
|
164
164
|
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.textWhiteSpace}}
|
|
165
165
|
|
|
166
|
+
div[class="ac-input-container"] input.ac-multichoiceInput,
|
|
167
|
+
div[class="ac-input-container"] select.ac-multichoiceInput {
|
|
168
|
+
${webChatContainerProps !== null && webChatContainerProps !== void 0 && (_webChatContainerProp7 = webChatContainerProps.adaptiveCardStyles) !== null && _webChatContainerProp7 !== void 0 && _webChatContainerProp7.choiceInputPadding ? `padding: ${webChatContainerProps.adaptiveCardStyles.choiceInputPadding} !important;` : ""}
|
|
169
|
+
}
|
|
170
|
+
|
|
166
171
|
.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 {
|
|
167
172
|
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.webChatStyles) === null || _defaultWebChatContai === void 0 ? void 0 : _defaultWebChatContai.bubbleBackground)};
|
|
168
173
|
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.webChatStyles) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.bubbleTextColor)};
|
|
@@ -172,16 +177,16 @@ export const WebChatContainerStateful = props => {
|
|
|
172
177
|
div[class="ac-textBlock"] a:visited,
|
|
173
178
|
div[class="ac-textBlock"] a:hover,
|
|
174
179
|
div[class="ac-textBlock"] a:active {
|
|
175
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
180
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp8 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp8 === void 0 ? void 0 : _webChatContainerProp8.anchorColor) ?? defaultAdaptiveCardStyles.anchorColor};
|
|
176
181
|
}
|
|
177
182
|
|
|
178
|
-
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
183
|
+
.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.buttonWhiteSpace} !important;}
|
|
179
184
|
|
|
180
185
|
.ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon {
|
|
181
186
|
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03LjI1MDEgNC41MDAxN0gxMC43NDk1QzExLjE2MzcgNC41MDAxNyAxMS40OTk1IDQuODM1OTYgMTEuNDk5NSA1LjI1MDE3QzExLjQ5OTUgNS42Mjk4NiAxMS4yMTczIDUuOTQzNjYgMTAuODUxMyA1Ljk5MzMyTDEwLjc0OTUgNi4wMDAxN0g3LjI0OTc0QzYuMDcwNzkgNS45OTk2MSA1LjEwMzQ5IDYuOTA2NTYgNS4wMDc4NiA4LjA2MTEyTDUuMDAwMjggOC4yMjAwM0w1LjAwMzEyIDE2Ljc1MDdDNS4wMDM0MyAxNy45NDE1IDUuOTI4ODUgMTguOTE2MSA3LjA5OTY2IDE4Ljk5NDlMNy4yNTM3MSAxOS4wMDAxTDE1Ljc1MTggMTguOTg4NEMxNi45NDE1IDE4Ljk4NjggMTcuOTE0NSAxOC4wNjIgMTcuOTkzNSAxNi44OTIzTDE3Ljk5ODcgMTYuNzM4NFYxMy4yMzIxQzE3Ljk5ODcgMTIuODE3OSAxOC4zMzQ1IDEyLjQ4MjEgMTguNzQ4NyAxMi40ODIxQzE5LjEyODQgMTIuNDgyMSAxOS40NDIyIDEyLjc2NDMgMTkuNDkxOCAxMy4xMzAzTDE5LjQ5ODcgMTMuMjMyMVYxNi43Mzg0QzE5LjQ5ODcgMTguNzQwNyAxNy45MjkzIDIwLjM3NjkgMTUuOTUyOCAyMC40ODI5TDE1Ljc1MzggMjAuNDg4NEw3LjI1ODI3IDIwLjUwMDFMNy4wNTQ5NSAyMC40OTQ5QzUuMTQyMzkgMjAuMzk1NCAzLjYwODk1IDE4Ljg2MjcgMy41MDgzNyAxNi45NTAyTDMuNTAzMTIgMTYuNzUxMUwzLjUwMDg5IDguMjUyN0wzLjUwNTI5IDguMDUwMkMzLjYwNTM5IDYuMTM3NDkgNS4xMzg2NyA0LjYwNDQ5IDcuMDUwOTYgNC41MDUyN0w3LjI1MDEgNC41MDAxN0gxMC43NDk1SDcuMjUwMVpNMTMuNzQ4MSAzLjAwMTQ2TDIwLjMwMTggMy4wMDE5N0wyMC40MDE0IDMuMDE1NzVMMjAuNTAyMiAzLjA0MzkzTDIwLjU1OSAzLjA2ODAzQzIwLjYxMjIgMy4wOTEyMiAyMC42NjM0IDMuMTIxNjMgMjAuNzExMSAzLjE1ODg1TDIwLjc4MDQgMy4yMjE1NkwyMC44NjQxIDMuMzIwMTRMMjAuOTE4MyAzLjQxMDI1TDIwLjk1NyAzLjUwMDU3TDIwLjk3NjIgMy41NjQ3NkwyMC45ODk4IDMuNjI4NjJMMjAuOTk5MiAzLjcyMjgyTDIwLjk5OTcgMTAuMjU1NEMyMC45OTk3IDEwLjY2OTYgMjAuNjYzOSAxMS4wMDU0IDIwLjI0OTcgMTEuMDA1NEMxOS44NyAxMS4wMDU0IDE5LjU1NjIgMTAuNzIzMiAxOS41MDY1IDEwLjM1NzFMMTkuNDk5NyAxMC4yNTU0TDE5LjQ5ODkgNS41NjE0N0wxMi4yNzk3IDEyLjc4NDdDMTIuMDEzNCAxMy4wNTEgMTEuNTk2OCAxMy4wNzUzIDExLjMwMzEgMTIuODU3NUwxMS4yMTkgMTIuNzg0OUMxMC45NTI3IDEyLjUxODcgMTAuOTI4NCAxMi4xMDIxIDExLjE0NjIgMTEuODA4NEwxMS4yMTg4IDExLjcyNDNMMTguNDM2OSA0LjUwMTQ2SDEzLjc0ODFDMTMuMzY4NCA0LjUwMTQ2IDEzLjA1NDYgNC4yMTkzMSAxMy4wMDUgMy44NTMyNEwxMi45OTgxIDMuNzUxNDZDMTIuOTk4MSAzLjM3MTc3IDEzLjI4MDMgMy4wNTc5NyAxMy42NDY0IDMuMDA4MzFMMTMuNzQ4MSAzLjAwMTQ2WiIgZmlsbD0iI0ZGRkZGRiIgLz48L3N2Zz4) !important;
|
|
182
187
|
height: .75em;
|
|
183
188
|
margin-left: .25em;
|
|
184
|
-
filter:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
189
|
+
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 === null || defaultReceivedMessageAnchorStyles === void 0 ? void 0 : defaultReceivedMessageAnchorStyles.filter)};
|
|
185
190
|
}
|
|
186
191
|
pre {
|
|
187
192
|
white-space: pre-wrap;
|
|
@@ -194,13 +199,13 @@ export const WebChatContainerStateful = props => {
|
|
|
194
199
|
.ms_lcw_webchat_received_message a:visited,
|
|
195
200
|
.ms_lcw_webchat_received_message a:hover,
|
|
196
201
|
.ms_lcw_webchat_received_message a:active {
|
|
197
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
202
|
+
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 === null || defaultReceivedMessageAnchorStyles === void 0 ? void 0 : defaultReceivedMessageAnchorStyles.color)};
|
|
198
203
|
}
|
|
199
204
|
.ms_lcw_webchat_sent_message a:link,
|
|
200
205
|
.ms_lcw_webchat_sent_message a:visited,
|
|
201
206
|
.ms_lcw_webchat_sent_message a:hover,
|
|
202
207
|
.ms_lcw_webchat_sent_message a:active {
|
|
203
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
208
|
+
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 === null || defaultSentMessageAnchorStyles === void 0 ? void 0 : defaultSentMessageAnchorStyles.color)};
|
|
204
209
|
}
|
|
205
210
|
|
|
206
211
|
.webchat__bubble:not(.webchat__bubble--from-user) .webchat__bubble__content {
|
|
@@ -1,17 +1,40 @@
|
|
|
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); }
|
|
1
4
|
import { DesignerChatAdapter } from "./DesignerChatAdapter";
|
|
2
5
|
import { MockChatSDK } from "./mockchatsdk";
|
|
3
6
|
export class DesignerChatSDK extends MockChatSDK {
|
|
4
7
|
constructor() {
|
|
5
8
|
super();
|
|
9
|
+
_defineProperty(this, "localeId", this.getLiveChatConfig().ChatWidgetLanguage.msdyn_localeid);
|
|
6
10
|
}
|
|
7
11
|
createChatAdapter() {
|
|
8
12
|
return new DesignerChatAdapter();
|
|
9
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* If the widget is running in designer mode, we mock the initialize response. We don't want
|
|
16
|
+
* any interactions with a real server in when designing LCW widget visually in Modern Admin.
|
|
17
|
+
*
|
|
18
|
+
* - All GUIDs were changed to 00000000-0000-0000-0000-000000000000.
|
|
19
|
+
* - msdyn_callingoptions was changed to disable calling functionality
|
|
20
|
+
*/
|
|
10
21
|
getLiveChatConfig() {
|
|
11
22
|
return {
|
|
12
23
|
LiveWSAndLiveChatEngJoin: {
|
|
24
|
+
msdyn_widgetthemecolor: "19236002",
|
|
25
|
+
// msdyn_callingoptions was changed to disable calling functionality
|
|
26
|
+
msdyn_callingoptions: "192350000",
|
|
27
|
+
msdyn_widgettitle: "Let\u0027s chat",
|
|
28
|
+
msdyn_conversationmode: "192350000",
|
|
29
|
+
msdyn_avatarurl: "https://oc-cdn-ocprod.azureedge.net/livechatwidget/images/chatIcon.svg",
|
|
30
|
+
msdyn_name: "Let's Chat",
|
|
13
31
|
msdyn_postconversationsurveyenable: "false",
|
|
14
|
-
|
|
32
|
+
OutOfOperatingHours: "False",
|
|
33
|
+
ShowWidget: "True"
|
|
34
|
+
},
|
|
35
|
+
ChatWidgetLanguage: {
|
|
36
|
+
msdyn_localeid: "1033",
|
|
37
|
+
msdyn_languagename: "English - United States"
|
|
15
38
|
}
|
|
16
39
|
};
|
|
17
40
|
}
|
|
@@ -80,7 +80,8 @@ export const createActivityMiddleware = (renderMarkdown, systemMessageStyleProps
|
|
|
80
80
|
}
|
|
81
81
|
if (isTagIncluded(card, Constants.systemMessageTag)) {
|
|
82
82
|
return handleSystemMessage(next, args, card, renderMarkdown, systemMessageStyleProps);
|
|
83
|
-
}
|
|
83
|
+
}
|
|
84
|
+
if (card.activity.text && card.activity.type === DirectLineActivityType.Message) {
|
|
84
85
|
if (!card.activity.channelData.isHtmlEncoded && card.activity.channelId === Constants.webchatChannelId) {
|
|
85
86
|
card.activity.text = escapeHtml(card.activity.text);
|
|
86
87
|
card.activity.channelData.isHtmlEncoded = true;
|
|
@@ -3,6 +3,8 @@ import { NotificationLevel } from "../enums/NotificationLevel";
|
|
|
3
3
|
import { WebChatActionType } from "../enums/WebChatActionType";
|
|
4
4
|
import { WebChatStoreLoader } from "../WebChatStoreLoader";
|
|
5
5
|
import { setFocusOnSendBox } from "../../../../common/utils";
|
|
6
|
+
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
7
|
+
import { BroadcastEvent } from "../../../../common/telemetry/TelemetryConstants";
|
|
6
8
|
export class NotificationHandler {
|
|
7
9
|
static notify(id, level, message) {
|
|
8
10
|
if (WebChatStoreLoader.store) {
|
|
@@ -28,6 +30,12 @@ export class NotificationHandler {
|
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
static notifyError(id, message) {
|
|
33
|
+
BroadcastService.postMessage({
|
|
34
|
+
eventName: BroadcastEvent.OnWidgetError,
|
|
35
|
+
payload: {
|
|
36
|
+
errorMessage: message
|
|
37
|
+
}
|
|
38
|
+
});
|
|
31
39
|
this.notify(id, NotificationLevel.Error, message);
|
|
32
40
|
}
|
|
33
41
|
static notifyWarning(id, message) {
|
package/lib/esm/index.js
CHANGED
|
@@ -4,5 +4,6 @@ import useChatSDKStore from "./hooks/useChatSDKStore";
|
|
|
4
4
|
import { getWidgetCacheId, getWidgetEndChatEventName } from "./common/utils";
|
|
5
5
|
import { ConversationState } from "./contexts/common/ConversationState";
|
|
6
6
|
export { default as LiveChatWidget } from "./components/livechatwidget/LiveChatWidget";
|
|
7
|
+
export { getMockChatSDKIfApplicable } from "./components/livechatwidget/common/getMockChatSDKIfApplicable";
|
|
7
8
|
export { encodeComponentString, decodeComponentString, BroadcastService, useChatSDKStore, useChatContextStore };
|
|
8
9
|
export { getWidgetCacheId, getWidgetEndChatEventName, ConversationState };
|
|
@@ -53,7 +53,8 @@ export declare enum BroadcastEvent {
|
|
|
53
53
|
UpdateSessionDataForTelemetry = "UpdateSessionDataForTelemetry",
|
|
54
54
|
UpdateConversationDataForTelemetry = "UpdateConversationDataForTelemetry",
|
|
55
55
|
ContactIdNotFound = "ContactIdNotFound",
|
|
56
|
-
SyncMinimize = "SyncMinimize"
|
|
56
|
+
SyncMinimize = "SyncMinimize",
|
|
57
|
+
OnWidgetError = "OnWidgetError"
|
|
57
58
|
}
|
|
58
59
|
export declare enum TelemetryEvent {
|
|
59
60
|
CallAdded = "CallAdded",
|
|
@@ -3,10 +3,29 @@ import { MockChatSDK } from "./mockchatsdk";
|
|
|
3
3
|
export declare class DesignerChatSDK extends MockChatSDK {
|
|
4
4
|
constructor();
|
|
5
5
|
createChatAdapter(): DesignerChatAdapter;
|
|
6
|
+
localeId: string;
|
|
7
|
+
/**
|
|
8
|
+
* If the widget is running in designer mode, we mock the initialize response. We don't want
|
|
9
|
+
* any interactions with a real server in when designing LCW widget visually in Modern Admin.
|
|
10
|
+
*
|
|
11
|
+
* - All GUIDs were changed to 00000000-0000-0000-0000-000000000000.
|
|
12
|
+
* - msdyn_callingoptions was changed to disable calling functionality
|
|
13
|
+
*/
|
|
6
14
|
getLiveChatConfig(): {
|
|
7
15
|
LiveWSAndLiveChatEngJoin: {
|
|
8
|
-
|
|
16
|
+
msdyn_widgetthemecolor: string;
|
|
17
|
+
msdyn_callingoptions: string;
|
|
18
|
+
msdyn_widgettitle: string;
|
|
9
19
|
msdyn_conversationmode: string;
|
|
20
|
+
msdyn_avatarurl: string;
|
|
21
|
+
msdyn_name: string;
|
|
22
|
+
msdyn_postconversationsurveyenable: string;
|
|
23
|
+
OutOfOperatingHours: string;
|
|
24
|
+
ShowWidget: string;
|
|
25
|
+
};
|
|
26
|
+
ChatWidgetLanguage: {
|
|
27
|
+
msdyn_localeid: string;
|
|
28
|
+
msdyn_languagename: string;
|
|
10
29
|
};
|
|
11
30
|
};
|
|
12
31
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -4,5 +4,6 @@ import useChatSDKStore from "./hooks/useChatSDKStore";
|
|
|
4
4
|
import { getWidgetCacheId, getWidgetEndChatEventName } from "./common/utils";
|
|
5
5
|
import { ConversationState } from "./contexts/common/ConversationState";
|
|
6
6
|
export { default as LiveChatWidget } from "./components/livechatwidget/LiveChatWidget";
|
|
7
|
+
export { getMockChatSDKIfApplicable } from "./components/livechatwidget/common/getMockChatSDKIfApplicable";
|
|
7
8
|
export { encodeComponentString, decodeComponentString, BroadcastService, useChatSDKStore, useChatContextStore };
|
|
8
9
|
export { getWidgetCacheId, getWidgetEndChatEventName, ConversationState };
|