@microsoft/omnichannel-chat-widget 1.7.5-main.290ba08 → 1.7.6-main.410976b
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/facades/FacadeChatSDK.js +14 -2
- package/lib/cjs/common/telemetry/TelemetryConstants.js +32 -0
- package/lib/cjs/common/telemetry/TelemetryHelper.js +10 -0
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +15 -1
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +14 -2
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +16 -2
- package/lib/cjs/components/footerstateful/FooterStateful.js +15 -0
- package/lib/cjs/components/headerstateful/HeaderStateful.js +16 -2
- package/lib/cjs/components/livechatwidget/LiveChatWidget.js +3 -2
- package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +5 -3
- package/lib/cjs/components/livechatwidget/interfaces/IFeatureConfigProps.js +1 -0
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +39 -4
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +20 -2
- package/lib/cjs/components/notificationpanestateful/NotificationPaneStateful.js +21 -7
- package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +12 -1
- package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +14 -3
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +13 -0
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +12 -0
- package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +12 -1
- package/lib/cjs/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +19 -8
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +14 -1
- 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/facades/FacadeChatSDK.js +14 -2
- package/lib/esm/common/telemetry/TelemetryConstants.js +32 -0
- package/lib/esm/common/telemetry/TelemetryHelper.js +10 -0
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +15 -1
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +14 -3
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +17 -3
- package/lib/esm/components/footerstateful/FooterStateful.js +14 -0
- package/lib/esm/components/headerstateful/HeaderStateful.js +16 -2
- package/lib/esm/components/livechatwidget/LiveChatWidget.js +3 -2
- package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +5 -3
- package/lib/esm/components/livechatwidget/interfaces/IFeatureConfigProps.js +1 -0
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +39 -4
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +19 -2
- package/lib/esm/components/notificationpanestateful/NotificationPaneStateful.js +21 -7
- package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +12 -1
- package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +14 -3
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +13 -1
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +11 -0
- package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +12 -1
- package/lib/esm/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +19 -8
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +14 -1
- 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/facades/FacadeChatSDK.d.ts +3 -2
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +33 -1
- package/lib/types/common/telemetry/TelemetryHelper.d.ts +2 -1
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +1 -1
- package/lib/types/common/telemetry/definitions/Payload.d.ts +14 -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/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/livechatwidget/interfaces/IFeatureConfigProps.d.ts +3 -0
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +9 -7
- 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
|
@@ -6,16 +6,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = exports.OutOfOfficeHoursPaneStateful = void 0;
|
|
7
7
|
var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _utils = require("../../common/utils");
|
|
9
10
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
10
11
|
var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
11
12
|
var _defaultgeneralOOOHPaneStyleProps = require("./common/defaultStyleProps/defaultgeneralOOOHPaneStyleProps");
|
|
12
|
-
var _utils = require("../../common/utils");
|
|
13
13
|
var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
let uiTimer;
|
|
17
18
|
const OutOfOfficeHoursPaneStateful = props => {
|
|
18
19
|
var _props$styleProps;
|
|
20
|
+
(0, _react.useEffect)(() => {
|
|
21
|
+
uiTimer = (0, _utils.createTimer)();
|
|
22
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
23
|
+
Event: _TelemetryConstants.TelemetryEvent.UXOOHPaneStart
|
|
24
|
+
});
|
|
25
|
+
}, []);
|
|
19
26
|
const [state] = (0, _useChatContextStore.default)();
|
|
20
27
|
const generalStyleProps = Object.assign({}, _defaultgeneralOOOHPaneStyleProps.defaultGeneralStyleProps, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps);
|
|
21
28
|
const styleProps = {
|
|
@@ -37,6 +44,10 @@ const OutOfOfficeHoursPaneStateful = props => {
|
|
|
37
44
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
38
45
|
Event: _TelemetryConstants.TelemetryEvent.OutOfOfficePaneLoaded
|
|
39
46
|
});
|
|
47
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
48
|
+
Event: _TelemetryConstants.TelemetryEvent.UXOOHPaneCompleted,
|
|
49
|
+
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
50
|
+
});
|
|
40
51
|
}, []);
|
|
41
52
|
return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.OutOfOfficeHoursPane, {
|
|
42
53
|
componentOverrides: props.componentOverrides,
|
|
@@ -4,18 +4,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.PostChatLoadingPaneStateful = void 0;
|
|
7
|
+
var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
|
|
7
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _utils = require("../../common/utils");
|
|
8
10
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
11
|
+
var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
9
12
|
var _defaultgeneralPostChatLoadingPaneStyleProps = require("./common/defaultgeneralPostChatLoadingPaneStyleProps");
|
|
10
|
-
var _utils = require("../../common/utils");
|
|
11
13
|
var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
|
|
12
|
-
var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
13
|
-
var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
let uiTimer;
|
|
17
18
|
const PostChatLoadingPaneStateful = props => {
|
|
18
19
|
var _props$styleProps;
|
|
20
|
+
(0, _react.useEffect)(() => {
|
|
21
|
+
uiTimer = (0, _utils.createTimer)();
|
|
22
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
23
|
+
Event: _TelemetryConstants.TelemetryEvent.UXPostChatLoadingPaneStart
|
|
24
|
+
});
|
|
25
|
+
}, []);
|
|
19
26
|
const [state] = (0, _useChatContextStore.default)();
|
|
20
27
|
const generalStyleProps = Object.assign({}, _defaultgeneralPostChatLoadingPaneStyleProps.defaultGeneralPostChatLoadingPaneStyleProps, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps);
|
|
21
28
|
const styleProps = {
|
|
@@ -42,6 +49,10 @@ const PostChatLoadingPaneStateful = props => {
|
|
|
42
49
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
43
50
|
Event: _TelemetryConstants.TelemetryEvent.PostChatSurveyLoadingPaneLoaded
|
|
44
51
|
});
|
|
52
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
53
|
+
Event: _TelemetryConstants.TelemetryEvent.UXPostChatLoadingPaneCompleted,
|
|
54
|
+
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
55
|
+
});
|
|
45
56
|
}, []);
|
|
46
57
|
return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.LoadingPane, {
|
|
47
58
|
componentOverrides: props.componentOverrides,
|
|
@@ -19,9 +19,18 @@ var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatCo
|
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
+
let uiTimer;
|
|
23
|
+
|
|
22
24
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
25
|
const PreChatSurveyPaneStateful = props => {
|
|
24
26
|
var _surveyProps$stylePro, _props$surveyProps, _props$surveyProps$co;
|
|
27
|
+
(0, _react.useEffect)(() => {
|
|
28
|
+
uiTimer = (0, _utils.createTimer)();
|
|
29
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
30
|
+
Event: _TelemetryConstants.TelemetryEvent.UXPrechatPaneStart
|
|
31
|
+
});
|
|
32
|
+
}, []);
|
|
33
|
+
|
|
25
34
|
// Set MarkDown global variable to be used for prechat adaptive cards
|
|
26
35
|
window["markdownit"] = _markdownIt.default;
|
|
27
36
|
const [state, dispatch] = (0, _useChatContextStore.default)();
|
|
@@ -144,6 +153,10 @@ const PreChatSurveyPaneStateful = props => {
|
|
|
144
153
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
145
154
|
Event: _TelemetryConstants.TelemetryEvent.PrechatSurveyLoaded
|
|
146
155
|
});
|
|
156
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
157
|
+
Event: _TelemetryConstants.TelemetryEvent.UXPrechatPaneCompleted,
|
|
158
|
+
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
159
|
+
});
|
|
147
160
|
}, []);
|
|
148
161
|
return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.PreChatSurveyPane, {
|
|
149
162
|
controlProps: controlProps,
|
|
@@ -17,9 +17,17 @@ var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatCo
|
|
|
17
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
19
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
|
+
let uiTimer;
|
|
21
|
+
|
|
20
22
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
23
|
const ProactiveChatPaneStateful = props => {
|
|
22
24
|
var _proactiveChatProps$c;
|
|
25
|
+
(0, _react.useEffect)(() => {
|
|
26
|
+
uiTimer = (0, _utils.createTimer)();
|
|
27
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
28
|
+
Event: _TelemetryConstants.TelemetryEvent.UXProactiveChatPaneStart
|
|
29
|
+
});
|
|
30
|
+
}, []);
|
|
23
31
|
const [state, dispatch] = (0, _useChatContextStore.default)();
|
|
24
32
|
const {
|
|
25
33
|
proactiveChatProps,
|
|
@@ -121,6 +129,10 @@ const ProactiveChatPaneStateful = props => {
|
|
|
121
129
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
122
130
|
Event: _TelemetryConstants.TelemetryEvent.ProactiveChatPaneLoaded
|
|
123
131
|
});
|
|
132
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
133
|
+
Event: _TelemetryConstants.TelemetryEvent.UXProactiveChatCompleted,
|
|
134
|
+
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
135
|
+
});
|
|
124
136
|
return () => {
|
|
125
137
|
clearTimeout(timeoutEvent);
|
|
126
138
|
};
|
|
@@ -6,17 +6,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = exports.ReconnectChatPaneStateful = void 0;
|
|
7
7
|
var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _utils = require("../../common/utils");
|
|
9
10
|
var _ConversationState = require("../../contexts/common/ConversationState");
|
|
10
11
|
var _LiveChatWidgetActionType = require("../../contexts/common/LiveChatWidgetActionType");
|
|
11
12
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
12
13
|
var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
13
|
-
var _utils = require("../../common/utils");
|
|
14
14
|
var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
|
|
15
15
|
var _useFacadeChatSDKStore = _interopRequireDefault(require("../../hooks/useFacadeChatSDKStore"));
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
+
let uiTimer;
|
|
19
20
|
const ReconnectChatPaneStateful = props => {
|
|
21
|
+
(0, _react.useEffect)(() => {
|
|
22
|
+
uiTimer = (0, _utils.createTimer)();
|
|
23
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
24
|
+
Event: _TelemetryConstants.TelemetryEvent.UXReconnectChatPaneStart,
|
|
25
|
+
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
26
|
+
});
|
|
27
|
+
}, []);
|
|
20
28
|
const [state, dispatch] = (0, _useChatContextStore.default)();
|
|
21
29
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
30
|
//const chatSDK: any = useChatSDKStore();
|
|
@@ -100,6 +108,9 @@ const ReconnectChatPaneStateful = props => {
|
|
|
100
108
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
101
109
|
Event: _TelemetryConstants.TelemetryEvent.ReconnectChatPaneLoaded
|
|
102
110
|
});
|
|
111
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
112
|
+
Event: _TelemetryConstants.TelemetryEvent.UXReconnectChatCompleted
|
|
113
|
+
});
|
|
103
114
|
}, []);
|
|
104
115
|
return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.ReconnectChatPane, {
|
|
105
116
|
componentOverrides: reconnectChatProps === null || reconnectChatProps === void 0 ? void 0 : reconnectChatProps.componentOverrides,
|
|
@@ -4,24 +4,31 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.StartChatErrorPaneStateful = void 0;
|
|
7
|
+
var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
|
|
7
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
9
9
|
var _utils = require("../../common/utils");
|
|
10
|
-
var
|
|
10
|
+
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
11
|
+
var _Constants = require("../../common/Constants");
|
|
12
|
+
var _StartChatFailureType = require("../../contexts/common/StartChatFailureType");
|
|
11
13
|
var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
12
|
-
var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
|
|
13
14
|
var _defaultStartChatErrorPaneGeneralStyleProps = require("./common/defaultStartChatErrorPaneGeneralStyleProps");
|
|
14
|
-
var _defaultStartChatErrorPaneTitleStyleProps = require("./common/defaultStartChatErrorPaneTitleStyleProps");
|
|
15
|
-
var _defaultStartChatErrorPaneSubtitleStyleProps = require("./common/defaultStartChatErrorPaneSubtitleStyleProps");
|
|
16
|
-
var _defaultStartChatErrorPaneIconStyleProps = require("./common/defaultStartChatErrorPaneIconStyleProps");
|
|
17
15
|
var _defaultStartChatErrorPaneIconImageProps = require("./common/defaultStartChatErrorPaneIconImageProps");
|
|
18
|
-
var
|
|
19
|
-
var
|
|
16
|
+
var _defaultStartChatErrorPaneIconStyleProps = require("./common/defaultStartChatErrorPaneIconStyleProps");
|
|
17
|
+
var _defaultStartChatErrorPaneSubtitleStyleProps = require("./common/defaultStartChatErrorPaneSubtitleStyleProps");
|
|
18
|
+
var _defaultStartChatErrorPaneTitleStyleProps = require("./common/defaultStartChatErrorPaneTitleStyleProps");
|
|
19
|
+
var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
let uiTimer;
|
|
23
24
|
const StartChatErrorPaneStateful = startChatErrorPaneProps => {
|
|
24
25
|
var _startChatErrorPanePr, _startChatErrorPanePr2, _startChatErrorPanePr3, _startChatErrorPanePr4, _startChatErrorPanePr5, _startChatErrorPanePr6, _startChatErrorPanePr7, _startChatErrorPanePr8, _startChatErrorPanePr9, _startChatErrorPanePr10, _startChatErrorPanePr11;
|
|
26
|
+
(0, _react.useEffect)(() => {
|
|
27
|
+
uiTimer = (0, _utils.createTimer)();
|
|
28
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
29
|
+
Event: _TelemetryConstants.TelemetryEvent.UXStartChatErrorPaneStart
|
|
30
|
+
});
|
|
31
|
+
}, []);
|
|
25
32
|
const [state] = (0, _useChatContextStore.default)();
|
|
26
33
|
const generalStyleProps = Object.assign({}, _defaultStartChatErrorPaneGeneralStyleProps.defaultStartChatErrorPaneGeneralStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr === void 0 ? void 0 : _startChatErrorPanePr.generalStyleProps);
|
|
27
34
|
const titleStyleProps = Object.assign({}, _defaultStartChatErrorPaneTitleStyleProps.defaultStartChatErrorPaneTitleStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr2 = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr2 === void 0 ? void 0 : _startChatErrorPanePr2.titleStyleProps);
|
|
@@ -70,6 +77,10 @@ const StartChatErrorPaneStateful = startChatErrorPaneProps => {
|
|
|
70
77
|
Event: _TelemetryConstants.TelemetryEvent.StartChatErrorPaneLoaded,
|
|
71
78
|
Description: "Start chat error pane loaded."
|
|
72
79
|
});
|
|
80
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
81
|
+
Event: _TelemetryConstants.TelemetryEvent.UXStartChatErrorCompleted,
|
|
82
|
+
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
83
|
+
});
|
|
73
84
|
}, []);
|
|
74
85
|
return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.LoadingPane, {
|
|
75
86
|
componentOverrides: startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : startChatErrorPaneProps.componentOverrides,
|
|
@@ -7,6 +7,7 @@ exports.default = exports.WebChatContainerStateful = void 0;
|
|
|
7
7
|
var _react = require("@fluentui/react");
|
|
8
8
|
var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
|
|
9
9
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _utils = require("../../common/utils");
|
|
10
11
|
var _BotMagicCodeStore = require("./webchatcontroller/BotMagicCodeStore");
|
|
11
12
|
var _botframeworkWebchat = require("botframework-webchat");
|
|
12
13
|
var _Constants = require("../../common/Constants");
|
|
@@ -23,12 +24,12 @@ var _defaultSentMessageAnchorStyles = require("./webchatcontroller/middlewares/r
|
|
|
23
24
|
var _defaultSystemMessageBoxStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles");
|
|
24
25
|
var _defaultUserMessageBoxStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles");
|
|
25
26
|
var _defaultWebChatContainerStatefulProps = require("./common/defaultProps/defaultWebChatContainerStatefulProps");
|
|
26
|
-
var _utils = require("../../common/utils");
|
|
27
27
|
var _ = require("../..");
|
|
28
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
29
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
30
30
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
31
31
|
|
|
32
|
+
let uiTimer;
|
|
32
33
|
const broadcastChannelMessageEvent = "message";
|
|
33
34
|
const postActivity = activity => {
|
|
34
35
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
@@ -56,6 +57,12 @@ const createMagicCodeSuccessResponse = signin => {
|
|
|
56
57
|
};
|
|
57
58
|
const WebChatContainerStateful = props => {
|
|
58
59
|
var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _props$webChatContain5, _props$webChatContain6, _defaultWebChatContai, _props$webChatContain7, _props$webChatContain8, _defaultWebChatContai2, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15, _props$webChatContain9, _props$webChatContain10;
|
|
60
|
+
(0, _react2.useEffect)(() => {
|
|
61
|
+
uiTimer = (0, _utils.createTimer)();
|
|
62
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
63
|
+
Event: _TelemetryConstants.TelemetryEvent.UXWebchatContainerCompleted
|
|
64
|
+
});
|
|
65
|
+
}, []);
|
|
59
66
|
const {
|
|
60
67
|
BasicWebChat
|
|
61
68
|
} = _botframeworkWebchat.Components;
|
|
@@ -151,6 +158,12 @@ const WebChatContainerStateful = props => {
|
|
|
151
158
|
};
|
|
152
159
|
magicCodeBroadcastChannel.addEventListener(broadcastChannelMessageEvent, eventListener);
|
|
153
160
|
}, []);
|
|
161
|
+
(0, _react2.useEffect)(() => {
|
|
162
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
163
|
+
Event: _TelemetryConstants.TelemetryEvent.UXWebchatContainerCompleted,
|
|
164
|
+
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
165
|
+
});
|
|
166
|
+
}, []);
|
|
154
167
|
return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, /*#__PURE__*/_react2.default.createElement("style", null, `
|
|
155
168
|
.webchat__stacked-layout__content .ac-pushButton {
|
|
156
169
|
cursor: pointer;
|
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
|
|
|
@@ -20,7 +20,7 @@ export class FacadeChatSDK {
|
|
|
20
20
|
isTokenSet() {
|
|
21
21
|
return !isNullOrEmptyString(this.token);
|
|
22
22
|
}
|
|
23
|
-
constructor(input) {
|
|
23
|
+
constructor(input, disableReauthentication) {
|
|
24
24
|
_defineProperty(this, "chatSDK", void 0);
|
|
25
25
|
_defineProperty(this, "chatConfig", void 0);
|
|
26
26
|
_defineProperty(this, "token", "");
|
|
@@ -28,11 +28,13 @@ export class FacadeChatSDK {
|
|
|
28
28
|
_defineProperty(this, "isAuthenticated", void 0);
|
|
29
29
|
_defineProperty(this, "getAuthToken", void 0);
|
|
30
30
|
_defineProperty(this, "sdkMocked", void 0);
|
|
31
|
+
_defineProperty(this, "disableReauthentication", void 0);
|
|
31
32
|
this.chatSDK = input.chatSDK;
|
|
32
33
|
this.chatConfig = input.chatConfig;
|
|
33
34
|
this.getAuthToken = input.getAuthToken;
|
|
34
35
|
this.isAuthenticated = input.isAuthenticated;
|
|
35
36
|
this.sdkMocked = input.isSDKMocked;
|
|
37
|
+
this.disableReauthentication = disableReauthentication;
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
//set default expiration to zero, for undefined or missed exp in jwt
|
|
@@ -97,6 +99,14 @@ export class FacadeChatSDK {
|
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
101
|
async tokenRing() {
|
|
102
|
+
if (this.disableReauthentication === true) {
|
|
103
|
+
// facade feature is disabled, so we are bypassing the re authentication and let it fail.
|
|
104
|
+
return {
|
|
105
|
+
result: true,
|
|
106
|
+
message: "Facade is disabled"
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
100
110
|
// this is needed for storybooks, specifically for reconnect pane which requires authentication bypass
|
|
101
111
|
if (this.sdkMocked === true) {
|
|
102
112
|
return {
|
|
@@ -241,7 +251,9 @@ export class FacadeChatSDK {
|
|
|
241
251
|
return this.validateAndExecuteCall("sendMessage", () => this.chatSDK.sendMessage(message));
|
|
242
252
|
}
|
|
243
253
|
async onNewMessage(onNewMessageCallback) {
|
|
244
|
-
let optionalParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
254
|
+
let optionalParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
255
|
+
disablePolling: false
|
|
256
|
+
};
|
|
245
257
|
return this.validateAndExecuteCall("onNewMessage", () => this.chatSDK.onNewMessage(onNewMessageCallback, optionalParams));
|
|
246
258
|
}
|
|
247
259
|
async sendTypingEvent() {
|
|
@@ -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";
|
|
@@ -167,6 +168,7 @@ export let TelemetryEvent;
|
|
|
167
168
|
TelemetryEvent["SetBotAuthProviderNotFound"] = "SetBotAuthProviderNotFound";
|
|
168
169
|
TelemetryEvent["BotAuthActivityUndefinedSignInId"] = "BotAuthActivityUndefinedSignInId";
|
|
169
170
|
TelemetryEvent["ThirdPartyCookiesBlocked"] = "ThirdPartyCookiesBlocked";
|
|
171
|
+
TelemetryEvent["ParticipantsRemovedEvent"] = "ParticipantsRemovedEvent";
|
|
170
172
|
TelemetryEvent["ProcessingHTMLTextMiddlewareFailed"] = "ProcessingHTMLTextMiddlewareFailed";
|
|
171
173
|
TelemetryEvent["ProcessingSanitizationMiddlewareFailed"] = "ProcessingSanitizationMiddlewareFailed";
|
|
172
174
|
TelemetryEvent["FormatTagsMiddlewareJSONStringifyFailed"] = "FormatTagsMiddlewareJSONStringifyFailed";
|
|
@@ -218,6 +220,36 @@ export let TelemetryEvent;
|
|
|
218
220
|
TelemetryEvent["NewTokenFailed"] = "NewTokenFailed";
|
|
219
221
|
TelemetryEvent["NewTokenExpired"] = "NewTokenExpired";
|
|
220
222
|
TelemetryEvent["TokenEmptyOrSame"] = "TokenEmptyOrSame";
|
|
223
|
+
TelemetryEvent["UXFooterStart"] = "UXFooterStart";
|
|
224
|
+
TelemetryEvent["UXFooterCompleted"] = "UXFooterCompleted";
|
|
225
|
+
TelemetryEvent["UXHeaderStart"] = "UXHeaderStart";
|
|
226
|
+
TelemetryEvent["UXHeaderCompleted"] = "UXHeaderCompleted";
|
|
227
|
+
TelemetryEvent["UXLoadingPaneStart"] = "UXLoadingPaneStart";
|
|
228
|
+
TelemetryEvent["UXLoadingPaneCompleted"] = "UXLoadingPaneCompleted";
|
|
229
|
+
TelemetryEvent["UXNotificationPaneStart"] = "UXNotificationPaneStart";
|
|
230
|
+
TelemetryEvent["UXNotificationPaneCompleted"] = "UXNotificationPaneCompleted";
|
|
231
|
+
TelemetryEvent["UXOOHPaneStart"] = "UXOOHPaneStart";
|
|
232
|
+
TelemetryEvent["UXOOHPaneCompleted"] = "UXOOHPaneCompleted";
|
|
233
|
+
TelemetryEvent["UXPostChatLoadingPaneStart"] = "UXPostChatLoadingPaneStart";
|
|
234
|
+
TelemetryEvent["UXPostChatLoadingPaneCompleted"] = "UXPostChatLoadingPaneCompleted";
|
|
235
|
+
TelemetryEvent["UXPrechatPaneStart"] = "UXPrechatPaneStart";
|
|
236
|
+
TelemetryEvent["UXPrechatPaneCompleted"] = "UXPrechatPaneCompleted";
|
|
237
|
+
TelemetryEvent["UXProactiveChatPaneStart"] = "UXProactiveChatPaneStart";
|
|
238
|
+
TelemetryEvent["UXProactiveChatCompleted"] = "UXProactiveChatCompleted";
|
|
239
|
+
TelemetryEvent["UXReconnectChatPaneStart"] = "UXReconnectChatPaneStart";
|
|
240
|
+
TelemetryEvent["UXReconnectChatCompleted"] = "UXReconnectChatCompleted";
|
|
241
|
+
TelemetryEvent["UXStartChatErrorPaneStart"] = "UXStartChatErrorPaneStart";
|
|
242
|
+
TelemetryEvent["UXStartChatErrorCompleted"] = "UXStartChatErrorCompleted";
|
|
243
|
+
TelemetryEvent["UXEmailTranscriptPaneStart"] = "UXEmailTranscriptPaneStart";
|
|
244
|
+
TelemetryEvent["UXEmailTranscriptPaneCompleted"] = "UXEmailTranscriptPaneCompleted";
|
|
245
|
+
TelemetryEvent["UXWebchatContainerStart"] = "UXWebchatContainerStart";
|
|
246
|
+
TelemetryEvent["UXWebchatContainerCompleted"] = "UXWebchatContainerCompleted";
|
|
247
|
+
TelemetryEvent["UXLCWChatButtonStart"] = "UXLCWChatButtonStart";
|
|
248
|
+
TelemetryEvent["UXLCWChatButtonCompleted"] = "UXLCWChatButtonCompleted";
|
|
249
|
+
TelemetryEvent["UXConfirmationPaneStart"] = "UXConfirmationPaneStart";
|
|
250
|
+
TelemetryEvent["UXConfirmationPaneCompleted"] = "UXConfirmationPaneCompleted";
|
|
251
|
+
TelemetryEvent["UXLivechatwidgetStart"] = "UXLivechatwidgetStart";
|
|
252
|
+
TelemetryEvent["UXLivechatwidgetCompleted"] = "UXLivechatwidgetCompleted";
|
|
221
253
|
})(TelemetryEvent || (TelemetryEvent = {}));
|
|
222
254
|
export class TelemetryConstants {
|
|
223
255
|
static map(eventTypeOrScenarioType) {
|
|
@@ -213,6 +213,16 @@ _defineProperty(TelemetryHelper, "logLoadingEvent", (logLevel, payload) => {
|
|
|
213
213
|
};
|
|
214
214
|
BroadcastService.postMessage(telemetryEvent);
|
|
215
215
|
});
|
|
216
|
+
_defineProperty(TelemetryHelper, "logUIEvent", (logLevel, payload) => {
|
|
217
|
+
const telemetryEvent = {
|
|
218
|
+
eventName: (payload === null || payload === void 0 ? void 0 : payload.Event) ?? "",
|
|
219
|
+
logLevel: logLevel,
|
|
220
|
+
payload: {
|
|
221
|
+
...payload
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
BroadcastService.postMessage(telemetryEvent);
|
|
225
|
+
});
|
|
216
226
|
_defineProperty(TelemetryHelper, "logActionEvent", (logLevel, payload) => {
|
|
217
227
|
const telemetryEvent = {
|
|
218
228
|
eventName: (payload === null || payload === void 0 ? void 0 : payload.Event) ?? "",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
2
2
|
import React, { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { createTimer, setFocusOnElement } from "../../common/utils";
|
|
3
4
|
import { ChatButton } from "@microsoft/omnichannel-chat-components";
|
|
4
5
|
import { Constants } from "../../common/Constants";
|
|
5
6
|
import { ConversationState } from "../../contexts/common/ConversationState";
|
|
@@ -7,10 +8,19 @@ import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetAc
|
|
|
7
8
|
import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
8
9
|
import { TelemetryTimers } from "../../common/telemetry/TelemetryManager";
|
|
9
10
|
import { defaultOutOfOfficeChatButtonStyleProps } from "./common/styleProps/defaultOutOfOfficeChatButtonStyleProps";
|
|
10
|
-
import { setFocusOnElement } from "../../common/utils";
|
|
11
11
|
import useChatContextStore from "../../hooks/useChatContextStore";
|
|
12
|
+
let uiTimer;
|
|
12
13
|
export const ChatButtonStateful = props => {
|
|
13
14
|
var _state$domainStates$l, _state$domainStates$l2, _buttonProps$controlP, _props$buttonProps, _props$buttonProps$co, _props$buttonProps2, _props$buttonProps2$c, _props$buttonProps3, _props$buttonProps3$c;
|
|
15
|
+
// this is to ensure the telemetry is set only once and start the load timer
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
uiTimer = createTimer();
|
|
18
|
+
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
19
|
+
Event: TelemetryEvent.UXLCWChatButtonStart
|
|
20
|
+
});
|
|
21
|
+
}, []);
|
|
22
|
+
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
24
|
const [state, dispatch] = useChatContextStore();
|
|
15
25
|
const {
|
|
16
26
|
buttonProps,
|
|
@@ -92,6 +102,10 @@ export const ChatButtonStateful = props => {
|
|
|
92
102
|
payload: true
|
|
93
103
|
});
|
|
94
104
|
}
|
|
105
|
+
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
106
|
+
Event: TelemetryEvent.UXLCWChatButtonCompleted,
|
|
107
|
+
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
108
|
+
});
|
|
95
109
|
}, []);
|
|
96
110
|
return /*#__PURE__*/React.createElement(ChatButton, {
|
|
97
111
|
componentOverrides: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.componentOverrides,
|