@microsoft/omnichannel-chat-widget 0.1.0-main.eb80fb1 → 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/README.md +35 -11
- package/lib/cjs/common/Constants.js +31 -150
- 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 +79 -24
- package/lib/cjs/common/telemetry/TelemetryHelper.js +26 -54
- package/lib/cjs/common/telemetry/TelemetryManager.js +14 -34
- package/lib/cjs/common/telemetry/defaultConfigs/defaultAriaConfig.js +1 -1
- package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -3
- package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +49 -35
- package/lib/cjs/common/telemetry/loggers/consoleLogger.js +6 -14
- package/lib/cjs/common/utils.js +80 -80
- package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +21 -45
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +20 -26
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +12 -70
- 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 +12 -44
- package/lib/cjs/components/footerstateful/audionotificationstateful/AudioNotificationStateful.js +0 -6
- package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +15 -44
- package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +6 -8
- package/lib/cjs/components/headerstateful/HeaderStateful.js +23 -34
- package/lib/cjs/components/livechatwidget/LiveChatWidget.js +2 -14
- package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +37 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +18 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +32 -0
- package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +62 -0
- package/lib/cjs/components/livechatwidget/common/Deferred.js +35 -0
- package/lib/cjs/components/livechatwidget/common/authHelper.js +50 -0
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +10 -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 -44
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +73 -52
- package/lib/cjs/components/livechatwidget/common/disposeTelemetryLoggers.js +0 -3
- package/lib/cjs/components/livechatwidget/common/endChat.js +127 -61
- package/lib/cjs/components/livechatwidget/common/getGeneralStylesForButton.js +0 -6
- package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +8 -17
- package/lib/cjs/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -8
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +58 -54
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +131 -56
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +9 -33
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -15
- package/lib/cjs/components/livechatwidget/common/shareObservable.js +41 -0
- package/lib/cjs/components/livechatwidget/common/startChat.js +157 -77
- 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 +287 -139
- 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 +9 -14
- 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 +11 -44
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +21 -35
- package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +2 -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 +9 -26
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +6 -15
- 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/interfaces/IAdaptiveCardStyles.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +10 -0
- 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 +33 -80
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +9 -19
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +25 -60
- 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 +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 +7 -18
- 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 +33 -0
- 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 +4 -3
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +11 -9
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +14 -10
- package/lib/cjs/contexts/createReducer.js +150 -107
- package/lib/cjs/controller/componentController.js +5 -34
- 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 +78 -0
- package/lib/esm/common/Constants.js +28 -138
- 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 +78 -19
- package/lib/esm/common/telemetry/TelemetryHelper.js +27 -44
- package/lib/esm/common/telemetry/TelemetryManager.js +14 -23
- package/lib/esm/common/telemetry/defaultConfigs/defaultAriaConfig.js +1 -1
- package/lib/esm/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
- package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +49 -23
- package/lib/esm/common/telemetry/loggers/consoleLogger.js +6 -10
- package/lib/esm/common/utils.js +73 -45
- package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +21 -16
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +23 -13
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +13 -46
- 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 +14 -25
- package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +15 -37
- package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +6 -6
- package/lib/esm/components/headerstateful/HeaderStateful.js +24 -20
- package/lib/esm/components/livechatwidget/LiveChatWidget.js +2 -2
- package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +30 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +11 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +25 -0
- package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +55 -0
- package/lib/esm/components/livechatwidget/common/Deferred.js +28 -0
- package/lib/esm/components/livechatwidget/common/authHelper.js +42 -0
- package/lib/esm/components/livechatwidget/common/createAdapter.js +12 -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/dummyDefaultProps.js +75 -40
- package/lib/esm/components/livechatwidget/common/endChat.js +131 -50
- package/lib/esm/components/livechatwidget/common/getGeneralStylesForButton.js +0 -2
- package/lib/esm/components/livechatwidget/common/initCallingSdk.js +10 -12
- package/lib/esm/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -5
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +60 -26
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +129 -50
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +9 -23
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +4 -6
- package/lib/esm/components/livechatwidget/common/shareObservable.js +35 -0
- package/lib/esm/components/livechatwidget/common/startChat.js +161 -61
- package/lib/esm/components/livechatwidget/common/updateSessionDataForTelemetry.js +4 -2
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +293 -94
- 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 +9 -4
- 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 +15 -29
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +24 -12
- package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +2 -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 +9 -18
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +6 -11
- 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/interfaces/IAdaptiveCardStyles.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +3 -0
- 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 +34 -66
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +11 -11
- 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 +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 +9 -14
- 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 +27 -0
- 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 +4 -3
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +11 -9
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +14 -6
- package/lib/esm/contexts/createReducer.js +150 -103
- package/lib/esm/controller/componentController.js +6 -5
- 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 +71 -0
- package/lib/types/common/Constants.d.ts +27 -2
- package/lib/types/common/interfaces/IContextDataStore.d.ts +2 -2
- 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 +53 -6
- package/lib/types/common/telemetry/TelemetryHelper.d.ts +2 -0
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +2 -4
- package/lib/types/common/telemetry/definitions/Payload.d.ts +12 -9
- package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +3 -3
- package/lib/types/common/utils.d.ts +8 -1
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +5 -2
- package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationStatefulParams.d.ts +0 -1
- package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +5 -1
- package/lib/types/components/livechatwidget/common/ActivityStreamHandler.d.ts +14 -0
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.d.ts +5 -0
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.d.ts +6 -0
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.d.ts +7 -0
- package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -0
- package/lib/types/components/livechatwidget/common/Deferred.d.ts +9 -0
- package/lib/types/components/livechatwidget/common/authHelper.d.ts +5 -0
- package/lib/types/components/livechatwidget/common/endChat.d.ts +4 -1
- package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +7 -2
- package/lib/types/components/livechatwidget/common/shareObservable.d.ts +1 -0
- package/lib/types/components/livechatwidget/common/startChat.d.ts +4 -2
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts +1 -0
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +1 -0
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +4 -3
- 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 +1 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/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/activityMiddleware.d.ts +0 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/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/webchattelemetry/WebChatLogger.d.ts +1 -0
- package/lib/types/contexts/common/ConversationState.d.ts +4 -2
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +4 -2
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +12 -9
- package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +1 -2
- package/lib/types/plugins/newMessageEventHandler.d.ts +2 -0
- package/package.json +12 -13
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.ConversationState = void 0;
|
|
7
7
|
let ConversationState;
|
|
8
8
|
exports.ConversationState = ConversationState;
|
|
9
|
-
|
|
10
9
|
(function (ConversationState) {
|
|
11
10
|
ConversationState[ConversationState["Prechat"] = 0] = "Prechat";
|
|
12
11
|
ConversationState[ConversationState["Loading"] = 1] = "Loading";
|
|
@@ -14,6 +13,8 @@ exports.ConversationState = ConversationState;
|
|
|
14
13
|
ConversationState[ConversationState["OutOfOffice"] = 3] = "OutOfOffice";
|
|
15
14
|
ConversationState[ConversationState["ProactiveChat"] = 4] = "ProactiveChat";
|
|
16
15
|
ConversationState[ConversationState["Active"] = 5] = "Active";
|
|
17
|
-
ConversationState[ConversationState["
|
|
18
|
-
ConversationState[ConversationState["
|
|
16
|
+
ConversationState[ConversationState["InActive"] = 6] = "InActive";
|
|
17
|
+
ConversationState[ConversationState["PostchatLoading"] = 7] = "PostchatLoading";
|
|
18
|
+
ConversationState[ConversationState["Postchat"] = 8] = "Postchat";
|
|
19
|
+
ConversationState[ConversationState["Closed"] = 9] = "Closed";
|
|
19
20
|
})(ConversationState || (exports.ConversationState = ConversationState = {}));
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.LiveChatWidgetActionType = void 0;
|
|
7
7
|
let LiveChatWidgetActionType;
|
|
8
8
|
exports.LiveChatWidgetActionType = LiveChatWidgetActionType;
|
|
9
|
-
|
|
10
9
|
(function (LiveChatWidgetActionType) {
|
|
11
10
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_ELEMENT_ID"] = 0] = "SET_WIDGET_ELEMENT_ID";
|
|
12
11
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RENDERING_MIDDLEWARE_PROPS"] = 1] = "SET_RENDERING_MIDDLEWARE_PROPS";
|
|
@@ -14,16 +13,16 @@ exports.LiveChatWidgetActionType = LiveChatWidgetActionType;
|
|
|
14
13
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_GLOBAL_DIR"] = 3] = "SET_GLOBAL_DIR";
|
|
15
14
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_MINIMIZED"] = 4] = "SET_MINIMIZED";
|
|
16
15
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_STATE"] = 5] = "SET_CONVERSATION_STATE";
|
|
17
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
16
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PREVIOUS_FOCUSED_ELEMENT_ID"] = 6] = "SET_PREVIOUS_FOCUSED_ELEMENT_ID";
|
|
18
17
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_OUTSIDE_OPERATING_HOURS"] = 7] = "SET_OUTSIDE_OPERATING_HOURS";
|
|
19
18
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRE_CHAT_SURVEY_RESPONSE"] = 8] = "SET_PRE_CHAT_SURVEY_RESPONSE";
|
|
20
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
21
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
22
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
23
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
24
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
25
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
26
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
19
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CUSTOM_CONTEXT"] = 9] = "SET_CUSTOM_CONTEXT";
|
|
20
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_CONFIRMATION"] = 10] = "SET_SHOW_CONFIRMATION";
|
|
21
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_EMAIL_TRANSCRIPT_PANE"] = 11] = "SET_SHOW_EMAIL_TRANSCRIPT_PANE";
|
|
22
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRECHAT_RESPONSE_EMAIL"] = 12] = "SET_PRECHAT_RESPONSE_EMAIL";
|
|
23
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 13] = "SET_AUDIO_NOTIFICATION";
|
|
24
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 14] = "SET_E2VV_ENABLED";
|
|
25
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 15] = "SET_POST_CHAT_CONTEXT";
|
|
27
26
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 16] = "SHOW_CALLING_CONTAINER";
|
|
28
27
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 17] = "SET_INCOMING_CALL";
|
|
29
28
|
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 18] = "DISABLE_VIDEO_CALL";
|
|
@@ -39,4 +38,7 @@ exports.LiveChatWidgetActionType = LiveChatWidgetActionType;
|
|
|
39
38
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT"] = 28] = "SET_CONVERSATION_ENDED_BY_AGENT";
|
|
40
39
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 29] = "SET_WIDGET_STATE";
|
|
41
40
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 30] = "SET_LIVE_CHAT_CONTEXT";
|
|
41
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_OAUTH_SIGNIN_ID"] = 31] = "SET_BOT_OAUTH_SIGNIN_ID";
|
|
42
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_SIZE"] = 32] = "SET_WIDGET_SIZE";
|
|
43
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_INSTANCE_ID"] = 33] = "SET_WIDGET_INSTANCE_ID";
|
|
42
44
|
})(LiveChatWidgetActionType || (exports.LiveChatWidgetActionType = LiveChatWidgetActionType = {}));
|
|
@@ -4,14 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getLiveChatWidgetContextInitialState = void 0;
|
|
7
|
-
|
|
8
7
|
var _ConversationState = require("./ConversationState");
|
|
9
|
-
|
|
10
8
|
var _defaultMiddlewareLocalizedTexts = require("../../components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
11
|
-
|
|
9
|
+
var _utils = require("../../common/utils");
|
|
10
|
+
var _defaultClientDataStoreProvider = require("../../common/storage/default/defaultClientDataStoreProvider");
|
|
12
11
|
const getLiveChatWidgetContextInitialState = props => {
|
|
13
|
-
var _props$webChatContain;
|
|
14
|
-
|
|
12
|
+
var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$controlProps, _props$webChatContain;
|
|
13
|
+
const widgetCacheId = (0, _utils.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) ?? "");
|
|
14
|
+
const initialState = (0, _defaultClientDataStoreProvider.defaultClientDataStoreProvider)().getData(widgetCacheId, "localStorage");
|
|
15
|
+
if (!(0, _utils.isNullOrUndefined)(initialState)) {
|
|
16
|
+
return JSON.parse(initialState);
|
|
17
|
+
}
|
|
15
18
|
const LiveChatWidgetContextInitialState = {
|
|
16
19
|
domainStates: {
|
|
17
20
|
liveChatConfig: props.chatConfig,
|
|
@@ -23,14 +26,16 @@ const getLiveChatWidgetContextInitialState = props => {
|
|
|
23
26
|
postChatContext: undefined,
|
|
24
27
|
telemetryInternalData: {},
|
|
25
28
|
globalDir: "ltr",
|
|
26
|
-
liveChatContext: undefined
|
|
29
|
+
liveChatContext: undefined,
|
|
30
|
+
customContext: undefined,
|
|
31
|
+
widgetSize: undefined,
|
|
32
|
+
widgetInstanceId: ""
|
|
27
33
|
},
|
|
28
34
|
appStates: {
|
|
29
35
|
conversationState: _ConversationState.ConversationState.Closed,
|
|
30
36
|
isMinimized: false,
|
|
31
|
-
|
|
37
|
+
previousElementIdOnFocusBeforeModalOpen: null,
|
|
32
38
|
outsideOperatingHours: false,
|
|
33
|
-
shouldShowPostChat: false,
|
|
34
39
|
preChatResponseEmail: "",
|
|
35
40
|
isAudioMuted: null,
|
|
36
41
|
newMessage: false,
|
|
@@ -56,7 +61,6 @@ const getLiveChatWidgetContextInitialState = props => {
|
|
|
56
61
|
focusChatButton: false
|
|
57
62
|
}
|
|
58
63
|
};
|
|
59
|
-
return
|
|
64
|
+
return LiveChatWidgetContextInitialState;
|
|
60
65
|
};
|
|
61
|
-
|
|
62
66
|
exports.getLiveChatWidgetContextInitialState = getLiveChatWidgetContextInitialState;
|
|
@@ -4,245 +4,288 @@ 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
|
-
var _TelemetryManager = require("../common/telemetry/TelemetryManager");
|
|
11
|
-
|
|
12
8
|
/* eslint-disable indent */
|
|
9
|
+
|
|
13
10
|
const createReducer = () => {
|
|
14
11
|
const reducer = (state, action) => {
|
|
15
12
|
var _action$payload, _action$payload2, _action$payload3;
|
|
16
|
-
|
|
17
13
|
switch (action.type) {
|
|
18
14
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_WIDGET_ELEMENT_ID:
|
|
19
|
-
return {
|
|
20
|
-
|
|
15
|
+
return {
|
|
16
|
+
...state,
|
|
17
|
+
domainStates: {
|
|
18
|
+
...state.domainStates,
|
|
21
19
|
widgetElementId: action.payload
|
|
22
20
|
}
|
|
23
21
|
};
|
|
24
|
-
|
|
25
22
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_RENDERING_MIDDLEWARE_PROPS:
|
|
26
|
-
return {
|
|
27
|
-
|
|
23
|
+
return {
|
|
24
|
+
...state,
|
|
25
|
+
domainStates: {
|
|
26
|
+
...state.domainStates,
|
|
28
27
|
renderingMiddlewareProps: action.payload
|
|
29
28
|
}
|
|
30
29
|
};
|
|
31
|
-
|
|
32
30
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MIDDLEWARE_LOCALIZED_TEXTS:
|
|
33
|
-
return {
|
|
34
|
-
|
|
31
|
+
return {
|
|
32
|
+
...state,
|
|
33
|
+
domainStates: {
|
|
34
|
+
...state.domainStates,
|
|
35
35
|
middlewareLocalizedTexts: action.payload
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
|
|
39
38
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_GLOBAL_DIR:
|
|
40
|
-
return {
|
|
41
|
-
|
|
39
|
+
return {
|
|
40
|
+
...state,
|
|
41
|
+
domainStates: {
|
|
42
|
+
...state.domainStates,
|
|
42
43
|
globalDir: action.payload === "ltr" || action.payload === "rtl" ? action.payload : "ltr"
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
|
-
|
|
46
46
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MINIMIZED:
|
|
47
|
-
return {
|
|
48
|
-
|
|
47
|
+
return {
|
|
48
|
+
...state,
|
|
49
|
+
appStates: {
|
|
50
|
+
...state.appStates,
|
|
49
51
|
isMinimized: action.payload
|
|
50
52
|
}
|
|
51
53
|
};
|
|
52
|
-
|
|
53
54
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE:
|
|
54
|
-
return {
|
|
55
|
-
|
|
55
|
+
return {
|
|
56
|
+
...state,
|
|
57
|
+
appStates: {
|
|
58
|
+
...state.appStates,
|
|
56
59
|
conversationState: action.payload
|
|
57
60
|
}
|
|
58
61
|
};
|
|
59
|
-
|
|
60
62
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_OUTSIDE_OPERATING_HOURS:
|
|
61
|
-
return {
|
|
62
|
-
|
|
63
|
+
return {
|
|
64
|
+
...state,
|
|
65
|
+
appStates: {
|
|
66
|
+
...state.appStates,
|
|
63
67
|
outsideOperatingHours: action.payload
|
|
64
68
|
}
|
|
65
69
|
};
|
|
66
|
-
|
|
67
70
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_PRE_CHAT_SURVEY_RESPONSE:
|
|
68
|
-
return {
|
|
69
|
-
|
|
71
|
+
return {
|
|
72
|
+
...state,
|
|
73
|
+
domainStates: {
|
|
74
|
+
...state.domainStates,
|
|
70
75
|
preChatSurveyResponse: action.payload
|
|
71
76
|
}
|
|
72
77
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CUSTOM_CONTEXT:
|
|
79
|
+
return {
|
|
80
|
+
...state,
|
|
81
|
+
domainStates: {
|
|
82
|
+
...state.domainStates,
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
84
|
+
customContext: action.payload
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_PREVIOUS_FOCUSED_ELEMENT_ID:
|
|
88
|
+
return {
|
|
89
|
+
...state,
|
|
90
|
+
appStates: {
|
|
91
|
+
...state.appStates,
|
|
92
|
+
previousElementIdOnFocusBeforeModalOpen: action.payload
|
|
78
93
|
}
|
|
79
94
|
};
|
|
80
|
-
|
|
81
95
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SHOW_CONFIRMATION:
|
|
82
|
-
return {
|
|
83
|
-
|
|
96
|
+
return {
|
|
97
|
+
...state,
|
|
98
|
+
uiStates: {
|
|
99
|
+
...state.uiStates,
|
|
84
100
|
showConfirmationPane: action.payload
|
|
85
101
|
}
|
|
86
102
|
};
|
|
87
|
-
|
|
88
103
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_POST_CHAT_CONTEXT:
|
|
89
|
-
return {
|
|
90
|
-
|
|
104
|
+
return {
|
|
105
|
+
...state,
|
|
106
|
+
domainStates: {
|
|
107
|
+
...state.domainStates,
|
|
91
108
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
109
|
postChatContext: action.payload
|
|
93
110
|
}
|
|
94
111
|
};
|
|
95
|
-
|
|
96
|
-
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SHOULD_SHOW_POST_CHAT:
|
|
97
|
-
return { ...state,
|
|
98
|
-
appStates: { ...state.appStates,
|
|
99
|
-
shouldShowPostChat: action.payload
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
|
|
103
112
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SHOW_CALLING_CONTAINER:
|
|
104
|
-
return {
|
|
105
|
-
|
|
113
|
+
return {
|
|
114
|
+
...state,
|
|
115
|
+
uiStates: {
|
|
116
|
+
...state.uiStates,
|
|
106
117
|
showCallingPopup: action.payload
|
|
107
118
|
}
|
|
108
119
|
};
|
|
109
|
-
|
|
110
120
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_INCOMING_CALL:
|
|
111
|
-
return {
|
|
112
|
-
|
|
121
|
+
return {
|
|
122
|
+
...state,
|
|
123
|
+
uiStates: {
|
|
124
|
+
...state.uiStates,
|
|
113
125
|
isIncomingCall: action.payload
|
|
114
126
|
}
|
|
115
127
|
};
|
|
116
|
-
|
|
117
128
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_FOCUS_CHAT_BUTTON:
|
|
118
|
-
return {
|
|
119
|
-
|
|
129
|
+
return {
|
|
130
|
+
...state,
|
|
131
|
+
uiStates: {
|
|
132
|
+
...state.uiStates,
|
|
120
133
|
focusChatButton: action.payload
|
|
121
134
|
}
|
|
122
135
|
};
|
|
123
|
-
|
|
124
136
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.DISABLE_VIDEO_CALL:
|
|
125
|
-
return {
|
|
126
|
-
|
|
137
|
+
return {
|
|
138
|
+
...state,
|
|
139
|
+
uiStates: {
|
|
140
|
+
...state.uiStates,
|
|
127
141
|
disableVideoCall: action.payload
|
|
128
142
|
}
|
|
129
143
|
};
|
|
130
|
-
|
|
131
144
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.DISABLE_LOCAL_VIDEO:
|
|
132
|
-
return {
|
|
133
|
-
|
|
145
|
+
return {
|
|
146
|
+
...state,
|
|
147
|
+
uiStates: {
|
|
148
|
+
...state.uiStates,
|
|
134
149
|
disableSelfVideo: action.payload
|
|
135
150
|
}
|
|
136
151
|
};
|
|
137
|
-
|
|
138
152
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.DISABLE_REMOTE_VIDEO:
|
|
139
|
-
return {
|
|
140
|
-
|
|
153
|
+
return {
|
|
154
|
+
...state,
|
|
155
|
+
uiStates: {
|
|
156
|
+
...state.uiStates,
|
|
141
157
|
disableRemoteVideo: action.payload
|
|
142
158
|
}
|
|
143
159
|
};
|
|
144
|
-
|
|
145
160
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CHAT_TOKEN:
|
|
146
|
-
return {
|
|
147
|
-
|
|
161
|
+
return {
|
|
162
|
+
...state,
|
|
163
|
+
domainStates: {
|
|
164
|
+
...state.domainStates,
|
|
148
165
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
149
166
|
chatToken: action.payload
|
|
150
167
|
}
|
|
151
168
|
};
|
|
152
|
-
|
|
153
169
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SHOW_EMAIL_TRANSCRIPT_PANE:
|
|
154
|
-
return {
|
|
155
|
-
|
|
170
|
+
return {
|
|
171
|
+
...state,
|
|
172
|
+
uiStates: {
|
|
173
|
+
...state.uiStates,
|
|
156
174
|
showEmailTranscriptPane: action.payload
|
|
157
175
|
}
|
|
158
176
|
};
|
|
159
|
-
|
|
160
177
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_PRECHAT_RESPONSE_EMAIL:
|
|
161
|
-
return {
|
|
162
|
-
|
|
178
|
+
return {
|
|
179
|
+
...state,
|
|
180
|
+
appStates: {
|
|
181
|
+
...state.appStates,
|
|
163
182
|
preChatResponseEmail: action.payload
|
|
164
183
|
}
|
|
165
184
|
};
|
|
166
|
-
|
|
167
185
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_AUDIO_NOTIFICATION:
|
|
168
|
-
return {
|
|
169
|
-
|
|
186
|
+
return {
|
|
187
|
+
...state,
|
|
188
|
+
appStates: {
|
|
189
|
+
...state.appStates,
|
|
170
190
|
isAudioMuted: action.payload
|
|
171
191
|
}
|
|
172
192
|
};
|
|
173
|
-
|
|
174
193
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_E2VV_ENABLED:
|
|
175
|
-
return {
|
|
176
|
-
|
|
194
|
+
return {
|
|
195
|
+
...state,
|
|
196
|
+
appStates: {
|
|
197
|
+
...state.appStates,
|
|
177
198
|
e2vvEnabled: action.payload
|
|
178
199
|
}
|
|
179
200
|
};
|
|
180
|
-
|
|
181
201
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_SKIP_CHAT_BUTTON_RENDERING:
|
|
182
|
-
return {
|
|
183
|
-
|
|
202
|
+
return {
|
|
203
|
+
...state,
|
|
204
|
+
appStates: {
|
|
205
|
+
...state.appStates,
|
|
184
206
|
skipChatButtonRendering: action.payload
|
|
185
207
|
}
|
|
186
208
|
};
|
|
187
|
-
|
|
188
209
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_PROACTIVE_CHAT_PARAMS:
|
|
189
|
-
return {
|
|
190
|
-
|
|
191
|
-
|
|
210
|
+
return {
|
|
211
|
+
...state,
|
|
212
|
+
appStates: {
|
|
213
|
+
...state.appStates,
|
|
214
|
+
proactiveChatStates: {
|
|
215
|
+
...state.appStates.proactiveChatStates,
|
|
192
216
|
proactiveChatBodyTitle: (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : _action$payload.proactiveChatBodyTitle,
|
|
193
217
|
proactiveChatEnablePrechat: (_action$payload2 = action.payload) === null || _action$payload2 === void 0 ? void 0 : _action$payload2.proactiveChatEnablePrechat,
|
|
194
218
|
proactiveChatInNewWindow: (_action$payload3 = action.payload) === null || _action$payload3 === void 0 ? void 0 : _action$payload3.proactiveChatInNewWindow
|
|
195
219
|
}
|
|
196
220
|
}
|
|
197
221
|
};
|
|
198
|
-
|
|
199
222
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_TELEMETRY_DATA:
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
domainStates: {
|
|
223
|
+
return {
|
|
224
|
+
...state,
|
|
225
|
+
domainStates: {
|
|
226
|
+
...state.domainStates,
|
|
203
227
|
telemetryInternalData: action.payload
|
|
204
228
|
}
|
|
205
229
|
};
|
|
206
|
-
|
|
207
230
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_RECONNECT_ID:
|
|
208
|
-
return {
|
|
209
|
-
|
|
231
|
+
return {
|
|
232
|
+
...state,
|
|
233
|
+
appStates: {
|
|
234
|
+
...state.appStates,
|
|
210
235
|
reconnectId: action.payload
|
|
211
236
|
}
|
|
212
237
|
};
|
|
213
|
-
|
|
214
238
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_UNREAD_MESSAGE_COUNT:
|
|
215
|
-
return {
|
|
216
|
-
|
|
239
|
+
return {
|
|
240
|
+
...state,
|
|
241
|
+
appStates: {
|
|
242
|
+
...state.appStates,
|
|
217
243
|
unreadMessageCount: action.payload
|
|
218
244
|
}
|
|
219
245
|
};
|
|
220
|
-
|
|
221
246
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT:
|
|
222
|
-
return {
|
|
223
|
-
|
|
247
|
+
return {
|
|
248
|
+
...state,
|
|
249
|
+
domainStates: {
|
|
250
|
+
...state.domainStates,
|
|
224
251
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
225
252
|
liveChatContext: action.payload
|
|
226
253
|
}
|
|
227
254
|
};
|
|
228
|
-
|
|
229
255
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_WIDGET_STATE:
|
|
230
|
-
return {
|
|
256
|
+
return {
|
|
257
|
+
...action.payload
|
|
231
258
|
};
|
|
232
|
-
|
|
233
259
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY_AGENT:
|
|
234
|
-
return {
|
|
235
|
-
|
|
260
|
+
return {
|
|
261
|
+
...state,
|
|
262
|
+
appStates: {
|
|
263
|
+
...state.appStates,
|
|
236
264
|
conversationEndedByAgent: action.payload
|
|
237
265
|
}
|
|
238
266
|
};
|
|
239
|
-
|
|
267
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_WIDGET_SIZE:
|
|
268
|
+
return {
|
|
269
|
+
...state,
|
|
270
|
+
domainStates: {
|
|
271
|
+
...state.domainStates,
|
|
272
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
273
|
+
widgetSize: action.payload
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_WIDGET_INSTANCE_ID:
|
|
277
|
+
return {
|
|
278
|
+
...state,
|
|
279
|
+
domainStates: {
|
|
280
|
+
...state.domainStates,
|
|
281
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
282
|
+
widgetInstanceId: action.payload
|
|
283
|
+
}
|
|
284
|
+
};
|
|
240
285
|
default:
|
|
241
286
|
return state;
|
|
242
287
|
}
|
|
243
288
|
};
|
|
244
|
-
|
|
245
289
|
return reducer;
|
|
246
290
|
};
|
|
247
|
-
|
|
248
291
|
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.skipChatButtonRendering == 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;
|
|
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
|
-
return state.appStates.conversationState === _ConversationState.ConversationState.Active;
|
|
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;
|