@microsoft/omnichannel-chat-widget 0.1.0-main.e67738e → 0.1.0-main.ec08ec5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/common/Constants.js +0 -167
- package/lib/cjs/common/KeyCodes.js +0 -3
- package/lib/cjs/common/contextDataStore/DataStoreManager.js +0 -4
- package/lib/cjs/common/storage/default/defaultCacheManager.js +24 -0
- package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +102 -0
- package/lib/cjs/common/storage/default/defaultInMemoryDataStore.js +78 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +21 -22
- package/lib/cjs/common/telemetry/TelemetryHelper.js +16 -57
- package/lib/cjs/common/telemetry/TelemetryManager.js +0 -31
- 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/confirmationpanestateful/ConfirmationPaneStateful.js +8 -32
- package/lib/cjs/components/dimlayer/DimLayer.js +0 -4
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +8 -36
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -8
- package/lib/cjs/components/footerstateful/FooterStateful.js +11 -42
- 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 +12 -27
- package/lib/cjs/components/livechatwidget/LiveChatWidget.js +2 -14
- package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +2 -9
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +0 -5
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +4 -11
- package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +11 -19
- package/lib/cjs/components/livechatwidget/common/Deferred.js +3 -10
- package/lib/cjs/components/livechatwidget/common/authHelper.js +13 -15
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -13
- package/lib/cjs/components/livechatwidget/common/createFooter.js +4 -23
- 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/dummyDefaultProps.js +55 -36
- package/lib/cjs/components/livechatwidget/common/disposeTelemetryLoggers.js +0 -3
- package/lib/cjs/components/livechatwidget/common/endChat.js +8 -33
- 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 +16 -54
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +36 -66
- 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 +55 -86
- 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/livechatwidgetstateful/LiveChatWidgetStateful.js +125 -196
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +4 -17
- 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 +8 -36
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +2 -32
- package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +2 -24
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +21 -37
- 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 +9 -26
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +2 -17
- 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 +0 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +0 -4
- 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 -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/defaultReceivedMessageAnchorStyles.js +10 -0
- 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 +2 -12
- 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 +16 -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 +1 -2
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +8 -10
- package/lib/cjs/contexts/createReducer.js +135 -106
- package/lib/cjs/controller/componentController.js +1 -30
- 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/common/Constants.js +0 -155
- package/lib/esm/common/KeyCodes.js +0 -2
- package/lib/esm/common/contextDataStore/DataStoreManager.js +0 -2
- package/lib/esm/common/storage/default/defaultCacheManager.js +16 -0
- package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +95 -0
- package/lib/esm/common/storage/default/defaultInMemoryDataStore.js +70 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +25 -19
- package/lib/esm/common/telemetry/TelemetryHelper.js +16 -45
- package/lib/esm/common/telemetry/TelemetryManager.js +0 -18
- 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/confirmationpanestateful/ConfirmationPaneStateful.js +10 -13
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +8 -15
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -6
- package/lib/esm/components/footerstateful/FooterStateful.js +13 -23
- 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 +12 -12
- package/lib/esm/components/livechatwidget/LiveChatWidget.js +2 -2
- package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +2 -6
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +0 -3
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +4 -8
- package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +11 -15
- package/lib/esm/components/livechatwidget/common/Deferred.js +3 -8
- package/lib/esm/components/livechatwidget/common/authHelper.js +13 -10
- package/lib/esm/components/livechatwidget/common/createAdapter.js +4 -6
- package/lib/esm/components/livechatwidget/common/createFooter.js +4 -16
- 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/dummyDefaultProps.js +57 -23
- package/lib/esm/components/livechatwidget/common/endChat.js +10 -18
- 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 +18 -19
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +37 -51
- 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 +57 -59
- package/lib/esm/components/livechatwidget/common/updateSessionDataForTelemetry.js +4 -2
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +126 -129
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +4 -5
- 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 +10 -20
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +4 -8
- package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +2 -6
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +19 -11
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -2
- package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +9 -18
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +2 -13
- 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 +0 -2
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +0 -2
- 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 -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/defaultReceivedMessageAnchorStyles.js +3 -0
- 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 +3 -3
- 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 +16 -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 +1 -2
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +8 -6
- package/lib/esm/contexts/createReducer.js +135 -103
- package/lib/esm/controller/componentController.js +2 -1
- 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/common/storage/default/defaultCacheManager.d.ts +4 -0
- package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +2 -0
- package/lib/types/common/storage/default/defaultInMemoryDataStore.d.ts +6 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +9 -2
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +2 -4
- package/lib/types/components/livechatwidget/common/authHelper.d.ts +3 -2
- package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +6 -5
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -2
- 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 +4 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.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/contexts/common/ILiveChatWidgetContext.d.ts +1 -1
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +1 -1
- package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +1 -2
- package/package.json +3 -3
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export let LiveChatWidgetActionType;
|
|
2
|
-
|
|
3
2
|
(function (LiveChatWidgetActionType) {
|
|
4
3
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_ELEMENT_ID"] = 0] = "SET_WIDGET_ELEMENT_ID";
|
|
5
4
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RENDERING_MIDDLEWARE_PROPS"] = 1] = "SET_RENDERING_MIDDLEWARE_PROPS";
|
|
@@ -7,7 +6,7 @@ export let LiveChatWidgetActionType;
|
|
|
7
6
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_GLOBAL_DIR"] = 3] = "SET_GLOBAL_DIR";
|
|
8
7
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_MINIMIZED"] = 4] = "SET_MINIMIZED";
|
|
9
8
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_STATE"] = 5] = "SET_CONVERSATION_STATE";
|
|
10
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
9
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PREVIOUS_FOCUSED_ELEMENT_ID"] = 6] = "SET_PREVIOUS_FOCUSED_ELEMENT_ID";
|
|
11
10
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_OUTSIDE_OPERATING_HOURS"] = 7] = "SET_OUTSIDE_OPERATING_HOURS";
|
|
12
11
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRE_CHAT_SURVEY_RESPONSE"] = 8] = "SET_PRE_CHAT_SURVEY_RESPONSE";
|
|
13
12
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CUSTOM_CONTEXT"] = 9] = "SET_CUSTOM_CONTEXT";
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ConversationState } from "./ConversationState";
|
|
2
2
|
import { defaultMiddlewareLocalizedTexts } from "../../components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
3
|
+
import { getWidgetCacheId, isNullOrUndefined } from "../../common/utils";
|
|
4
|
+
import { defaultClientDataStoreProvider } from "../../common/storage/default/defaultClientDataStoreProvider";
|
|
3
5
|
export const getLiveChatWidgetContextInitialState = props => {
|
|
4
|
-
var _props$webChatContain;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$controlProps, _props$webChatContain;
|
|
7
|
+
const widgetCacheId = getWidgetCacheId(props === null || props === void 0 ? void 0 : (_props$chatSDK = props.chatSDK) === null || _props$chatSDK === void 0 ? void 0 : (_props$chatSDK$omnich = _props$chatSDK.omnichannelConfig) === null || _props$chatSDK$omnich === void 0 ? void 0 : _props$chatSDK$omnich.orgId, props === null || props === void 0 ? void 0 : (_props$chatSDK2 = props.chatSDK) === null || _props$chatSDK2 === void 0 ? void 0 : (_props$chatSDK2$omnic = _props$chatSDK2.omnichannelConfig) === null || _props$chatSDK2$omnic === void 0 ? void 0 : _props$chatSDK2$omnic.widgetId, (props === null || props === void 0 ? void 0 : (_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.widgetInstanceId) ?? "");
|
|
8
|
+
const initialState = defaultClientDataStoreProvider().getData(widgetCacheId, "localStorage");
|
|
9
|
+
if (!isNullOrUndefined(initialState)) {
|
|
10
|
+
return JSON.parse(initialState);
|
|
8
11
|
}
|
|
9
|
-
|
|
10
12
|
const LiveChatWidgetContextInitialState = {
|
|
11
13
|
domainStates: {
|
|
12
14
|
liveChatConfig: props.chatConfig,
|
|
@@ -26,7 +28,7 @@ export const getLiveChatWidgetContextInitialState = props => {
|
|
|
26
28
|
appStates: {
|
|
27
29
|
conversationState: ConversationState.Closed,
|
|
28
30
|
isMinimized: false,
|
|
29
|
-
|
|
31
|
+
previousElementIdOnFocusBeforeModalOpen: null,
|
|
30
32
|
outsideOperatingHours: false,
|
|
31
33
|
preChatResponseEmail: "",
|
|
32
34
|
isAudioMuted: null,
|
|
@@ -1,252 +1,284 @@
|
|
|
1
1
|
/* eslint-disable indent */
|
|
2
|
+
|
|
2
3
|
import { LiveChatWidgetActionType } from "./common/LiveChatWidgetActionType";
|
|
3
4
|
export const createReducer = () => {
|
|
4
5
|
const reducer = (state, action) => {
|
|
5
6
|
var _action$payload, _action$payload2, _action$payload3;
|
|
6
|
-
|
|
7
7
|
switch (action.type) {
|
|
8
8
|
case LiveChatWidgetActionType.SET_WIDGET_ELEMENT_ID:
|
|
9
|
-
return {
|
|
10
|
-
|
|
9
|
+
return {
|
|
10
|
+
...state,
|
|
11
|
+
domainStates: {
|
|
12
|
+
...state.domainStates,
|
|
11
13
|
widgetElementId: action.payload
|
|
12
14
|
}
|
|
13
15
|
};
|
|
14
|
-
|
|
15
16
|
case LiveChatWidgetActionType.SET_RENDERING_MIDDLEWARE_PROPS:
|
|
16
|
-
return {
|
|
17
|
-
|
|
17
|
+
return {
|
|
18
|
+
...state,
|
|
19
|
+
domainStates: {
|
|
20
|
+
...state.domainStates,
|
|
18
21
|
renderingMiddlewareProps: action.payload
|
|
19
22
|
}
|
|
20
23
|
};
|
|
21
|
-
|
|
22
24
|
case LiveChatWidgetActionType.SET_MIDDLEWARE_LOCALIZED_TEXTS:
|
|
23
|
-
return {
|
|
24
|
-
|
|
25
|
+
return {
|
|
26
|
+
...state,
|
|
27
|
+
domainStates: {
|
|
28
|
+
...state.domainStates,
|
|
25
29
|
middlewareLocalizedTexts: action.payload
|
|
26
30
|
}
|
|
27
31
|
};
|
|
28
|
-
|
|
29
32
|
case LiveChatWidgetActionType.SET_GLOBAL_DIR:
|
|
30
|
-
return {
|
|
31
|
-
|
|
33
|
+
return {
|
|
34
|
+
...state,
|
|
35
|
+
domainStates: {
|
|
36
|
+
...state.domainStates,
|
|
32
37
|
globalDir: action.payload === "ltr" || action.payload === "rtl" ? action.payload : "ltr"
|
|
33
38
|
}
|
|
34
39
|
};
|
|
35
|
-
|
|
36
40
|
case LiveChatWidgetActionType.SET_MINIMIZED:
|
|
37
|
-
return {
|
|
38
|
-
|
|
41
|
+
return {
|
|
42
|
+
...state,
|
|
43
|
+
appStates: {
|
|
44
|
+
...state.appStates,
|
|
39
45
|
isMinimized: action.payload
|
|
40
46
|
}
|
|
41
47
|
};
|
|
42
|
-
|
|
43
48
|
case LiveChatWidgetActionType.SET_CONVERSATION_STATE:
|
|
44
|
-
return {
|
|
45
|
-
|
|
49
|
+
return {
|
|
50
|
+
...state,
|
|
51
|
+
appStates: {
|
|
52
|
+
...state.appStates,
|
|
46
53
|
conversationState: action.payload
|
|
47
54
|
}
|
|
48
55
|
};
|
|
49
|
-
|
|
50
56
|
case LiveChatWidgetActionType.SET_OUTSIDE_OPERATING_HOURS:
|
|
51
|
-
return {
|
|
52
|
-
|
|
57
|
+
return {
|
|
58
|
+
...state,
|
|
59
|
+
appStates: {
|
|
60
|
+
...state.appStates,
|
|
53
61
|
outsideOperatingHours: action.payload
|
|
54
62
|
}
|
|
55
63
|
};
|
|
56
|
-
|
|
57
64
|
case LiveChatWidgetActionType.SET_PRE_CHAT_SURVEY_RESPONSE:
|
|
58
|
-
return {
|
|
59
|
-
|
|
65
|
+
return {
|
|
66
|
+
...state,
|
|
67
|
+
domainStates: {
|
|
68
|
+
...state.domainStates,
|
|
60
69
|
preChatSurveyResponse: action.payload
|
|
61
70
|
}
|
|
62
71
|
};
|
|
63
|
-
|
|
64
72
|
case LiveChatWidgetActionType.SET_CUSTOM_CONTEXT:
|
|
65
|
-
return {
|
|
66
|
-
|
|
73
|
+
return {
|
|
74
|
+
...state,
|
|
75
|
+
domainStates: {
|
|
76
|
+
...state.domainStates,
|
|
67
77
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
68
78
|
customContext: action.payload
|
|
69
79
|
}
|
|
70
80
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
appStates: {
|
|
75
|
-
|
|
81
|
+
case LiveChatWidgetActionType.SET_PREVIOUS_FOCUSED_ELEMENT_ID:
|
|
82
|
+
return {
|
|
83
|
+
...state,
|
|
84
|
+
appStates: {
|
|
85
|
+
...state.appStates,
|
|
86
|
+
previousElementIdOnFocusBeforeModalOpen: action.payload
|
|
76
87
|
}
|
|
77
88
|
};
|
|
78
|
-
|
|
79
89
|
case LiveChatWidgetActionType.SET_SHOW_CONFIRMATION:
|
|
80
|
-
return {
|
|
81
|
-
|
|
90
|
+
return {
|
|
91
|
+
...state,
|
|
92
|
+
uiStates: {
|
|
93
|
+
...state.uiStates,
|
|
82
94
|
showConfirmationPane: action.payload
|
|
83
95
|
}
|
|
84
96
|
};
|
|
85
|
-
|
|
86
97
|
case LiveChatWidgetActionType.SET_POST_CHAT_CONTEXT:
|
|
87
|
-
return {
|
|
88
|
-
|
|
98
|
+
return {
|
|
99
|
+
...state,
|
|
100
|
+
domainStates: {
|
|
101
|
+
...state.domainStates,
|
|
89
102
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
90
103
|
postChatContext: action.payload
|
|
91
104
|
}
|
|
92
105
|
};
|
|
93
|
-
|
|
94
106
|
case LiveChatWidgetActionType.SHOW_CALLING_CONTAINER:
|
|
95
|
-
return {
|
|
96
|
-
|
|
107
|
+
return {
|
|
108
|
+
...state,
|
|
109
|
+
uiStates: {
|
|
110
|
+
...state.uiStates,
|
|
97
111
|
showCallingPopup: action.payload
|
|
98
112
|
}
|
|
99
113
|
};
|
|
100
|
-
|
|
101
114
|
case LiveChatWidgetActionType.SET_INCOMING_CALL:
|
|
102
|
-
return {
|
|
103
|
-
|
|
115
|
+
return {
|
|
116
|
+
...state,
|
|
117
|
+
uiStates: {
|
|
118
|
+
...state.uiStates,
|
|
104
119
|
isIncomingCall: action.payload
|
|
105
120
|
}
|
|
106
121
|
};
|
|
107
|
-
|
|
108
122
|
case LiveChatWidgetActionType.SET_FOCUS_CHAT_BUTTON:
|
|
109
|
-
return {
|
|
110
|
-
|
|
123
|
+
return {
|
|
124
|
+
...state,
|
|
125
|
+
uiStates: {
|
|
126
|
+
...state.uiStates,
|
|
111
127
|
focusChatButton: action.payload
|
|
112
128
|
}
|
|
113
129
|
};
|
|
114
|
-
|
|
115
130
|
case LiveChatWidgetActionType.DISABLE_VIDEO_CALL:
|
|
116
|
-
return {
|
|
117
|
-
|
|
131
|
+
return {
|
|
132
|
+
...state,
|
|
133
|
+
uiStates: {
|
|
134
|
+
...state.uiStates,
|
|
118
135
|
disableVideoCall: action.payload
|
|
119
136
|
}
|
|
120
137
|
};
|
|
121
|
-
|
|
122
138
|
case LiveChatWidgetActionType.DISABLE_LOCAL_VIDEO:
|
|
123
|
-
return {
|
|
124
|
-
|
|
139
|
+
return {
|
|
140
|
+
...state,
|
|
141
|
+
uiStates: {
|
|
142
|
+
...state.uiStates,
|
|
125
143
|
disableSelfVideo: action.payload
|
|
126
144
|
}
|
|
127
145
|
};
|
|
128
|
-
|
|
129
146
|
case LiveChatWidgetActionType.DISABLE_REMOTE_VIDEO:
|
|
130
|
-
return {
|
|
131
|
-
|
|
147
|
+
return {
|
|
148
|
+
...state,
|
|
149
|
+
uiStates: {
|
|
150
|
+
...state.uiStates,
|
|
132
151
|
disableRemoteVideo: action.payload
|
|
133
152
|
}
|
|
134
153
|
};
|
|
135
|
-
|
|
136
154
|
case LiveChatWidgetActionType.SET_CHAT_TOKEN:
|
|
137
|
-
return {
|
|
138
|
-
|
|
155
|
+
return {
|
|
156
|
+
...state,
|
|
157
|
+
domainStates: {
|
|
158
|
+
...state.domainStates,
|
|
139
159
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
140
160
|
chatToken: action.payload
|
|
141
161
|
}
|
|
142
162
|
};
|
|
143
|
-
|
|
144
163
|
case LiveChatWidgetActionType.SET_SHOW_EMAIL_TRANSCRIPT_PANE:
|
|
145
|
-
return {
|
|
146
|
-
|
|
164
|
+
return {
|
|
165
|
+
...state,
|
|
166
|
+
uiStates: {
|
|
167
|
+
...state.uiStates,
|
|
147
168
|
showEmailTranscriptPane: action.payload
|
|
148
169
|
}
|
|
149
170
|
};
|
|
150
|
-
|
|
151
171
|
case LiveChatWidgetActionType.SET_PRECHAT_RESPONSE_EMAIL:
|
|
152
|
-
return {
|
|
153
|
-
|
|
172
|
+
return {
|
|
173
|
+
...state,
|
|
174
|
+
appStates: {
|
|
175
|
+
...state.appStates,
|
|
154
176
|
preChatResponseEmail: action.payload
|
|
155
177
|
}
|
|
156
178
|
};
|
|
157
|
-
|
|
158
179
|
case LiveChatWidgetActionType.SET_AUDIO_NOTIFICATION:
|
|
159
|
-
return {
|
|
160
|
-
|
|
180
|
+
return {
|
|
181
|
+
...state,
|
|
182
|
+
appStates: {
|
|
183
|
+
...state.appStates,
|
|
161
184
|
isAudioMuted: action.payload
|
|
162
185
|
}
|
|
163
186
|
};
|
|
164
|
-
|
|
165
187
|
case LiveChatWidgetActionType.SET_E2VV_ENABLED:
|
|
166
|
-
return {
|
|
167
|
-
|
|
188
|
+
return {
|
|
189
|
+
...state,
|
|
190
|
+
appStates: {
|
|
191
|
+
...state.appStates,
|
|
168
192
|
e2vvEnabled: action.payload
|
|
169
193
|
}
|
|
170
194
|
};
|
|
171
|
-
|
|
172
195
|
case LiveChatWidgetActionType.SET_SKIP_CHAT_BUTTON_RENDERING:
|
|
173
|
-
return {
|
|
174
|
-
|
|
196
|
+
return {
|
|
197
|
+
...state,
|
|
198
|
+
appStates: {
|
|
199
|
+
...state.appStates,
|
|
175
200
|
skipChatButtonRendering: action.payload
|
|
176
201
|
}
|
|
177
202
|
};
|
|
178
|
-
|
|
179
203
|
case LiveChatWidgetActionType.SET_PROACTIVE_CHAT_PARAMS:
|
|
180
|
-
return {
|
|
181
|
-
|
|
182
|
-
|
|
204
|
+
return {
|
|
205
|
+
...state,
|
|
206
|
+
appStates: {
|
|
207
|
+
...state.appStates,
|
|
208
|
+
proactiveChatStates: {
|
|
209
|
+
...state.appStates.proactiveChatStates,
|
|
183
210
|
proactiveChatBodyTitle: (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : _action$payload.proactiveChatBodyTitle,
|
|
184
211
|
proactiveChatEnablePrechat: (_action$payload2 = action.payload) === null || _action$payload2 === void 0 ? void 0 : _action$payload2.proactiveChatEnablePrechat,
|
|
185
212
|
proactiveChatInNewWindow: (_action$payload3 = action.payload) === null || _action$payload3 === void 0 ? void 0 : _action$payload3.proactiveChatInNewWindow
|
|
186
213
|
}
|
|
187
214
|
}
|
|
188
215
|
};
|
|
189
|
-
|
|
190
216
|
case LiveChatWidgetActionType.SET_TELEMETRY_DATA:
|
|
191
|
-
return {
|
|
192
|
-
|
|
217
|
+
return {
|
|
218
|
+
...state,
|
|
219
|
+
domainStates: {
|
|
220
|
+
...state.domainStates,
|
|
193
221
|
telemetryInternalData: action.payload
|
|
194
222
|
}
|
|
195
223
|
};
|
|
196
|
-
|
|
197
224
|
case LiveChatWidgetActionType.SET_RECONNECT_ID:
|
|
198
|
-
return {
|
|
199
|
-
|
|
225
|
+
return {
|
|
226
|
+
...state,
|
|
227
|
+
appStates: {
|
|
228
|
+
...state.appStates,
|
|
200
229
|
reconnectId: action.payload
|
|
201
230
|
}
|
|
202
231
|
};
|
|
203
|
-
|
|
204
232
|
case LiveChatWidgetActionType.SET_UNREAD_MESSAGE_COUNT:
|
|
205
|
-
return {
|
|
206
|
-
|
|
233
|
+
return {
|
|
234
|
+
...state,
|
|
235
|
+
appStates: {
|
|
236
|
+
...state.appStates,
|
|
207
237
|
unreadMessageCount: action.payload
|
|
208
238
|
}
|
|
209
239
|
};
|
|
210
|
-
|
|
211
240
|
case LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT:
|
|
212
|
-
return {
|
|
213
|
-
|
|
241
|
+
return {
|
|
242
|
+
...state,
|
|
243
|
+
domainStates: {
|
|
244
|
+
...state.domainStates,
|
|
214
245
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
215
246
|
liveChatContext: action.payload
|
|
216
247
|
}
|
|
217
248
|
};
|
|
218
|
-
|
|
219
249
|
case LiveChatWidgetActionType.SET_WIDGET_STATE:
|
|
220
|
-
return {
|
|
250
|
+
return {
|
|
251
|
+
...action.payload
|
|
221
252
|
};
|
|
222
|
-
|
|
223
253
|
case LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY_AGENT:
|
|
224
|
-
return {
|
|
225
|
-
|
|
254
|
+
return {
|
|
255
|
+
...state,
|
|
256
|
+
appStates: {
|
|
257
|
+
...state.appStates,
|
|
226
258
|
conversationEndedByAgent: action.payload
|
|
227
259
|
}
|
|
228
260
|
};
|
|
229
|
-
|
|
230
261
|
case LiveChatWidgetActionType.SET_WIDGET_SIZE:
|
|
231
|
-
return {
|
|
232
|
-
|
|
262
|
+
return {
|
|
263
|
+
...state,
|
|
264
|
+
domainStates: {
|
|
265
|
+
...state.domainStates,
|
|
233
266
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
234
267
|
widgetSize: action.payload
|
|
235
268
|
}
|
|
236
269
|
};
|
|
237
|
-
|
|
238
270
|
case LiveChatWidgetActionType.SET_WIDGET_INSTANCE_ID:
|
|
239
|
-
return {
|
|
240
|
-
|
|
271
|
+
return {
|
|
272
|
+
...state,
|
|
273
|
+
domainStates: {
|
|
274
|
+
...state.domainStates,
|
|
241
275
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
242
276
|
widgetInstanceId: action.payload
|
|
243
277
|
}
|
|
244
278
|
};
|
|
245
|
-
|
|
246
279
|
default:
|
|
247
280
|
return state;
|
|
248
281
|
}
|
|
249
282
|
};
|
|
250
|
-
|
|
251
283
|
return reducer;
|
|
252
284
|
};
|
|
@@ -2,6 +2,7 @@ import { ConversationState } from "../contexts/common/ConversationState";
|
|
|
2
2
|
export const shouldShowChatButton = state => {
|
|
3
3
|
return (state.appStates.isMinimized || state.appStates.conversationState === ConversationState.Closed) && state.appStates.skipChatButtonRendering == false; // Do not show chat button in case of popout
|
|
4
4
|
};
|
|
5
|
+
|
|
5
6
|
export const shouldShowProactiveChatPane = state => {
|
|
6
7
|
return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.ProactiveChat;
|
|
7
8
|
};
|
|
@@ -9,7 +10,7 @@ export const shouldShowHeader = state => {
|
|
|
9
10
|
return !state.appStates.isMinimized && state.appStates.conversationState !== ConversationState.Closed && state.appStates.conversationState !== ConversationState.ProactiveChat;
|
|
10
11
|
};
|
|
11
12
|
export const shouldShowFooter = state => {
|
|
12
|
-
return !state.appStates.isMinimized && (state.appStates.conversationState === ConversationState.Active || state.appStates.conversationState === ConversationState.InActive);
|
|
13
|
+
return !state.appStates.isMinimized && (state.appStates.conversationState === ConversationState.Active || state.appStates.conversationState === ConversationState.InActive || state.appStates.conversationState === ConversationState.Postchat);
|
|
13
14
|
};
|
|
14
15
|
export const shouldShowEmailTranscriptPane = state => {
|
|
15
16
|
return state.uiStates.showEmailTranscriptPane;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { ChatAdapterStore } from "../contexts/ChatAdapterStore";
|
|
2
2
|
import { useContext } from "react";
|
|
3
|
-
|
|
4
3
|
const useChatAdapterStore = () => {
|
|
5
4
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
5
|
const adapter = useContext(ChatAdapterStore);
|
|
7
|
-
|
|
8
6
|
if (!adapter) {
|
|
9
7
|
throw new Error("This hook can only be used on component that is descendants of <ChatAdapterStore.Provider>");
|
|
10
8
|
}
|
|
11
|
-
|
|
12
9
|
return adapter;
|
|
13
10
|
};
|
|
14
|
-
|
|
15
11
|
export default useChatAdapterStore;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
2
|
import { ChatContextStore } from "../contexts/ChatContextStore";
|
|
3
|
-
|
|
4
3
|
const useChatContextStore = () => {
|
|
5
4
|
const context = useContext(ChatContextStore);
|
|
6
|
-
|
|
7
5
|
if (!context) {
|
|
8
6
|
throw new Error("This hook can only be used on component that is descendants of <ChatContextStore.Provider>");
|
|
9
7
|
}
|
|
10
|
-
|
|
11
8
|
return context;
|
|
12
9
|
};
|
|
13
|
-
|
|
14
10
|
export default useChatContextStore;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { ChatSDKStore } from "../contexts/ChatSDKStore";
|
|
2
2
|
import { useContext } from "react";
|
|
3
|
-
|
|
4
3
|
const useChatSDKStore = () => {
|
|
5
4
|
const sdk = useContext(ChatSDKStore);
|
|
6
|
-
|
|
7
5
|
if (!sdk) {
|
|
8
6
|
throw new Error("This hook is not called on component that is descendants of <ChatSDKStore.Provider>, or ChatSDK is not passed into LiveChatWidget component.");
|
|
9
7
|
}
|
|
10
|
-
|
|
11
8
|
return sdk;
|
|
12
9
|
};
|
|
13
|
-
|
|
14
10
|
export default useChatSDKStore;
|
|
@@ -5,19 +5,13 @@ import { TelemetryHelper } from "../common/telemetry/TelemetryHelper";
|
|
|
5
5
|
export const createOnNewAdapterActivityHandler = (chatId, userId) => {
|
|
6
6
|
const onNewAdapterActivityHandler = activity => {
|
|
7
7
|
var _activity$channelData, _activity$channelData2, _activity$channelData3;
|
|
8
|
-
|
|
9
8
|
const isActivityMessage = (activity === null || activity === void 0 ? void 0 : activity.type) === Constants.message;
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
if (isNotHistoryMessage) {
|
|
13
|
-
raiseMessageEvent(activity);
|
|
14
|
-
}
|
|
9
|
+
const isHistoryMessage = isActivityMessage && ((activity === null || activity === void 0 ? void 0 : (_activity$channelData = activity.channelData) === null || _activity$channelData === void 0 ? void 0 : (_activity$channelData2 = _activity$channelData.tags) === null || _activity$channelData2 === void 0 ? void 0 : _activity$channelData2.includes(Constants.historyMessageTag)) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData3 = activity.channelData) === null || _activity$channelData3 === void 0 ? void 0 : _activity$channelData3.fromList));
|
|
10
|
+
raiseMessageEvent(activity, isHistoryMessage);
|
|
15
11
|
};
|
|
16
|
-
|
|
17
|
-
const raiseMessageEvent = activity => {
|
|
12
|
+
const raiseMessageEvent = (activity, isHistoryMessage) => {
|
|
18
13
|
if ((activity === null || activity === void 0 ? void 0 : activity.type) === Constants.message) {
|
|
19
14
|
var _text, _text2, _activity$channelData4, _activity$from;
|
|
20
|
-
|
|
21
15
|
const payload = {
|
|
22
16
|
// To identify hidden contents vs empty content
|
|
23
17
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -28,7 +22,6 @@ export const createOnNewAdapterActivityHandler = (chatId, userId) => {
|
|
|
28
22
|
tags: activity === null || activity === void 0 ? void 0 : (_activity$channelData4 = activity.channelData) === null || _activity$channelData4 === void 0 ? void 0 : _activity$channelData4.tags,
|
|
29
23
|
messageType: ""
|
|
30
24
|
};
|
|
31
|
-
|
|
32
25
|
if ((activity === null || activity === void 0 ? void 0 : (_activity$from = activity.from) === null || _activity$from === void 0 ? void 0 : _activity$from.role) === Constants.userMessageTag) {
|
|
33
26
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
27
|
payload.messageType = Constants.userMessageTag;
|
|
@@ -43,40 +36,36 @@ export const createOnNewAdapterActivityHandler = (chatId, userId) => {
|
|
|
43
36
|
});
|
|
44
37
|
} else {
|
|
45
38
|
var _activity$channelData5, _activity$channelData6;
|
|
46
|
-
|
|
47
39
|
if (activity !== null && activity !== void 0 && (_activity$channelData5 = activity.channelData) !== null && _activity$channelData5 !== void 0 && (_activity$channelData6 = _activity$channelData5.tags) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.includes(Constants.systemMessageTag)) {
|
|
48
40
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
41
|
payload.messageType = Constants.systemMessageTag;
|
|
50
42
|
} else {
|
|
51
43
|
var _activity$channelData7, _activity$channelData8, _activity$channelData9;
|
|
52
|
-
|
|
53
44
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
|
-
const messageHasNoText = !(activity !== null && activity !== void 0 && activity.text);
|
|
55
|
-
|
|
56
|
-
const messageHasNoTags = !(activity !== null && activity !== void 0 && activity.channelData) || !(activity !== null && activity !== void 0 && (_activity$channelData7 = activity.channelData) !== null && _activity$channelData7 !== void 0 && _activity$channelData7.tags) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData8 = activity.channelData) === null || _activity$channelData8 === void 0 ? void 0 : (_activity$channelData9 = _activity$channelData8.tags) === null || _activity$channelData9 === void 0 ? void 0 : _activity$channelData9.length) === 0;
|
|
57
|
-
|
|
45
|
+
const messageHasNoText = !(activity !== null && activity !== void 0 && activity.text);
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
|
+
const messageHasNoTags = !(activity !== null && activity !== void 0 && activity.channelData) || !(activity !== null && activity !== void 0 && (_activity$channelData7 = activity.channelData) !== null && _activity$channelData7 !== void 0 && _activity$channelData7.tags) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData8 = activity.channelData) === null || _activity$channelData8 === void 0 ? void 0 : (_activity$channelData9 = _activity$channelData8.tags) === null || _activity$channelData9 === void 0 ? void 0 : _activity$channelData9.length) === 0;
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
58
49
|
const messageHasNoAttachments = !(activity !== null && activity !== void 0 && activity.attachments) || (activity === null || activity === void 0 ? void 0 : activity.attachments.length) === 0;
|
|
59
|
-
|
|
60
50
|
if (messageHasNoTags && messageHasNoText && messageHasNoAttachments) {
|
|
61
51
|
return;
|
|
62
52
|
}
|
|
63
|
-
|
|
64
53
|
payload.messageType = Constants.userMessageTag;
|
|
65
54
|
}
|
|
66
|
-
|
|
67
55
|
const newMessageReceivedEvent = {
|
|
68
|
-
eventName: BroadcastEvent.NewMessageReceived,
|
|
56
|
+
eventName: isHistoryMessage ? BroadcastEvent.HistoryMessageReceived : BroadcastEvent.NewMessageReceived,
|
|
69
57
|
payload: payload
|
|
70
58
|
};
|
|
71
59
|
BroadcastService.postMessage(newMessageReceivedEvent);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
60
|
+
if (!isHistoryMessage) {
|
|
61
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
62
|
+
Event: TelemetryEvent.MessageReceived,
|
|
63
|
+
Description: "New message received",
|
|
64
|
+
Data: payload
|
|
65
|
+
});
|
|
66
|
+
}
|
|
77
67
|
}
|
|
78
68
|
}
|
|
79
69
|
};
|
|
80
|
-
|
|
81
70
|
return onNewAdapterActivityHandler;
|
|
82
71
|
};
|
|
@@ -30,6 +30,7 @@ export declare enum BroadcastEvent {
|
|
|
30
30
|
InvalidAdaptiveCardFormat = "InvalidAdaptiveCardFormat",
|
|
31
31
|
NewMessageSent = "NewMessageSent",
|
|
32
32
|
NewMessageReceived = "NewMessageReceived",
|
|
33
|
+
HistoryMessageReceived = "HistoryMessageReceived",
|
|
33
34
|
RedirectPageRequest = "RedirectPageRequest",
|
|
34
35
|
StartChat = "StartChat",
|
|
35
36
|
StartChatSkippingChatButtonRendering = "StartChatSkippingChatButtonRendering",
|
|
@@ -52,8 +53,8 @@ export declare enum TelemetryEvent {
|
|
|
52
53
|
CallDisconnected = "CallDisconnected",
|
|
53
54
|
CallDisconnectedException = "CallDisconnectedException",
|
|
54
55
|
IncomingCallEnded = "incomingCallEnded",
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
VoiceVideoSdkInitialize = "VoiceVideoSdkInitialize",
|
|
57
|
+
VoiceVideoSdkInitializeException = "VoiceVideoSdkInitializeException",
|
|
57
58
|
VoiceVideoLoading = "VoiceVideoLoading",
|
|
58
59
|
VoiceVideoNotLoaded = "VoiceVideoNotLoaded",
|
|
59
60
|
VoiceVideoLoadingException = "VoiceVideoLoadingException",
|
|
@@ -79,6 +80,8 @@ export declare enum TelemetryEvent {
|
|
|
79
80
|
PostChatContextCallSucceed = "PostChatContextCallSucceed",
|
|
80
81
|
PostChatContextCallFailed = "PostChatContextCallFailed",
|
|
81
82
|
ParseAdaptiveCardFailed = "ParseAdaptiveCardFailed",
|
|
83
|
+
ClientDataStoreProviderFailed = "ClientDataStoreProviderFailed",
|
|
84
|
+
InMemoryDataStoreFailed = "InMemoryDataStoreFailed",
|
|
82
85
|
WebChatLoaded = "WebChatLoaded",
|
|
83
86
|
LCWChatButtonClicked = "LCWChatButtonClicked",
|
|
84
87
|
LCWChatButtonShow = "LCWChatButtonShow",
|
|
@@ -123,12 +126,16 @@ export declare enum TelemetryEvent {
|
|
|
123
126
|
BrowserUnloadEventStarted = "BrowserUnloadEventStarted",
|
|
124
127
|
GetAuthTokenCalled = "GetAuthTokenCalled",
|
|
125
128
|
ReceivedNullOrEmptyToken = "ReceivedNullOrEmptyToken",
|
|
129
|
+
CustomerVoiceResponsePageLoaded = "CustomerVoiceResponsePageLoaded",
|
|
130
|
+
CustomerVoiceFormResponseSubmitted = "CustomerVoiceFormResponseSubmitted",
|
|
131
|
+
CustomerVoiceFormResponseError = "CustomerVoiceFormResponseError",
|
|
126
132
|
ProcessingHTMLTextMiddlewareFailed = "ProcessingHTMLTextMiddlewareFailed",
|
|
127
133
|
ProcessingSanitizationMiddlewareFailed = "ProcessingSanitizationMiddlewareFailed",
|
|
128
134
|
FormatTagsMiddlewareJSONStringifyFailed = "FormatTagsMiddlewareJSONStringifyFailed",
|
|
129
135
|
QueuePositionMessageRecieved = "QueuePositionMessageRecieved",
|
|
130
136
|
AverageWaitTimeMessageRecieved = "AverageWaitTimeMessageRecieved",
|
|
131
137
|
DataMaskingRuleApplied = "DataMaskingRuleApplied",
|
|
138
|
+
DataMaskingRuleApplyFailed = "DataMaskingRuleApplyFailed",
|
|
132
139
|
IC3ClientEvent = "IC3ClientEvent",
|
|
133
140
|
ConversationEndedThreadEventReceived = "ConversationEndedThreadEventReceived",
|
|
134
141
|
InvalidConfiguration = "InvalidConfiguration",
|