@microsoft/omnichannel-chat-widget 1.7.8-main.ab4d3b4 → 1.7.8-main.cf04c1c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/common/Constants.js +67 -20
- package/lib/cjs/common/KeyCodes.js +6 -1
- package/lib/cjs/common/contextDataStore/DataStoreManager.js +6 -1
- package/lib/cjs/common/facades/FacadeChatSDK.js +392 -295
- package/lib/cjs/common/storage/default/defaultCacheManager.js +6 -3
- package/lib/cjs/common/telemetry/AppInsightsEvents.js +31 -0
- package/lib/cjs/common/telemetry/ScenarioMarker.js +66 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +153 -131
- package/lib/cjs/common/telemetry/TelemetryHelper.js +281 -250
- package/lib/cjs/common/telemetry/TelemetryManager.js +32 -12
- package/lib/cjs/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +11 -0
- package/lib/cjs/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
- package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +149 -0
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +13 -9
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +3 -2
- package/lib/cjs/components/footerstateful/FooterStateful.js +11 -6
- package/lib/cjs/components/headerstateful/HeaderStateful.js +18 -6
- package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +70 -58
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +17 -8
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +65 -52
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +31 -18
- package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +14 -6
- package/lib/cjs/components/livechatwidget/common/Deferred.js +14 -6
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +0 -5
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
- package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +6 -3
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -2
- package/lib/cjs/components/livechatwidget/common/startChat.js +43 -40
- package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +5 -4
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +25 -20
- package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +6 -4
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +9 -4
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +8 -6
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +7 -1
- package/lib/cjs/components/webchatcontainerstateful/common/DemoChatAdapter.js +88 -65
- package/lib/cjs/components/webchatcontainerstateful/common/DemoChatSDK.js +26 -7
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +49 -26
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +57 -35
- package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +62 -52
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +95 -61
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +53 -39
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +5 -6
- package/lib/cjs/controller/componentController.js +3 -2
- package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +138 -116
- package/lib/cjs/plugins/createChatTranscript.js +88 -58
- package/lib/cjs/plugins/newMessageEventHandler.js +4 -4
- package/lib/esm/common/Constants.js +65 -19
- package/lib/esm/common/KeyCodes.js +6 -1
- package/lib/esm/common/contextDataStore/DataStoreManager.js +6 -1
- package/lib/esm/common/facades/FacadeChatSDK.js +392 -295
- package/lib/esm/common/storage/default/defaultCacheManager.js +6 -1
- package/lib/esm/common/telemetry/AppInsightsEvents.js +24 -0
- package/lib/esm/common/telemetry/ScenarioMarker.js +59 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +153 -131
- package/lib/esm/common/telemetry/TelemetryHelper.js +281 -250
- package/lib/esm/common/telemetry/TelemetryManager.js +32 -12
- package/lib/esm/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +4 -0
- package/lib/esm/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
- package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +139 -0
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +13 -9
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +3 -2
- package/lib/esm/components/footerstateful/FooterStateful.js +11 -6
- package/lib/esm/components/headerstateful/HeaderStateful.js +18 -6
- package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +70 -58
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +17 -8
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +65 -52
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +31 -18
- package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +14 -6
- package/lib/esm/components/livechatwidget/common/Deferred.js +14 -6
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +1 -6
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
- package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +6 -3
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -2
- package/lib/esm/components/livechatwidget/common/startChat.js +44 -41
- package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +5 -4
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +25 -20
- package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +6 -4
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +9 -4
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +8 -6
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +7 -1
- package/lib/esm/components/webchatcontainerstateful/common/DemoChatAdapter.js +88 -65
- package/lib/esm/components/webchatcontainerstateful/common/DemoChatSDK.js +26 -7
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +49 -26
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +57 -35
- package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +63 -52
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +95 -61
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +53 -39
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +5 -6
- package/lib/esm/controller/componentController.js +3 -2
- package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +138 -116
- package/lib/esm/plugins/createChatTranscript.js +88 -58
- package/lib/esm/plugins/newMessageEventHandler.js +4 -4
- package/lib/types/assets/Audios.d.ts +1 -1
- package/lib/types/assets/Icons.d.ts +16 -16
- package/lib/types/common/Constants.d.ts +283 -277
- package/lib/types/common/KeyCodes.d.ts +5 -5
- package/lib/types/common/contextDataStore/DataStoreManager.d.ts +4 -4
- package/lib/types/common/facades/FacadeChatSDK.d.ts +75 -74
- package/lib/types/common/facades/types/IFacadeChatSDKInput.d.ts +13 -13
- package/lib/types/common/interfaces/IContextDataStore.d.ts +14 -14
- package/lib/types/common/interfaces/ITimer.d.ts +3 -3
- package/lib/types/common/storage/default/defaultCacheManager.d.ts +5 -5
- package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +4 -4
- package/lib/types/common/storage/default/defaultInMemoryDataStore.d.ts +6 -6
- package/lib/types/common/telemetry/AppInsightsEvents.d.ts +1 -0
- package/lib/types/common/telemetry/ScenarioMarker.d.ts +19 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +272 -264
- package/lib/types/common/telemetry/TelemetryHelper.d.ts +48 -43
- package/lib/types/common/telemetry/TelemetryManager.d.ts +12 -12
- package/lib/types/common/telemetry/defaultConfigs/defaultAppInsightsConfig.d.ts +2 -0
- package/lib/types/common/telemetry/defaultConfigs/defaultAriaConfig.d.ts +2 -2
- package/lib/types/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.d.ts +2 -2
- package/lib/types/common/telemetry/defaultConfigs/defaultTelemetryInternalData.d.ts +2 -2
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +77 -77
- package/lib/types/common/telemetry/definitions/Payload.d.ts +105 -105
- package/lib/types/common/telemetry/interfaces/IAppInsightsConfig.d.ts +4 -0
- package/lib/types/common/telemetry/interfaces/IAriaConfigurations.d.ts +18 -18
- package/lib/types/common/telemetry/interfaces/IChatSDKLogger.d.ts +6 -5
- package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +23 -21
- package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +48 -48
- package/lib/types/common/telemetry/interfaces/ITelemetryEvents.d.ts +7 -7
- package/lib/types/common/telemetry/loggers/appInsightsLogger.d.ts +10 -0
- package/lib/types/common/telemetry/loggers/ariaTelemetryLogger.d.ts +2 -2
- package/lib/types/common/telemetry/loggers/consoleLogger.d.ts +2 -2
- package/lib/types/common/utils.d.ts +49 -49
- package/lib/types/components/callingcontainerstateful/CallingContainerStateful.d.ts +4 -3
- package/lib/types/components/callingcontainerstateful/ICallingContainerStatefulProps.d.ts +4 -4
- package/lib/types/components/chatbuttonstateful/ChatButtonStateful.d.ts +4 -3
- package/lib/types/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.d.ts +2 -2
- package/lib/types/components/chatbuttonstateful/interfaces/IChatButtonStatefulParams.d.ts +17 -17
- package/lib/types/components/confirmationpanestateful/ConfirmationPaneStateful.d.ts +4 -3
- package/lib/types/components/confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts.d.ts +2 -2
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneInputs.d.ts +4 -4
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.d.ts +10 -10
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +13 -13
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps.d.ts +8 -8
- package/lib/types/components/dimlayer/DimLayer.d.ts +6 -5
- package/lib/types/components/draggable/DraggableChatWidget.d.ts +9 -9
- package/lib/types/components/draggable/DraggableEventEmitter.d.ts +27 -27
- package/lib/types/components/draggable/DraggableEventNames.d.ts +6 -6
- package/lib/types/components/draggable/DraggableEventReceiver.d.ts +27 -27
- package/lib/types/components/draggable/IDraggableElementPosition.d.ts +5 -5
- package/lib/types/components/draggable/IDraggableElementPositionDelta.d.ts +5 -5
- package/lib/types/components/draggable/IDraggableEvent.d.ts +12 -12
- package/lib/types/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.d.ts +4 -3
- package/lib/types/components/emailtranscriptpanestateful/interfaces/IChatTranscriptBody.d.ts +5 -5
- package/lib/types/components/emailtranscriptpanestateful/interfaces/IEmailTranscriptPaneProps.d.ts +11 -11
- package/lib/types/components/footerstateful/FooterStateful.d.ts +3 -2
- package/lib/types/components/footerstateful/audionotificationstateful/AudioNotificationStateful.d.ts +4 -3
- package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationProps.d.ts +3 -3
- package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationStatefulParams.d.ts +4 -4
- package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +4 -4
- package/lib/types/components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts.d.ts +23 -23
- package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/IDownloadTranscriptProps.d.ts +19 -19
- package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/IWebChatTranscriptConfig.d.ts +14 -14
- package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/TranscriptHtmlScripts.d.ts +33 -33
- package/lib/types/components/headerstateful/HeaderStateful.d.ts +4 -3
- package/lib/types/components/headerstateful/common/styleProps/defaultOutOfOfficeHeaderStyleProps.d.ts +2 -2
- package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +33 -33
- package/lib/types/components/livechatwidget/LiveChatWidget.d.ts +4 -3
- package/lib/types/components/livechatwidget/common/ActivityStreamHandler.d.ts +14 -14
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.d.ts +12 -12
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.d.ts +5 -5
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.d.ts +7 -7
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.d.ts +6 -6
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.d.ts +7 -7
- package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -7
- package/lib/types/components/livechatwidget/common/Deferred.d.ts +9 -9
- package/lib/types/components/livechatwidget/common/authHelper.d.ts +18 -18
- package/lib/types/components/livechatwidget/common/chatDisconnectHelper.d.ts +4 -4
- package/lib/types/components/livechatwidget/common/createAdapter.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/createDownloadTranscriptProps.d.ts +25 -25
- package/lib/types/components/livechatwidget/common/createFooter.d.ts +4 -3
- package/lib/types/components/livechatwidget/common/createInternetConnectionChangeHandler.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/createMarkdown.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/defaultProps/defaultScrollBarProps.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/defaultStyles/defaultLiveChatWidgetGeneralStyles.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/disposeTelemetryLoggers.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/endChat.d.ts +13 -13
- package/lib/types/components/livechatwidget/common/getGeneralStylesForButton.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/helpers/markdownHelper.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/initCallingSdk.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/initConfirmationPropsComposer.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +7 -7
- package/lib/types/components/livechatwidget/common/liveChatConfigUtils.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/overridePropsOnMockIfApplicable.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/persistentChatHelper.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +12 -12
- package/lib/types/components/livechatwidget/common/registerTelemetryLoggers.d.ts +4 -4
- package/lib/types/components/livechatwidget/common/renderSurveyHelpers.d.ts +10 -10
- package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +4 -4
- package/lib/types/components/livechatwidget/common/shareObservable.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/startChat.d.ts +11 -11
- package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +6 -6
- package/lib/types/components/livechatwidget/common/startProactiveChat.d.ts +4 -4
- package/lib/types/components/livechatwidget/common/updateSessionDataForTelemetry.d.ts +4 -4
- package/lib/types/components/livechatwidget/interfaces/IBotAuthActivitySubscriberOptionalParams.d.ts +4 -4
- package/lib/types/components/livechatwidget/interfaces/IDraggableChatWidgetProps.d.ts +10 -10
- package/lib/types/components/livechatwidget/interfaces/IFeatureConfigProps.d.ts +3 -3
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts +17 -17
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +21 -21
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +70 -68
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetStyleProps.d.ts +5 -5
- package/lib/types/components/livechatwidget/interfaces/IMockProps.d.ts +8 -8
- package/lib/types/components/livechatwidget/interfaces/IScrollBarProps.d.ts +22 -22
- package/lib/types/components/livechatwidget/interfaces/ISendBox.d.ts +12 -12
- package/lib/types/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.d.ts +3 -3
- package/lib/types/components/loadingpanestateful/LoadingPaneStateful.d.ts +3 -2
- package/lib/types/components/loadingpanestateful/common/defaultStyleProps/defaultgeneralLoadingPaneStyleProps.d.ts +2 -2
- package/lib/types/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.d.ts +2 -2
- package/lib/types/components/notificationpanestateful/NotificationPaneStateful.d.ts +4 -3
- package/lib/types/components/notificationpanestateful/defaultProps/defaultChatDisconnectControlProps.d.ts +2 -2
- package/lib/types/components/notificationpanestateful/defaultProps/defaultChatDisconnectStyleProps.d.ts +2 -2
- package/lib/types/components/notificationpanestateful/interfaces/INotificationPaneStatefulProps.d.ts +13 -13
- package/lib/types/components/ooohpanestateful/OOOHPaneStateful.d.ts +4 -3
- package/lib/types/components/ooohpanestateful/common/defaultStyleProps/defaultgeneralOOOHPaneStyleProps.d.ts +2 -2
- package/lib/types/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.d.ts +4 -3
- package/lib/types/components/postchatloadingpanestateful/common/defaultgeneralPostChatLoadingPaneStyleProps.d.ts +2 -2
- package/lib/types/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.d.ts +4 -3
- package/lib/types/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.d.ts +2 -2
- package/lib/types/components/postchatsurveypanestateful/common/isValidSurveyUrl.d.ts +2 -2
- package/lib/types/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.d.ts +5 -5
- package/lib/types/components/postchatsurveypanestateful/enums/PostChatSurveyMode.d.ts +4 -4
- package/lib/types/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.d.ts +5 -5
- package/lib/types/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.d.ts +4 -3
- package/lib/types/components/prechatsurveypanestateful/common/defaultProps/defaultPreChatSurveyLocalizedTexts.d.ts +2 -2
- package/lib/types/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.d.ts +2 -2
- package/lib/types/components/prechatsurveypanestateful/interfaces/IPreChatSurveyPaneStatefulParams.d.ts +5 -5
- package/lib/types/components/proactivechatpanestateful/ProactiveChatPaneStateful.d.ts +3 -2
- package/lib/types/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.d.ts +3 -3
- package/lib/types/components/proactivechatpanestateful/interfaces/IProactiveChatPaneStatefulProps.d.ts +4 -4
- package/lib/types/components/reconnectchatpanestateful/ReconnectChatPaneStateful.d.ts +4 -3
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatContext.d.ts +4 -4
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatOptionalParams.d.ts +3 -3
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulParams.d.ts +5 -5
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +5 -5
- package/lib/types/components/startchaterrorpanestateful/StartChatErrorPaneStateful.d.ts +4 -3
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneGeneralStyleProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconImageProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconStyleProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneSubtitleStyleProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneTitleStyleProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneClassNames.d.ts +5 -5
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneComponentOverrides.d.ts +6 -6
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneControlProps.d.ts +14 -14
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneProps.d.ts +8 -8
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneStyleProps.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/WebChatContainerStateful.d.ts +4 -3
- package/lib/types/components/webchatcontainerstateful/common/DemoChatAdapter.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/common/DemoChatSDK.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatAdapter.d.ts +8 -8
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +31 -31
- package/lib/types/components/webchatcontainerstateful/common/MockBotCardCommandType.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/common/MockBotCommand.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultAttachmentProps.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStatefulContainerStyles.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/mockadapter.d.ts +14 -14
- package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +45 -45
- package/lib/types/components/webchatcontainerstateful/common/utils/BrowserInfo.d.ts +5 -5
- package/lib/types/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.d.ts +7 -7
- package/lib/types/components/webchatcontainerstateful/common/utils/attachmentActivityUtils.d.ts +9 -9
- package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +9 -9
- package/lib/types/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +8 -8
- package/lib/types/components/webchatcontainerstateful/interfaces/IAttachmentProps.d.ts +5 -5
- package/lib/types/components/webchatcontainerstateful/interfaces/IBotAuthConfig.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/interfaces/IDataMaskingInfo.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/interfaces/IDataMaskingRule.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/interfaces/IDataMaskingSetting.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +37 -37
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatAction.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +28 -28
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatProps.d.ts +39 -39
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.d.ts +9 -9
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.d.ts +5 -5
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.d.ts +5 -5
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.d.ts +24 -24
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.d.ts +9 -9
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentContent.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentIcon.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/FileScanStatus.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Spinner.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.d.ts +8 -8
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentContentStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDividerStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDownloadIconStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentFileNameStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentSizeStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentAdaptiveCardStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentIconStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampContentStyles.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorBubbleStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorContainerStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorMessageStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageStyles.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/index.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.d.ts +7 -6
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.d.ts +12 -12
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.d.ts +1 -1
- package/lib/types/contexts/ChatAdapterStore.d.ts +1 -2
- package/lib/types/contexts/ChatContextStore.d.ts +1 -1
- package/lib/types/contexts/ChatSDKStore.d.ts +1 -1
- package/lib/types/contexts/FacadeChatSDKStore.d.ts +1 -1
- package/lib/types/contexts/common/ConversationState.d.ts +13 -13
- package/lib/types/contexts/common/ILiveChatWidgetAction.d.ts +5 -5
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +63 -63
- package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +40 -40
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +48 -48
- package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +3 -3
- package/lib/types/contexts/common/StartChatFailureType.d.ts +5 -5
- package/lib/types/contexts/createReducer.d.ts +4 -4
- package/lib/types/controller/componentController.d.ts +16 -16
- package/lib/types/firstresponselatency/Constants.d.ts +30 -30
- package/lib/types/firstresponselatency/FirstMessageTrackerFromBot.d.ts +1 -1
- package/lib/types/firstresponselatency/FirstResponseLatencyTracker.d.ts +22 -22
- package/lib/types/firstresponselatency/util.d.ts +7 -7
- package/lib/types/hooks/useChatAdapterStore.d.ts +2 -2
- package/lib/types/hooks/useChatContextStore.d.ts +5 -5
- package/lib/types/hooks/useChatSDKStore.d.ts +2 -2
- package/lib/types/hooks/useDebounce.d.ts +3 -3
- package/lib/types/hooks/useFacadeChatSDKStore.d.ts +3 -3
- package/lib/types/hooks/useWindowDimensions.d.ts +4 -4
- package/lib/types/index.d.ts +11 -11
- package/lib/types/plugins/createChatTranscript.d.ts +3 -3
- package/lib/types/plugins/newMessageEventHandler.d.ts +2 -2
- package/package.json +31 -16
|
@@ -59,8 +59,9 @@ export const LiveChatWidgetStateful = props => {
|
|
|
59
59
|
var _props$webChatContain, _props$styleProps, _props$webChatContain2, _props$webChatContain3, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain7, _state$appStates14, _props$webChatContain9, _props$webChatContain10, _props$controlProps12, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _livechatProps$webCha, _props$webChatContain11, _props$webChatContain12, _props$webChatContain13, _props$webChatContain14, _props$webChatContain15, _props$webChatContain16, _props$webChatContain17, _props$webChatContain18, _livechatProps$styleP, _livechatProps$contro, _livechatProps$contro2, _livechatProps$compon, _livechatProps$contro3, _livechatProps$compon2, _livechatProps$contro4, _livechatProps$compon3, _livechatProps$contro5, _livechatProps$compon4, _livechatProps$contro6, _livechatProps$compon5, _livechatProps$contro7, _livechatProps$compon6, _livechatProps$contro8, _livechatProps$compon7, _livechatProps$contro9, _livechatProps$compon8, _livechatProps$contro10, _livechatProps$contro11, _livechatProps$compon9, _livechatProps$contro12, _livechatProps$compon10, _livechatProps$contro13, _livechatProps$compon11, _livechatProps$compon12, _livechatProps$compon13;
|
|
60
60
|
useEffect(() => {
|
|
61
61
|
uiTimer = createTimer();
|
|
62
|
-
TelemetryHelper.
|
|
63
|
-
Event: TelemetryEvent.
|
|
62
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
63
|
+
Event: TelemetryEvent.UXLiveChatWidgetStart,
|
|
64
|
+
Description: "Live chat widget loading started."
|
|
64
65
|
});
|
|
65
66
|
}, []);
|
|
66
67
|
const [state, dispatch] = useChatContextStore();
|
|
@@ -273,9 +274,8 @@ export const LiveChatWidgetStateful = props => {
|
|
|
273
274
|
useEffect(() => {
|
|
274
275
|
var _state$appStates6;
|
|
275
276
|
if ((state === null || state === void 0 ? void 0 : (_state$appStates6 = state.appStates) === null || _state$appStates6 === void 0 ? void 0 : _state$appStates6.hideStartChatButton) === true) {
|
|
276
|
-
var _props$chatConfig3, _props$chatConfig3$Li, _props$chatConfig4, _props$chatConfig4$Li;
|
|
277
277
|
//handle OOH pane
|
|
278
|
-
if (
|
|
278
|
+
if (state.appStates.outsideOperatingHours === true) {
|
|
279
279
|
dispatch({
|
|
280
280
|
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
281
281
|
payload: ConversationState.OutOfOffice
|
|
@@ -311,7 +311,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
311
311
|
});
|
|
312
312
|
});
|
|
313
313
|
BroadcastService.getMessageByEventName(BroadcastEvent.StartProactiveChat).subscribe(msg => {
|
|
314
|
-
TelemetryHelper.
|
|
314
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
315
315
|
Event: TelemetryEvent.StartProactiveChatEventReceived,
|
|
316
316
|
Description: "Start proactive chat event received."
|
|
317
317
|
});
|
|
@@ -409,10 +409,10 @@ export const LiveChatWidgetStateful = props => {
|
|
|
409
409
|
|
|
410
410
|
// Start chat from SDK Event
|
|
411
411
|
BroadcastService.getMessageByEventName(BroadcastEvent.StartChat).subscribe(msg => {
|
|
412
|
-
var
|
|
412
|
+
var _msg$payload5, _msg$payload6, _msg$payload7, _msg$payload9, _inMemoryState$appSta2, _inMemoryState$appSta3, _inMemoryState$appSta4;
|
|
413
413
|
// If chat is out of operating hours chat widget sets the conversation state to OutOfOffice.
|
|
414
|
-
if (
|
|
415
|
-
|
|
414
|
+
if (state.appStates.outsideOperatingHours === true) {
|
|
415
|
+
dispatch({
|
|
416
416
|
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
417
417
|
payload: false
|
|
418
418
|
});
|
|
@@ -428,7 +428,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
428
428
|
}
|
|
429
429
|
if (msg !== null && msg !== void 0 && (_msg$payload7 = msg.payload) !== null && _msg$payload7 !== void 0 && _msg$payload7.customContext) {
|
|
430
430
|
var _msg$payload8;
|
|
431
|
-
TelemetryHelper.
|
|
431
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
432
432
|
Event: TelemetryEvent.CustomContextReceived,
|
|
433
433
|
Description: "CustomContext received through startChat event."
|
|
434
434
|
});
|
|
@@ -437,8 +437,8 @@ export const LiveChatWidgetStateful = props => {
|
|
|
437
437
|
payload: msg === null || msg === void 0 ? void 0 : (_msg$payload8 = msg.payload) === null || _msg$payload8 === void 0 ? void 0 : _msg$payload8.customContext
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
|
-
TelemetryHelper.
|
|
441
|
-
Event: TelemetryEvent.
|
|
440
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
441
|
+
Event: TelemetryEvent.StartChatEventReceived,
|
|
442
442
|
Description: "Start chat event received."
|
|
443
443
|
});
|
|
444
444
|
const inMemoryState = executeReducer(state, {
|
|
@@ -446,13 +446,17 @@ export const LiveChatWidgetStateful = props => {
|
|
|
446
446
|
payload: null
|
|
447
447
|
});
|
|
448
448
|
inMemoryState.domainStates.customContext = msg === null || msg === void 0 ? void 0 : (_msg$payload9 = msg.payload) === null || _msg$payload9 === void 0 ? void 0 : _msg$payload9.customContext;
|
|
449
|
-
|
|
450
449
|
/*
|
|
451
450
|
* If the conversation is in closed state then we start a new chat,
|
|
452
451
|
* else if the conversation is in active state then we maximize the chat
|
|
453
452
|
* If the conversation is in inactive or postchat state then we maximize the chat.
|
|
454
453
|
*
|
|
455
454
|
* To start a new chat, it needs to be called via the close button or close chat via SDK.
|
|
455
|
+
*
|
|
456
|
+
* NOTE : Transition from OOH to business hours will follow this path, since during intialization conversation
|
|
457
|
+
* state is being set to closed.
|
|
458
|
+
*
|
|
459
|
+
* Maximization has been added as part of the initialization chat, since it wont go further than this block.
|
|
456
460
|
**/
|
|
457
461
|
if (((_inMemoryState$appSta2 = inMemoryState.appStates) === null || _inMemoryState$appSta2 === void 0 ? void 0 : _inMemoryState$appSta2.conversationState) === ConversationState.Closed) {
|
|
458
462
|
BroadcastService.postMessage({
|
|
@@ -463,7 +467,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
463
467
|
}
|
|
464
468
|
|
|
465
469
|
// If minimized, maximize the chat
|
|
466
|
-
if ((inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta3 = inMemoryState.appStates) === null || _inMemoryState$appSta3 === void 0 ? void 0 : _inMemoryState$appSta3.isMinimized) === true) {
|
|
470
|
+
if ((inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta3 = inMemoryState.appStates) === null || _inMemoryState$appSta3 === void 0 ? void 0 : _inMemoryState$appSta3.isMinimized) === true || (inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta4 = inMemoryState.appStates) === null || _inMemoryState$appSta4 === void 0 ? void 0 : _inMemoryState$appSta4.isMinimized) === undefined) {
|
|
467
471
|
var _inMemoryState$domain, _inMemoryState$domain2, _inMemoryState$domain3, _inMemoryState$domain4;
|
|
468
472
|
dispatch({
|
|
469
473
|
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
@@ -482,7 +486,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
482
486
|
|
|
483
487
|
// End chat
|
|
484
488
|
BroadcastService.getMessageByEventName(BroadcastEvent.InitiateEndChat).subscribe(async () => {
|
|
485
|
-
TelemetryHelper.
|
|
489
|
+
TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.INFO, {
|
|
486
490
|
Event: TelemetryEvent.EndChatEventReceived,
|
|
487
491
|
Description: "Received InitiateEndChat BroadcastEvent."
|
|
488
492
|
});
|
|
@@ -591,12 +595,12 @@ export const LiveChatWidgetStateful = props => {
|
|
|
591
595
|
disablePolling: true
|
|
592
596
|
});
|
|
593
597
|
facadeChatSDK === null || facadeChatSDK === void 0 ? void 0 : facadeChatSDK.onAgentEndSession(event => {
|
|
594
|
-
var _inMemoryState$
|
|
598
|
+
var _inMemoryState$appSta5;
|
|
595
599
|
const inMemoryState = executeReducer(state, {
|
|
596
600
|
type: LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
|
|
597
601
|
payload: null
|
|
598
602
|
});
|
|
599
|
-
if ("participantsRemoved" in event && (inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$
|
|
603
|
+
if ("participantsRemoved" in event && (inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta5 = inMemoryState.appStates) === null || _inMemoryState$appSta5 === void 0 ? void 0 : _inMemoryState$appSta5.conversationState) === ConversationState.Active) {
|
|
600
604
|
setWebChatStyles(styles => {
|
|
601
605
|
return {
|
|
602
606
|
...styles,
|
|
@@ -739,13 +743,13 @@ export const LiveChatWidgetStateful = props => {
|
|
|
739
743
|
|
|
740
744
|
// Handle Chat disconnect cases
|
|
741
745
|
useEffect(() => {
|
|
742
|
-
var _inMemoryState$
|
|
746
|
+
var _inMemoryState$appSta6;
|
|
743
747
|
const inMemoryState = executeReducer(state, {
|
|
744
748
|
type: LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
|
|
745
749
|
payload: null
|
|
746
750
|
});
|
|
747
751
|
handleChatDisconnect(props, inMemoryState, setWebChatStyles);
|
|
748
|
-
const chatDisconnectState = inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$
|
|
752
|
+
const chatDisconnectState = inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta6 = inMemoryState.appStates) === null || _inMemoryState$appSta6 === void 0 ? void 0 : _inMemoryState$appSta6.chatDisconnectEventReceived;
|
|
749
753
|
if (chatDisconnectState && adapter) {
|
|
750
754
|
try {
|
|
751
755
|
adapter.end();
|
|
@@ -768,8 +772,9 @@ export const LiveChatWidgetStateful = props => {
|
|
|
768
772
|
});
|
|
769
773
|
}, [(_props$webChatContain9 = props.webChatContainerProps) === null || _props$webChatContain9 === void 0 ? void 0 : _props$webChatContain9.renderingMiddlewareProps]);
|
|
770
774
|
useEffect(() => {
|
|
771
|
-
TelemetryHelper.
|
|
772
|
-
Event: TelemetryEvent.
|
|
775
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
776
|
+
Event: TelemetryEvent.UXLiveChatWidgetCompleted,
|
|
777
|
+
Description: "Live chat widget loading completed.",
|
|
773
778
|
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
774
779
|
});
|
|
775
780
|
}, []);
|
|
@@ -11,8 +11,9 @@ export const OutOfOfficeHoursPaneStateful = props => {
|
|
|
11
11
|
var _props$styleProps;
|
|
12
12
|
useEffect(() => {
|
|
13
13
|
uiTimer = createTimer();
|
|
14
|
-
TelemetryHelper.
|
|
15
|
-
Event: TelemetryEvent.
|
|
14
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
15
|
+
Event: TelemetryEvent.UXOutOfOfficeHoursPaneStart,
|
|
16
|
+
Description: "Out of office hours pane loading started."
|
|
16
17
|
});
|
|
17
18
|
}, []);
|
|
18
19
|
const [state] = useChatContextStore();
|
|
@@ -38,8 +39,9 @@ export const OutOfOfficeHoursPaneStateful = props => {
|
|
|
38
39
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
39
40
|
Event: TelemetryEvent.OutOfOfficePaneLoaded
|
|
40
41
|
});
|
|
41
|
-
TelemetryHelper.
|
|
42
|
-
Event: TelemetryEvent.
|
|
42
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
43
|
+
Event: TelemetryEvent.UXOutOfOfficeHoursPaneCompleted,
|
|
44
|
+
Description: "Out of office hours pane loading completed.",
|
|
43
45
|
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
44
46
|
});
|
|
45
47
|
}, []);
|
|
@@ -84,12 +84,17 @@ export const PostChatSurveyPaneStateful = props => {
|
|
|
84
84
|
Event: TelemetryEvent.CustomerVoiceResponsePageLoaded
|
|
85
85
|
});
|
|
86
86
|
} else if (data === CustomerVoiceEvents.FormResponseSubmitted) {
|
|
87
|
-
TelemetryHelper.
|
|
88
|
-
Event: TelemetryEvent.CustomerVoiceFormResponseSubmitted
|
|
87
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
88
|
+
Event: TelemetryEvent.CustomerVoiceFormResponseSubmitted,
|
|
89
|
+
Description: "Customer Voice form response submitted."
|
|
89
90
|
});
|
|
90
91
|
} else if (data === CustomerVoiceEvents.FormResponseError) {
|
|
91
|
-
TelemetryHelper.
|
|
92
|
-
Event: TelemetryEvent.CustomerVoiceFormResponseError
|
|
92
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.ERROR, {
|
|
93
|
+
Event: TelemetryEvent.CustomerVoiceFormResponseError,
|
|
94
|
+
Description: "Customer Voice form response error.",
|
|
95
|
+
ExceptionDetails: {
|
|
96
|
+
message: "Customer Voice form response error."
|
|
97
|
+
}
|
|
93
98
|
});
|
|
94
99
|
}
|
|
95
100
|
});
|
|
@@ -17,8 +17,9 @@ export const PreChatSurveyPaneStateful = props => {
|
|
|
17
17
|
var _surveyProps$stylePro, _props$surveyProps, _props$surveyProps$co;
|
|
18
18
|
useEffect(() => {
|
|
19
19
|
uiTimer = createTimer();
|
|
20
|
-
TelemetryHelper.
|
|
21
|
-
Event: TelemetryEvent.UXPrechatPaneStart
|
|
20
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
21
|
+
Event: TelemetryEvent.UXPrechatPaneStart,
|
|
22
|
+
Description: "Prechat survey pane loading started."
|
|
22
23
|
});
|
|
23
24
|
}, []);
|
|
24
25
|
|
|
@@ -67,8 +68,9 @@ export const PreChatSurveyPaneStateful = props => {
|
|
|
67
68
|
payload: getAdaptiveCardPayload(state.domainStates.preChatSurveyResponse, requiredFieldMissingMessage),
|
|
68
69
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
69
70
|
onSubmit: async values => {
|
|
70
|
-
TelemetryHelper.
|
|
71
|
-
Event: TelemetryEvent.PrechatSubmitted
|
|
71
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
72
|
+
Event: TelemetryEvent.PrechatSubmitted,
|
|
73
|
+
Description: "Prechat survey submitted."
|
|
72
74
|
});
|
|
73
75
|
dispatch({
|
|
74
76
|
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
@@ -139,9 +141,10 @@ export const PreChatSurveyPaneStateful = props => {
|
|
|
139
141
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
140
142
|
Event: TelemetryEvent.PrechatSurveyLoaded
|
|
141
143
|
});
|
|
142
|
-
TelemetryHelper.
|
|
144
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
143
145
|
Event: TelemetryEvent.UXPrechatPaneCompleted,
|
|
144
|
-
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
146
|
+
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed,
|
|
147
|
+
Description: "Prechat survey pane loading completed."
|
|
145
148
|
});
|
|
146
149
|
}, []);
|
|
147
150
|
|
|
@@ -16,8 +16,9 @@ export const ProactiveChatPaneStateful = props => {
|
|
|
16
16
|
var _proactiveChatProps$c;
|
|
17
17
|
useEffect(() => {
|
|
18
18
|
uiTimer = createTimer();
|
|
19
|
-
TelemetryHelper.
|
|
20
|
-
Event: TelemetryEvent.UXProactiveChatPaneStart
|
|
19
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
20
|
+
Event: TelemetryEvent.UXProactiveChatPaneStart,
|
|
21
|
+
Description: "Proactive chat pane loading started."
|
|
21
22
|
});
|
|
22
23
|
}, []);
|
|
23
24
|
const [state, dispatch] = useChatContextStore();
|
|
@@ -42,7 +43,7 @@ export const ProactiveChatPaneStateful = props => {
|
|
|
42
43
|
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
43
44
|
payload: ConversationState.Closed
|
|
44
45
|
});
|
|
45
|
-
TelemetryHelper.
|
|
46
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
46
47
|
Event: TelemetryEvent.ProactiveChatRejected,
|
|
47
48
|
ElapsedTimeInMilliseconds: TelemetryTimers.LcwLoadToChatButtonTimer.milliSecondsElapsed,
|
|
48
49
|
Description: "Proactive chat invitation timed out."
|
|
@@ -121,9 +122,10 @@ export const ProactiveChatPaneStateful = props => {
|
|
|
121
122
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
122
123
|
Event: TelemetryEvent.ProactiveChatPaneLoaded
|
|
123
124
|
});
|
|
124
|
-
TelemetryHelper.
|
|
125
|
-
Event: TelemetryEvent.
|
|
126
|
-
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
125
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
126
|
+
Event: TelemetryEvent.UXProactiveChatPaneCompleted,
|
|
127
|
+
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed,
|
|
128
|
+
Description: "Proactive chat pane loading completed."
|
|
127
129
|
});
|
|
128
130
|
return () => {
|
|
129
131
|
clearTimeout(timeoutEvent);
|
|
@@ -241,9 +241,15 @@ export const WebChatContainerStateful = props => {
|
|
|
241
241
|
.webchat__stacked-layout_container>div {
|
|
242
242
|
background: ${(props === null || props === void 0 ? void 0 : (_props$webChatContain9 = props.webChatContainerProps) === null || _props$webChatContain9 === void 0 ? void 0 : (_props$webChatContain10 = _props$webChatContain9.containerStyles) === null || _props$webChatContain10 === void 0 ? void 0 : _props$webChatContain10.background) ?? ""}
|
|
243
243
|
}
|
|
244
|
-
.
|
|
244
|
+
.webchat__toast_text {
|
|
245
245
|
display: flex;
|
|
246
|
+
|
|
246
247
|
}
|
|
248
|
+
.webchat__toaster {
|
|
249
|
+
overflow-y: unset;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
|
|
247
253
|
`), /*#__PURE__*/React.createElement(Stack, {
|
|
248
254
|
styles: containerStyles,
|
|
249
255
|
className: "webchat__stacked-layout_container"
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
5
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
7
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
8
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
10
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
11
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1
13
|
import "rxjs/add/operator/share";
|
|
2
14
|
import "rxjs/add/observable/of";
|
|
3
15
|
import { Observable } from "rxjs/Observable";
|
|
@@ -6,74 +18,85 @@ import { customerUser, postBotMessageActivity, postBotAttachmentActivity, postBo
|
|
|
6
18
|
import { createHeroCardAttachment, createJpgFileAttachment, createSigninCardAttachment, createThumbnailCardAttachment } from "./utils/attachmentActivityUtils";
|
|
7
19
|
import MockBotCommand from "./MockBotCommand";
|
|
8
20
|
import MockBotCardCommandType from "./MockBotCardCommandType";
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
21
|
+
export let DemoChatAdapter = /*#__PURE__*/function (_MockAdapter) {
|
|
22
|
+
_inherits(DemoChatAdapter, _MockAdapter);
|
|
23
|
+
var _super = _createSuper(DemoChatAdapter);
|
|
24
|
+
function DemoChatAdapter() {
|
|
25
|
+
var _this;
|
|
26
|
+
_classCallCheck(this, DemoChatAdapter);
|
|
27
|
+
_this = _super.call(this);
|
|
12
28
|
setTimeout(() => {
|
|
13
|
-
postSystemMessageActivity(
|
|
14
|
-
postBotMessageActivity(
|
|
29
|
+
postSystemMessageActivity(_this.activityObserver, "You're currently using a demo.", 0);
|
|
30
|
+
postBotMessageActivity(_this.activityObserver, "Type `/help` to learn more", undefined, 0); // send init message from bot
|
|
15
31
|
}, 1000);
|
|
32
|
+
return _this;
|
|
16
33
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
34
|
+
_createClass(DemoChatAdapter, [{
|
|
35
|
+
key: "postBotCommandsActivity",
|
|
36
|
+
value: function postBotCommandsActivity() {
|
|
37
|
+
let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1000;
|
|
38
|
+
postBotAttachmentActivity(this.activityObserver, [{
|
|
39
|
+
contentType: "application/vnd.microsoft.card.thumbnail",
|
|
40
|
+
content: {
|
|
41
|
+
buttons: [{
|
|
42
|
+
title: "Send system message",
|
|
43
|
+
type: "imBack",
|
|
44
|
+
value: "send system message"
|
|
45
|
+
}, {
|
|
46
|
+
title: "Send typing",
|
|
47
|
+
type: "imBack",
|
|
48
|
+
value: "send typing"
|
|
49
|
+
}, {
|
|
50
|
+
title: "Send bot message",
|
|
51
|
+
type: "imBack",
|
|
52
|
+
value: "send bot message"
|
|
53
|
+
}],
|
|
54
|
+
title: "Commands"
|
|
55
|
+
}
|
|
56
|
+
}], delay);
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
key: "postActivity",
|
|
60
|
+
value: function postActivity(activity) {
|
|
61
|
+
if (activity) {
|
|
62
|
+
postEchoActivity(this.activityObserver, activity, customerUser);
|
|
63
|
+
if (activity.text) {
|
|
64
|
+
switch (true) {
|
|
65
|
+
case activity.text === MockBotCommand.Help:
|
|
66
|
+
this.postBotCommandsActivity();
|
|
67
|
+
break;
|
|
68
|
+
case activity.text === MockBotCommand.SendSystemMessage:
|
|
69
|
+
postSystemMessageActivity(this.activityObserver, "Contoso has joined the chat.");
|
|
70
|
+
break;
|
|
71
|
+
case activity.text === MockBotCommand.SendTyping:
|
|
72
|
+
postBotTypingActivity(this.activityObserver);
|
|
73
|
+
break;
|
|
74
|
+
case activity.text === MockBotCommand.SendAttachment:
|
|
75
|
+
postBotAttachmentActivity(this.activityObserver, [createJpgFileAttachment()]);
|
|
76
|
+
break;
|
|
77
|
+
case activity.text === MockBotCommand.SendBotMessage:
|
|
78
|
+
postBotMessageActivity(this.activityObserver, "Hi, how can I help you?");
|
|
79
|
+
break;
|
|
80
|
+
case activity.text === `${MockBotCommand.Card} ${MockBotCardCommandType.Signin}`:
|
|
81
|
+
postBotAttachmentActivity(this.activityObserver, [createSigninCardAttachment()]);
|
|
82
|
+
break;
|
|
83
|
+
case activity.text === `${MockBotCommand.Card} ${MockBotCardCommandType.Hero}`:
|
|
84
|
+
postBotAttachmentActivity(this.activityObserver, [createHeroCardAttachment()]);
|
|
85
|
+
break;
|
|
86
|
+
case activity.text === `${MockBotCommand.Card} ${MockBotCardCommandType.Thumbnail}`:
|
|
87
|
+
postBotAttachmentActivity(this.activityObserver, [createThumbnailCardAttachment()]);
|
|
88
|
+
break;
|
|
89
|
+
case activity.text.startsWith(`${MockBotCommand.Bot} `):
|
|
90
|
+
postBotMessageActivity(this.activityObserver, activity.text.substring(5));
|
|
91
|
+
break;
|
|
92
|
+
case activity.text.startsWith(`${MockBotCommand.System} `):
|
|
93
|
+
postSystemMessageActivity(this.activityObserver, activity.text.substring(8));
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
74
96
|
}
|
|
75
97
|
}
|
|
98
|
+
return Observable.of(activity.id || "");
|
|
76
99
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
100
|
+
}]);
|
|
101
|
+
return DemoChatAdapter;
|
|
102
|
+
}(MockAdapter);
|
|
@@ -1,10 +1,29 @@
|
|
|
1
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
5
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
7
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
8
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
10
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
11
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1
13
|
import { DemoChatAdapter } from "./DemoChatAdapter";
|
|
2
14
|
import { MockChatSDK } from "./mockchatsdk";
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
15
|
+
export let DemoChatSDK = /*#__PURE__*/function (_MockChatSDK) {
|
|
16
|
+
_inherits(DemoChatSDK, _MockChatSDK);
|
|
17
|
+
var _super = _createSuper(DemoChatSDK);
|
|
18
|
+
function DemoChatSDK() {
|
|
19
|
+
_classCallCheck(this, DemoChatSDK);
|
|
20
|
+
return _super.call(this);
|
|
6
21
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
22
|
+
_createClass(DemoChatSDK, [{
|
|
23
|
+
key: "createChatAdapter",
|
|
24
|
+
value: function createChatAdapter() {
|
|
25
|
+
return new DemoChatAdapter();
|
|
26
|
+
}
|
|
27
|
+
}]);
|
|
28
|
+
return DemoChatSDK;
|
|
29
|
+
}(MockChatSDK);
|
|
@@ -1,33 +1,56 @@
|
|
|
1
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
5
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
7
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
8
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
10
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
11
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1
13
|
import { Observable } from "rxjs/Observable";
|
|
2
14
|
import MockAdapter from "./mockadapter";
|
|
3
15
|
import { customerUser, postBotMessageActivity, postEchoActivity, postSystemMessageActivity } from "./utils/chatAdapterUtils";
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
16
|
+
export let DesignerChatAdapter = /*#__PURE__*/function (_MockAdapter) {
|
|
17
|
+
_inherits(DesignerChatAdapter, _MockAdapter);
|
|
18
|
+
var _super = _createSuper(DesignerChatAdapter);
|
|
19
|
+
function DesignerChatAdapter() {
|
|
20
|
+
var _this;
|
|
21
|
+
_classCallCheck(this, DesignerChatAdapter);
|
|
22
|
+
_this = _super.call(this);
|
|
7
23
|
setTimeout(() => {
|
|
8
|
-
postBotMessageActivity(
|
|
9
|
-
|
|
10
|
-
postBotMessageActivity(
|
|
11
|
-
postSystemMessageActivity(
|
|
12
|
-
postBotMessageActivity(
|
|
24
|
+
postBotMessageActivity(_this.activityObserver, "Thank you for contacting us! How can I help you today?", undefined, 0);
|
|
25
|
+
_this.postUserActivity("I need to change my address.", 0);
|
|
26
|
+
postBotMessageActivity(_this.activityObserver, "Okay, let me connect you with a live agent.", undefined, 100);
|
|
27
|
+
postSystemMessageActivity(_this.activityObserver, "John has joined the chat", 100);
|
|
28
|
+
postBotMessageActivity(_this.activityObserver, "I'd be happy to help you update your account.", undefined, 100);
|
|
13
29
|
}, 1000);
|
|
30
|
+
return _this;
|
|
14
31
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (activity) {
|
|
29
|
-
postEchoActivity(this.activityObserver, activity, customerUser);
|
|
32
|
+
_createClass(DesignerChatAdapter, [{
|
|
33
|
+
key: "postUserActivity",
|
|
34
|
+
value: function postUserActivity(text) {
|
|
35
|
+
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
|
36
|
+
setTimeout(() => {
|
|
37
|
+
postEchoActivity(this.activityObserver, {
|
|
38
|
+
text,
|
|
39
|
+
from: {
|
|
40
|
+
...customerUser
|
|
41
|
+
},
|
|
42
|
+
type: "message"
|
|
43
|
+
}, customerUser, 0);
|
|
44
|
+
}, delay);
|
|
30
45
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
46
|
+
}, {
|
|
47
|
+
key: "postActivity",
|
|
48
|
+
value: function postActivity(activity) {
|
|
49
|
+
if (activity) {
|
|
50
|
+
postEchoActivity(this.activityObserver, activity, customerUser);
|
|
51
|
+
}
|
|
52
|
+
return Observable.of(activity.id || "");
|
|
53
|
+
}
|
|
54
|
+
}]);
|
|
55
|
+
return DesignerChatAdapter;
|
|
56
|
+
}(MockAdapter);
|