@microsoft/omnichannel-chat-widget 1.7.6-main.d227a81 → 1.7.6-main.dca3f60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +4 -2
- package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +5 -3
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +2 -2
- package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +2 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +7 -7
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +4 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +7 -4
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +4 -2
- package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +5 -3
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +2 -2
- package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +7 -7
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +4 -4
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +7 -4
- package/lib/types/common/telemetry/TelemetryHelper.d.ts +1 -1
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +1 -1
- package/lib/types/common/telemetry/definitions/Payload.d.ts +1 -1
- package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/authHelper.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/createAdapter.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/createDownloadTranscriptProps.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/createInternetConnectionChangeHandler.d.ts +2 -1
- package/lib/types/components/livechatwidget/common/endChat.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/startChat.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/startProactiveChat.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatProps.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.d.ts +1 -1
- package/lib/types/hooks/useChatSDKStore.d.ts +1 -1
- package/lib/types/hooks/useDebounce.d.ts +1 -1
- package/package.json +16 -7
|
@@ -61,22 +61,24 @@ const EmailTranscriptPaneStateful = props => {
|
|
|
61
61
|
attachmentMessage: (props === null || props === void 0 ? void 0 : props.attachmentMessage) ?? "The following attachment was uploaded during the conversation:"
|
|
62
62
|
};
|
|
63
63
|
try {
|
|
64
|
+
var _state$domainStates2, _state$domainStates2$;
|
|
64
65
|
await (facadeChatSDK === null || facadeChatSDK === void 0 ? void 0 : facadeChatSDK.emailLiveChatTranscript(chatTranscriptBody, {
|
|
65
66
|
liveChatContext
|
|
66
67
|
}));
|
|
67
|
-
_NotificationHandler.NotificationHandler.notifySuccess(_NotificationScenarios.NotificationScenarios.EmailAddressSaved, _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts === null || _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts === void 0 ? void 0 : _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_SUCCESS);
|
|
68
|
+
_NotificationHandler.NotificationHandler.notifySuccess(_NotificationScenarios.NotificationScenarios.EmailAddressSaved, (state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : (_state$domainStates2$ = _state$domainStates2.middlewareLocalizedTexts) === null || _state$domainStates2$ === void 0 ? void 0 : _state$domainStates2$.MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_SUCCESS) ?? (_defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts === null || _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts === void 0 ? void 0 : _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_SUCCESS));
|
|
68
69
|
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
69
70
|
Event: _TelemetryConstants.TelemetryEvent.EmailTranscriptSent,
|
|
70
71
|
Description: "Transcript sent to email successfully."
|
|
71
72
|
});
|
|
72
73
|
} catch (ex) {
|
|
74
|
+
var _state$domainStates3, _state$domainStates3$;
|
|
73
75
|
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
74
76
|
Event: _TelemetryConstants.TelemetryEvent.EmailTranscriptFailed,
|
|
75
77
|
ExceptionDetails: {
|
|
76
78
|
exception: ex
|
|
77
79
|
}
|
|
78
80
|
});
|
|
79
|
-
const message = (0, _utils.formatTemplateString)(_defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_ERROR, [email]);
|
|
81
|
+
const message = (0, _utils.formatTemplateString)((state === null || state === void 0 ? void 0 : (_state$domainStates3 = state.domainStates) === null || _state$domainStates3 === void 0 ? void 0 : (_state$domainStates3$ = _state$domainStates3.middlewareLocalizedTexts) === null || _state$domainStates3$ === void 0 ? void 0 : _state$domainStates3$.MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_ERROR) ?? _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_ERROR, [email]);
|
|
80
82
|
_NotificationHandler.NotificationHandler.notifyError(_NotificationScenarios.NotificationScenarios.EmailTranscriptError, (props === null || props === void 0 ? void 0 : props.bannerMessageOnError) ?? message);
|
|
81
83
|
}
|
|
82
84
|
}, [props.attachmentMessage, props.bannerMessageOnError, facadeChatSDK, state.domainStates.liveChatContext]);
|
|
@@ -20,19 +20,21 @@ const isInternetConnected = async () => {
|
|
|
20
20
|
return false;
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
const createInternetConnectionChangeHandler = async
|
|
23
|
+
const createInternetConnectionChangeHandler = async state => {
|
|
24
24
|
const handler = async () => {
|
|
25
25
|
const connected = await isInternetConnected();
|
|
26
26
|
if (!connected) {
|
|
27
|
+
var _state$domainStates, _state$domainStates$m;
|
|
27
28
|
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.WARN, {
|
|
28
29
|
Event: _TelemetryConstants.TelemetryEvent.NetworkDisconnected
|
|
29
30
|
});
|
|
30
|
-
_NotificationHandler.NotificationHandler.notifyError(_NotificationScenarios.NotificationScenarios.InternetConnection, _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_NO_INTERNET_CONNECTION);
|
|
31
|
+
_NotificationHandler.NotificationHandler.notifyError(_NotificationScenarios.NotificationScenarios.InternetConnection, (state === null || state === void 0 ? void 0 : (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : (_state$domainStates$m = _state$domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m === void 0 ? void 0 : _state$domainStates$m.MIDDLEWARE_BANNER_NO_INTERNET_CONNECTION) ?? _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_NO_INTERNET_CONNECTION);
|
|
31
32
|
} else {
|
|
33
|
+
var _state$domainStates2, _state$domainStates2$;
|
|
32
34
|
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.WARN, {
|
|
33
35
|
Event: _TelemetryConstants.TelemetryEvent.NetworkReconnected
|
|
34
36
|
});
|
|
35
|
-
_NotificationHandler.NotificationHandler.notifySuccess(_NotificationScenarios.NotificationScenarios.InternetConnection, _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_INTERNET_BACK_ONLINE);
|
|
37
|
+
_NotificationHandler.NotificationHandler.notifySuccess(_NotificationScenarios.NotificationScenarios.InternetConnection, (state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : (_state$domainStates2$ = _state$domainStates2.middlewareLocalizedTexts) === null || _state$domainStates2$ === void 0 ? void 0 : _state$domainStates2$.MIDDLEWARE_BANNER_INTERNET_BACK_ONLINE) ?? _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_INTERNET_BACK_ONLINE);
|
|
36
38
|
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
37
39
|
eventName: _TelemetryConstants.BroadcastEvent.NetworkReconnected
|
|
38
40
|
});
|
|
@@ -227,7 +227,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
227
227
|
state.domainStates.confirmationState = _Constants.ConfirmationState.NotSet;
|
|
228
228
|
setupClientDataStore();
|
|
229
229
|
(0, _registerTelemetryLoggers.registerTelemetryLoggers)(props, dispatch);
|
|
230
|
-
(0, _createInternetConnectionChangeHandler.createInternetConnectionChangeHandler)();
|
|
230
|
+
(0, _createInternetConnectionChangeHandler.createInternetConnectionChangeHandler)(state);
|
|
231
231
|
dispatch({
|
|
232
232
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_WIDGET_ELEMENT_ID,
|
|
233
233
|
payload: widgetElementId
|
|
@@ -816,7 +816,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
816
816
|
const chatWidgetDraggableConfig = {
|
|
817
817
|
elementId: widgetElementId,
|
|
818
818
|
channel: ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.widgetInstanceId) ?? "lcw",
|
|
819
|
-
disabled: ((_props$draggableChatW = props.draggableChatWidgetProps) === null || _props$draggableChatW === void 0 ? void 0 : _props$draggableChatW.disabled)
|
|
819
|
+
disabled: ((_props$draggableChatW = props.draggableChatWidgetProps) === null || _props$draggableChatW === void 0 ? void 0 : _props$draggableChatW.disabled) !== true // Draggable by default, unless explicitly disabled
|
|
820
820
|
};
|
|
821
821
|
|
|
822
822
|
// Disable receiving IDraggableEvent in current window
|
package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js
CHANGED
|
@@ -28,4 +28,5 @@ exports.WebChatActionType = WebChatActionType;
|
|
|
28
28
|
WebChatActionType["WEB_CHAT_DISMISS_NOTIFICATION"] = "WEB_CHAT/DISMISS_NOTIFICATION";
|
|
29
29
|
WebChatActionType["WEB_CHAT_SET_SEND_BOX"] = "WEB_CHAT/SET_SEND_BOX";
|
|
30
30
|
WebChatActionType["WEB_CHAT_SEND_FILES"] = "WEB_CHAT/SEND_FILES";
|
|
31
|
+
WebChatActionType["WEB_CHAT_SET_SEND_BOX_ATTACHMENTS"] = "WEB_CHAT/SET_SEND_BOX_ATTACHMENTS";
|
|
31
32
|
})(WebChatActionType || (exports.WebChatActionType = WebChatActionType = {}));
|
|
@@ -7,19 +7,19 @@ exports.createAttachmentMiddleware = void 0;
|
|
|
7
7
|
var _Constants = require("../../../../../common/Constants");
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _FileAttachmentIconManager = require("../../../common/utils/FileAttachmentIconManager");
|
|
10
|
+
var _Attachment = _interopRequireDefault(require("./attachments/Attachment"));
|
|
10
11
|
var _TelemetryConstants = require("../../../../../common/telemetry/TelemetryConstants");
|
|
11
12
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
13
|
+
var _FileScanStatus = _interopRequireDefault(require("./attachments/FileScanStatus"));
|
|
14
|
+
var _MaliciousAttachment = _interopRequireDefault(require("./attachments/MaliciousAttachment"));
|
|
15
|
+
var _NotificationHandler = require("../../notification/NotificationHandler");
|
|
16
|
+
var _NotificationScenarios = require("../../enums/NotificationScenarios");
|
|
17
|
+
var _ScanInProgressAttachment = _interopRequireDefault(require("./attachments/ScanInProgressAttachment"));
|
|
12
18
|
var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
13
19
|
var _defaultAtttachmentAdaptiveCardStyles = require("./defaultStyles/defaultAtttachmentAdaptiveCardStyles");
|
|
14
20
|
var _defaultAttachmentProps = require("../../../common/defaultProps/defaultAttachmentProps");
|
|
15
|
-
var _ = require("../../../../..");
|
|
16
|
-
var _NotificationHandler = require("../../notification/NotificationHandler");
|
|
17
|
-
var _NotificationScenarios = require("../../enums/NotificationScenarios");
|
|
18
21
|
var _defaultMiddlewareLocalizedTexts = require("../../../common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
19
|
-
var
|
|
20
|
-
var _ScanInProgressAttachment = _interopRequireDefault(require("./attachments/ScanInProgressAttachment"));
|
|
21
|
-
var _MaliciousAttachment = _interopRequireDefault(require("./attachments/MaliciousAttachment"));
|
|
22
|
-
var _FileScanStatus = _interopRequireDefault(require("./attachments/FileScanStatus"));
|
|
22
|
+
var _ = require("../../../../..");
|
|
23
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
24
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
25
25
|
/******
|
|
@@ -17,7 +17,7 @@ const createSendFileAction = files => {
|
|
|
17
17
|
payload: {
|
|
18
18
|
files
|
|
19
19
|
},
|
|
20
|
-
type: _WebChatActionType.WebChatActionType.
|
|
20
|
+
type: _WebChatActionType.WebChatActionType.WEB_CHAT_SEND_MESSAGE
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
|
|
@@ -27,9 +27,9 @@ const attachmentProcessingMiddleware = _ref => {
|
|
|
27
27
|
dispatch
|
|
28
28
|
} = _ref;
|
|
29
29
|
return next => async action => {
|
|
30
|
-
var _action$payload, _action$payload$
|
|
31
|
-
if ((action === null || action === void 0 ? void 0 : action.type) === _WebChatActionType.WebChatActionType.
|
|
32
|
-
const files = action.payload.
|
|
30
|
+
var _action$payload, _action$payload$attac;
|
|
31
|
+
if ((action === null || action === void 0 ? void 0 : action.type) === _WebChatActionType.WebChatActionType.WEB_CHAT_SEND_MESSAGE && (action === null || action === void 0 ? void 0 : (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : (_action$payload$attac = _action$payload.attachments) === null || _action$payload$attac === void 0 ? void 0 : _action$payload$attac.length) > 0) {
|
|
32
|
+
const files = action.payload.attachments;
|
|
33
33
|
if (files.length === 1) {
|
|
34
34
|
return next(action);
|
|
35
35
|
}
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _TelemetryConstants = require("../../../../../common/telemetry/TelemetryConstants");
|
|
8
|
+
var _Constants = require("../../../../../common/Constants");
|
|
8
9
|
var _NotificationHandler = require("../../notification/NotificationHandler");
|
|
9
10
|
var _NotificationScenarios = require("../../enums/NotificationScenarios");
|
|
10
|
-
var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
11
11
|
var _TelemetryHelper = require("../../../../../common/telemetry/TelemetryHelper");
|
|
12
|
-
var
|
|
12
|
+
var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
13
13
|
/******
|
|
14
14
|
* AttachmentUploadValidatorMiddleware
|
|
15
15
|
*
|
|
@@ -26,6 +26,9 @@ const validateAttachment = (action, allowedFileExtensions, maxFileSizeSupportedB
|
|
|
26
26
|
var _action$payload, _action$payload$activ, _action$payload2, _action$payload2$acti, _action$payload2$acti2, _action$payload3, _action$payload3$acti, _action$payload3$acti2;
|
|
27
27
|
const attachments = action === null || action === void 0 ? void 0 : (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : (_action$payload$activ = _action$payload.activity) === null || _action$payload$activ === void 0 ? void 0 : _action$payload$activ.attachments;
|
|
28
28
|
const attachmentSizes = action === null || action === void 0 ? void 0 : (_action$payload2 = action.payload) === null || _action$payload2 === void 0 ? void 0 : (_action$payload2$acti = _action$payload2.activity) === null || _action$payload2$acti === void 0 ? void 0 : (_action$payload2$acti2 = _action$payload2$acti.channelData) === null || _action$payload2$acti2 === void 0 ? void 0 : _action$payload2$acti2.attachmentSizes;
|
|
29
|
+
if (!attachments || attachments.length === 0) {
|
|
30
|
+
return action;
|
|
31
|
+
}
|
|
29
32
|
if (attachments) {
|
|
30
33
|
for (let i = 0; i < attachments.length; i++) {
|
|
31
34
|
const maxUploadFileSize = getMaxUploadFileSize(maxFileSizeSupportedByDynamics, attachments[i].contentType);
|
|
@@ -196,11 +199,11 @@ const createAttachmentUploadValidatorMiddleware = (allowedFileExtensions, maxFil
|
|
|
196
199
|
} = _ref;
|
|
197
200
|
return next => action => {
|
|
198
201
|
if (action.type === _WebChatActionType.WebChatActionType.DIRECT_LINE_POST_ACTIVITY) {
|
|
199
|
-
var _payload$activity, _payload$
|
|
202
|
+
var _payload$activity, _payload$activity$att, _payload$activity2, _payload$activity2$ch, _payload$activity2$ch2;
|
|
200
203
|
const {
|
|
201
204
|
payload
|
|
202
205
|
} = action;
|
|
203
|
-
if (payload !== null && payload !== void 0 &&
|
|
206
|
+
if (payload !== null && payload !== void 0 && payload.activity.attachments && payload.activity.attachments.length > 0 && (payload === null || payload === void 0 ? void 0 : (_payload$activity = payload.activity) === null || _payload$activity === void 0 ? void 0 : (_payload$activity$att = _payload$activity.attachments) === null || _payload$activity$att === void 0 ? void 0 : _payload$activity$att.length) === (payload === null || payload === void 0 ? void 0 : (_payload$activity2 = payload.activity) === null || _payload$activity2 === void 0 ? void 0 : (_payload$activity2$ch = _payload$activity2.channelData) === null || _payload$activity2$ch === void 0 ? void 0 : (_payload$activity2$ch2 = _payload$activity2$ch.attachmentSizes) === null || _payload$activity2$ch2 === void 0 ? void 0 : _payload$activity2$ch2.length)) {
|
|
204
207
|
return next(validateAttachment(action, allowedFileExtensions, maxFileSizeSupportedByDynamics, localizedTexts));
|
|
205
208
|
}
|
|
206
209
|
}
|
|
@@ -52,22 +52,24 @@ export const EmailTranscriptPaneStateful = props => {
|
|
|
52
52
|
attachmentMessage: (props === null || props === void 0 ? void 0 : props.attachmentMessage) ?? "The following attachment was uploaded during the conversation:"
|
|
53
53
|
};
|
|
54
54
|
try {
|
|
55
|
+
var _state$domainStates2, _state$domainStates2$;
|
|
55
56
|
await (facadeChatSDK === null || facadeChatSDK === void 0 ? void 0 : facadeChatSDK.emailLiveChatTranscript(chatTranscriptBody, {
|
|
56
57
|
liveChatContext
|
|
57
58
|
}));
|
|
58
|
-
NotificationHandler.notifySuccess(NotificationScenarios.EmailAddressSaved, defaultMiddlewareLocalizedTexts === null || defaultMiddlewareLocalizedTexts === void 0 ? void 0 : defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_SUCCESS);
|
|
59
|
+
NotificationHandler.notifySuccess(NotificationScenarios.EmailAddressSaved, (state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : (_state$domainStates2$ = _state$domainStates2.middlewareLocalizedTexts) === null || _state$domainStates2$ === void 0 ? void 0 : _state$domainStates2$.MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_SUCCESS) ?? (defaultMiddlewareLocalizedTexts === null || defaultMiddlewareLocalizedTexts === void 0 ? void 0 : defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_SUCCESS));
|
|
59
60
|
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
60
61
|
Event: TelemetryEvent.EmailTranscriptSent,
|
|
61
62
|
Description: "Transcript sent to email successfully."
|
|
62
63
|
});
|
|
63
64
|
} catch (ex) {
|
|
65
|
+
var _state$domainStates3, _state$domainStates3$;
|
|
64
66
|
TelemetryHelper.logActionEvent(LogLevel.ERROR, {
|
|
65
67
|
Event: TelemetryEvent.EmailTranscriptFailed,
|
|
66
68
|
ExceptionDetails: {
|
|
67
69
|
exception: ex
|
|
68
70
|
}
|
|
69
71
|
});
|
|
70
|
-
const message = formatTemplateString(defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_ERROR, [email]);
|
|
72
|
+
const message = formatTemplateString((state === null || state === void 0 ? void 0 : (_state$domainStates3 = state.domainStates) === null || _state$domainStates3 === void 0 ? void 0 : (_state$domainStates3$ = _state$domainStates3.middlewareLocalizedTexts) === null || _state$domainStates3$ === void 0 ? void 0 : _state$domainStates3$.MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_ERROR) ?? defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_ERROR, [email]);
|
|
71
73
|
NotificationHandler.notifyError(NotificationScenarios.EmailTranscriptError, (props === null || props === void 0 ? void 0 : props.bannerMessageOnError) ?? message);
|
|
72
74
|
}
|
|
73
75
|
}, [props.attachmentMessage, props.bannerMessageOnError, facadeChatSDK, state.domainStates.liveChatContext]);
|
|
@@ -14,19 +14,21 @@ const isInternetConnected = async () => {
|
|
|
14
14
|
return false;
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
export const createInternetConnectionChangeHandler = async
|
|
17
|
+
export const createInternetConnectionChangeHandler = async state => {
|
|
18
18
|
const handler = async () => {
|
|
19
19
|
const connected = await isInternetConnected();
|
|
20
20
|
if (!connected) {
|
|
21
|
+
var _state$domainStates, _state$domainStates$m;
|
|
21
22
|
TelemetryHelper.logActionEvent(LogLevel.WARN, {
|
|
22
23
|
Event: TelemetryEvent.NetworkDisconnected
|
|
23
24
|
});
|
|
24
|
-
NotificationHandler.notifyError(NotificationScenarios.InternetConnection, defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_NO_INTERNET_CONNECTION);
|
|
25
|
+
NotificationHandler.notifyError(NotificationScenarios.InternetConnection, (state === null || state === void 0 ? void 0 : (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : (_state$domainStates$m = _state$domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m === void 0 ? void 0 : _state$domainStates$m.MIDDLEWARE_BANNER_NO_INTERNET_CONNECTION) ?? defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_NO_INTERNET_CONNECTION);
|
|
25
26
|
} else {
|
|
27
|
+
var _state$domainStates2, _state$domainStates2$;
|
|
26
28
|
TelemetryHelper.logActionEvent(LogLevel.WARN, {
|
|
27
29
|
Event: TelemetryEvent.NetworkReconnected
|
|
28
30
|
});
|
|
29
|
-
NotificationHandler.notifySuccess(NotificationScenarios.InternetConnection, defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_INTERNET_BACK_ONLINE);
|
|
31
|
+
NotificationHandler.notifySuccess(NotificationScenarios.InternetConnection, (state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : (_state$domainStates2$ = _state$domainStates2.middlewareLocalizedTexts) === null || _state$domainStates2$ === void 0 ? void 0 : _state$domainStates2$.MIDDLEWARE_BANNER_INTERNET_BACK_ONLINE) ?? defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_INTERNET_BACK_ONLINE);
|
|
30
32
|
BroadcastService.postMessage({
|
|
31
33
|
eventName: BroadcastEvent.NetworkReconnected
|
|
32
34
|
});
|
|
@@ -219,7 +219,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
219
219
|
state.domainStates.confirmationState = ConfirmationState.NotSet;
|
|
220
220
|
setupClientDataStore();
|
|
221
221
|
registerTelemetryLoggers(props, dispatch);
|
|
222
|
-
createInternetConnectionChangeHandler();
|
|
222
|
+
createInternetConnectionChangeHandler(state);
|
|
223
223
|
dispatch({
|
|
224
224
|
type: LiveChatWidgetActionType.SET_WIDGET_ELEMENT_ID,
|
|
225
225
|
payload: widgetElementId
|
|
@@ -808,7 +808,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
808
808
|
const chatWidgetDraggableConfig = {
|
|
809
809
|
elementId: widgetElementId,
|
|
810
810
|
channel: ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.widgetInstanceId) ?? "lcw",
|
|
811
|
-
disabled: ((_props$draggableChatW = props.draggableChatWidgetProps) === null || _props$draggableChatW === void 0 ? void 0 : _props$draggableChatW.disabled)
|
|
811
|
+
disabled: ((_props$draggableChatW = props.draggableChatWidgetProps) === null || _props$draggableChatW === void 0 ? void 0 : _props$draggableChatW.disabled) !== true // Draggable by default, unless explicitly disabled
|
|
812
812
|
};
|
|
813
813
|
|
|
814
814
|
// Disable receiving IDraggableEvent in current window
|
package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js
CHANGED
|
@@ -21,4 +21,5 @@ export let WebChatActionType;
|
|
|
21
21
|
WebChatActionType["WEB_CHAT_DISMISS_NOTIFICATION"] = "WEB_CHAT/DISMISS_NOTIFICATION";
|
|
22
22
|
WebChatActionType["WEB_CHAT_SET_SEND_BOX"] = "WEB_CHAT/SET_SEND_BOX";
|
|
23
23
|
WebChatActionType["WEB_CHAT_SEND_FILES"] = "WEB_CHAT/SEND_FILES";
|
|
24
|
+
WebChatActionType["WEB_CHAT_SET_SEND_BOX_ATTACHMENTS"] = "WEB_CHAT/SET_SEND_BOX_ATTACHMENTS";
|
|
24
25
|
})(WebChatActionType || (WebChatActionType = {}));
|
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
import { Constants, MimeTypes, WebChatMiddlewareConstants } from "../../../../../common/Constants";
|
|
9
9
|
import React from "react";
|
|
10
10
|
import { getFileAttachmentIconData, isInlineMediaSupported } from "../../../common/utils/FileAttachmentIconManager";
|
|
11
|
+
import Attachment from "./attachments/Attachment";
|
|
11
12
|
import { BroadcastEvent } from "../../../../../common/telemetry/TelemetryConstants";
|
|
12
13
|
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
14
|
+
import FileScanStatus from "./attachments/FileScanStatus";
|
|
15
|
+
import MaliciousAttachment from "./attachments/MaliciousAttachment";
|
|
16
|
+
import { NotificationHandler } from "../../notification/NotificationHandler";
|
|
17
|
+
import { NotificationScenarios } from "../../enums/NotificationScenarios";
|
|
18
|
+
import ScanInProgressAttachment from "./attachments/ScanInProgressAttachment";
|
|
13
19
|
import { WebChatActionType } from "../../enums/WebChatActionType";
|
|
14
20
|
import { defaultAttachmentAdaptiveCardStyles } from "./defaultStyles/defaultAtttachmentAdaptiveCardStyles";
|
|
15
21
|
import { defaultAttachmentProps } from "../../../common/defaultProps/defaultAttachmentProps";
|
|
16
|
-
import { useChatContextStore } from "../../../../..";
|
|
17
|
-
import { NotificationHandler } from "../../notification/NotificationHandler";
|
|
18
|
-
import { NotificationScenarios } from "../../enums/NotificationScenarios";
|
|
19
22
|
import { defaultMiddlewareLocalizedTexts } from "../../../common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
20
|
-
import
|
|
21
|
-
import ScanInProgressAttachment from "./attachments/ScanInProgressAttachment";
|
|
22
|
-
import MaliciousAttachment from "./attachments/MaliciousAttachment";
|
|
23
|
-
import FileScanStatus from "./attachments/FileScanStatus";
|
|
23
|
+
import { useChatContextStore } from "../../../../..";
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Patch card with different attachment data.
|
|
@@ -12,7 +12,7 @@ const createSendFileAction = files => {
|
|
|
12
12
|
payload: {
|
|
13
13
|
files
|
|
14
14
|
},
|
|
15
|
-
type: WebChatActionType.
|
|
15
|
+
type: WebChatActionType.WEB_CHAT_SEND_MESSAGE
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
|
|
@@ -22,9 +22,9 @@ const attachmentProcessingMiddleware = _ref => {
|
|
|
22
22
|
dispatch
|
|
23
23
|
} = _ref;
|
|
24
24
|
return next => async action => {
|
|
25
|
-
var _action$payload, _action$payload$
|
|
26
|
-
if ((action === null || action === void 0 ? void 0 : action.type) === WebChatActionType.
|
|
27
|
-
const files = action.payload.
|
|
25
|
+
var _action$payload, _action$payload$attac;
|
|
26
|
+
if ((action === null || action === void 0 ? void 0 : action.type) === WebChatActionType.WEB_CHAT_SEND_MESSAGE && (action === null || action === void 0 ? void 0 : (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : (_action$payload$attac = _action$payload.attachments) === null || _action$payload$attac === void 0 ? void 0 : _action$payload$attac.length) > 0) {
|
|
27
|
+
const files = action.payload.attachments;
|
|
28
28
|
if (files.length === 1) {
|
|
29
29
|
return next(action);
|
|
30
30
|
}
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
******/
|
|
6
6
|
|
|
7
7
|
import { LogLevel, TelemetryEvent } from "../../../../../common/telemetry/TelemetryConstants";
|
|
8
|
+
import { AMSConstants } from "../../../../../common/Constants";
|
|
8
9
|
import { NotificationHandler } from "../../notification/NotificationHandler";
|
|
9
10
|
import { NotificationScenarios } from "../../enums/NotificationScenarios";
|
|
10
|
-
import { WebChatActionType } from "../../enums/WebChatActionType";
|
|
11
11
|
import { TelemetryHelper } from "../../../../../common/telemetry/TelemetryHelper";
|
|
12
|
-
import {
|
|
12
|
+
import { WebChatActionType } from "../../enums/WebChatActionType";
|
|
13
13
|
const MBtoBRatio = 1000000;
|
|
14
14
|
|
|
15
15
|
/*
|
|
@@ -20,6 +20,9 @@ const validateAttachment = (action, allowedFileExtensions, maxFileSizeSupportedB
|
|
|
20
20
|
var _action$payload, _action$payload$activ, _action$payload2, _action$payload2$acti, _action$payload2$acti2, _action$payload3, _action$payload3$acti, _action$payload3$acti2;
|
|
21
21
|
const attachments = action === null || action === void 0 ? void 0 : (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : (_action$payload$activ = _action$payload.activity) === null || _action$payload$activ === void 0 ? void 0 : _action$payload$activ.attachments;
|
|
22
22
|
const attachmentSizes = action === null || action === void 0 ? void 0 : (_action$payload2 = action.payload) === null || _action$payload2 === void 0 ? void 0 : (_action$payload2$acti = _action$payload2.activity) === null || _action$payload2$acti === void 0 ? void 0 : (_action$payload2$acti2 = _action$payload2$acti.channelData) === null || _action$payload2$acti2 === void 0 ? void 0 : _action$payload2$acti2.attachmentSizes;
|
|
23
|
+
if (!attachments || attachments.length === 0) {
|
|
24
|
+
return action;
|
|
25
|
+
}
|
|
23
26
|
if (attachments) {
|
|
24
27
|
for (let i = 0; i < attachments.length; i++) {
|
|
25
28
|
const maxUploadFileSize = getMaxUploadFileSize(maxFileSizeSupportedByDynamics, attachments[i].contentType);
|
|
@@ -190,11 +193,11 @@ const createAttachmentUploadValidatorMiddleware = (allowedFileExtensions, maxFil
|
|
|
190
193
|
} = _ref;
|
|
191
194
|
return next => action => {
|
|
192
195
|
if (action.type === WebChatActionType.DIRECT_LINE_POST_ACTIVITY) {
|
|
193
|
-
var _payload$activity, _payload$
|
|
196
|
+
var _payload$activity, _payload$activity$att, _payload$activity2, _payload$activity2$ch, _payload$activity2$ch2;
|
|
194
197
|
const {
|
|
195
198
|
payload
|
|
196
199
|
} = action;
|
|
197
|
-
if (payload !== null && payload !== void 0 &&
|
|
200
|
+
if (payload !== null && payload !== void 0 && payload.activity.attachments && payload.activity.attachments.length > 0 && (payload === null || payload === void 0 ? void 0 : (_payload$activity = payload.activity) === null || _payload$activity === void 0 ? void 0 : (_payload$activity$att = _payload$activity.attachments) === null || _payload$activity$att === void 0 ? void 0 : _payload$activity$att.length) === (payload === null || payload === void 0 ? void 0 : (_payload$activity2 = payload.activity) === null || _payload$activity2 === void 0 ? void 0 : (_payload$activity2$ch = _payload$activity2.channelData) === null || _payload$activity2$ch === void 0 ? void 0 : (_payload$activity2$ch2 = _payload$activity2$ch.attachmentSizes) === null || _payload$activity2$ch2 === void 0 ? void 0 : _payload$activity2$ch2.length)) {
|
|
198
201
|
return next(validateAttachment(action, allowedFileExtensions, maxFileSizeSupportedByDynamics, localizedTexts));
|
|
199
202
|
}
|
|
200
203
|
}
|
|
@@ -31,7 +31,7 @@ export declare class TelemetryHelper {
|
|
|
31
31
|
static addWidgetDataToTelemetry(telemetryConfig: ITelemetryConfig, telemetryInternalData: IInternalTelemetryData): IInternalTelemetryData;
|
|
32
32
|
static addSessionDataToTelemetry(chatSession: LiveChatContext, telemetryInternalData: IInternalTelemetryData): IInternalTelemetryData;
|
|
33
33
|
static addConversationDataToTelemetry(liveWorkItem: LiveWorkItemDetails, telemetryInternalData: IInternalTelemetryData): IInternalTelemetryData;
|
|
34
|
-
static logCallingEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper, callId?: string
|
|
34
|
+
static logCallingEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper, callId?: string) => void;
|
|
35
35
|
static logLoadingEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
|
|
36
36
|
static logUIEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
|
|
37
37
|
static logActionEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
|
|
@@ -74,4 +74,4 @@ export interface ACSAdapterContract extends BaseContract {
|
|
|
74
74
|
Event?: string;
|
|
75
75
|
ErrorCode?: string;
|
|
76
76
|
}
|
|
77
|
-
export
|
|
77
|
+
export type TelemetryContract = OCChatSDKContract | IC3ClientContract | ActionsContract | LoadContract | WebChatContract | ConfigValidationContract | CallingContract | ACSAdapterContract | BaseContract | any;
|
|
@@ -102,4 +102,4 @@ export interface FacadeChatSDKTelemetryData extends BaseTelemetryData {
|
|
|
102
102
|
ExceptionDetails?: object;
|
|
103
103
|
Description?: string;
|
|
104
104
|
}
|
|
105
|
-
export
|
|
105
|
+
export type TelemetryData = ConfigValidationTelemetryData | OCChatSDKTelemetryData | IC3ClientTelemetryData | LoadTelemetryData | ActionTelemetryData | WebChatTelemetryData | CallingTelemetryData | MessageProcessingErrorData;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
|
|
2
2
|
import { IDownloadTranscriptProps } from "./interfaces/IDownloadTranscriptProps";
|
|
3
3
|
import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
|
|
4
|
-
export declare const downloadTranscript: (facadeChatSDK: FacadeChatSDK, downloadTranscriptProps: IDownloadTranscriptProps, state?: ILiveChatWidgetContext
|
|
4
|
+
export declare const downloadTranscript: (facadeChatSDK: FacadeChatSDK, downloadTranscriptProps: IDownloadTranscriptProps, state?: ILiveChatWidgetContext) => Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
|
|
2
2
|
import { OmnichannelChatSDK } from "@microsoft/omnichannel-chat-sdk";
|
|
3
3
|
declare const getAuthClientFunction: (chatConfig: ChatConfig | undefined) => string | undefined;
|
|
4
|
-
declare const handleAuthentication: (chatSDK: OmnichannelChatSDK, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string
|
|
4
|
+
declare const handleAuthentication: (chatSDK: OmnichannelChatSDK, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string) => Promise<string | null>) | undefined) => Promise<{
|
|
5
5
|
result: boolean;
|
|
6
6
|
token: string | null;
|
|
7
7
|
error?: undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
|
|
2
2
|
import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
3
|
-
export declare const createAdapter: (facadeChatSDK: FacadeChatSDK, props?: ILiveChatWidgetProps
|
|
3
|
+
export declare const createAdapter: (facadeChatSDK: FacadeChatSDK, props?: ILiveChatWidgetProps) => Promise<any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StyleOptions } from "botframework-webchat-api";
|
|
2
2
|
import { IDownloadTranscriptProps } from "../../footerstateful/downloadtranscriptstateful/interfaces/IDownloadTranscriptProps";
|
|
3
3
|
import { IWebChatContainerStatefulProps } from "../../webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps";
|
|
4
|
-
declare const createDownloadTranscriptProps: (downloadTranscriptProps: IDownloadTranscriptProps, webChatStyles: StyleOptions, webChatContainerProps?: IWebChatContainerStatefulProps
|
|
4
|
+
declare const createDownloadTranscriptProps: (downloadTranscriptProps: IDownloadTranscriptProps, webChatStyles: StyleOptions, webChatContainerProps?: IWebChatContainerStatefulProps) => {
|
|
5
5
|
webChatTranscript: {
|
|
6
6
|
disableNewLineMarkdownSupport: boolean | undefined;
|
|
7
7
|
disableMarkdownMessageFormatting: boolean | undefined;
|
package/lib/types/components/livechatwidget/common/createInternetConnectionChangeHandler.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
|
|
2
|
+
export declare const createInternetConnectionChangeHandler: (state: ILiveChatWidgetContext) => Promise<void>;
|
|
@@ -4,7 +4,7 @@ import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetA
|
|
|
4
4
|
import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
|
|
5
5
|
import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
6
6
|
declare const prepareEndChat: (props: ILiveChatWidgetProps, facadeChatSDK: FacadeChatSDK, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, setWebChatStyles: any, adapter: any) => Promise<void>;
|
|
7
|
-
declare const endChat: (props: ILiveChatWidgetProps, facadeChatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, setWebChatStyles: any, adapter: any, skipEndChatSDK?: boolean
|
|
7
|
+
declare const endChat: (props: ILiveChatWidgetProps, facadeChatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, setWebChatStyles: any, adapter: any, skipEndChatSDK?: boolean, skipCloseChat?: boolean, postMessageToOtherTab?: boolean) => Promise<void>;
|
|
8
8
|
export declare const callingStateCleanUp: (dispatch: Dispatch<ILiveChatWidgetAction>) => void;
|
|
9
9
|
export declare const endChatStateCleanUp: (dispatch: Dispatch<ILiveChatWidgetAction>) => void;
|
|
10
10
|
export declare const closeChatStateCleanUp: (dispatch: Dispatch<ILiveChatWidgetAction>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getMockChatSDKIfApplicable: (chatSDK: any, type?: string
|
|
1
|
+
export declare const getMockChatSDKIfApplicable: (chatSDK: any, type?: string) => any;
|
|
@@ -7,6 +7,6 @@ import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidget
|
|
|
7
7
|
import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
8
8
|
declare const handleChatReconnect: (facadeChatSDK: FacadeChatSDK, props: ILiveChatWidgetProps, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, initStartChat: any, state: ILiveChatWidgetContext) => Promise<boolean>;
|
|
9
9
|
declare const getChatReconnectContext: (facadeChatSDK: FacadeChatSDK, chatConfig: ChatConfig, props: any, isAuthenticatedChat: boolean, dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<import("@microsoft/omnichannel-chat-sdk/lib/core/ChatReconnectContext").default | undefined>;
|
|
10
|
-
declare const isReconnectEnabled: (chatConfig?: ChatConfig
|
|
11
|
-
declare const isPersistentEnabled: (chatConfig?: ChatConfig
|
|
10
|
+
declare const isReconnectEnabled: (chatConfig?: ChatConfig) => boolean;
|
|
11
|
+
declare const isPersistentEnabled: (chatConfig?: ChatConfig) => boolean;
|
|
12
12
|
export { handleChatReconnect, isReconnectEnabled, isPersistentEnabled, getChatReconnectContext };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Dispatch } from "react";
|
|
2
2
|
import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
|
|
3
3
|
import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
|
|
4
|
-
export declare const setPostChatContextAndLoadSurvey: (facadeChatSDK: FacadeChatSDK, dispatch: Dispatch<ILiveChatWidgetAction>, persistedChat?: boolean
|
|
4
|
+
export declare const setPostChatContextAndLoadSurvey: (facadeChatSDK: FacadeChatSDK, dispatch: Dispatch<ILiveChatWidgetAction>, persistedChat?: boolean) => Promise<void>;
|
|
@@ -5,7 +5,7 @@ import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidget
|
|
|
5
5
|
import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
6
6
|
import StartChatOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/StartChatOptionalParams";
|
|
7
7
|
declare const prepareStartChat: (props: ILiveChatWidgetProps, facadeChatSDK: FacadeChatSDK, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any) => Promise<void>;
|
|
8
|
-
declare const setPreChatAndInitiateChat: (facadeChatSDK: FacadeChatSDK, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, isProactiveChat?: boolean |
|
|
9
|
-
declare const initStartChat: (facadeChatSDK: FacadeChatSDK, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, state: ILiveChatWidgetContext | undefined, props?: ILiveChatWidgetProps
|
|
8
|
+
declare const setPreChatAndInitiateChat: (facadeChatSDK: FacadeChatSDK, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, isProactiveChat?: boolean | false, proactiveChatEnablePrechatState?: boolean | false, state?: ILiveChatWidgetContext, props?: ILiveChatWidgetProps) => Promise<void>;
|
|
9
|
+
declare const initStartChat: (facadeChatSDK: FacadeChatSDK, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, state: ILiveChatWidgetContext | undefined, props?: ILiveChatWidgetProps, params?: StartChatOptionalParams, persistedState?: any) => Promise<void>;
|
|
10
10
|
declare const checkIfConversationStillValid: (facadeChatSDK: FacadeChatSDK, dispatch: Dispatch<ILiveChatWidgetAction>, state: ILiveChatWidgetContext) => Promise<boolean>;
|
|
11
11
|
export { prepareStartChat, initStartChat, setPreChatAndInitiateChat, checkIfConversationStillValid };
|
|
@@ -3,4 +3,4 @@ import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
|
|
|
3
3
|
import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
|
|
4
4
|
import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
5
5
|
export declare const handleStartChatError: (dispatch: Dispatch<ILiveChatWidgetAction>, facadeChatSDK: FacadeChatSDK, props: ILiveChatWidgetProps | undefined, ex: any, isStartChatSuccessful: boolean) => void;
|
|
6
|
-
export declare const logWidgetLoadComplete: (additionalMessage?: string
|
|
6
|
+
export declare const logWidgetLoadComplete: (additionalMessage?: string) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Dispatch } from "react";
|
|
2
2
|
import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
|
|
3
3
|
import { IProactiveChatNotificationConfig } from "../../proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig";
|
|
4
|
-
export declare const startProactiveChat: (dispatch: Dispatch<ILiveChatWidgetAction>, notificationConfig?: IProactiveChatNotificationConfig
|
|
4
|
+
export declare const startProactiveChat: (dispatch: Dispatch<ILiveChatWidgetAction>, notificationConfig?: IProactiveChatNotificationConfig, enablePreChat?: boolean, inNewWindow?: boolean) => void;
|
package/lib/types/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.d.ts
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @param extension File extension
|
|
5
5
|
*/
|
|
6
|
-
export declare const getFileAttachmentIconData: (extension: string) =>
|
|
6
|
+
export declare const getFileAttachmentIconData: (extension: string) => {};
|
|
7
7
|
export declare const isInlineMediaSupported: (attachmentName: string) => boolean;
|
|
@@ -12,7 +12,7 @@ export interface IWebChatProps {
|
|
|
12
12
|
children?: ReactNode;
|
|
13
13
|
dir?: string;
|
|
14
14
|
disabled?: boolean;
|
|
15
|
-
downscaleImageToDataURL?: (blob: Blob, maxWidth: number, maxHeight: number, type: string, quality: number) =>
|
|
15
|
+
downscaleImageToDataURL?: (blob: Blob, maxWidth: number, maxHeight: number, type: string, quality: number) => Promise<URL>;
|
|
16
16
|
grammars?: any;
|
|
17
17
|
groupActivitiesMiddleware?: OneOrMany<GroupActivitiesMiddleware>;
|
|
18
18
|
internalErrorBoxClass?: React.Component | Function;
|
package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.d.ts
CHANGED
|
@@ -19,5 +19,6 @@ export declare enum WebChatActionType {
|
|
|
19
19
|
WEB_CHAT_SET_NOTIFICATION = "WEB_CHAT/SET_NOTIFICATION",
|
|
20
20
|
WEB_CHAT_DISMISS_NOTIFICATION = "WEB_CHAT/DISMISS_NOTIFICATION",
|
|
21
21
|
WEB_CHAT_SET_SEND_BOX = "WEB_CHAT/SET_SEND_BOX",
|
|
22
|
-
WEB_CHAT_SEND_FILES = "WEB_CHAT/SEND_FILES"
|
|
22
|
+
WEB_CHAT_SEND_FILES = "WEB_CHAT/SEND_FILES",
|
|
23
|
+
WEB_CHAT_SET_SEND_BOX_ATTACHMENTS = "WEB_CHAT/SET_SEND_BOX_ATTACHMENTS"
|
|
23
24
|
}
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* 3. Decodes certain html characters that came through from chat services
|
|
8
8
|
******/
|
|
9
9
|
import React from "react";
|
|
10
|
-
export declare const createActivityMiddleware: (renderMarkdown: (text: string) => string, systemMessageStyleProps?: React.CSSProperties
|
|
10
|
+
export declare const createActivityMiddleware: (renderMarkdown: (text: string) => string, systemMessageStyleProps?: React.CSSProperties, userMessageStyleProps?: React.CSSProperties) => () => (next: any) => (...args: any) => any;
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* 1. Renders the first two letters of the sender as the profile pic
|
|
6
6
|
******/
|
|
7
7
|
import React from "react";
|
|
8
|
-
export declare const createAvatarMiddleware: (avatarStyleProps?: React.CSSProperties
|
|
8
|
+
export declare const createAvatarMiddleware: (avatarStyleProps?: React.CSSProperties, avatarTextStyleProps?: React.CSSProperties) => () => (next: any) => (args_0: any) => false | (() => JSX.Element);
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Checks if the attachment being uploaded satisfies Omnichannel's requirement on file extensions and file size.
|
|
5
5
|
******/
|
|
6
|
-
import { IWebChatAction } from "../../../interfaces/IWebChatAction";
|
|
7
6
|
import { ILiveChatWidgetLocalizedTexts } from "../../../../../contexts/common/ILiveChatWidgetLocalizedTexts";
|
|
7
|
+
import { IWebChatAction } from "../../../interfaces/IWebChatAction";
|
|
8
8
|
declare const createAttachmentUploadValidatorMiddleware: (allowedFileExtensions: string, maxFileSizeSupportedByDynamics: string, localizedTexts: ILiveChatWidgetLocalizedTexts) => ({ dispatch }: {
|
|
9
9
|
dispatch: any;
|
|
10
10
|
}) => (next: any) => (action: IWebChatAction) => any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const useChatSDKStore: () =>
|
|
1
|
+
declare const useChatSDKStore: () => {};
|
|
2
2
|
export default useChatSDKStore;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/omnichannel-chat-widget",
|
|
3
|
-
"version": "1.7.6-main.
|
|
3
|
+
"version": "1.7.6-main.dca3f60",
|
|
4
4
|
"description": "Microsoft Omnichannel Chat Widget",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"types": "lib/types/index.d.ts",
|
|
@@ -60,26 +60,28 @@
|
|
|
60
60
|
"jest-dom": "^4.0.0",
|
|
61
61
|
"jest-image-snapshot": "^4.5.1",
|
|
62
62
|
"json": "^11.0.0",
|
|
63
|
-
"
|
|
63
|
+
"p-defer": "^4.0.1",
|
|
64
|
+
"playwright": "^1.20.0",
|
|
64
65
|
"postcss": "^8.3.9",
|
|
65
66
|
"react": "^17.0.2",
|
|
67
|
+
"react-docgen-typescript-plugin": "^1.0.8",
|
|
66
68
|
"react-dom": "^17.0.2",
|
|
67
69
|
"react-test-renderer": "^17.0.2",
|
|
68
70
|
"storybook-addon-playwright": "^4.9.2",
|
|
69
71
|
"swiper": "^9.0.5",
|
|
70
72
|
"terser-webpack-plugin": "^4.2.3",
|
|
71
73
|
"ts-loader": "^9.2.6",
|
|
72
|
-
"typescript": "4.
|
|
74
|
+
"typescript": "4.9.5",
|
|
73
75
|
"webpack": "^4.44.2",
|
|
74
76
|
"webpack-cli": "^4.9.2"
|
|
75
77
|
},
|
|
76
78
|
"dependencies": {
|
|
77
79
|
"@azure/core-tracing": "^1.2.0",
|
|
78
|
-
"@microsoft/omnichannel-chat-components": "1.1.
|
|
80
|
+
"@microsoft/omnichannel-chat-components": "1.1.8",
|
|
79
81
|
"@microsoft/omnichannel-chat-sdk": "^1.10.11",
|
|
80
82
|
"@opentelemetry/api": "^1.9.0",
|
|
81
83
|
"abort-controller-es5": "^2.0.1",
|
|
82
|
-
"dompurify": "^2.
|
|
84
|
+
"dompurify": "^3.2.4",
|
|
83
85
|
"markdown-it": "^12.3.2",
|
|
84
86
|
"markdown-it-attrs": "^4.1.6",
|
|
85
87
|
"markdown-it-attrs-es5": "^2.0.2",
|
|
@@ -99,7 +101,7 @@
|
|
|
99
101
|
"test:unit": "jest -c jest.config.unit.cjs --env=jsdom --runInBand --force-exit",
|
|
100
102
|
"test:e2e": "cd automation_tests && yarn test",
|
|
101
103
|
"test:e2e:build": "yarn build-sample && cd automation_tests && yarn test",
|
|
102
|
-
"test:visual": "jest -c jest.config.visual.cjs",
|
|
104
|
+
"test:visual": "jest -c jest.config.visual.cjs --verbose",
|
|
103
105
|
"test:all": "yarn test:unit && yarn test:visual",
|
|
104
106
|
"build:esm": "babel ./src --config-file ./babel.esm.config.json --out-dir lib/esm --extensions .ts,.js,.tsx --ignore **/*.test.ts,**/*.stories.tsx,**/*.test.tsx,**/*.spec.ts,**/*.spec.tsx",
|
|
105
107
|
"build:cjs": "babel ./src --config-file ./babel.config.json --out-dir lib/cjs --extensions .ts,.js,.tsx --ignore **/*.test.ts,**/*.stories.tsx,**/*.test.tsx,**/*.spec.ts,**/*.spec.tsx",
|
|
@@ -109,7 +111,8 @@
|
|
|
109
111
|
"build-sample": "yarn build && webpack --config ./webpack.config.cjs",
|
|
110
112
|
"build-sample:dev": "yarn build && webpack --config ./webpack.dev.config.cjs",
|
|
111
113
|
"test:visual:build": "yarn build-storybook && yarn test:visual",
|
|
112
|
-
"lint": "yarn eslint . --max-warnings=0"
|
|
114
|
+
"lint": "yarn eslint . --max-warnings=0",
|
|
115
|
+
"pretest:visual": "yarn playwright install"
|
|
113
116
|
},
|
|
114
117
|
"resolutions": {
|
|
115
118
|
"**/url-parse": "1.5.9",
|
|
@@ -117,5 +120,11 @@
|
|
|
117
120
|
"**/abort-controller-es5": "^2.0.1",
|
|
118
121
|
"**/minimist": "1.2.6",
|
|
119
122
|
"**/sanitize-html": "2.12.1"
|
|
123
|
+
},
|
|
124
|
+
"jest": {
|
|
125
|
+
"verbose": true,
|
|
126
|
+
"reporters": [
|
|
127
|
+
"default"
|
|
128
|
+
]
|
|
120
129
|
}
|
|
121
130
|
}
|