@microsoft/omnichannel-chat-widget 0.1.0-main.a27ec4b → 0.1.0-main.a3902df
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/assets/Icons.js +4 -2
- package/lib/cjs/common/Constants.js +24 -171
- package/lib/cjs/common/KeyCodes.js +3 -4
- package/lib/cjs/common/contextDataStore/DataStoreManager.js +3 -5
- package/lib/cjs/common/storage/default/defaultCacheManager.js +5 -13
- package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +18 -21
- package/lib/cjs/common/storage/default/defaultInMemoryDataStore.js +2 -10
- package/lib/cjs/common/telemetry/TelemetryConstants.js +26 -23
- package/lib/cjs/common/telemetry/TelemetryHelper.js +21 -59
- package/lib/cjs/common/telemetry/TelemetryManager.js +3 -32
- package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +0 -2
- package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +30 -36
- package/lib/cjs/common/telemetry/loggers/consoleLogger.js +0 -9
- package/lib/cjs/common/utils.js +18 -105
- package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +8 -46
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +2 -24
- package/lib/cjs/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +3 -0
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +9 -33
- package/lib/cjs/components/dimlayer/DimLayer.js +0 -4
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +9 -37
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -8
- package/lib/cjs/components/footerstateful/FooterStateful.js +10 -34
- package/lib/cjs/components/footerstateful/audionotificationstateful/AudioNotificationStateful.js +0 -6
- package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +7 -45
- package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +6 -8
- package/lib/cjs/components/headerstateful/HeaderStateful.js +18 -31
- package/lib/cjs/components/livechatwidget/LiveChatWidget.js +2 -14
- package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +5 -10
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +3 -6
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +7 -12
- package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +14 -20
- package/lib/cjs/components/livechatwidget/common/Deferred.js +6 -11
- package/lib/cjs/components/livechatwidget/common/authHelper.js +4 -19
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -13
- package/lib/cjs/components/livechatwidget/common/createFooter.js +0 -10
- package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +2 -14
- package/lib/cjs/components/livechatwidget/common/createMarkdown.js +16 -24
- package/lib/cjs/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +14 -0
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +102 -45
- package/lib/cjs/components/livechatwidget/common/disposeTelemetryLoggers.js +0 -3
- package/lib/cjs/components/livechatwidget/common/endChat.js +50 -35
- package/lib/cjs/components/livechatwidget/common/getGeneralStylesForButton.js +0 -6
- package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +7 -16
- package/lib/cjs/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -8
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +29 -73
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +79 -152
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +4 -17
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +2 -11
- package/lib/cjs/components/livechatwidget/common/shareObservable.js +4 -8
- package/lib/cjs/components/livechatwidget/common/startChat.js +197 -120
- package/lib/cjs/components/livechatwidget/common/startProactiveChat.js +0 -8
- package/lib/cjs/components/livechatwidget/common/updateSessionDataForTelemetry.js +2 -11
- package/lib/cjs/components/livechatwidget/interfaces/IScrollBarProps.js +1 -0
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +200 -254
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +19 -19
- package/lib/cjs/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +57 -0
- package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +4 -17
- package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +4 -17
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +32 -23
- package/lib/cjs/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +1 -1
- package/lib/cjs/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +13 -0
- package/lib/cjs/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +0 -1
- package/lib/cjs/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.js +1 -0
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +10 -38
- package/lib/cjs/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +1 -1
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +2 -32
- package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +6 -24
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +19 -38
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +0 -7
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -6
- package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +12 -27
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +5 -18
- package/lib/cjs/components/webchatcontainerstateful/common/utils/BrowserInfo.js +2 -24
- package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +5 -15
- package/lib/cjs/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +5 -8
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +3 -5
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +3 -5
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +0 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +0 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +0 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +0 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +0 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +0 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +0 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +0 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +0 -7
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +0 -5
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +17 -41
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +9 -22
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +25 -61
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +7 -15
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +2 -13
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +0 -16
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +10 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +2 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +10 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.js +3 -9
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +2 -30
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +7 -18
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +8 -42
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +4 -22
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +13 -30
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +3 -9
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +6 -34
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +1 -10
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +1 -12
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +17 -19
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +1 -9
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +3 -9
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +13 -34
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +1 -10
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +7 -11
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +5 -14
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +1 -21
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +0 -12
- package/lib/cjs/contexts/ChatAdapterStore.js +0 -2
- package/lib/cjs/contexts/ChatContextStore.js +0 -2
- package/lib/cjs/contexts/ChatSDKStore.js +0 -2
- package/lib/cjs/contexts/common/ConversationState.js +0 -1
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +30 -29
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +7 -13
- package/lib/cjs/contexts/createReducer.js +154 -108
- package/lib/cjs/controller/componentController.js +2 -31
- package/lib/cjs/hooks/useChatAdapterStore.js +0 -6
- package/lib/cjs/hooks/useChatContextStore.js +0 -6
- package/lib/cjs/hooks/useChatSDKStore.js +0 -6
- package/lib/cjs/index.js +0 -5
- package/lib/cjs/plugins/newMessageEventHandler.js +19 -36
- package/lib/esm/assets/Icons.js +2 -1
- package/lib/esm/common/Constants.js +21 -158
- package/lib/esm/common/KeyCodes.js +3 -3
- package/lib/esm/common/contextDataStore/DataStoreManager.js +3 -3
- package/lib/esm/common/storage/default/defaultCacheManager.js +5 -6
- package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +19 -17
- package/lib/esm/common/storage/default/defaultInMemoryDataStore.js +2 -3
- package/lib/esm/common/telemetry/TelemetryConstants.js +30 -20
- package/lib/esm/common/telemetry/TelemetryHelper.js +21 -47
- package/lib/esm/common/telemetry/TelemetryManager.js +3 -19
- package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +28 -24
- package/lib/esm/common/telemetry/loggers/consoleLogger.js +0 -5
- package/lib/esm/common/utils.js +18 -53
- package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +8 -17
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +2 -7
- package/lib/esm/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +3 -0
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +11 -14
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +9 -16
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -6
- package/lib/esm/components/footerstateful/FooterStateful.js +12 -15
- package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +7 -35
- package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +6 -6
- package/lib/esm/components/headerstateful/HeaderStateful.js +18 -16
- package/lib/esm/components/livechatwidget/LiveChatWidget.js +2 -2
- package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +5 -7
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +3 -4
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +7 -9
- package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +14 -16
- package/lib/esm/components/livechatwidget/common/Deferred.js +6 -9
- package/lib/esm/components/livechatwidget/common/authHelper.js +4 -12
- package/lib/esm/components/livechatwidget/common/createAdapter.js +4 -6
- package/lib/esm/components/livechatwidget/common/createFooter.js +0 -1
- package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +2 -5
- package/lib/esm/components/livechatwidget/common/createMarkdown.js +18 -18
- package/lib/esm/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +7 -0
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +103 -31
- package/lib/esm/components/livechatwidget/common/endChat.js +52 -20
- package/lib/esm/components/livechatwidget/common/getGeneralStylesForButton.js +0 -2
- package/lib/esm/components/livechatwidget/common/initCallingSdk.js +9 -11
- package/lib/esm/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -5
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +31 -38
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +77 -130
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +4 -9
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +4 -3
- package/lib/esm/components/livechatwidget/common/shareObservable.js +4 -7
- package/lib/esm/components/livechatwidget/common/startChat.js +196 -91
- package/lib/esm/components/livechatwidget/common/updateSessionDataForTelemetry.js +4 -2
- package/lib/esm/components/livechatwidget/interfaces/IScrollBarProps.js +1 -0
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +202 -188
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +19 -7
- package/lib/esm/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +50 -0
- package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +4 -5
- package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +4 -5
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +32 -11
- package/lib/esm/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +1 -1
- package/lib/esm/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +6 -0
- package/lib/esm/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +0 -1
- package/lib/esm/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.js +1 -0
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +12 -22
- package/lib/esm/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +1 -1
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +4 -8
- package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +6 -6
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +17 -11
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -2
- package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +12 -19
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +5 -14
- package/lib/esm/components/webchatcontainerstateful/common/utils/BrowserInfo.js +2 -16
- package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +5 -5
- package/lib/esm/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +5 -6
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +3 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +3 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +0 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +0 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +0 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +0 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +0 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +0 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +0 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +0 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +2 -5
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +0 -4
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +17 -26
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +11 -14
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +25 -39
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +9 -8
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +2 -9
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +0 -14
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +3 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +3 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.js +3 -7
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +4 -28
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +8 -9
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +9 -28
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +5 -14
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +15 -19
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +5 -8
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +6 -29
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +3 -7
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +3 -8
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +17 -14
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +3 -7
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +3 -7
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +15 -27
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +3 -5
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +9 -9
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +7 -9
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +1 -13
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +0 -5
- package/lib/esm/contexts/ChatAdapterStore.js +2 -1
- package/lib/esm/contexts/ChatContextStore.js +2 -1
- package/lib/esm/contexts/ChatSDKStore.js +2 -1
- package/lib/esm/contexts/common/ConversationState.js +0 -1
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +30 -29
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +7 -7
- package/lib/esm/contexts/createReducer.js +154 -105
- package/lib/esm/controller/componentController.js +3 -2
- package/lib/esm/hooks/useChatAdapterStore.js +0 -4
- package/lib/esm/hooks/useChatContextStore.js +0 -4
- package/lib/esm/hooks/useChatSDKStore.js +0 -4
- package/lib/esm/plugins/newMessageEventHandler.js +19 -26
- package/lib/types/assets/Icons.d.ts +1 -0
- package/lib/types/common/Constants.d.ts +14 -0
- package/lib/types/common/storage/default/defaultCacheManager.d.ts +1 -1
- package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +1 -1
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +15 -4
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +4 -4
- package/lib/types/common/telemetry/definitions/Payload.d.ts +1 -0
- package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +4 -0
- package/lib/types/components/livechatwidget/common/defaultProps/defaultScrollBarProps.d.ts +2 -0
- package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +5 -7
- package/lib/types/components/livechatwidget/common/startChat.d.ts +5 -4
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +3 -1
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +4 -2
- package/lib/types/components/livechatwidget/interfaces/IScrollBarProps.d.ts +22 -0
- package/lib/types/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.d.ts +2 -0
- package/lib/types/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.d.ts +2 -2
- package/lib/types/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.d.ts +5 -0
- package/lib/types/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.d.ts +4 -0
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +0 -1
- package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.d.ts +3 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.d.ts +3 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +1 -1
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +3 -2
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +30 -28
- package/package.json +3 -3
|
@@ -1,27 +1,29 @@
|
|
|
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
|
-
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
4
|
import { DefaultActivitySubscriber } from "./ActivitySubscriber/DefaultActivitySubscriber";
|
|
4
5
|
import { shareObservable } from "./shareObservable";
|
|
5
6
|
export class ChatAdapterShim {
|
|
6
7
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
+
|
|
7
9
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
+
|
|
8
11
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
+
|
|
9
13
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
14
|
constructor(chatAdapter) {
|
|
11
15
|
_defineProperty(this, "chatAdapter", void 0);
|
|
12
|
-
|
|
13
16
|
_defineProperty(this, "activityObserver", void 0);
|
|
14
|
-
|
|
15
17
|
_defineProperty(this, "subscribers", void 0);
|
|
16
|
-
|
|
17
18
|
this.subscribers = [];
|
|
18
|
-
this.chatAdapter = {
|
|
19
|
-
|
|
19
|
+
this.chatAdapter = {
|
|
20
|
+
...chatAdapter,
|
|
21
|
+
activity$: shareObservable(
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
23
|
new window.Observable(observer => {
|
|
21
|
-
this.activityObserver = observer;
|
|
22
|
-
|
|
24
|
+
this.activityObserver = observer;
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
26
|
const abortController = new window.AbortController();
|
|
24
|
-
|
|
25
27
|
(async () => {
|
|
26
28
|
try {
|
|
27
29
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -31,29 +33,25 @@ export class ChatAdapterShim {
|
|
|
31
33
|
for (const subscriber of [...this.subscribers, new DefaultActivitySubscriber()]) {
|
|
32
34
|
subscriber.observer = this.activityObserver;
|
|
33
35
|
activity = await subscriber.next(activity);
|
|
34
|
-
|
|
35
36
|
if (!activity) {
|
|
36
37
|
break;
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
|
-
|
|
41
41
|
observer.complete();
|
|
42
42
|
} catch (error) {
|
|
43
43
|
observer.error(error);
|
|
44
44
|
}
|
|
45
45
|
})();
|
|
46
|
-
|
|
47
46
|
return () => {
|
|
48
47
|
abortController.abort();
|
|
49
48
|
};
|
|
50
49
|
}))
|
|
51
50
|
};
|
|
52
|
-
}
|
|
53
|
-
|
|
51
|
+
}
|
|
54
52
|
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
54
|
addSubscriber(subscriber) {
|
|
56
55
|
this.subscribers.push(subscriber);
|
|
57
56
|
}
|
|
58
|
-
|
|
59
57
|
}
|
|
@@ -1,33 +1,30 @@
|
|
|
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
|
-
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
4
|
export class Deferred {
|
|
4
5
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
|
+
|
|
5
7
|
constructor() {
|
|
6
8
|
_defineProperty(this, "_promise", void 0);
|
|
7
|
-
|
|
8
9
|
_defineProperty(this, "_resolve", void 0);
|
|
9
|
-
|
|
10
10
|
_defineProperty(this, "_reject", () => {
|
|
11
11
|
return;
|
|
12
12
|
});
|
|
13
|
-
|
|
14
13
|
_defineProperty(this, "resolve", value => {
|
|
15
14
|
this._resolve(value);
|
|
16
15
|
});
|
|
17
|
-
|
|
18
16
|
_defineProperty(this, "reject", value => {
|
|
19
17
|
this._reject(value);
|
|
20
18
|
});
|
|
21
|
-
|
|
22
19
|
this._promise = new Promise((resolve, reject) => {
|
|
23
20
|
this._resolve = resolve;
|
|
24
21
|
this._reject = reject;
|
|
25
22
|
});
|
|
26
|
-
}
|
|
23
|
+
}
|
|
27
24
|
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
26
|
|
|
29
27
|
get promise() {
|
|
30
28
|
return this._promise;
|
|
31
29
|
}
|
|
32
|
-
|
|
33
30
|
}
|
|
@@ -1,29 +1,23 @@
|
|
|
1
1
|
import { LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
2
2
|
import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
|
|
3
3
|
import { isNullOrEmptyString } from "../../../common/utils";
|
|
4
|
-
|
|
5
4
|
const getAuthClientFunction = chatConfig => {
|
|
6
5
|
let authClientFunction = undefined;
|
|
7
|
-
|
|
8
6
|
if (chatConfig !== null && chatConfig !== void 0 && chatConfig.LiveChatConfigAuthSettings) {
|
|
9
7
|
var _chatConfig$LiveChatC;
|
|
10
|
-
|
|
11
8
|
authClientFunction = (chatConfig === null || chatConfig === void 0 ? void 0 : (_chatConfig$LiveChatC = chatConfig.LiveChatConfigAuthSettings) === null || _chatConfig$LiveChatC === void 0 ? void 0 : _chatConfig$LiveChatC.msdyn_javascriptclientfunction) ?? undefined;
|
|
12
9
|
}
|
|
13
|
-
|
|
14
10
|
return authClientFunction;
|
|
15
|
-
};
|
|
16
|
-
|
|
11
|
+
};
|
|
17
12
|
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
14
|
const handleAuthentication = async (chatSDK, chatConfig, getAuthToken) => {
|
|
19
15
|
const authClientFunction = getAuthClientFunction(chatConfig);
|
|
20
|
-
|
|
21
16
|
if (getAuthToken && authClientFunction) {
|
|
22
17
|
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
23
18
|
Event: TelemetryEvent.GetAuthTokenCalled
|
|
24
19
|
});
|
|
25
20
|
const token = await getAuthToken(authClientFunction);
|
|
26
|
-
|
|
27
21
|
if (!isNullOrEmptyString(token)) {
|
|
28
22
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
23
|
chatSDK.setAuthTokenProvider(async () => {
|
|
@@ -37,14 +31,12 @@ const handleAuthentication = async (chatSDK, chatConfig, getAuthToken) => {
|
|
|
37
31
|
return false;
|
|
38
32
|
}
|
|
39
33
|
}
|
|
40
|
-
|
|
41
34
|
return false;
|
|
42
|
-
};
|
|
43
|
-
|
|
35
|
+
};
|
|
44
36
|
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
38
|
const removeAuthTokenProvider = chatSDK => {
|
|
46
39
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
40
|
chatSDK.authenticatedUserToken = null;
|
|
48
41
|
};
|
|
49
|
-
|
|
50
42
|
export { getAuthClientFunction, handleAuthentication, removeAuthTokenProvider };
|
|
@@ -3,8 +3,9 @@ import { NotificationLevel } from "../../webchatcontainerstateful/webchatcontrol
|
|
|
3
3
|
import { NotificationScenarios } from "../../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios";
|
|
4
4
|
import { defaultMiddlewareLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
5
5
|
import { ChatAdapterShim } from "./ChatAdapterShim";
|
|
6
|
-
import { PauseActivitySubscriber } from "./ActivitySubscriber/PauseActivitySubscriber";
|
|
6
|
+
import { PauseActivitySubscriber } from "./ActivitySubscriber/PauseActivitySubscriber";
|
|
7
7
|
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
9
|
export const createAdapter = async chatSDK => {
|
|
9
10
|
const chatAdapterOptionalParams = {
|
|
10
11
|
IC3Adapter: {
|
|
@@ -13,11 +14,9 @@ export const createAdapter = async chatSDK => {
|
|
|
13
14
|
if (notification.id === NotificationScenarios.InternetConnection && notification.level == NotificationLevel.Error) {
|
|
14
15
|
notification.message = defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_NO_INTERNET_CONNECTION;
|
|
15
16
|
}
|
|
16
|
-
|
|
17
17
|
if (notification.id === NotificationScenarios.InternetConnection && notification.level == NotificationLevel.Success) {
|
|
18
18
|
notification.message = defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_INTERNET_BACK_ONLINE;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
20
|
if (notification.id && notification.message) {
|
|
22
21
|
NotificationHandler.notifyWithLevel(notification.id, notification.message, notification.level);
|
|
23
22
|
}
|
|
@@ -25,13 +24,12 @@ export const createAdapter = async chatSDK => {
|
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
};
|
|
28
|
-
let adapter = await chatSDK.createChatAdapter(chatAdapterOptionalParams);
|
|
29
|
-
|
|
27
|
+
let adapter = await chatSDK.createChatAdapter(chatAdapterOptionalParams);
|
|
28
|
+
//so far, there is no need to convert to the shim adapter when using visual tests
|
|
30
29
|
if (chatSDK.isMockModeOn !== true) {
|
|
31
30
|
adapter = new ChatAdapterShim(adapter);
|
|
32
31
|
adapter.addSubscriber(new PauseActivitySubscriber());
|
|
33
32
|
return adapter.chatAdapter;
|
|
34
33
|
}
|
|
35
|
-
|
|
36
34
|
return adapter;
|
|
37
35
|
};
|
|
@@ -4,7 +4,6 @@ import { decodeComponentString } from "@microsoft/omnichannel-chat-components";
|
|
|
4
4
|
import { shouldShowFooter } from "../../../controller/componentController";
|
|
5
5
|
export const createFooter = (props, state) => {
|
|
6
6
|
var _props$controlProps, _props$componentOverr;
|
|
7
|
-
|
|
8
7
|
const hideFooterDisplay = !((_props$controlProps = props.controlProps) !== null && _props$controlProps !== void 0 && _props$controlProps.hideFooter) && shouldShowFooter(state) ? false : true;
|
|
9
8
|
const footer = decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.footer) || /*#__PURE__*/React.createElement(FooterStateful, {
|
|
10
9
|
footerProps: props.footerProps,
|
|
@@ -4,7 +4,6 @@ import { NotificationScenarios } from "../../webchatcontainerstateful/webchatcon
|
|
|
4
4
|
import { defaultMiddlewareLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
5
5
|
import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
|
|
6
6
|
import { LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
7
|
-
|
|
8
7
|
const isInternetConnected = async () => {
|
|
9
8
|
try {
|
|
10
9
|
const response = await fetch(Constants.internetConnectionTestUrl);
|
|
@@ -14,11 +13,9 @@ const isInternetConnected = async () => {
|
|
|
14
13
|
return false;
|
|
15
14
|
}
|
|
16
15
|
};
|
|
17
|
-
|
|
18
16
|
export const createInternetConnectionChangeHandler = async () => {
|
|
19
17
|
const handler = async () => {
|
|
20
18
|
const connected = await isInternetConnected();
|
|
21
|
-
|
|
22
19
|
if (!connected) {
|
|
23
20
|
TelemetryHelper.logActionEvent(LogLevel.WARN, {
|
|
24
21
|
Event: TelemetryEvent.NetworkDisconnected
|
|
@@ -30,9 +27,9 @@ export const createInternetConnectionChangeHandler = async () => {
|
|
|
30
27
|
});
|
|
31
28
|
NotificationHandler.notifySuccess(NotificationScenarios.InternetConnection, defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_INTERNET_BACK_ONLINE);
|
|
32
29
|
}
|
|
33
|
-
};
|
|
34
|
-
|
|
30
|
+
};
|
|
35
31
|
|
|
32
|
+
// Checking connection status on online & offline events due to possible false positives
|
|
36
33
|
window.addEventListener("online", () => handler(), false);
|
|
37
34
|
window.addEventListener("offline", () => handler(), false);
|
|
38
35
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import MarkdownIt from "markdown-it";
|
|
2
2
|
import MarkdownItForInline from "markdown-it-for-inline";
|
|
3
3
|
import { defaultMarkdownLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts";
|
|
4
|
-
import { Constants } from "../../../common/Constants";
|
|
4
|
+
import { Constants } from "../../../common/Constants";
|
|
5
5
|
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
7
|
export const createMarkdown = (disableMarkdownMessageFormatting, disableNewLineMarkdownSupport) => {
|
|
7
8
|
let markdown;
|
|
8
|
-
|
|
9
9
|
if (!disableMarkdownMessageFormatting) {
|
|
10
10
|
markdown = new MarkdownIt(Constants.Default, {
|
|
11
11
|
html: true,
|
|
12
12
|
linkify: true,
|
|
13
13
|
breaks: !disableNewLineMarkdownSupport
|
|
14
|
-
});
|
|
14
|
+
});
|
|
15
|
+
// ToDo: Commenting below usage of plugin until deferred bug is resolved: https://github.com/mayashavin/markdown-it-slack/issues/1
|
|
15
16
|
// markdown.use(MarkdownSlack);
|
|
16
17
|
} else {
|
|
17
18
|
markdown = new MarkdownIt(Constants.Zero, {
|
|
@@ -19,38 +20,37 @@ export const createMarkdown = (disableMarkdownMessageFormatting, disableNewLineM
|
|
|
19
20
|
linkify: true,
|
|
20
21
|
breaks: !disableNewLineMarkdownSupport
|
|
21
22
|
});
|
|
22
|
-
markdown.enable(["entity",
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
23
|
+
markdown.enable(["entity",
|
|
24
|
+
// Rule to process html entity - {, ¯, "
|
|
25
|
+
"linkify",
|
|
26
|
+
// Rule to replace link-like texts with link nodes
|
|
27
|
+
"html_block",
|
|
28
|
+
// Rule to process html blocks and paragraphs
|
|
29
|
+
"html_inline",
|
|
30
|
+
// Rule to process html tags
|
|
26
31
|
"newline" // Rule to proceess '\n'
|
|
27
32
|
]);
|
|
28
|
-
}
|
|
29
|
-
|
|
33
|
+
}
|
|
30
34
|
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
36
|
markdown.use(MarkdownItForInline, "url_new_win", "link_open", function (tokens, idx, env) {
|
|
32
|
-
const targetAttrIndex = tokens[idx].attrIndex(Constants.Target);
|
|
33
|
-
|
|
37
|
+
const targetAttrIndex = tokens[idx].attrIndex(Constants.Target);
|
|
38
|
+
// Put a transparent pixel instead of the "open in new window" icon, so developers can easily modify the icon in CSS.
|
|
34
39
|
const TRANSPARENT_GIF = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
35
|
-
|
|
36
40
|
if (~targetAttrIndex) {
|
|
37
41
|
tokens[idx].attrs[targetAttrIndex][1] = Constants.Blank;
|
|
38
42
|
} else {
|
|
39
43
|
tokens[idx].attrPush([Constants.Target, Constants.Blank]);
|
|
40
44
|
}
|
|
41
|
-
|
|
42
45
|
const relAttrIndex = tokens[idx].attrIndex(Constants.TargetRelationship);
|
|
43
|
-
|
|
44
46
|
if (~relAttrIndex) {
|
|
45
47
|
tokens[idx].attrs[relAttrIndex][1] = Constants.TargetRelationshipAttributes;
|
|
46
48
|
} else {
|
|
47
49
|
tokens[idx].attrPush([Constants.TargetRelationship, Constants.TargetRelationshipAttributes]);
|
|
48
|
-
|
|
49
50
|
if (!disableMarkdownMessageFormatting) {
|
|
50
|
-
tokens[idx].attrPush([Constants.Title, defaultMarkdownLocalizedTexts.MARKDOWN_EXTERNAL_LINK_ALT]);
|
|
51
|
-
|
|
51
|
+
tokens[idx].attrPush([Constants.Title, defaultMarkdownLocalizedTexts.MARKDOWN_EXTERNAL_LINK_ALT]);
|
|
52
|
+
// eslint-disable-next-line quotes
|
|
52
53
|
const iconTokens = markdown.parseInline(``, env)[0].children;
|
|
53
|
-
|
|
54
54
|
if (iconTokens && iconTokens.length > 0) {
|
|
55
55
|
iconTokens[0].attrJoin("class", Constants.OpenLinkIconCssClass);
|
|
56
56
|
tokens.splice(idx + 2, 0, ...iconTokens);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-empty-function, @typescript-eslint/no-explicit-any */
|
|
2
|
+
|
|
2
3
|
import { ChatReconnectIconBase64, CloseChatButtonIconBase64, ModernChatIconBase64, ProactiveChatBannerBase64 } from "@microsoft/omnichannel-chat-components";
|
|
3
4
|
import MockAdapter from "../../../webchatcontainerstateful/common/mockadapter";
|
|
4
5
|
import { NewMessageNotificationSoundBase64 } from "../../../../assets/Audios";
|
|
@@ -8,10 +9,11 @@ import { createActivityMiddleware } from "../../../webchatcontainerstateful/webc
|
|
|
8
9
|
import createAttachmentMiddleware from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware";
|
|
9
10
|
import { createAvatarMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware";
|
|
10
11
|
import { createMarkdown } from "../createMarkdown";
|
|
12
|
+
import { createWebChatTelemetry } from "../../../webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger";
|
|
11
13
|
import { groupActivitiesMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware";
|
|
12
14
|
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
|
|
14
15
|
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
17
|
export const dummyDefaultProps = {
|
|
16
18
|
audioNotificationProps: {
|
|
17
19
|
audioSrc: NewMessageNotificationSoundBase64
|
|
@@ -166,24 +168,28 @@ export const dummyDefaultProps = {
|
|
|
166
168
|
},
|
|
167
169
|
audioCallButtonStyleProps: {
|
|
168
170
|
borderRadius: "50%",
|
|
169
|
-
color: "#FFFFFF",
|
|
170
171
|
backgroundColor: "#008000",
|
|
171
172
|
lineHeight: "40px",
|
|
172
173
|
height: "40px",
|
|
173
174
|
width: "40px",
|
|
174
|
-
|
|
175
|
+
icon: {
|
|
176
|
+
fontSize: 18,
|
|
177
|
+
color: "#FFFFFF"
|
|
178
|
+
}
|
|
175
179
|
},
|
|
176
180
|
audioCallButtonHoverStyleProps: {
|
|
177
181
|
filter: "brightness(0.8)"
|
|
178
182
|
},
|
|
179
183
|
videoCallButtonStyleProps: {
|
|
180
184
|
borderRadius: "50%",
|
|
181
|
-
color: "#FFFFFF",
|
|
182
185
|
backgroundColor: "#008000",
|
|
183
186
|
lineHeight: "40px",
|
|
184
187
|
height: "40px",
|
|
185
188
|
width: "40px",
|
|
186
|
-
|
|
189
|
+
icon: {
|
|
190
|
+
fontSize: 18,
|
|
191
|
+
color: "#FFFFFF"
|
|
192
|
+
}
|
|
187
193
|
},
|
|
188
194
|
videoCallButtonHoverStyleProps: {
|
|
189
195
|
filter: "brightness(0.8)"
|
|
@@ -194,13 +200,15 @@ export const dummyDefaultProps = {
|
|
|
194
200
|
},
|
|
195
201
|
declineCallButtonStyleProps: {
|
|
196
202
|
borderRadius: "50%",
|
|
197
|
-
color: "#FFFFFF",
|
|
198
203
|
backgroundColor: "#DC0000",
|
|
199
204
|
lineHeight: "40px",
|
|
200
205
|
height: "40px",
|
|
201
206
|
width: "40px",
|
|
202
|
-
|
|
203
|
-
|
|
207
|
+
marginLeft: "5px",
|
|
208
|
+
icon: {
|
|
209
|
+
fontSize: 18,
|
|
210
|
+
color: "#FFFFFF"
|
|
211
|
+
}
|
|
204
212
|
},
|
|
205
213
|
incomingCallTitleStyleProps: {
|
|
206
214
|
margin: "0 5px",
|
|
@@ -399,6 +407,7 @@ export const dummyDefaultProps = {
|
|
|
399
407
|
width: "90px",
|
|
400
408
|
cursor: "pointer",
|
|
401
409
|
overflow: "hidden",
|
|
410
|
+
padding: "0px",
|
|
402
411
|
whiteSpace: "nowrap"
|
|
403
412
|
},
|
|
404
413
|
subtitleStyleProps: {
|
|
@@ -406,12 +415,14 @@ export const dummyDefaultProps = {
|
|
|
406
415
|
fontWeight: "200",
|
|
407
416
|
color: "#666",
|
|
408
417
|
overflow: "hidden",
|
|
418
|
+
padding: "0px",
|
|
409
419
|
fontFamily: "'Segoe UI',Arial,sans-serif",
|
|
410
420
|
display: "block",
|
|
411
421
|
alignItems: "center",
|
|
412
422
|
margin: "0px 14px 0px 14px",
|
|
413
423
|
textOverflow: "ellipsis !important",
|
|
414
|
-
width: "
|
|
424
|
+
width: "90px",
|
|
425
|
+
whiteSpace: "nowrap",
|
|
415
426
|
cursor: "pointer"
|
|
416
427
|
},
|
|
417
428
|
classNames: {
|
|
@@ -461,28 +472,30 @@ export const dummyDefaultProps = {
|
|
|
461
472
|
cancelButtonText: "Cancel",
|
|
462
473
|
cancelButtonAriaLabel: "Cancel. Return to Chat",
|
|
463
474
|
brightnessValueOnDim: "0.2",
|
|
464
|
-
disableDimLayer: false,
|
|
465
475
|
onConfirm: () => {},
|
|
466
476
|
// Detailed implementation omitted
|
|
467
477
|
onCancel: () => {} // Detailed implementation omitted
|
|
468
|
-
|
|
469
478
|
},
|
|
479
|
+
|
|
470
480
|
styleProps: {
|
|
471
481
|
generalStyleProps: {
|
|
482
|
+
display: "flex",
|
|
483
|
+
minHeight: "160px",
|
|
484
|
+
maxHeight: "300px",
|
|
485
|
+
boxSizing: "border-box",
|
|
472
486
|
backgroundColor: "#FFFFFF",
|
|
473
487
|
borderRadius: "2px",
|
|
474
488
|
color: "black",
|
|
475
489
|
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
476
490
|
fontSize: "14px",
|
|
477
|
-
height: "160px",
|
|
478
491
|
padding: "10px 20px",
|
|
479
|
-
width: "262px",
|
|
480
492
|
position: "absolute",
|
|
481
493
|
justifyContent: "center",
|
|
482
494
|
alignItems: "center",
|
|
483
|
-
display: "flex",
|
|
484
495
|
flexFlow: "column",
|
|
485
|
-
zIndex: "9999"
|
|
496
|
+
zIndex: "9999",
|
|
497
|
+
left: "26px",
|
|
498
|
+
right: "26px"
|
|
486
499
|
},
|
|
487
500
|
titleStyleProps: {
|
|
488
501
|
color: "#323130",
|
|
@@ -504,10 +517,14 @@ export const dummyDefaultProps = {
|
|
|
504
517
|
},
|
|
505
518
|
buttonGroupStyleProps: {
|
|
506
519
|
display: "flex",
|
|
520
|
+
width: "auto",
|
|
521
|
+
height: "auto",
|
|
522
|
+
boxSizing: "border-box",
|
|
507
523
|
flexFlow: "row",
|
|
508
524
|
justifyContent: "center",
|
|
509
525
|
alignItems: "center",
|
|
510
|
-
gap: "10px"
|
|
526
|
+
gap: "10px",
|
|
527
|
+
marginBottom: "10px"
|
|
511
528
|
},
|
|
512
529
|
confirmButtonStyleProps: {
|
|
513
530
|
backgroundColor: "rgba(9,72,159,1)",
|
|
@@ -562,6 +579,7 @@ export const dummyDefaultProps = {
|
|
|
562
579
|
hideCallingContainer: false,
|
|
563
580
|
hideChatButton: false,
|
|
564
581
|
hideConfirmationPane: false,
|
|
582
|
+
hideErrorUIPane: false,
|
|
565
583
|
hideFooter: false,
|
|
566
584
|
hideHeader: false,
|
|
567
585
|
hideLoadingPane: false,
|
|
@@ -571,7 +589,7 @@ export const dummyDefaultProps = {
|
|
|
571
589
|
hideProactiveChatPane: false,
|
|
572
590
|
hideReconnectChatPane: false,
|
|
573
591
|
hideWebChatContainer: false,
|
|
574
|
-
|
|
592
|
+
hideStartChatButton: false
|
|
575
593
|
},
|
|
576
594
|
directLine: new MockAdapter(),
|
|
577
595
|
downloadTranscriptProps: {
|
|
@@ -612,7 +630,6 @@ export const dummyDefaultProps = {
|
|
|
612
630
|
cancelButtonText: "Cancel",
|
|
613
631
|
cancelButtonAriaLabel: "Cancel",
|
|
614
632
|
brightnessValueOnDim: "0.2",
|
|
615
|
-
disableDimLayer: false,
|
|
616
633
|
onSend: undefined,
|
|
617
634
|
onCancel: undefined,
|
|
618
635
|
checkInput: undefined
|
|
@@ -771,6 +788,7 @@ export const dummyDefaultProps = {
|
|
|
771
788
|
},
|
|
772
789
|
audioNotificationButtonProps: {
|
|
773
790
|
id: "oc-lcw-footer-audionotification-button",
|
|
791
|
+
type: "icon",
|
|
774
792
|
ariaLabel: "Turn sound off",
|
|
775
793
|
toggleAriaLabel: "Turn sound on",
|
|
776
794
|
iconName: "Volume3",
|
|
@@ -796,8 +814,10 @@ export const dummyDefaultProps = {
|
|
|
796
814
|
padding: "0 10px 5px 10px"
|
|
797
815
|
},
|
|
798
816
|
downloadTranscriptButtonStyleProps: {
|
|
799
|
-
|
|
800
|
-
|
|
817
|
+
icon: {
|
|
818
|
+
color: "blue",
|
|
819
|
+
fontSize: 16
|
|
820
|
+
},
|
|
801
821
|
height: "25px",
|
|
802
822
|
lineHeight: "25px",
|
|
803
823
|
width: "25px"
|
|
@@ -807,8 +827,10 @@ export const dummyDefaultProps = {
|
|
|
807
827
|
backgroundColor: "#C8C8C8"
|
|
808
828
|
},
|
|
809
829
|
emailTranscriptButtonStyleProps: {
|
|
810
|
-
|
|
811
|
-
|
|
830
|
+
cicon: {
|
|
831
|
+
color: "blue",
|
|
832
|
+
fontSize: 16
|
|
833
|
+
},
|
|
812
834
|
height: "25px",
|
|
813
835
|
lineHeight: "25px",
|
|
814
836
|
width: "25px"
|
|
@@ -818,8 +840,10 @@ export const dummyDefaultProps = {
|
|
|
818
840
|
backgroundColor: "#C8C8C8"
|
|
819
841
|
},
|
|
820
842
|
audioNotificationButtonStyleProps: {
|
|
821
|
-
|
|
822
|
-
|
|
843
|
+
icon: {
|
|
844
|
+
color: "blue",
|
|
845
|
+
fontSize: 16
|
|
846
|
+
},
|
|
823
847
|
height: "25px",
|
|
824
848
|
lineHeight: "25px",
|
|
825
849
|
width: "25px"
|
|
@@ -1049,8 +1073,8 @@ export const dummyDefaultProps = {
|
|
|
1049
1073
|
titleText: "We're Offline",
|
|
1050
1074
|
subtitleText: "No agents available",
|
|
1051
1075
|
onClick: () => {} // Detailed implementation omitted
|
|
1052
|
-
|
|
1053
1076
|
},
|
|
1077
|
+
|
|
1054
1078
|
styleProps: {
|
|
1055
1079
|
// ...[Existing chat button style props]
|
|
1056
1080
|
iconStyleProps: {
|
|
@@ -1068,8 +1092,8 @@ export const dummyDefaultProps = {
|
|
|
1068
1092
|
text: "We're Offline"
|
|
1069
1093
|
},
|
|
1070
1094
|
onMinimizeClick: () => {} // Detailed implementation omitted
|
|
1071
|
-
|
|
1072
1095
|
},
|
|
1096
|
+
|
|
1073
1097
|
styleProps: {
|
|
1074
1098
|
// ...[Existing chat button style props]
|
|
1075
1099
|
generalStyleProps: {
|
|
@@ -1095,7 +1119,8 @@ export const dummyDefaultProps = {
|
|
|
1095
1119
|
dir: "auto",
|
|
1096
1120
|
hideOOOHPane: false,
|
|
1097
1121
|
hideTitle: false,
|
|
1098
|
-
titleText: "Thanks for contacting us. You have reached us outside of our operating hours. An agent will respond when we open."
|
|
1122
|
+
titleText: "Thanks for contacting us. You have reached us outside of our operating hours. An agent will respond when we open. Please see link https://microsoft.com",
|
|
1123
|
+
openLinkInNewTab: true
|
|
1099
1124
|
},
|
|
1100
1125
|
styleProps: {
|
|
1101
1126
|
generalStyleProps: {
|
|
@@ -1138,7 +1163,7 @@ export const dummyDefaultProps = {
|
|
|
1138
1163
|
subtitleText: "Please take a moment to give us feedback about your chat experience. We are loading the survey for you now."
|
|
1139
1164
|
},
|
|
1140
1165
|
styleProps: {
|
|
1141
|
-
// ...[Existing
|
|
1166
|
+
// ...[Existing loading pane style props]
|
|
1142
1167
|
generalStyleProps: {
|
|
1143
1168
|
position: "initial",
|
|
1144
1169
|
width: "100%",
|
|
@@ -1166,6 +1191,48 @@ export const dummyDefaultProps = {
|
|
|
1166
1191
|
backgroundColor: "#FFFFFF",
|
|
1167
1192
|
borderColor: "#F1F1F1"
|
|
1168
1193
|
}
|
|
1194
|
+
},
|
|
1195
|
+
isCustomerVoiceSurveyCompact: undefined
|
|
1196
|
+
},
|
|
1197
|
+
preChatSurveyPaneProps: {
|
|
1198
|
+
controlProps: {
|
|
1199
|
+
id: "oc-lcw-prechatsurveypane-default",
|
|
1200
|
+
dir: "auto",
|
|
1201
|
+
hidePreChatSurveyPane: false,
|
|
1202
|
+
adaptiveCardHostConfig: "{\"fontFamily\":\"Segoe UI, Helvetica Neue, sans-serif\",\"containerStyles\":{\"default\":{\"foregroundColors\":{\"default\":{\"default\":\"#000000\"}},\"backgroundColor\":\"#FFFFFF\"}},\"actions\":{\"actionsOrientation\":\"Vertical\",\"actionAlignment\":\"stretch\"}}",
|
|
1203
|
+
payload: "{\"$schema\":\"http://adaptivecards.io/schemas/adaptive-card.json\",\"type\":\"AdaptiveCard\",\"version\":\"1.1\",\"body\":[{\"type\":\"TextBlock\",\"weight\":\"bolder\",\"text\":\"Please answer below questions.\"},{\"type\":\"Input.Text\",\"id\":\"1e5e4e7a-8f0b-ec11-b6e6-000d3a305d38\",\"label\":\"name pls?\",\"maxLength\":100,\"isRequired\":true,\"errorMessage\":\"Name is required\"},{\"type\":\"Input.Text\",\"id\":\"7f8f5d6d-995e-ec11-8f8f-000d3a31376e\",\"label\":\"multi\\nmulti\\nmulti\",\"style\":\"text\",\"isMultiline\":true,\"maxLength\":250},{\"type\":\"Input.ChoiceSet\",\"id\":\"e4bdf7cb-995e-ec11-8f8f-000d3a31376e\",\"label\":\"options\",\"isMultiSelect\":false,\"value\":\"1\",\"style\":\"compact\",\"choices\":[{\"title\":\"one\",\"value\":\"1\"},{\"title\":\"two\",\"value\":\"2\"},{\"title\":\"three\",\"value\":\"3\"}]},{\"type\":\"Input.Toggle\",\"id\":\"b26011d2-995e-ec11-8f8f-000d3a31376e\",\"title\":\"consent\",\"valueOn\":\"True\",\"valueOff\":\"False\",\"value\":\"false\"},{\"type\":\"TextBlock\",\"isSubtle\":true,\"text\":\"Fields marked with * are mandatory.\",\"wrap\":true}],\"actions\":[{\"type\":\"Action.Submit\",\"title\":\"Submit\",\"data\":{\"Type\":\"InputSubmit\"}}]}",
|
|
1204
|
+
onSubmit: function () {} // Detailed implementation omitted
|
|
1205
|
+
},
|
|
1206
|
+
|
|
1207
|
+
styleProps: {
|
|
1208
|
+
generalStyleProps: {
|
|
1209
|
+
borderStyle: "solid",
|
|
1210
|
+
borderRadius: "4px",
|
|
1211
|
+
borderWidth: "0px",
|
|
1212
|
+
backgroundColor: "#FFFFFF",
|
|
1213
|
+
borderColor: "#F1F1F1",
|
|
1214
|
+
overflowY: "auto",
|
|
1215
|
+
height: "inherit",
|
|
1216
|
+
width: "inherit"
|
|
1217
|
+
},
|
|
1218
|
+
customButtonStyleProps: {
|
|
1219
|
+
backgroundColor: "rgb(49, 95, 162)",
|
|
1220
|
+
color: "#FFFFFF",
|
|
1221
|
+
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
1222
|
+
fontSize: "15px",
|
|
1223
|
+
height: "48px"
|
|
1224
|
+
},
|
|
1225
|
+
adaptiveCardContainerStyleProps: {
|
|
1226
|
+
border: "1px solid #ECECEC",
|
|
1227
|
+
borderRadius: "4px",
|
|
1228
|
+
margin: "3%"
|
|
1229
|
+
},
|
|
1230
|
+
customTextInputStyleProps: {
|
|
1231
|
+
height: "20px"
|
|
1232
|
+
},
|
|
1233
|
+
customMultilineTextInputStyleProps: {
|
|
1234
|
+
height: "52px"
|
|
1235
|
+
}
|
|
1169
1236
|
}
|
|
1170
1237
|
},
|
|
1171
1238
|
proactiveChatPaneProps: {
|
|
@@ -1206,8 +1273,8 @@ export const dummyDefaultProps = {
|
|
|
1206
1273
|
onClose: () => {},
|
|
1207
1274
|
// Detailed implementation omitted
|
|
1208
1275
|
onStart: () => {} // Detailed implementation omitted
|
|
1209
|
-
|
|
1210
1276
|
},
|
|
1277
|
+
|
|
1211
1278
|
styleProps: {
|
|
1212
1279
|
generalStyleProps: {
|
|
1213
1280
|
backgroundColor: "rgb(255, 255, 255)",
|
|
@@ -1338,8 +1405,8 @@ export const dummyDefaultProps = {
|
|
|
1338
1405
|
onStartNewChat: () => {},
|
|
1339
1406
|
// Detailed implementation omitted
|
|
1340
1407
|
onMinimize: () => {} // Detailed implementation omitted
|
|
1341
|
-
|
|
1342
1408
|
},
|
|
1409
|
+
|
|
1343
1410
|
styleProps: {
|
|
1344
1411
|
generalStyleProps: {
|
|
1345
1412
|
backgroundColor: "rgb(255, 255, 255)",
|
|
@@ -1424,7 +1491,6 @@ export const dummyDefaultProps = {
|
|
|
1424
1491
|
startNewChatButtonClassName: undefined
|
|
1425
1492
|
}
|
|
1426
1493
|
},
|
|
1427
|
-
isReconnectEnabled: undefined,
|
|
1428
1494
|
reconnectId: undefined,
|
|
1429
1495
|
redirectInSameWindow: undefined
|
|
1430
1496
|
},
|
|
@@ -1546,6 +1612,12 @@ export const dummyDefaultProps = {
|
|
|
1546
1612
|
lineHeight: "16px",
|
|
1547
1613
|
padding: "0px 10px 0 10px"
|
|
1548
1614
|
},
|
|
1615
|
+
userMessageBoxStyles: {
|
|
1616
|
+
maxWidth: "90%"
|
|
1617
|
+
},
|
|
1618
|
+
systemMessageBoxStyles: {
|
|
1619
|
+
maxWidth: "90%"
|
|
1620
|
+
},
|
|
1549
1621
|
typingIndicatorStyleProps: {
|
|
1550
1622
|
marginLeft: "10px",
|
|
1551
1623
|
marginBottom: "5px",
|