@microsoft/omnichannel-chat-widget 1.1.1-main.691fe30 → 1.1.1-main.75135c5
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/storage/default/defaultClientDataStoreProvider.js +20 -15
- package/lib/cjs/common/telemetry/TelemetryConstants.js +2 -0
- package/lib/cjs/common/telemetry/TelemetryHelper.js +9 -0
- package/lib/cjs/components/livechatwidget/common/createMarkdown.js +3 -3
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +15 -5
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +7 -4
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +34 -14
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +5 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +1 -0
- package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +18 -14
- package/lib/esm/common/telemetry/TelemetryConstants.js +2 -0
- package/lib/esm/common/telemetry/TelemetryHelper.js +9 -0
- package/lib/esm/components/livechatwidget/common/createMarkdown.js +3 -3
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +15 -5
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +7 -4
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +34 -14
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +5 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +1 -0
- package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +1 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/WebChatContainerStateful.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +5 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.d.ts +2 -1
- package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +1 -0
- package/package.json +1 -1
|
@@ -3,30 +3,35 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.defaultClientDataStoreProvider = void 0;
|
|
6
|
+
exports.isCookieAllowed = exports.defaultClientDataStoreProvider = void 0;
|
|
7
7
|
var _TelemetryConstants = require("../../telemetry/TelemetryConstants");
|
|
8
|
+
var _Constants = require("../../Constants");
|
|
8
9
|
var _TelemetryHelper = require("../../telemetry/TelemetryHelper");
|
|
9
10
|
var _defaultInMemoryDataStore = require("./defaultInMemoryDataStore");
|
|
10
|
-
var _Constants = require("../../Constants");
|
|
11
11
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
12
12
|
|
|
13
|
+
const isCookieAllowed = () => {
|
|
14
|
+
try {
|
|
15
|
+
localStorage;
|
|
16
|
+
sessionStorage;
|
|
17
|
+
return true;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
if (!window.TPCWarningLogged) {
|
|
20
|
+
console.warn("Third party cookies blocked.");
|
|
21
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.WARN, {
|
|
22
|
+
Event: _TelemetryConstants.TelemetryEvent.ThirdPartyCookiesBlocked,
|
|
23
|
+
Description: "Third party cookies are blocked. Cannot access local storage or session storage."
|
|
24
|
+
});
|
|
25
|
+
window.TPCWarningLogged = true;
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.isCookieAllowed = isCookieAllowed;
|
|
13
31
|
const defaultClientDataStoreProvider = function () {
|
|
14
32
|
let cacheTtlinMins = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
15
33
|
let storageType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _Constants.StorageType.localStorage;
|
|
16
34
|
let ttlInMs = 0;
|
|
17
|
-
const isCookieAllowed = () => {
|
|
18
|
-
try {
|
|
19
|
-
localStorage;
|
|
20
|
-
sessionStorage;
|
|
21
|
-
return true;
|
|
22
|
-
} catch (error) {
|
|
23
|
-
if (!window.TPCWarningShown) {
|
|
24
|
-
console.warn("Third party cookies blocked.");
|
|
25
|
-
window.TPCWarningShown = true;
|
|
26
|
-
}
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
35
|
if (ttlInMs == 0) {
|
|
31
36
|
ttlInMs = cacheTtlinMins * 60 * 1000;
|
|
32
37
|
}
|
|
@@ -164,6 +164,7 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
164
164
|
TelemetryEvent["SetBotAuthProviderHideCard"] = "SetBotAuthProviderHideCard";
|
|
165
165
|
TelemetryEvent["SetBotAuthProviderDisplayCard"] = "SetBotAuthProviderDisplayCard";
|
|
166
166
|
TelemetryEvent["SetBotAuthProviderNotFound"] = "SetBotAuthProviderNotFound";
|
|
167
|
+
TelemetryEvent["ThirdPartyCookiesBlocked"] = "ThirdPartyCookiesBlocked";
|
|
167
168
|
TelemetryEvent["ProcessingHTMLTextMiddlewareFailed"] = "ProcessingHTMLTextMiddlewareFailed";
|
|
168
169
|
TelemetryEvent["ProcessingSanitizationMiddlewareFailed"] = "ProcessingSanitizationMiddlewareFailed";
|
|
169
170
|
TelemetryEvent["FormatTagsMiddlewareJSONStringifyFailed"] = "FormatTagsMiddlewareJSONStringifyFailed";
|
|
@@ -231,6 +232,7 @@ class TelemetryConstants {
|
|
|
231
232
|
case TelemetryEvent.OutOfOfficePaneLoaded:
|
|
232
233
|
case TelemetryEvent.ConfirmationPaneLoaded:
|
|
233
234
|
case TelemetryEvent.ProactiveChatPaneLoaded:
|
|
235
|
+
case TelemetryEvent.ThirdPartyCookiesBlocked:
|
|
234
236
|
return ScenarioType.LOAD;
|
|
235
237
|
case TelemetryEvent.PrechatSubmitted:
|
|
236
238
|
case TelemetryEvent.LCWChatButtonClicked:
|
|
@@ -167,6 +167,15 @@ class TelemetryHelper {
|
|
|
167
167
|
}
|
|
168
168
|
static addWidgetDataToTelemetry(telemetryConfig, telemetryInternalData) {
|
|
169
169
|
const telemetryDataLocal = telemetryInternalData;
|
|
170
|
+
if (!(telemetryConfig !== null && telemetryConfig !== void 0 && telemetryConfig.appId) || (telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.appId.trim()) === "") {
|
|
171
|
+
throw new Error("TelemetryConfig.appId is not set");
|
|
172
|
+
}
|
|
173
|
+
if (!(telemetryConfig !== null && telemetryConfig !== void 0 && telemetryConfig.orgId) || (telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.orgId.trim()) === "") {
|
|
174
|
+
throw new Error("TelemetryConfig.orgId is not set");
|
|
175
|
+
}
|
|
176
|
+
if (!(telemetryConfig !== null && telemetryConfig !== void 0 && telemetryConfig.orgUrl) || (telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.orgUrl.trim()) === "") {
|
|
177
|
+
throw new Error("TelemetryConfig.orgUrl is not set");
|
|
178
|
+
}
|
|
170
179
|
telemetryDataLocal.widgetId = telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.appId;
|
|
171
180
|
telemetryDataLocal.orgId = telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.orgId;
|
|
172
181
|
telemetryDataLocal.orgUrl = telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.orgUrl;
|
|
@@ -4,10 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createMarkdown = void 0;
|
|
7
|
+
var _Constants = require("../../../common/Constants");
|
|
7
8
|
var _markdownIt = _interopRequireDefault(require("markdown-it"));
|
|
8
9
|
var _markdownItForInline = _interopRequireDefault(require("markdown-it-for-inline"));
|
|
10
|
+
var _slackMarkdownIt = _interopRequireDefault(require("slack-markdown-it"));
|
|
9
11
|
var _defaultMarkdownLocalizedTexts = require("../../webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts");
|
|
10
|
-
var _Constants = require("../../../common/Constants");
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
13
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
14
|
const createMarkdown = (disableMarkdownMessageFormatting, disableNewLineMarkdownSupport) => {
|
|
@@ -18,8 +19,7 @@ const createMarkdown = (disableMarkdownMessageFormatting, disableNewLineMarkdown
|
|
|
18
19
|
linkify: true,
|
|
19
20
|
breaks: !disableNewLineMarkdownSupport
|
|
20
21
|
});
|
|
21
|
-
|
|
22
|
-
// markdown.use(MarkdownSlack);
|
|
22
|
+
markdown.use(_slackMarkdownIt.default);
|
|
23
23
|
} else {
|
|
24
24
|
markdown = new _markdownIt.default(_Constants.Constants.Zero, {
|
|
25
25
|
html: true,
|
|
@@ -10,6 +10,7 @@ var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
|
10
10
|
var _defaultAriaConfig = require("../../../common/telemetry/defaultConfigs/defaultAriaConfig");
|
|
11
11
|
var _defaultTelemetryInternalData = require("../../../common/telemetry/defaultConfigs/defaultTelemetryInternalData");
|
|
12
12
|
var _defaultTelemetryConfiguration = require("../../../common/telemetry/defaultConfigs/defaultTelemetryConfiguration");
|
|
13
|
+
var _utils = require("../../../common/utils");
|
|
13
14
|
const registerTelemetryLoggers = (props, dispatch) => {
|
|
14
15
|
var _props$liveChatContex, _props$liveChatContex2;
|
|
15
16
|
const telemetryConfig = {
|
|
@@ -20,7 +21,7 @@ const registerTelemetryLoggers = (props, dispatch) => {
|
|
|
20
21
|
var _props$liveChatContex3, _props$liveChatContex4;
|
|
21
22
|
_TelemetryManager.TelemetryManager.InternalTelemetryData = (_props$liveChatContex3 = props.liveChatContextFromCache) === null || _props$liveChatContex3 === void 0 ? void 0 : (_props$liveChatContex4 = _props$liveChatContex3.domainStates) === null || _props$liveChatContex4 === void 0 ? void 0 : _props$liveChatContex4.telemetryInternalData;
|
|
22
23
|
} else {
|
|
23
|
-
var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$chatSDK3, _props$chatSDK3$omnic;
|
|
24
|
+
var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$chatSDK3, _props$chatSDK3$omnic, _props$chatSDK4, _props$chatSDK4$omnic, _props$chatSDK5, _props$chatSDK5$omnic, _props$chatSDK6, _props$chatSDK6$omnic, _props$chatSDK7, _props$chatSDK7$omnic, _props$chatSDK8, _props$chatSDK8$omnic, _props$chatSDK9, _props$chatSDK9$omnic;
|
|
24
25
|
let telemetryData = {
|
|
25
26
|
..._defaultTelemetryInternalData.defaultInternalTelemetryData,
|
|
26
27
|
telemetryConfig: Object.assign({}, _defaultTelemetryConfiguration.defaultTelemetryConfiguration, telemetryConfig),
|
|
@@ -29,13 +30,22 @@ const registerTelemetryLoggers = (props, dispatch) => {
|
|
|
29
30
|
if (props.chatConfig) {
|
|
30
31
|
telemetryData = _TelemetryHelper.TelemetryHelper.addChatConfigDataToTelemetry(props === null || props === void 0 ? void 0 : props.chatConfig, telemetryData);
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
+
if (!((_props$chatSDK = props.chatSDK) !== null && _props$chatSDK !== void 0 && (_props$chatSDK$omnich = _props$chatSDK.omnichannelConfig) !== null && _props$chatSDK$omnich !== void 0 && _props$chatSDK$omnich.orgId) || ((_props$chatSDK2 = props.chatSDK) === null || _props$chatSDK2 === void 0 ? void 0 : (_props$chatSDK2$omnic = _props$chatSDK2.omnichannelConfig) === null || _props$chatSDK2$omnic === void 0 ? void 0 : _props$chatSDK2$omnic.orgId.trim().length) === 0) {
|
|
34
|
+
throw new Error("orgId is undefined in ChatSDK");
|
|
35
|
+
}
|
|
36
|
+
if (!((_props$chatSDK3 = props.chatSDK) !== null && _props$chatSDK3 !== void 0 && (_props$chatSDK3$omnic = _props$chatSDK3.omnichannelConfig) !== null && _props$chatSDK3$omnic !== void 0 && _props$chatSDK3$omnic.widgetId) || ((_props$chatSDK4 = props.chatSDK) === null || _props$chatSDK4 === void 0 ? void 0 : (_props$chatSDK4$omnic = _props$chatSDK4.omnichannelConfig) === null || _props$chatSDK4$omnic === void 0 ? void 0 : _props$chatSDK4$omnic.widgetId.trim().length) === 0) {
|
|
37
|
+
throw new Error("widgetId is undefined in ChatSDK");
|
|
38
|
+
}
|
|
39
|
+
if (!((_props$chatSDK5 = props.chatSDK) !== null && _props$chatSDK5 !== void 0 && (_props$chatSDK5$omnic = _props$chatSDK5.omnichannelConfig) !== null && _props$chatSDK5$omnic !== void 0 && _props$chatSDK5$omnic.orgUrl) || ((_props$chatSDK6 = props.chatSDK) === null || _props$chatSDK6 === void 0 ? void 0 : (_props$chatSDK6$omnic = _props$chatSDK6.omnichannelConfig) === null || _props$chatSDK6$omnic === void 0 ? void 0 : _props$chatSDK6$omnic.orgUrl.trim().length) === 0) {
|
|
40
|
+
throw new Error("orgUrl is undefined in ChatSDK");
|
|
41
|
+
}
|
|
33
42
|
telemetryData.OCChatSDKVersion = telemetryConfig.OCChatSDKVersion ?? "0.0.0-0";
|
|
34
43
|
telemetryData.chatComponentVersion = telemetryConfig.chatComponentVersion ?? "0.0.0-0";
|
|
35
44
|
telemetryData.chatWidgetVersion = telemetryConfig.chatWidgetVersion ?? "0.0.0-0";
|
|
36
|
-
telemetryData.orgId = (_props$
|
|
37
|
-
telemetryData.widgetId = (_props$
|
|
38
|
-
telemetryData.orgUrl = (_props$
|
|
45
|
+
telemetryData.orgId = (_props$chatSDK7 = props.chatSDK) === null || _props$chatSDK7 === void 0 ? void 0 : (_props$chatSDK7$omnic = _props$chatSDK7.omnichannelConfig) === null || _props$chatSDK7$omnic === void 0 ? void 0 : _props$chatSDK7$omnic.orgId;
|
|
46
|
+
telemetryData.widgetId = (_props$chatSDK8 = props.chatSDK) === null || _props$chatSDK8 === void 0 ? void 0 : (_props$chatSDK8$omnic = _props$chatSDK8.omnichannelConfig) === null || _props$chatSDK8$omnic === void 0 ? void 0 : _props$chatSDK8$omnic.widgetId;
|
|
47
|
+
telemetryData.orgUrl = (_props$chatSDK9 = props.chatSDK) === null || _props$chatSDK9 === void 0 ? void 0 : (_props$chatSDK9$omnic = _props$chatSDK9.omnichannelConfig) === null || _props$chatSDK9$omnic === void 0 ? void 0 : _props$chatSDK9$omnic.orgUrl;
|
|
48
|
+
telemetryData.lcwRuntimeId = telemetryConfig.LCWRuntimeId ?? (0, _utils.newGuid)();
|
|
39
49
|
_TelemetryManager.TelemetryManager.InternalTelemetryData = telemetryData;
|
|
40
50
|
dispatch({
|
|
41
51
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_TELEMETRY_DATA,
|
|
@@ -12,6 +12,7 @@ var _react = require("@fluentui/react");
|
|
|
12
12
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _startChat = require("../common/startChat");
|
|
14
14
|
var _utils = require("../../../common/utils");
|
|
15
|
+
var _defaultClientDataStoreProvider = require("../../../common/storage/default/defaultClientDataStoreProvider");
|
|
15
16
|
var _endChat = require("../common/endChat");
|
|
16
17
|
var _reconnectChatHelper = require("../common/reconnectChatHelper");
|
|
17
18
|
var _componentController = require("../../../controller/componentController");
|
|
@@ -20,8 +21,8 @@ var _CallingContainerStateful = _interopRequireDefault(require("../../callingcon
|
|
|
20
21
|
var _ChatButtonStateful = _interopRequireDefault(require("../../chatbuttonstateful/ChatButtonStateful"));
|
|
21
22
|
var _ConfirmationPaneStateful = _interopRequireDefault(require("../../confirmationpanestateful/ConfirmationPaneStateful"));
|
|
22
23
|
var _ConversationState = require("../../../contexts/common/ConversationState");
|
|
23
|
-
var _createDownloadTranscriptProps = _interopRequireDefault(require("../common/createDownloadTranscriptProps"));
|
|
24
24
|
var _DataStoreManager = require("../../../common/contextDataStore/DataStoreManager");
|
|
25
|
+
var _DraggableChatWidget = _interopRequireDefault(require("../../draggable/DraggableChatWidget"));
|
|
25
26
|
var _EmailTranscriptPaneStateful = _interopRequireDefault(require("../../emailtranscriptpanestateful/EmailTranscriptPaneStateful"));
|
|
26
27
|
var _HeaderStateful = _interopRequireDefault(require("../../headerstateful/HeaderStateful"));
|
|
27
28
|
var _LiveChatWidgetActionType = require("../../../contexts/common/LiveChatWidgetActionType");
|
|
@@ -35,9 +36,9 @@ var _ReconnectChatPaneStateful = _interopRequireDefault(require("../../reconnect
|
|
|
35
36
|
var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
36
37
|
var _TelemetryManager = require("../../../common/telemetry/TelemetryManager");
|
|
37
38
|
var _WebChatContainerStateful = _interopRequireDefault(require("../../webchatcontainerstateful/WebChatContainerStateful"));
|
|
39
|
+
var _createDownloadTranscriptProps = _interopRequireDefault(require("../common/createDownloadTranscriptProps"));
|
|
38
40
|
var _createFooter = require("../common/createFooter");
|
|
39
41
|
var _createInternetConnectionChangeHandler = require("../common/createInternetConnectionChangeHandler");
|
|
40
|
-
var _defaultClientDataStoreProvider = require("../../../common/storage/default/defaultClientDataStoreProvider");
|
|
41
42
|
var _defaultScrollBarProps = require("../common/defaultProps/defaultScrollBarProps");
|
|
42
43
|
var _defaultWebChatContainerStatefulProps = require("../../webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps");
|
|
43
44
|
var _disposeTelemetryLoggers = require("../common/disposeTelemetryLoggers");
|
|
@@ -53,7 +54,6 @@ var _startProactiveChat = require("../common/startProactiveChat");
|
|
|
53
54
|
var _useChatAdapterStore = _interopRequireDefault(require("../../../hooks/useChatAdapterStore"));
|
|
54
55
|
var _useChatContextStore = _interopRequireDefault(require("../../../hooks/useChatContextStore"));
|
|
55
56
|
var _useChatSDKStore = _interopRequireDefault(require("../../../hooks/useChatSDKStore"));
|
|
56
|
-
var _DraggableChatWidget = _interopRequireDefault(require("../../draggable/DraggableChatWidget"));
|
|
57
57
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
58
58
|
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); }
|
|
59
59
|
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; }
|
|
@@ -434,6 +434,9 @@ const LiveChatWidgetStateful = props => {
|
|
|
434
434
|
payload: undefined
|
|
435
435
|
});
|
|
436
436
|
});
|
|
437
|
+
|
|
438
|
+
// Check for TPC and log in telemetry if blocked
|
|
439
|
+
(0, _defaultClientDataStoreProvider.isCookieAllowed)();
|
|
437
440
|
return () => {
|
|
438
441
|
(0, _disposeTelemetryLoggers.disposeTelemetryLoggers)();
|
|
439
442
|
};
|
|
@@ -680,7 +683,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
680
683
|
initStartChat: initStartChatRelay
|
|
681
684
|
})), !((_livechatProps$contro9 = livechatProps.controlProps) !== null && _livechatProps$contro9 !== void 0 && _livechatProps$contro9.hideCallingContainer) && (0, _componentController.shouldShowCallingContainer)(state) && /*#__PURE__*/_react2.default.createElement(_CallingContainerStateful.default, _extends({
|
|
682
685
|
voiceVideoCallingSdk: voiceVideoCallingSDK
|
|
683
|
-
}, livechatProps.callingContainerProps)), !((_livechatProps$contro10 = livechatProps.controlProps) !== null && _livechatProps$contro10 !== void 0 && _livechatProps$contro10.hideWebChatContainer) && (0, _componentController.shouldShowWebChatContainer)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon8 = livechatProps.componentOverrides) === null || _livechatProps$compon8 === void 0 ? void 0 : _livechatProps$compon8.webChatContainer) || /*#__PURE__*/_react2.default.createElement(_WebChatContainerStateful.default, livechatProps
|
|
686
|
+
}, livechatProps.callingContainerProps)), !((_livechatProps$contro10 = livechatProps.controlProps) !== null && _livechatProps$contro10 !== void 0 && _livechatProps$contro10.hideWebChatContainer) && (0, _componentController.shouldShowWebChatContainer)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon8 = livechatProps.componentOverrides) === null || _livechatProps$compon8 === void 0 ? void 0 : _livechatProps$compon8.webChatContainer) || /*#__PURE__*/_react2.default.createElement(_WebChatContainerStateful.default, livechatProps)), !((_livechatProps$contro11 = livechatProps.controlProps) !== null && _livechatProps$contro11 !== void 0 && _livechatProps$contro11.hideConfirmationPane) && (0, _componentController.shouldShowConfirmationPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon9 = livechatProps.componentOverrides) === null || _livechatProps$compon9 === void 0 ? void 0 : _livechatProps$compon9.confirmationPane) || /*#__PURE__*/_react2.default.createElement(_ConfirmationPaneStateful.default, _extends({}, confirmationPaneProps, {
|
|
684
687
|
setPostChatContext: setPostChatContextRelay,
|
|
685
688
|
prepareEndChat: prepareEndChatRelay
|
|
686
689
|
}))), !((_livechatProps$contro12 = livechatProps.controlProps) !== null && _livechatProps$contro12 !== void 0 && _livechatProps$contro12.hidePostChatLoadingPane) && (0, _componentController.shouldShowPostChatLoadingPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon10 = livechatProps.componentOverrides) === null || _livechatProps$compon10 === void 0 ? void 0 : _livechatProps$compon10.postChatLoadingPane) || /*#__PURE__*/_react2.default.createElement(_PostChatLoadingPaneStateful.default, livechatProps.postChatLoadingPaneProps)), (0, _componentController.shouldShowPostChatSurveyPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon11 = livechatProps.componentOverrides) === null || _livechatProps$compon11 === void 0 ? void 0 : _livechatProps$compon11.postChatSurveyPane) || /*#__PURE__*/_react2.default.createElement(_PostChatSurveyPaneStateful.default, _extends({}, livechatProps.postChatSurveyPaneProps, livechatProps.chatSDK))), (0, _createFooter.createFooter)(livechatProps, state), (0, _componentController.shouldShowEmailTranscriptPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon12 = livechatProps.componentOverrides) === null || _livechatProps$compon12 === void 0 ? void 0 : _livechatProps$compon12.emailTranscriptPane) || /*#__PURE__*/_react2.default.createElement(_EmailTranscriptPaneStateful.default, livechatProps.emailTranscriptPane))))));
|
|
@@ -12,20 +12,24 @@ var _broadcastChannel = require("broadcast-channel");
|
|
|
12
12
|
var _botframeworkWebchat = require("botframework-webchat");
|
|
13
13
|
var _Constants = require("../../common/Constants");
|
|
14
14
|
var _LiveChatWidgetActionType = require("../../contexts/common/LiveChatWidgetActionType");
|
|
15
|
+
var _NotificationHandler = require("./webchatcontroller/notification/NotificationHandler");
|
|
16
|
+
var _NotificationScenarios = require("./webchatcontroller/enums/NotificationScenarios");
|
|
15
17
|
var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
16
18
|
var _WebChatActionType = require("./webchatcontroller/enums/WebChatActionType");
|
|
17
19
|
var _WebChatStoreLoader = require("./webchatcontroller/WebChatStoreLoader");
|
|
18
20
|
var _defaultAdaptiveCardStyles = require("./common/defaultStyles/defaultAdaptiveCardStyles");
|
|
19
21
|
var _defaultMiddlewareLocalizedTexts = require("./common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
20
22
|
var _defaultReceivedMessageAnchorStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles");
|
|
23
|
+
var _defaultSentMessageAnchorStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles");
|
|
21
24
|
var _defaultSystemMessageBoxStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles");
|
|
22
25
|
var _defaultUserMessageBoxStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles");
|
|
23
26
|
var _defaultWebChatContainerStatefulProps = require("./common/defaultProps/defaultWebChatContainerStatefulProps");
|
|
24
27
|
var _utils = require("../../common/utils");
|
|
25
28
|
var _ = require("../..");
|
|
26
|
-
var _defaultSentMessageAnchorStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles");
|
|
27
29
|
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); }
|
|
28
30
|
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; }
|
|
31
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
32
|
+
|
|
29
33
|
const broadcastChannelMessageEvent = "message";
|
|
30
34
|
const postActivity = activity => {
|
|
31
35
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
@@ -52,28 +56,33 @@ const createMagicCodeSuccessResponse = signin => {
|
|
|
52
56
|
};
|
|
53
57
|
};
|
|
54
58
|
const WebChatContainerStateful = props => {
|
|
55
|
-
var
|
|
59
|
+
var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15;
|
|
56
60
|
const {
|
|
57
61
|
BasicWebChat
|
|
58
62
|
} = _botframeworkWebchat.Components;
|
|
59
63
|
const [state, dispatch] = (0, _.useChatContextStore)();
|
|
60
64
|
const magicCodeBroadcastChannel = new _broadcastChannel.BroadcastChannel(_Constants.Constants.magicCodeBroadcastChannel);
|
|
61
65
|
const magicCodeResponseBroadcastChannel = new _broadcastChannel.BroadcastChannel(_Constants.Constants.magicCodeResponseBroadcastChannel);
|
|
66
|
+
const {
|
|
67
|
+
webChatContainerProps,
|
|
68
|
+
contextDataStore
|
|
69
|
+
} = props;
|
|
62
70
|
const containerStyles = {
|
|
63
|
-
root: Object.assign({}, _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.containerStyles,
|
|
71
|
+
root: Object.assign({}, _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.containerStyles, webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.containerStyles, {
|
|
64
72
|
display: state.appStates.isMinimized ? "none" : ""
|
|
65
73
|
}) // Use this instead of removing WebChat from the picture so that the activity observer inside the adapter is not invoked
|
|
66
74
|
};
|
|
67
75
|
|
|
68
76
|
const localizedTexts = {
|
|
69
77
|
..._defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts,
|
|
70
|
-
...(
|
|
78
|
+
...(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.localizedTexts)
|
|
71
79
|
};
|
|
72
80
|
(0, _react2.useEffect)(() => {
|
|
81
|
+
var _props$webChatContain, _props$webChatContain2;
|
|
73
82
|
(0, _utils.setFocusOnSendBox)();
|
|
74
83
|
dispatch({
|
|
75
84
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_RENDERING_MIDDLEWARE_PROPS,
|
|
76
|
-
payload:
|
|
85
|
+
payload: webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.renderingMiddlewareProps
|
|
77
86
|
});
|
|
78
87
|
dispatch({
|
|
79
88
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MIDDLEWARE_LOCALIZED_TEXTS,
|
|
@@ -82,6 +91,17 @@ const WebChatContainerStateful = props => {
|
|
|
82
91
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
83
92
|
Event: _TelemetryConstants.TelemetryEvent.WebChatLoaded
|
|
84
93
|
});
|
|
94
|
+
if (((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : (_props$webChatContain2 = _props$webChatContain.renderingMiddlewareProps) === null || _props$webChatContain2 === void 0 ? void 0 : _props$webChatContain2.disableThirdPartyCookiesAlert) !== true && !contextDataStore) {
|
|
95
|
+
try {
|
|
96
|
+
localStorage;
|
|
97
|
+
sessionStorage;
|
|
98
|
+
} catch (error) {
|
|
99
|
+
if (!window.TPCWarningShown) {
|
|
100
|
+
_NotificationHandler.NotificationHandler.notifyWarning(_NotificationScenarios.NotificationScenarios.TPC, (localizedTexts === null || localizedTexts === void 0 ? void 0 : localizedTexts.THIRD_PARTY_COOKIES_BLOCKED_ALERT_MESSAGE) ?? "");
|
|
101
|
+
window.TPCWarningShown = true;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
85
105
|
}, []);
|
|
86
106
|
(0, _react2.useEffect)(() => {
|
|
87
107
|
const eventListener = event => {
|
|
@@ -122,33 +142,33 @@ const WebChatContainerStateful = props => {
|
|
|
122
142
|
return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, /*#__PURE__*/_react2.default.createElement("style", null, `
|
|
123
143
|
|
|
124
144
|
.webchat__bubble__content>div#ms_lcw_webchat_adaptive_card {
|
|
125
|
-
background: ${(
|
|
145
|
+
background: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp === void 0 ? void 0 : _webChatContainerProp.background) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.background};
|
|
126
146
|
}
|
|
127
147
|
|
|
128
148
|
.webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__bubble--from-user {
|
|
129
|
-
max-width: ${(
|
|
149
|
+
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp2 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp2 === void 0 ? void 0 : (_webChatContainerProp3 = _webChatContainerProp2.userMessageBoxStyles) === null || _webChatContainerProp3 === void 0 ? void 0 : _webChatContainerProp3.maxWidth) ?? (_defaultUserMessageBoxStyles.defaultUserMessageBoxStyles === null || _defaultUserMessageBoxStyles.defaultUserMessageBoxStyles === void 0 ? void 0 : _defaultUserMessageBoxStyles.defaultUserMessageBoxStyles.maxWidth)}
|
|
130
150
|
}
|
|
131
151
|
|
|
132
152
|
.webchat__stacked-layout--show-avatar div.webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__stacked-layout__message {
|
|
133
|
-
max-width: ${(
|
|
153
|
+
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp4 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp4 === void 0 ? void 0 : (_webChatContainerProp5 = _webChatContainerProp4.systemMessageBoxStyles) === null || _webChatContainerProp5 === void 0 ? void 0 : _webChatContainerProp5.maxWidth) ?? (_defaultSystemMessageBoxStyles.defaultSystemMessageBoxStyles === null || _defaultSystemMessageBoxStyles.defaultSystemMessageBoxStyles === void 0 ? void 0 : _defaultSystemMessageBoxStyles.defaultSystemMessageBoxStyles.maxWidth)}
|
|
134
154
|
}
|
|
135
155
|
|
|
136
156
|
div[class="ac-textBlock"] *,
|
|
137
|
-
div[class="ac-input-container"] * {color:${(
|
|
157
|
+
div[class="ac-input-container"] * {color:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp6 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp6 === void 0 ? void 0 : _webChatContainerProp6.color) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.color}; white-space:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp7 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp7 === void 0 ? void 0 : _webChatContainerProp7.textWhiteSpace) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.textWhiteSpace}}
|
|
138
158
|
div[class="ac-textBlock"] a:link,
|
|
139
159
|
div[class="ac-textBlock"] a:visited,
|
|
140
160
|
div[class="ac-textBlock"] a:hover,
|
|
141
161
|
div[class="ac-textBlock"] a:active {
|
|
142
|
-
color: ${(
|
|
162
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp8 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp8 === void 0 ? void 0 : _webChatContainerProp8.anchorColor) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.anchorColor};
|
|
143
163
|
}
|
|
144
164
|
|
|
145
|
-
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(
|
|
165
|
+
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp9 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp9 === void 0 ? void 0 : _webChatContainerProp9.buttonWhiteSpace) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.buttonWhiteSpace} !important;}
|
|
146
166
|
|
|
147
167
|
.ms_lcw_webchat_received_message img.webchat__markdown__external-link-icon {
|
|
148
168
|
background-image : url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03LjI1MDEgNC41MDAxN0gxMC43NDk1QzExLjE2MzcgNC41MDAxNyAxMS40OTk1IDQuODM1OTYgMTEuNDk5NSA1LjI1MDE3QzExLjQ5OTUgNS42Mjk4NiAxMS4yMTczIDUuOTQzNjYgMTAuODUxMyA1Ljk5MzMyTDEwLjc0OTUgNi4wMDAxN0g3LjI0OTc0QzYuMDcwNzkgNS45OTk2MSA1LjEwMzQ5IDYuOTA2NTYgNS4wMDc4NiA4LjA2MTEyTDUuMDAwMjggOC4yMjAwM0w1LjAwMzEyIDE2Ljc1MDdDNS4wMDM0MyAxNy45NDE1IDUuOTI4ODUgMTguOTE2MSA3LjA5OTY2IDE4Ljk5NDlMNy4yNTM3MSAxOS4wMDAxTDE1Ljc1MTggMTguOTg4NEMxNi45NDE1IDE4Ljk4NjggMTcuOTE0NSAxOC4wNjIgMTcuOTkzNSAxNi44OTIzTDE3Ljk5ODcgMTYuNzM4NFYxMy4yMzIxQzE3Ljk5ODcgMTIuODE3OSAxOC4zMzQ1IDEyLjQ4MjEgMTguNzQ4NyAxMi40ODIxQzE5LjEyODQgMTIuNDgyMSAxOS40NDIyIDEyLjc2NDMgMTkuNDkxOCAxMy4xMzAzTDE5LjQ5ODcgMTMuMjMyMVYxNi43Mzg0QzE5LjQ5ODcgMTguNzQwNyAxNy45MjkzIDIwLjM3NjkgMTUuOTUyOCAyMC40ODI5TDE1Ljc1MzggMjAuNDg4NEw3LjI1ODI3IDIwLjUwMDFMNy4wNTQ5NSAyMC40OTQ5QzUuMTQyMzkgMjAuMzk1NCAzLjYwODk1IDE4Ljg2MjcgMy41MDgzNyAxNi45NTAyTDMuNTAzMTIgMTYuNzUxMUwzLjUwMDg5IDguMjUyN0wzLjUwNTI5IDguMDUwMkMzLjYwNTM5IDYuMTM3NDkgNS4xMzg2NyA0LjYwNDQ5IDcuMDUwOTYgNC41MDUyN0w3LjI1MDEgNC41MDAxN0gxMC43NDk1SDcuMjUwMVpNMTMuNzQ4MSAzLjAwMTQ2TDIwLjMwMTggMy4wMDE5N0wyMC40MDE0IDMuMDE1NzVMMjAuNTAyMiAzLjA0MzkzTDIwLjU1OSAzLjA2ODAzQzIwLjYxMjIgMy4wOTEyMiAyMC42NjM0IDMuMTIxNjMgMjAuNzExMSAzLjE1ODg1TDIwLjc4MDQgMy4yMjE1NkwyMC44NjQxIDMuMzIwMTRMMjAuOTE4MyAzLjQxMDI1TDIwLjk1NyAzLjUwMDU3TDIwLjk3NjIgMy41NjQ3NkwyMC45ODk4IDMuNjI4NjJMMjAuOTk5MiAzLjcyMjgyTDIwLjk5OTcgMTAuMjU1NEMyMC45OTk3IDEwLjY2OTYgMjAuNjYzOSAxMS4wMDU0IDIwLjI0OTcgMTEuMDA1NEMxOS44NyAxMS4wMDU0IDE5LjU1NjIgMTAuNzIzMiAxOS41MDY1IDEwLjM1NzFMMTkuNDk5NyAxMC4yNTU0TDE5LjQ5ODkgNS41NjE0N0wxMi4yNzk3IDEyLjc4NDdDMTIuMDEzNCAxMy4wNTEgMTEuNTk2OCAxMy4wNzUzIDExLjMwMzEgMTIuODU3NUwxMS4yMTkgMTIuNzg0OUMxMC45NTI3IDEyLjUxODcgMTAuOTI4NCAxMi4xMDIxIDExLjE0NjIgMTEuODA4NEwxMS4yMTg4IDExLjcyNDNMMTguNDM2OSA0LjUwMTQ2SDEzLjc0ODFDMTMuMzY4NCA0LjUwMTQ2IDEzLjA1NDYgNC4yMTkzMSAxMy4wMDUgMy44NTMyNEwxMi45OTgxIDMuNzUxNDZDMTIuOTk4MSAzLjM3MTc3IDEzLjI4MDMgMy4wNTc5NyAxMy42NDY0IDMuMDA4MzFMMTMuNzQ4MSAzLjAwMTQ2WiIgZmlsbD0iI0ZGRkZGRiIgLz48L3N2Zz4) !important;
|
|
149
169
|
height: '.75em';
|
|
150
170
|
marginLeft: '.25em';
|
|
151
|
-
filter:${(
|
|
171
|
+
filter:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp10 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp10 === void 0 ? void 0 : (_webChatContainerProp11 = _webChatContainerProp10.receivedMessageAnchorStyles) === null || _webChatContainerProp11 === void 0 ? void 0 : _webChatContainerProp11.filter) ?? "none"};
|
|
152
172
|
}
|
|
153
173
|
pre {
|
|
154
174
|
white-space: pre-wrap;
|
|
@@ -161,13 +181,13 @@ const WebChatContainerStateful = props => {
|
|
|
161
181
|
.ms_lcw_webchat_received_message a:visited,
|
|
162
182
|
.ms_lcw_webchat_received_message a:hover,
|
|
163
183
|
.ms_lcw_webchat_received_message a:active {
|
|
164
|
-
color: ${(
|
|
184
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp12 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp12 === void 0 ? void 0 : (_webChatContainerProp13 = _webChatContainerProp12.receivedMessageAnchorStyles) === null || _webChatContainerProp13 === void 0 ? void 0 : _webChatContainerProp13.color) ?? (_defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === null || _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === void 0 ? void 0 : _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles.color)};
|
|
165
185
|
}
|
|
166
186
|
.ms_lcw_webchat_sent_message a:link,
|
|
167
187
|
.ms_lcw_webchat_sent_message a:visited,
|
|
168
188
|
.ms_lcw_webchat_sent_message a:hover,
|
|
169
189
|
.ms_lcw_webchat_sent_message a:active {
|
|
170
|
-
color: ${(
|
|
190
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp14 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp14 === void 0 ? void 0 : (_webChatContainerProp15 = _webChatContainerProp14.sentMessageAnchorStyles) === null || _webChatContainerProp15 === void 0 ? void 0 : _webChatContainerProp15.color) ?? (_defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === null || _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === void 0 ? void 0 : _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles.color)};
|
|
171
191
|
}
|
|
172
192
|
`), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
173
193
|
styles: containerStyles
|
|
@@ -30,6 +30,7 @@ const defaultMiddlewareLocalizedTexts = {
|
|
|
30
30
|
MIDDLEWARE_MESSAGE_DELIVERED: "Sent",
|
|
31
31
|
MIDDLEWARE_MESSAGE_NOT_DELIVERED: "Not Delivered",
|
|
32
32
|
MIDDLEWARE_MESSAGE_RETRY: "Retry",
|
|
33
|
-
MIDDLEWARE_BANNER_CHAT_DISCONNECT: "Your conversation has been disconnected. For additional assistance, please start a new chat."
|
|
33
|
+
MIDDLEWARE_BANNER_CHAT_DISCONNECT: "Your conversation has been disconnected. For additional assistance, please start a new chat.",
|
|
34
|
+
THIRD_PARTY_COOKIES_BLOCKED_ALERT_MESSAGE: "Third party cookies are blocked. Reloading this page will start a new conversation."
|
|
34
35
|
};
|
|
35
36
|
exports.defaultMiddlewareLocalizedTexts = defaultMiddlewareLocalizedTexts;
|
|
@@ -15,6 +15,11 @@ class MockChatSDK {
|
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
16
|
_defineProperty(this, "sleep", ms => new Promise(r => setTimeout(r, ms)));
|
|
17
17
|
_defineProperty(this, "isMockModeOn", true);
|
|
18
|
+
_defineProperty(this, "omnichannelConfig", {
|
|
19
|
+
widgetId: "00000000-0000-0000-0000-000000000000",
|
|
20
|
+
orgId: "00000000-0000-0000-0000-000000000000",
|
|
21
|
+
orgUrl: "https://contoso.crm.dynamics.com"
|
|
22
|
+
});
|
|
18
23
|
}
|
|
19
24
|
async startChat() {
|
|
20
25
|
await this.sleep(1000);
|
package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js
CHANGED
|
@@ -14,4 +14,5 @@ exports.NotificationScenarios = NotificationScenarios;
|
|
|
14
14
|
NotificationScenarios["InternetConnection"] = "internet connection";
|
|
15
15
|
NotificationScenarios["MaxSizeError"] = "max size";
|
|
16
16
|
NotificationScenarios["ChatDisconnect"] = "chat disconnect";
|
|
17
|
+
NotificationScenarios["TPC"] = "tpc blocked";
|
|
17
18
|
})(NotificationScenarios || (exports.NotificationScenarios = NotificationScenarios = {}));
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
|
|
3
3
|
import { LogLevel, TelemetryEvent } from "../../telemetry/TelemetryConstants";
|
|
4
|
+
import { StorageType } from "../../Constants";
|
|
4
5
|
import { TelemetryHelper } from "../../telemetry/TelemetryHelper";
|
|
5
6
|
import { inMemoryDataStore } from "./defaultInMemoryDataStore";
|
|
6
|
-
|
|
7
|
+
export const isCookieAllowed = () => {
|
|
8
|
+
try {
|
|
9
|
+
localStorage;
|
|
10
|
+
sessionStorage;
|
|
11
|
+
return true;
|
|
12
|
+
} catch (error) {
|
|
13
|
+
if (!window.TPCWarningLogged) {
|
|
14
|
+
console.warn("Third party cookies blocked.");
|
|
15
|
+
TelemetryHelper.logActionEvent(LogLevel.WARN, {
|
|
16
|
+
Event: TelemetryEvent.ThirdPartyCookiesBlocked,
|
|
17
|
+
Description: "Third party cookies are blocked. Cannot access local storage or session storage."
|
|
18
|
+
});
|
|
19
|
+
window.TPCWarningLogged = true;
|
|
20
|
+
}
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
7
24
|
export const defaultClientDataStoreProvider = function () {
|
|
8
25
|
let cacheTtlinMins = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
9
26
|
let storageType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : StorageType.localStorage;
|
|
10
27
|
let ttlInMs = 0;
|
|
11
|
-
const isCookieAllowed = () => {
|
|
12
|
-
try {
|
|
13
|
-
localStorage;
|
|
14
|
-
sessionStorage;
|
|
15
|
-
return true;
|
|
16
|
-
} catch (error) {
|
|
17
|
-
if (!window.TPCWarningShown) {
|
|
18
|
-
console.warn("Third party cookies blocked.");
|
|
19
|
-
window.TPCWarningShown = true;
|
|
20
|
-
}
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
28
|
if (ttlInMs == 0) {
|
|
25
29
|
ttlInMs = cacheTtlinMins * 60 * 1000;
|
|
26
30
|
}
|
|
@@ -158,6 +158,7 @@ export let TelemetryEvent;
|
|
|
158
158
|
TelemetryEvent["SetBotAuthProviderHideCard"] = "SetBotAuthProviderHideCard";
|
|
159
159
|
TelemetryEvent["SetBotAuthProviderDisplayCard"] = "SetBotAuthProviderDisplayCard";
|
|
160
160
|
TelemetryEvent["SetBotAuthProviderNotFound"] = "SetBotAuthProviderNotFound";
|
|
161
|
+
TelemetryEvent["ThirdPartyCookiesBlocked"] = "ThirdPartyCookiesBlocked";
|
|
161
162
|
TelemetryEvent["ProcessingHTMLTextMiddlewareFailed"] = "ProcessingHTMLTextMiddlewareFailed";
|
|
162
163
|
TelemetryEvent["ProcessingSanitizationMiddlewareFailed"] = "ProcessingSanitizationMiddlewareFailed";
|
|
163
164
|
TelemetryEvent["FormatTagsMiddlewareJSONStringifyFailed"] = "FormatTagsMiddlewareJSONStringifyFailed";
|
|
@@ -225,6 +226,7 @@ export class TelemetryConstants {
|
|
|
225
226
|
case TelemetryEvent.OutOfOfficePaneLoaded:
|
|
226
227
|
case TelemetryEvent.ConfirmationPaneLoaded:
|
|
227
228
|
case TelemetryEvent.ProactiveChatPaneLoaded:
|
|
229
|
+
case TelemetryEvent.ThirdPartyCookiesBlocked:
|
|
228
230
|
return ScenarioType.LOAD;
|
|
229
231
|
case TelemetryEvent.PrechatSubmitted:
|
|
230
232
|
case TelemetryEvent.LCWChatButtonClicked:
|
|
@@ -161,6 +161,15 @@ export class TelemetryHelper {
|
|
|
161
161
|
}
|
|
162
162
|
static addWidgetDataToTelemetry(telemetryConfig, telemetryInternalData) {
|
|
163
163
|
const telemetryDataLocal = telemetryInternalData;
|
|
164
|
+
if (!(telemetryConfig !== null && telemetryConfig !== void 0 && telemetryConfig.appId) || (telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.appId.trim()) === "") {
|
|
165
|
+
throw new Error("TelemetryConfig.appId is not set");
|
|
166
|
+
}
|
|
167
|
+
if (!(telemetryConfig !== null && telemetryConfig !== void 0 && telemetryConfig.orgId) || (telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.orgId.trim()) === "") {
|
|
168
|
+
throw new Error("TelemetryConfig.orgId is not set");
|
|
169
|
+
}
|
|
170
|
+
if (!(telemetryConfig !== null && telemetryConfig !== void 0 && telemetryConfig.orgUrl) || (telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.orgUrl.trim()) === "") {
|
|
171
|
+
throw new Error("TelemetryConfig.orgUrl is not set");
|
|
172
|
+
}
|
|
164
173
|
telemetryDataLocal.widgetId = telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.appId;
|
|
165
174
|
telemetryDataLocal.orgId = telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.orgId;
|
|
166
175
|
telemetryDataLocal.orgUrl = telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.orgUrl;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { Constants } from "../../../common/Constants";
|
|
1
2
|
import MarkdownIt from "markdown-it";
|
|
2
3
|
import MarkdownItForInline from "markdown-it-for-inline";
|
|
4
|
+
import MarkdownSlack from "slack-markdown-it";
|
|
3
5
|
import { defaultMarkdownLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts";
|
|
4
|
-
import { Constants } from "../../../common/Constants";
|
|
5
6
|
|
|
6
7
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
8
|
export const createMarkdown = (disableMarkdownMessageFormatting, disableNewLineMarkdownSupport) => {
|
|
@@ -12,8 +13,7 @@ export const createMarkdown = (disableMarkdownMessageFormatting, disableNewLineM
|
|
|
12
13
|
linkify: true,
|
|
13
14
|
breaks: !disableNewLineMarkdownSupport
|
|
14
15
|
});
|
|
15
|
-
|
|
16
|
-
// markdown.use(MarkdownSlack);
|
|
16
|
+
markdown.use(MarkdownSlack);
|
|
17
17
|
} else {
|
|
18
18
|
markdown = new MarkdownIt(Constants.Zero, {
|
|
19
19
|
html: true,
|
|
@@ -4,6 +4,7 @@ import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
|
|
|
4
4
|
import { defaultAriaConfig } from "../../../common/telemetry/defaultConfigs/defaultAriaConfig";
|
|
5
5
|
import { defaultInternalTelemetryData } from "../../../common/telemetry/defaultConfigs/defaultTelemetryInternalData";
|
|
6
6
|
import { defaultTelemetryConfiguration } from "../../../common/telemetry/defaultConfigs/defaultTelemetryConfiguration";
|
|
7
|
+
import { newGuid } from "../../../common/utils";
|
|
7
8
|
export const registerTelemetryLoggers = (props, dispatch) => {
|
|
8
9
|
var _props$liveChatContex, _props$liveChatContex2;
|
|
9
10
|
const telemetryConfig = {
|
|
@@ -14,7 +15,7 @@ export const registerTelemetryLoggers = (props, dispatch) => {
|
|
|
14
15
|
var _props$liveChatContex3, _props$liveChatContex4;
|
|
15
16
|
TelemetryManager.InternalTelemetryData = (_props$liveChatContex3 = props.liveChatContextFromCache) === null || _props$liveChatContex3 === void 0 ? void 0 : (_props$liveChatContex4 = _props$liveChatContex3.domainStates) === null || _props$liveChatContex4 === void 0 ? void 0 : _props$liveChatContex4.telemetryInternalData;
|
|
16
17
|
} else {
|
|
17
|
-
var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$chatSDK3, _props$chatSDK3$omnic;
|
|
18
|
+
var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$chatSDK3, _props$chatSDK3$omnic, _props$chatSDK4, _props$chatSDK4$omnic, _props$chatSDK5, _props$chatSDK5$omnic, _props$chatSDK6, _props$chatSDK6$omnic, _props$chatSDK7, _props$chatSDK7$omnic, _props$chatSDK8, _props$chatSDK8$omnic, _props$chatSDK9, _props$chatSDK9$omnic;
|
|
18
19
|
let telemetryData = {
|
|
19
20
|
...defaultInternalTelemetryData,
|
|
20
21
|
telemetryConfig: Object.assign({}, defaultTelemetryConfiguration, telemetryConfig),
|
|
@@ -23,13 +24,22 @@ export const registerTelemetryLoggers = (props, dispatch) => {
|
|
|
23
24
|
if (props.chatConfig) {
|
|
24
25
|
telemetryData = TelemetryHelper.addChatConfigDataToTelemetry(props === null || props === void 0 ? void 0 : props.chatConfig, telemetryData);
|
|
25
26
|
}
|
|
26
|
-
|
|
27
|
+
if (!((_props$chatSDK = props.chatSDK) !== null && _props$chatSDK !== void 0 && (_props$chatSDK$omnich = _props$chatSDK.omnichannelConfig) !== null && _props$chatSDK$omnich !== void 0 && _props$chatSDK$omnich.orgId) || ((_props$chatSDK2 = props.chatSDK) === null || _props$chatSDK2 === void 0 ? void 0 : (_props$chatSDK2$omnic = _props$chatSDK2.omnichannelConfig) === null || _props$chatSDK2$omnic === void 0 ? void 0 : _props$chatSDK2$omnic.orgId.trim().length) === 0) {
|
|
28
|
+
throw new Error("orgId is undefined in ChatSDK");
|
|
29
|
+
}
|
|
30
|
+
if (!((_props$chatSDK3 = props.chatSDK) !== null && _props$chatSDK3 !== void 0 && (_props$chatSDK3$omnic = _props$chatSDK3.omnichannelConfig) !== null && _props$chatSDK3$omnic !== void 0 && _props$chatSDK3$omnic.widgetId) || ((_props$chatSDK4 = props.chatSDK) === null || _props$chatSDK4 === void 0 ? void 0 : (_props$chatSDK4$omnic = _props$chatSDK4.omnichannelConfig) === null || _props$chatSDK4$omnic === void 0 ? void 0 : _props$chatSDK4$omnic.widgetId.trim().length) === 0) {
|
|
31
|
+
throw new Error("widgetId is undefined in ChatSDK");
|
|
32
|
+
}
|
|
33
|
+
if (!((_props$chatSDK5 = props.chatSDK) !== null && _props$chatSDK5 !== void 0 && (_props$chatSDK5$omnic = _props$chatSDK5.omnichannelConfig) !== null && _props$chatSDK5$omnic !== void 0 && _props$chatSDK5$omnic.orgUrl) || ((_props$chatSDK6 = props.chatSDK) === null || _props$chatSDK6 === void 0 ? void 0 : (_props$chatSDK6$omnic = _props$chatSDK6.omnichannelConfig) === null || _props$chatSDK6$omnic === void 0 ? void 0 : _props$chatSDK6$omnic.orgUrl.trim().length) === 0) {
|
|
34
|
+
throw new Error("orgUrl is undefined in ChatSDK");
|
|
35
|
+
}
|
|
27
36
|
telemetryData.OCChatSDKVersion = telemetryConfig.OCChatSDKVersion ?? "0.0.0-0";
|
|
28
37
|
telemetryData.chatComponentVersion = telemetryConfig.chatComponentVersion ?? "0.0.0-0";
|
|
29
38
|
telemetryData.chatWidgetVersion = telemetryConfig.chatWidgetVersion ?? "0.0.0-0";
|
|
30
|
-
telemetryData.orgId = (_props$
|
|
31
|
-
telemetryData.widgetId = (_props$
|
|
32
|
-
telemetryData.orgUrl = (_props$
|
|
39
|
+
telemetryData.orgId = (_props$chatSDK7 = props.chatSDK) === null || _props$chatSDK7 === void 0 ? void 0 : (_props$chatSDK7$omnic = _props$chatSDK7.omnichannelConfig) === null || _props$chatSDK7$omnic === void 0 ? void 0 : _props$chatSDK7$omnic.orgId;
|
|
40
|
+
telemetryData.widgetId = (_props$chatSDK8 = props.chatSDK) === null || _props$chatSDK8 === void 0 ? void 0 : (_props$chatSDK8$omnic = _props$chatSDK8.omnichannelConfig) === null || _props$chatSDK8$omnic === void 0 ? void 0 : _props$chatSDK8$omnic.widgetId;
|
|
41
|
+
telemetryData.orgUrl = (_props$chatSDK9 = props.chatSDK) === null || _props$chatSDK9 === void 0 ? void 0 : (_props$chatSDK9$omnic = _props$chatSDK9.omnichannelConfig) === null || _props$chatSDK9$omnic === void 0 ? void 0 : _props$chatSDK9$omnic.orgUrl;
|
|
42
|
+
telemetryData.lcwRuntimeId = telemetryConfig.LCWRuntimeId ?? newGuid();
|
|
33
43
|
TelemetryManager.InternalTelemetryData = telemetryData;
|
|
34
44
|
dispatch({
|
|
35
45
|
type: LiveChatWidgetActionType.SET_TELEMETRY_DATA,
|
|
@@ -7,6 +7,7 @@ import { Stack } from "@fluentui/react";
|
|
|
7
7
|
import React, { useEffect, useRef, useState } from "react";
|
|
8
8
|
import { checkIfConversationStillValid, initStartChat, prepareStartChat, setPreChatAndInitiateChat } from "../common/startChat";
|
|
9
9
|
import { createTimer, getBroadcastChannelName, getConversationDetailsCall, getLocaleDirection, getStateFromCache, getWidgetCacheIdfromProps, getWidgetEndChatEventName, isNullOrEmptyString, isUndefinedOrEmpty, newGuid } from "../../../common/utils";
|
|
10
|
+
import { defaultClientDataStoreProvider, isCookieAllowed } from "../../../common/storage/default/defaultClientDataStoreProvider";
|
|
10
11
|
import { endChat, prepareEndChat } from "../common/endChat";
|
|
11
12
|
import { handleChatReconnect, isReconnectEnabled } from "../common/reconnectChatHelper";
|
|
12
13
|
import { shouldShowCallingContainer, shouldShowChatButton, shouldShowConfirmationPane, shouldShowEmailTranscriptPane, shouldShowHeader, shouldShowLoadingPane, shouldShowOutOfOfficeHoursPane, shouldShowPostChatLoadingPane, shouldShowPostChatSurveyPane, shouldShowPreChatSurveyPane, shouldShowProactiveChatPane, shouldShowReconnectChatPane, shouldShowWebChatContainer } from "../../../controller/componentController";
|
|
@@ -15,8 +16,8 @@ import CallingContainerStateful from "../../callingcontainerstateful/CallingCont
|
|
|
15
16
|
import ChatButtonStateful from "../../chatbuttonstateful/ChatButtonStateful";
|
|
16
17
|
import ConfirmationPaneStateful from "../../confirmationpanestateful/ConfirmationPaneStateful";
|
|
17
18
|
import { ConversationState } from "../../../contexts/common/ConversationState";
|
|
18
|
-
import createDownloadTranscriptProps from "../common/createDownloadTranscriptProps";
|
|
19
19
|
import { DataStoreManager } from "../../../common/contextDataStore/DataStoreManager";
|
|
20
|
+
import DraggableChatWidget from "../../draggable/DraggableChatWidget";
|
|
20
21
|
import { ElementType } from "@microsoft/omnichannel-chat-components";
|
|
21
22
|
import EmailTranscriptPaneStateful from "../../emailtranscriptpanestateful/EmailTranscriptPaneStateful";
|
|
22
23
|
import HeaderStateful from "../../headerstateful/HeaderStateful";
|
|
@@ -31,9 +32,9 @@ import ReconnectChatPaneStateful from "../../reconnectchatpanestateful/Reconnect
|
|
|
31
32
|
import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
|
|
32
33
|
import { TelemetryTimers } from "../../../common/telemetry/TelemetryManager";
|
|
33
34
|
import WebChatContainerStateful from "../../webchatcontainerstateful/WebChatContainerStateful";
|
|
35
|
+
import createDownloadTranscriptProps from "../common/createDownloadTranscriptProps";
|
|
34
36
|
import { createFooter } from "../common/createFooter";
|
|
35
37
|
import { createInternetConnectionChangeHandler } from "../common/createInternetConnectionChangeHandler";
|
|
36
|
-
import { defaultClientDataStoreProvider } from "../../../common/storage/default/defaultClientDataStoreProvider";
|
|
37
38
|
import { defaultScrollBarProps } from "../common/defaultProps/defaultScrollBarProps";
|
|
38
39
|
import { defaultWebChatContainerStatefulProps } from "../../webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps";
|
|
39
40
|
import { disposeTelemetryLoggers } from "../common/disposeTelemetryLoggers";
|
|
@@ -49,7 +50,6 @@ import { startProactiveChat } from "../common/startProactiveChat";
|
|
|
49
50
|
import useChatAdapterStore from "../../../hooks/useChatAdapterStore";
|
|
50
51
|
import useChatContextStore from "../../../hooks/useChatContextStore";
|
|
51
52
|
import useChatSDKStore from "../../../hooks/useChatSDKStore";
|
|
52
|
-
import DraggableChatWidget from "../../draggable/DraggableChatWidget";
|
|
53
53
|
export const LiveChatWidgetStateful = props => {
|
|
54
54
|
var _props$webChatContain, _props$styleProps, _chatSDK$omnichannelC, _props$controlProps, _props$controlProps2, _state$appStates7, _props$webChatContain5, _state$appStates14, _props$webChatContain6, _props$controlProps11, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _livechatProps$webCha, _livechatProps$styleP, _livechatProps$contro, _livechatProps$contro2, _livechatProps$compon, _livechatProps$contro3, _livechatProps$compon2, _livechatProps$contro4, _livechatProps$compon3, _livechatProps$contro5, _livechatProps$compon4, _livechatProps$contro6, _livechatProps$compon5, _livechatProps$contro7, _livechatProps$compon6, _livechatProps$contro8, _livechatProps$compon7, _livechatProps$contro9, _livechatProps$contro10, _livechatProps$compon8, _livechatProps$contro11, _livechatProps$compon9, _livechatProps$contro12, _livechatProps$compon10, _livechatProps$compon11, _livechatProps$compon12;
|
|
55
55
|
const [state, dispatch] = useChatContextStore();
|
|
@@ -426,6 +426,9 @@ export const LiveChatWidgetStateful = props => {
|
|
|
426
426
|
payload: undefined
|
|
427
427
|
});
|
|
428
428
|
});
|
|
429
|
+
|
|
430
|
+
// Check for TPC and log in telemetry if blocked
|
|
431
|
+
isCookieAllowed();
|
|
429
432
|
return () => {
|
|
430
433
|
disposeTelemetryLoggers();
|
|
431
434
|
};
|
|
@@ -672,7 +675,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
672
675
|
initStartChat: initStartChatRelay
|
|
673
676
|
})), !((_livechatProps$contro9 = livechatProps.controlProps) !== null && _livechatProps$contro9 !== void 0 && _livechatProps$contro9.hideCallingContainer) && shouldShowCallingContainer(state) && /*#__PURE__*/React.createElement(CallingContainerStateful, _extends({
|
|
674
677
|
voiceVideoCallingSdk: voiceVideoCallingSDK
|
|
675
|
-
}, livechatProps.callingContainerProps)), !((_livechatProps$contro10 = livechatProps.controlProps) !== null && _livechatProps$contro10 !== void 0 && _livechatProps$contro10.hideWebChatContainer) && shouldShowWebChatContainer(state) && (decodeComponentString((_livechatProps$compon8 = livechatProps.componentOverrides) === null || _livechatProps$compon8 === void 0 ? void 0 : _livechatProps$compon8.webChatContainer) || /*#__PURE__*/React.createElement(WebChatContainerStateful, livechatProps
|
|
678
|
+
}, livechatProps.callingContainerProps)), !((_livechatProps$contro10 = livechatProps.controlProps) !== null && _livechatProps$contro10 !== void 0 && _livechatProps$contro10.hideWebChatContainer) && shouldShowWebChatContainer(state) && (decodeComponentString((_livechatProps$compon8 = livechatProps.componentOverrides) === null || _livechatProps$compon8 === void 0 ? void 0 : _livechatProps$compon8.webChatContainer) || /*#__PURE__*/React.createElement(WebChatContainerStateful, livechatProps)), !((_livechatProps$contro11 = livechatProps.controlProps) !== null && _livechatProps$contro11 !== void 0 && _livechatProps$contro11.hideConfirmationPane) && shouldShowConfirmationPane(state) && (decodeComponentString((_livechatProps$compon9 = livechatProps.componentOverrides) === null || _livechatProps$compon9 === void 0 ? void 0 : _livechatProps$compon9.confirmationPane) || /*#__PURE__*/React.createElement(ConfirmationPaneStateful, _extends({}, confirmationPaneProps, {
|
|
676
679
|
setPostChatContext: setPostChatContextRelay,
|
|
677
680
|
prepareEndChat: prepareEndChatRelay
|
|
678
681
|
}))), !((_livechatProps$contro12 = livechatProps.controlProps) !== null && _livechatProps$contro12 !== void 0 && _livechatProps$contro12.hidePostChatLoadingPane) && shouldShowPostChatLoadingPane(state) && (decodeComponentString((_livechatProps$compon10 = livechatProps.componentOverrides) === null || _livechatProps$compon10 === void 0 ? void 0 : _livechatProps$compon10.postChatLoadingPane) || /*#__PURE__*/React.createElement(PostChatLoadingPaneStateful, livechatProps.postChatLoadingPaneProps)), shouldShowPostChatSurveyPane(state) && (decodeComponentString((_livechatProps$compon11 = livechatProps.componentOverrides) === null || _livechatProps$compon11 === void 0 ? void 0 : _livechatProps$compon11.postChatSurveyPane) || /*#__PURE__*/React.createElement(PostChatSurveyPaneStateful, _extends({}, livechatProps.postChatSurveyPaneProps, livechatProps.chatSDK))), createFooter(livechatProps, state), shouldShowEmailTranscriptPane(state) && (decodeComponentString((_livechatProps$compon12 = livechatProps.componentOverrides) === null || _livechatProps$compon12 === void 0 ? void 0 : _livechatProps$compon12.emailTranscriptPane) || /*#__PURE__*/React.createElement(EmailTranscriptPaneStateful, livechatProps.emailTranscriptPane))))));
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
|
|
1
3
|
import { Stack } from "@fluentui/react";
|
|
2
4
|
import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
3
5
|
import React, { useEffect } from "react";
|
|
@@ -6,18 +8,20 @@ import { BroadcastChannel } from "broadcast-channel";
|
|
|
6
8
|
import { Components } from "botframework-webchat";
|
|
7
9
|
import { Constants } from "../../common/Constants";
|
|
8
10
|
import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
|
|
11
|
+
import { NotificationHandler } from "./webchatcontroller/notification/NotificationHandler";
|
|
12
|
+
import { NotificationScenarios } from "./webchatcontroller/enums/NotificationScenarios";
|
|
9
13
|
import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
10
14
|
import { WebChatActionType } from "./webchatcontroller/enums/WebChatActionType";
|
|
11
15
|
import { WebChatStoreLoader } from "./webchatcontroller/WebChatStoreLoader";
|
|
12
16
|
import { defaultAdaptiveCardStyles } from "./common/defaultStyles/defaultAdaptiveCardStyles";
|
|
13
17
|
import { defaultMiddlewareLocalizedTexts } from "./common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
14
18
|
import { defaultReceivedMessageAnchorStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles";
|
|
19
|
+
import { defaultSentMessageAnchorStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles";
|
|
15
20
|
import { defaultSystemMessageBoxStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles";
|
|
16
21
|
import { defaultUserMessageBoxStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles";
|
|
17
22
|
import { defaultWebChatContainerStatefulProps } from "./common/defaultProps/defaultWebChatContainerStatefulProps";
|
|
18
23
|
import { setFocusOnSendBox } from "../../common/utils";
|
|
19
24
|
import { useChatContextStore } from "../..";
|
|
20
|
-
import { defaultSentMessageAnchorStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles";
|
|
21
25
|
const broadcastChannelMessageEvent = "message";
|
|
22
26
|
const postActivity = activity => {
|
|
23
27
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
@@ -44,28 +48,33 @@ const createMagicCodeSuccessResponse = signin => {
|
|
|
44
48
|
};
|
|
45
49
|
};
|
|
46
50
|
export const WebChatContainerStateful = props => {
|
|
47
|
-
var
|
|
51
|
+
var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15;
|
|
48
52
|
const {
|
|
49
53
|
BasicWebChat
|
|
50
54
|
} = Components;
|
|
51
55
|
const [state, dispatch] = useChatContextStore();
|
|
52
56
|
const magicCodeBroadcastChannel = new BroadcastChannel(Constants.magicCodeBroadcastChannel);
|
|
53
57
|
const magicCodeResponseBroadcastChannel = new BroadcastChannel(Constants.magicCodeResponseBroadcastChannel);
|
|
58
|
+
const {
|
|
59
|
+
webChatContainerProps,
|
|
60
|
+
contextDataStore
|
|
61
|
+
} = props;
|
|
54
62
|
const containerStyles = {
|
|
55
|
-
root: Object.assign({}, defaultWebChatContainerStatefulProps.containerStyles,
|
|
63
|
+
root: Object.assign({}, defaultWebChatContainerStatefulProps.containerStyles, webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.containerStyles, {
|
|
56
64
|
display: state.appStates.isMinimized ? "none" : ""
|
|
57
65
|
}) // Use this instead of removing WebChat from the picture so that the activity observer inside the adapter is not invoked
|
|
58
66
|
};
|
|
59
67
|
|
|
60
68
|
const localizedTexts = {
|
|
61
69
|
...defaultMiddlewareLocalizedTexts,
|
|
62
|
-
...(
|
|
70
|
+
...(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.localizedTexts)
|
|
63
71
|
};
|
|
64
72
|
useEffect(() => {
|
|
73
|
+
var _props$webChatContain, _props$webChatContain2;
|
|
65
74
|
setFocusOnSendBox();
|
|
66
75
|
dispatch({
|
|
67
76
|
type: LiveChatWidgetActionType.SET_RENDERING_MIDDLEWARE_PROPS,
|
|
68
|
-
payload:
|
|
77
|
+
payload: webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.renderingMiddlewareProps
|
|
69
78
|
});
|
|
70
79
|
dispatch({
|
|
71
80
|
type: LiveChatWidgetActionType.SET_MIDDLEWARE_LOCALIZED_TEXTS,
|
|
@@ -74,6 +83,17 @@ export const WebChatContainerStateful = props => {
|
|
|
74
83
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
75
84
|
Event: TelemetryEvent.WebChatLoaded
|
|
76
85
|
});
|
|
86
|
+
if (((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : (_props$webChatContain2 = _props$webChatContain.renderingMiddlewareProps) === null || _props$webChatContain2 === void 0 ? void 0 : _props$webChatContain2.disableThirdPartyCookiesAlert) !== true && !contextDataStore) {
|
|
87
|
+
try {
|
|
88
|
+
localStorage;
|
|
89
|
+
sessionStorage;
|
|
90
|
+
} catch (error) {
|
|
91
|
+
if (!window.TPCWarningShown) {
|
|
92
|
+
NotificationHandler.notifyWarning(NotificationScenarios.TPC, (localizedTexts === null || localizedTexts === void 0 ? void 0 : localizedTexts.THIRD_PARTY_COOKIES_BLOCKED_ALERT_MESSAGE) ?? "");
|
|
93
|
+
window.TPCWarningShown = true;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
77
97
|
}, []);
|
|
78
98
|
useEffect(() => {
|
|
79
99
|
const eventListener = event => {
|
|
@@ -114,33 +134,33 @@ export const WebChatContainerStateful = props => {
|
|
|
114
134
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, `
|
|
115
135
|
|
|
116
136
|
.webchat__bubble__content>div#ms_lcw_webchat_adaptive_card {
|
|
117
|
-
background: ${(
|
|
137
|
+
background: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp === void 0 ? void 0 : _webChatContainerProp.background) ?? defaultAdaptiveCardStyles.background};
|
|
118
138
|
}
|
|
119
139
|
|
|
120
140
|
.webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__bubble--from-user {
|
|
121
|
-
max-width: ${(
|
|
141
|
+
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp2 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp2 === void 0 ? void 0 : (_webChatContainerProp3 = _webChatContainerProp2.userMessageBoxStyles) === null || _webChatContainerProp3 === void 0 ? void 0 : _webChatContainerProp3.maxWidth) ?? (defaultUserMessageBoxStyles === null || defaultUserMessageBoxStyles === void 0 ? void 0 : defaultUserMessageBoxStyles.maxWidth)}
|
|
122
142
|
}
|
|
123
143
|
|
|
124
144
|
.webchat__stacked-layout--show-avatar div.webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__stacked-layout__message {
|
|
125
|
-
max-width: ${(
|
|
145
|
+
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp4 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp4 === void 0 ? void 0 : (_webChatContainerProp5 = _webChatContainerProp4.systemMessageBoxStyles) === null || _webChatContainerProp5 === void 0 ? void 0 : _webChatContainerProp5.maxWidth) ?? (defaultSystemMessageBoxStyles === null || defaultSystemMessageBoxStyles === void 0 ? void 0 : defaultSystemMessageBoxStyles.maxWidth)}
|
|
126
146
|
}
|
|
127
147
|
|
|
128
148
|
div[class="ac-textBlock"] *,
|
|
129
|
-
div[class="ac-input-container"] * {color:${(
|
|
149
|
+
div[class="ac-input-container"] * {color:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp6 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp6 === void 0 ? void 0 : _webChatContainerProp6.color) ?? defaultAdaptiveCardStyles.color}; white-space:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp7 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp7 === void 0 ? void 0 : _webChatContainerProp7.textWhiteSpace) ?? defaultAdaptiveCardStyles.textWhiteSpace}}
|
|
130
150
|
div[class="ac-textBlock"] a:link,
|
|
131
151
|
div[class="ac-textBlock"] a:visited,
|
|
132
152
|
div[class="ac-textBlock"] a:hover,
|
|
133
153
|
div[class="ac-textBlock"] a:active {
|
|
134
|
-
color: ${(
|
|
154
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp8 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp8 === void 0 ? void 0 : _webChatContainerProp8.anchorColor) ?? defaultAdaptiveCardStyles.anchorColor};
|
|
135
155
|
}
|
|
136
156
|
|
|
137
|
-
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(
|
|
157
|
+
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp9 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp9 === void 0 ? void 0 : _webChatContainerProp9.buttonWhiteSpace) ?? defaultAdaptiveCardStyles.buttonWhiteSpace} !important;}
|
|
138
158
|
|
|
139
159
|
.ms_lcw_webchat_received_message img.webchat__markdown__external-link-icon {
|
|
140
160
|
background-image : url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03LjI1MDEgNC41MDAxN0gxMC43NDk1QzExLjE2MzcgNC41MDAxNyAxMS40OTk1IDQuODM1OTYgMTEuNDk5NSA1LjI1MDE3QzExLjQ5OTUgNS42Mjk4NiAxMS4yMTczIDUuOTQzNjYgMTAuODUxMyA1Ljk5MzMyTDEwLjc0OTUgNi4wMDAxN0g3LjI0OTc0QzYuMDcwNzkgNS45OTk2MSA1LjEwMzQ5IDYuOTA2NTYgNS4wMDc4NiA4LjA2MTEyTDUuMDAwMjggOC4yMjAwM0w1LjAwMzEyIDE2Ljc1MDdDNS4wMDM0MyAxNy45NDE1IDUuOTI4ODUgMTguOTE2MSA3LjA5OTY2IDE4Ljk5NDlMNy4yNTM3MSAxOS4wMDAxTDE1Ljc1MTggMTguOTg4NEMxNi45NDE1IDE4Ljk4NjggMTcuOTE0NSAxOC4wNjIgMTcuOTkzNSAxNi44OTIzTDE3Ljk5ODcgMTYuNzM4NFYxMy4yMzIxQzE3Ljk5ODcgMTIuODE3OSAxOC4zMzQ1IDEyLjQ4MjEgMTguNzQ4NyAxMi40ODIxQzE5LjEyODQgMTIuNDgyMSAxOS40NDIyIDEyLjc2NDMgMTkuNDkxOCAxMy4xMzAzTDE5LjQ5ODcgMTMuMjMyMVYxNi43Mzg0QzE5LjQ5ODcgMTguNzQwNyAxNy45MjkzIDIwLjM3NjkgMTUuOTUyOCAyMC40ODI5TDE1Ljc1MzggMjAuNDg4NEw3LjI1ODI3IDIwLjUwMDFMNy4wNTQ5NSAyMC40OTQ5QzUuMTQyMzkgMjAuMzk1NCAzLjYwODk1IDE4Ljg2MjcgMy41MDgzNyAxNi45NTAyTDMuNTAzMTIgMTYuNzUxMUwzLjUwMDg5IDguMjUyN0wzLjUwNTI5IDguMDUwMkMzLjYwNTM5IDYuMTM3NDkgNS4xMzg2NyA0LjYwNDQ5IDcuMDUwOTYgNC41MDUyN0w3LjI1MDEgNC41MDAxN0gxMC43NDk1SDcuMjUwMVpNMTMuNzQ4MSAzLjAwMTQ2TDIwLjMwMTggMy4wMDE5N0wyMC40MDE0IDMuMDE1NzVMMjAuNTAyMiAzLjA0MzkzTDIwLjU1OSAzLjA2ODAzQzIwLjYxMjIgMy4wOTEyMiAyMC42NjM0IDMuMTIxNjMgMjAuNzExMSAzLjE1ODg1TDIwLjc4MDQgMy4yMjE1NkwyMC44NjQxIDMuMzIwMTRMMjAuOTE4MyAzLjQxMDI1TDIwLjk1NyAzLjUwMDU3TDIwLjk3NjIgMy41NjQ3NkwyMC45ODk4IDMuNjI4NjJMMjAuOTk5MiAzLjcyMjgyTDIwLjk5OTcgMTAuMjU1NEMyMC45OTk3IDEwLjY2OTYgMjAuNjYzOSAxMS4wMDU0IDIwLjI0OTcgMTEuMDA1NEMxOS44NyAxMS4wMDU0IDE5LjU1NjIgMTAuNzIzMiAxOS41MDY1IDEwLjM1NzFMMTkuNDk5NyAxMC4yNTU0TDE5LjQ5ODkgNS41NjE0N0wxMi4yNzk3IDEyLjc4NDdDMTIuMDEzNCAxMy4wNTEgMTEuNTk2OCAxMy4wNzUzIDExLjMwMzEgMTIuODU3NUwxMS4yMTkgMTIuNzg0OUMxMC45NTI3IDEyLjUxODcgMTAuOTI4NCAxMi4xMDIxIDExLjE0NjIgMTEuODA4NEwxMS4yMTg4IDExLjcyNDNMMTguNDM2OSA0LjUwMTQ2SDEzLjc0ODFDMTMuMzY4NCA0LjUwMTQ2IDEzLjA1NDYgNC4yMTkzMSAxMy4wMDUgMy44NTMyNEwxMi45OTgxIDMuNzUxNDZDMTIuOTk4MSAzLjM3MTc3IDEzLjI4MDMgMy4wNTc5NyAxMy42NDY0IDMuMDA4MzFMMTMuNzQ4MSAzLjAwMTQ2WiIgZmlsbD0iI0ZGRkZGRiIgLz48L3N2Zz4) !important;
|
|
141
161
|
height: '.75em';
|
|
142
162
|
marginLeft: '.25em';
|
|
143
|
-
filter:${(
|
|
163
|
+
filter:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp10 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp10 === void 0 ? void 0 : (_webChatContainerProp11 = _webChatContainerProp10.receivedMessageAnchorStyles) === null || _webChatContainerProp11 === void 0 ? void 0 : _webChatContainerProp11.filter) ?? "none"};
|
|
144
164
|
}
|
|
145
165
|
pre {
|
|
146
166
|
white-space: pre-wrap;
|
|
@@ -153,13 +173,13 @@ export const WebChatContainerStateful = props => {
|
|
|
153
173
|
.ms_lcw_webchat_received_message a:visited,
|
|
154
174
|
.ms_lcw_webchat_received_message a:hover,
|
|
155
175
|
.ms_lcw_webchat_received_message a:active {
|
|
156
|
-
color: ${(
|
|
176
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp12 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp12 === void 0 ? void 0 : (_webChatContainerProp13 = _webChatContainerProp12.receivedMessageAnchorStyles) === null || _webChatContainerProp13 === void 0 ? void 0 : _webChatContainerProp13.color) ?? (defaultReceivedMessageAnchorStyles === null || defaultReceivedMessageAnchorStyles === void 0 ? void 0 : defaultReceivedMessageAnchorStyles.color)};
|
|
157
177
|
}
|
|
158
178
|
.ms_lcw_webchat_sent_message a:link,
|
|
159
179
|
.ms_lcw_webchat_sent_message a:visited,
|
|
160
180
|
.ms_lcw_webchat_sent_message a:hover,
|
|
161
181
|
.ms_lcw_webchat_sent_message a:active {
|
|
162
|
-
color: ${(
|
|
182
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp14 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp14 === void 0 ? void 0 : (_webChatContainerProp15 = _webChatContainerProp14.sentMessageAnchorStyles) === null || _webChatContainerProp15 === void 0 ? void 0 : _webChatContainerProp15.color) ?? (defaultSentMessageAnchorStyles === null || defaultSentMessageAnchorStyles === void 0 ? void 0 : defaultSentMessageAnchorStyles.color)};
|
|
163
183
|
}
|
|
164
184
|
`), /*#__PURE__*/React.createElement(Stack, {
|
|
165
185
|
styles: containerStyles
|
|
@@ -24,5 +24,6 @@ export const defaultMiddlewareLocalizedTexts = {
|
|
|
24
24
|
MIDDLEWARE_MESSAGE_DELIVERED: "Sent",
|
|
25
25
|
MIDDLEWARE_MESSAGE_NOT_DELIVERED: "Not Delivered",
|
|
26
26
|
MIDDLEWARE_MESSAGE_RETRY: "Retry",
|
|
27
|
-
MIDDLEWARE_BANNER_CHAT_DISCONNECT: "Your conversation has been disconnected. For additional assistance, please start a new chat."
|
|
27
|
+
MIDDLEWARE_BANNER_CHAT_DISCONNECT: "Your conversation has been disconnected. For additional assistance, please start a new chat.",
|
|
28
|
+
THIRD_PARTY_COOKIES_BLOCKED_ALERT_MESSAGE: "Third party cookies are blocked. Reloading this page will start a new conversation."
|
|
28
29
|
};
|
|
@@ -8,6 +8,11 @@ export class MockChatSDK {
|
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
9
|
_defineProperty(this, "sleep", ms => new Promise(r => setTimeout(r, ms)));
|
|
10
10
|
_defineProperty(this, "isMockModeOn", true);
|
|
11
|
+
_defineProperty(this, "omnichannelConfig", {
|
|
12
|
+
widgetId: "00000000-0000-0000-0000-000000000000",
|
|
13
|
+
orgId: "00000000-0000-0000-0000-000000000000",
|
|
14
|
+
orgUrl: "https://contoso.crm.dynamics.com"
|
|
15
|
+
});
|
|
11
16
|
}
|
|
12
17
|
async startChat() {
|
|
13
18
|
await this.sleep(1000);
|
package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js
CHANGED
|
@@ -7,4 +7,5 @@ export let NotificationScenarios;
|
|
|
7
7
|
NotificationScenarios["InternetConnection"] = "internet connection";
|
|
8
8
|
NotificationScenarios["MaxSizeError"] = "max size";
|
|
9
9
|
NotificationScenarios["ChatDisconnect"] = "chat disconnect";
|
|
10
|
+
NotificationScenarios["TPC"] = "tpc blocked";
|
|
10
11
|
})(NotificationScenarios || (NotificationScenarios = {}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { IContextDataStore } from "../../interfaces/IContextDataStore";
|
|
2
2
|
import { StorageType } from "../../Constants";
|
|
3
|
+
export declare const isCookieAllowed: () => boolean;
|
|
3
4
|
export declare const defaultClientDataStoreProvider: (cacheTtlinMins?: number, storageType?: StorageType) => IContextDataStore;
|
|
@@ -151,6 +151,7 @@ export declare enum TelemetryEvent {
|
|
|
151
151
|
SetBotAuthProviderHideCard = "SetBotAuthProviderHideCard",
|
|
152
152
|
SetBotAuthProviderDisplayCard = "SetBotAuthProviderDisplayCard",
|
|
153
153
|
SetBotAuthProviderNotFound = "SetBotAuthProviderNotFound",
|
|
154
|
+
ThirdPartyCookiesBlocked = "ThirdPartyCookiesBlocked",
|
|
154
155
|
ProcessingHTMLTextMiddlewareFailed = "ProcessingHTMLTextMiddlewareFailed",
|
|
155
156
|
ProcessingSanitizationMiddlewareFailed = "ProcessingSanitizationMiddlewareFailed",
|
|
156
157
|
FormatTagsMiddlewareJSONStringifyFailed = "FormatTagsMiddlewareJSONStringifyFailed",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const WebChatContainerStateful: (props:
|
|
1
|
+
import { ILiveChatWidgetProps } from "../livechatwidget/interfaces/ILiveChatWidgetProps";
|
|
2
|
+
export declare const WebChatContainerStateful: (props: ILiveChatWidgetProps) => JSX.Element;
|
|
3
3
|
export default WebChatContainerStateful;
|
|
@@ -3,6 +3,11 @@ import MockAdapter from "./mockadapter";
|
|
|
3
3
|
export declare class MockChatSDK {
|
|
4
4
|
protected sleep: (ms: any) => Promise<unknown>;
|
|
5
5
|
isMockModeOn: boolean;
|
|
6
|
+
omnichannelConfig: {
|
|
7
|
+
widgetId: string;
|
|
8
|
+
orgId: string;
|
|
9
|
+
orgUrl: string;
|
|
10
|
+
};
|
|
6
11
|
startChat(): Promise<void>;
|
|
7
12
|
endChat(): null;
|
|
8
13
|
getChatToken(): null;
|
package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { IAttachmentProps } from "./IAttachmentProps";
|
|
2
|
+
import React from "react";
|
|
3
3
|
export interface IRenderingMiddlewareProps {
|
|
4
4
|
timestampDir?: "ltr" | "rtl" | "auto";
|
|
5
5
|
disableActivityMiddleware?: boolean;
|
|
@@ -8,6 +8,7 @@ export interface IRenderingMiddlewareProps {
|
|
|
8
8
|
disableAvatarMiddleware?: boolean;
|
|
9
9
|
disableGroupActivitiesMiddleware?: boolean;
|
|
10
10
|
disableTypingIndicatorMiddleware?: boolean;
|
|
11
|
+
disableThirdPartyCookiesAlert?: boolean;
|
|
11
12
|
hideSendboxOnConversationEnd?: boolean;
|
|
12
13
|
userMessageStyleProps?: React.CSSProperties;
|
|
13
14
|
systemMessageStyleProps?: React.CSSProperties;
|