@microsoft/omnichannel-chat-widget 0.1.0-main.fb426ed → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/lib/cjs/assets/Icons.js +4 -2
- package/lib/cjs/common/Constants.js +40 -164
- 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 +26 -0
- package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +111 -0
- package/lib/cjs/common/storage/default/defaultInMemoryDataStore.js +78 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +84 -30
- package/lib/cjs/common/telemetry/TelemetryHelper.js +21 -59
- package/lib/cjs/common/telemetry/TelemetryManager.js +3 -32
- package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +0 -2
- package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +30 -36
- package/lib/cjs/common/telemetry/loggers/consoleLogger.js +0 -9
- package/lib/cjs/common/utils.js +92 -85
- package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +8 -46
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +19 -25
- package/lib/cjs/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +3 -0
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +18 -50
- package/lib/cjs/components/dimlayer/DimLayer.js +0 -4
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +9 -37
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -8
- package/lib/cjs/components/footerstateful/FooterStateful.js +11 -42
- package/lib/cjs/components/footerstateful/audionotificationstateful/AudioNotificationStateful.js +0 -6
- package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +14 -43
- package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +6 -8
- package/lib/cjs/components/headerstateful/HeaderStateful.js +21 -32
- package/lib/cjs/components/livechatwidget/LiveChatWidget.js +2 -14
- package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +39 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +139 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +20 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +34 -0
- package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +64 -0
- package/lib/cjs/components/livechatwidget/common/Deferred.js +37 -0
- package/lib/cjs/components/livechatwidget/common/agentEndConversationHelper.js +36 -0
- package/lib/cjs/components/livechatwidget/common/authHelper.js +50 -0
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +12 -9
- package/lib/cjs/components/livechatwidget/common/createFooter.js +4 -23
- package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +10 -10
- package/lib/cjs/components/livechatwidget/common/createMarkdown.js +36 -43
- package/lib/cjs/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +14 -0
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +139 -51
- package/lib/cjs/components/livechatwidget/common/disposeTelemetryLoggers.js +0 -3
- package/lib/cjs/components/livechatwidget/common/endChat.js +98 -57
- package/lib/cjs/components/livechatwidget/common/getGeneralStylesForButton.js +0 -6
- package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +7 -16
- package/lib/cjs/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -8
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +29 -88
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +79 -128
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +4 -17
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +254 -14
- package/lib/cjs/components/livechatwidget/common/shareObservable.js +41 -0
- package/lib/cjs/components/livechatwidget/common/startChat.js +257 -117
- 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 +368 -197
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +37 -25
- package/lib/cjs/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +57 -0
- package/lib/cjs/components/loadingpanestateful/interfaces/IStartChatErrorPaneControlProps.js +1 -0
- package/lib/cjs/components/loadingpanestateful/interfaces/IStartChatErrorPaneProps.js +1 -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 +35 -24
- 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 +11 -42
- package/lib/cjs/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +1 -1
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +19 -33
- package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +8 -24
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +94 -19
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +3 -7
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -6
- package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +11 -0
- package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +12 -27
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +6 -17
- package/lib/cjs/components/webchatcontainerstateful/common/utils/BrowserInfo.js +2 -24
- package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +5 -15
- package/lib/cjs/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +5 -8
- package/lib/cjs/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +12 -0
- 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 +27 -37
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +10 -22
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +25 -61
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +7 -15
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +41 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +82 -0
- 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 +89 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +7 -18
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +8 -42
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +4 -22
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +20 -33
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +3 -9
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +81 -45
- 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/ConversationEndEntity.js +12 -0
- package/lib/cjs/contexts/common/ConversationState.js +3 -3
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +34 -26
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +20 -14
- package/lib/cjs/contexts/createReducer.js +200 -104
- package/lib/cjs/controller/componentController.js +4 -33
- 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/hooks/useDebounce.js +28 -0
- package/lib/cjs/hooks/useWindowDimensions.js +30 -0
- package/lib/cjs/index.js +0 -5
- package/lib/cjs/plugins/newMessageEventHandler.js +29 -36
- package/lib/esm/assets/Icons.js +2 -1
- package/lib/esm/common/Constants.js +36 -151
- 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 +18 -0
- package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +104 -0
- package/lib/esm/common/storage/default/defaultInMemoryDataStore.js +70 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +88 -27
- package/lib/esm/common/telemetry/TelemetryHelper.js +21 -47
- package/lib/esm/common/telemetry/TelemetryManager.js +3 -19
- package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +28 -24
- package/lib/esm/common/telemetry/loggers/consoleLogger.js +0 -5
- package/lib/esm/common/utils.js +84 -47
- package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +8 -17
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +22 -12
- package/lib/esm/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +3 -0
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +20 -31
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +9 -16
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -6
- package/lib/esm/components/footerstateful/FooterStateful.js +13 -23
- package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +14 -36
- package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +6 -6
- package/lib/esm/components/headerstateful/HeaderStateful.js +21 -17
- package/lib/esm/components/livechatwidget/LiveChatWidget.js +2 -2
- package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +32 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +134 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +13 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +27 -0
- package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +57 -0
- package/lib/esm/components/livechatwidget/common/Deferred.js +30 -0
- package/lib/esm/components/livechatwidget/common/agentEndConversationHelper.js +30 -0
- package/lib/esm/components/livechatwidget/common/authHelper.js +42 -0
- package/lib/esm/components/livechatwidget/common/createAdapter.js +14 -4
- package/lib/esm/components/livechatwidget/common/createFooter.js +4 -16
- package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +10 -5
- package/lib/esm/components/livechatwidget/common/createMarkdown.js +38 -37
- package/lib/esm/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +7 -0
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +140 -37
- package/lib/esm/components/livechatwidget/common/endChat.js +98 -43
- 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 +32 -57
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +80 -110
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +4 -9
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +257 -8
- package/lib/esm/components/livechatwidget/common/shareObservable.js +35 -0
- package/lib/esm/components/livechatwidget/common/startChat.js +256 -96
- 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 +372 -144
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +38 -13
- package/lib/esm/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +50 -0
- package/lib/esm/components/loadingpanestateful/interfaces/IStartChatErrorPaneControlProps.js +1 -0
- package/lib/esm/components/loadingpanestateful/interfaces/IStartChatErrorPaneProps.js +1 -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 +35 -12
- 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 +15 -27
- package/lib/esm/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +1 -1
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +21 -9
- package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +8 -6
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +94 -4
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -2
- package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +4 -0
- package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +12 -19
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +6 -13
- package/lib/esm/components/webchatcontainerstateful/common/utils/BrowserInfo.js +2 -16
- package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +5 -5
- package/lib/esm/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +5 -6
- package/lib/esm/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +5 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/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 +27 -22
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +12 -14
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +25 -39
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +9 -8
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +34 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +80 -0
- 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 +83 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +8 -9
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +9 -28
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +5 -14
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +20 -22
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +5 -8
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +81 -40
- 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/ConversationEndEntity.js +5 -0
- package/lib/esm/contexts/common/ConversationState.js +3 -3
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +34 -26
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +20 -10
- package/lib/esm/contexts/createReducer.js +200 -101
- package/lib/esm/controller/componentController.js +5 -4
- 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/hooks/useDebounce.js +22 -0
- package/lib/esm/hooks/useWindowDimensions.js +23 -0
- package/lib/esm/plugins/newMessageEventHandler.js +29 -26
- package/lib/types/assets/Icons.d.ts +1 -0
- package/lib/types/common/Constants.d.ts +30 -1
- package/lib/types/common/interfaces/IContextDataStore.d.ts +1 -1
- 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 +65 -12
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +4 -4
- package/lib/types/common/telemetry/definitions/Payload.d.ts +1 -0
- package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +4 -0
- package/lib/types/common/utils.d.ts +8 -1
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +0 -7
- package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +2 -1
- package/lib/types/components/livechatwidget/common/ActivityStreamHandler.d.ts +14 -0
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.d.ts +9 -0
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.d.ts +5 -0
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.d.ts +6 -0
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.d.ts +7 -0
- package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -0
- package/lib/types/components/livechatwidget/common/Deferred.d.ts +9 -0
- package/lib/types/components/livechatwidget/common/agentEndConversationHelper.d.ts +6 -0
- package/lib/types/components/livechatwidget/common/authHelper.d.ts +5 -0
- package/lib/types/components/livechatwidget/common/defaultProps/defaultScrollBarProps.d.ts +2 -0
- package/lib/types/components/livechatwidget/common/endChat.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +6 -7
- package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +6 -1
- package/lib/types/components/livechatwidget/common/shareObservable.d.ts +1 -0
- package/lib/types/components/livechatwidget/common/startChat.d.ts +5 -2
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +4 -1
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +7 -2
- package/lib/types/components/livechatwidget/interfaces/IScrollBarProps.d.ts +22 -0
- package/lib/types/components/loadingpanestateful/LoadingPaneStateful.d.ts +1 -2
- package/lib/types/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.d.ts +2 -0
- package/lib/types/components/loadingpanestateful/interfaces/IStartChatErrorPaneControlProps.d.ts +4 -0
- package/lib/types/components/loadingpanestateful/interfaces/IStartChatErrorPaneProps.d.ts +4 -0
- package/lib/types/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.d.ts +2 -2
- package/lib/types/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.d.ts +5 -0
- package/lib/types/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.d.ts +4 -0
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +0 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +4 -1
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.d.ts +3 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.d.ts +3 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.d.ts +3 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.d.ts +5 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.d.ts +1 -1
- package/lib/types/contexts/common/ConversationEndEntity.d.ts +4 -0
- package/lib/types/contexts/common/ConversationState.d.ts +3 -2
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +11 -4
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +34 -25
- package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +1 -2
- package/lib/types/hooks/useDebounce.d.ts +3 -0
- package/lib/types/hooks/useWindowDimensions.d.ts +4 -0
- package/package.json +5 -4
|
@@ -4,243 +4,339 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createReducer = void 0;
|
|
7
|
-
|
|
8
7
|
var _LiveChatWidgetActionType = require("./common/LiveChatWidgetActionType");
|
|
9
|
-
|
|
10
8
|
/* eslint-disable indent */
|
|
9
|
+
|
|
11
10
|
const createReducer = () => {
|
|
12
11
|
const reducer = (state, action) => {
|
|
13
12
|
var _action$payload, _action$payload2, _action$payload3;
|
|
14
|
-
|
|
15
13
|
switch (action.type) {
|
|
16
14
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_WIDGET_ELEMENT_ID:
|
|
17
|
-
return {
|
|
18
|
-
|
|
15
|
+
return {
|
|
16
|
+
...state,
|
|
17
|
+
domainStates: {
|
|
18
|
+
...state.domainStates,
|
|
19
19
|
widgetElementId: action.payload
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
|
|
23
22
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_RENDERING_MIDDLEWARE_PROPS:
|
|
24
|
-
return {
|
|
25
|
-
|
|
23
|
+
return {
|
|
24
|
+
...state,
|
|
25
|
+
domainStates: {
|
|
26
|
+
...state.domainStates,
|
|
26
27
|
renderingMiddlewareProps: action.payload
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
|
-
|
|
30
30
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MIDDLEWARE_LOCALIZED_TEXTS:
|
|
31
|
-
return {
|
|
32
|
-
|
|
31
|
+
return {
|
|
32
|
+
...state,
|
|
33
|
+
domainStates: {
|
|
34
|
+
...state.domainStates,
|
|
33
35
|
middlewareLocalizedTexts: action.payload
|
|
34
36
|
}
|
|
35
37
|
};
|
|
36
|
-
|
|
37
38
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_GLOBAL_DIR:
|
|
38
|
-
return {
|
|
39
|
-
|
|
39
|
+
return {
|
|
40
|
+
...state,
|
|
41
|
+
domainStates: {
|
|
42
|
+
...state.domainStates,
|
|
40
43
|
globalDir: action.payload === "ltr" || action.payload === "rtl" ? action.payload : "ltr"
|
|
41
44
|
}
|
|
42
45
|
};
|
|
43
|
-
|
|
44
46
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MINIMIZED:
|
|
45
|
-
return {
|
|
46
|
-
|
|
47
|
+
return {
|
|
48
|
+
...state,
|
|
49
|
+
appStates: {
|
|
50
|
+
...state.appStates,
|
|
47
51
|
isMinimized: action.payload
|
|
48
52
|
}
|
|
49
53
|
};
|
|
50
|
-
|
|
51
54
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE:
|
|
52
|
-
return {
|
|
53
|
-
|
|
55
|
+
return {
|
|
56
|
+
...state,
|
|
57
|
+
appStates: {
|
|
58
|
+
...state.appStates,
|
|
54
59
|
conversationState: action.payload
|
|
55
60
|
}
|
|
56
61
|
};
|
|
57
|
-
|
|
62
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_START_CHAT_FAILING:
|
|
63
|
+
return {
|
|
64
|
+
...state,
|
|
65
|
+
appStates: {
|
|
66
|
+
...state.appStates,
|
|
67
|
+
isStartChatFailing: action.payload
|
|
68
|
+
}
|
|
69
|
+
};
|
|
58
70
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_OUTSIDE_OPERATING_HOURS:
|
|
59
|
-
return {
|
|
60
|
-
|
|
71
|
+
return {
|
|
72
|
+
...state,
|
|
73
|
+
appStates: {
|
|
74
|
+
...state.appStates,
|
|
61
75
|
outsideOperatingHours: action.payload
|
|
62
76
|
}
|
|
63
77
|
};
|
|
64
|
-
|
|
65
78
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_PRE_CHAT_SURVEY_RESPONSE:
|
|
66
|
-
return {
|
|
67
|
-
|
|
79
|
+
return {
|
|
80
|
+
...state,
|
|
81
|
+
domainStates: {
|
|
82
|
+
...state.domainStates,
|
|
68
83
|
preChatSurveyResponse: action.payload
|
|
69
84
|
}
|
|
70
85
|
};
|
|
71
|
-
|
|
72
86
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CUSTOM_CONTEXT:
|
|
73
|
-
return {
|
|
74
|
-
|
|
87
|
+
return {
|
|
88
|
+
...state,
|
|
89
|
+
domainStates: {
|
|
90
|
+
...state.domainStates,
|
|
75
91
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
92
|
customContext: action.payload
|
|
77
93
|
}
|
|
78
94
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
appStates: {
|
|
83
|
-
|
|
95
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_PREVIOUS_FOCUSED_ELEMENT_ID:
|
|
96
|
+
return {
|
|
97
|
+
...state,
|
|
98
|
+
appStates: {
|
|
99
|
+
...state.appStates,
|
|
100
|
+
previousElementIdOnFocusBeforeModalOpen: action.payload
|
|
84
101
|
}
|
|
85
102
|
};
|
|
86
|
-
|
|
87
103
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SHOW_CONFIRMATION:
|
|
88
|
-
return {
|
|
89
|
-
|
|
104
|
+
return {
|
|
105
|
+
...state,
|
|
106
|
+
uiStates: {
|
|
107
|
+
...state.uiStates,
|
|
90
108
|
showConfirmationPane: action.payload
|
|
91
109
|
}
|
|
92
110
|
};
|
|
93
|
-
|
|
94
111
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_POST_CHAT_CONTEXT:
|
|
95
|
-
return {
|
|
96
|
-
|
|
112
|
+
return {
|
|
113
|
+
...state,
|
|
114
|
+
domainStates: {
|
|
115
|
+
...state.domainStates,
|
|
97
116
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
98
117
|
postChatContext: action.payload
|
|
99
118
|
}
|
|
100
119
|
};
|
|
101
|
-
|
|
102
120
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SHOW_CALLING_CONTAINER:
|
|
103
|
-
return {
|
|
104
|
-
|
|
121
|
+
return {
|
|
122
|
+
...state,
|
|
123
|
+
uiStates: {
|
|
124
|
+
...state.uiStates,
|
|
105
125
|
showCallingPopup: action.payload
|
|
106
126
|
}
|
|
107
127
|
};
|
|
108
|
-
|
|
109
128
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_INCOMING_CALL:
|
|
110
|
-
return {
|
|
111
|
-
|
|
129
|
+
return {
|
|
130
|
+
...state,
|
|
131
|
+
uiStates: {
|
|
132
|
+
...state.uiStates,
|
|
112
133
|
isIncomingCall: action.payload
|
|
113
134
|
}
|
|
114
135
|
};
|
|
115
|
-
|
|
116
136
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_FOCUS_CHAT_BUTTON:
|
|
117
|
-
return {
|
|
118
|
-
|
|
137
|
+
return {
|
|
138
|
+
...state,
|
|
139
|
+
uiStates: {
|
|
140
|
+
...state.uiStates,
|
|
119
141
|
focusChatButton: action.payload
|
|
120
142
|
}
|
|
121
143
|
};
|
|
122
|
-
|
|
123
144
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.DISABLE_VIDEO_CALL:
|
|
124
|
-
return {
|
|
125
|
-
|
|
145
|
+
return {
|
|
146
|
+
...state,
|
|
147
|
+
uiStates: {
|
|
148
|
+
...state.uiStates,
|
|
126
149
|
disableVideoCall: action.payload
|
|
127
150
|
}
|
|
128
151
|
};
|
|
129
|
-
|
|
130
152
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.DISABLE_LOCAL_VIDEO:
|
|
131
|
-
return {
|
|
132
|
-
|
|
153
|
+
return {
|
|
154
|
+
...state,
|
|
155
|
+
uiStates: {
|
|
156
|
+
...state.uiStates,
|
|
133
157
|
disableSelfVideo: action.payload
|
|
134
158
|
}
|
|
135
159
|
};
|
|
136
|
-
|
|
137
160
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.DISABLE_REMOTE_VIDEO:
|
|
138
|
-
return {
|
|
139
|
-
|
|
161
|
+
return {
|
|
162
|
+
...state,
|
|
163
|
+
uiStates: {
|
|
164
|
+
...state.uiStates,
|
|
140
165
|
disableRemoteVideo: action.payload
|
|
141
166
|
}
|
|
142
167
|
};
|
|
143
|
-
|
|
144
168
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CHAT_TOKEN:
|
|
145
|
-
return {
|
|
146
|
-
|
|
169
|
+
return {
|
|
170
|
+
...state,
|
|
171
|
+
domainStates: {
|
|
172
|
+
...state.domainStates,
|
|
147
173
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
148
174
|
chatToken: action.payload
|
|
149
175
|
}
|
|
150
176
|
};
|
|
151
|
-
|
|
152
177
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SHOW_EMAIL_TRANSCRIPT_PANE:
|
|
153
|
-
return {
|
|
154
|
-
|
|
178
|
+
return {
|
|
179
|
+
...state,
|
|
180
|
+
uiStates: {
|
|
181
|
+
...state.uiStates,
|
|
155
182
|
showEmailTranscriptPane: action.payload
|
|
156
183
|
}
|
|
157
184
|
};
|
|
158
|
-
|
|
159
185
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_PRECHAT_RESPONSE_EMAIL:
|
|
160
|
-
return {
|
|
161
|
-
|
|
186
|
+
return {
|
|
187
|
+
...state,
|
|
188
|
+
appStates: {
|
|
189
|
+
...state.appStates,
|
|
162
190
|
preChatResponseEmail: action.payload
|
|
163
191
|
}
|
|
164
192
|
};
|
|
165
|
-
|
|
166
193
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_AUDIO_NOTIFICATION:
|
|
167
|
-
return {
|
|
168
|
-
|
|
194
|
+
return {
|
|
195
|
+
...state,
|
|
196
|
+
appStates: {
|
|
197
|
+
...state.appStates,
|
|
169
198
|
isAudioMuted: action.payload
|
|
170
199
|
}
|
|
171
200
|
};
|
|
172
|
-
|
|
173
201
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_E2VV_ENABLED:
|
|
174
|
-
return {
|
|
175
|
-
|
|
202
|
+
return {
|
|
203
|
+
...state,
|
|
204
|
+
appStates: {
|
|
205
|
+
...state.appStates,
|
|
176
206
|
e2vvEnabled: action.payload
|
|
177
207
|
}
|
|
178
208
|
};
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
appStates: {
|
|
183
|
-
|
|
209
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_START_CHAT_BUTTON_DISPLAY:
|
|
210
|
+
return {
|
|
211
|
+
...state,
|
|
212
|
+
appStates: {
|
|
213
|
+
...state.appStates,
|
|
214
|
+
hideStartChatButton: action.payload
|
|
184
215
|
}
|
|
185
216
|
};
|
|
186
|
-
|
|
187
217
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_PROACTIVE_CHAT_PARAMS:
|
|
188
|
-
return {
|
|
189
|
-
|
|
190
|
-
|
|
218
|
+
return {
|
|
219
|
+
...state,
|
|
220
|
+
appStates: {
|
|
221
|
+
...state.appStates,
|
|
222
|
+
proactiveChatStates: {
|
|
223
|
+
...state.appStates.proactiveChatStates,
|
|
191
224
|
proactiveChatBodyTitle: (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : _action$payload.proactiveChatBodyTitle,
|
|
192
225
|
proactiveChatEnablePrechat: (_action$payload2 = action.payload) === null || _action$payload2 === void 0 ? void 0 : _action$payload2.proactiveChatEnablePrechat,
|
|
193
226
|
proactiveChatInNewWindow: (_action$payload3 = action.payload) === null || _action$payload3 === void 0 ? void 0 : _action$payload3.proactiveChatInNewWindow
|
|
194
227
|
}
|
|
195
228
|
}
|
|
196
229
|
};
|
|
197
|
-
|
|
198
230
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_TELEMETRY_DATA:
|
|
199
|
-
return {
|
|
200
|
-
|
|
231
|
+
return {
|
|
232
|
+
...state,
|
|
233
|
+
domainStates: {
|
|
234
|
+
...state.domainStates,
|
|
201
235
|
telemetryInternalData: action.payload
|
|
202
236
|
}
|
|
203
237
|
};
|
|
204
|
-
|
|
205
238
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_RECONNECT_ID:
|
|
206
|
-
return {
|
|
207
|
-
|
|
239
|
+
return {
|
|
240
|
+
...state,
|
|
241
|
+
appStates: {
|
|
242
|
+
...state.appStates,
|
|
208
243
|
reconnectId: action.payload
|
|
209
244
|
}
|
|
210
245
|
};
|
|
211
|
-
|
|
212
246
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_UNREAD_MESSAGE_COUNT:
|
|
213
|
-
return {
|
|
214
|
-
|
|
247
|
+
return {
|
|
248
|
+
...state,
|
|
249
|
+
appStates: {
|
|
250
|
+
...state.appStates,
|
|
215
251
|
unreadMessageCount: action.payload
|
|
216
252
|
}
|
|
217
253
|
};
|
|
218
|
-
|
|
219
254
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT:
|
|
220
|
-
return {
|
|
221
|
-
|
|
255
|
+
return {
|
|
256
|
+
...state,
|
|
257
|
+
domainStates: {
|
|
258
|
+
...state.domainStates,
|
|
222
259
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
223
260
|
liveChatContext: action.payload
|
|
224
261
|
}
|
|
225
262
|
};
|
|
226
|
-
|
|
227
263
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_WIDGET_STATE:
|
|
228
|
-
return {
|
|
264
|
+
return {
|
|
265
|
+
...action.payload
|
|
229
266
|
};
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
appStates: {
|
|
234
|
-
|
|
267
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED:
|
|
268
|
+
return {
|
|
269
|
+
...state,
|
|
270
|
+
appStates: {
|
|
271
|
+
...state.appStates,
|
|
272
|
+
conversationEndedByAgentEventReceived: action.payload
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY:
|
|
276
|
+
return {
|
|
277
|
+
...state,
|
|
278
|
+
appStates: {
|
|
279
|
+
...state.appStates,
|
|
280
|
+
conversationEndedBy: action.payload
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_WIDGET_SIZE:
|
|
284
|
+
return {
|
|
285
|
+
...state,
|
|
286
|
+
domainStates: {
|
|
287
|
+
...state.domainStates,
|
|
288
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
289
|
+
widgetSize: action.payload
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_WIDGET_INSTANCE_ID:
|
|
293
|
+
return {
|
|
294
|
+
...state,
|
|
295
|
+
domainStates: {
|
|
296
|
+
...state.domainStates,
|
|
297
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
298
|
+
widgetInstanceId: action.payload
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_LIVE_CHAT_CONFIG:
|
|
302
|
+
return {
|
|
303
|
+
...state,
|
|
304
|
+
domainStates: {
|
|
305
|
+
...state.domainStates,
|
|
306
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
307
|
+
liveChatConfig: action.payload
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_POST_CHAT_WORKFLOW_IN_PROGRESS:
|
|
311
|
+
return {
|
|
312
|
+
...state,
|
|
313
|
+
appStates: {
|
|
314
|
+
...state.appStates,
|
|
315
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
316
|
+
postChatWorkflowInProgress: action.payload
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_INITIAL_CHAT_SDK_REQUEST_ID:
|
|
320
|
+
return {
|
|
321
|
+
...state,
|
|
322
|
+
domainStates: {
|
|
323
|
+
...state.domainStates,
|
|
324
|
+
initialChatSdkRequestId: action.payload
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SHOULD_USE_BOT_SURVEY:
|
|
328
|
+
return {
|
|
329
|
+
...state,
|
|
330
|
+
appStates: {
|
|
331
|
+
...state.appStates,
|
|
332
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
333
|
+
shouldUseBotSurvey: action.payload
|
|
235
334
|
}
|
|
236
335
|
};
|
|
237
|
-
|
|
238
336
|
default:
|
|
239
337
|
return state;
|
|
240
338
|
}
|
|
241
339
|
};
|
|
242
|
-
|
|
243
340
|
return reducer;
|
|
244
341
|
};
|
|
245
|
-
|
|
246
342
|
exports.createReducer = createReducer;
|
|
@@ -4,89 +4,60 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.shouldShowWebChatContainer = exports.shouldShowReconnectChatPane = exports.shouldShowProactiveChatPane = exports.shouldShowPreChatSurveyPane = exports.shouldShowPostChatSurveyPane = exports.shouldShowPostChatLoadingPane = exports.shouldShowOutOfOfficeHoursPane = exports.shouldShowLoadingPane = exports.shouldShowHeader = exports.shouldShowFooter = exports.shouldShowEmailTranscriptPane = exports.shouldShowConfirmationPane = exports.shouldShowChatButton = exports.shouldShowCallingContainer = void 0;
|
|
7
|
-
|
|
8
7
|
var _ConversationState = require("../contexts/common/ConversationState");
|
|
9
|
-
|
|
10
8
|
const shouldShowChatButton = state => {
|
|
11
|
-
return state.appStates.isMinimized || state.appStates.conversationState === _ConversationState.ConversationState.Closed;
|
|
9
|
+
return (state.appStates.isMinimized || state.appStates.conversationState === _ConversationState.ConversationState.Closed) && state.appStates.hideStartChatButton === false; // Do not show chat button in case of popout
|
|
12
10
|
};
|
|
13
|
-
|
|
14
11
|
exports.shouldShowChatButton = shouldShowChatButton;
|
|
15
|
-
|
|
16
12
|
const shouldShowProactiveChatPane = state => {
|
|
17
13
|
return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.ProactiveChat;
|
|
18
14
|
};
|
|
19
|
-
|
|
20
15
|
exports.shouldShowProactiveChatPane = shouldShowProactiveChatPane;
|
|
21
|
-
|
|
22
16
|
const shouldShowHeader = state => {
|
|
23
17
|
return !state.appStates.isMinimized && state.appStates.conversationState !== _ConversationState.ConversationState.Closed && state.appStates.conversationState !== _ConversationState.ConversationState.ProactiveChat;
|
|
24
18
|
};
|
|
25
|
-
|
|
26
19
|
exports.shouldShowHeader = shouldShowHeader;
|
|
27
|
-
|
|
28
20
|
const shouldShowFooter = state => {
|
|
29
|
-
return !state.appStates.isMinimized && (state.appStates.conversationState === _ConversationState.ConversationState.Active || state.appStates.conversationState === _ConversationState.ConversationState.InActive);
|
|
21
|
+
return !state.appStates.isMinimized && (state.appStates.conversationState === _ConversationState.ConversationState.Active || state.appStates.conversationState === _ConversationState.ConversationState.InActive || state.appStates.conversationState === _ConversationState.ConversationState.Postchat);
|
|
30
22
|
};
|
|
31
|
-
|
|
32
23
|
exports.shouldShowFooter = shouldShowFooter;
|
|
33
|
-
|
|
34
24
|
const shouldShowEmailTranscriptPane = state => {
|
|
35
25
|
return state.uiStates.showEmailTranscriptPane;
|
|
36
26
|
};
|
|
37
|
-
|
|
38
27
|
exports.shouldShowEmailTranscriptPane = shouldShowEmailTranscriptPane;
|
|
39
|
-
|
|
40
28
|
const shouldShowWebChatContainer = state => {
|
|
41
29
|
return state.appStates.conversationState === _ConversationState.ConversationState.Active || state.appStates.conversationState === _ConversationState.ConversationState.InActive;
|
|
42
30
|
};
|
|
43
|
-
|
|
44
31
|
exports.shouldShowWebChatContainer = shouldShowWebChatContainer;
|
|
45
|
-
|
|
46
32
|
const shouldShowLoadingPane = state => {
|
|
47
|
-
return !state.appStates.isMinimized &&
|
|
33
|
+
return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.Loading;
|
|
48
34
|
};
|
|
49
|
-
|
|
50
35
|
exports.shouldShowLoadingPane = shouldShowLoadingPane;
|
|
51
|
-
|
|
52
36
|
const shouldShowReconnectChatPane = state => {
|
|
53
37
|
return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.ReconnectChat;
|
|
54
38
|
};
|
|
55
|
-
|
|
56
39
|
exports.shouldShowReconnectChatPane = shouldShowReconnectChatPane;
|
|
57
|
-
|
|
58
40
|
const shouldShowPostChatLoadingPane = state => {
|
|
59
|
-
return !state.appStates.isMinimized && state.appStates.
|
|
41
|
+
return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.PostchatLoading;
|
|
60
42
|
};
|
|
61
|
-
|
|
62
43
|
exports.shouldShowPostChatLoadingPane = shouldShowPostChatLoadingPane;
|
|
63
|
-
|
|
64
44
|
const shouldShowOutOfOfficeHoursPane = state => {
|
|
65
45
|
return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.OutOfOffice;
|
|
66
46
|
};
|
|
67
|
-
|
|
68
47
|
exports.shouldShowOutOfOfficeHoursPane = shouldShowOutOfOfficeHoursPane;
|
|
69
|
-
|
|
70
48
|
const shouldShowPreChatSurveyPane = state => {
|
|
71
49
|
return state.appStates.conversationState === _ConversationState.ConversationState.Prechat;
|
|
72
50
|
};
|
|
73
|
-
|
|
74
51
|
exports.shouldShowPreChatSurveyPane = shouldShowPreChatSurveyPane;
|
|
75
|
-
|
|
76
52
|
const shouldShowConfirmationPane = state => {
|
|
77
53
|
return state.uiStates.showConfirmationPane;
|
|
78
54
|
};
|
|
79
|
-
|
|
80
55
|
exports.shouldShowConfirmationPane = shouldShowConfirmationPane;
|
|
81
|
-
|
|
82
56
|
const shouldShowPostChatSurveyPane = state => {
|
|
83
57
|
return state.appStates.conversationState === _ConversationState.ConversationState.Postchat;
|
|
84
58
|
};
|
|
85
|
-
|
|
86
59
|
exports.shouldShowPostChatSurveyPane = shouldShowPostChatSurveyPane;
|
|
87
|
-
|
|
88
60
|
const shouldShowCallingContainer = state => {
|
|
89
61
|
return state.appStates.conversationState === _ConversationState.ConversationState.Active && state.appStates.e2vvEnabled;
|
|
90
62
|
};
|
|
91
|
-
|
|
92
63
|
exports.shouldShowCallingContainer = shouldShowCallingContainer;
|
|
@@ -4,21 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _ChatAdapterStore = require("../contexts/ChatAdapterStore");
|
|
9
|
-
|
|
10
8
|
var _react = require("react");
|
|
11
|
-
|
|
12
9
|
const useChatAdapterStore = () => {
|
|
13
10
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
11
|
const adapter = (0, _react.useContext)(_ChatAdapterStore.ChatAdapterStore);
|
|
15
|
-
|
|
16
12
|
if (!adapter) {
|
|
17
13
|
throw new Error("This hook can only be used on component that is descendants of <ChatAdapterStore.Provider>");
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
return adapter;
|
|
21
16
|
};
|
|
22
|
-
|
|
23
17
|
var _default = useChatAdapterStore;
|
|
24
18
|
exports.default = _default;
|
|
@@ -4,20 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _ChatContextStore = require("../contexts/ChatContextStore");
|
|
11
|
-
|
|
12
9
|
const useChatContextStore = () => {
|
|
13
10
|
const context = (0, _react.useContext)(_ChatContextStore.ChatContextStore);
|
|
14
|
-
|
|
15
11
|
if (!context) {
|
|
16
12
|
throw new Error("This hook can only be used on component that is descendants of <ChatContextStore.Provider>");
|
|
17
13
|
}
|
|
18
|
-
|
|
19
14
|
return context;
|
|
20
15
|
};
|
|
21
|
-
|
|
22
16
|
var _default = useChatContextStore;
|
|
23
17
|
exports.default = _default;
|
|
@@ -4,20 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _ChatSDKStore = require("../contexts/ChatSDKStore");
|
|
9
|
-
|
|
10
8
|
var _react = require("react");
|
|
11
|
-
|
|
12
9
|
const useChatSDKStore = () => {
|
|
13
10
|
const sdk = (0, _react.useContext)(_ChatSDKStore.ChatSDKStore);
|
|
14
|
-
|
|
15
11
|
if (!sdk) {
|
|
16
12
|
throw new Error("This hook is not called on component that is descendants of <ChatSDKStore.Provider>, or ChatSDK is not passed into LiveChatWidget component.");
|
|
17
13
|
}
|
|
18
|
-
|
|
19
14
|
return sdk;
|
|
20
15
|
};
|
|
21
|
-
|
|
22
16
|
var _default = useChatSDKStore;
|
|
23
17
|
exports.default = _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useDebounce;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
function useDebounce(func) {
|
|
9
|
+
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
|
10
|
+
const timer = (0, _react.useRef)();
|
|
11
|
+
(0, _react.useEffect)(() => {
|
|
12
|
+
return () => {
|
|
13
|
+
if (!timer.current) return;
|
|
14
|
+
clearTimeout(timer.current);
|
|
15
|
+
};
|
|
16
|
+
}, []);
|
|
17
|
+
const debouncedFunction = function () {
|
|
18
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
19
|
+
args[_key] = arguments[_key];
|
|
20
|
+
}
|
|
21
|
+
const newTimer = setTimeout(() => {
|
|
22
|
+
func(...args);
|
|
23
|
+
}, delay);
|
|
24
|
+
clearTimeout(timer.current);
|
|
25
|
+
timer.current = newTimer;
|
|
26
|
+
};
|
|
27
|
+
return debouncedFunction;
|
|
28
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useWindowDimensions;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _useDebounce = _interopRequireDefault(require("./useDebounce"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function getWindowDimensions() {
|
|
11
|
+
const {
|
|
12
|
+
innerWidth: width,
|
|
13
|
+
innerHeight: height
|
|
14
|
+
} = window;
|
|
15
|
+
return {
|
|
16
|
+
width,
|
|
17
|
+
height
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function useWindowDimensions() {
|
|
21
|
+
let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 200;
|
|
22
|
+
const [windowDimensions, setWindowDimensions] = (0, _react.useState)(getWindowDimensions());
|
|
23
|
+
const handleResize = () => setWindowDimensions(getWindowDimensions());
|
|
24
|
+
const debouncedHandleResize = (0, _useDebounce.default)(handleResize, delay);
|
|
25
|
+
(0, _react.useEffect)(() => {
|
|
26
|
+
window.addEventListener("resize", debouncedHandleResize);
|
|
27
|
+
return () => window.removeEventListener("resize", debouncedHandleResize);
|
|
28
|
+
}, []);
|
|
29
|
+
return windowDimensions;
|
|
30
|
+
}
|
package/lib/cjs/index.js
CHANGED
|
@@ -39,13 +39,8 @@ Object.defineProperty(exports, "useChatSDKStore", {
|
|
|
39
39
|
return _useChatSDKStore.default;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
|
|
43
42
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
44
|
-
|
|
45
43
|
var _useChatContextStore = _interopRequireDefault(require("./hooks/useChatContextStore"));
|
|
46
|
-
|
|
47
44
|
var _useChatSDKStore = _interopRequireDefault(require("./hooks/useChatSDKStore"));
|
|
48
|
-
|
|
49
45
|
var _LiveChatWidget = _interopRequireDefault(require("./components/livechatwidget/LiveChatWidget"));
|
|
50
|
-
|
|
51
46
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|