@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
|
@@ -10,27 +10,29 @@ var _react2 = require("@fluentui/react");
|
|
|
10
10
|
var _defaultMiddlewareLocalizedTexts = require("../../../../common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
11
11
|
var _defaultTimestampContentStyles = require("../defaultStyles/defaultTimestampContentStyles");
|
|
12
12
|
var _utils = require("../../../../../../common/utils");
|
|
13
|
-
var
|
|
13
|
+
var _useChatContextStore3 = _interopRequireDefault(require("../../../../../../hooks/useChatContextStore"));
|
|
14
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
16
|
+
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."); }
|
|
17
|
+
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; } }
|
|
18
|
+
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; }
|
|
19
|
+
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; } }
|
|
20
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
15
21
|
/* eslint @typescript-eslint/no-explicit-any: "off" */
|
|
16
22
|
const DeliveredTimestamp = _ref => {
|
|
17
23
|
var _state$domainStates$r, _state$domainStates$r2, _state$domainStates$m;
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
let args = _ref.args,
|
|
25
|
+
role = _ref.role,
|
|
26
|
+
name = _ref.name;
|
|
27
|
+
const _useChatContextStore = (0, _useChatContextStore3.default)(),
|
|
28
|
+
_useChatContextStore2 = _slicedToArray(_useChatContextStore, 1),
|
|
29
|
+
state = _useChatContextStore2[0];
|
|
24
30
|
const dir = ((_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.timestampDir) ?? state.domainStates.globalDir;
|
|
25
31
|
const contentStyles = {
|
|
26
32
|
..._defaultTimestampContentStyles.defaultTimestampContentStyles,
|
|
27
33
|
...((_state$domainStates$r2 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.timestampContentStyleProps)
|
|
28
34
|
};
|
|
29
|
-
const
|
|
30
|
-
activity: {
|
|
31
|
-
timestamp
|
|
32
|
-
}
|
|
33
|
-
} = args;
|
|
35
|
+
const timestamp = args.activity.timestamp;
|
|
34
36
|
const getTimeElement = timestamp => {
|
|
35
37
|
const timeString = (0, _utils.getTimestampHourMinute)(timestamp);
|
|
36
38
|
const isAmPmFormat = timeString.toLowerCase().includes("am") || timeString.toLowerCase().includes("pm");
|
|
@@ -9,25 +9,27 @@ var _react2 = require("@fluentui/react");
|
|
|
9
9
|
var _defaultMiddlewareLocalizedTexts = require("../../../../common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
10
10
|
var _defaultTimestampContentStyles = require("../defaultStyles/defaultTimestampContentStyles");
|
|
11
11
|
var _utils = require("../../../../../../common/utils");
|
|
12
|
-
var
|
|
12
|
+
var _useChatContextStore3 = _interopRequireDefault(require("../../../../../../hooks/useChatContextStore"));
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
15
|
+
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."); }
|
|
16
|
+
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; } }
|
|
17
|
+
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; }
|
|
18
|
+
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; } }
|
|
19
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
14
20
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
21
|
const HistoryMessageTimestamp = _ref => {
|
|
16
22
|
var _state$domainStates$r, _state$domainStates$r2, _state$domainStates$m;
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
let args = _ref.args;
|
|
24
|
+
const _useChatContextStore = (0, _useChatContextStore3.default)(),
|
|
25
|
+
_useChatContextStore2 = _slicedToArray(_useChatContextStore, 1),
|
|
26
|
+
state = _useChatContextStore2[0];
|
|
21
27
|
const dir = ((_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.timestampDir) ?? state.domainStates.globalDir;
|
|
22
|
-
const
|
|
23
|
-
activity
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
role
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
} = args;
|
|
28
|
+
const _args$activity = args.activity,
|
|
29
|
+
timestamp = _args$activity.timestamp,
|
|
30
|
+
_args$activity$from = _args$activity.from,
|
|
31
|
+
name = _args$activity$from.name,
|
|
32
|
+
role = _args$activity$from.role;
|
|
31
33
|
const contentStyles = {
|
|
32
34
|
..._defaultTimestampContentStyles.defaultTimestampContentStyles,
|
|
33
35
|
...((_state$domainStates$r2 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.timestampContentStyleProps)
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.NotDeliveredTimestamp = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _KeyCodes = require("../../../../../../common/KeyCodes");
|
|
9
8
|
var _react2 = require("@fluentui/react");
|
|
10
9
|
var _defaultMiddlewareLocalizedTexts = require("../../../../common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
11
10
|
var _defaultTimestampContentStyles = require("../defaultStyles/defaultTimestampContentStyles");
|
|
@@ -13,31 +12,29 @@ var _defaultTimestampFailedStyles = require("../defaultStyles/defaultTimestampFa
|
|
|
13
12
|
var _defaultTimestampRetryStyles = require("../defaultStyles/defaultTimestampRetryStyles");
|
|
14
13
|
var _utils = require("../../../../../../common/utils");
|
|
15
14
|
var _botframeworkWebchat = require("botframework-webchat");
|
|
16
|
-
var
|
|
15
|
+
var _useChatContextStore3 = _interopRequireDefault(require("../../../../../../hooks/useChatContextStore"));
|
|
17
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
19
|
+
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."); }
|
|
20
|
+
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; } }
|
|
21
|
+
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; }
|
|
22
|
+
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; } }
|
|
23
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } /* eslint-disable @typescript-eslint/no-explicit-any */
|
|
21
24
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
25
|
const NotDeliveredTimestamp = _ref => {
|
|
23
26
|
var _state$domainStates$r, _state$domainStates$r2, _state$domainStates$r3, _state$domainStates$r4, _state$domainStates$m, _state$domainStates$m2;
|
|
24
|
-
let
|
|
25
|
-
args
|
|
26
|
-
} = _ref;
|
|
27
|
+
let args = _ref.args;
|
|
27
28
|
const timestampRef = (0, _react.useRef)();
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
usePostActivity
|
|
31
|
-
} = _botframeworkWebchat.hooks;
|
|
29
|
+
const useFocus = _botframeworkWebchat.hooks.useFocus,
|
|
30
|
+
usePostActivity = _botframeworkWebchat.hooks.usePostActivity;
|
|
32
31
|
const focus = useFocus();
|
|
33
32
|
const postActivity = usePostActivity();
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} = activity;
|
|
40
|
-
const [state] = (0, _useChatContextStore.default)();
|
|
33
|
+
const activity = args.activity;
|
|
34
|
+
const timestamp = activity.timestamp;
|
|
35
|
+
const _useChatContextStore = (0, _useChatContextStore3.default)(),
|
|
36
|
+
_useChatContextStore2 = _slicedToArray(_useChatContextStore, 1),
|
|
37
|
+
state = _useChatContextStore2[0];
|
|
41
38
|
const dir = ((_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.timestampDir) ?? state.domainStates.globalDir;
|
|
42
39
|
const contentStyles = {
|
|
43
40
|
..._defaultTimestampContentStyles.defaultTimestampContentStyles,
|
|
@@ -64,24 +61,15 @@ const NotDeliveredTimestamp = _ref => {
|
|
|
64
61
|
await postActivity(activity);
|
|
65
62
|
focus("sendBox");
|
|
66
63
|
}, [activity, focus, postActivity]);
|
|
67
|
-
const onRetryKeyEnter = event => {
|
|
68
|
-
if (event.code === _KeyCodes.KeyCodes.ENTER) {
|
|
69
|
-
event.preventDefault();
|
|
70
|
-
onRetryClick();
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
64
|
return /*#__PURE__*/_react.default.createElement(_react2.Stack, {
|
|
74
65
|
style: contentStyles,
|
|
75
66
|
dir: dir,
|
|
76
67
|
horizontal: true
|
|
77
68
|
}, /*#__PURE__*/_react.default.createElement("span", null, " ", (0, _utils.getTimestampHourMinute)(timestamp)), /*#__PURE__*/_react.default.createElement("span", null, " \xA0-\xA0 "), /*#__PURE__*/_react.default.createElement("span", {
|
|
78
69
|
style: failedTextStyles
|
|
79
|
-
}, " ", ((_state$domainStates$m = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m === void 0 ? void 0 : _state$domainStates$m.MIDDLEWARE_MESSAGE_NOT_DELIVERED) ?? _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_MESSAGE_NOT_DELIVERED, " "), /*#__PURE__*/_react.default.createElement("span", null, " \xA0-\xA0 "), /*#__PURE__*/_react.default.createElement("
|
|
70
|
+
}, " ", ((_state$domainStates$m = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m === void 0 ? void 0 : _state$domainStates$m.MIDDLEWARE_MESSAGE_NOT_DELIVERED) ?? _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_MESSAGE_NOT_DELIVERED, " "), /*#__PURE__*/_react.default.createElement("span", null, " \xA0-\xA0 "), /*#__PURE__*/_react.default.createElement("button", {
|
|
80
71
|
style: retryTextStyles,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
onKeyDown: onRetryKeyEnter,
|
|
84
|
-
tabIndex: 0
|
|
85
|
-
}, " ", ((_state$domainStates$m2 = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m2 === void 0 ? void 0 : _state$domainStates$m2.MIDDLEWARE_MESSAGE_RETRY) ?? _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_MESSAGE_RETRY, " "));
|
|
72
|
+
onClick: onRetryClick
|
|
73
|
+
}, ((_state$domainStates$m2 = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m2 === void 0 ? void 0 : _state$domainStates$m2.MIDDLEWARE_MESSAGE_RETRY) ?? _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_MESSAGE_RETRY));
|
|
86
74
|
};
|
|
87
75
|
exports.NotDeliveredTimestamp = NotDeliveredTimestamp;
|
|
@@ -8,12 +8,20 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _react2 = require("@fluentui/react");
|
|
9
9
|
var _defaultMiddlewareLocalizedTexts = require("../../../../common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
10
10
|
var _defaultTimestampContentStyles = require("../defaultStyles/defaultTimestampContentStyles");
|
|
11
|
-
var
|
|
11
|
+
var _useChatContextStore3 = _interopRequireDefault(require("../../../../../../hooks/useChatContextStore"));
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
14
|
+
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."); }
|
|
15
|
+
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; } }
|
|
16
|
+
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; }
|
|
17
|
+
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; } }
|
|
18
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
19
|
/* eslint @typescript-eslint/no-explicit-any: "off" */
|
|
14
20
|
const SendingTimestamp = () => {
|
|
15
21
|
var _state$domainStates$r, _state$domainStates$r2, _state$domainStates$m;
|
|
16
|
-
const
|
|
22
|
+
const _useChatContextStore = (0, _useChatContextStore3.default)(),
|
|
23
|
+
_useChatContextStore2 = _slicedToArray(_useChatContextStore, 1),
|
|
24
|
+
state = _useChatContextStore2[0];
|
|
17
25
|
const dir = ((_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.timestampDir) ?? state.domainStates.globalDir;
|
|
18
26
|
const contentStyles = {
|
|
19
27
|
..._defaultTimestampContentStyles.defaultTimestampContentStyles,
|
|
@@ -12,9 +12,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
12
12
|
const createToastMiddleware = (notificationPaneProps, endChat) => {
|
|
13
13
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, react/display-name
|
|
14
14
|
const toastMiddleware = () => next => card => {
|
|
15
|
-
const
|
|
16
|
-
notification
|
|
17
|
-
} = card;
|
|
15
|
+
const notification = card.notification;
|
|
18
16
|
if (notificationPaneProps) {
|
|
19
17
|
if (notification.id === _NotificationScenarios.NotificationScenarios.ChatDisconnect) {
|
|
20
18
|
return /*#__PURE__*/_react.default.createElement(_NotificationPaneStateful.default, {
|
|
@@ -15,21 +15,27 @@ var _ = require("../../../../..");
|
|
|
15
15
|
var _useFacadeChatSDKStore = _interopRequireDefault(require("../../../../../hooks/useFacadeChatSDKStore"));
|
|
16
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
18
|
-
|
|
18
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
19
|
+
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."); }
|
|
20
|
+
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; } }
|
|
21
|
+
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; }
|
|
22
|
+
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; } }
|
|
23
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } /******
|
|
19
24
|
* TypingIndicatorMiddleware
|
|
20
25
|
*
|
|
21
26
|
* This middleware changes the component that shows who's actively typing. It uses the default Microsoft LiveChatWidget styles.
|
|
22
27
|
******/
|
|
23
|
-
|
|
24
28
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
29
|
const TypingIndicator = _ref => {
|
|
26
30
|
var _state$domainStates$l, _state$domainStates$r, _state$domainStates$r2, _state$domainStates$r3;
|
|
27
|
-
let
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
31
|
+
let activeTyping = _ref.activeTyping,
|
|
32
|
+
visible = _ref.visible;
|
|
33
|
+
const _useFacadeSDKStore = (0, _useFacadeChatSDKStore.default)(),
|
|
34
|
+
_useFacadeSDKStore2 = _slicedToArray(_useFacadeSDKStore, 1),
|
|
35
|
+
facadeChatSDK = _useFacadeSDKStore2[0];
|
|
36
|
+
const _useChatContextStore = (0, _.useChatContextStore)(),
|
|
37
|
+
_useChatContextStore2 = _slicedToArray(_useChatContextStore, 1),
|
|
38
|
+
state = _useChatContextStore2[0];
|
|
33
39
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
40
|
const debounceTyping = (0, _react.useCallback)((0, _utils.debounceLeading)(() => facadeChatSDK === null || facadeChatSDK === void 0 ? void 0 : facadeChatSDK.sendTypingEvent()), []);
|
|
35
41
|
if (!activeTyping || Object.keys(activeTyping).length === 0 || ((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : _state$domainStates$l.LiveChatVersion) === 1 && !visible) {
|
|
@@ -108,10 +114,8 @@ const TypingIndicator = _ref => {
|
|
|
108
114
|
|
|
109
115
|
// eslint-disable-next-line react/display-name, @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
|
|
110
116
|
const typingIndicatorMiddleware = () => next => args => {
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
visible
|
|
114
|
-
} = args;
|
|
117
|
+
const activeTyping = args.activeTyping,
|
|
118
|
+
visible = args.visible;
|
|
115
119
|
return /*#__PURE__*/_react.default.createElement(TypingIndicator, {
|
|
116
120
|
activeTyping: activeTyping,
|
|
117
121
|
visible: visible
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
var _IWebChatAction = require("../../../interfaces/IWebChatAction");
|
|
7
8
|
var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
8
9
|
/******
|
|
9
10
|
* AttachmentProcessingMiddleware
|
|
@@ -20,15 +21,14 @@ const createSendFileAction = files => {
|
|
|
20
21
|
type: _WebChatActionType.WebChatActionType.WEB_CHAT_SEND_MESSAGE
|
|
21
22
|
};
|
|
22
23
|
};
|
|
23
|
-
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
24
|
const attachmentProcessingMiddleware = _ref => {
|
|
26
|
-
let
|
|
27
|
-
dispatch
|
|
28
|
-
} = _ref;
|
|
25
|
+
let dispatch = _ref.dispatch;
|
|
29
26
|
return next => async action => {
|
|
30
27
|
var _action$payload;
|
|
31
|
-
if ((
|
|
28
|
+
if (!(0, _IWebChatAction.isWebChatAction)(action)) {
|
|
29
|
+
return next(action);
|
|
30
|
+
}
|
|
31
|
+
if (action.type === _WebChatActionType.WebChatActionType.WEB_CHAT_SEND_MESSAGE && ((_action$payload = action.payload) === null || _action$payload === void 0 || (_action$payload = _action$payload.attachments) === null || _action$payload === void 0 ? void 0 : _action$payload.length) > 0) {
|
|
32
32
|
const files = action.payload.attachments;
|
|
33
33
|
if (files.length === 1) {
|
|
34
34
|
return next(action);
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _IWebChatAction = require("../../../interfaces/IWebChatAction");
|
|
8
|
+
var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
9
|
+
/******
|
|
10
|
+
* AttachmentSentAnnouncementMiddleware
|
|
11
|
+
*
|
|
12
|
+
* When a file attachment is successfully sent, announces the result to
|
|
13
|
+
* screen readers via an aria-live region so that assistive technology
|
|
14
|
+
* users receive immediate feedback.
|
|
15
|
+
******/
|
|
16
|
+
|
|
17
|
+
const ARIA_LIVE_REGION_ID = "oc-lcw-attachment-announcement";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Ensures a visually-hidden aria-live region exists in the DOM for
|
|
21
|
+
* announcing attachment upload results to screen readers.
|
|
22
|
+
*/
|
|
23
|
+
const ensureAriaLiveRegion = () => {
|
|
24
|
+
let region = document.getElementById(ARIA_LIVE_REGION_ID);
|
|
25
|
+
if (!region) {
|
|
26
|
+
region = document.createElement("div");
|
|
27
|
+
region.id = ARIA_LIVE_REGION_ID;
|
|
28
|
+
region.setAttribute("aria-live", "polite");
|
|
29
|
+
region.setAttribute("role", "status");
|
|
30
|
+
region.setAttribute("aria-atomic", "true");
|
|
31
|
+
// Visually hidden but available to screen readers
|
|
32
|
+
Object.assign(region.style, {
|
|
33
|
+
position: "absolute",
|
|
34
|
+
width: "1px",
|
|
35
|
+
height: "1px",
|
|
36
|
+
padding: "0",
|
|
37
|
+
margin: "-1px",
|
|
38
|
+
overflow: "hidden",
|
|
39
|
+
clip: "rect(0, 0, 0, 0)",
|
|
40
|
+
whiteSpace: "nowrap",
|
|
41
|
+
border: "0"
|
|
42
|
+
});
|
|
43
|
+
const container = document.getElementById("oc-lcw-container");
|
|
44
|
+
(container || document.body).appendChild(region);
|
|
45
|
+
}
|
|
46
|
+
return region;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Announces a message to screen readers by updating the aria-live region.
|
|
51
|
+
* Clears it briefly first so repeated identical messages are still announced.
|
|
52
|
+
*/
|
|
53
|
+
const announce = message => {
|
|
54
|
+
const region = ensureAriaLiveRegion();
|
|
55
|
+
region.textContent = "";
|
|
56
|
+
// Small delay so the screen reader detects the content change
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
region.textContent = message;
|
|
59
|
+
}, 100);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
63
|
+
const attachmentSentAnnouncementMiddleware = _ref => {
|
|
64
|
+
let dispatch = _ref.dispatch;
|
|
65
|
+
return next => action => {
|
|
66
|
+
if (!(0, _IWebChatAction.isWebChatAction)(action)) {
|
|
67
|
+
return next(action);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Intercept successfully posted activities that contain attachments
|
|
71
|
+
if (action.type === _WebChatActionType.WebChatActionType.DIRECT_LINE_POST_ACTIVITY_FULFILLED) {
|
|
72
|
+
var _action$payload;
|
|
73
|
+
const attachments = (_action$payload = action.payload) === null || _action$payload === void 0 || (_action$payload = _action$payload.activity) === null || _action$payload === void 0 ? void 0 : _action$payload.attachments;
|
|
74
|
+
if (attachments && attachments.length > 0) {
|
|
75
|
+
const count = attachments.length;
|
|
76
|
+
const message = count === 1 ? "File sent" : `${count} files sent`;
|
|
77
|
+
announce(message);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return next(action);
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
var _default = exports.default = attachmentSentAnnouncementMiddleware;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _TelemetryConstants = require("../../../../../common/telemetry/TelemetryConstants");
|
|
8
8
|
var _Constants = require("../../../../../common/Constants");
|
|
9
|
+
var _IWebChatAction = require("../../../interfaces/IWebChatAction");
|
|
9
10
|
var _NotificationHandler = require("../../notification/NotificationHandler");
|
|
10
11
|
var _NotificationScenarios = require("../../enums/NotificationScenarios");
|
|
11
12
|
var _TelemetryHelper = require("../../../../../common/telemetry/TelemetryHelper");
|
|
@@ -17,6 +18,27 @@ var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
|
17
18
|
******/
|
|
18
19
|
|
|
19
20
|
const MBtoBRatio = 1000000;
|
|
21
|
+
const announceFileSent = message => {
|
|
22
|
+
// TalkBack on Android WebView reliably announces newly *appended*
|
|
23
|
+
// role="alert" nodes but often misses text-content updates on existing
|
|
24
|
+
// nodes. Wait 500ms for the send-box focus shift to settle, then inject
|
|
25
|
+
// a fresh alert element appended to document.body and remove it after 3s.
|
|
26
|
+
setTimeout(() => {
|
|
27
|
+
const el = document.createElement("div");
|
|
28
|
+
el.setAttribute("role", "alert");
|
|
29
|
+
el.setAttribute("aria-live", "assertive");
|
|
30
|
+
el.setAttribute("aria-atomic", "true");
|
|
31
|
+
el.style.cssText = "position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;";
|
|
32
|
+
el.textContent = message;
|
|
33
|
+
document.body.appendChild(el);
|
|
34
|
+
// Remove after TalkBack has had time to read it
|
|
35
|
+
setTimeout(() => {
|
|
36
|
+
if (el.parentNode) {
|
|
37
|
+
el.parentNode.removeChild(el);
|
|
38
|
+
}
|
|
39
|
+
}, 3000);
|
|
40
|
+
}, 500);
|
|
41
|
+
};
|
|
20
42
|
|
|
21
43
|
/*
|
|
22
44
|
* If an attachment is invalid, delete this attachment from the attachments list
|
|
@@ -194,19 +216,25 @@ const getFileSizeErrorMessage = (fileName, maxUploadFileSize, maxFileSizeSupport
|
|
|
194
216
|
return errorMessage ? errorMessage.includes("{2}") ? errorMessage.replace("{2}", textEllipsis(fileName)) : errorMessage : "";
|
|
195
217
|
};
|
|
196
218
|
|
|
197
|
-
// eslint-disable-next-line @typescript-eslint/no-
|
|
219
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
198
220
|
const createAttachmentUploadValidatorMiddleware = (allowedFileExtensions, maxFileSizeSupportedByDynamics, localizedTexts) => _ref => {
|
|
199
|
-
let
|
|
200
|
-
dispatch
|
|
201
|
-
} = _ref;
|
|
221
|
+
let dispatch = _ref.dispatch;
|
|
202
222
|
return next => action => {
|
|
223
|
+
if (!(0, _IWebChatAction.isWebChatAction)(action)) {
|
|
224
|
+
return next(action);
|
|
225
|
+
}
|
|
203
226
|
if (action.type === _WebChatActionType.WebChatActionType.DIRECT_LINE_POST_ACTIVITY) {
|
|
204
227
|
var _payload$activity, _payload$activity2;
|
|
205
|
-
const
|
|
206
|
-
payload
|
|
207
|
-
} = action;
|
|
228
|
+
const payload = action.payload;
|
|
208
229
|
if (payload !== null && payload !== void 0 && payload.activity.attachments && payload.activity.attachments.length > 0 && (payload === null || payload === void 0 || (_payload$activity = payload.activity) === null || _payload$activity === void 0 || (_payload$activity = _payload$activity.attachments) === null || _payload$activity === void 0 ? void 0 : _payload$activity.length) === (payload === null || payload === void 0 || (_payload$activity2 = payload.activity) === null || _payload$activity2 === void 0 || (_payload$activity2 = _payload$activity2.channelData) === null || _payload$activity2 === void 0 || (_payload$activity2 = _payload$activity2.attachmentSizes) === null || _payload$activity2 === void 0 ? void 0 : _payload$activity2.length)) {
|
|
209
|
-
|
|
230
|
+
var _validatedAction$payl;
|
|
231
|
+
const validatedAction = validateAttachment(action, allowedFileExtensions, maxFileSizeSupportedByDynamics, localizedTexts);
|
|
232
|
+
|
|
233
|
+
// Announce to screen readers that the file was sent when validation passes
|
|
234
|
+
if (((_validatedAction$payl = validatedAction.payload) === null || _validatedAction$payl === void 0 || (_validatedAction$payl = _validatedAction$payl.activity) === null || _validatedAction$payl === void 0 || (_validatedAction$payl = _validatedAction$payl.attachments) === null || _validatedAction$payl === void 0 ? void 0 : _validatedAction$payl.length) > 0) {
|
|
235
|
+
announceFileSent(localizedTexts.MIDDLEWARE_BANNER_FILE_SENT ?? "File sent successfully.");
|
|
236
|
+
}
|
|
237
|
+
return next(validatedAction);
|
|
210
238
|
}
|
|
211
239
|
}
|
|
212
240
|
return next(action);
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
var _IWebChatAction = require("../../../interfaces/IWebChatAction");
|
|
7
8
|
var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
8
9
|
/******
|
|
9
10
|
* CallActionMiddleware
|
|
@@ -11,8 +12,11 @@ var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
|
11
12
|
* Intercepts custom call actions and handles tel: URL navigation
|
|
12
13
|
******/
|
|
13
14
|
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
15
15
|
const createCallActionMiddleware = () => () => next => action => {
|
|
16
|
+
if (!(0, _IWebChatAction.isWebChatAction)(action)) {
|
|
17
|
+
return next(action);
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
// Intercept incoming activities to modify suggested actions with call type
|
|
17
21
|
if (action.type === _WebChatActionType.WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY) {
|
|
18
22
|
var _action$payload, _activity$suggestedAc;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _Constants = require("../../../../../common/Constants");
|
|
8
8
|
var _omnichannelChatSdk = require("@microsoft/omnichannel-chat-sdk");
|
|
9
|
+
var _IWebChatAction = require("../../../interfaces/IWebChatAction");
|
|
9
10
|
var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
10
11
|
/******
|
|
11
12
|
* ChannelDataMiddleware
|
|
@@ -15,12 +16,13 @@ var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
|
15
16
|
|
|
16
17
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
17
18
|
const channelDataMiddleware = addConversationalSurveyTagsCallback => _ref => {
|
|
18
|
-
let
|
|
19
|
-
dispatch
|
|
20
|
-
} = _ref;
|
|
19
|
+
let dispatch = _ref.dispatch;
|
|
21
20
|
return next => action => {
|
|
22
|
-
var _action
|
|
23
|
-
if ((
|
|
21
|
+
var _action$payload;
|
|
22
|
+
if (!(0, _IWebChatAction.isWebChatAction)(action)) {
|
|
23
|
+
return next(action);
|
|
24
|
+
}
|
|
25
|
+
if (action.type === _WebChatActionType.WebChatActionType.DIRECT_LINE_POST_ACTIVITY_PENDING && (_action$payload = action.payload) !== null && _action$payload !== void 0 && (_action$payload = _action$payload.activity) !== null && _action$payload !== void 0 && _action$payload.channelData) {
|
|
24
26
|
const channelIdTag = `${_Constants.Constants.channelIdKey}${_Constants.Constants.ChannelId}`;
|
|
25
27
|
const customerMessageTag = `${_Constants.Constants.CustomerTag}`;
|
|
26
28
|
if (action.payload.activity.channelData.tags) {
|
|
@@ -34,10 +36,11 @@ const channelDataMiddleware = addConversationalSurveyTagsCallback => _ref => {
|
|
|
34
36
|
action.payload.activity.channelData.tags = [channelIdTag];
|
|
35
37
|
action.payload.activity.channelData.tags.push(customerMessageTag);
|
|
36
38
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
const updatedAction = addConversationalSurveyTagsCallback(action);
|
|
40
|
+
updatedAction.payload.activity.channelData.metadata = {
|
|
39
41
|
deliveryMode: _omnichannelChatSdk.DeliveryMode.Bridged
|
|
40
42
|
};
|
|
43
|
+
return next(updatedAction);
|
|
41
44
|
}
|
|
42
45
|
return next(action);
|
|
43
46
|
};
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.createCitationsMiddleware = void 0;
|
|
7
7
|
var _TelemetryConstants = require("../../../../../common/telemetry/TelemetryConstants");
|
|
8
|
+
var _IWebChatAction = require("../../../interfaces/IWebChatAction");
|
|
8
9
|
var _LiveChatWidgetActionType = require("../../../../../contexts/common/LiveChatWidgetActionType");
|
|
9
10
|
var _TelemetryHelper = require("../../../../../common/telemetry/TelemetryHelper");
|
|
10
11
|
var _createReducer = require("../../../../../contexts/createReducer");
|
|
@@ -15,6 +16,9 @@ var _createReducer = require("../../../../../contexts/createReducer");
|
|
|
15
16
|
|
|
16
17
|
const createCitationsMiddleware = (state, dispatch) => () => next => action => {
|
|
17
18
|
var _action$payload;
|
|
19
|
+
if (!(0, _IWebChatAction.isWebChatAction)(action)) {
|
|
20
|
+
return next(action);
|
|
21
|
+
}
|
|
18
22
|
if ((_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.activity) {
|
|
19
23
|
if (isApplicable(action)) {
|
|
20
24
|
try {
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _Constants = require("../../../../../common/Constants");
|
|
8
8
|
var _DirectLineSenderRole = require("../../enums/DirectLineSenderRole");
|
|
9
|
+
var _IWebChatAction = require("../../../interfaces/IWebChatAction");
|
|
9
10
|
var _MessageType = require("../../enums/MessageType");
|
|
10
11
|
var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
11
12
|
/******
|
|
@@ -17,12 +18,13 @@ var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
|
17
18
|
|
|
18
19
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
19
20
|
const createConversationEndMiddleware = (conversationEndCallback, startConversationalSurveyCallback, endConversationalSurveyCallback) => _ref => {
|
|
20
|
-
let
|
|
21
|
-
dispatch
|
|
22
|
-
} = _ref;
|
|
21
|
+
let dispatch = _ref.dispatch;
|
|
23
22
|
return next => action => {
|
|
24
23
|
var _action$payload;
|
|
25
|
-
if ((
|
|
24
|
+
if (!(0, _IWebChatAction.isWebChatAction)(action)) {
|
|
25
|
+
return next(action);
|
|
26
|
+
}
|
|
27
|
+
if (action.type == _WebChatActionType.WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY && (_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.activity) {
|
|
26
28
|
var _activity$from2, _activity$channelData9, _activity$channelData0;
|
|
27
29
|
const activity = action.payload.activity;
|
|
28
30
|
if (activity.channelId === "ACS_CHANNEL") {
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.isValidCustomEvent = exports.default = void 0;
|
|
7
7
|
var _Constants = require("../../../../../common/Constants");
|
|
8
|
+
var _IWebChatAction = require("../../../interfaces/IWebChatAction");
|
|
8
9
|
var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
9
10
|
/******
|
|
10
11
|
* CustomEventMiddleware
|
|
@@ -20,7 +21,10 @@ const isValidCustomEvent = activity => {
|
|
|
20
21
|
exports.isValidCustomEvent = isValidCustomEvent;
|
|
21
22
|
const createCustomEventMiddleware = broadcastservice => () => next => action => {
|
|
22
23
|
var _action$payload;
|
|
23
|
-
if ((
|
|
24
|
+
if (!(0, _IWebChatAction.isWebChatAction)(action)) {
|
|
25
|
+
return next(action);
|
|
26
|
+
}
|
|
27
|
+
if (action.type == _WebChatActionType.WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY && (_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.activity) {
|
|
24
28
|
const activity = action.payload.activity;
|
|
25
29
|
if (isValidCustomEvent(activity)) {
|
|
26
30
|
const customEvent = {
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _TelemetryConstants = require("../../../../../common/telemetry/TelemetryConstants");
|
|
8
|
+
var _IWebChatAction = require("../../../interfaces/IWebChatAction");
|
|
8
9
|
var _TelemetryHelper = require("../../../../../common/telemetry/TelemetryHelper");
|
|
9
10
|
var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
10
11
|
var _isMaskingFromCustomer = require("../../../common/utils/isMaskingFromCustomer");
|
|
@@ -16,9 +17,7 @@ var _isMaskingFromCustomer = require("../../../common/utils/isMaskingFromCustome
|
|
|
16
17
|
|
|
17
18
|
const applyDataMasking = (action, regexCollection) => {
|
|
18
19
|
const maskedChar = "#"; //to do: load from env once OC SDK supporting.
|
|
19
|
-
let
|
|
20
|
-
text
|
|
21
|
-
} = action.payload;
|
|
20
|
+
let text = action.payload.text;
|
|
22
21
|
if (!regexCollection) {
|
|
23
22
|
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
24
23
|
Event: _TelemetryConstants.TelemetryEvent.InvalidConfiguration,
|
|
@@ -78,13 +77,14 @@ const applyDataMasking = (action, regexCollection) => {
|
|
|
78
77
|
return action;
|
|
79
78
|
};
|
|
80
79
|
|
|
81
|
-
// eslint-disable-next-line @typescript-eslint/no-
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
82
81
|
const createDataMaskingMiddleware = dataMaskingInfo => _ref => {
|
|
83
|
-
let
|
|
84
|
-
dispatch
|
|
85
|
-
} = _ref;
|
|
82
|
+
let dispatch = _ref.dispatch;
|
|
86
83
|
return next => action => {
|
|
87
84
|
var _action$payload;
|
|
85
|
+
if (!(0, _IWebChatAction.isWebChatAction)(action)) {
|
|
86
|
+
return next(action);
|
|
87
|
+
}
|
|
88
88
|
if ((0, _isMaskingFromCustomer.isMaskingforCustomer)(dataMaskingInfo) && (_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.text && action.type === _WebChatActionType.WebChatActionType.WEB_CHAT_SEND_MESSAGE) {
|
|
89
89
|
const regexCollection = dataMaskingInfo === null || dataMaskingInfo === void 0 ? void 0 : dataMaskingInfo.dataMaskingRules;
|
|
90
90
|
return next(applyDataMasking(action, regexCollection));
|