@microsoft/omnichannel-chat-widget 0.1.0-main.07a2a56 → 0.1.0-main.0c0fd47
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 +20 -169
- 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 +3 -11
- package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +4 -16
- package/lib/cjs/common/storage/default/defaultInMemoryDataStore.js +2 -10
- package/lib/cjs/common/telemetry/TelemetryConstants.js +15 -23
- package/lib/cjs/common/telemetry/TelemetryHelper.js +19 -58
- 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 +2 -21
- 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 +4 -28
- package/lib/cjs/components/dimlayer/DimLayer.js +0 -4
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +4 -32
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -8
- package/lib/cjs/components/footerstateful/FooterStateful.js +6 -29
- 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 +7 -28
- 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 +60 -26
- 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 +0 -8
- package/lib/cjs/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -8
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +16 -54
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +78 -151
- 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 +141 -112
- 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 +201 -256
- 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 +27 -20
- 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/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -37
- 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 +3 -36
- 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 +3 -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 +8 -19
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +23 -60
- 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/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/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 +6 -28
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -11
- 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 +29 -28
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +2 -10
- package/lib/cjs/contexts/createReducer.js +152 -106
- 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 +15 -36
- package/lib/esm/assets/Icons.js +2 -1
- package/lib/esm/common/Constants.js +17 -156
- 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 +3 -4
- package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +4 -11
- package/lib/esm/common/storage/default/defaultInMemoryDataStore.js +2 -3
- package/lib/esm/common/telemetry/TelemetryConstants.js +19 -20
- package/lib/esm/common/telemetry/TelemetryHelper.js +19 -46
- package/lib/esm/common/telemetry/TelemetryManager.js +3 -19
- package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +2 -14
- 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 +6 -9
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +4 -11
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -6
- package/lib/esm/components/footerstateful/FooterStateful.js +8 -10
- 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 +7 -13
- 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 +62 -13
- 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 +2 -2
- package/lib/esm/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -5
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +18 -19
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +77 -131
- 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 +141 -84
- 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 +203 -190
- 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 +27 -7
- 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/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +11 -21
- 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 +3 -8
- 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 +3 -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 +10 -11
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +23 -38
- 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/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/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 +7 -14
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +3 -3
- 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 +29 -28
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +2 -4
- package/lib/esm/contexts/createReducer.js +152 -103
- 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 +15 -26
- package/lib/types/assets/Icons.d.ts +1 -0
- package/lib/types/common/Constants.d.ts +12 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +11 -4
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +2 -4
- 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 +3 -2
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +1 -1
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -0
- 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/enums/CustomerVoiceEvents.d.ts +5 -0
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +0 -1
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -1
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +29 -27
- package/package.json +3 -3
|
@@ -10,22 +10,22 @@ import { NotificationScenarios } from "../webchatcontainerstateful/webchatcontro
|
|
|
10
10
|
import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
11
11
|
import { downloadTranscript } from "./downloadtranscriptstateful/DownloadTranscriptStateful";
|
|
12
12
|
import useChatContextStore from "../../hooks/useChatContextStore";
|
|
13
|
-
import useChatSDKStore from "../../hooks/useChatSDKStore";
|
|
13
|
+
import useChatSDKStore from "../../hooks/useChatSDKStore";
|
|
14
14
|
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
16
|
export const FooterStateful = props => {
|
|
16
17
|
var _footerProps$controlP3, _footerProps$controlP4;
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
const [state, dispatch] = useChatContextStore();
|
|
19
|
+
// hideFooterDisplay - the purpose of this is to keep the footer always "active",
|
|
19
20
|
// but hide it visually in certain states (e.g., loading state) and show in some other states (e.g. active state).
|
|
20
21
|
// The reason for this approach is to make sure that state variables for audio notification work correctly after minimizing
|
|
21
|
-
|
|
22
22
|
const {
|
|
23
23
|
footerProps,
|
|
24
24
|
downloadTranscriptProps,
|
|
25
25
|
audioNotificationProps,
|
|
26
26
|
hideFooterDisplay
|
|
27
|
-
} = props;
|
|
28
|
-
|
|
27
|
+
} = props;
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
29
|
const chatSDK = useChatSDKStore();
|
|
30
30
|
const controlProps = {
|
|
31
31
|
id: "oc-lcw-footer",
|
|
@@ -49,20 +49,17 @@ export const FooterStateful = props => {
|
|
|
49
49
|
},
|
|
50
50
|
onEmailTranscriptClick: () => {
|
|
51
51
|
var _footerProps$controlP, _footerProps$controlP2;
|
|
52
|
-
|
|
53
52
|
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
54
53
|
Event: TelemetryEvent.EmailTranscriptButtonClicked,
|
|
55
54
|
Description: "Email Transcript button clicked."
|
|
56
55
|
});
|
|
57
56
|
const emailTranscriptButtonId = (footerProps === null || footerProps === void 0 ? void 0 : (_footerProps$controlP = footerProps.controlProps) === null || _footerProps$controlP === void 0 ? void 0 : (_footerProps$controlP2 = _footerProps$controlP.emailTranscriptButtonProps) === null || _footerProps$controlP2 === void 0 ? void 0 : _footerProps$controlP2.id) ?? `${controlProps.id}-emailtranscript-button`;
|
|
58
|
-
|
|
59
57
|
if (emailTranscriptButtonId) {
|
|
60
58
|
dispatch({
|
|
61
59
|
type: LiveChatWidgetActionType.SET_PREVIOUS_FOCUSED_ELEMENT_ID,
|
|
62
60
|
payload: emailTranscriptButtonId
|
|
63
61
|
});
|
|
64
62
|
}
|
|
65
|
-
|
|
66
63
|
dispatch({
|
|
67
64
|
type: LiveChatWidgetActionType.SET_SHOW_EMAIL_TRANSCRIPT_PANE,
|
|
68
65
|
payload: true
|
|
@@ -79,7 +76,8 @@ export const FooterStateful = props => {
|
|
|
79
76
|
});
|
|
80
77
|
},
|
|
81
78
|
...(footerProps === null || footerProps === void 0 ? void 0 : footerProps.controlProps),
|
|
82
|
-
audioNotificationButtonProps: {
|
|
79
|
+
audioNotificationButtonProps: {
|
|
80
|
+
...(footerProps === null || footerProps === void 0 ? void 0 : (_footerProps$controlP3 = footerProps.controlProps) === null || _footerProps$controlP3 === void 0 ? void 0 : _footerProps$controlP3.audioNotificationButtonProps),
|
|
83
81
|
isAudioMuted: state.appStates.isAudioMuted
|
|
84
82
|
}
|
|
85
83
|
};
|
package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js
CHANGED
|
@@ -3,27 +3,21 @@ import { NotificationScenarios } from "../../webchatcontainerstateful/webchatcon
|
|
|
3
3
|
import { NotificationHandler } from "../../webchatcontainerstateful/webchatcontroller/notification/NotificationHandler";
|
|
4
4
|
import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
|
|
5
5
|
import { LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
6
|
-
|
|
7
6
|
const processDisplayName = displayName => {
|
|
8
7
|
// if displayname matches "teamsvisitor:<some alphanumeric string>", we replace it with "Customer"
|
|
9
8
|
const displayNameRegex = ".+:.+";
|
|
10
9
|
const matchedTeamsDisplayName = displayName.match(displayNameRegex);
|
|
11
|
-
|
|
12
10
|
if (displayName.indexOf("teamsvisitor") >= 0 && matchedTeamsDisplayName && matchedTeamsDisplayName.length > 0) {
|
|
13
11
|
displayName = "Customer";
|
|
14
12
|
}
|
|
15
|
-
|
|
16
13
|
return displayName;
|
|
17
14
|
};
|
|
18
|
-
|
|
19
15
|
const constructIconName = displayName => {
|
|
20
16
|
if (!displayName) {
|
|
21
17
|
return "";
|
|
22
18
|
}
|
|
23
|
-
|
|
24
19
|
let iconName = "C";
|
|
25
20
|
const displayNameSplit = displayName.split(" ");
|
|
26
|
-
|
|
27
21
|
if (displayNameSplit.length > 1) {
|
|
28
22
|
// get the first letter of name and surname
|
|
29
23
|
iconName = displayNameSplit[0][0] + displayNameSplit[1][0];
|
|
@@ -31,55 +25,42 @@ const constructIconName = displayName => {
|
|
|
31
25
|
// get the first letter of name
|
|
32
26
|
iconName = displayNameSplit[0][0];
|
|
33
27
|
}
|
|
34
|
-
|
|
35
28
|
return iconName;
|
|
36
29
|
};
|
|
37
|
-
|
|
38
30
|
const processCreatedDateTime = (createdDateTime, chatCount) => {
|
|
39
|
-
const formattedDate = new Date(createdDateTime);
|
|
40
|
-
|
|
41
|
-
const formattedTimeString = formattedDate.toLocaleTimeString("en-us"
|
|
42
|
-
/* Bootstrapper.LiveChatConfiguration.chatWidgetLocale */
|
|
43
|
-
, {
|
|
31
|
+
const formattedDate = new Date(createdDateTime);
|
|
32
|
+
// TODO: Localization:
|
|
33
|
+
const formattedTimeString = formattedDate.toLocaleTimeString("en-us" /* Bootstrapper.LiveChatConfiguration.chatWidgetLocale */, {
|
|
44
34
|
hour: "2-digit",
|
|
45
35
|
minute: "2-digit"
|
|
46
36
|
});
|
|
47
37
|
const formattedSplitTimeString = formattedTimeString.split(" ");
|
|
48
38
|
let finalizedTimeString = "";
|
|
49
|
-
|
|
50
39
|
if (formattedSplitTimeString && formattedSplitTimeString.length > 1) {
|
|
51
40
|
finalizedTimeString = formattedSplitTimeString[0] + " " + formattedSplitTimeString[1];
|
|
52
41
|
}
|
|
53
|
-
|
|
54
42
|
if (chatCount == 0) {
|
|
55
43
|
return formattedDate.toLocaleDateString("en-us") + " " + finalizedTimeString;
|
|
56
44
|
}
|
|
57
|
-
|
|
58
45
|
return finalizedTimeString;
|
|
59
46
|
};
|
|
60
|
-
|
|
61
47
|
const processContent = (transcriptContent, isAgentChat, renderMarkDown) => {
|
|
62
48
|
if (transcriptContent.toString().toLowerCase().indexOf(TranscriptConstants.TranscriptMessageEmojiMessageType) >= 0) {
|
|
63
49
|
// eslint-disable-next-line no-useless-escape
|
|
64
50
|
const emojiRegex = "<img src=\"http.*:\/\/.+\/objects\/.+\/views.+\">";
|
|
65
51
|
const matchedEmojiImgTag = transcriptContent.match(emojiRegex);
|
|
66
|
-
|
|
67
52
|
if (matchedEmojiImgTag && matchedEmojiImgTag.length > 0 && transcriptContent.toString().toLowerCase().indexOf(matchedEmojiImgTag[0]) >= 0) {
|
|
68
53
|
transcriptContent = transcriptContent.replace(matchedEmojiImgTag[0], "");
|
|
69
54
|
}
|
|
70
55
|
}
|
|
71
|
-
|
|
72
56
|
if (!isAgentChat && transcriptContent.toString().toLowerCase().indexOf("a href") >= 0 && transcriptContent.toString().toLowerCase().indexOf("target") >= 0) {
|
|
73
57
|
transcriptContent = transcriptContent.slice(0, transcriptContent.toString().indexOf("target")) + " style='color:white' " + transcriptContent.slice(transcriptContent.toString().indexOf("target"));
|
|
74
58
|
}
|
|
75
|
-
|
|
76
59
|
if (renderMarkDown) {
|
|
77
60
|
transcriptContent = renderMarkDown(transcriptContent);
|
|
78
61
|
}
|
|
79
|
-
|
|
80
62
|
return transcriptContent;
|
|
81
63
|
};
|
|
82
|
-
|
|
83
64
|
const beautifyChatTranscripts = (chatTranscripts, renderMarkDown, attachmentMessage) => {
|
|
84
65
|
const chats = JSON.parse(chatTranscripts).reverse();
|
|
85
66
|
const docTypeTag = "<!DOCTYPE html>";
|
|
@@ -94,8 +75,9 @@ const beautifyChatTranscripts = (chatTranscripts, renderMarkDown, attachmentMess
|
|
|
94
75
|
let tabIndex = 1;
|
|
95
76
|
const mainTranscriptSection = "<div class='allTranscripts' style='max-width:60%;min-width:30%;margin-left:20%;background-color:#FFFFFF;'>";
|
|
96
77
|
let previousDisplayName = "";
|
|
97
|
-
let chatCount = 0;
|
|
78
|
+
let chatCount = 0;
|
|
98
79
|
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
99
81
|
chats.forEach(value => {
|
|
100
82
|
let dialogNameMarginTop = "6px";
|
|
101
83
|
let dialogboxMarginleft = "40px";
|
|
@@ -111,7 +93,6 @@ const beautifyChatTranscripts = (chatTranscripts, renderMarkDown, attachmentMess
|
|
|
111
93
|
const isInternalMessage = value.deliveryMode && value.deliveryMode.toLowerCase() === TranscriptConstants.InternalMode;
|
|
112
94
|
const isHiddenMessage = value.tags && value.tags.toLowerCase().indexOf(Constants.hiddenTag.toLowerCase()) !== -1;
|
|
113
95
|
const shouldIgnoreMessage = isSystemMessage || isControlMessage || isAdaptiveCard || isInternalMessage || isHiddenMessage;
|
|
114
|
-
|
|
115
96
|
if (shouldIgnoreMessage) {
|
|
116
97
|
return;
|
|
117
98
|
} else if (value.from) {
|
|
@@ -127,19 +108,15 @@ const beautifyChatTranscripts = (chatTranscripts, renderMarkDown, attachmentMess
|
|
|
127
108
|
displayName = value.from.user.displayName;
|
|
128
109
|
dialogColor = TranscriptConstants.CustomerDialogColor;
|
|
129
110
|
}
|
|
130
|
-
|
|
131
111
|
displayName = processDisplayName(displayName);
|
|
132
112
|
iconName = constructIconName(displayName);
|
|
133
|
-
|
|
134
113
|
if (value.attachments && value.attachments.length > 0 && value.attachments[0].name) {
|
|
135
114
|
fileAttachmentName = value.attachments[0].name;
|
|
136
115
|
value.content = attachmentMessage ? attachmentMessage + " " + fileAttachmentName : "The following attachment was uploaded during the conversation: " + fileAttachmentName;
|
|
137
116
|
}
|
|
138
117
|
}
|
|
139
|
-
|
|
140
118
|
let displayNamePlaceholder = processCreatedDateTime(value.createdDateTime, chatCount);
|
|
141
119
|
let iconPara = "";
|
|
142
|
-
|
|
143
120
|
if (displayName !== previousDisplayName) {
|
|
144
121
|
dialogboxMarginleft = "0px";
|
|
145
122
|
displayNamePlaceholder = "<b>" + displayName + " </b> " + processCreatedDateTime(value.createdDateTime, chatCount);
|
|
@@ -150,17 +127,14 @@ const beautifyChatTranscripts = (chatTranscripts, renderMarkDown, attachmentMess
|
|
|
150
127
|
</div>";
|
|
151
128
|
tabIndex++;
|
|
152
129
|
}
|
|
153
|
-
|
|
154
130
|
if (displayName !== previousDisplayName) {
|
|
155
131
|
if (previousDisplayName === "") {
|
|
156
132
|
dialogNameMarginTop = "0px";
|
|
157
133
|
}
|
|
158
|
-
|
|
159
134
|
if (previousDisplayName !== "") {
|
|
160
135
|
dialogNameMarginTop = "20px";
|
|
161
136
|
}
|
|
162
137
|
}
|
|
163
|
-
|
|
164
138
|
const displayNameDiv = "<div style='margin-right:-2px;margin-top:" + dialogNameMarginTop + ";margin-bottom:-2px;margin-left:42px;top:-2px;position:relative;'>\
|
|
165
139
|
<font tabindex ='" + tabIndex + "' size = '1px' color='#000000' style='font-family:Segoe UI,SegoeUI,Helvetica Neue,Helvetica,Arial,sans-serif;font-weight:500;'>\
|
|
166
140
|
" + displayNamePlaceholder + "\
|
|
@@ -174,16 +148,14 @@ const beautifyChatTranscripts = (chatTranscripts, renderMarkDown, attachmentMess
|
|
|
174
148
|
});
|
|
175
149
|
const str = docTypeTag + docStartTag + docMetaTag + bodyStartTag + mainTranscriptSection + beautifiedChats + divEndTag + bodyEndTag + docEndTag;
|
|
176
150
|
return str;
|
|
177
|
-
};
|
|
178
|
-
|
|
151
|
+
};
|
|
179
152
|
|
|
153
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
180
154
|
export const downloadTranscript = async (chatSDK, renderMarkDown, bannerMessageOnError, attachmentMessage) => {
|
|
181
155
|
let data = await (chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.getLiveChatTranscript());
|
|
182
|
-
|
|
183
156
|
if (typeof data === Constants.String) {
|
|
184
157
|
data = JSON.parse(data);
|
|
185
158
|
}
|
|
186
|
-
|
|
187
159
|
if (data[Constants.ChatMessagesJson] !== null && data[Constants.ChatMessagesJson] !== undefined) {
|
|
188
160
|
const chatTranscripts = window.btoa(encodeURIComponent(beautifyChatTranscripts(data[Constants.ChatMessagesJson], renderMarkDown, attachmentMessage)));
|
|
189
161
|
const byteCharacters = decodeURIComponent(window.atob(chatTranscripts));
|
|
@@ -14,10 +14,10 @@ describe("DownloadTranscriptStateful unit test", () => {
|
|
|
14
14
|
};
|
|
15
15
|
const chatSDK = new OmnichannelChatSDK(omnichannelConfig);
|
|
16
16
|
jest.spyOn(chatSDK, "getLiveChatTranscript").mockResolvedValue(Promise.resolve());
|
|
17
|
-
|
|
18
17
|
try {
|
|
19
18
|
await chatSDK.getLiveChatTranscript();
|
|
20
|
-
expect(chatSDK.getLiveChatTranscript).toHaveBeenCalledTimes(1);
|
|
19
|
+
expect(chatSDK.getLiveChatTranscript).toHaveBeenCalledTimes(1);
|
|
20
|
+
// eslint-disable-next-line no-empty
|
|
21
21
|
} catch (ex) {}
|
|
22
22
|
});
|
|
23
23
|
it("Method getLiveChatTranscript throws exception", async () => {
|
|
@@ -29,9 +29,9 @@ describe("DownloadTranscriptStateful unit test", () => {
|
|
|
29
29
|
};
|
|
30
30
|
const chatSDK = new OmnichannelChatSDK(omnichannelConfig);
|
|
31
31
|
jest.spyOn(chatSDK, "getLiveChatTranscript").mockRejectedValue(new Error(errorMessage));
|
|
32
|
-
|
|
33
32
|
try {
|
|
34
|
-
await chatSDK.getLiveChatTranscript();
|
|
33
|
+
await chatSDK.getLiveChatTranscript();
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
35
|
} catch (ex) {
|
|
36
36
|
expect(ex.message).toEqual(errorMessage);
|
|
37
37
|
}
|
|
@@ -44,9 +44,9 @@ describe("DownloadTranscriptStateful unit test", () => {
|
|
|
44
44
|
widgetId: ""
|
|
45
45
|
};
|
|
46
46
|
const chatSDK = new OmnichannelChatSDK(omnichannelConfig);
|
|
47
|
-
|
|
48
47
|
try {
|
|
49
|
-
await chatSDK.getLiveChatTranscript();
|
|
48
|
+
await chatSDK.getLiveChatTranscript();
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50
50
|
} catch (ex) {
|
|
51
51
|
expect(ex.message).toEqual(errorMessage);
|
|
52
52
|
}
|
|
@@ -9,16 +9,15 @@ import useChatAdapterStore from "../../hooks/useChatAdapterStore";
|
|
|
9
9
|
import useChatContextStore from "../../hooks/useChatContextStore";
|
|
10
10
|
export const HeaderStateful = props => {
|
|
11
11
|
var _state$domainStates$l, _state$domainStates$l2, _headerProps$controlP, _headerProps$controlP2, _headerProps$controlP3, _outOfOfficeHeaderPro;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const [state, dispatch] = useChatContextStore();
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
14
|
const [adapter] = useChatAdapterStore();
|
|
16
15
|
const {
|
|
17
16
|
headerProps,
|
|
18
17
|
outOfOfficeHeaderProps,
|
|
19
18
|
endChat
|
|
20
|
-
} = props;
|
|
21
|
-
|
|
19
|
+
} = props;
|
|
20
|
+
//Setting OutOfOperatingHours Flag
|
|
22
21
|
const [outOfOperatingHours, setOutOfOperatingHours] = useState(((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.OutOfOperatingHours) === "True");
|
|
23
22
|
const outOfOfficeStyleProps = Object.assign({}, defaultOutOfOfficeHeaderStyleProps, outOfOfficeHeaderProps === null || outOfOfficeHeaderProps === void 0 ? void 0 : outOfOfficeHeaderProps.styleProps);
|
|
24
23
|
const conversationState = useRef(state.appStates.conversationState);
|
|
@@ -37,12 +36,10 @@ export const HeaderStateful = props => {
|
|
|
37
36
|
},
|
|
38
37
|
onCloseClick: async () => {
|
|
39
38
|
var _props$headerProps, _props$headerProps$co, _props$headerProps$co2;
|
|
40
|
-
|
|
41
39
|
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
42
40
|
Event: TelemetryEvent.HeaderCloseButtonClicked,
|
|
43
41
|
Description: "Header Close button clicked."
|
|
44
42
|
});
|
|
45
|
-
|
|
46
43
|
if (conversationState.current === ConversationState.Active) {
|
|
47
44
|
dispatch({
|
|
48
45
|
type: LiveChatWidgetActionType.SET_SHOW_CONFIRMATION,
|
|
@@ -54,9 +51,7 @@ export const HeaderStateful = props => {
|
|
|
54
51
|
const postMessageToOtherTabs = true;
|
|
55
52
|
await endChat(adapter, skipEndChatSDK, skipCloseChat, postMessageToOtherTabs);
|
|
56
53
|
}
|
|
57
|
-
|
|
58
54
|
const closeButtonId = ((_props$headerProps = props.headerProps) === null || _props$headerProps === void 0 ? void 0 : (_props$headerProps$co = _props$headerProps.controlProps) === null || _props$headerProps$co === void 0 ? void 0 : (_props$headerProps$co2 = _props$headerProps$co.closeButtonProps) === null || _props$headerProps$co2 === void 0 ? void 0 : _props$headerProps$co2.id) ?? `${controlProps.id}-close-button`;
|
|
59
|
-
|
|
60
55
|
if (closeButtonId) {
|
|
61
56
|
dispatch({
|
|
62
57
|
type: LiveChatWidgetActionType.SET_PREVIOUS_FOCUSED_ELEMENT_ID,
|
|
@@ -65,9 +60,9 @@ export const HeaderStateful = props => {
|
|
|
65
60
|
}
|
|
66
61
|
},
|
|
67
62
|
...(headerProps === null || headerProps === void 0 ? void 0 : headerProps.controlProps),
|
|
68
|
-
hideTitle: state.appStates.conversationState === ConversationState.Loading || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP = headerProps.controlProps) === null || _headerProps$controlP === void 0 ? void 0 : _headerProps$controlP.hideTitle),
|
|
69
|
-
hideIcon: state.appStates.conversationState === ConversationState.Loading || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP2 = headerProps.controlProps) === null || _headerProps$controlP2 === void 0 ? void 0 : _headerProps$controlP2.hideIcon),
|
|
70
|
-
hideCloseButton: state.appStates.conversationState === ConversationState.Loading || state.appStates.conversationState === ConversationState.Prechat || state.appStates.conversationState === ConversationState.ReconnectChat || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP3 = headerProps.controlProps) === null || _headerProps$controlP3 === void 0 ? void 0 : _headerProps$controlP3.hideCloseButton)
|
|
63
|
+
hideTitle: state.appStates.conversationState === ConversationState.Loading && !state.appStates.isStartChatFailing || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP = headerProps.controlProps) === null || _headerProps$controlP === void 0 ? void 0 : _headerProps$controlP.hideTitle),
|
|
64
|
+
hideIcon: state.appStates.conversationState === ConversationState.Loading && !state.appStates.isStartChatFailing || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP2 = headerProps.controlProps) === null || _headerProps$controlP2 === void 0 ? void 0 : _headerProps$controlP2.hideIcon),
|
|
65
|
+
hideCloseButton: state.appStates.conversationState === ConversationState.Loading && !state.appStates.isStartChatFailing || state.appStates.conversationState === ConversationState.Prechat || state.appStates.conversationState === ConversationState.ReconnectChat || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP3 = headerProps.controlProps) === null || _headerProps$controlP3 === void 0 ? void 0 : _headerProps$controlP3.hideCloseButton)
|
|
71
66
|
};
|
|
72
67
|
const outOfOfficeControlProps = {
|
|
73
68
|
id: "oc-lcw-header",
|
|
@@ -88,7 +83,6 @@ export const HeaderStateful = props => {
|
|
|
88
83
|
if (state.appStates.outsideOperatingHours) {
|
|
89
84
|
setOutOfOperatingHours(true);
|
|
90
85
|
}
|
|
91
|
-
|
|
92
86
|
if (state.appStates.conversationState) {
|
|
93
87
|
conversationState.current = state.appStates.conversationState;
|
|
94
88
|
}
|
|
@@ -7,8 +7,8 @@ import { createReducer } from "../../contexts/createReducer";
|
|
|
7
7
|
import { getLiveChatWidgetContextInitialState } from "../../contexts/common/LiveChatWidgetContextInitialState";
|
|
8
8
|
export const LiveChatWidget = props => {
|
|
9
9
|
const reducer = createReducer();
|
|
10
|
-
const [state, dispatch] = useReducer(reducer, getLiveChatWidgetContextInitialState(props));
|
|
11
|
-
|
|
10
|
+
const [state, dispatch] = useReducer(reducer, getLiveChatWidgetContextInitialState(props));
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
12
|
const [adapter, setAdapter] = useState(undefined);
|
|
13
13
|
return /*#__PURE__*/React.createElement(ChatSDKStore.Provider, {
|
|
14
14
|
value: props.chatSDK
|
|
@@ -1,8 +1,10 @@
|
|
|
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 { Deferred } from "./Deferred";
|
|
4
5
|
export class ActivityStreamHandler {
|
|
5
6
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
+
|
|
6
8
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
9
|
|
|
8
10
|
/**
|
|
@@ -13,22 +15,18 @@ export class ActivityStreamHandler {
|
|
|
13
15
|
ActivityStreamHandler.restoreDeferred = new Deferred();
|
|
14
16
|
ActivityStreamHandler.restorePromise = ActivityStreamHandler.restoreDeferred.promise;
|
|
15
17
|
}
|
|
18
|
+
|
|
16
19
|
/**
|
|
17
20
|
* Resolve the promise, releasing it to continue with the execution of the activity.
|
|
18
21
|
*
|
|
19
22
|
* */
|
|
20
|
-
|
|
21
|
-
|
|
22
23
|
static uncork() {
|
|
23
24
|
ActivityStreamHandler.restoreDeferred.resolve();
|
|
24
25
|
}
|
|
25
|
-
|
|
26
26
|
}
|
|
27
|
-
|
|
28
27
|
_defineProperty(ActivityStreamHandler, "restoreDeferred", {
|
|
29
28
|
resolve: () => {
|
|
30
29
|
return "initialState";
|
|
31
30
|
}
|
|
32
31
|
});
|
|
33
|
-
|
|
34
32
|
_defineProperty(ActivityStreamHandler, "restorePromise", void 0);
|
package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
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 DefaultActivitySubscriber {
|
|
4
5
|
constructor() {
|
|
5
6
|
_defineProperty(this, "observer", void 0);
|
|
6
7
|
}
|
|
7
|
-
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
9
|
async next(activity) {
|
|
10
10
|
this.observer.next(activity);
|
|
11
11
|
return false;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
13
|
}
|
package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
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 { ActivityStreamHandler } from "../ActivityStreamHandler";
|
|
4
5
|
export class PauseActivitySubscriber {
|
|
5
6
|
constructor() {
|
|
6
7
|
_defineProperty(this, "observer", void 0);
|
|
7
8
|
}
|
|
8
|
-
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
10
|
async apply(activity) {
|
|
11
11
|
await ActivityStreamHandler.restorePromise;
|
|
12
12
|
return activity;
|
|
13
|
-
}
|
|
14
|
-
|
|
13
|
+
}
|
|
15
14
|
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
|
|
16
16
|
applicable(activity) {
|
|
17
17
|
return true;
|
|
18
|
-
}
|
|
19
|
-
|
|
18
|
+
}
|
|
20
19
|
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
21
|
async next(activity) {
|
|
22
22
|
if (this.applicable(activity)) {
|
|
23
23
|
return await this.apply(activity);
|
|
24
24
|
}
|
|
25
|
-
|
|
26
25
|
return activity;
|
|
27
26
|
}
|
|
28
|
-
|
|
29
27
|
}
|
|
@@ -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,
|