@microsoft/omnichannel-chat-widget 0.1.0-main.edd8c2a → 0.1.0-main.f514612
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 +54 -4
- package/lib/cjs/common/contextDataStore/DataStoreManager.js +14 -0
- package/lib/cjs/{assets/assets.d.js → common/interfaces/IContextDataStore.js} +0 -0
- package/lib/cjs/common/storage/default/defaultCacheManager.js +34 -0
- package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +114 -0
- package/lib/cjs/common/storage/default/defaultInMemoryDataStore.js +86 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +67 -4
- package/lib/cjs/common/telemetry/TelemetryHelper.js +22 -4
- package/lib/cjs/common/telemetry/TelemetryManager.js +28 -9
- package/lib/cjs/common/telemetry/defaultConfigs/defaultAriaConfig.js +3 -3
- package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
- package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +48 -15
- package/lib/cjs/common/telemetry/loggers/consoleLogger.js +9 -5
- package/lib/cjs/common/utils.js +89 -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 +7 -54
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -2
- package/lib/cjs/components/footerstateful/FooterStateful.js +5 -13
- package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +11 -2
- package/lib/cjs/components/headerstateful/HeaderStateful.js +14 -10
- package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +44 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +23 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +39 -0
- package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +70 -0
- package/lib/cjs/components/livechatwidget/common/Deferred.js +42 -0
- package/lib/cjs/components/livechatwidget/common/authHelper.js +65 -0
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +13 -1
- package/lib/cjs/components/livechatwidget/common/createFooter.js +7 -16
- package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +12 -0
- package/lib/cjs/components/livechatwidget/common/createMarkdown.js +32 -32
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +46 -26
- package/lib/cjs/components/livechatwidget/common/disposeTelemetryLoggers.js +14 -0
- package/lib/cjs/components/livechatwidget/common/endChat.js +142 -43
- package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +5 -0
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +51 -10
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +144 -39
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +11 -7
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +22 -24
- package/lib/cjs/components/livechatwidget/common/shareObservable.js +45 -0
- package/lib/cjs/components/livechatwidget/common/startChat.js +207 -41
- package/lib/cjs/components/livechatwidget/common/startProactiveChat.js +3 -3
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +324 -71
- 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 +22 -10
- 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 +96 -2
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +4 -1
- package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +11 -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/IAdaptiveCardStyles.js +1 -0
- 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/activityStatusMiddleware.js +2 -1
- 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/defaultStyles/defaultReceivedMessageAnchorStyles.js +10 -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 +13 -7
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +20 -5
- package/lib/cjs/contexts/createReducer.js +44 -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 +50 -3
- package/lib/esm/common/contextDataStore/DataStoreManager.js +5 -0
- package/lib/esm/common/interfaces/IContextDataStore.js +1 -0
- package/lib/esm/common/storage/default/defaultCacheManager.js +19 -0
- package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +102 -0
- package/lib/esm/common/storage/default/defaultInMemoryDataStore.js +71 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +63 -3
- package/lib/esm/common/telemetry/TelemetryHelper.js +22 -5
- package/lib/esm/common/telemetry/TelemetryManager.js +22 -9
- package/lib/esm/common/telemetry/defaultConfigs/defaultAriaConfig.js +3 -3
- package/lib/esm/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
- package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +50 -15
- package/lib/esm/common/telemetry/loggers/consoleLogger.js +9 -5
- package/lib/esm/common/utils.js +64 -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 +7 -50
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -2
- package/lib/esm/components/footerstateful/FooterStateful.js +5 -13
- package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +9 -3
- package/lib/esm/components/headerstateful/HeaderStateful.js +15 -11
- package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +34 -0
- 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/ActivitySubscriber/PauseActivitySubscriber.js +29 -0
- package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +59 -0
- package/lib/esm/components/livechatwidget/common/Deferred.js +33 -0
- package/lib/esm/components/livechatwidget/common/authHelper.js +50 -0
- package/lib/esm/components/livechatwidget/common/createAdapter.js +12 -2
- package/lib/esm/components/livechatwidget/common/createFooter.js +4 -15
- package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +8 -0
- package/lib/esm/components/livechatwidget/common/createMarkdown.js +32 -31
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +44 -27
- package/lib/esm/components/livechatwidget/common/disposeTelemetryLoggers.js +4 -0
- package/lib/esm/components/livechatwidget/common/endChat.js +139 -42
- package/lib/esm/components/livechatwidget/common/initCallingSdk.js +3 -0
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +45 -11
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +134 -41
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +10 -3
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +19 -22
- package/lib/esm/components/livechatwidget/common/shareObservable.js +38 -0
- package/lib/esm/components/livechatwidget/common/startChat.js +195 -39
- package/lib/esm/components/livechatwidget/common/startProactiveChat.js +5 -5
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +307 -76
- 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 +22 -10
- 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 +86 -2
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +4 -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/IAdaptiveCardStyles.js +1 -0
- 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/activityStatusMiddleware.js +2 -1
- 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/defaultStyles/defaultReceivedMessageAnchorStyles.js +3 -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 +13 -7
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +18 -5
- package/lib/esm/contexts/createReducer.js +44 -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 +27 -1
- package/lib/types/common/contextDataStore/DataStoreManager.d.ts +4 -0
- package/lib/types/common/interfaces/IContextDataStore.d.ts +14 -0
- package/lib/types/common/storage/default/defaultCacheManager.d.ts +4 -0
- package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +2 -0
- package/lib/types/common/storage/default/defaultInMemoryDataStore.d.ts +6 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +49 -2
- package/lib/types/common/telemetry/TelemetryHelper.d.ts +2 -0
- package/lib/types/common/telemetry/TelemetryManager.d.ts +1 -0
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +3 -0
- package/lib/types/common/telemetry/definitions/Payload.d.ts +15 -9
- package/lib/types/common/telemetry/interfaces/IChatSDKLogger.d.ts +1 -0
- package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +2 -0
- package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +12 -0
- package/lib/types/common/utils.d.ts +8 -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/headerstateful/interfaces/IHeaderStatefulParams.d.ts +5 -1
- package/lib/types/components/livechatwidget/common/ActivityStreamHandler.d.ts +14 -0
- 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/ActivitySubscriber/PauseActivitySubscriber.d.ts +7 -0
- package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -0
- package/lib/types/components/livechatwidget/common/Deferred.d.ts +9 -0
- package/lib/types/components/livechatwidget/common/authHelper.d.ts +5 -0
- package/lib/types/components/livechatwidget/common/disposeTelemetryLoggers.d.ts +1 -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/ILiveChatWidgetControlProps.d.ts +1 -0
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +4 -1
- package/lib/types/components/prechatsurveypanestateful/interfaces/IPreChatSurveyPaneStatefulParams.d.ts +1 -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/defaultStyles/defaultAdaptiveCardStyles.d.ts +2 -0
- 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/IAdaptiveCardStyles.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.d.ts +3 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +0 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.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/defaultStyles/defaultReceivedMessageAnchorStyles.d.ts +2 -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 +5 -1
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +14 -8
- package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +1 -2
- package/lib/types/plugins/newMessageEventHandler.d.ts +2 -0
- package/package.json +13 -12
- 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,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";
|
|
@@ -7,11 +9,12 @@ import createAttachmentMiddleware from "../../../webchatcontainerstateful/webcha
|
|
|
7
9
|
import { createAvatarMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware";
|
|
8
10
|
import { createMarkdown } from "../createMarkdown";
|
|
9
11
|
import { groupActivitiesMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware";
|
|
10
|
-
import { typingIndicatorMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware";
|
|
12
|
+
import { typingIndicatorMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware";
|
|
13
|
+
import { createWebChatTelemetry } from "../../../webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger"; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11
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,10 @@ 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+",
|
|
322
|
+
ariaLabelUnreadMessageString: "you have new messages"
|
|
329
323
|
},
|
|
330
324
|
styleProps: {
|
|
331
325
|
generalStyleProps: {
|
|
@@ -366,7 +360,7 @@ export const dummyDefaultProps = {
|
|
|
366
360
|
margin: "-2px -2px -2px -3px",
|
|
367
361
|
justifyContent: "center",
|
|
368
362
|
backgroundSize: "65% 65%",
|
|
369
|
-
backgroundImage:
|
|
363
|
+
backgroundImage: `url(${ModernChatIconBase64})`,
|
|
370
364
|
display: "flex",
|
|
371
365
|
backgroundRepeat: "no-repeat",
|
|
372
366
|
backgroundPosition: "center"
|
|
@@ -876,7 +870,7 @@ export const dummyDefaultProps = {
|
|
|
876
870
|
className: undefined
|
|
877
871
|
},
|
|
878
872
|
closeButtonProps: {
|
|
879
|
-
id: "oc-lcw-header-
|
|
873
|
+
id: "oc-lcw-header-close-button",
|
|
880
874
|
type: "icon",
|
|
881
875
|
iconName: "ChromeClose",
|
|
882
876
|
ariaLabel: "Close",
|
|
@@ -887,7 +881,7 @@ export const dummyDefaultProps = {
|
|
|
887
881
|
},
|
|
888
882
|
headerIconProps: {
|
|
889
883
|
id: "oc-lcw-header-icon",
|
|
890
|
-
src:
|
|
884
|
+
src: ModernChatIconBase64,
|
|
891
885
|
alt: "Chat Icon",
|
|
892
886
|
className: undefined
|
|
893
887
|
},
|
|
@@ -1012,7 +1006,7 @@ export const dummyDefaultProps = {
|
|
|
1012
1006
|
alignSelf: "auto"
|
|
1013
1007
|
},
|
|
1014
1008
|
iconImageProps: {
|
|
1015
|
-
src: "
|
|
1009
|
+
src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIw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gMCAwIDAgMCAxIDAgMCAwIDAgMSAwIDAgMCAwLjE2IDAiLz4NCjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJlZmZlY3QyX2lubmVyU2hhZG93IiByZXN1bHQ9ImVmZmVjdDNfaW5uZXJTaGFkb3ciLz4NCjwvZmlsdGVyPg0KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDBfbGluZWFyIiB4MT0iLTAuMzk1MDAxIiB5MT0iMjMuMTI4MiIgeDI9IjIwLjEwNTgiIHkyPSIzNy44NDc0IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+DQo8c3RvcCBzdG9wLWNvbG9yPSIjRUZFRkVGIi8+DQo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IndoaXRlIi8+DQo8L2xpbmVhckdyYWRpZW50Pg0KPC9kZWZzPg0KPC9zdmc+DQo=",
|
|
1016
1010
|
imageFit: 0,
|
|
1017
1011
|
width: "86px",
|
|
1018
1012
|
height: "86px",
|
|
@@ -1192,7 +1186,17 @@ export const dummyDefaultProps = {
|
|
|
1192
1186
|
hideSubtitle: false,
|
|
1193
1187
|
subtitleText: "Live chat support!",
|
|
1194
1188
|
hideCloseButton: false,
|
|
1195
|
-
|
|
1189
|
+
closeButtonProps: {
|
|
1190
|
+
id: "oc-lcw-proactivechat-closebutton",
|
|
1191
|
+
type: "icon",
|
|
1192
|
+
iconName: "ChromeClose",
|
|
1193
|
+
ariaLabel: "Close",
|
|
1194
|
+
imageIconProps: undefined,
|
|
1195
|
+
text: "Close",
|
|
1196
|
+
onClick: undefined,
|
|
1197
|
+
className: undefined,
|
|
1198
|
+
hideButtonTitle: true
|
|
1199
|
+
},
|
|
1196
1200
|
isBodyContainerHorizantal: false,
|
|
1197
1201
|
hideBodyTitle: false,
|
|
1198
1202
|
bodyTitleText: "Hi! Have any questions? I am here to help.",
|
|
@@ -1220,7 +1224,7 @@ export const dummyDefaultProps = {
|
|
|
1220
1224
|
},
|
|
1221
1225
|
headerContainerStyleProps: {
|
|
1222
1226
|
backgroundColor: "rgb(49, 95, 162)",
|
|
1223
|
-
backgroundImage:
|
|
1227
|
+
backgroundImage: `url(${ProactiveChatBannerBase64})`,
|
|
1224
1228
|
backgroundPosition: "initial",
|
|
1225
1229
|
backgroundRepeat: "no-repeat",
|
|
1226
1230
|
borderTopLeftRadius: "inherit",
|
|
@@ -1248,7 +1252,7 @@ export const dummyDefaultProps = {
|
|
|
1248
1252
|
fontWeight: "600"
|
|
1249
1253
|
},
|
|
1250
1254
|
closeButtonStyleProps: {
|
|
1251
|
-
backgroundImage:
|
|
1255
|
+
backgroundImage: `url(${CloseChatButtonIconBase64})`,
|
|
1252
1256
|
backgroundPosition: "center",
|
|
1253
1257
|
backgroundRepeat: "no-repeat",
|
|
1254
1258
|
color: "#605e5c",
|
|
@@ -1371,7 +1375,7 @@ export const dummyDefaultProps = {
|
|
|
1371
1375
|
lineHeight: "19px"
|
|
1372
1376
|
},
|
|
1373
1377
|
iconStyleProps: {
|
|
1374
|
-
backgroundImage:
|
|
1378
|
+
backgroundImage: `url(${ChatReconnectIconBase64})`,
|
|
1375
1379
|
backgroundPosition: "center",
|
|
1376
1380
|
backgroundRepeat: "no-repeat",
|
|
1377
1381
|
backgroundSize: "200px",
|
|
@@ -1420,9 +1424,9 @@ export const dummyDefaultProps = {
|
|
|
1420
1424
|
startNewChatButtonClassName: undefined
|
|
1421
1425
|
}
|
|
1422
1426
|
},
|
|
1423
|
-
authClientFunction: undefined,
|
|
1424
1427
|
isReconnectEnabled: undefined,
|
|
1425
|
-
reconnectId: undefined
|
|
1428
|
+
reconnectId: undefined,
|
|
1429
|
+
redirectInSameWindow: undefined
|
|
1426
1430
|
},
|
|
1427
1431
|
styleProps: {
|
|
1428
1432
|
generalStyles: {
|
|
@@ -1494,7 +1498,7 @@ export const dummyDefaultProps = {
|
|
|
1494
1498
|
internalErrorBoxClass: undefined,
|
|
1495
1499
|
internalRenderErrorBox: undefined,
|
|
1496
1500
|
locale: "en-US",
|
|
1497
|
-
onTelemetry:
|
|
1501
|
+
onTelemetry: createWebChatTelemetry(),
|
|
1498
1502
|
overrideLocalizedStrings: undefined,
|
|
1499
1503
|
renderMarkdown: createMarkdown(false, false),
|
|
1500
1504
|
scrollToEndButtonMiddleware: undefined,
|
|
@@ -1661,6 +1665,9 @@ export const dummyDefaultProps = {
|
|
|
1661
1665
|
},
|
|
1662
1666
|
attachmentSizeStyles: {
|
|
1663
1667
|
display: "none"
|
|
1668
|
+
},
|
|
1669
|
+
receivedMessageAnchorStyles: {
|
|
1670
|
+
color: "white"
|
|
1664
1671
|
}
|
|
1665
1672
|
},
|
|
1666
1673
|
localizedTexts: {
|
|
@@ -1684,6 +1691,16 @@ export const dummyDefaultProps = {
|
|
|
1684
1691
|
MIDDLEWARE_MESSAGE_RETRY: "Retry",
|
|
1685
1692
|
PRECHAT_REQUIRED_FIELD_MISSING_MESSAGE: "{0} field is required",
|
|
1686
1693
|
MARKDOWN_EXTERNAL_LINK_ALT: "Opens in a new window; external."
|
|
1694
|
+
},
|
|
1695
|
+
botMagicCode: {
|
|
1696
|
+
disabled: false,
|
|
1697
|
+
fwdUrl: ""
|
|
1698
|
+
},
|
|
1699
|
+
adaptiveCardStyles: {
|
|
1700
|
+
background: "white",
|
|
1701
|
+
color: "black"
|
|
1687
1702
|
}
|
|
1688
|
-
}
|
|
1703
|
+
},
|
|
1704
|
+
telemetryConfig: undefined,
|
|
1705
|
+
getAuthToken: undefined
|
|
1689
1706
|
};
|
|
@@ -1,53 +1,150 @@
|
|
|
1
|
-
import { LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
1
|
+
import { BroadcastEvent, LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
2
|
+
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
2
3
|
import { ConversationState } from "../../../contexts/common/ConversationState";
|
|
3
4
|
import { LiveChatWidgetActionType } from "../../../contexts/common/LiveChatWidgetActionType";
|
|
4
|
-
import { NotificationHandler } from "../../webchatcontainerstateful/webchatcontroller/notification/NotificationHandler";
|
|
5
|
-
import { NotificationScenarios } from "../../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios";
|
|
6
5
|
import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
|
|
7
6
|
import { WebChatStoreLoader } from "../../webchatcontainerstateful/webchatcontroller/WebChatStoreLoader";
|
|
8
7
|
import { defaultWebChatContainerStatefulProps } from "../../webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps";
|
|
9
|
-
import {
|
|
8
|
+
import { PostChatSurveyMode } from "../../postchatsurveypanestateful/enums/PostChatSurveyMode";
|
|
9
|
+
import { Constants } from "../../../common/Constants";
|
|
10
|
+
import { addDelayInMs, getWidgetEndChatEventName } from "../../../common/utils"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _props$webChatContain;
|
|
12
|
+
const prepareEndChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, state) => {
|
|
13
|
+
var _state$domainStates$l, _state$domainStates$l2, _state$domainStates$l3, _state$domainStates$l4, _conversationDetails;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
dispatch({
|
|
26
|
-
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
27
|
-
payload: ConversationState.Closed
|
|
28
|
-
});
|
|
29
|
-
dispatch({
|
|
30
|
-
type: LiveChatWidgetActionType.SET_RECONNECT_ID,
|
|
31
|
-
payload: undefined
|
|
32
|
-
});
|
|
33
|
-
dispatch({
|
|
34
|
-
type: LiveChatWidgetActionType.SET_AUDIO_NOTIFICATION,
|
|
35
|
-
payload: null
|
|
36
|
-
});
|
|
37
|
-
dispatch({
|
|
38
|
-
type: LiveChatWidgetActionType.SET_CHAT_TOKEN,
|
|
39
|
-
payload: undefined
|
|
40
|
-
});
|
|
41
|
-
BroadcastService.postMessage({
|
|
42
|
-
eventName: "EndChat"
|
|
43
|
-
});
|
|
44
|
-
} catch (ex) {
|
|
45
|
-
TelemetryHelper.logSDKEvent(LogLevel.ERROR, {
|
|
46
|
-
Event: TelemetryEvent.EndChatSDKCallFailed,
|
|
15
|
+
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;
|
|
16
|
+
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; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
+
|
|
18
|
+
let conversationDetails = undefined;
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
conversationDetails = await chatSDK.getConversationDetails();
|
|
22
|
+
} catch (erorr) {
|
|
23
|
+
TelemetryHelper.logActionEvent(LogLevel.ERROR, {
|
|
24
|
+
Event: TelemetryEvent.GetConversationDetailsException,
|
|
47
25
|
ExceptionDetails: {
|
|
48
|
-
exception:
|
|
26
|
+
exception: `Failed to get conversation details: ${erorr}`
|
|
49
27
|
}
|
|
50
28
|
});
|
|
51
|
-
NotificationHandler.notifyError(NotificationScenarios.Connection, "End Chat Call Failed: " + ex);
|
|
52
29
|
}
|
|
53
|
-
|
|
30
|
+
|
|
31
|
+
if (isPostChatEnabled === "true" && ((_conversationDetails = conversationDetails) === null || _conversationDetails === void 0 ? void 0 : _conversationDetails.canRenderPostChat) === Constants.truePascal) {
|
|
32
|
+
const skipEndChatSDK = false;
|
|
33
|
+
const skipCloseChat = true;
|
|
34
|
+
await endChat(props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, skipEndChatSDK, skipCloseChat, false);
|
|
35
|
+
|
|
36
|
+
if (postChatSurveyMode === PostChatSurveyMode.Embed) {
|
|
37
|
+
dispatch({
|
|
38
|
+
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
39
|
+
payload: ConversationState.PostchatLoading
|
|
40
|
+
});
|
|
41
|
+
await addDelayInMs(Constants.PostChatLoadingDurationInMs);
|
|
42
|
+
const loadPostChatEvent = {
|
|
43
|
+
eventName: BroadcastEvent.LoadPostChatSurvey
|
|
44
|
+
};
|
|
45
|
+
BroadcastService.postMessage(loadPostChatEvent);
|
|
46
|
+
} else if (postChatSurveyMode === PostChatSurveyMode.Link) {
|
|
47
|
+
dispatch({
|
|
48
|
+
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
49
|
+
payload: ConversationState.InActive
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
await endChat(props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, false, false, true);
|
|
57
|
+
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, skipEndChatSDK, skipCloseChat, postMessageToOtherTab) => {
|
|
61
|
+
if (!skipEndChatSDK) {
|
|
62
|
+
try {
|
|
63
|
+
TelemetryHelper.logSDKEvent(LogLevel.INFO, {
|
|
64
|
+
Event: TelemetryEvent.EndChatSDKCall
|
|
65
|
+
});
|
|
66
|
+
await (chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.endChat());
|
|
67
|
+
} catch (ex) {
|
|
68
|
+
TelemetryHelper.logSDKEvent(LogLevel.ERROR, {
|
|
69
|
+
Event: TelemetryEvent.EndChatSDKCallFailed,
|
|
70
|
+
ExceptionDetails: {
|
|
71
|
+
exception: ex
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
postMessageToOtherTab = false;
|
|
75
|
+
}
|
|
76
|
+
} // Need to clear these states immediately when chat ended from OC.
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
dispatch({
|
|
80
|
+
type: LiveChatWidgetActionType.SET_CUSTOM_CONTEXT,
|
|
81
|
+
payload: undefined
|
|
82
|
+
});
|
|
83
|
+
dispatch({
|
|
84
|
+
type: LiveChatWidgetActionType.SET_CHAT_TOKEN,
|
|
85
|
+
payload: undefined
|
|
86
|
+
});
|
|
87
|
+
dispatch({
|
|
88
|
+
type: LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT,
|
|
89
|
+
payload: undefined
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
if (!skipCloseChat) {
|
|
93
|
+
try {
|
|
94
|
+
var _props$webChatContain;
|
|
95
|
+
|
|
96
|
+
adapter === null || adapter === void 0 ? void 0 : adapter.end();
|
|
97
|
+
setAdapter(undefined);
|
|
98
|
+
setWebChatStyles({ ...defaultWebChatContainerStatefulProps.webChatStyles,
|
|
99
|
+
...((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.webChatStyles)
|
|
100
|
+
});
|
|
101
|
+
WebChatStoreLoader.store = null;
|
|
102
|
+
dispatch({
|
|
103
|
+
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
104
|
+
payload: ConversationState.Closed
|
|
105
|
+
});
|
|
106
|
+
dispatch({
|
|
107
|
+
type: LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY_AGENT,
|
|
108
|
+
payload: false
|
|
109
|
+
});
|
|
110
|
+
dispatch({
|
|
111
|
+
type: LiveChatWidgetActionType.SET_RECONNECT_ID,
|
|
112
|
+
payload: undefined
|
|
113
|
+
});
|
|
114
|
+
dispatch({
|
|
115
|
+
type: LiveChatWidgetActionType.SET_AUDIO_NOTIFICATION,
|
|
116
|
+
payload: null
|
|
117
|
+
});
|
|
118
|
+
dispatch({
|
|
119
|
+
type: LiveChatWidgetActionType.SET_UNREAD_MESSAGE_COUNT,
|
|
120
|
+
payload: 0
|
|
121
|
+
});
|
|
122
|
+
dispatch({
|
|
123
|
+
type: LiveChatWidgetActionType.SET_PROACTIVE_CHAT_PARAMS,
|
|
124
|
+
payload: {
|
|
125
|
+
proactiveChatBodyTitle: "",
|
|
126
|
+
proactiveChatEnablePrechat: false,
|
|
127
|
+
proactiveChatInNewWindow: false
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
if (postMessageToOtherTab) {
|
|
132
|
+
var _chatSDK$omnichannelC, _chatSDK$omnichannelC2, _props$controlProps;
|
|
133
|
+
|
|
134
|
+
const endChatEventName = getWidgetEndChatEventName(chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$omnichannelC = chatSDK.omnichannelConfig) === null || _chatSDK$omnichannelC === void 0 ? void 0 : _chatSDK$omnichannelC.orgId, chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$omnichannelC2 = chatSDK.omnichannelConfig) === null || _chatSDK$omnichannelC2 === void 0 ? void 0 : _chatSDK$omnichannelC2.widgetId, (props === null || props === void 0 ? void 0 : (_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.widgetInstanceId) ?? "");
|
|
135
|
+
BroadcastService.postMessage({
|
|
136
|
+
eventName: endChatEventName
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
} catch (error) {
|
|
140
|
+
TelemetryHelper.logActionEvent(LogLevel.ERROR, {
|
|
141
|
+
Event: TelemetryEvent.CloseChatMethodException,
|
|
142
|
+
ExceptionDetails: {
|
|
143
|
+
exception: `Failed to endChat: ${error}`
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export { prepareEndChat, endChat };
|
|
@@ -8,6 +8,9 @@ export const initCallingSdk = async (chatSDK, setVoiceVideoCallingSDK) => {
|
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
9
|
const callingSDK = await chatSDK.getVoiceVideoCalling();
|
|
10
10
|
setVoiceVideoCallingSDK(callingSDK);
|
|
11
|
+
TelemetryHelper.logCallingEvent(LogLevel.INFO, {
|
|
12
|
+
Event: TelemetryEvent.CallingSDKLoadSuccess
|
|
13
|
+
});
|
|
11
14
|
return true;
|
|
12
15
|
}
|
|
13
16
|
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { BroadcastEvent, LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
1
2
|
import { createStore } from "botframework-webchat";
|
|
3
|
+
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
2
4
|
import { ConversationState } from "../../../contexts/common/ConversationState";
|
|
3
5
|
import { LiveChatWidgetActionType } from "../../../contexts/common/LiveChatWidgetActionType";
|
|
4
6
|
import { PostChatSurveyMode } from "../../postchatsurveypanestateful/enums/PostChatSurveyMode";
|
|
7
|
+
import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
|
|
5
8
|
import { WebChatStoreLoader } from "../../webchatcontainerstateful/webchatcontroller/WebChatStoreLoader";
|
|
6
9
|
import attachmentProcessingMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware";
|
|
7
|
-
import { changeLanguageCodeFormatForWebChat } from "../../../common/utils";
|
|
10
|
+
import { addDelayInMs, changeLanguageCodeFormatForWebChat } from "../../../common/utils";
|
|
8
11
|
import channelDataMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware";
|
|
9
12
|
import { createActivityMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware";
|
|
10
13
|
import createAttachmentMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware";
|
|
@@ -14,6 +17,7 @@ import createConversationEndMiddleware from "../../webchatcontainerstateful/webc
|
|
|
14
17
|
import createDataMaskingMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware";
|
|
15
18
|
import { createMarkdown } from "./createMarkdown";
|
|
16
19
|
import createMaxMessageSizeValidator from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator";
|
|
20
|
+
import { createWebChatTelemetry } from "../../webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger";
|
|
17
21
|
import { defaultAttachmentProps } from "../../webchatcontainerstateful/common/defaultProps/defaultAttachmentProps";
|
|
18
22
|
import { defaultMiddlewareLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
19
23
|
import { defaultWebChatContainerStatefulProps } from "../../webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps";
|
|
@@ -23,10 +27,12 @@ import htmlPlayerMiddleware from "../../webchatcontainerstateful/webchatcontroll
|
|
|
23
27
|
import htmlTextMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware";
|
|
24
28
|
import preProcessingMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware";
|
|
25
29
|
import sanitizationMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware";
|
|
26
|
-
import {
|
|
30
|
+
import { createCardActionMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware";
|
|
31
|
+
import createMessageTimeStampMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware";
|
|
32
|
+
import { Constants } from "../../../common/Constants"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
33
|
|
|
28
34
|
export const initWebChatComposer = (props, chatSDK, state, dispatch, setWebChatStyles) => {
|
|
29
|
-
var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _state$domainStates$l, _state$domainStates$l2, _state$domainStates$l3, _state$domainStates$l4, _state$domainStates$l8, _state$domainStates$l9, _props$webChatContain7, _props$webChatContain8, _state$domainStates$r, _state$domainStates$r2, _props$webChatContain9, _props$webChatContain10, _state$domainStates$r3, _state$domainStates$r4, _props$webChatContain11, _props$webChatContain12, _defaultWebChatContai, _props$webChatContain13, _props$webChatContain14, _props$webChatContain15, _props$webChatContain16, _state$domainStates$r5, _state$domainStates$r6, _props$webChatContain17, _props$webChatContain18, _defaultWebChatContai2, _props$webChatContain19, _props$webChatContain20, _defaultWebChatContai3, _props$webChatContain21;
|
|
35
|
+
var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _state$domainStates$l, _state$domainStates$l2, _state$domainStates$l3, _state$domainStates$l4, _state$domainStates$l8, _state$domainStates$l9, _props$webChatContain7, _props$webChatContain8, _state$domainStates$r, _state$domainStates$r2, _props$webChatContain9, _props$webChatContain10, _state$domainStates$r3, _state$domainStates$r4, _props$webChatContain11, _props$webChatContain12, _defaultWebChatContai, _props$webChatContain13, _props$webChatContain14, _props$webChatContain15, _props$webChatContain16, _state$domainStates$r5, _state$domainStates$r6, _props$webChatContain17, _props$webChatContain18, _defaultWebChatContai2, _props$webChatContain19, _props$webChatContain20, _defaultWebChatContai3, _props$webChatContain21, _props$webChatContain22;
|
|
30
36
|
|
|
31
37
|
const localizedTexts = { ...defaultMiddlewareLocalizedTexts,
|
|
32
38
|
...((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.localizedTexts)
|
|
@@ -45,6 +51,11 @@ export const initWebChatComposer = (props, chatSDK, state, dispatch, setWebChatS
|
|
|
45
51
|
const conversationEndCallback = async () => {
|
|
46
52
|
var _props$webChatContain4, _props$webChatContain5;
|
|
47
53
|
|
|
54
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
55
|
+
Event: TelemetryEvent.ConversationEndedThreadEventReceived,
|
|
56
|
+
Description: "Conversation is ended by agent side or by timeout."
|
|
57
|
+
});
|
|
58
|
+
|
|
48
59
|
if ((props === null || props === void 0 ? void 0 : (_props$webChatContain4 = props.webChatContainerProps) === null || _props$webChatContain4 === void 0 ? void 0 : (_props$webChatContain5 = _props$webChatContain4.renderingMiddlewareProps) === null || _props$webChatContain5 === void 0 ? void 0 : _props$webChatContain5.hideSendboxOnConversationEnd) !== false) {
|
|
49
60
|
setWebChatStyles(styles => {
|
|
50
61
|
return { ...styles,
|
|
@@ -53,26 +64,47 @@ export const initWebChatComposer = (props, chatSDK, state, dispatch, setWebChatS
|
|
|
53
64
|
});
|
|
54
65
|
}
|
|
55
66
|
|
|
56
|
-
if (isPostChatEnabled === "true"
|
|
67
|
+
if (isPostChatEnabled === "true") {
|
|
68
|
+
if (postChatSurveyMode === PostChatSurveyMode.Embed) {
|
|
69
|
+
WebChatStoreLoader.store = null;
|
|
70
|
+
dispatch({
|
|
71
|
+
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
72
|
+
payload: ConversationState.PostchatLoading
|
|
73
|
+
});
|
|
74
|
+
await addDelayInMs(Constants.PostChatLoadingDurationInMs);
|
|
75
|
+
const loadPostChatEvent = {
|
|
76
|
+
eventName: BroadcastEvent.LoadPostChatSurvey
|
|
77
|
+
};
|
|
78
|
+
BroadcastService.postMessage(loadPostChatEvent);
|
|
79
|
+
} else if (postChatSurveyMode === PostChatSurveyMode.Link) {
|
|
80
|
+
dispatch({
|
|
81
|
+
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
82
|
+
payload: ConversationState.InActive
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
57
86
|
dispatch({
|
|
58
|
-
type: LiveChatWidgetActionType.
|
|
59
|
-
payload:
|
|
87
|
+
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
88
|
+
payload: ConversationState.InActive
|
|
60
89
|
});
|
|
61
90
|
dispatch({
|
|
62
|
-
type: LiveChatWidgetActionType.
|
|
63
|
-
payload:
|
|
91
|
+
type: LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY_AGENT,
|
|
92
|
+
payload: true
|
|
64
93
|
});
|
|
65
|
-
await setPostChatContextAndLoadSurvey(chatSDK, dispatch, true);
|
|
66
94
|
}
|
|
67
95
|
|
|
68
96
|
dispatch({
|
|
69
97
|
type: LiveChatWidgetActionType.SET_CHAT_TOKEN,
|
|
70
98
|
payload: undefined
|
|
71
99
|
});
|
|
100
|
+
dispatch({
|
|
101
|
+
type: LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT,
|
|
102
|
+
payload: undefined
|
|
103
|
+
});
|
|
72
104
|
};
|
|
73
105
|
|
|
74
106
|
webChatStore = createStore({}, //initial state
|
|
75
|
-
preProcessingMiddleware, attachmentProcessingMiddleware, createAttachmentUploadValidatorMiddleware((_state$domainStates$l5 = state.domainStates.liveChatConfig) === null || _state$domainStates$l5 === void 0 ? void 0 : _state$domainStates$l5.allowedFileExtensions, (_state$domainStates$l6 = state.domainStates.liveChatConfig) === null || _state$domainStates$l6 === void 0 ? void 0 : _state$domainStates$l6.maxUploadFileSize, localizedTexts), channelDataMiddleware, createConversationEndMiddleware(conversationEndCallback), createDataMaskingMiddleware((_state$domainStates$l7 = state.domainStates.liveChatConfig) === null || _state$domainStates$l7 === void 0 ? void 0 : _state$domainStates$l7.DataMaskingInfo), gifUploadMiddleware, htmlPlayerMiddleware, htmlTextMiddleware, createMaxMessageSizeValidator(localizedTexts), sanitizationMiddleware, // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
107
|
+
preProcessingMiddleware, attachmentProcessingMiddleware, createAttachmentUploadValidatorMiddleware((_state$domainStates$l5 = state.domainStates.liveChatConfig) === null || _state$domainStates$l5 === void 0 ? void 0 : _state$domainStates$l5.allowedFileExtensions, (_state$domainStates$l6 = state.domainStates.liveChatConfig) === null || _state$domainStates$l6 === void 0 ? void 0 : _state$domainStates$l6.maxUploadFileSize, localizedTexts), channelDataMiddleware, createConversationEndMiddleware(conversationEndCallback), createDataMaskingMiddleware((_state$domainStates$l7 = state.domainStates.liveChatConfig) === null || _state$domainStates$l7 === void 0 ? void 0 : _state$domainStates$l7.DataMaskingInfo), createMessageTimeStampMiddleware, gifUploadMiddleware, htmlPlayerMiddleware, htmlTextMiddleware, createMaxMessageSizeValidator(localizedTexts), sanitizationMiddleware, // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
108
|
...(((_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.storeMiddlewares) ?? []));
|
|
77
109
|
WebChatStoreLoader.store = webChatStore;
|
|
78
110
|
} // Initialize the remaining Web Chat props
|
|
@@ -89,7 +121,9 @@ export const initWebChatComposer = (props, chatSDK, state, dispatch, setWebChatS
|
|
|
89
121
|
avatarMiddleware: (_props$webChatContain15 = props.webChatContainerProps) !== null && _props$webChatContain15 !== void 0 && (_props$webChatContain16 = _props$webChatContain15.renderingMiddlewareProps) !== null && _props$webChatContain16 !== void 0 && _props$webChatContain16.disableAvatarMiddleware ? undefined : createAvatarMiddleware((_state$domainStates$r5 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r5 === void 0 ? void 0 : _state$domainStates$r5.avatarStyleProps, (_state$domainStates$r6 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r6 === void 0 ? void 0 : _state$domainStates$r6.avatarTextStyleProps),
|
|
90
122
|
groupActivitiesMiddleware: (_props$webChatContain17 = props.webChatContainerProps) !== null && _props$webChatContain17 !== void 0 && (_props$webChatContain18 = _props$webChatContain17.renderingMiddlewareProps) !== null && _props$webChatContain18 !== void 0 && _props$webChatContain18.disableGroupActivitiesMiddleware ? undefined : (_defaultWebChatContai2 = defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.groupActivitiesMiddleware,
|
|
91
123
|
typingIndicatorMiddleware: (_props$webChatContain19 = props.webChatContainerProps) !== null && _props$webChatContain19 !== void 0 && (_props$webChatContain20 = _props$webChatContain19.renderingMiddlewareProps) !== null && _props$webChatContain20 !== void 0 && _props$webChatContain20.disableTypingIndicatorMiddleware ? undefined : (_defaultWebChatContai3 = defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai3 === void 0 ? void 0 : _defaultWebChatContai3.typingIndicatorMiddleware,
|
|
92
|
-
|
|
124
|
+
onTelemetry: createWebChatTelemetry(),
|
|
125
|
+
cardActionMiddleware: createCardActionMiddleware(((_props$webChatContain21 = props.webChatContainerProps) === null || _props$webChatContain21 === void 0 ? void 0 : _props$webChatContain21.botMagicCode) || undefined),
|
|
126
|
+
...((_props$webChatContain22 = props.webChatContainerProps) === null || _props$webChatContain22 === void 0 ? void 0 : _props$webChatContain22.webChatProps)
|
|
93
127
|
};
|
|
94
128
|
return webChatProps;
|
|
95
129
|
};
|