@microsoft/omnichannel-chat-widget 1.7.5 → 1.7.6-main.aac589b
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/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +1 -1
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +6 -0
- 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/cjs/plugins/createChatTranscript.js +15 -6
- package/lib/esm/common/telemetry/TelemetryConstants.js +1 -0
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +1 -1
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +6 -0
- 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/esm/plugins/createChatTranscript.js +15 -6
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +1 -0
- 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/footerstateful/downloadtranscriptstateful/interfaces/IWebChatTranscriptConfig.d.ts +1 -0
- 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 +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 +17 -8
|
@@ -141,6 +141,7 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
141
141
|
TelemetryEvent["ConfirmationCancelButtonClicked"] = "ConfirmationCancelButtonClicked";
|
|
142
142
|
TelemetryEvent["ConfirmationConfirmButtonClicked"] = "ConfirmationConfirmButtonClicked";
|
|
143
143
|
TelemetryEvent["LoadingPaneLoaded"] = "LoadingPaneLoaded";
|
|
144
|
+
TelemetryEvent["LoadingPaneUnloaded"] = "LoadingPaneUnloaded";
|
|
144
145
|
TelemetryEvent["StartChatErrorPaneLoaded"] = "StartChatErrorPaneLoaded";
|
|
145
146
|
TelemetryEvent["EmailTranscriptLoaded"] = "EmailTranscriptLoaded";
|
|
146
147
|
TelemetryEvent["OutOfOfficePaneLoaded"] = "OutOfOfficePaneLoaded";
|
|
@@ -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
|
|
@@ -73,6 +73,12 @@ const LoadingPaneStateful = props => {
|
|
|
73
73
|
Event: _TelemetryConstants.TelemetryEvent.UXLoadingPaneCompleted,
|
|
74
74
|
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
75
75
|
});
|
|
76
|
+
return () => {
|
|
77
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
78
|
+
Event: _TelemetryConstants.TelemetryEvent.LoadingPaneUnloaded,
|
|
79
|
+
Description: "Loading pane unmount."
|
|
80
|
+
});
|
|
81
|
+
};
|
|
76
82
|
}, []);
|
|
77
83
|
return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.LoadingPane, {
|
|
78
84
|
componentOverrides: loadingPaneProps === null || loadingPaneProps === void 0 ? void 0 : loadingPaneProps.componentOverrides,
|
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
|
}
|
|
@@ -14,7 +14,7 @@ class TranscriptHTMLBuilder {
|
|
|
14
14
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
15
15
|
|
|
16
16
|
constructor(options) {
|
|
17
|
-
var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options8, _this$options9, _this$options10, _this$options11, _this$options12;
|
|
17
|
+
var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options8, _this$options9, _this$options10, _this$options11, _this$options12, _this$options13;
|
|
18
18
|
_defineProperty(this, "options", void 0);
|
|
19
19
|
_defineProperty(this, "pageTitle", "Customer Transcript");
|
|
20
20
|
_defineProperty(this, "attachmentMessage", "The following attachment was uploaded during the conversation: ");
|
|
@@ -25,6 +25,7 @@ class TranscriptHTMLBuilder {
|
|
|
25
25
|
_defineProperty(this, "agentAvatarFontColor", "#000");
|
|
26
26
|
_defineProperty(this, "customerAvatarBackgroundColor", "#2266E3");
|
|
27
27
|
_defineProperty(this, "customerAvatarFontColor", "#FFF");
|
|
28
|
+
_defineProperty(this, "customerDisplayName", "");
|
|
28
29
|
_defineProperty(this, "disableMarkdownMessageFormatting", false);
|
|
29
30
|
_defineProperty(this, "disableNewLineMarkdownSupport", false);
|
|
30
31
|
_defineProperty(this, "externalScripts", {});
|
|
@@ -60,13 +61,16 @@ class TranscriptHTMLBuilder {
|
|
|
60
61
|
if ((_this$options9 = this.options) !== null && _this$options9 !== void 0 && _this$options9.customerAvatarFontColor) {
|
|
61
62
|
this.customerAvatarFontColor = this.options.customerAvatarFontColor;
|
|
62
63
|
}
|
|
63
|
-
if ((_this$options10 = this.options) !== null && _this$options10 !== void 0 && _this$options10.
|
|
64
|
+
if ((_this$options10 = this.options) !== null && _this$options10 !== void 0 && _this$options10.customerDisplayName) {
|
|
65
|
+
this.customerDisplayName = this.options.customerDisplayName;
|
|
66
|
+
}
|
|
67
|
+
if ((_this$options11 = this.options) !== null && _this$options11 !== void 0 && _this$options11.disableMarkdownMessageFormatting) {
|
|
64
68
|
this.disableMarkdownMessageFormatting = this.options.disableMarkdownMessageFormatting;
|
|
65
69
|
}
|
|
66
|
-
if ((_this$
|
|
70
|
+
if ((_this$options12 = this.options) !== null && _this$options12 !== void 0 && _this$options12.disableNewLineMarkdownSupport) {
|
|
67
71
|
this.disableNewLineMarkdownSupport = this.options.disableNewLineMarkdownSupport;
|
|
68
72
|
}
|
|
69
|
-
if ((_this$
|
|
73
|
+
if ((_this$options13 = this.options) !== null && _this$options13 !== void 0 && _this$options13.externalScripts) {
|
|
70
74
|
this.externalScripts = this.options.externalScripts;
|
|
71
75
|
}
|
|
72
76
|
}
|
|
@@ -528,7 +532,12 @@ class TranscriptHTMLBuilder {
|
|
|
528
532
|
const avatarMiddleware = () => (next) => (...args) => {
|
|
529
533
|
const [card] = args;
|
|
530
534
|
const {fromUser, activity} = card;
|
|
531
|
-
|
|
535
|
+
let displayName = getIconText(activity.from.name);
|
|
536
|
+
let customerDisplayName = '${this.customerDisplayName}';
|
|
537
|
+
|
|
538
|
+
if (fromUser && customerDisplayName) {
|
|
539
|
+
displayName = customerDisplayName;
|
|
540
|
+
}
|
|
532
541
|
|
|
533
542
|
const avatarElement = React.createElement(
|
|
534
543
|
"div",
|
|
@@ -536,7 +545,7 @@ class TranscriptHTMLBuilder {
|
|
|
536
545
|
React.createElement(
|
|
537
546
|
"p",
|
|
538
547
|
null,
|
|
539
|
-
\`\${
|
|
548
|
+
\`\${displayName}\`
|
|
540
549
|
)
|
|
541
550
|
);
|
|
542
551
|
|
|
@@ -135,6 +135,7 @@ export let TelemetryEvent;
|
|
|
135
135
|
TelemetryEvent["ConfirmationCancelButtonClicked"] = "ConfirmationCancelButtonClicked";
|
|
136
136
|
TelemetryEvent["ConfirmationConfirmButtonClicked"] = "ConfirmationConfirmButtonClicked";
|
|
137
137
|
TelemetryEvent["LoadingPaneLoaded"] = "LoadingPaneLoaded";
|
|
138
|
+
TelemetryEvent["LoadingPaneUnloaded"] = "LoadingPaneUnloaded";
|
|
138
139
|
TelemetryEvent["StartChatErrorPaneLoaded"] = "StartChatErrorPaneLoaded";
|
|
139
140
|
TelemetryEvent["EmailTranscriptLoaded"] = "EmailTranscriptLoaded";
|
|
140
141
|
TelemetryEvent["OutOfOfficePaneLoaded"] = "OutOfOfficePaneLoaded";
|
|
@@ -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
|
|
@@ -64,6 +64,12 @@ export const LoadingPaneStateful = props => {
|
|
|
64
64
|
Event: TelemetryEvent.UXLoadingPaneCompleted,
|
|
65
65
|
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
66
66
|
});
|
|
67
|
+
return () => {
|
|
68
|
+
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
69
|
+
Event: TelemetryEvent.LoadingPaneUnloaded,
|
|
70
|
+
Description: "Loading pane unmount."
|
|
71
|
+
});
|
|
72
|
+
};
|
|
67
73
|
}, []);
|
|
68
74
|
return /*#__PURE__*/React.createElement(LoadingPane, {
|
|
69
75
|
componentOverrides: loadingPaneProps === null || loadingPaneProps === void 0 ? void 0 : loadingPaneProps.componentOverrides,
|
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
|
}
|
|
@@ -9,7 +9,7 @@ class TranscriptHTMLBuilder {
|
|
|
9
9
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
10
10
|
|
|
11
11
|
constructor(options) {
|
|
12
|
-
var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options8, _this$options9, _this$options10, _this$options11, _this$options12;
|
|
12
|
+
var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options8, _this$options9, _this$options10, _this$options11, _this$options12, _this$options13;
|
|
13
13
|
_defineProperty(this, "options", void 0);
|
|
14
14
|
_defineProperty(this, "pageTitle", "Customer Transcript");
|
|
15
15
|
_defineProperty(this, "attachmentMessage", "The following attachment was uploaded during the conversation: ");
|
|
@@ -20,6 +20,7 @@ class TranscriptHTMLBuilder {
|
|
|
20
20
|
_defineProperty(this, "agentAvatarFontColor", "#000");
|
|
21
21
|
_defineProperty(this, "customerAvatarBackgroundColor", "#2266E3");
|
|
22
22
|
_defineProperty(this, "customerAvatarFontColor", "#FFF");
|
|
23
|
+
_defineProperty(this, "customerDisplayName", "");
|
|
23
24
|
_defineProperty(this, "disableMarkdownMessageFormatting", false);
|
|
24
25
|
_defineProperty(this, "disableNewLineMarkdownSupport", false);
|
|
25
26
|
_defineProperty(this, "externalScripts", {});
|
|
@@ -55,13 +56,16 @@ class TranscriptHTMLBuilder {
|
|
|
55
56
|
if ((_this$options9 = this.options) !== null && _this$options9 !== void 0 && _this$options9.customerAvatarFontColor) {
|
|
56
57
|
this.customerAvatarFontColor = this.options.customerAvatarFontColor;
|
|
57
58
|
}
|
|
58
|
-
if ((_this$options10 = this.options) !== null && _this$options10 !== void 0 && _this$options10.
|
|
59
|
+
if ((_this$options10 = this.options) !== null && _this$options10 !== void 0 && _this$options10.customerDisplayName) {
|
|
60
|
+
this.customerDisplayName = this.options.customerDisplayName;
|
|
61
|
+
}
|
|
62
|
+
if ((_this$options11 = this.options) !== null && _this$options11 !== void 0 && _this$options11.disableMarkdownMessageFormatting) {
|
|
59
63
|
this.disableMarkdownMessageFormatting = this.options.disableMarkdownMessageFormatting;
|
|
60
64
|
}
|
|
61
|
-
if ((_this$
|
|
65
|
+
if ((_this$options12 = this.options) !== null && _this$options12 !== void 0 && _this$options12.disableNewLineMarkdownSupport) {
|
|
62
66
|
this.disableNewLineMarkdownSupport = this.options.disableNewLineMarkdownSupport;
|
|
63
67
|
}
|
|
64
|
-
if ((_this$
|
|
68
|
+
if ((_this$options13 = this.options) !== null && _this$options13 !== void 0 && _this$options13.externalScripts) {
|
|
65
69
|
this.externalScripts = this.options.externalScripts;
|
|
66
70
|
}
|
|
67
71
|
}
|
|
@@ -523,7 +527,12 @@ class TranscriptHTMLBuilder {
|
|
|
523
527
|
const avatarMiddleware = () => (next) => (...args) => {
|
|
524
528
|
const [card] = args;
|
|
525
529
|
const {fromUser, activity} = card;
|
|
526
|
-
|
|
530
|
+
let displayName = getIconText(activity.from.name);
|
|
531
|
+
let customerDisplayName = '${this.customerDisplayName}';
|
|
532
|
+
|
|
533
|
+
if (fromUser && customerDisplayName) {
|
|
534
|
+
displayName = customerDisplayName;
|
|
535
|
+
}
|
|
527
536
|
|
|
528
537
|
const avatarElement = React.createElement(
|
|
529
538
|
"div",
|
|
@@ -531,7 +540,7 @@ class TranscriptHTMLBuilder {
|
|
|
531
540
|
React.createElement(
|
|
532
541
|
"p",
|
|
533
542
|
null,
|
|
534
|
-
\`\${
|
|
543
|
+
\`\${displayName}\`
|
|
535
544
|
)
|
|
536
545
|
);
|
|
537
546
|
|
|
@@ -128,6 +128,7 @@ export declare enum TelemetryEvent {
|
|
|
128
128
|
ConfirmationCancelButtonClicked = "ConfirmationCancelButtonClicked",
|
|
129
129
|
ConfirmationConfirmButtonClicked = "ConfirmationConfirmButtonClicked",
|
|
130
130
|
LoadingPaneLoaded = "LoadingPaneLoaded",
|
|
131
|
+
LoadingPaneUnloaded = "LoadingPaneUnloaded",
|
|
131
132
|
StartChatErrorPaneLoaded = "StartChatErrorPaneLoaded",
|
|
132
133
|
EmailTranscriptLoaded = "EmailTranscriptLoaded",
|
|
133
134
|
OutOfOfficePaneLoaded = "OutOfOfficePaneLoaded",
|
|
@@ -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;
|
|
@@ -16,6 +16,7 @@ declare const createDownloadTranscriptProps: (downloadTranscriptProps: IDownload
|
|
|
16
16
|
attachmentMessage?: string | undefined;
|
|
17
17
|
networkOnlineMessage?: string | undefined;
|
|
18
18
|
networkOfflineMessage?: string | undefined;
|
|
19
|
+
customerDisplayName?: string | undefined;
|
|
19
20
|
};
|
|
20
21
|
attachmentMessage?: string | undefined;
|
|
21
22
|
bannerMessageOnError?: string | undefined;
|
|
@@ -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.
|
|
3
|
+
"version": "1.7.6-main.aac589b",
|
|
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.
|
|
79
|
-
"@microsoft/omnichannel-chat-sdk": "^1.10.
|
|
80
|
+
"@microsoft/omnichannel-chat-components": "1.1.8",
|
|
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
|
+
"postinstall": "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
|
}
|