@microsoft/omnichannel-chat-widget 1.8.7 → 2.0.0-main.5ebd4eb
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 +52 -5
- package/lib/cjs/common/Constants.js +5 -0
- package/lib/cjs/common/facades/FacadeChatSDK.js +234 -9
- package/lib/cjs/common/telemetry/TelemetryConstants.js +19 -0
- package/lib/cjs/common/telemetry/TelemetryManager.js +6 -1
- package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +2 -3
- package/lib/cjs/common/telemetry/sanitizeSasInPayload.js +91 -0
- package/lib/cjs/common/utils.js +93 -17
- package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +16 -6
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +20 -10
- package/lib/cjs/components/citationpanestateful/CitationDim.js +2 -3
- package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +27 -5
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +23 -3
- package/lib/cjs/components/dimlayer/DimLayer.js +1 -3
- package/lib/cjs/components/draggable/DraggableChatWidget.js +35 -15
- package/lib/cjs/components/draggable/DraggableEventEmitter.js +10 -1
- package/lib/cjs/components/draggable/DraggableEventReceiver.js +1 -3
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +54 -17
- package/lib/cjs/components/errorboundary/ErrorBoundary.js +4 -12
- package/lib/cjs/components/footerstateful/FooterStateful.js +18 -9
- package/lib/cjs/components/footerstateful/audionotificationstateful/AudioNotificationStateful.js +2 -4
- package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +4 -6
- package/lib/cjs/components/headerstateful/HeaderStateful.js +24 -12
- package/lib/cjs/components/livechatwidget/LiveChatWidget.js +27 -4
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +5 -11
- package/lib/cjs/components/livechatwidget/common/ChatWidgetEvents.js +1 -0
- package/lib/cjs/components/livechatwidget/common/PersistentConversationHandler.js +11 -4
- package/lib/cjs/components/livechatwidget/common/authHelper.js +44 -4
- package/lib/cjs/components/livechatwidget/common/createMarkdown.js +98 -5
- package/lib/cjs/components/livechatwidget/common/endChat.js +12 -9
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +182 -1
- package/lib/cjs/components/livechatwidget/common/recoveryEligibilityTelemetry.js +60 -0
- package/lib/cjs/components/livechatwidget/common/startChat.js +31 -14
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +160 -21
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +16 -11
- package/lib/cjs/components/notificationpanestateful/NotificationPaneStateful.js +19 -12
- package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +13 -6
- package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +28 -5
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +12 -5
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +105 -11
- package/lib/cjs/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +12 -1
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +17 -7
- package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +16 -7
- package/lib/cjs/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +10 -2
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +154 -29
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +10 -0
- package/lib/cjs/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +115 -10
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +3 -0
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +2 -1
- package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +2 -2
- package/lib/cjs/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/common/utils/citationA11y.js +195 -0
- package/lib/cjs/components/webchatcontainerstateful/interfaces/IWebChatAction.js +17 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +27 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +1 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +1 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +180 -190
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +3 -5
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +22 -6
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +12 -23
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +27 -35
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AdaptiveCardAccessibilityWrapper.js +199 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.js +29 -15
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +5 -12
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +8 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +8 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.js +5 -8
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.js +6 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +6 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +14 -12
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +16 -14
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +18 -30
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +10 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.js +1 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +16 -12
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +6 -6
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentSentAnnouncementMiddleware.js +83 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +36 -8
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/callActionMiddleware.js +5 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +10 -7
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +4 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +6 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware.js +5 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +7 -7
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +10 -14
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +6 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +13 -10
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +57 -11
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +6 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +25 -30
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +10 -7
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +6 -4
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +55 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +2 -4
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +5 -0
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +17 -1
- package/lib/cjs/contexts/createReducer.js +15 -0
- package/lib/cjs/controller/componentController.js +13 -1
- package/lib/cjs/hooks/useWindowDimensions.js +13 -5
- package/lib/cjs/package.json +1 -0
- package/lib/cjs/plugins/createChatTranscript.js +3 -4
- package/lib/cjs/plugins/newMessageEventHandler.js +20 -3
- package/lib/esm/common/Constants.js +5 -0
- package/lib/esm/common/facades/FacadeChatSDK.js +235 -10
- package/lib/esm/common/telemetry/TelemetryConstants.js +19 -0
- package/lib/esm/common/telemetry/TelemetryManager.js +6 -1
- package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +2 -3
- package/lib/esm/common/telemetry/sanitizeSasInPayload.js +84 -0
- package/lib/esm/common/utils.js +88 -14
- package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +15 -5
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +19 -9
- package/lib/esm/components/citationpanestateful/CitationDim.js +2 -3
- package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +26 -4
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +22 -2
- package/lib/esm/components/dimlayer/DimLayer.js +1 -3
- package/lib/esm/components/draggable/DraggableChatWidget.js +34 -14
- package/lib/esm/components/draggable/DraggableEventEmitter.js +10 -1
- package/lib/esm/components/draggable/DraggableEventReceiver.js +1 -3
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +54 -17
- package/lib/esm/components/errorboundary/ErrorBoundary.js +4 -12
- package/lib/esm/components/footerstateful/FooterStateful.js +17 -8
- package/lib/esm/components/footerstateful/audionotificationstateful/AudioNotificationStateful.js +2 -4
- package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +4 -6
- package/lib/esm/components/headerstateful/HeaderStateful.js +22 -10
- package/lib/esm/components/livechatwidget/LiveChatWidget.js +27 -4
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +5 -11
- package/lib/esm/components/livechatwidget/common/ChatWidgetEvents.js +1 -0
- package/lib/esm/components/livechatwidget/common/PersistentConversationHandler.js +11 -4
- package/lib/esm/components/livechatwidget/common/authHelper.js +44 -4
- package/lib/esm/components/livechatwidget/common/createMarkdown.js +98 -5
- package/lib/esm/components/livechatwidget/common/endChat.js +12 -9
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +182 -1
- package/lib/esm/components/livechatwidget/common/recoveryEligibilityTelemetry.js +52 -0
- package/lib/esm/components/livechatwidget/common/startChat.js +31 -14
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +159 -20
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +14 -9
- package/lib/esm/components/notificationpanestateful/NotificationPaneStateful.js +17 -10
- package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +12 -5
- package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +28 -5
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +11 -4
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +105 -11
- package/lib/esm/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +12 -1
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +16 -6
- package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +15 -6
- package/lib/esm/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +9 -1
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +154 -29
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +10 -0
- package/lib/esm/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +115 -10
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +3 -0
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +2 -2
- package/lib/esm/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/common/utils/citationA11y.js +188 -0
- package/lib/esm/components/webchatcontainerstateful/interfaces/IWebChatAction.js +10 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +27 -4
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +1 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +1 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +180 -190
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +3 -5
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +19 -4
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +12 -23
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +27 -32
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AdaptiveCardAccessibilityWrapper.js +193 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.js +28 -14
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +5 -12
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +8 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +8 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.js +5 -8
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.js +6 -4
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +6 -4
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +13 -11
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +15 -13
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +17 -27
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +9 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.js +1 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +16 -10
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +6 -6
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentSentAnnouncementMiddleware.js +77 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +36 -8
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/callActionMiddleware.js +5 -2
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +10 -7
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +4 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +6 -4
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware.js +5 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +7 -7
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +10 -14
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +6 -4
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +13 -10
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +57 -11
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +6 -4
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +25 -31
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +10 -7
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +6 -4
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +55 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +2 -4
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +5 -0
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +17 -1
- package/lib/esm/contexts/createReducer.js +15 -0
- package/lib/esm/controller/componentController.js +13 -1
- package/lib/esm/hooks/useWindowDimensions.js +13 -5
- package/lib/esm/plugins/createChatTranscript.js +3 -4
- package/lib/esm/plugins/newMessageEventHandler.js +20 -3
- package/lib/types/common/Constants.d.ts +4 -0
- package/lib/types/common/facades/FacadeChatSDK.d.ts +29 -0
- package/lib/types/common/facades/types/IFacadeChatSDKInput.d.ts +3 -1
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +15 -2
- package/lib/types/common/telemetry/sanitizeSasInPayload.d.ts +24 -0
- package/lib/types/common/utils.d.ts +3 -1
- package/lib/types/components/livechatwidget/common/ChatWidgetEvents.d.ts +2 -1
- package/lib/types/components/livechatwidget/common/authHelper.d.ts +9 -2
- package/lib/types/components/livechatwidget/common/recoveryEligibilityTelemetry.d.ts +17 -0
- package/lib/types/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.d.ts +6 -0
- package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/common/utils/citationA11y.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatAction.d.ts +16 -1
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +7 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.d.ts +14 -38
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AdaptiveCardAccessibilityWrapper.d.ts +18 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.d.ts +3 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.d.ts +2 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.d.ts +2 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.d.ts +2 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentSentAnnouncementMiddleware.d.ts +10 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.d.ts +2 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/callActionMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.d.ts +2 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.d.ts +2 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.d.ts +2 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.d.ts +2 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.d.ts +2 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.d.ts +2 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.d.ts +2 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.d.ts +2 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.d.ts +2 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.d.ts +2 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.d.ts +7 -0
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
- package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +17 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +2 -1
- package/package.json +71 -57
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
2
8
|
import { BroadcastEvent, ConversationStage, LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
3
9
|
import { BroadcastService, BroadcastServiceInitialize, decodeComponentString } from "@microsoft/omnichannel-chat-components";
|
|
4
10
|
import { Components } from "botframework-webchat";
|
|
@@ -8,7 +14,7 @@ import React, { useEffect, useRef, useState } from "react";
|
|
|
8
14
|
import { TelemetryManager, TelemetryTimers } from "../../../common/telemetry/TelemetryManager";
|
|
9
15
|
import { chatSDKStateCleanUp, endChat, endChatStateCleanUp, prepareEndChat } from "../common/endChat";
|
|
10
16
|
import { checkIfConversationStillValid, initStartChat, prepareStartChat, setPreChatAndInitiateChat } from "../common/startChat";
|
|
11
|
-
import { createTimer, getBroadcastChannelName, getConversationDetailsCall, getLocaleDirection, getStateFromCache, getWidgetCacheIdfromProps, getWidgetEndChatEventName, isNullOrEmptyString, isNullOrUndefined, isThisSessionPopout, isUndefinedOrEmpty, setOcUserAgent } from "../../../common/utils";
|
|
17
|
+
import { createTimer, getBroadcastChannelName, getConversationDetailsCall, getLocaleDirection, getStateFromCache, getWidgetCacheIdfromProps, getWidgetEndChatEventName, isNullOrEmptyString, isNullOrUndefined, isThisSessionPopout, isUndefinedOrEmpty, setAriaHiddenForSiblings, setOcUserAgent } from "../../../common/utils";
|
|
12
18
|
import { customEventCallback, subscribeToSendCustomEvent } from "../common/customEventHandler";
|
|
13
19
|
import { defaultClientDataStoreProvider, isCookieAllowed } from "../../../common/storage/default/defaultClientDataStoreProvider";
|
|
14
20
|
import { handleChatReconnect, isPersistentEnabled, isReconnectEnabled } from "../common/reconnectChatHelper";
|
|
@@ -50,14 +56,16 @@ import { initConfirmationPropsComposer } from "../common/initConfirmationPropsCo
|
|
|
50
56
|
import { initWebChatComposer } from "../common/initWebChatComposer";
|
|
51
57
|
import { registerBroadcastServiceForStorage } from "../../../common/storage/default/defaultCacheManager";
|
|
52
58
|
import { setPostChatContextAndLoadSurvey } from "../common/setPostChatContextAndLoadSurvey";
|
|
59
|
+
import { shouldLoadPersistentChatHistory } from "../common/liveChatConfigUtils";
|
|
53
60
|
import { startProactiveChat } from "../common/startProactiveChat";
|
|
54
61
|
import useChatAdapterStore from "../../../hooks/useChatAdapterStore";
|
|
55
62
|
import useChatContextStore from "../../../hooks/useChatContextStore";
|
|
56
63
|
import useFacadeSDKStore from "../../../hooks/useFacadeChatSDKStore";
|
|
57
64
|
import { getPostChatContext, initiatePostChat } from "../common/renderSurveyHelpers";
|
|
65
|
+
import { logRecoveryEligibilityTelemetry } from "../common/recoveryEligibilityTelemetry";
|
|
58
66
|
let uiTimer;
|
|
59
67
|
export const LiveChatWidgetStateful = props => {
|
|
60
|
-
var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _props$webChatContain4, _props$webChatContain5, _props$styleProps, _props$webChatContain6, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain9, _state$appStates8, _props$webChatContain1, _props$webChatContain10, _props$controlProps10, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _livechatProps$webCha, _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$contro0, _livechatProps$contro1, _livechatProps$compon9, _livechatProps$contro10, _livechatProps$compon0, _livechatProps$contro11, _livechatProps$compon1, _livechatProps$compon10, _livechatProps$compon11;
|
|
68
|
+
var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _props$webChatContain4, _props$webChatContain5, _props$styleProps, _props$webChatContain6, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain9, _state$appStates8, _props$webChatContain1, _props$webChatContain10, _props$controlProps10, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _livechatProps$webCha, _livechatProps$styleP, _props$headerProps, _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$contro0, _livechatProps$contro1, _livechatProps$compon9, _livechatProps$contro10, _livechatProps$compon0, _livechatProps$contro11, _livechatProps$compon1, _livechatProps$compon10, _livechatProps$compon11;
|
|
61
69
|
useEffect(() => {
|
|
62
70
|
uiTimer = createTimer();
|
|
63
71
|
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
@@ -68,21 +76,36 @@ export const LiveChatWidgetStateful = props => {
|
|
|
68
76
|
}
|
|
69
77
|
});
|
|
70
78
|
}, []);
|
|
71
|
-
const
|
|
79
|
+
const _useChatContextStore = useChatContextStore(),
|
|
80
|
+
_useChatContextStore2 = _slicedToArray(_useChatContextStore, 2),
|
|
81
|
+
state = _useChatContextStore2[0],
|
|
82
|
+
dispatch = _useChatContextStore2[1];
|
|
72
83
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
const _useChatAdapterStore = useChatAdapterStore(),
|
|
85
|
+
_useChatAdapterStore2 = _slicedToArray(_useChatAdapterStore, 2),
|
|
86
|
+
adapter = _useChatAdapterStore2[0],
|
|
87
|
+
setAdapter = _useChatAdapterStore2[1];
|
|
88
|
+
const _useState = useState({
|
|
89
|
+
...defaultWebChatContainerStatefulProps.webChatStyles,
|
|
90
|
+
...((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.webChatStyles)
|
|
91
|
+
}),
|
|
92
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
93
|
+
webChatStyles = _useState2[0],
|
|
94
|
+
setWebChatStyles = _useState2[1];
|
|
78
95
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
79
|
-
const
|
|
96
|
+
const _useFacadeSDKStore = useFacadeSDKStore(),
|
|
97
|
+
_useFacadeSDKStore2 = _slicedToArray(_useFacadeSDKStore, 1),
|
|
98
|
+
facadeChatSDK = _useFacadeSDKStore2[0];
|
|
80
99
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
100
|
+
const _useState3 = useState(undefined),
|
|
101
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
102
|
+
voiceVideoCallingSDK = _useState4[0],
|
|
103
|
+
setVoiceVideoCallingSDK = _useState4[1];
|
|
104
|
+
const _useState5 = useState(""),
|
|
105
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
106
|
+
conversationId = _useState6[0],
|
|
107
|
+
setConversationId = _useState6[1];
|
|
108
|
+
const Composer = Components.Composer;
|
|
86
109
|
const canStartProactiveChat = useRef(true);
|
|
87
110
|
const bubbleBackground = ((_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 || (_props$webChatContain2 = _props$webChatContain2.webChatStyles) === null || _props$webChatContain2 === void 0 ? void 0 : _props$webChatContain2.bubbleBackground) ?? ((_props$webChatContain3 = props.webChatContainerProps) === null || _props$webChatContain3 === void 0 || (_props$webChatContain3 = _props$webChatContain3.adaptiveCardStyles) === null || _props$webChatContain3 === void 0 ? void 0 : _props$webChatContain3.background) ?? defaultAdaptiveCardStyles.background;
|
|
88
111
|
const bubbleTextColor = ((_props$webChatContain4 = props.webChatContainerProps) === null || _props$webChatContain4 === void 0 || (_props$webChatContain4 = _props$webChatContain4.webChatStyles) === null || _props$webChatContain4 === void 0 ? void 0 : _props$webChatContain4.bubbleTextColor) ?? ((_props$webChatContain5 = props.webChatContainerProps) === null || _props$webChatContain5 === void 0 || (_props$webChatContain5 = _props$webChatContain5.adaptiveCardStyles) === null || _props$webChatContain5 === void 0 ? void 0 : _props$webChatContain5.color) ?? defaultAdaptiveCardStyles.color;
|
|
@@ -128,6 +151,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
128
151
|
activeCachedChatExist = false;
|
|
129
152
|
optionalParams = {};
|
|
130
153
|
}
|
|
154
|
+
logRecoveryEligibilityTelemetry(state, activeCachedChatExist);
|
|
131
155
|
};
|
|
132
156
|
|
|
133
157
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -553,9 +577,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
553
577
|
}
|
|
554
578
|
});
|
|
555
579
|
const conversationDetails = await getConversationDetailsCall(facadeChatSDK);
|
|
556
|
-
const
|
|
557
|
-
chatConfig
|
|
558
|
-
} = props;
|
|
580
|
+
const chatConfig = props.chatConfig;
|
|
559
581
|
const isPersistent = isPersistentEnabled(chatConfig);
|
|
560
582
|
TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.INFO, {
|
|
561
583
|
Event: TelemetryEvent.EndChatEventReceived,
|
|
@@ -728,7 +750,15 @@ export const LiveChatWidgetStateful = props => {
|
|
|
728
750
|
if (state.appStates.isMinimized) {
|
|
729
751
|
ActivityStreamHandler.cork();
|
|
730
752
|
} else {
|
|
731
|
-
|
|
753
|
+
var _state$domainStates4;
|
|
754
|
+
const extendedChatConfig = state === null || state === void 0 || (_state$domainStates4 = state.domainStates) === null || _state$domainStates4 === void 0 ? void 0 : _state$domainStates4.liveChatConfig;
|
|
755
|
+
if (shouldLoadPersistentChatHistory(extendedChatConfig)) {
|
|
756
|
+
requestAnimationFrame(() => {
|
|
757
|
+
setTimeout(() => ActivityStreamHandler.uncork(), 500);
|
|
758
|
+
});
|
|
759
|
+
} else {
|
|
760
|
+
setTimeout(() => ActivityStreamHandler.uncork(), 500);
|
|
761
|
+
}
|
|
732
762
|
}
|
|
733
763
|
}, [state.appStates.isMinimized]);
|
|
734
764
|
|
|
@@ -867,6 +897,37 @@ export const LiveChatWidgetStateful = props => {
|
|
|
867
897
|
}
|
|
868
898
|
}, [state.appStates.chatDisconnectEventReceived]);
|
|
869
899
|
|
|
900
|
+
// Auth state change listeners (broadcast by FacadeChatSDK.startChat())
|
|
901
|
+
useEffect(() => {
|
|
902
|
+
const authSucceededSub = BroadcastService.getMessageByEventName(BroadcastEvent.MidConversationAuthSucceeded).subscribe(msg => {
|
|
903
|
+
var _msg$payload13;
|
|
904
|
+
if (msg !== null && msg !== void 0 && (_msg$payload13 = msg.payload) !== null && _msg$payload13 !== void 0 && _msg$payload13.isAuthenticated) {
|
|
905
|
+
// Only store boolean flag, NOT the token - token is managed by FacadeChatSDK
|
|
906
|
+
dispatch({
|
|
907
|
+
type: LiveChatWidgetActionType.SET_USER_AUTHENTICATED,
|
|
908
|
+
payload: true
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
});
|
|
912
|
+
|
|
913
|
+
// Auth reset: only update the boolean flag here.
|
|
914
|
+
// We do NOT clear widget state/cache/adapter because this fires DURING startChat(),
|
|
915
|
+
// which will handle state transitions. FacadeChatSDK has already cleared SDK internals.
|
|
916
|
+
const authResetSub = BroadcastService.getMessageByEventName(BroadcastEvent.MidConversationAuthReset).subscribe(msg => {
|
|
917
|
+
var _msg$payload14;
|
|
918
|
+
if ((msg === null || msg === void 0 || (_msg$payload14 = msg.payload) === null || _msg$payload14 === void 0 ? void 0 : _msg$payload14.isAuthenticated) === false) {
|
|
919
|
+
dispatch({
|
|
920
|
+
type: LiveChatWidgetActionType.SET_USER_AUTHENTICATED,
|
|
921
|
+
payload: false
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
});
|
|
925
|
+
return () => {
|
|
926
|
+
authSucceededSub.unsubscribe();
|
|
927
|
+
authResetSub.unsubscribe();
|
|
928
|
+
};
|
|
929
|
+
}, [dispatch]);
|
|
930
|
+
|
|
870
931
|
// if props state gets updates we need to update the renderingMiddlewareProps in the state
|
|
871
932
|
useEffect(() => {
|
|
872
933
|
var _props$webChatContain0;
|
|
@@ -885,6 +946,25 @@ export const LiveChatWidgetStateful = props => {
|
|
|
885
946
|
}
|
|
886
947
|
});
|
|
887
948
|
}, []);
|
|
949
|
+
|
|
950
|
+
// Reliable browser close detection via visibilitychange + sendBeacon
|
|
951
|
+
// visibilitychange fires while the page is still alive (unlike beforeunload),
|
|
952
|
+
// so telemetry calls complete reliably. False positives (tab switch, minimize)
|
|
953
|
+
// are filtered in Kusto by checking if this is the last event in the session.
|
|
954
|
+
useEffect(() => {
|
|
955
|
+
const handleVisibilityChange = () => {
|
|
956
|
+
if (document.visibilityState === "hidden" && state.appStates.conversationState === ConversationState.Active) {
|
|
957
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
958
|
+
Event: TelemetryEvent.BrowserTabHidden,
|
|
959
|
+
Description: "Browser tab hidden during active conversation"
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
|
+
};
|
|
963
|
+
document.addEventListener("visibilitychange", handleVisibilityChange);
|
|
964
|
+
return () => {
|
|
965
|
+
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
|
966
|
+
};
|
|
967
|
+
}, [state.appStates.conversationState]);
|
|
888
968
|
const initiateEndChatOnBrowserUnload = () => {
|
|
889
969
|
var _DataStoreManager$cli;
|
|
890
970
|
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
@@ -962,6 +1042,15 @@ export const LiveChatWidgetStateful = props => {
|
|
|
962
1042
|
}));
|
|
963
1043
|
}
|
|
964
1044
|
}, [state.domainStates.botAvatarInitials]);
|
|
1045
|
+
const isWidgetOpen = !state.appStates.isMinimized && state.appStates.conversationState !== ConversationState.Closed;
|
|
1046
|
+
const siblingAriaHiddenMapRef = useRef(new Map());
|
|
1047
|
+
useEffect(() => {
|
|
1048
|
+
const map = siblingAriaHiddenMapRef.current;
|
|
1049
|
+
setAriaHiddenForSiblings(widgetElementId, isWidgetOpen, map);
|
|
1050
|
+
return () => {
|
|
1051
|
+
setAriaHiddenForSiblings(widgetElementId, false, map);
|
|
1052
|
+
};
|
|
1053
|
+
}, [isWidgetOpen]);
|
|
965
1054
|
|
|
966
1055
|
// WebChat's Composer can only be rendered if a directLine object is defined
|
|
967
1056
|
return directLine && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, `
|
|
@@ -1008,10 +1097,31 @@ export const LiveChatWidgetStateful = props => {
|
|
|
1008
1097
|
.webchat__basic-transcript__activity-markdown-body > :last-child {
|
|
1009
1098
|
margin-bottom: 0px;
|
|
1010
1099
|
}
|
|
1011
|
-
|
|
1100
|
+
|
|
1012
1101
|
.webchat__basic-transcript__activity-markdown-body > :first-child {
|
|
1013
1102
|
margin-top: 0px;
|
|
1014
1103
|
}
|
|
1104
|
+
|
|
1105
|
+
/* Remove browser-default <p> margins inside system messages.
|
|
1106
|
+
Without this, each markdown paragraph adds ~1em top+bottom gap
|
|
1107
|
+
which causes the oversized line spacing visible on iOS Safari.
|
|
1108
|
+
Also disable iOS Safari's auto font-size scaling (-webkit-text-size-adjust)
|
|
1109
|
+
which inflates font sizes and causes line-height to grow over time
|
|
1110
|
+
when the layout is viewed in a narrow viewport. */
|
|
1111
|
+
.webchat__basic-transcript__activity-markdown-body {
|
|
1112
|
+
-webkit-text-size-adjust: 100%;
|
|
1113
|
+
text-size-adjust: 100%;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
.webchat__basic-transcript__activity-markdown-body p {
|
|
1117
|
+
margin-top: 0;
|
|
1118
|
+
margin-bottom: 4px;
|
|
1119
|
+
line-height: 1.4;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
.webchat__basic-transcript__activity-markdown-body p:last-child {
|
|
1123
|
+
margin-bottom: 0;
|
|
1124
|
+
}
|
|
1015
1125
|
|
|
1016
1126
|
.webchat__basic-transcript__activity-markdown-body img.webchat__render-markdown__external-link-icon {
|
|
1017
1127
|
background-image : url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg5MjNMMTcuOTk4NyAxNi43Mzg0VjEzLjIzMjFDMTcuOTk4NyAxMi44MTc5IDE4LjMzNDUgMTIuNDgyMSAxOC43NDg3IDEyLjQ4MjFDMTkuMTI4NCAxMi40ODIxIDE5LjQ0MjIgMTIuNzY0MyAxOS40OTE4IDEzLjEzMDNMMTkuNDk4NyAxMy4yMzIxVjE2LjczODRDMTkuNDk4NyAxOC43NDA3IDE3LjkyOTMgMjAuMzc2OSAxNS45NTI4IDIwLjQ4MjlMMTUuNzUzOCAyMC40ODg0TDcuMjU4MjcgMjAuNTAwMUw3LjA1NDk1IDIwLjQ5NDlDNS4xNDIzOSAyMC4zOTU0IDMuNjA4OTUgMTguODYyNyAzLjUwODM3IDE2Ljk1MDJMMy41MDMxMiAxNi43NTExTDMuNTAwODkgOC4yNTI3TDMuNTA1MjkgOC4wNTAyQzMuNjA1MzkgNi4xMzc0OSA1LjEzODY3IDQuNjA0NDkgNy4wNTA5NiA0LjUwNTI3TDcuMjUwMSA0LjUwMDE3SDEwLjc0OTVINy4yNTAxWk0xMy43NDgxIDMuMDAxNDZMMjAuMzAxOCAzLjAwMTk3TDIwLjQwMTQgMy4wMTU3NUwyMC41MDIyIDMuMDQzOTNMMjAuNTU5IDMuMDY4MDNDMjAuNjEyMiAzLjA5MTIyIDIwLjY2MzQgMy4xMjE2MyAyMC43MTExIDMuMTU4ODVMMjAuNzgwNCAzLjIyMTU2TDIwLjg2NDEgMy4zMjAxNEwyMC45MTgzIDMuNDEwMjVMMjAuOTU3IDMuNTAwNTdMMjAuOTc2MiAzLjU2NDc2TDIwLjk4OTggMy42Mjg2MkwyMC45OTkyIDMuNzIyODJMMjAuOTk5NyAxMC4yNTU0QzIwLjk5OTcgMTAuNjY5NiAyMC42NjM5IDExLjAwNTQgMjAuMjQ5NyAxMS4wMDU0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjMjEyMTIxIiAvPjwvc3ZnPg==) !important;
|
|
@@ -1019,6 +1129,32 @@ export const LiveChatWidgetStateful = props => {
|
|
|
1019
1129
|
margin-left: .25em;
|
|
1020
1130
|
}
|
|
1021
1131
|
|
|
1132
|
+
/* ── iOS Safari: underline + number alignment fixes ────────────────
|
|
1133
|
+
1. Position underlines below all glyphs (not at alphabetic baseline)
|
|
1134
|
+
so they never intersect numbers in links or auto-detected tel: hrefs.
|
|
1135
|
+
2. Use a solid underline (skip-ink: none) so numbers aren't split by
|
|
1136
|
+
gaps the browser renders around descenders.
|
|
1137
|
+
3. Prevent ::marker pseudo-element from inheriting text-decoration,
|
|
1138
|
+
which Safari applies to ol/ul counters causing them to appear
|
|
1139
|
+
underlined and misaligned.
|
|
1140
|
+
4. Normalise ordered-list indentation across Safari/WebKit. */
|
|
1141
|
+
.webchat__basic-transcript__activity-markdown-body a {
|
|
1142
|
+
-webkit-text-underline-position: under;
|
|
1143
|
+
text-underline-position: under;
|
|
1144
|
+
text-decoration-skip-ink: none;
|
|
1145
|
+
-webkit-text-decoration-skip: none;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
.webchat__basic-transcript__activity-markdown-body ol li::marker,
|
|
1149
|
+
.webchat__basic-transcript__activity-markdown-body ul li::marker {
|
|
1150
|
+
text-decoration: none;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
.webchat__basic-transcript__activity-markdown-body ol {
|
|
1154
|
+
-webkit-padding-start: 1.5em;
|
|
1155
|
+
padding-inline-start: 1.5em;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1022
1158
|
.webchat__link-definitions__header-text {
|
|
1023
1159
|
color: ${bubbleBackground}
|
|
1024
1160
|
}
|
|
@@ -1038,7 +1174,10 @@ export const LiveChatWidgetStateful = props => {
|
|
|
1038
1174
|
}), /*#__PURE__*/React.createElement(Stack, {
|
|
1039
1175
|
id: widgetElementId,
|
|
1040
1176
|
styles: generalStyles,
|
|
1041
|
-
className: (_livechatProps$styleP = livechatProps.styleProps) === null || _livechatProps$styleP === void 0 ? void 0 : _livechatProps$styleP.className
|
|
1177
|
+
className: (_livechatProps$styleP = livechatProps.styleProps) === null || _livechatProps$styleP === void 0 ? void 0 : _livechatProps$styleP.className,
|
|
1178
|
+
role: isWidgetOpen ? "dialog" : undefined,
|
|
1179
|
+
"aria-modal": isWidgetOpen ? true : undefined,
|
|
1180
|
+
"aria-label": isWidgetOpen ? ((_props$headerProps = props.headerProps) === null || _props$headerProps === void 0 || (_props$headerProps = _props$headerProps.controlProps) === null || _props$headerProps === void 0 || (_props$headerProps = _props$headerProps.headerTitleProps) === null || _props$headerProps === void 0 ? void 0 : _props$headerProps.text) ?? "Live Chat" : undefined
|
|
1042
1181
|
}, !((_livechatProps$contro = livechatProps.controlProps) !== null && _livechatProps$contro !== void 0 && _livechatProps$contro.hideChatButton) && !((_livechatProps$contro2 = livechatProps.controlProps) !== null && _livechatProps$contro2 !== void 0 && _livechatProps$contro2.hideStartChatButton) && shouldShowChatButton(state) && (decodeComponentString((_livechatProps$compon = livechatProps.componentOverrides) === null || _livechatProps$compon === void 0 ? void 0 : _livechatProps$compon.chatButton) || /*#__PURE__*/React.createElement(ChatButtonStateful, {
|
|
1043
1182
|
buttonProps: livechatProps.chatButtonProps,
|
|
1044
1183
|
outOfOfficeButtonProps: livechatProps.outOfOfficeChatButtonProps,
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
1
7
|
import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
2
8
|
import React, { useEffect } from "react";
|
|
3
9
|
import { createTimer, findAllFocusableElement } from "../../common/utils";
|
|
@@ -18,11 +24,11 @@ export const LoadingPaneStateful = props => {
|
|
|
18
24
|
Event: TelemetryEvent.UXLoadingPaneStart
|
|
19
25
|
});
|
|
20
26
|
}, []);
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
const _useChatContextStore = useChatContextStore(),
|
|
28
|
+
_useChatContextStore2 = _slicedToArray(_useChatContextStore, 1),
|
|
29
|
+
state = _useChatContextStore2[0];
|
|
30
|
+
const loadingPaneProps = props.loadingPaneProps,
|
|
31
|
+
startChatErrorPaneProps = props.startChatErrorPaneProps;
|
|
26
32
|
const generalLoadingPaneStyleProps = Object.assign({}, defaultGeneralLoadingPaneStyleProps, loadingPaneProps === null || loadingPaneProps === void 0 || (_loadingPaneProps$sty = loadingPaneProps.styleProps) === null || _loadingPaneProps$sty === void 0 ? void 0 : _loadingPaneProps$sty.generalStyleProps);
|
|
27
33
|
const loadingPaneStyleProps = {
|
|
28
34
|
...(loadingPaneProps === null || loadingPaneProps === void 0 ? void 0 : loadingPaneProps.styleProps),
|
|
@@ -45,10 +51,9 @@ export const LoadingPaneStateful = props => {
|
|
|
45
51
|
hideSpinner: true,
|
|
46
52
|
hideSpinnerText: true
|
|
47
53
|
};
|
|
48
|
-
const
|
|
49
|
-
height,
|
|
50
|
-
width
|
|
51
|
-
} = useWindowDimensions();
|
|
54
|
+
const _useWindowDimensions = useWindowDimensions(),
|
|
55
|
+
height = _useWindowDimensions.height,
|
|
56
|
+
width = _useWindowDimensions.width;
|
|
52
57
|
|
|
53
58
|
// Move focus to the first button
|
|
54
59
|
useEffect(() => {
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
1
7
|
import { ConfirmationState, NotificationPaneConstants } from "../../common/Constants";
|
|
2
8
|
import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
3
9
|
import React, { useEffect, useRef } from "react";
|
|
@@ -21,14 +27,17 @@ export const NotificationPaneStateful = props => {
|
|
|
21
27
|
Event: TelemetryEvent.UXNotificationPaneStart
|
|
22
28
|
});
|
|
23
29
|
}, []);
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
const notificationPaneProps = props.notificationPaneProps,
|
|
31
|
+
notificationScenarioType = props.notificationScenarioType,
|
|
32
|
+
endChat = props.endChat;
|
|
33
|
+
const _useChatContextStore = useChatContextStore(),
|
|
34
|
+
_useChatContextStore2 = _slicedToArray(_useChatContextStore, 2),
|
|
35
|
+
state = _useChatContextStore2[0],
|
|
36
|
+
dispatch = _useChatContextStore2[1];
|
|
30
37
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
|
-
const
|
|
38
|
+
const _useChatAdapterStore = useChatAdapterStore(),
|
|
39
|
+
_useChatAdapterStore2 = _slicedToArray(_useChatAdapterStore, 1),
|
|
40
|
+
adapter = _useChatAdapterStore2[0];
|
|
32
41
|
const localConfirmationPaneState = useRef(state === null || state === void 0 || (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : _state$domainStates.confirmationState);
|
|
33
42
|
const onCloseChatClick = async () => {
|
|
34
43
|
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
@@ -51,9 +60,7 @@ export const NotificationPaneStateful = props => {
|
|
|
51
60
|
var _state$domainStates2;
|
|
52
61
|
localConfirmationPaneState.current = state === null || state === void 0 || (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : _state$domainStates2.confirmationState;
|
|
53
62
|
}, [state === null || state === void 0 || (_state$domainStates3 = state.domainStates) === null || _state$domainStates3 === void 0 ? void 0 : _state$domainStates3.confirmationState]);
|
|
54
|
-
const
|
|
55
|
-
useDismissNotification
|
|
56
|
-
} = hooks;
|
|
63
|
+
const useDismissNotification = hooks.useDismissNotification;
|
|
57
64
|
const dismissNotification = useDismissNotification();
|
|
58
65
|
const handleDismissNotification = useCallback(() => {
|
|
59
66
|
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
1
7
|
import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
2
8
|
import React, { useEffect } from "react";
|
|
3
9
|
import { createTimer, findAllFocusableElement } from "../../common/utils";
|
|
@@ -17,7 +23,9 @@ export const OutOfOfficeHoursPaneStateful = props => {
|
|
|
17
23
|
Description: "Out of office hours pane loading started."
|
|
18
24
|
});
|
|
19
25
|
}, []);
|
|
20
|
-
const
|
|
26
|
+
const _useChatContextStore = useChatContextStore(),
|
|
27
|
+
_useChatContextStore2 = _slicedToArray(_useChatContextStore, 1),
|
|
28
|
+
state = _useChatContextStore2[0];
|
|
21
29
|
const generalStyleProps = Object.assign({}, defaultGeneralStyleProps, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps);
|
|
22
30
|
const styleProps = {
|
|
23
31
|
...props.styleProps,
|
|
@@ -49,10 +57,9 @@ export const OutOfOfficeHoursPaneStateful = props => {
|
|
|
49
57
|
|
|
50
58
|
// Enhanced titleText sanitization
|
|
51
59
|
if (controlProps !== null && controlProps !== void 0 && controlProps.titleText) {
|
|
52
|
-
const
|
|
53
|
-
cleanText,
|
|
54
|
-
isXSSDetected
|
|
55
|
-
} = detectAndCleanXSS(controlProps.titleText);
|
|
60
|
+
const _detectAndCleanXSS = detectAndCleanXSS(controlProps.titleText),
|
|
61
|
+
cleanText = _detectAndCleanXSS.cleanText,
|
|
62
|
+
isXSSDetected = _detectAndCleanXSS.isXSSDetected;
|
|
56
63
|
if (!isXSSDetected) {
|
|
57
64
|
// replace with the sanitized text
|
|
58
65
|
controlProps.titleText = cleanText;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
1
7
|
import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
2
|
-
import React, { useEffect } from "react";
|
|
8
|
+
import React, { useEffect, useState } from "react";
|
|
3
9
|
import { createTimer, findAllFocusableElement } from "../../common/utils";
|
|
4
10
|
import { LoadingPane } from "@microsoft/omnichannel-chat-components";
|
|
5
11
|
import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
@@ -7,14 +13,28 @@ import { defaultGeneralPostChatLoadingPaneStyleProps } from "./common/defaultgen
|
|
|
7
13
|
import useChatContextStore from "../../hooks/useChatContextStore";
|
|
8
14
|
let uiTimer;
|
|
9
15
|
export const PostChatLoadingPaneStateful = props => {
|
|
10
|
-
var _props$styleProps;
|
|
16
|
+
var _props$controlProps, _props$styleProps;
|
|
17
|
+
const defaultSubtitleText = "Please take a moment to give us feedback about your chat experience. We are loading the survey for you now.";
|
|
18
|
+
const subtitleText = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.subtitleText) ?? defaultSubtitleText;
|
|
19
|
+
const _useState = useState(""),
|
|
20
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
21
|
+
announcedSubtitleText = _useState2[0],
|
|
22
|
+
setAnnouncedSubtitleText = _useState2[1];
|
|
11
23
|
useEffect(() => {
|
|
12
24
|
uiTimer = createTimer();
|
|
13
25
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
14
26
|
Event: TelemetryEvent.UXPostChatLoadingPaneStart
|
|
15
27
|
});
|
|
16
28
|
}, []);
|
|
17
|
-
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const timeout = window.setTimeout(() => {
|
|
31
|
+
setAnnouncedSubtitleText(subtitleText);
|
|
32
|
+
}, 0);
|
|
33
|
+
return () => window.clearTimeout(timeout);
|
|
34
|
+
}, [subtitleText]);
|
|
35
|
+
const _useChatContextStore = useChatContextStore(),
|
|
36
|
+
_useChatContextStore2 = _slicedToArray(_useChatContextStore, 1),
|
|
37
|
+
state = _useChatContextStore2[0];
|
|
18
38
|
const generalStyleProps = Object.assign({}, defaultGeneralPostChatLoadingPaneStyleProps, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps);
|
|
19
39
|
const styleProps = {
|
|
20
40
|
...props.styleProps,
|
|
@@ -27,8 +47,11 @@ export const PostChatLoadingPaneStateful = props => {
|
|
|
27
47
|
hideTitle: true,
|
|
28
48
|
hideSpinner: true,
|
|
29
49
|
hideSpinnerText: true,
|
|
30
|
-
|
|
31
|
-
|
|
50
|
+
...props.controlProps,
|
|
51
|
+
role: "status",
|
|
52
|
+
"aria-live": "polite",
|
|
53
|
+
"aria-atomic": "true",
|
|
54
|
+
subtitleText: announcedSubtitleText
|
|
32
55
|
};
|
|
33
56
|
|
|
34
57
|
// Move focus to the first button
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
1
7
|
import { ConversationStage, LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
2
8
|
import React, { useEffect } from "react";
|
|
3
9
|
import { ParticipantType } from "../../common/Constants";
|
|
@@ -33,7 +39,9 @@ export const PostChatSurveyPaneStateful = props => {
|
|
|
33
39
|
}
|
|
34
40
|
});
|
|
35
41
|
}, []);
|
|
36
|
-
const
|
|
42
|
+
const _useChatContextStore = useChatContextStore(),
|
|
43
|
+
_useChatContextStore2 = _slicedToArray(_useChatContextStore, 1),
|
|
44
|
+
state = _useChatContextStore2[0];
|
|
37
45
|
const generalStyleProps = Object.assign({}, defaultGeneralPostChatSurveyPaneStyleProps, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps, {
|
|
38
46
|
display: state.appStates.isMinimized ? "none" : "contents"
|
|
39
47
|
});
|
|
@@ -58,6 +66,7 @@ export const PostChatSurveyPaneStateful = props => {
|
|
|
58
66
|
};
|
|
59
67
|
const controlProps = {
|
|
60
68
|
id: "oc-lcw-postchatsurvey-pane",
|
|
69
|
+
title: "Post-chat survey",
|
|
61
70
|
surveyURL: ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.surveyURL) ?? surveyInviteLink,
|
|
62
71
|
...props.controlProps
|
|
63
72
|
};
|
|
@@ -96,9 +105,7 @@ export const PostChatSurveyPaneStateful = props => {
|
|
|
96
105
|
//Customer Voice Telemetry Events
|
|
97
106
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
98
107
|
window.addEventListener("message", message => {
|
|
99
|
-
const
|
|
100
|
-
data
|
|
101
|
-
} = message;
|
|
108
|
+
const data = message.data;
|
|
102
109
|
if (!data) return;
|
|
103
110
|
if (data === CustomerVoiceEvents.ResponsePageLoaded) {
|
|
104
111
|
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|