@microsoft/omnichannel-chat-widget 1.6.6-main.ebf7b47 → 1.7.1-main.0f60758
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/utils.js +11 -4
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +8 -0
- package/lib/cjs/components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts.js +30 -0
- package/lib/cjs/components/footerstateful/downloadtranscriptstateful/interfaces/TranscriptHtmlScripts.js +1 -0
- package/lib/cjs/components/headerstateful/HeaderStateful.js +4 -0
- package/lib/cjs/components/livechatwidget/common/startChat.js +2 -2
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +39 -21
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +2 -2
- package/lib/cjs/plugins/createChatTranscript.js +43 -6
- package/lib/esm/common/utils.js +8 -2
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +8 -0
- package/lib/esm/components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts.js +23 -0
- package/lib/esm/components/footerstateful/downloadtranscriptstateful/interfaces/TranscriptHtmlScripts.js +1 -0
- package/lib/esm/components/headerstateful/HeaderStateful.js +4 -0
- package/lib/esm/components/livechatwidget/common/startChat.js +2 -2
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +41 -23
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +2 -2
- package/lib/esm/plugins/createChatTranscript.js +42 -6
- package/lib/types/common/utils.d.ts +1 -0
- package/lib/types/components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts.d.ts +23 -0
- package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/TranscriptHtmlScripts.d.ts +33 -0
- package/package.json +1 -1
package/lib/cjs/common/utils.js
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.setTabIndices = exports.setOcUserAgent = exports.setFocusOnSendBox = exports.setFocusOnElement = exports.preventFocusToMoveOutOfElement = exports.parseLowerCaseString = exports.parseAdaptiveCardPayload = exports.newGuid = exports.isUndefinedOrEmpty = exports.isNullOrUndefined = exports.isNullOrEmptyString = exports.getWidgetEndChatEventName = exports.getWidgetCacheIdfromProps = exports.getWidgetCacheId = exports.getTimestampHourMinute = exports.getStateFromCache = exports.getLocaleDirection = exports.getIconText = exports.getDomain = exports.getConversationDetailsCall = exports.getBroadcastChannelName = exports.formatTemplateString = exports.findParentFocusableElementsWithoutChildContainer = exports.findAllFocusableElement = exports.extractPreChatSurveyResponseValues = exports.escapeHtml = exports.debounceLeading = exports.createTimer = exports.createFileAndDownload = exports.checkContactIdError = exports.changeLanguageCodeFormatForWebChat = exports.addDelayInMs = void 0;
|
|
6
|
+
exports.setTabIndices = exports.setOcUserAgent = exports.setFocusOnSendBox = exports.setFocusOnElement = exports.preventFocusToMoveOutOfElement = exports.parseLowerCaseString = exports.parseAdaptiveCardPayload = exports.newGuid = exports.isUndefinedOrEmpty = exports.isThisSessionPopout = exports.isNullOrUndefined = exports.isNullOrEmptyString = exports.getWidgetEndChatEventName = exports.getWidgetCacheIdfromProps = exports.getWidgetCacheId = exports.getTimestampHourMinute = exports.getStateFromCache = exports.getLocaleDirection = exports.getIconText = exports.getDomain = exports.getConversationDetailsCall = exports.getBroadcastChannelName = exports.formatTemplateString = exports.findParentFocusableElementsWithoutChildContainer = exports.findAllFocusableElement = exports.extractPreChatSurveyResponseValues = exports.escapeHtml = exports.debounceLeading = exports.createTimer = exports.createFileAndDownload = exports.checkContactIdError = exports.changeLanguageCodeFormatForWebChat = exports.addDelayInMs = void 0;
|
|
7
7
|
var _Constants = require("./Constants");
|
|
8
8
|
var _TelemetryConstants = require("./telemetry/TelemetryConstants");
|
|
9
9
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
10
|
+
var _omnichannelChatSdk = require("@microsoft/omnichannel-chat-sdk");
|
|
10
11
|
var _DataStoreManager = require("./contextDataStore/DataStoreManager");
|
|
11
12
|
var _KeyCodes = require("./KeyCodes");
|
|
12
13
|
var _md5Typescript = require("md5-typescript");
|
|
13
14
|
var _TelemetryHelper = require("./telemetry/TelemetryHelper");
|
|
14
|
-
var _omnichannelChatSdk = require("@microsoft/omnichannel-chat-sdk");
|
|
15
15
|
var _this = void 0;
|
|
16
16
|
const getElementBySelector = selector => {
|
|
17
17
|
let element;
|
|
@@ -380,9 +380,16 @@ const debounceLeading = function (fn) {
|
|
|
380
380
|
}, ms);
|
|
381
381
|
};
|
|
382
382
|
};
|
|
383
|
-
|
|
384
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
385
383
|
exports.debounceLeading = debounceLeading;
|
|
384
|
+
const isThisSessionPopout = href => {
|
|
385
|
+
var _window, _window$location, _window$location$href;
|
|
386
|
+
if (href !== null && href !== void 0 && href.includes("open-in-window=true") && !((_window = window) !== null && _window !== void 0 && (_window$location = _window.location) !== null && _window$location !== void 0 && (_window$location$href = _window$location.href) !== null && _window$location$href !== void 0 && _window$location$href.includes("is-popout-mode=true"))) {
|
|
387
|
+
return true;
|
|
388
|
+
}
|
|
389
|
+
return false;
|
|
390
|
+
};
|
|
391
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
392
|
+
exports.isThisSessionPopout = isThisSessionPopout;
|
|
386
393
|
const getConversationDetailsCall = async function (chatSDK) {
|
|
387
394
|
let liveChatContext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
388
395
|
let conversationDetails = undefined; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
@@ -40,6 +40,14 @@ const ChatButtonStateful = props => {
|
|
|
40
40
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MINIMIZED,
|
|
41
41
|
payload: false
|
|
42
42
|
});
|
|
43
|
+
dispatch({
|
|
44
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_UNREAD_MESSAGE_COUNT,
|
|
45
|
+
payload: 0
|
|
46
|
+
});
|
|
47
|
+
// If chat is minimized and then unminimized, start a chat if convesation state is closed.
|
|
48
|
+
if (state.appStates.conversationState === _ConversationState.ConversationState.Closed) {
|
|
49
|
+
await startChat();
|
|
50
|
+
}
|
|
43
51
|
} else {
|
|
44
52
|
await startChat();
|
|
45
53
|
}
|
package/lib/cjs/components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
const defaultLibraryScripts = {
|
|
8
|
+
botframeworkWebChat: {
|
|
9
|
+
src: "https://cdn.botframework.com/botframework-webchat/4.15.7/webchat.js"
|
|
10
|
+
},
|
|
11
|
+
rxJs: {
|
|
12
|
+
src: "https://cdnjs.cloudflare.com/ajax/libs/rxjs/7.8.0/rxjs.umd.min.js",
|
|
13
|
+
integrity: "sha512-v0/YVjBcbjLN6scjmmJN+h86koeB7JhY4/2YeyA5l+rTdtKLv0VbDBNJ32rxJpsaW1QGMd1Z16lsLOSGI38Rbg==",
|
|
14
|
+
crossOrigin: "anonymous",
|
|
15
|
+
referrerPolicy: "no-referrer"
|
|
16
|
+
},
|
|
17
|
+
react: {
|
|
18
|
+
src: "https://unpkg.com/react@18.2.0/umd/react.production.min.js"
|
|
19
|
+
},
|
|
20
|
+
reactDom: {
|
|
21
|
+
src: "https://unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js"
|
|
22
|
+
},
|
|
23
|
+
markdownIt: {
|
|
24
|
+
src: "https://cdn.jsdelivr.net/npm/markdown-it@13.0.1/dist/markdown-it.min.js",
|
|
25
|
+
integrity: "sha256-hNyljag6giCsjv/yKmxK8/VeHzvMDvc5u8AzmRvm1BI=",
|
|
26
|
+
crossOrigin: "anonymous"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var _default = defaultLibraryScripts;
|
|
30
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -46,6 +46,10 @@ const HeaderStateful = props => {
|
|
|
46
46
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MINIMIZED,
|
|
47
47
|
payload: true
|
|
48
48
|
});
|
|
49
|
+
dispatch({
|
|
50
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_UNREAD_MESSAGE_COUNT,
|
|
51
|
+
payload: 0
|
|
52
|
+
});
|
|
49
53
|
},
|
|
50
54
|
onCloseClick: async () => {
|
|
51
55
|
var _props$headerProps, _props$headerProps$co, _props$headerProps$co2;
|
|
@@ -61,12 +61,12 @@ const prepareStartChat = async (props, chatSDK, state, dispatch, setAdapter) =>
|
|
|
61
61
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
62
62
|
exports.prepareStartChat = prepareStartChat;
|
|
63
63
|
const setPreChatAndInitiateChat = async (chatSDK, dispatch, setAdapter, isProactiveChat, proactiveChatEnablePrechatState, state, props) => {
|
|
64
|
-
var _props$controlProps;
|
|
64
|
+
var _props$preChatSurveyP, _props$preChatSurveyP2, _props$controlProps;
|
|
65
65
|
//Handle reconnect scenario
|
|
66
66
|
|
|
67
67
|
// Getting prechat Survey Context
|
|
68
68
|
const parseToJson = false;
|
|
69
|
-
const preChatSurveyResponse = await chatSDK.getPreChatSurvey(parseToJson);
|
|
69
|
+
const preChatSurveyResponse = (props === null || props === void 0 ? void 0 : (_props$preChatSurveyP = props.preChatSurveyPaneProps) === null || _props$preChatSurveyP === void 0 ? void 0 : (_props$preChatSurveyP2 = _props$preChatSurveyP.controlProps) === null || _props$preChatSurveyP2 === void 0 ? void 0 : _props$preChatSurveyP2.payload) ?? (await chatSDK.getPreChatSurvey(parseToJson));
|
|
70
70
|
const showPrechat = isProactiveChat ? preChatSurveyResponse && proactiveChatEnablePrechatState : preChatSurveyResponse && !(props !== null && props !== void 0 && (_props$controlProps = props.controlProps) !== null && _props$controlProps !== void 0 && _props$controlProps.hidePreChatSurveyPane);
|
|
71
71
|
if (showPrechat) {
|
|
72
72
|
var _state$domainStates, _state$domainStates$l, _state$domainStates$l2, _state$domainStates$l3;
|
|
@@ -10,10 +10,11 @@ var _botframeworkWebchat = require("botframework-webchat");
|
|
|
10
10
|
var _Constants = require("../../../common/Constants");
|
|
11
11
|
var _react = require("@fluentui/react");
|
|
12
12
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _TelemetryManager = require("../../../common/telemetry/TelemetryManager");
|
|
14
|
+
var _endChat = require("../common/endChat");
|
|
13
15
|
var _startChat = require("../common/startChat");
|
|
14
16
|
var _utils = require("../../../common/utils");
|
|
15
17
|
var _defaultClientDataStoreProvider = require("../../../common/storage/default/defaultClientDataStoreProvider");
|
|
16
|
-
var _endChat = require("../common/endChat");
|
|
17
18
|
var _reconnectChatHelper = require("../common/reconnectChatHelper");
|
|
18
19
|
var _componentController = require("../../../controller/componentController");
|
|
19
20
|
var _ActivityStreamHandler = require("../common/ActivityStreamHandler");
|
|
@@ -33,15 +34,18 @@ var _PostChatSurveyPaneStateful = _interopRequireDefault(require("../../postchat
|
|
|
33
34
|
var _PreChatSurveyPaneStateful = _interopRequireDefault(require("../../prechatsurveypanestateful/PreChatSurveyPaneStateful"));
|
|
34
35
|
var _ProactiveChatPaneStateful = _interopRequireDefault(require("../../proactivechatpanestateful/ProactiveChatPaneStateful"));
|
|
35
36
|
var _ReconnectChatPaneStateful = _interopRequireDefault(require("../../reconnectchatpanestateful/ReconnectChatPaneStateful"));
|
|
37
|
+
var _StartChatErrorPaneStateful = _interopRequireDefault(require("../../startchaterrorpanestateful/StartChatErrorPaneStateful"));
|
|
38
|
+
var _StartChatFailureType = require("../../../contexts/common/StartChatFailureType");
|
|
36
39
|
var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
37
|
-
var _TelemetryManager = require("../../../common/telemetry/TelemetryManager");
|
|
38
40
|
var _WebChatContainerStateful = _interopRequireDefault(require("../../webchatcontainerstateful/WebChatContainerStateful"));
|
|
39
41
|
var _createDownloadTranscriptProps = _interopRequireDefault(require("../common/createDownloadTranscriptProps"));
|
|
40
42
|
var _createFooter = require("../common/createFooter");
|
|
41
43
|
var _createInternetConnectionChangeHandler = require("../common/createInternetConnectionChangeHandler");
|
|
44
|
+
var _defaultAdaptiveCardStyles = require("../../webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles");
|
|
42
45
|
var _defaultScrollBarProps = require("../common/defaultProps/defaultScrollBarProps");
|
|
43
46
|
var _defaultWebChatContainerStatefulProps = require("../../webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps");
|
|
44
47
|
var _disposeTelemetryLoggers = require("../common/disposeTelemetryLoggers");
|
|
48
|
+
var _createReducer = require("../../../contexts/createReducer");
|
|
45
49
|
var _getGeneralStylesForButton = require("../common/getGeneralStylesForButton");
|
|
46
50
|
var _chatDisconnectHelper = require("../common/chatDisconnectHelper");
|
|
47
51
|
var _initCallingSdk = require("../common/initCallingSdk");
|
|
@@ -54,10 +58,6 @@ var _startProactiveChat = require("../common/startProactiveChat");
|
|
|
54
58
|
var _useChatAdapterStore = _interopRequireDefault(require("../../../hooks/useChatAdapterStore"));
|
|
55
59
|
var _useChatContextStore = _interopRequireDefault(require("../../../hooks/useChatContextStore"));
|
|
56
60
|
var _useChatSDKStore = _interopRequireDefault(require("../../../hooks/useChatSDKStore"));
|
|
57
|
-
var _defaultAdaptiveCardStyles = require("../../webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles");
|
|
58
|
-
var _StartChatErrorPaneStateful = _interopRequireDefault(require("../../startchaterrorpanestateful/StartChatErrorPaneStateful"));
|
|
59
|
-
var _StartChatFailureType = require("../../../contexts/common/StartChatFailureType");
|
|
60
|
-
var _createReducer = require("../../../contexts/createReducer");
|
|
61
61
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
62
62
|
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); }
|
|
63
63
|
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; }
|
|
@@ -99,6 +99,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
99
99
|
const currentMessageCountRef = (0, _react2.useRef)(0);
|
|
100
100
|
let widgetStateEventId = "";
|
|
101
101
|
const lastLWICheckTimeRef = (0, _react2.useRef)(0);
|
|
102
|
+
const callInProgress = (0, _react2.useRef)(false);
|
|
102
103
|
let optionalParams;
|
|
103
104
|
let activeCachedChatExist = false;
|
|
104
105
|
const setOptionalParams = () => {
|
|
@@ -318,7 +319,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
318
319
|
_omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.HideChatVisibilityChangeEvent).subscribe(async event => {
|
|
319
320
|
var _event$payload;
|
|
320
321
|
if ((event === null || event === void 0 ? void 0 : (_event$payload = event.payload) === null || _event$payload === void 0 ? void 0 : _event$payload.isChatHidden) !== undefined) {
|
|
321
|
-
var _props$controlProps10;
|
|
322
|
+
var _props$controlProps10, _window, _window$location;
|
|
322
323
|
if ((_props$controlProps10 = props.controlProps) !== null && _props$controlProps10 !== void 0 && _props$controlProps10.hideStartChatButton) {
|
|
323
324
|
var _event$payload2;
|
|
324
325
|
dispatch({
|
|
@@ -327,9 +328,18 @@ const LiveChatWidgetStateful = props => {
|
|
|
327
328
|
});
|
|
328
329
|
}
|
|
329
330
|
const dateNow = Date.now();
|
|
330
|
-
if (
|
|
331
|
-
|
|
331
|
+
if ((0, _utils.isThisSessionPopout)((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.href)) {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* callInProgress acts as "thread lock" to prevent multiple calls to getConversationDetailsCall,
|
|
337
|
+
* in case of multiple switchs between tabs
|
|
338
|
+
*/
|
|
339
|
+
if (callInProgress.current === false && dateNow - lastLWICheckTimeRef.current > _Constants.Constants.LWICheckOnVisibilityTimeout) {
|
|
332
340
|
lastLWICheckTimeRef.current = dateNow;
|
|
341
|
+
callInProgress.current = true;
|
|
342
|
+
const conversationDetails = await (0, _utils.getConversationDetailsCall)(chatSDK);
|
|
333
343
|
if ((conversationDetails === null || conversationDetails === void 0 ? void 0 : conversationDetails.state) === _Constants.LiveWorkItemState.WrapUp || (conversationDetails === null || conversationDetails === void 0 ? void 0 : conversationDetails.state) === _Constants.LiveWorkItemState.Closed) {
|
|
334
344
|
dispatch({
|
|
335
345
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CHAT_DISCONNECT_EVENT_RECEIVED,
|
|
@@ -340,6 +350,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
340
350
|
Description: "Chat disconnected due to timeout, left or removed."
|
|
341
351
|
});
|
|
342
352
|
}
|
|
353
|
+
callInProgress.current = false;
|
|
343
354
|
}
|
|
344
355
|
}
|
|
345
356
|
});
|
|
@@ -555,17 +566,6 @@ const LiveChatWidgetStateful = props => {
|
|
|
555
566
|
} else {
|
|
556
567
|
setTimeout(() => _ActivityStreamHandler.ActivityStreamHandler.uncork(), 500);
|
|
557
568
|
}
|
|
558
|
-
currentMessageCountRef.current = -1;
|
|
559
|
-
dispatch({
|
|
560
|
-
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_UNREAD_MESSAGE_COUNT,
|
|
561
|
-
payload: 0
|
|
562
|
-
});
|
|
563
|
-
const customEvent = {
|
|
564
|
-
elementType: _omnichannelChatComponents.ElementType.Custom,
|
|
565
|
-
eventName: _TelemetryConstants.BroadcastEvent.UnreadMessageCount,
|
|
566
|
-
payload: 0
|
|
567
|
-
};
|
|
568
|
-
_omnichannelChatComponents.BroadcastService.postMessage(customEvent);
|
|
569
569
|
}, [state.appStates.isMinimized]);
|
|
570
570
|
|
|
571
571
|
// Broadcast the UnreadMessageCount state on any change.
|
|
@@ -578,6 +578,15 @@ const LiveChatWidgetStateful = props => {
|
|
|
578
578
|
};
|
|
579
579
|
_omnichannelChatComponents.BroadcastService.postMessage(customEvent);
|
|
580
580
|
}
|
|
581
|
+
if (state.appStates.unreadMessageCount === 0) {
|
|
582
|
+
currentMessageCountRef.current = -1;
|
|
583
|
+
const customEvent = {
|
|
584
|
+
elementType: _omnichannelChatComponents.ElementType.Custom,
|
|
585
|
+
eventName: _TelemetryConstants.BroadcastEvent.UnreadMessageCount,
|
|
586
|
+
payload: 0
|
|
587
|
+
};
|
|
588
|
+
_omnichannelChatComponents.BroadcastService.postMessage(customEvent);
|
|
589
|
+
}
|
|
581
590
|
}, [state.appStates.unreadMessageCount]);
|
|
582
591
|
(0, _react2.useEffect)(() => {
|
|
583
592
|
var _props$webChatContain4;
|
|
@@ -662,7 +671,11 @@ const LiveChatWidgetStateful = props => {
|
|
|
662
671
|
|
|
663
672
|
// Handle Chat disconnect cases
|
|
664
673
|
(0, _react2.useEffect)(() => {
|
|
665
|
-
(0,
|
|
674
|
+
const inMemoryState = (0, _createReducer.executeReducer)(state, {
|
|
675
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
|
|
676
|
+
payload: null
|
|
677
|
+
});
|
|
678
|
+
(0, _chatDisconnectHelper.handleChatDisconnect)(props, inMemoryState, setWebChatStyles);
|
|
666
679
|
}, [state.appStates.chatDisconnectEventReceived]);
|
|
667
680
|
|
|
668
681
|
// if props state gets updates we need to update the renderingMiddlewareProps in the state
|
|
@@ -761,6 +774,11 @@ const LiveChatWidgetStateful = props => {
|
|
|
761
774
|
.webchat__basic-transcript__activity-markdown-body > :first-child {
|
|
762
775
|
margin-top: 0px;
|
|
763
776
|
}
|
|
777
|
+
.webchat__basic-transcript__activity-markdown-body img.webchat__render-markdown__external-link-icon {
|
|
778
|
+
background-image : url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg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4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjMjEyMTIxIiAvPjwvc3ZnPg==) !important;
|
|
779
|
+
height: .75em;
|
|
780
|
+
margin-left: .25em;
|
|
781
|
+
}
|
|
764
782
|
}
|
|
765
783
|
`), /*#__PURE__*/_react2.default.createElement(_DraggableChatWidget.default, chatWidgetDraggableConfig, /*#__PURE__*/_react2.default.createElement(Composer, _extends({}, webChatProps, {
|
|
766
784
|
userID: userID,
|
|
@@ -185,8 +185,8 @@ const WebChatContainerStateful = props => {
|
|
|
185
185
|
|
|
186
186
|
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp8 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp8 === void 0 ? void 0 : _webChatContainerProp8.buttonWhiteSpace) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.buttonWhiteSpace} !important;}
|
|
187
187
|
|
|
188
|
-
.ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon
|
|
189
|
-
background-image
|
|
188
|
+
.ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon {
|
|
189
|
+
background-image: url(data:image/svg+xml;base64,PHN2ZyB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192
|
filter:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp9 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp9 === void 0 ? void 0 : (_webChatContainerProp10 = _webChatContainerProp9.receivedMessageAnchorStyles) === null || _webChatContainerProp10 === void 0 ? void 0 : _webChatContainerProp10.filter) ?? (_defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === null || _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === void 0 ? void 0 : _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles.filter)};
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _utils = require("../common/utils");
|
|
8
|
+
var _defaultLibraryScripts = _interopRequireDefault(require("../components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
8
10
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
11
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
10
12
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
@@ -12,7 +14,7 @@ class TranscriptHTMLBuilder {
|
|
|
12
14
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
13
15
|
|
|
14
16
|
constructor(options) {
|
|
15
|
-
var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options8, _this$options9, _this$options10, _this$options11;
|
|
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;
|
|
16
18
|
_defineProperty(this, "options", void 0);
|
|
17
19
|
_defineProperty(this, "pageTitle", "Customer Transcript");
|
|
18
20
|
_defineProperty(this, "attachmentMessage", "The following attachment was uploaded during the conversation: ");
|
|
@@ -25,6 +27,7 @@ class TranscriptHTMLBuilder {
|
|
|
25
27
|
_defineProperty(this, "customerAvatarFontColor", "#FFF");
|
|
26
28
|
_defineProperty(this, "disableMarkdownMessageFormatting", false);
|
|
27
29
|
_defineProperty(this, "disableNewLineMarkdownSupport", false);
|
|
30
|
+
_defineProperty(this, "externalScripts", {});
|
|
28
31
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
29
32
|
this.options = options;
|
|
30
33
|
if (!this.options || !this.options.messages) {
|
|
@@ -63,6 +66,9 @@ class TranscriptHTMLBuilder {
|
|
|
63
66
|
if ((_this$options11 = this.options) !== null && _this$options11 !== void 0 && _this$options11.disableNewLineMarkdownSupport) {
|
|
64
67
|
this.disableNewLineMarkdownSupport = this.options.disableNewLineMarkdownSupport;
|
|
65
68
|
}
|
|
69
|
+
if ((_this$options12 = this.options) !== null && _this$options12 !== void 0 && _this$options12.externalScripts) {
|
|
70
|
+
this.externalScripts = this.options.externalScripts;
|
|
71
|
+
}
|
|
66
72
|
}
|
|
67
73
|
createMetaElement() {
|
|
68
74
|
const htmlData = `
|
|
@@ -74,13 +80,44 @@ class TranscriptHTMLBuilder {
|
|
|
74
80
|
const htmlData = `<title> ${this.pageTitle} </title>`;
|
|
75
81
|
return htmlData;
|
|
76
82
|
}
|
|
83
|
+
createScriptElement(src) {
|
|
84
|
+
let integrity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
85
|
+
let crossOrigin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
86
|
+
let referrerPolicy = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
87
|
+
return `<script src="${src}" ${integrity ? `integrity="${integrity}"` : ""} ${crossOrigin ? `crossorigin="${crossOrigin}"` : ""} ${referrerPolicy ? `referrerpolicy="${referrerPolicy}"` : ""}><\/script>`;
|
|
88
|
+
}
|
|
89
|
+
createWebChatScriptElement() {
|
|
90
|
+
var _this$externalScripts, _this$externalScripts2, _this$externalScripts3, _this$externalScripts4, _this$externalScripts5, _this$externalScripts6, _this$externalScripts7, _this$externalScripts8, _this$externalScripts9, _this$externalScripts10;
|
|
91
|
+
return (_this$externalScripts = this.externalScripts) !== null && _this$externalScripts !== void 0 && (_this$externalScripts2 = _this$externalScripts.botframeworkWebChat) !== null && _this$externalScripts2 !== void 0 && _this$externalScripts2.src ? this.createScriptElement((_this$externalScripts3 = this.externalScripts) === null || _this$externalScripts3 === void 0 ? void 0 : (_this$externalScripts4 = _this$externalScripts3.botframeworkWebChat) === null || _this$externalScripts4 === void 0 ? void 0 : _this$externalScripts4.src, (_this$externalScripts5 = this.externalScripts) === null || _this$externalScripts5 === void 0 ? void 0 : (_this$externalScripts6 = _this$externalScripts5.botframeworkWebChat) === null || _this$externalScripts6 === void 0 ? void 0 : _this$externalScripts6.integrity, (_this$externalScripts7 = this.externalScripts) === null || _this$externalScripts7 === void 0 ? void 0 : (_this$externalScripts8 = _this$externalScripts7.botframeworkWebChat) === null || _this$externalScripts8 === void 0 ? void 0 : _this$externalScripts8.crossOrigin, (_this$externalScripts9 = this.externalScripts) === null || _this$externalScripts9 === void 0 ? void 0 : (_this$externalScripts10 = _this$externalScripts9.botframeworkWebChat) === null || _this$externalScripts10 === void 0 ? void 0 : _this$externalScripts10.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.botframeworkWebChat.src);
|
|
92
|
+
}
|
|
93
|
+
createRxJsScriptElement() {
|
|
94
|
+
var _this$externalScripts11, _this$externalScripts12, _this$externalScripts13, _this$externalScripts14, _this$externalScripts15, _this$externalScripts16, _this$externalScripts17, _this$externalScripts18, _this$externalScripts19, _this$externalScripts20;
|
|
95
|
+
return (_this$externalScripts11 = this.externalScripts) !== null && _this$externalScripts11 !== void 0 && (_this$externalScripts12 = _this$externalScripts11.rxJs) !== null && _this$externalScripts12 !== void 0 && _this$externalScripts12.src ? this.createScriptElement((_this$externalScripts13 = this.externalScripts) === null || _this$externalScripts13 === void 0 ? void 0 : (_this$externalScripts14 = _this$externalScripts13.rxJs) === null || _this$externalScripts14 === void 0 ? void 0 : _this$externalScripts14.src, (_this$externalScripts15 = this.externalScripts) === null || _this$externalScripts15 === void 0 ? void 0 : (_this$externalScripts16 = _this$externalScripts15.rxJs) === null || _this$externalScripts16 === void 0 ? void 0 : _this$externalScripts16.integrity, (_this$externalScripts17 = this.externalScripts) === null || _this$externalScripts17 === void 0 ? void 0 : (_this$externalScripts18 = _this$externalScripts17.rxJs) === null || _this$externalScripts18 === void 0 ? void 0 : _this$externalScripts18.crossOrigin, (_this$externalScripts19 = this.externalScripts) === null || _this$externalScripts19 === void 0 ? void 0 : (_this$externalScripts20 = _this$externalScripts19.rxJs) === null || _this$externalScripts20 === void 0 ? void 0 : _this$externalScripts20.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.rxJs.src, _defaultLibraryScripts.default.rxJs.integrity, _defaultLibraryScripts.default.rxJs.crossOrigin, _defaultLibraryScripts.default.rxJs.referrerPolicy);
|
|
96
|
+
}
|
|
97
|
+
createReactScriptElement() {
|
|
98
|
+
var _this$externalScripts21, _this$externalScripts22, _this$externalScripts23, _this$externalScripts24, _this$externalScripts25, _this$externalScripts26, _this$externalScripts27, _this$externalScripts28, _this$externalScripts29, _this$externalScripts30;
|
|
99
|
+
return (_this$externalScripts21 = this.externalScripts) !== null && _this$externalScripts21 !== void 0 && (_this$externalScripts22 = _this$externalScripts21.react) !== null && _this$externalScripts22 !== void 0 && _this$externalScripts22.src ? this.createScriptElement((_this$externalScripts23 = this.externalScripts) === null || _this$externalScripts23 === void 0 ? void 0 : (_this$externalScripts24 = _this$externalScripts23.react) === null || _this$externalScripts24 === void 0 ? void 0 : _this$externalScripts24.src, (_this$externalScripts25 = this.externalScripts) === null || _this$externalScripts25 === void 0 ? void 0 : (_this$externalScripts26 = _this$externalScripts25.react) === null || _this$externalScripts26 === void 0 ? void 0 : _this$externalScripts26.integrity, (_this$externalScripts27 = this.externalScripts) === null || _this$externalScripts27 === void 0 ? void 0 : (_this$externalScripts28 = _this$externalScripts27.react) === null || _this$externalScripts28 === void 0 ? void 0 : _this$externalScripts28.crossOrigin, (_this$externalScripts29 = this.externalScripts) === null || _this$externalScripts29 === void 0 ? void 0 : (_this$externalScripts30 = _this$externalScripts29.react) === null || _this$externalScripts30 === void 0 ? void 0 : _this$externalScripts30.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.react.src);
|
|
100
|
+
}
|
|
101
|
+
createReactDomScriptElement() {
|
|
102
|
+
var _this$externalScripts31, _this$externalScripts32, _this$externalScripts33, _this$externalScripts34, _this$externalScripts35, _this$externalScripts36, _this$externalScripts37, _this$externalScripts38, _this$externalScripts39, _this$externalScripts40, _this$externalScripts41, _this$externalScripts42;
|
|
103
|
+
return (_this$externalScripts31 = this.externalScripts) !== null && _this$externalScripts31 !== void 0 && (_this$externalScripts32 = _this$externalScripts31.reactDom) !== null && _this$externalScripts32 !== void 0 && _this$externalScripts32.src ? this.createScriptElement((_this$externalScripts33 = this.externalScripts) === null || _this$externalScripts33 === void 0 ? void 0 : (_this$externalScripts34 = _this$externalScripts33.reactDom) === null || _this$externalScripts34 === void 0 ? void 0 : _this$externalScripts34.src, (_this$externalScripts35 = this.externalScripts) === null || _this$externalScripts35 === void 0 ? void 0 : (_this$externalScripts36 = _this$externalScripts35.reactDom) === null || _this$externalScripts36 === void 0 ? void 0 : _this$externalScripts36.integrity, (_this$externalScripts37 = this.externalScripts) === null || _this$externalScripts37 === void 0 ? void 0 : (_this$externalScripts38 = _this$externalScripts37.reactDom) === null || _this$externalScripts38 === void 0 ? void 0 : _this$externalScripts38.crossOrigin, (_this$externalScripts39 = this.externalScripts) === null || _this$externalScripts39 === void 0 ? void 0 : (_this$externalScripts40 = _this$externalScripts39.reactDom) === null || _this$externalScripts40 === void 0 ? void 0 : _this$externalScripts40.referrerPolicy) : this.createScriptElement(((_this$externalScripts41 = this.externalScripts) === null || _this$externalScripts41 === void 0 ? void 0 : (_this$externalScripts42 = _this$externalScripts41.reactDom) === null || _this$externalScripts42 === void 0 ? void 0 : _this$externalScripts42.src) ?? _defaultLibraryScripts.default.reactDom.src);
|
|
104
|
+
}
|
|
105
|
+
createMarkdownItScriptElement() {
|
|
106
|
+
var _this$externalScripts43, _this$externalScripts44, _this$externalScripts45, _this$externalScripts46, _this$externalScripts47, _this$externalScripts48, _this$externalScripts49, _this$externalScripts50, _this$externalScripts51, _this$externalScripts52;
|
|
107
|
+
return (_this$externalScripts43 = this.externalScripts) !== null && _this$externalScripts43 !== void 0 && (_this$externalScripts44 = _this$externalScripts43.markdownIt) !== null && _this$externalScripts44 !== void 0 && _this$externalScripts44.src ? this.createScriptElement((_this$externalScripts45 = this.externalScripts) === null || _this$externalScripts45 === void 0 ? void 0 : (_this$externalScripts46 = _this$externalScripts45.markdownIt) === null || _this$externalScripts46 === void 0 ? void 0 : _this$externalScripts46.src, (_this$externalScripts47 = this.externalScripts) === null || _this$externalScripts47 === void 0 ? void 0 : (_this$externalScripts48 = _this$externalScripts47.markdownIt) === null || _this$externalScripts48 === void 0 ? void 0 : _this$externalScripts48.integrity, (_this$externalScripts49 = this.externalScripts) === null || _this$externalScripts49 === void 0 ? void 0 : (_this$externalScripts50 = _this$externalScripts49.markdownIt) === null || _this$externalScripts50 === void 0 ? void 0 : _this$externalScripts50.crossOrigin, (_this$externalScripts51 = this.externalScripts) === null || _this$externalScripts51 === void 0 ? void 0 : (_this$externalScripts52 = _this$externalScripts51.markdownIt) === null || _this$externalScripts52 === void 0 ? void 0 : _this$externalScripts52.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.markdownIt.src, _defaultLibraryScripts.default.markdownIt.integrity, _defaultLibraryScripts.default.markdownIt.crossOrigin);
|
|
108
|
+
}
|
|
77
109
|
createExternalScriptElements() {
|
|
110
|
+
const webChatScript = this.createWebChatScriptElement();
|
|
111
|
+
const rxJsScript = this.createRxJsScriptElement();
|
|
112
|
+
const reactScript = this.createReactScriptElement();
|
|
113
|
+
const reactDomScript = this.createReactDomScriptElement();
|
|
114
|
+
const markdownItScript = this.createMarkdownItScriptElement();
|
|
78
115
|
const htmlData = `
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
116
|
+
${webChatScript}
|
|
117
|
+
${rxJsScript}
|
|
118
|
+
${reactScript}
|
|
119
|
+
${reactDomScript}
|
|
120
|
+
${markdownItScript}
|
|
84
121
|
`;
|
|
85
122
|
return htmlData;
|
|
86
123
|
}
|
package/lib/esm/common/utils.js
CHANGED
|
@@ -2,11 +2,11 @@ var _this = this;
|
|
|
2
2
|
import { AriaTelemetryConstants, Constants, HtmlAttributeNames, LocaleConstants } from "./Constants";
|
|
3
3
|
import { BroadcastEvent, LogLevel, TelemetryEvent } from "./telemetry/TelemetryConstants";
|
|
4
4
|
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
5
|
+
import { ChatSDKErrorName } from "@microsoft/omnichannel-chat-sdk";
|
|
5
6
|
import { DataStoreManager } from "./contextDataStore/DataStoreManager";
|
|
6
7
|
import { KeyCodes } from "./KeyCodes";
|
|
7
8
|
import { Md5 } from "md5-typescript";
|
|
8
9
|
import { TelemetryHelper } from "./telemetry/TelemetryHelper";
|
|
9
|
-
import { ChatSDKErrorName } from "@microsoft/omnichannel-chat-sdk";
|
|
10
10
|
const getElementBySelector = selector => {
|
|
11
11
|
let element;
|
|
12
12
|
if (typeof selector === "string") {
|
|
@@ -349,7 +349,13 @@ export const debounceLeading = function (fn) {
|
|
|
349
349
|
}, ms);
|
|
350
350
|
};
|
|
351
351
|
};
|
|
352
|
-
|
|
352
|
+
export const isThisSessionPopout = href => {
|
|
353
|
+
var _window, _window$location, _window$location$href;
|
|
354
|
+
if (href !== null && href !== void 0 && href.includes("open-in-window=true") && !((_window = window) !== null && _window !== void 0 && (_window$location = _window.location) !== null && _window$location !== void 0 && (_window$location$href = _window$location.href) !== null && _window$location$href !== void 0 && _window$location$href.includes("is-popout-mode=true"))) {
|
|
355
|
+
return true;
|
|
356
|
+
}
|
|
357
|
+
return false;
|
|
358
|
+
};
|
|
353
359
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
354
360
|
export const getConversationDetailsCall = async function (chatSDK) {
|
|
355
361
|
let liveChatContext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
@@ -31,6 +31,14 @@ export const ChatButtonStateful = props => {
|
|
|
31
31
|
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
32
32
|
payload: false
|
|
33
33
|
});
|
|
34
|
+
dispatch({
|
|
35
|
+
type: LiveChatWidgetActionType.SET_UNREAD_MESSAGE_COUNT,
|
|
36
|
+
payload: 0
|
|
37
|
+
});
|
|
38
|
+
// If chat is minimized and then unminimized, start a chat if convesation state is closed.
|
|
39
|
+
if (state.appStates.conversationState === ConversationState.Closed) {
|
|
40
|
+
await startChat();
|
|
41
|
+
}
|
|
34
42
|
} else {
|
|
35
43
|
await startChat();
|
|
36
44
|
}
|
package/lib/esm/components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const defaultLibraryScripts = {
|
|
2
|
+
botframeworkWebChat: {
|
|
3
|
+
src: "https://cdn.botframework.com/botframework-webchat/4.15.7/webchat.js"
|
|
4
|
+
},
|
|
5
|
+
rxJs: {
|
|
6
|
+
src: "https://cdnjs.cloudflare.com/ajax/libs/rxjs/7.8.0/rxjs.umd.min.js",
|
|
7
|
+
integrity: "sha512-v0/YVjBcbjLN6scjmmJN+h86koeB7JhY4/2YeyA5l+rTdtKLv0VbDBNJ32rxJpsaW1QGMd1Z16lsLOSGI38Rbg==",
|
|
8
|
+
crossOrigin: "anonymous",
|
|
9
|
+
referrerPolicy: "no-referrer"
|
|
10
|
+
},
|
|
11
|
+
react: {
|
|
12
|
+
src: "https://unpkg.com/react@18.2.0/umd/react.production.min.js"
|
|
13
|
+
},
|
|
14
|
+
reactDom: {
|
|
15
|
+
src: "https://unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js"
|
|
16
|
+
},
|
|
17
|
+
markdownIt: {
|
|
18
|
+
src: "https://cdn.jsdelivr.net/npm/markdown-it@13.0.1/dist/markdown-it.min.js",
|
|
19
|
+
integrity: "sha256-hNyljag6giCsjv/yKmxK8/VeHzvMDvc5u8AzmRvm1BI=",
|
|
20
|
+
crossOrigin: "anonymous"
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export default defaultLibraryScripts;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -37,6 +37,10 @@ export const HeaderStateful = props => {
|
|
|
37
37
|
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
38
38
|
payload: true
|
|
39
39
|
});
|
|
40
|
+
dispatch({
|
|
41
|
+
type: LiveChatWidgetActionType.SET_UNREAD_MESSAGE_COUNT,
|
|
42
|
+
payload: 0
|
|
43
|
+
});
|
|
40
44
|
},
|
|
41
45
|
onCloseClick: async () => {
|
|
42
46
|
var _props$headerProps, _props$headerProps$co, _props$headerProps$co2;
|
|
@@ -55,12 +55,12 @@ const prepareStartChat = async (props, chatSDK, state, dispatch, setAdapter) =>
|
|
|
55
55
|
|
|
56
56
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
57
|
const setPreChatAndInitiateChat = async (chatSDK, dispatch, setAdapter, isProactiveChat, proactiveChatEnablePrechatState, state, props) => {
|
|
58
|
-
var _props$controlProps;
|
|
58
|
+
var _props$preChatSurveyP, _props$preChatSurveyP2, _props$controlProps;
|
|
59
59
|
//Handle reconnect scenario
|
|
60
60
|
|
|
61
61
|
// Getting prechat Survey Context
|
|
62
62
|
const parseToJson = false;
|
|
63
|
-
const preChatSurveyResponse = await chatSDK.getPreChatSurvey(parseToJson);
|
|
63
|
+
const preChatSurveyResponse = (props === null || props === void 0 ? void 0 : (_props$preChatSurveyP = props.preChatSurveyPaneProps) === null || _props$preChatSurveyP === void 0 ? void 0 : (_props$preChatSurveyP2 = _props$preChatSurveyP.controlProps) === null || _props$preChatSurveyP2 === void 0 ? void 0 : _props$preChatSurveyP2.payload) ?? (await chatSDK.getPreChatSurvey(parseToJson));
|
|
64
64
|
const showPrechat = isProactiveChat ? preChatSurveyResponse && proactiveChatEnablePrechatState : preChatSurveyResponse && !(props !== null && props !== void 0 && (_props$controlProps = props.controlProps) !== null && _props$controlProps !== void 0 && _props$controlProps.hidePreChatSurveyPane);
|
|
65
65
|
if (showPrechat) {
|
|
66
66
|
var _state$domainStates, _state$domainStates$l, _state$domainStates$l2, _state$domainStates$l3;
|
|
@@ -5,12 +5,13 @@ import { Components } from "botframework-webchat";
|
|
|
5
5
|
import { ConfirmationState, Constants, ConversationEndEntity, E2VVOptions, LiveWorkItemState, PrepareEndChatDescriptionConstants, StorageType } from "../../../common/Constants";
|
|
6
6
|
import { Stack } from "@fluentui/react";
|
|
7
7
|
import React, { useEffect, useRef, useState } from "react";
|
|
8
|
+
import { TelemetryManager, TelemetryTimers } from "../../../common/telemetry/TelemetryManager";
|
|
9
|
+
import { chatSDKStateCleanUp, endChat, endChatStateCleanUp, prepareEndChat } from "../common/endChat";
|
|
8
10
|
import { checkIfConversationStillValid, initStartChat, prepareStartChat, setPreChatAndInitiateChat } from "../common/startChat";
|
|
9
|
-
import { createTimer, getBroadcastChannelName, getConversationDetailsCall, getLocaleDirection, getStateFromCache, getWidgetCacheIdfromProps, getWidgetEndChatEventName, isNullOrEmptyString, isNullOrUndefined, isUndefinedOrEmpty, setOcUserAgent } from "../../../common/utils";
|
|
11
|
+
import { createTimer, getBroadcastChannelName, getConversationDetailsCall, getLocaleDirection, getStateFromCache, getWidgetCacheIdfromProps, getWidgetEndChatEventName, isNullOrEmptyString, isNullOrUndefined, isThisSessionPopout, isUndefinedOrEmpty, setOcUserAgent } from "../../../common/utils";
|
|
10
12
|
import { defaultClientDataStoreProvider, isCookieAllowed } from "../../../common/storage/default/defaultClientDataStoreProvider";
|
|
11
|
-
import { chatSDKStateCleanUp, endChat, endChatStateCleanUp, prepareEndChat } from "../common/endChat";
|
|
12
13
|
import { handleChatReconnect, isPersistentEnabled, isReconnectEnabled } from "../common/reconnectChatHelper";
|
|
13
|
-
import { shouldShowCallingContainer, shouldShowChatButton, shouldShowConfirmationPane, shouldShowEmailTranscriptPane,
|
|
14
|
+
import { shouldShowCallingContainer, shouldShowChatButton, shouldShowConfirmationPane, shouldShowEmailTranscriptPane, shouldShowHeader, shouldShowLoadingPane, shouldShowOutOfOfficeHoursPane, shouldShowPostChatLoadingPane, shouldShowPostChatSurveyPane, shouldShowPreChatSurveyPane, shouldShowProactiveChatPane, shouldShowReconnectChatPane, shouldShowStartChatErrorPane, shouldShowWebChatContainer } from "../../../controller/componentController";
|
|
14
15
|
import { ActivityStreamHandler } from "../common/ActivityStreamHandler";
|
|
15
16
|
import CallingContainerStateful from "../../callingcontainerstateful/CallingContainerStateful";
|
|
16
17
|
import ChatButtonStateful from "../../chatbuttonstateful/ChatButtonStateful";
|
|
@@ -29,15 +30,18 @@ import PostChatSurveyPaneStateful from "../../postchatsurveypanestateful/PostCha
|
|
|
29
30
|
import PreChatSurveyPaneStateful from "../../prechatsurveypanestateful/PreChatSurveyPaneStateful";
|
|
30
31
|
import ProactiveChatPaneStateful from "../../proactivechatpanestateful/ProactiveChatPaneStateful";
|
|
31
32
|
import ReconnectChatPaneStateful from "../../reconnectchatpanestateful/ReconnectChatPaneStateful";
|
|
33
|
+
import StartChatErrorPaneStateful from "../../startchaterrorpanestateful/StartChatErrorPaneStateful";
|
|
34
|
+
import { StartChatFailureType } from "../../../contexts/common/StartChatFailureType";
|
|
32
35
|
import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
|
|
33
|
-
import { TelemetryManager, TelemetryTimers } from "../../../common/telemetry/TelemetryManager";
|
|
34
36
|
import WebChatContainerStateful from "../../webchatcontainerstateful/WebChatContainerStateful";
|
|
35
37
|
import createDownloadTranscriptProps from "../common/createDownloadTranscriptProps";
|
|
36
38
|
import { createFooter } from "../common/createFooter";
|
|
37
39
|
import { createInternetConnectionChangeHandler } from "../common/createInternetConnectionChangeHandler";
|
|
40
|
+
import { defaultAdaptiveCardStyles } from "../../webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles";
|
|
38
41
|
import { defaultScrollBarProps } from "../common/defaultProps/defaultScrollBarProps";
|
|
39
42
|
import { defaultWebChatContainerStatefulProps } from "../../webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps";
|
|
40
43
|
import { disposeTelemetryLoggers } from "../common/disposeTelemetryLoggers";
|
|
44
|
+
import { executeReducer } from "../../../contexts/createReducer";
|
|
41
45
|
import { getGeneralStylesForButton } from "../common/getGeneralStylesForButton";
|
|
42
46
|
import { handleChatDisconnect } from "../common/chatDisconnectHelper";
|
|
43
47
|
import { initCallingSdk } from "../common/initCallingSdk";
|
|
@@ -50,10 +54,6 @@ import { startProactiveChat } from "../common/startProactiveChat";
|
|
|
50
54
|
import useChatAdapterStore from "../../../hooks/useChatAdapterStore";
|
|
51
55
|
import useChatContextStore from "../../../hooks/useChatContextStore";
|
|
52
56
|
import useChatSDKStore from "../../../hooks/useChatSDKStore";
|
|
53
|
-
import { defaultAdaptiveCardStyles } from "../../webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles";
|
|
54
|
-
import StartChatErrorPaneStateful from "../../startchaterrorpanestateful/StartChatErrorPaneStateful";
|
|
55
|
-
import { StartChatFailureType } from "../../../contexts/common/StartChatFailureType";
|
|
56
|
-
import { executeReducer } from "../../../contexts/createReducer";
|
|
57
57
|
export const LiveChatWidgetStateful = props => {
|
|
58
58
|
var _props$webChatContain, _props$styleProps, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain5, _state$appStates14, _props$webChatContain7, _props$webChatContain8, _props$controlProps12, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _livechatProps$webCha, _props$webChatContain9, _props$webChatContain10, _props$webChatContain11, _props$webChatContain12, _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$compon8, _livechatProps$contro10, _livechatProps$contro11, _livechatProps$compon9, _livechatProps$contro12, _livechatProps$compon10, _livechatProps$contro13, _livechatProps$compon11, _livechatProps$compon12, _livechatProps$compon13;
|
|
59
59
|
const [state, dispatch] = useChatContextStore();
|
|
@@ -91,6 +91,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
91
91
|
const currentMessageCountRef = useRef(0);
|
|
92
92
|
let widgetStateEventId = "";
|
|
93
93
|
const lastLWICheckTimeRef = useRef(0);
|
|
94
|
+
const callInProgress = useRef(false);
|
|
94
95
|
let optionalParams;
|
|
95
96
|
let activeCachedChatExist = false;
|
|
96
97
|
const setOptionalParams = () => {
|
|
@@ -310,7 +311,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
310
311
|
BroadcastService.getMessageByEventName(BroadcastEvent.HideChatVisibilityChangeEvent).subscribe(async event => {
|
|
311
312
|
var _event$payload;
|
|
312
313
|
if ((event === null || event === void 0 ? void 0 : (_event$payload = event.payload) === null || _event$payload === void 0 ? void 0 : _event$payload.isChatHidden) !== undefined) {
|
|
313
|
-
var _props$controlProps10;
|
|
314
|
+
var _props$controlProps10, _window, _window$location;
|
|
314
315
|
if ((_props$controlProps10 = props.controlProps) !== null && _props$controlProps10 !== void 0 && _props$controlProps10.hideStartChatButton) {
|
|
315
316
|
var _event$payload2;
|
|
316
317
|
dispatch({
|
|
@@ -319,9 +320,18 @@ export const LiveChatWidgetStateful = props => {
|
|
|
319
320
|
});
|
|
320
321
|
}
|
|
321
322
|
const dateNow = Date.now();
|
|
322
|
-
if (
|
|
323
|
-
|
|
323
|
+
if (isThisSessionPopout((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.href)) {
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* callInProgress acts as "thread lock" to prevent multiple calls to getConversationDetailsCall,
|
|
329
|
+
* in case of multiple switchs between tabs
|
|
330
|
+
*/
|
|
331
|
+
if (callInProgress.current === false && dateNow - lastLWICheckTimeRef.current > Constants.LWICheckOnVisibilityTimeout) {
|
|
324
332
|
lastLWICheckTimeRef.current = dateNow;
|
|
333
|
+
callInProgress.current = true;
|
|
334
|
+
const conversationDetails = await getConversationDetailsCall(chatSDK);
|
|
325
335
|
if ((conversationDetails === null || conversationDetails === void 0 ? void 0 : conversationDetails.state) === LiveWorkItemState.WrapUp || (conversationDetails === null || conversationDetails === void 0 ? void 0 : conversationDetails.state) === LiveWorkItemState.Closed) {
|
|
326
336
|
dispatch({
|
|
327
337
|
type: LiveChatWidgetActionType.SET_CHAT_DISCONNECT_EVENT_RECEIVED,
|
|
@@ -332,6 +342,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
332
342
|
Description: "Chat disconnected due to timeout, left or removed."
|
|
333
343
|
});
|
|
334
344
|
}
|
|
345
|
+
callInProgress.current = false;
|
|
335
346
|
}
|
|
336
347
|
}
|
|
337
348
|
});
|
|
@@ -547,17 +558,6 @@ export const LiveChatWidgetStateful = props => {
|
|
|
547
558
|
} else {
|
|
548
559
|
setTimeout(() => ActivityStreamHandler.uncork(), 500);
|
|
549
560
|
}
|
|
550
|
-
currentMessageCountRef.current = -1;
|
|
551
|
-
dispatch({
|
|
552
|
-
type: LiveChatWidgetActionType.SET_UNREAD_MESSAGE_COUNT,
|
|
553
|
-
payload: 0
|
|
554
|
-
});
|
|
555
|
-
const customEvent = {
|
|
556
|
-
elementType: ElementType.Custom,
|
|
557
|
-
eventName: BroadcastEvent.UnreadMessageCount,
|
|
558
|
-
payload: 0
|
|
559
|
-
};
|
|
560
|
-
BroadcastService.postMessage(customEvent);
|
|
561
561
|
}, [state.appStates.isMinimized]);
|
|
562
562
|
|
|
563
563
|
// Broadcast the UnreadMessageCount state on any change.
|
|
@@ -570,6 +570,15 @@ export const LiveChatWidgetStateful = props => {
|
|
|
570
570
|
};
|
|
571
571
|
BroadcastService.postMessage(customEvent);
|
|
572
572
|
}
|
|
573
|
+
if (state.appStates.unreadMessageCount === 0) {
|
|
574
|
+
currentMessageCountRef.current = -1;
|
|
575
|
+
const customEvent = {
|
|
576
|
+
elementType: ElementType.Custom,
|
|
577
|
+
eventName: BroadcastEvent.UnreadMessageCount,
|
|
578
|
+
payload: 0
|
|
579
|
+
};
|
|
580
|
+
BroadcastService.postMessage(customEvent);
|
|
581
|
+
}
|
|
573
582
|
}, [state.appStates.unreadMessageCount]);
|
|
574
583
|
useEffect(() => {
|
|
575
584
|
var _props$webChatContain4;
|
|
@@ -654,7 +663,11 @@ export const LiveChatWidgetStateful = props => {
|
|
|
654
663
|
|
|
655
664
|
// Handle Chat disconnect cases
|
|
656
665
|
useEffect(() => {
|
|
657
|
-
|
|
666
|
+
const inMemoryState = executeReducer(state, {
|
|
667
|
+
type: LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
|
|
668
|
+
payload: null
|
|
669
|
+
});
|
|
670
|
+
handleChatDisconnect(props, inMemoryState, setWebChatStyles);
|
|
658
671
|
}, [state.appStates.chatDisconnectEventReceived]);
|
|
659
672
|
|
|
660
673
|
// if props state gets updates we need to update the renderingMiddlewareProps in the state
|
|
@@ -753,6 +766,11 @@ export const LiveChatWidgetStateful = props => {
|
|
|
753
766
|
.webchat__basic-transcript__activity-markdown-body > :first-child {
|
|
754
767
|
margin-top: 0px;
|
|
755
768
|
}
|
|
769
|
+
.webchat__basic-transcript__activity-markdown-body img.webchat__render-markdown__external-link-icon {
|
|
770
|
+
background-image : url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg5MjNMMTcuOTk4NyAxNi43Mzg0VjEzLjIzMjFDMTcuOTk4NyAxMi44MTc5IDE4LjMzNDUgMTIuNDgyMSAxOC43NDg3IDEyLjQ4MjFDMTkuMTI4NCAxMi40ODIxIDE5LjQ0MjIgMTIuNzY0MyAxOS40OTE4IDEzLjEzMDNMMTkuNDk4NyAxMy4yMzIxVjE2LjczODRDMTkuNDk4NyAxOC43NDA3IDE3LjkyOTMgMjAuMzc2OSAxNS45NTI4IDIwLjQ4MjlMMTUuNzUzOCAyMC40ODg0TDcuMjU4MjcgMjAuNTAwMUw3LjA1NDk1IDIwL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kMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjMjEyMTIxIiAvPjwvc3ZnPg==) !important;
|
|
771
|
+
height: .75em;
|
|
772
|
+
margin-left: .25em;
|
|
773
|
+
}
|
|
756
774
|
}
|
|
757
775
|
`), /*#__PURE__*/React.createElement(DraggableChatWidget, chatWidgetDraggableConfig, /*#__PURE__*/React.createElement(Composer, _extends({}, webChatProps, {
|
|
758
776
|
userID: userID,
|
|
@@ -177,8 +177,8 @@ export const WebChatContainerStateful = props => {
|
|
|
177
177
|
|
|
178
178
|
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp8 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp8 === void 0 ? void 0 : _webChatContainerProp8.buttonWhiteSpace) ?? defaultAdaptiveCardStyles.buttonWhiteSpace} !important;}
|
|
179
179
|
|
|
180
|
-
.ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon
|
|
181
|
-
background-image
|
|
180
|
+
.ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon {
|
|
181
|
+
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03LjI1MDEgNC41MDAxN0gxMC43NDk1QzExLjE2MzcgNC41MDAxNyAxMS40OTk1IDQuODM1OTYgMTEuNDk5NSA1LjI1MDE3QzExLjQ5OTUgNS42Mjk4NiAxMS4yMTczIDUuOTQzNjYgMTAuODUxMyA1Ljk5MzMyTDEwLjc0OTUgNi4wMDAxN0g3LjI0OTc0QzYuMDcwNzkgNS45OTk2MSA1LjEwMzQ5IDYuOTA2NTYgNS4wMDc4NiA4LjA2MTEyTDUuMDAwMj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IDMuNjI4NjJMMjAuOTk5MiAzLjcyMjgyTDIwLjk5OTcgMTAuMjU1NEMyMC45OTk3IDEwLjY2OTYgMjAuNjYzOSAxMS4wMDU0IDIwLjI0OTcgMTEuMDA1NEMxOS44NyAxMS4wMDU0IDE5LjU1NjIgMTAuNzIzMiAxOS41MDY1IDEwLjM1NzFMMTkuNDk5NyAxMC4yNTU0TDE5LjQ5ODkgNS41NjE0N0wxMi4yNzk3IDEyLjc4NDdDMTIuMDEzNCAxMy4wNTEgMTEuNTk2OCAxMy4wNzUzIDExLjMwMzEgMTIuODU3NUwxMS4yMTkgMTIuNzg0OUMxMC45NTI3IDEyLjUxODcgMTAuOTI4NCAxMi4xMDIxIDExLjE0NjIgMTEuODA4NEwxMS4yMTg4IDExLjcyNDNMMTguNDM2OSA0LjUwMTQ2SDEzLjc0ODFDMTMuMzY4NCA0LjUwMTQ2IDEzLjA1NDYgNC4yMTkzMSAxMy4wMDUgMy44NTMyNEwxMi45OTgxIDMuNzUxNDZDMTIuOTk4MSAzLjM3MTc3IDEzLjI4MDMgMy4wNTc5NyAxMy42NDY0IDMuMDA4MzFMMTMuNzQ4MSAzLjAwMTQ2WiIgZmlsbD0iI0ZGRkZGRiIgLz48L3N2Zz4) !important;
|
|
182
182
|
height: .75em;
|
|
183
183
|
margin-left: .25em;
|
|
184
184
|
filter:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp9 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp9 === void 0 ? void 0 : (_webChatContainerProp10 = _webChatContainerProp9.receivedMessageAnchorStyles) === null || _webChatContainerProp10 === void 0 ? void 0 : _webChatContainerProp10.filter) ?? (defaultReceivedMessageAnchorStyles === null || defaultReceivedMessageAnchorStyles === void 0 ? void 0 : defaultReceivedMessageAnchorStyles.filter)};
|
|
@@ -4,11 +4,12 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
|
4
4
|
/* eslint-disable no-useless-escape */
|
|
5
5
|
|
|
6
6
|
import { createFileAndDownload } from "../common/utils";
|
|
7
|
+
import defaultLibraryScripts from "../components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts";
|
|
7
8
|
class TranscriptHTMLBuilder {
|
|
8
9
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
9
10
|
|
|
10
11
|
constructor(options) {
|
|
11
|
-
var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options8, _this$options9, _this$options10, _this$options11;
|
|
12
|
+
var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options8, _this$options9, _this$options10, _this$options11, _this$options12;
|
|
12
13
|
_defineProperty(this, "options", void 0);
|
|
13
14
|
_defineProperty(this, "pageTitle", "Customer Transcript");
|
|
14
15
|
_defineProperty(this, "attachmentMessage", "The following attachment was uploaded during the conversation: ");
|
|
@@ -21,6 +22,7 @@ class TranscriptHTMLBuilder {
|
|
|
21
22
|
_defineProperty(this, "customerAvatarFontColor", "#FFF");
|
|
22
23
|
_defineProperty(this, "disableMarkdownMessageFormatting", false);
|
|
23
24
|
_defineProperty(this, "disableNewLineMarkdownSupport", false);
|
|
25
|
+
_defineProperty(this, "externalScripts", {});
|
|
24
26
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
25
27
|
this.options = options;
|
|
26
28
|
if (!this.options || !this.options.messages) {
|
|
@@ -59,6 +61,9 @@ class TranscriptHTMLBuilder {
|
|
|
59
61
|
if ((_this$options11 = this.options) !== null && _this$options11 !== void 0 && _this$options11.disableNewLineMarkdownSupport) {
|
|
60
62
|
this.disableNewLineMarkdownSupport = this.options.disableNewLineMarkdownSupport;
|
|
61
63
|
}
|
|
64
|
+
if ((_this$options12 = this.options) !== null && _this$options12 !== void 0 && _this$options12.externalScripts) {
|
|
65
|
+
this.externalScripts = this.options.externalScripts;
|
|
66
|
+
}
|
|
62
67
|
}
|
|
63
68
|
createMetaElement() {
|
|
64
69
|
const htmlData = `
|
|
@@ -70,13 +75,44 @@ class TranscriptHTMLBuilder {
|
|
|
70
75
|
const htmlData = `<title> ${this.pageTitle} </title>`;
|
|
71
76
|
return htmlData;
|
|
72
77
|
}
|
|
78
|
+
createScriptElement(src) {
|
|
79
|
+
let integrity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
80
|
+
let crossOrigin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
81
|
+
let referrerPolicy = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
82
|
+
return `<script src="${src}" ${integrity ? `integrity="${integrity}"` : ""} ${crossOrigin ? `crossorigin="${crossOrigin}"` : ""} ${referrerPolicy ? `referrerpolicy="${referrerPolicy}"` : ""}><\/script>`;
|
|
83
|
+
}
|
|
84
|
+
createWebChatScriptElement() {
|
|
85
|
+
var _this$externalScripts, _this$externalScripts2, _this$externalScripts3, _this$externalScripts4, _this$externalScripts5, _this$externalScripts6, _this$externalScripts7, _this$externalScripts8, _this$externalScripts9, _this$externalScripts10;
|
|
86
|
+
return (_this$externalScripts = this.externalScripts) !== null && _this$externalScripts !== void 0 && (_this$externalScripts2 = _this$externalScripts.botframeworkWebChat) !== null && _this$externalScripts2 !== void 0 && _this$externalScripts2.src ? this.createScriptElement((_this$externalScripts3 = this.externalScripts) === null || _this$externalScripts3 === void 0 ? void 0 : (_this$externalScripts4 = _this$externalScripts3.botframeworkWebChat) === null || _this$externalScripts4 === void 0 ? void 0 : _this$externalScripts4.src, (_this$externalScripts5 = this.externalScripts) === null || _this$externalScripts5 === void 0 ? void 0 : (_this$externalScripts6 = _this$externalScripts5.botframeworkWebChat) === null || _this$externalScripts6 === void 0 ? void 0 : _this$externalScripts6.integrity, (_this$externalScripts7 = this.externalScripts) === null || _this$externalScripts7 === void 0 ? void 0 : (_this$externalScripts8 = _this$externalScripts7.botframeworkWebChat) === null || _this$externalScripts8 === void 0 ? void 0 : _this$externalScripts8.crossOrigin, (_this$externalScripts9 = this.externalScripts) === null || _this$externalScripts9 === void 0 ? void 0 : (_this$externalScripts10 = _this$externalScripts9.botframeworkWebChat) === null || _this$externalScripts10 === void 0 ? void 0 : _this$externalScripts10.referrerPolicy) : this.createScriptElement(defaultLibraryScripts.botframeworkWebChat.src);
|
|
87
|
+
}
|
|
88
|
+
createRxJsScriptElement() {
|
|
89
|
+
var _this$externalScripts11, _this$externalScripts12, _this$externalScripts13, _this$externalScripts14, _this$externalScripts15, _this$externalScripts16, _this$externalScripts17, _this$externalScripts18, _this$externalScripts19, _this$externalScripts20;
|
|
90
|
+
return (_this$externalScripts11 = this.externalScripts) !== null && _this$externalScripts11 !== void 0 && (_this$externalScripts12 = _this$externalScripts11.rxJs) !== null && _this$externalScripts12 !== void 0 && _this$externalScripts12.src ? this.createScriptElement((_this$externalScripts13 = this.externalScripts) === null || _this$externalScripts13 === void 0 ? void 0 : (_this$externalScripts14 = _this$externalScripts13.rxJs) === null || _this$externalScripts14 === void 0 ? void 0 : _this$externalScripts14.src, (_this$externalScripts15 = this.externalScripts) === null || _this$externalScripts15 === void 0 ? void 0 : (_this$externalScripts16 = _this$externalScripts15.rxJs) === null || _this$externalScripts16 === void 0 ? void 0 : _this$externalScripts16.integrity, (_this$externalScripts17 = this.externalScripts) === null || _this$externalScripts17 === void 0 ? void 0 : (_this$externalScripts18 = _this$externalScripts17.rxJs) === null || _this$externalScripts18 === void 0 ? void 0 : _this$externalScripts18.crossOrigin, (_this$externalScripts19 = this.externalScripts) === null || _this$externalScripts19 === void 0 ? void 0 : (_this$externalScripts20 = _this$externalScripts19.rxJs) === null || _this$externalScripts20 === void 0 ? void 0 : _this$externalScripts20.referrerPolicy) : this.createScriptElement(defaultLibraryScripts.rxJs.src, defaultLibraryScripts.rxJs.integrity, defaultLibraryScripts.rxJs.crossOrigin, defaultLibraryScripts.rxJs.referrerPolicy);
|
|
91
|
+
}
|
|
92
|
+
createReactScriptElement() {
|
|
93
|
+
var _this$externalScripts21, _this$externalScripts22, _this$externalScripts23, _this$externalScripts24, _this$externalScripts25, _this$externalScripts26, _this$externalScripts27, _this$externalScripts28, _this$externalScripts29, _this$externalScripts30;
|
|
94
|
+
return (_this$externalScripts21 = this.externalScripts) !== null && _this$externalScripts21 !== void 0 && (_this$externalScripts22 = _this$externalScripts21.react) !== null && _this$externalScripts22 !== void 0 && _this$externalScripts22.src ? this.createScriptElement((_this$externalScripts23 = this.externalScripts) === null || _this$externalScripts23 === void 0 ? void 0 : (_this$externalScripts24 = _this$externalScripts23.react) === null || _this$externalScripts24 === void 0 ? void 0 : _this$externalScripts24.src, (_this$externalScripts25 = this.externalScripts) === null || _this$externalScripts25 === void 0 ? void 0 : (_this$externalScripts26 = _this$externalScripts25.react) === null || _this$externalScripts26 === void 0 ? void 0 : _this$externalScripts26.integrity, (_this$externalScripts27 = this.externalScripts) === null || _this$externalScripts27 === void 0 ? void 0 : (_this$externalScripts28 = _this$externalScripts27.react) === null || _this$externalScripts28 === void 0 ? void 0 : _this$externalScripts28.crossOrigin, (_this$externalScripts29 = this.externalScripts) === null || _this$externalScripts29 === void 0 ? void 0 : (_this$externalScripts30 = _this$externalScripts29.react) === null || _this$externalScripts30 === void 0 ? void 0 : _this$externalScripts30.referrerPolicy) : this.createScriptElement(defaultLibraryScripts.react.src);
|
|
95
|
+
}
|
|
96
|
+
createReactDomScriptElement() {
|
|
97
|
+
var _this$externalScripts31, _this$externalScripts32, _this$externalScripts33, _this$externalScripts34, _this$externalScripts35, _this$externalScripts36, _this$externalScripts37, _this$externalScripts38, _this$externalScripts39, _this$externalScripts40, _this$externalScripts41, _this$externalScripts42;
|
|
98
|
+
return (_this$externalScripts31 = this.externalScripts) !== null && _this$externalScripts31 !== void 0 && (_this$externalScripts32 = _this$externalScripts31.reactDom) !== null && _this$externalScripts32 !== void 0 && _this$externalScripts32.src ? this.createScriptElement((_this$externalScripts33 = this.externalScripts) === null || _this$externalScripts33 === void 0 ? void 0 : (_this$externalScripts34 = _this$externalScripts33.reactDom) === null || _this$externalScripts34 === void 0 ? void 0 : _this$externalScripts34.src, (_this$externalScripts35 = this.externalScripts) === null || _this$externalScripts35 === void 0 ? void 0 : (_this$externalScripts36 = _this$externalScripts35.reactDom) === null || _this$externalScripts36 === void 0 ? void 0 : _this$externalScripts36.integrity, (_this$externalScripts37 = this.externalScripts) === null || _this$externalScripts37 === void 0 ? void 0 : (_this$externalScripts38 = _this$externalScripts37.reactDom) === null || _this$externalScripts38 === void 0 ? void 0 : _this$externalScripts38.crossOrigin, (_this$externalScripts39 = this.externalScripts) === null || _this$externalScripts39 === void 0 ? void 0 : (_this$externalScripts40 = _this$externalScripts39.reactDom) === null || _this$externalScripts40 === void 0 ? void 0 : _this$externalScripts40.referrerPolicy) : this.createScriptElement(((_this$externalScripts41 = this.externalScripts) === null || _this$externalScripts41 === void 0 ? void 0 : (_this$externalScripts42 = _this$externalScripts41.reactDom) === null || _this$externalScripts42 === void 0 ? void 0 : _this$externalScripts42.src) ?? defaultLibraryScripts.reactDom.src);
|
|
99
|
+
}
|
|
100
|
+
createMarkdownItScriptElement() {
|
|
101
|
+
var _this$externalScripts43, _this$externalScripts44, _this$externalScripts45, _this$externalScripts46, _this$externalScripts47, _this$externalScripts48, _this$externalScripts49, _this$externalScripts50, _this$externalScripts51, _this$externalScripts52;
|
|
102
|
+
return (_this$externalScripts43 = this.externalScripts) !== null && _this$externalScripts43 !== void 0 && (_this$externalScripts44 = _this$externalScripts43.markdownIt) !== null && _this$externalScripts44 !== void 0 && _this$externalScripts44.src ? this.createScriptElement((_this$externalScripts45 = this.externalScripts) === null || _this$externalScripts45 === void 0 ? void 0 : (_this$externalScripts46 = _this$externalScripts45.markdownIt) === null || _this$externalScripts46 === void 0 ? void 0 : _this$externalScripts46.src, (_this$externalScripts47 = this.externalScripts) === null || _this$externalScripts47 === void 0 ? void 0 : (_this$externalScripts48 = _this$externalScripts47.markdownIt) === null || _this$externalScripts48 === void 0 ? void 0 : _this$externalScripts48.integrity, (_this$externalScripts49 = this.externalScripts) === null || _this$externalScripts49 === void 0 ? void 0 : (_this$externalScripts50 = _this$externalScripts49.markdownIt) === null || _this$externalScripts50 === void 0 ? void 0 : _this$externalScripts50.crossOrigin, (_this$externalScripts51 = this.externalScripts) === null || _this$externalScripts51 === void 0 ? void 0 : (_this$externalScripts52 = _this$externalScripts51.markdownIt) === null || _this$externalScripts52 === void 0 ? void 0 : _this$externalScripts52.referrerPolicy) : this.createScriptElement(defaultLibraryScripts.markdownIt.src, defaultLibraryScripts.markdownIt.integrity, defaultLibraryScripts.markdownIt.crossOrigin);
|
|
103
|
+
}
|
|
73
104
|
createExternalScriptElements() {
|
|
105
|
+
const webChatScript = this.createWebChatScriptElement();
|
|
106
|
+
const rxJsScript = this.createRxJsScriptElement();
|
|
107
|
+
const reactScript = this.createReactScriptElement();
|
|
108
|
+
const reactDomScript = this.createReactDomScriptElement();
|
|
109
|
+
const markdownItScript = this.createMarkdownItScriptElement();
|
|
74
110
|
const htmlData = `
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
111
|
+
${webChatScript}
|
|
112
|
+
${rxJsScript}
|
|
113
|
+
${reactScript}
|
|
114
|
+
${reactDomScript}
|
|
115
|
+
${markdownItScript}
|
|
80
116
|
`;
|
|
81
117
|
return htmlData;
|
|
82
118
|
}
|
|
@@ -30,6 +30,7 @@ export declare const addDelayInMs: (ms: number) => Promise<void>;
|
|
|
30
30
|
export declare const getBroadcastChannelName: (widgetId: string, widgetInstanceId: string) => string;
|
|
31
31
|
export declare const getWidgetCacheIdfromProps: (props: any, popoutChat?: boolean) => string;
|
|
32
32
|
export declare const debounceLeading: (fn: any, ms?: number) => (...args: any[]) => void;
|
|
33
|
+
export declare const isThisSessionPopout: (href: string) => boolean;
|
|
33
34
|
export declare const getConversationDetailsCall: (chatSDK: any, liveChatContext?: any) => Promise<any>;
|
|
34
35
|
export declare const checkContactIdError: (e: any) => void;
|
|
35
36
|
export declare const createFileAndDownload: (fileName: string, blobData: string, mimeType: string) => void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const defaultLibraryScripts: {
|
|
2
|
+
botframeworkWebChat: {
|
|
3
|
+
src: string;
|
|
4
|
+
};
|
|
5
|
+
rxJs: {
|
|
6
|
+
src: string;
|
|
7
|
+
integrity: string;
|
|
8
|
+
crossOrigin: string;
|
|
9
|
+
referrerPolicy: string;
|
|
10
|
+
};
|
|
11
|
+
react: {
|
|
12
|
+
src: string;
|
|
13
|
+
};
|
|
14
|
+
reactDom: {
|
|
15
|
+
src: string;
|
|
16
|
+
};
|
|
17
|
+
markdownIt: {
|
|
18
|
+
src: string;
|
|
19
|
+
integrity: string;
|
|
20
|
+
crossOrigin: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default defaultLibraryScripts;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
interface TranscriptHtmlScripts {
|
|
2
|
+
botframeworkWebChat?: {
|
|
3
|
+
src?: string;
|
|
4
|
+
integrity?: string;
|
|
5
|
+
crossOrigin?: string;
|
|
6
|
+
referrerPolicy?: string;
|
|
7
|
+
};
|
|
8
|
+
rxJs?: {
|
|
9
|
+
src?: string;
|
|
10
|
+
integrity?: string;
|
|
11
|
+
crossOrigin?: string;
|
|
12
|
+
referrerPolicy?: string;
|
|
13
|
+
};
|
|
14
|
+
react?: {
|
|
15
|
+
src?: string;
|
|
16
|
+
integrity?: string;
|
|
17
|
+
crossOrigin?: string;
|
|
18
|
+
referrerPolicy?: string;
|
|
19
|
+
};
|
|
20
|
+
reactDom?: {
|
|
21
|
+
src?: string;
|
|
22
|
+
integrity?: string;
|
|
23
|
+
crossOrigin?: string;
|
|
24
|
+
referrerPolicy?: string;
|
|
25
|
+
};
|
|
26
|
+
markdownIt?: {
|
|
27
|
+
src?: string;
|
|
28
|
+
integrity?: string;
|
|
29
|
+
crossOrigin?: string;
|
|
30
|
+
referrerPolicy?: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export default TranscriptHtmlScripts;
|