@microsoft/omnichannel-chat-widget 0.1.0-main.cf54410 → 0.1.0-main.d48dae2
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/README.md +259 -0
- package/lib/cjs/assets/Audios.js +8 -0
- package/lib/cjs/assets/Icons.js +28 -0
- package/lib/cjs/common/Constants.js +52 -6
- package/lib/cjs/common/telemetry/TelemetryConstants.js +61 -5
- package/lib/cjs/common/telemetry/TelemetryHelper.js +13 -0
- package/lib/cjs/common/telemetry/TelemetryManager.js +17 -6
- package/lib/cjs/common/telemetry/defaultConfigs/defaultAriaConfig.js +1 -1
- package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
- package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +33 -13
- package/lib/cjs/common/telemetry/loggers/consoleLogger.js +6 -5
- package/lib/cjs/common/utils.js +76 -2
- package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +14 -0
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +20 -4
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -42
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -2
- package/lib/cjs/components/footerstateful/FooterStateful.js +4 -5
- package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +11 -2
- package/lib/cjs/components/headerstateful/HeaderStateful.js +13 -10
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +23 -0
- package/lib/cjs/{assets/assets.d.js → components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js} +0 -0
- package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +70 -0
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +10 -1
- package/lib/cjs/components/livechatwidget/common/createMarkdown.js +32 -32
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +25 -24
- package/lib/cjs/components/livechatwidget/common/endChat.js +142 -51
- package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +5 -0
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +47 -9
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +115 -22
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +6 -17
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +6 -9
- package/lib/cjs/components/livechatwidget/common/shareObservable.js +45 -0
- package/lib/cjs/components/livechatwidget/common/startChat.js +176 -57
- package/lib/cjs/components/livechatwidget/common/startProactiveChat.js +3 -3
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +246 -78
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
- package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +8 -0
- package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +8 -0
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +8 -13
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +27 -5
- package/lib/cjs/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +80 -0
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +6 -0
- package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +51 -73
- package/lib/cjs/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +14 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +25 -48
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +52 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +98 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +117 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +6 -6
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +45 -0
- package/lib/cjs/contexts/common/ConversationState.js +4 -2
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +9 -7
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +8 -3
- package/lib/cjs/contexts/createReducer.js +16 -10
- package/lib/cjs/controller/componentController.js +5 -5
- package/lib/cjs/plugins/newMessageEventHandler.js +99 -0
- package/lib/esm/assets/Audios.js +1 -0
- package/lib/esm/assets/Icons.js +11 -0
- package/lib/esm/common/Constants.js +48 -5
- package/lib/esm/common/telemetry/TelemetryConstants.js +57 -4
- package/lib/esm/common/telemetry/TelemetryHelper.js +13 -1
- package/lib/esm/common/telemetry/TelemetryManager.js +15 -6
- package/lib/esm/common/telemetry/defaultConfigs/defaultAriaConfig.js +1 -1
- package/lib/esm/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
- package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +36 -14
- package/lib/esm/common/telemetry/loggers/consoleLogger.js +6 -5
- package/lib/esm/common/utils.js +55 -1
- package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +14 -0
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +22 -7
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -38
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -2
- package/lib/esm/components/footerstateful/FooterStateful.js +4 -5
- package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +9 -3
- package/lib/esm/components/headerstateful/HeaderStateful.js +14 -11
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +14 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
- package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +59 -0
- package/lib/esm/components/livechatwidget/common/createAdapter.js +10 -2
- package/lib/esm/components/livechatwidget/common/createMarkdown.js +32 -31
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +23 -25
- package/lib/esm/components/livechatwidget/common/endChat.js +139 -50
- package/lib/esm/components/livechatwidget/common/initCallingSdk.js +3 -0
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +42 -11
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +104 -22
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +5 -14
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +6 -9
- package/lib/esm/components/livechatwidget/common/shareObservable.js +38 -0
- package/lib/esm/components/livechatwidget/common/startChat.js +170 -56
- package/lib/esm/components/livechatwidget/common/startProactiveChat.js +5 -5
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +232 -79
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
- package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +6 -0
- package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +6 -0
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -13
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +26 -6
- package/lib/esm/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +72 -0
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +6 -0
- package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +2 -12
- package/lib/esm/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +5 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +23 -46
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +41 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +94 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +107 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +6 -6
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +32 -0
- package/lib/esm/contexts/common/ConversationState.js +4 -2
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +9 -7
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +8 -3
- package/lib/esm/contexts/createReducer.js +16 -9
- package/lib/esm/controller/componentController.js +5 -5
- package/lib/esm/plugins/newMessageEventHandler.js +82 -0
- package/lib/types/assets/Audios.d.ts +1 -0
- package/lib/types/assets/Icons.d.ts +11 -0
- package/lib/types/common/Constants.d.ts +26 -2
- package/lib/types/common/interfaces/IContextDataStore.d.ts +2 -2
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +44 -2
- package/lib/types/common/telemetry/TelemetryHelper.d.ts +3 -1
- package/lib/types/common/telemetry/definitions/Payload.d.ts +12 -9
- package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +3 -3
- package/lib/types/common/utils.d.ts +7 -1
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +5 -2
- package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationStatefulParams.d.ts +0 -1
- package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +1 -1
- package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +4 -1
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.d.ts +5 -0
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.d.ts +6 -0
- package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -0
- package/lib/types/components/livechatwidget/common/endChat.d.ts +4 -1
- package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +6 -2
- package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/shareObservable.d.ts +1 -0
- package/lib/types/components/livechatwidget/common/startChat.d.ts +4 -2
- package/lib/types/components/livechatwidget/common/startProactiveChat.d.ts +2 -1
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts +1 -0
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -1
- package/lib/types/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.d.ts +3 -0
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.d.ts +3 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.d.ts +5 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.d.ts +1 -0
- package/lib/types/contexts/common/ConversationState.d.ts +4 -2
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -1
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +10 -8
- package/lib/types/plugins/newMessageEventHandler.d.ts +2 -0
- package/package.json +9 -11
- package/lib/cjs/assets/audios/newMessageNotification.mp3 +0 -0
- package/lib/cjs/assets/icons/archiveIcon.svg +0 -3
- package/lib/cjs/assets/icons/audioIcon.svg +0 -6
- package/lib/cjs/assets/icons/blankIcon.svg +0 -6
- package/lib/cjs/assets/icons/excelIcon.svg +0 -6
- package/lib/cjs/assets/icons/imageIcon.svg +0 -6
- package/lib/cjs/assets/icons/oneNoteIcon.svg +0 -6
- package/lib/cjs/assets/icons/pdfIcon.svg +0 -6
- package/lib/cjs/assets/icons/powerpointIcon.svg +0 -6
- package/lib/cjs/assets/icons/videoIcon.svg +0 -6
- package/lib/cjs/assets/icons/visioIcon.svg +0 -6
- package/lib/cjs/assets/icons/wordIcon.svg +0 -6
- package/lib/esm/assets/assets.d.js +0 -0
- package/lib/esm/assets/audios/newMessageNotification.mp3 +0 -0
- package/lib/esm/assets/icons/archiveIcon.svg +0 -3
- package/lib/esm/assets/icons/audioIcon.svg +0 -6
- package/lib/esm/assets/icons/blankIcon.svg +0 -6
- package/lib/esm/assets/icons/excelIcon.svg +0 -6
- package/lib/esm/assets/icons/imageIcon.svg +0 -6
- package/lib/esm/assets/icons/oneNoteIcon.svg +0 -6
- package/lib/esm/assets/icons/pdfIcon.svg +0 -6
- package/lib/esm/assets/icons/powerpointIcon.svg +0 -6
- package/lib/esm/assets/icons/videoIcon.svg +0 -6
- package/lib/esm/assets/icons/visioIcon.svg +0 -6
- package/lib/esm/assets/icons/wordIcon.svg +0 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
2
|
-
import React, { useEffect, useState } from "react";
|
|
3
|
-
import { ChatButton } from "@microsoft/omnichannel-chat-components";
|
|
1
|
+
import { BroadcastEvent, LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
2
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { BroadcastService, ChatButton } from "@microsoft/omnichannel-chat-components";
|
|
4
4
|
import { Constants } from "../../common/Constants";
|
|
5
5
|
import { setFocusOnElement } from "../../common/utils";
|
|
6
6
|
import { ConversationState } from "../../contexts/common/ConversationState";
|
|
@@ -10,7 +10,7 @@ import { TelemetryTimers } from "../../common/telemetry/TelemetryManager";
|
|
|
10
10
|
import { defaultOutOfOfficeChatButtonStyleProps } from "./common/styleProps/defaultOutOfOfficeChatButtonStyleProps";
|
|
11
11
|
import useChatContextStore from "../../hooks/useChatContextStore";
|
|
12
12
|
export const ChatButtonStateful = props => {
|
|
13
|
-
var _state$domainStates$l, _state$domainStates$l2, _buttonProps$controlP;
|
|
13
|
+
var _state$domainStates$l, _state$domainStates$l2, _buttonProps$controlP, _props$buttonProps, _props$buttonProps$co, _props$buttonProps2, _props$buttonProps2$c, _props$buttonProps3, _props$buttonProps3$c;
|
|
14
14
|
|
|
15
15
|
const [state, dispatch] = useChatContextStore();
|
|
16
16
|
const {
|
|
@@ -20,20 +20,26 @@ export const ChatButtonStateful = props => {
|
|
|
20
20
|
} = props; //Setting OutOfOperatingHours Flag
|
|
21
21
|
|
|
22
22
|
const [outOfOperatingHours, setOutOfOperatingHours] = useState(((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.OutOfOperatingHours) === "True");
|
|
23
|
+
const proactiveChatInNewWindow = useRef(state.appStates.proactiveChatStates.proactiveChatInNewWindow);
|
|
23
24
|
const outOfOfficeStyleProps = Object.assign({}, defaultOutOfOfficeChatButtonStyleProps, outOfOfficeButtonProps === null || outOfOfficeButtonProps === void 0 ? void 0 : outOfOfficeButtonProps.styleProps);
|
|
24
25
|
const controlProps = {
|
|
25
26
|
id: "oc-lcw-chat-button",
|
|
26
27
|
dir: state.domainStates.globalDir,
|
|
27
28
|
titleText: "Let's Chat!",
|
|
28
29
|
subtitleText: "We're online.",
|
|
29
|
-
hideNotificationBubble:
|
|
30
|
-
unreadMessageCount: state.appStates.unreadMessageCount ? state.appStates.unreadMessageCount > Constants.maximumUnreadMessageCount ?
|
|
30
|
+
hideNotificationBubble: (buttonProps === null || buttonProps === void 0 ? void 0 : (_buttonProps$controlP = buttonProps.controlProps) === null || _buttonProps$controlP === void 0 ? void 0 : _buttonProps$controlP.hideNotificationBubble) === true || state.appStates.isMinimized === false,
|
|
31
|
+
unreadMessageCount: state.appStates.unreadMessageCount ? state.appStates.unreadMessageCount > Constants.maximumUnreadMessageCount ? (_props$buttonProps = props.buttonProps) === null || _props$buttonProps === void 0 ? void 0 : (_props$buttonProps$co = _props$buttonProps.controlProps) === null || _props$buttonProps$co === void 0 ? void 0 : _props$buttonProps$co.largeUnreadMessageString : state.appStates.unreadMessageCount.toString() : "0",
|
|
31
32
|
onClick: async () => {
|
|
32
33
|
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
33
34
|
Event: TelemetryEvent.LCWChatButtonClicked
|
|
34
35
|
});
|
|
35
36
|
|
|
36
|
-
if (
|
|
37
|
+
if (proactiveChatInNewWindow.current) {
|
|
38
|
+
const proactiveChatIsInPopoutModeEvent = {
|
|
39
|
+
eventName: BroadcastEvent.ProactiveChatIsInPopoutMode
|
|
40
|
+
};
|
|
41
|
+
BroadcastService.postMessage(proactiveChatIsInPopoutModeEvent);
|
|
42
|
+
} else if (state.appStates.isMinimized) {
|
|
37
43
|
dispatch({
|
|
38
44
|
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
39
45
|
payload: false
|
|
@@ -42,6 +48,7 @@ export const ChatButtonStateful = props => {
|
|
|
42
48
|
await startChat();
|
|
43
49
|
}
|
|
44
50
|
},
|
|
51
|
+
unreadMessageString: (_props$buttonProps2 = props.buttonProps) === null || _props$buttonProps2 === void 0 ? void 0 : (_props$buttonProps2$c = _props$buttonProps2.controlProps) === null || _props$buttonProps2$c === void 0 ? void 0 : _props$buttonProps2$c.unreadMessageString,
|
|
45
52
|
...(buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.controlProps)
|
|
46
53
|
};
|
|
47
54
|
const outOfOfficeControlProps = {
|
|
@@ -50,6 +57,10 @@ export const ChatButtonStateful = props => {
|
|
|
50
57
|
titleText: "We're Offline",
|
|
51
58
|
subtitleText: "No agents available",
|
|
52
59
|
onClick: async () => {
|
|
60
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
61
|
+
Event: TelemetryEvent.LCWChatButtonClicked
|
|
62
|
+
});
|
|
63
|
+
|
|
53
64
|
if (state.appStates.isMinimized) {
|
|
54
65
|
dispatch({
|
|
55
66
|
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
@@ -62,6 +73,7 @@ export const ChatButtonStateful = props => {
|
|
|
62
73
|
});
|
|
63
74
|
}
|
|
64
75
|
},
|
|
76
|
+
unreadMessageString: (_props$buttonProps3 = props.buttonProps) === null || _props$buttonProps3 === void 0 ? void 0 : (_props$buttonProps3$c = _props$buttonProps3.controlProps) === null || _props$buttonProps3$c === void 0 ? void 0 : _props$buttonProps3$c.unreadMessageString,
|
|
65
77
|
...(outOfOfficeButtonProps === null || outOfOfficeButtonProps === void 0 ? void 0 : outOfOfficeButtonProps.controlProps)
|
|
66
78
|
};
|
|
67
79
|
useEffect(() => {
|
|
@@ -83,6 +95,9 @@ export const ChatButtonStateful = props => {
|
|
|
83
95
|
});
|
|
84
96
|
}
|
|
85
97
|
}, []);
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
proactiveChatInNewWindow.current = state.appStates.proactiveChatStates.proactiveChatInNewWindow;
|
|
100
|
+
}, [state.appStates.proactiveChatStates.proactiveChatInNewWindow]);
|
|
86
101
|
return /*#__PURE__*/React.createElement(ChatButton, {
|
|
87
102
|
componentOverrides: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.componentOverrides,
|
|
88
103
|
controlProps: outOfOperatingHours ? outOfOfficeControlProps : controlProps,
|
|
@@ -1,39 +1,29 @@
|
|
|
1
1
|
import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
2
|
+
import { ConfirmationPane } from "@microsoft/omnichannel-chat-components";
|
|
2
3
|
import React, { useEffect } from "react";
|
|
3
4
|
import { findAllFocusableElement, findParentFocusableElementsWithoutChildContainer, preventFocusToMoveOutOfElement, setFocusOnElement, setFocusOnSendBox, setTabIndices } from "../../common/utils";
|
|
4
|
-
import { BroadcastService, ConfirmationPane } from "@microsoft/omnichannel-chat-components";
|
|
5
5
|
import { DimLayer } from "../dimlayer/DimLayer";
|
|
6
6
|
import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
|
|
7
7
|
import { NotificationHandler } from "../webchatcontainerstateful/webchatcontroller/notification/NotificationHandler";
|
|
8
8
|
import { NotificationScenarios } from "../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios";
|
|
9
|
-
import { PostChatSurveyMode } from "../postchatsurveypanestateful/enums/PostChatSurveyMode";
|
|
10
9
|
import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
11
10
|
import useChatAdapterStore from "../../hooks/useChatAdapterStore";
|
|
12
|
-
import useChatContextStore from "../../hooks/useChatContextStore";
|
|
13
|
-
import useChatSDKStore from "../../hooks/useChatSDKStore";
|
|
14
|
-
import { Constants } from "../../common/Constants"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
import useChatContextStore from "../../hooks/useChatContextStore"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
12
|
|
|
16
13
|
export const ConfirmationPaneStateful = props => {
|
|
17
|
-
var _state$domainStates$l, _state$domainStates$l2, _state$domainStates$l3, _state$domainStates$l4;
|
|
18
|
-
|
|
19
14
|
const initialTabIndexMap = new Map();
|
|
20
|
-
let elements = [];
|
|
21
|
-
|
|
22
|
-
const chatSDK = useChatSDKStore();
|
|
15
|
+
let elements = [];
|
|
23
16
|
const [state, dispatch] = useChatContextStore();
|
|
24
17
|
const {
|
|
25
|
-
|
|
18
|
+
prepareEndChat
|
|
26
19
|
} = props; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
20
|
|
|
29
21
|
const [adapter] = useChatAdapterStore();
|
|
30
|
-
const isPostChatEnabled = (_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.msdyn_postconversationsurveyenable;
|
|
31
|
-
const postChatSurveyMode = (_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : (_state$domainStates$l4 = _state$domainStates$l3.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l4 === void 0 ? void 0 : _state$domainStates$l4.msdyn_postconversationsurveymode;
|
|
32
22
|
const controlProps = {
|
|
33
23
|
id: "oc-lcw-confirmation-pane",
|
|
34
24
|
dir: state.domainStates.globalDir,
|
|
35
25
|
onConfirm: async () => {
|
|
36
|
-
TelemetryHelper.
|
|
26
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
37
27
|
Event: TelemetryEvent.ConfirmationConfirmButtonClicked,
|
|
38
28
|
Description: "Confirmation pane Confirm button clicked"
|
|
39
29
|
});
|
|
@@ -43,28 +33,8 @@ export const ConfirmationPaneStateful = props => {
|
|
|
43
33
|
});
|
|
44
34
|
|
|
45
35
|
try {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (isPostChatEnabled === "true" && postChatSurveyMode === PostChatSurveyMode.Embed && conversationDetails.canRenderPostChat === Constants.truePascal) {
|
|
50
|
-
const loadPostChatEvent = {
|
|
51
|
-
eventName: "LoadPostChatSurvey"
|
|
52
|
-
};
|
|
53
|
-
BroadcastService.postMessage(loadPostChatEvent);
|
|
54
|
-
} else {
|
|
55
|
-
setTabIndices(elements, initialTabIndexMap, true);
|
|
56
|
-
|
|
57
|
-
try {
|
|
58
|
-
await endChat(adapter);
|
|
59
|
-
} catch (error) {
|
|
60
|
-
TelemetryHelper.logSDKEvent(LogLevel.ERROR, {
|
|
61
|
-
Event: TelemetryEvent.CloseChatMethodException,
|
|
62
|
-
ExceptionDetails: {
|
|
63
|
-
exception: `Failed to endChat: ${error}`
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}
|
|
36
|
+
setTabIndices(elements, initialTabIndexMap, true);
|
|
37
|
+
await prepareEndChat(adapter, state);
|
|
68
38
|
} catch (ex) {
|
|
69
39
|
TelemetryHelper.logSDKEvent(LogLevel.ERROR, {
|
|
70
40
|
Event: TelemetryEvent.GetConversationDetailsCallFailed,
|
|
@@ -76,7 +46,7 @@ export const ConfirmationPaneStateful = props => {
|
|
|
76
46
|
}
|
|
77
47
|
},
|
|
78
48
|
onCancel: () => {
|
|
79
|
-
TelemetryHelper.
|
|
49
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
80
50
|
Event: TelemetryEvent.ConfirmationCancelButtonClicked,
|
|
81
51
|
Description: "Confirmation pane Cancel button clicked."
|
|
82
52
|
});
|
|
@@ -68,8 +68,8 @@ export const EmailTranscriptPaneStateful = props => {
|
|
|
68
68
|
},
|
|
69
69
|
onCancel: () => {
|
|
70
70
|
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
71
|
-
Event: TelemetryEvent.
|
|
72
|
-
Description: "Email Transcript button clicked."
|
|
71
|
+
Event: TelemetryEvent.EmailTranscriptCancelButtonClicked,
|
|
72
|
+
Description: "Email Transcript cancel button clicked."
|
|
73
73
|
});
|
|
74
74
|
closeEmailTranscriptPane();
|
|
75
75
|
},
|
|
@@ -4,13 +4,13 @@ import AudioNotificationStateful from "./audionotificationstateful/AudioNotifica
|
|
|
4
4
|
import { Constants } from "../../common/Constants";
|
|
5
5
|
import { Footer } from "@microsoft/omnichannel-chat-components";
|
|
6
6
|
import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
|
|
7
|
+
import { NewMessageNotificationSoundBase64 } from "../../assets/Audios";
|
|
7
8
|
import { NotificationHandler } from "../webchatcontainerstateful/webchatcontroller/notification/NotificationHandler";
|
|
8
9
|
import { NotificationScenarios } from "../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios";
|
|
9
10
|
import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
10
11
|
import { downloadTranscript } from "./downloadtranscriptstateful/DownloadTranscriptStateful";
|
|
11
12
|
import useChatContextStore from "../../hooks/useChatContextStore";
|
|
12
|
-
import useChatSDKStore from "../../hooks/useChatSDKStore";
|
|
13
|
-
import newMessageNotification from "../../assets/audios/newMessageNotification.mp3"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
|
+
import useChatSDKStore from "../../hooks/useChatSDKStore"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
14
|
|
|
15
15
|
export const FooterStateful = props => {
|
|
16
16
|
var _footerProps$controlP3, _footerProps$controlP4;
|
|
@@ -96,9 +96,8 @@ export const FooterStateful = props => {
|
|
|
96
96
|
controlProps: controlProps,
|
|
97
97
|
styleProps: footerProps === null || footerProps === void 0 ? void 0 : footerProps.styleProps
|
|
98
98
|
}), /*#__PURE__*/React.createElement(AudioNotificationStateful, {
|
|
99
|
-
audioSrc: (audioNotificationProps === null || audioNotificationProps === void 0 ? void 0 : audioNotificationProps.audioSrc) ??
|
|
100
|
-
|
|
101
|
-
isAudioMuted: state.appStates.isAudioMuted ?? false
|
|
99
|
+
audioSrc: (audioNotificationProps === null || audioNotificationProps === void 0 ? void 0 : audioNotificationProps.audioSrc) ?? NewMessageNotificationSoundBase64,
|
|
100
|
+
isAudioMuted: state.appStates.isAudioMuted === null ? (footerProps === null || footerProps === void 0 ? void 0 : (_footerProps$controlP4 = footerProps.controlProps) === null || _footerProps$controlP4 === void 0 ? void 0 : _footerProps$controlP4.hideAudioNotificationButton) ?? false : state.appStates.isAudioMuted ?? false
|
|
102
101
|
}));
|
|
103
102
|
};
|
|
104
103
|
export default FooterStateful;
|
package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js
CHANGED
|
@@ -105,8 +105,14 @@ const beautifyChatTranscripts = (chatTranscripts, renderMarkDown, attachmentMess
|
|
|
105
105
|
let fileAttachmentName = TranscriptConstants.DefaultFileAttachmentName;
|
|
106
106
|
let dialogColor = TranscriptConstants.CustomerDialogColor;
|
|
107
107
|
let fontColor = TranscriptConstants.CustomerFontColor;
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
const isSystemMessage = value.tags && value.tags.toLowerCase().indexOf(Constants.systemMessageTag) !== -1;
|
|
109
|
+
const isControlMessage = value.isControlMessage && value.isControlMessage === true;
|
|
110
|
+
const isAdaptiveCard = value.contentType && value.contentType.toLowerCase() === TranscriptConstants.AdaptiveCardType;
|
|
111
|
+
const isInternalMessage = value.deliveryMode && value.deliveryMode.toLowerCase() === TranscriptConstants.InternalMode;
|
|
112
|
+
const isHiddenMessage = value.tags && value.tags.toLowerCase().indexOf(Constants.hiddenTag.toLowerCase()) !== -1;
|
|
113
|
+
const shouldIgnoreMessage = isSystemMessage || isControlMessage || isAdaptiveCard || isInternalMessage || isHiddenMessage;
|
|
114
|
+
|
|
115
|
+
if (shouldIgnoreMessage) {
|
|
110
116
|
return;
|
|
111
117
|
} else if (value.from) {
|
|
112
118
|
if (value.from.application) {
|
|
@@ -127,7 +133,7 @@ const beautifyChatTranscripts = (chatTranscripts, renderMarkDown, attachmentMess
|
|
|
127
133
|
|
|
128
134
|
if (value.attachments && value.attachments.length > 0 && value.attachments[0].name) {
|
|
129
135
|
fileAttachmentName = value.attachments[0].name;
|
|
130
|
-
value.content = attachmentMessage
|
|
136
|
+
value.content = attachmentMessage ? attachmentMessage + " " + fileAttachmentName : "The following attachment was uploaded during the conversation: " + fileAttachmentName;
|
|
131
137
|
}
|
|
132
138
|
}
|
|
133
139
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
2
|
-
import React, { useEffect, useState } from "react";
|
|
2
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
3
3
|
import { ConversationState } from "../../contexts/common/ConversationState";
|
|
4
4
|
import { Header } from "@microsoft/omnichannel-chat-components";
|
|
5
5
|
import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
|
|
@@ -21,6 +21,7 @@ export const HeaderStateful = props => {
|
|
|
21
21
|
|
|
22
22
|
const [outOfOperatingHours, setOutOfOperatingHours] = useState(((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.OutOfOperatingHours) === "True");
|
|
23
23
|
const outOfOfficeStyleProps = Object.assign({}, defaultOutOfOfficeHeaderStyleProps, outOfOfficeHeaderProps === null || outOfOfficeHeaderProps === void 0 ? void 0 : outOfOfficeHeaderProps.styleProps);
|
|
24
|
+
const conversationState = useRef(state.appStates.conversationState);
|
|
24
25
|
const controlProps = {
|
|
25
26
|
id: "oc-lcw-header",
|
|
26
27
|
dir: state.domainStates.globalDir,
|
|
@@ -40,17 +41,15 @@ export const HeaderStateful = props => {
|
|
|
40
41
|
Description: "Header Close button clicked."
|
|
41
42
|
});
|
|
42
43
|
|
|
43
|
-
if (
|
|
44
|
+
if (conversationState.current === ConversationState.Active) {
|
|
44
45
|
dispatch({
|
|
45
46
|
type: LiveChatWidgetActionType.SET_SHOW_CONFIRMATION,
|
|
46
47
|
payload: true
|
|
47
48
|
});
|
|
48
|
-
} else
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
53
|
-
await endChat(adapter);
|
|
49
|
+
} else {
|
|
50
|
+
const skipEndChatSDK = true;
|
|
51
|
+
const skipCloseChat = false;
|
|
52
|
+
await endChat(adapter, skipEndChatSDK, skipCloseChat);
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
dispatch({
|
|
@@ -59,8 +58,8 @@ export const HeaderStateful = props => {
|
|
|
59
58
|
});
|
|
60
59
|
},
|
|
61
60
|
...(headerProps === null || headerProps === void 0 ? void 0 : headerProps.controlProps),
|
|
62
|
-
hideTitle: state.appStates.conversationState === ConversationState.Loading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP = headerProps.controlProps) === null || _headerProps$controlP === void 0 ? void 0 : _headerProps$controlP.hideTitle),
|
|
63
|
-
hideIcon: state.appStates.conversationState === ConversationState.Loading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP2 = headerProps.controlProps) === null || _headerProps$controlP2 === void 0 ? void 0 : _headerProps$controlP2.hideIcon),
|
|
61
|
+
hideTitle: state.appStates.conversationState === ConversationState.Loading || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP = headerProps.controlProps) === null || _headerProps$controlP === void 0 ? void 0 : _headerProps$controlP.hideTitle),
|
|
62
|
+
hideIcon: state.appStates.conversationState === ConversationState.Loading || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP2 = headerProps.controlProps) === null || _headerProps$controlP2 === void 0 ? void 0 : _headerProps$controlP2.hideIcon),
|
|
64
63
|
hideCloseButton: state.appStates.conversationState === ConversationState.Loading || state.appStates.conversationState === ConversationState.Prechat || state.appStates.conversationState === ConversationState.ReconnectChat || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP3 = headerProps.controlProps) === null || _headerProps$controlP3 === void 0 ? void 0 : _headerProps$controlP3.hideCloseButton)
|
|
65
64
|
};
|
|
66
65
|
const outOfOfficeControlProps = {
|
|
@@ -82,7 +81,11 @@ export const HeaderStateful = props => {
|
|
|
82
81
|
if (state.appStates.outsideOperatingHours) {
|
|
83
82
|
setOutOfOperatingHours(true);
|
|
84
83
|
}
|
|
85
|
-
|
|
84
|
+
|
|
85
|
+
if (state.appStates.conversationState) {
|
|
86
|
+
conversationState.current = state.appStates.conversationState;
|
|
87
|
+
}
|
|
88
|
+
}, [state.appStates]);
|
|
86
89
|
return /*#__PURE__*/React.createElement(Header, {
|
|
87
90
|
componentOverrides: headerProps === null || headerProps === void 0 ? void 0 : headerProps.componentOverrides,
|
|
88
91
|
controlProps: outOfOperatingHours || state.appStates.conversationState === ConversationState.OutOfOffice ? outOfOfficeControlProps : controlProps,
|
package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
3
|
+
export class DefaultActivitySubscriber {
|
|
4
|
+
constructor() {
|
|
5
|
+
_defineProperty(this, "observer", void 0);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
+
async next(activity) {
|
|
10
|
+
this.observer.next(activity);
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
3
|
+
import { DefaultActivitySubscriber } from "./ActivitySubscriber/DefaultActivitySubscriber";
|
|
4
|
+
import { shareObservable } from "./shareObservable";
|
|
5
|
+
export class ChatAdapterShim {
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
+
constructor(chatAdapter) {
|
|
11
|
+
_defineProperty(this, "chatAdapter", void 0);
|
|
12
|
+
|
|
13
|
+
_defineProperty(this, "activityObserver", void 0);
|
|
14
|
+
|
|
15
|
+
_defineProperty(this, "subscribers", void 0);
|
|
16
|
+
|
|
17
|
+
this.subscribers = [];
|
|
18
|
+
this.chatAdapter = { ...chatAdapter,
|
|
19
|
+
activity$: shareObservable( // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
+
new window.Observable(observer => {
|
|
21
|
+
this.activityObserver = observer; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
+
|
|
23
|
+
const abortController = new window.AbortController();
|
|
24
|
+
|
|
25
|
+
(async () => {
|
|
26
|
+
try {
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
for await (let activity of chatAdapter.activities({
|
|
29
|
+
signal: abortController.signal
|
|
30
|
+
})) {
|
|
31
|
+
for (const subscriber of [...this.subscribers, new DefaultActivitySubscriber()]) {
|
|
32
|
+
subscriber.observer = this.activityObserver;
|
|
33
|
+
activity = await subscriber.next(activity);
|
|
34
|
+
|
|
35
|
+
if (!activity) {
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
observer.complete();
|
|
42
|
+
} catch (error) {
|
|
43
|
+
observer.error(error);
|
|
44
|
+
}
|
|
45
|
+
})();
|
|
46
|
+
|
|
47
|
+
return () => {
|
|
48
|
+
abortController.abort();
|
|
49
|
+
};
|
|
50
|
+
}))
|
|
51
|
+
};
|
|
52
|
+
} // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
addSubscriber(subscriber) {
|
|
56
|
+
this.subscribers.push(subscriber);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { NotificationHandler } from "../../webchatcontainerstateful/webchatcontroller/notification/NotificationHandler";
|
|
2
2
|
import { NotificationLevel } from "../../webchatcontainerstateful/webchatcontroller/enums/NotificationLevel";
|
|
3
3
|
import { NotificationScenarios } from "../../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios";
|
|
4
|
-
import { defaultMiddlewareLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
4
|
+
import { defaultMiddlewareLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
5
|
+
import { ChatAdapterShim } from "./ChatAdapterShim"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
6
|
|
|
6
7
|
export const createAdapter = async chatSDK => {
|
|
7
8
|
const chatAdapterOptionalParams = {
|
|
@@ -23,5 +24,12 @@ export const createAdapter = async chatSDK => {
|
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
};
|
|
26
|
-
|
|
27
|
+
let adapter = await chatSDK.createChatAdapter(chatAdapterOptionalParams); //so far, there is no need to convert to the shim adapter when using visual tests
|
|
28
|
+
|
|
29
|
+
if (chatSDK.isMockModeOn !== true) {
|
|
30
|
+
adapter = new ChatAdapterShim(adapter);
|
|
31
|
+
return adapter.chatAdapter;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return adapter;
|
|
27
35
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import MarkdownIt from "markdown-it";
|
|
2
|
-
import MarkdownSlack from "slack-markdown-it";
|
|
3
2
|
import MarkdownItForInline from "markdown-it-for-inline";
|
|
4
3
|
import { defaultMarkdownLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts";
|
|
5
4
|
import { Constants } from "../../../common/Constants"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -12,27 +11,42 @@ export const createMarkdown = (disableMarkdownMessageFormatting, disableNewLineM
|
|
|
12
11
|
html: true,
|
|
13
12
|
linkify: true,
|
|
14
13
|
breaks: !disableNewLineMarkdownSupport
|
|
14
|
+
}); // ToDo: Commenting below usage of plugin until deferred bug is resolved: https://github.com/mayashavin/markdown-it-slack/issues/1
|
|
15
|
+
// markdown.use(MarkdownSlack);
|
|
16
|
+
} else {
|
|
17
|
+
markdown = new MarkdownIt(Constants.Zero, {
|
|
18
|
+
html: true,
|
|
19
|
+
linkify: true,
|
|
20
|
+
breaks: !disableNewLineMarkdownSupport
|
|
15
21
|
});
|
|
16
|
-
markdown.
|
|
17
|
-
//
|
|
22
|
+
markdown.enable(["entity", // Rule to process html entity - {, ¯, "
|
|
23
|
+
"linkify", // Rule to replace link-like texts with link nodes
|
|
24
|
+
"html_block", // Rule to process html blocks and paragraphs
|
|
25
|
+
"html_inline", // Rule to process html tags
|
|
26
|
+
"newline" // Rule to proceess '\n'
|
|
27
|
+
]);
|
|
28
|
+
} // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
29
|
|
|
19
|
-
markdown.use(MarkdownItForInline, "url_new_win", "link_open", function (tokens, idx, env) {
|
|
20
|
-
const targetAttrIndex = tokens[idx].attrIndex(Constants.Target); // Put a transparent pixel instead of the "open in new window" icon, so developers can easily modify the icon in CSS.
|
|
21
30
|
|
|
22
|
-
|
|
31
|
+
markdown.use(MarkdownItForInline, "url_new_win", "link_open", function (tokens, idx, env) {
|
|
32
|
+
const targetAttrIndex = tokens[idx].attrIndex(Constants.Target); // Put a transparent pixel instead of the "open in new window" icon, so developers can easily modify the icon in CSS.
|
|
23
33
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
34
|
+
const TRANSPARENT_GIF = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
35
|
+
|
|
36
|
+
if (~targetAttrIndex) {
|
|
37
|
+
tokens[idx].attrs[targetAttrIndex][1] = Constants.Blank;
|
|
38
|
+
} else {
|
|
39
|
+
tokens[idx].attrPush([Constants.Target, Constants.Blank]);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const relAttrIndex = tokens[idx].attrIndex(Constants.TargetRelationship);
|
|
29
43
|
|
|
30
|
-
|
|
44
|
+
if (~relAttrIndex) {
|
|
45
|
+
tokens[idx].attrs[relAttrIndex][1] = Constants.TargetRelationshipAttributes;
|
|
46
|
+
} else {
|
|
47
|
+
tokens[idx].attrPush([Constants.TargetRelationship, Constants.TargetRelationshipAttributes]);
|
|
31
48
|
|
|
32
|
-
if (
|
|
33
|
-
tokens[idx].attrs[relAttrIndex][1] = Constants.TargetRelationshipAttributes;
|
|
34
|
-
} else {
|
|
35
|
-
tokens[idx].attrPush([Constants.TargetRelationship, Constants.TargetRelationshipAttributes]);
|
|
49
|
+
if (!disableMarkdownMessageFormatting) {
|
|
36
50
|
tokens[idx].attrPush([Constants.Title, defaultMarkdownLocalizedTexts.MARKDOWN_EXTERNAL_LINK_ALT]); // eslint-disable-next-line quotes
|
|
37
51
|
|
|
38
52
|
const iconTokens = markdown.parseInline(``, env)[0].children;
|
|
@@ -42,20 +56,7 @@ export const createMarkdown = (disableMarkdownMessageFormatting, disableNewLineM
|
|
|
42
56
|
tokens.splice(idx + 2, 0, ...iconTokens);
|
|
43
57
|
}
|
|
44
58
|
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
markdown = new MarkdownIt(Constants.Zero, {
|
|
48
|
-
html: true,
|
|
49
|
-
linkify: true,
|
|
50
|
-
breaks: !disableNewLineMarkdownSupport
|
|
51
|
-
});
|
|
52
|
-
markdown.enable(["entity", // Rule to process html entity - {, ¯, "
|
|
53
|
-
"linkify", // Rule to replace link-like texts with link nodes
|
|
54
|
-
"html_block", // Rule to process html blocks and paragraphs
|
|
55
|
-
"html_inline", // Rule to process html tags
|
|
56
|
-
"newline" // Rule to proceess '\n'
|
|
57
|
-
]);
|
|
58
|
-
}
|
|
59
|
-
|
|
59
|
+
}
|
|
60
|
+
});
|
|
60
61
|
return markdown;
|
|
61
62
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-empty-function, @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { ChatReconnectIconBase64, CloseChatButtonIconBase64, ModernChatIconBase64, ProactiveChatBannerBase64 } from "@microsoft/omnichannel-chat-components";
|
|
2
3
|
import MockAdapter from "../../../webchatcontainerstateful/common/mockadapter";
|
|
4
|
+
import { NewMessageNotificationSoundBase64 } from "../../../../assets/Audios";
|
|
3
5
|
import { WebChatStoreLoader } from "../../../webchatcontainerstateful/webchatcontroller/WebChatStoreLoader";
|
|
4
6
|
import { activityStatusMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware";
|
|
5
7
|
import { createActivityMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware";
|
|
@@ -8,10 +10,11 @@ import { createAvatarMiddleware } from "../../../webchatcontainerstateful/webcha
|
|
|
8
10
|
import { createMarkdown } from "../createMarkdown";
|
|
9
11
|
import { groupActivitiesMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware";
|
|
10
12
|
import { typingIndicatorMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware";
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13
|
+
import { createWebChatTelemetry } from "../../../webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger"; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14
|
+
|
|
12
15
|
export const dummyDefaultProps = {
|
|
13
16
|
audioNotificationProps: {
|
|
14
|
-
audioSrc:
|
|
17
|
+
audioSrc: NewMessageNotificationSoundBase64
|
|
15
18
|
},
|
|
16
19
|
callingContainerProps: {
|
|
17
20
|
controlProps: {
|
|
@@ -250,18 +253,6 @@ export const dummyDefaultProps = {
|
|
|
250
253
|
width: "50px",
|
|
251
254
|
fontSize: "18px"
|
|
252
255
|
},
|
|
253
|
-
currentCallTimerStyleProps: {
|
|
254
|
-
borderRadius: "2px",
|
|
255
|
-
margin: "1px",
|
|
256
|
-
color: "#FFFFFF",
|
|
257
|
-
paddingTop: "18px",
|
|
258
|
-
fontSize: 12,
|
|
259
|
-
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
260
|
-
backgroundColor: "darkgrey",
|
|
261
|
-
height: "45px",
|
|
262
|
-
width: "50px",
|
|
263
|
-
textAlign: "center"
|
|
264
|
-
},
|
|
265
256
|
videoTileStyleProps: {
|
|
266
257
|
width: "100%",
|
|
267
258
|
marginLeft: "auto",
|
|
@@ -325,7 +316,9 @@ export const dummyDefaultProps = {
|
|
|
325
316
|
hideChatTextContainer: false,
|
|
326
317
|
hideChatSubtitle: false,
|
|
327
318
|
hideChatTitle: false,
|
|
328
|
-
hideNotificationBubble: true
|
|
319
|
+
hideNotificationBubble: true,
|
|
320
|
+
unreadMessageString: "new messages",
|
|
321
|
+
largeUnreadMessageString: "99+"
|
|
329
322
|
},
|
|
330
323
|
styleProps: {
|
|
331
324
|
generalStyleProps: {
|
|
@@ -366,7 +359,7 @@ export const dummyDefaultProps = {
|
|
|
366
359
|
margin: "-2px -2px -2px -3px",
|
|
367
360
|
justifyContent: "center",
|
|
368
361
|
backgroundSize: "65% 65%",
|
|
369
|
-
backgroundImage:
|
|
362
|
+
backgroundImage: `url(${ModernChatIconBase64})`,
|
|
370
363
|
display: "flex",
|
|
371
364
|
backgroundRepeat: "no-repeat",
|
|
372
365
|
backgroundPosition: "center"
|
|
@@ -887,7 +880,7 @@ export const dummyDefaultProps = {
|
|
|
887
880
|
},
|
|
888
881
|
headerIconProps: {
|
|
889
882
|
id: "oc-lcw-header-icon",
|
|
890
|
-
src:
|
|
883
|
+
src: ModernChatIconBase64,
|
|
891
884
|
alt: "Chat Icon",
|
|
892
885
|
className: undefined
|
|
893
886
|
},
|
|
@@ -1012,7 +1005,7 @@ export const dummyDefaultProps = {
|
|
|
1012
1005
|
alignSelf: "auto"
|
|
1013
1006
|
},
|
|
1014
1007
|
iconImageProps: {
|
|
1015
|
-
src: "
|
|
1008
|
+
src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2lpKSI+DQo8cGF0aCBkPSJNMTUuMTk3MSAxNi4yNzI1VjI1Ljg1MjRDMTUuMTk3MSAyNy4zODExIDE1Ljg0MDEgMjcuNTIwMSAxNi45ODMyIDI3LjUyMDFMMjYuNzA4NCAyNy41NjQ5TDMxLjAwMzkgMzIuMzEyM1YyNy41NjQ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T0iLTAuMzk1MDAxIiB5MT0iMjMuMTI4MiIgeDI9IjIwLjEwNTgiIHkyPSIzNy44NDc0IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+DQo8c3RvcCBzdG9wLWNvbG9yPSIjRUZFRkVGIi8+DQo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IndoaXRlIi8+DQo8L2xpbmVhckdyYWRpZW50Pg0KPC9kZWZzPg0KPC9zdmc+DQo=",
|
|
1016
1009
|
imageFit: 0,
|
|
1017
1010
|
width: "86px",
|
|
1018
1011
|
height: "86px",
|
|
@@ -1220,7 +1213,7 @@ export const dummyDefaultProps = {
|
|
|
1220
1213
|
},
|
|
1221
1214
|
headerContainerStyleProps: {
|
|
1222
1215
|
backgroundColor: "rgb(49, 95, 162)",
|
|
1223
|
-
backgroundImage:
|
|
1216
|
+
backgroundImage: `url(${ProactiveChatBannerBase64})`,
|
|
1224
1217
|
backgroundPosition: "initial",
|
|
1225
1218
|
backgroundRepeat: "no-repeat",
|
|
1226
1219
|
borderTopLeftRadius: "inherit",
|
|
@@ -1248,7 +1241,7 @@ export const dummyDefaultProps = {
|
|
|
1248
1241
|
fontWeight: "600"
|
|
1249
1242
|
},
|
|
1250
1243
|
closeButtonStyleProps: {
|
|
1251
|
-
backgroundImage:
|
|
1244
|
+
backgroundImage: `url(${CloseChatButtonIconBase64})`,
|
|
1252
1245
|
backgroundPosition: "center",
|
|
1253
1246
|
backgroundRepeat: "no-repeat",
|
|
1254
1247
|
color: "#605e5c",
|
|
@@ -1371,7 +1364,7 @@ export const dummyDefaultProps = {
|
|
|
1371
1364
|
lineHeight: "19px"
|
|
1372
1365
|
},
|
|
1373
1366
|
iconStyleProps: {
|
|
1374
|
-
backgroundImage:
|
|
1367
|
+
backgroundImage: `url(${ChatReconnectIconBase64})`,
|
|
1375
1368
|
backgroundPosition: "center",
|
|
1376
1369
|
backgroundRepeat: "no-repeat",
|
|
1377
1370
|
backgroundSize: "200px",
|
|
@@ -1420,9 +1413,9 @@ export const dummyDefaultProps = {
|
|
|
1420
1413
|
startNewChatButtonClassName: undefined
|
|
1421
1414
|
}
|
|
1422
1415
|
},
|
|
1423
|
-
authClientFunction: undefined,
|
|
1424
1416
|
isReconnectEnabled: undefined,
|
|
1425
|
-
reconnectId: undefined
|
|
1417
|
+
reconnectId: undefined,
|
|
1418
|
+
redirectInSameWindow: undefined
|
|
1426
1419
|
},
|
|
1427
1420
|
styleProps: {
|
|
1428
1421
|
generalStyles: {
|
|
@@ -1494,7 +1487,7 @@ export const dummyDefaultProps = {
|
|
|
1494
1487
|
internalErrorBoxClass: undefined,
|
|
1495
1488
|
internalRenderErrorBox: undefined,
|
|
1496
1489
|
locale: "en-US",
|
|
1497
|
-
onTelemetry:
|
|
1490
|
+
onTelemetry: createWebChatTelemetry(),
|
|
1498
1491
|
overrideLocalizedStrings: undefined,
|
|
1499
1492
|
renderMarkdown: createMarkdown(false, false),
|
|
1500
1493
|
scrollToEndButtonMiddleware: undefined,
|
|
@@ -1684,7 +1677,12 @@ export const dummyDefaultProps = {
|
|
|
1684
1677
|
MIDDLEWARE_MESSAGE_RETRY: "Retry",
|
|
1685
1678
|
PRECHAT_REQUIRED_FIELD_MISSING_MESSAGE: "{0} field is required",
|
|
1686
1679
|
MARKDOWN_EXTERNAL_LINK_ALT: "Opens in a new window; external."
|
|
1680
|
+
},
|
|
1681
|
+
botMagicCode: {
|
|
1682
|
+
disabled: false,
|
|
1683
|
+
fwdUrl: ""
|
|
1687
1684
|
}
|
|
1688
1685
|
},
|
|
1689
|
-
telemetryConfig: undefined
|
|
1686
|
+
telemetryConfig: undefined,
|
|
1687
|
+
getAuthToken: undefined
|
|
1690
1688
|
};
|