botframework-webchat-component 4.13.0 → 4.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.yml +4 -100
- package/.prettierrc.yml +1 -1
- package/lib/Activity/Avatar.d.ts +10 -0
- package/lib/Activity/Avatar.d.ts.map +1 -0
- package/lib/Activity/Avatar.js +2 -1
- package/lib/Activity/Bubble.d.ts +11 -0
- package/lib/Activity/Bubble.d.ts.map +1 -0
- package/lib/Activity/Bubble.js +2 -2
- package/lib/Activity/CarouselFilmStrip.js +21 -31
- package/lib/Activity/CarouselFilmStripAttachment.js +120 -0
- package/lib/Activity/CarouselLayout.js +5 -5
- package/lib/Activity/Speak.d.ts +10 -0
- package/lib/Activity/Speak.d.ts.map +1 -0
- package/lib/Activity/Speak.js +11 -13
- package/lib/Activity/StackedLayout.d.ts +18 -0
- package/lib/Activity/StackedLayout.d.ts.map +1 -0
- package/lib/Activity/StackedLayout.js +19 -15
- package/lib/Assets/TypingAnimation.js +2 -2
- package/lib/Attachment/Assets/DownloadIcon.js +3 -1
- package/lib/Attachment/AudioAttachment.js +2 -2
- package/lib/Attachment/AudioContent.d.ts +11 -0
- package/lib/Attachment/AudioContent.d.ts.map +1 -0
- package/lib/Attachment/AudioContent.js +4 -4
- package/lib/Attachment/FileAttachment.js +2 -2
- package/lib/Attachment/FileContent.d.ts +10 -0
- package/lib/Attachment/FileContent.d.ts.map +1 -0
- package/lib/Attachment/FileContent.js +14 -9
- package/lib/Attachment/HTMLVideoContent.d.ts +11 -0
- package/lib/Attachment/HTMLVideoContent.d.ts.map +1 -0
- package/lib/Attachment/HTMLVideoContent.js +2 -2
- package/lib/Attachment/ImageContent.d.ts +8 -0
- package/lib/Attachment/ImageContent.d.ts.map +1 -0
- package/lib/Attachment/ImageContent.js +2 -2
- package/lib/Attachment/TextContent.d.ts +8 -0
- package/lib/Attachment/TextContent.d.ts.map +1 -0
- package/lib/Attachment/TextContent.js +4 -4
- package/lib/Attachment/VideoAttachment.js +2 -2
- package/lib/Attachment/VideoContent.d.ts +11 -0
- package/lib/Attachment/VideoContent.d.ts.map +1 -0
- package/lib/Attachment/VideoContent.js +1 -1
- package/lib/Attachment/VimeoContent.d.ts +10 -0
- package/lib/Attachment/VimeoContent.d.ts.map +1 -0
- package/lib/Attachment/VimeoContent.js +8 -8
- package/lib/Attachment/YouTubeContent.d.ts +10 -0
- package/lib/Attachment/YouTubeContent.d.ts.map +1 -0
- package/lib/Attachment/YouTubeContent.js +5 -5
- package/lib/Avatar/ImageAvatar.js +2 -2
- package/lib/Avatar/InitialsAvatar.js +2 -2
- package/lib/BasicConnectivityStatus.js +2 -2
- package/lib/BasicSendBox.d.ts +9 -0
- package/lib/BasicSendBox.d.ts.map +1 -0
- package/lib/BasicSendBox.js +7 -6
- package/lib/BasicToast.js +4 -4
- package/lib/BasicToaster.js +8 -5
- package/lib/BasicTranscript.d.ts +7 -0
- package/lib/BasicTranscript.d.ts.map +1 -0
- package/lib/BasicTranscript.js +406 -743
- package/lib/BasicTypingIndicator.d.ts +6 -0
- package/lib/BasicTypingIndicator.d.ts.map +1 -0
- package/lib/BasicTypingIndicator.js +13 -5
- package/lib/BasicWebChat.d.ts +9 -0
- package/lib/BasicWebChat.d.ts.map +1 -0
- package/lib/BasicWebChat.js +6 -4
- package/lib/Composer.d.ts +23 -0
- package/lib/Composer.d.ts.map +1 -0
- package/lib/Composer.js +65 -82
- package/lib/ConnectivityStatus/Assets/ErrorNotificationIcon.js +2 -2
- package/lib/ConnectivityStatus/Assets/SpinnerAnimation.js +2 -2
- package/lib/ConnectivityStatus/Assets/WarningNotificationIcon.js +2 -2
- package/lib/ConnectivityStatus/Connected.js +1 -1
- package/lib/ConnectivityStatus/Connecting.js +4 -4
- package/lib/ConnectivityStatus/FailedToConnect.js +2 -2
- package/lib/ConnectivityStatus/JavaScriptError.js +2 -2
- package/lib/Dictation.js +13 -4
- package/lib/ErrorBox.d.ts +8 -0
- package/lib/ErrorBox.d.ts.map +1 -0
- package/lib/ErrorBox.js +2 -2
- package/lib/Middleware/Activity/createCoreMiddleware.d.ts +3 -0
- package/lib/Middleware/Activity/createCoreMiddleware.d.ts.map +1 -0
- package/lib/Middleware/Activity/createCoreMiddleware.js +1 -1
- package/lib/Middleware/ActivityStatus/AbsoluteTime.js +1 -1
- package/lib/Middleware/ActivityStatus/RelativeTime.js +1 -1
- package/lib/Middleware/ActivityStatus/SendStatus/SendFailedRetry.js +3 -3
- package/lib/Middleware/ActivityStatus/SendStatus/SendStatus.d.ts +11 -0
- package/lib/Middleware/ActivityStatus/SendStatus/SendStatus.d.ts.map +1 -0
- package/lib/Middleware/ActivityStatus/SendStatus/SendStatus.js +5 -5
- package/lib/Middleware/ActivityStatus/Timestamp.d.ts +9 -0
- package/lib/Middleware/ActivityStatus/Timestamp.d.ts.map +1 -0
- package/lib/Middleware/ActivityStatus/Timestamp.js +2 -2
- package/lib/Middleware/ActivityStatus/createCoreMiddleware.d.ts +3 -0
- package/lib/Middleware/ActivityStatus/createCoreMiddleware.d.ts.map +1 -0
- package/lib/Middleware/ActivityStatus/createCoreMiddleware.js +1 -1
- package/lib/Middleware/ActivityStatus/createSendStatusMiddleware.js +21 -16
- package/lib/Middleware/ActivityStatus/createTimestampMiddleware.js +1 -1
- package/lib/Middleware/Attachment/createCoreMiddleware.d.ts +3 -0
- package/lib/Middleware/Attachment/createCoreMiddleware.d.ts.map +1 -0
- package/lib/Middleware/Attachment/createCoreMiddleware.js +10 -13
- package/lib/Middleware/AttachmentForScreenReader/AudioAttachment.js +1 -1
- package/lib/Middleware/AttachmentForScreenReader/FileAttachment.js +1 -1
- package/lib/Middleware/AttachmentForScreenReader/ImageAttachment.js +1 -1
- package/lib/Middleware/AttachmentForScreenReader/TextAttachment.js +1 -1
- package/lib/Middleware/AttachmentForScreenReader/VideoAttachment.js +1 -1
- package/lib/Middleware/AttachmentForScreenReader/createCoreMiddleware.d.ts +3 -0
- package/lib/Middleware/AttachmentForScreenReader/createCoreMiddleware.d.ts.map +1 -0
- package/lib/Middleware/AttachmentForScreenReader/createCoreMiddleware.js +9 -5
- package/lib/Middleware/Avatar/createCoreMiddleware.d.ts +11 -0
- package/lib/Middleware/Avatar/createCoreMiddleware.d.ts.map +1 -0
- package/lib/Middleware/Avatar/createCoreMiddleware.js +3 -4
- package/lib/Middleware/CardAction/createCoreMiddleware.js +11 -4
- package/lib/Middleware/GroupActivities/createCoreMiddleware.js +1 -1
- package/lib/Middleware/ScrollToEndButton/ScrollToEndButton.js +71 -0
- package/lib/Middleware/ScrollToEndButton/createScrollToEndButtonMiddleware.d.ts +3 -0
- package/lib/Middleware/ScrollToEndButton/createScrollToEndButtonMiddleware.d.ts.map +1 -0
- package/lib/Middleware/ScrollToEndButton/createScrollToEndButtonMiddleware.js +27 -0
- package/lib/Middleware/Toast/createCoreMiddleware.d.ts +4 -0
- package/lib/Middleware/Toast/createCoreMiddleware.d.ts.map +1 -0
- package/lib/Middleware/Toast/createCoreMiddleware.js +1 -1
- package/lib/Middleware/TypingIndicator/createCoreMiddleware.d.ts +3 -0
- package/lib/Middleware/TypingIndicator/createCoreMiddleware.d.ts.map +1 -0
- package/lib/Middleware/TypingIndicator/createCoreMiddleware.js +9 -6
- package/lib/ReactWebChat.d.ts +10 -0
- package/lib/ReactWebChat.d.ts.map +1 -0
- package/lib/ReactWebChat.js +19 -7
- package/lib/ScreenReaderActivity.js +76 -48
- package/lib/ScreenReaderText.d.ts +9 -0
- package/lib/ScreenReaderText.d.ts.map +1 -0
- package/lib/ScreenReaderText.js +22 -8
- package/lib/SendBox/Assets/AttachmentIcon.js +3 -1
- package/lib/SendBox/Assets/MicrophoneIcon.js +3 -1
- package/lib/SendBox/Assets/SendIcon.js +2 -2
- package/lib/SendBox/AutoResizeTextArea.d.ts +23 -0
- package/lib/SendBox/AutoResizeTextArea.d.ts.map +1 -0
- package/lib/SendBox/AutoResizeTextArea.js +6 -6
- package/lib/SendBox/DictationInterims.d.ts +9 -0
- package/lib/SendBox/DictationInterims.d.ts.map +1 -0
- package/lib/SendBox/DictationInterims.js +3 -3
- package/lib/SendBox/IconButton.d.ts +11 -0
- package/lib/SendBox/IconButton.d.ts.map +1 -0
- package/lib/SendBox/IconButton.js +27 -7
- package/lib/SendBox/MicrophoneButton.d.ts +11 -0
- package/lib/SendBox/MicrophoneButton.d.ts.map +1 -0
- package/lib/SendBox/MicrophoneButton.js +25 -24
- package/lib/SendBox/SendButton.d.ts +9 -0
- package/lib/SendBox/SendButton.d.ts.map +1 -0
- package/lib/SendBox/SendButton.js +8 -6
- package/lib/SendBox/SuggestedAction.d.ts +17 -0
- package/lib/SendBox/SuggestedAction.d.ts.map +1 -0
- package/lib/SendBox/SuggestedAction.js +29 -24
- package/lib/SendBox/SuggestedActions.d.ts +5 -0
- package/lib/SendBox/SuggestedActions.d.ts.map +1 -0
- package/lib/SendBox/SuggestedActions.js +33 -13
- package/lib/SendBox/TextBox.d.ts +28 -0
- package/lib/SendBox/TextBox.d.ts.map +1 -0
- package/lib/SendBox/TextBox.js +13 -8
- package/lib/SendBox/UploadButton.d.ts +9 -0
- package/lib/SendBox/UploadButton.d.ts.map +1 -0
- package/lib/SendBox/UploadButton.js +6 -6
- package/lib/Styles/StyleSet/Activities.d.ts +5 -0
- package/lib/Styles/StyleSet/Activities.d.ts.map +1 -0
- package/lib/Styles/StyleSet/AudioAttachment.d.ts +6 -0
- package/lib/Styles/StyleSet/AudioAttachment.d.ts.map +1 -0
- package/lib/Styles/StyleSet/AudioContent.d.ts +4 -0
- package/lib/Styles/StyleSet/AudioContent.d.ts.map +1 -0
- package/lib/Styles/StyleSet/AutoResizeTextArea.d.ts +37 -0
- package/lib/Styles/StyleSet/AutoResizeTextArea.d.ts.map +1 -0
- package/lib/Styles/StyleSet/Avatar.d.ts +9 -0
- package/lib/Styles/StyleSet/Avatar.d.ts.map +1 -0
- package/lib/Styles/StyleSet/BasicTranscript.d.ts +85 -0
- package/lib/Styles/StyleSet/BasicTranscript.d.ts.map +1 -0
- package/lib/Styles/StyleSet/BasicTranscript.js +21 -9
- package/lib/Styles/StyleSet/Bubble.d.ts +5 -0
- package/lib/Styles/StyleSet/Bubble.d.ts.map +1 -0
- package/lib/Styles/StyleSet/Bubble.js +2 -2
- package/lib/Styles/StyleSet/CarouselFilmStrip.d.ts +5 -0
- package/lib/Styles/StyleSet/CarouselFilmStrip.d.ts.map +1 -0
- package/lib/Styles/StyleSet/CarouselFilmStrip.js +2 -18
- package/lib/Styles/StyleSet/CarouselFilmStripAttachment.d.ts +3 -0
- package/lib/Styles/StyleSet/CarouselFilmStripAttachment.d.ts.map +1 -0
- package/lib/Styles/StyleSet/CarouselFilmStripAttachment.js +63 -0
- package/lib/Styles/StyleSet/CarouselFlipper.d.ts +27 -0
- package/lib/Styles/StyleSet/CarouselFlipper.d.ts.map +1 -0
- package/lib/Styles/StyleSet/ConnectivityNotification.d.ts +13 -0
- package/lib/Styles/StyleSet/ConnectivityNotification.d.ts.map +1 -0
- package/lib/Styles/StyleSet/DictationInterims.d.ts +13 -0
- package/lib/Styles/StyleSet/DictationInterims.d.ts.map +1 -0
- package/lib/Styles/StyleSet/ErrorBox.d.ts +33 -0
- package/lib/Styles/StyleSet/ErrorBox.d.ts.map +1 -0
- package/lib/Styles/StyleSet/ErrorNotification.d.ts +23 -0
- package/lib/Styles/StyleSet/ErrorNotification.d.ts.map +1 -0
- package/lib/Styles/StyleSet/FileContent.d.ts +32 -0
- package/lib/Styles/StyleSet/FileContent.d.ts.map +1 -0
- package/lib/Styles/StyleSet/ImageAvatar.d.ts +7 -0
- package/lib/Styles/StyleSet/ImageAvatar.d.ts.map +1 -0
- package/lib/Styles/StyleSet/InitialsAvatar.d.ts +19 -0
- package/lib/Styles/StyleSet/InitialsAvatar.d.ts.map +1 -0
- package/lib/Styles/StyleSet/KeyboardHelp.d.ts +123 -0
- package/lib/Styles/StyleSet/KeyboardHelp.d.ts.map +1 -0
- package/lib/Styles/StyleSet/KeyboardHelp.js +145 -0
- package/lib/Styles/StyleSet/MicrophoneButton.d.ts +13 -0
- package/lib/Styles/StyleSet/MicrophoneButton.d.ts.map +1 -0
- package/lib/Styles/StyleSet/Root.d.ts +8 -0
- package/lib/Styles/StyleSet/Root.d.ts.map +1 -0
- package/lib/Styles/StyleSet/ScrollToEndButton.d.ts +36 -0
- package/lib/Styles/StyleSet/ScrollToEndButton.d.ts.map +1 -0
- package/lib/Styles/StyleSet/ScrollToEndButton.js +36 -34
- package/lib/Styles/StyleSet/SendBox.d.ts +24 -0
- package/lib/Styles/StyleSet/SendBox.d.ts.map +1 -0
- package/lib/Styles/StyleSet/SendBoxButton.d.ts +79 -0
- package/lib/Styles/StyleSet/SendBoxButton.d.ts.map +1 -0
- package/lib/Styles/StyleSet/SendBoxButton.js +76 -12
- package/lib/Styles/StyleSet/SendBoxTextBox.d.ts +41 -0
- package/lib/Styles/StyleSet/SendBoxTextBox.d.ts.map +1 -0
- package/lib/Styles/StyleSet/SendBoxTextBox.js +3 -3
- package/lib/Styles/StyleSet/SendStatus.d.ts +8 -0
- package/lib/Styles/StyleSet/SendStatus.d.ts.map +1 -0
- package/lib/Styles/StyleSet/SingleAttachmentActivity.d.ts +11 -0
- package/lib/Styles/StyleSet/SingleAttachmentActivity.d.ts.map +1 -0
- package/lib/Styles/StyleSet/SpinnerAnimation.d.ts +15 -0
- package/lib/Styles/StyleSet/SpinnerAnimation.d.ts.map +1 -0
- package/lib/Styles/StyleSet/StackedLayout.d.ts +63 -0
- package/lib/Styles/StyleSet/StackedLayout.d.ts.map +1 -0
- package/lib/Styles/StyleSet/StackedLayout.js +1 -1
- package/lib/Styles/StyleSet/SuggestedAction.d.ts +94 -0
- package/lib/Styles/StyleSet/SuggestedAction.d.ts.map +1 -0
- package/lib/Styles/StyleSet/SuggestedAction.js +116 -41
- package/lib/Styles/StyleSet/SuggestedActions.d.ts +125 -0
- package/lib/Styles/StyleSet/SuggestedActions.d.ts.map +1 -0
- package/lib/Styles/StyleSet/SuggestedActions.js +13 -6
- package/lib/Styles/StyleSet/TextContent.d.ts +28 -0
- package/lib/Styles/StyleSet/TextContent.d.ts.map +1 -0
- package/lib/Styles/StyleSet/Toast.d.ts +65 -0
- package/lib/Styles/StyleSet/Toast.d.ts.map +1 -0
- package/lib/Styles/StyleSet/Toaster.d.ts +111 -0
- package/lib/Styles/StyleSet/Toaster.d.ts.map +1 -0
- package/lib/Styles/StyleSet/TypingAnimation.d.ts +8 -0
- package/lib/Styles/StyleSet/TypingAnimation.d.ts.map +1 -0
- package/lib/Styles/StyleSet/TypingIndicator.d.ts +11 -0
- package/lib/Styles/StyleSet/TypingIndicator.d.ts.map +1 -0
- package/lib/Styles/StyleSet/UploadButton.d.ts +14 -0
- package/lib/Styles/StyleSet/UploadButton.d.ts.map +1 -0
- package/lib/Styles/StyleSet/VideoAttachment.d.ts +2 -0
- package/lib/Styles/StyleSet/VideoAttachment.d.ts.map +1 -0
- package/lib/Styles/StyleSet/VideoContent.d.ts +6 -0
- package/lib/Styles/StyleSet/VideoContent.d.ts.map +1 -0
- package/lib/Styles/StyleSet/VimeoContent.d.ts +7 -0
- package/lib/Styles/StyleSet/VimeoContent.d.ts.map +1 -0
- package/lib/Styles/StyleSet/WarningNotification.d.ts +22 -0
- package/lib/Styles/StyleSet/WarningNotification.d.ts.map +1 -0
- package/lib/Styles/StyleSet/YouTubeContent.d.ts +7 -0
- package/lib/Styles/StyleSet/YouTubeContent.d.ts.map +1 -0
- package/lib/Styles/createStyleSet.d.ts +1372 -0
- package/lib/Styles/createStyleSet.d.ts.map +1 -0
- package/lib/Styles/createStyleSet.js +47 -41
- package/lib/Styles/mirrorStyle.js +13 -4
- package/lib/Toast/CollapseIcon.js +3 -1
- package/lib/Toast/DismissIcon.js +3 -1
- package/lib/Toast/ExpandIcon.js +3 -1
- package/lib/Toast/NotificationIcon.js +7 -3
- package/lib/Toast/createToastMiddleware.d.ts +4 -0
- package/lib/Toast/createToastMiddleware.d.ts.map +1 -0
- package/lib/Toast/createToastMiddleware.js +2 -2
- package/lib/Transcript/ActivityRow.d.ts +9 -0
- package/lib/Transcript/ActivityRow.d.ts.map +1 -0
- package/lib/Transcript/ActivityRow.js +157 -0
- package/lib/Transcript/ActivityTextAlt.js +57 -0
- package/lib/Transcript/FocusTrap.d.ts +8 -0
- package/lib/Transcript/FocusTrap.d.ts.map +1 -0
- package/lib/Transcript/FocusTrap.js +74 -0
- package/lib/Transcript/KeyboardHelp.d.ts +4 -0
- package/lib/Transcript/KeyboardHelp.d.ts.map +1 -0
- package/lib/Transcript/KeyboardHelp.js +550 -0
- package/lib/Transcript/LiveRegionTranscript.d.ts +8 -0
- package/lib/Transcript/LiveRegionTranscript.d.ts.map +1 -0
- package/lib/Transcript/LiveRegionTranscript.js +214 -0
- package/lib/Transcript/types.d.ts +2 -0
- package/lib/Transcript/types.d.ts.map +1 -0
- package/lib/Transcript/types.js +2 -0
- package/lib/Transcript/useActivityAccessibleName.d.ts +4 -0
- package/lib/Transcript/useActivityAccessibleName.d.ts.map +1 -0
- package/lib/Transcript/useActivityAccessibleName.js +97 -0
- package/lib/Utils/AccessKeySink/Surface.js +7 -5
- package/lib/Utils/AccessibleButton.d.ts +11 -0
- package/lib/Utils/AccessibleButton.d.ts.map +1 -0
- package/lib/Utils/AccessibleButton.js +15 -8
- package/lib/Utils/AccessibleInputText.d.ts +21 -0
- package/lib/Utils/AccessibleInputText.d.ts.map +1 -0
- package/lib/Utils/AccessibleInputText.js +29 -25
- package/lib/Utils/AccessibleTextArea.d.ts +20 -0
- package/lib/Utils/AccessibleTextArea.d.ts.map +1 -0
- package/lib/Utils/AccessibleTextArea.js +35 -24
- package/lib/Utils/CroppedImage.js +2 -2
- package/lib/Utils/Fade.js +2 -2
- package/lib/Utils/FocusRedirector.d.ts +9 -0
- package/lib/Utils/FocusRedirector.d.ts.map +1 -0
- package/lib/Utils/FocusRedirector.js +18 -15
- package/lib/Utils/InlineMarkdown.js +17 -10
- package/lib/Utils/TypeFocusSink/FocusBox.js +6 -4
- package/lib/Utils/TypeFocusSink/getTabIndex.d.ts +2 -0
- package/lib/Utils/TypeFocusSink/getTabIndex.d.ts.map +1 -0
- package/lib/Utils/TypeFocusSink/getTabIndex.js +1 -1
- package/lib/Utils/TypeFocusSink/inputtableKey.d.ts +2 -0
- package/lib/Utils/TypeFocusSink/inputtableKey.d.ts.map +1 -0
- package/lib/Utils/TypeFocusSink/inputtableKey.js +5 -2
- package/lib/Utils/TypeFocusSink/navigableEvent.js +1 -1
- package/lib/Utils/activityAltText.d.ts +8 -0
- package/lib/Utils/activityAltText.d.ts.map +1 -0
- package/lib/Utils/activityAltText.js +100 -0
- package/lib/Utils/addTargetBlankToHyperlinksMarkdown.js +1 -1
- package/lib/Utils/createCustomEvent.js +9 -3
- package/lib/Utils/debounce.js +1 -1
- package/lib/Utils/detectBrowser.js +4 -2
- package/lib/Utils/downscaleImageToDataURL/downscaleImageToDataURLUsingWorker.js +3 -3
- package/lib/Utils/downscaleImageToDataURL/index.js +2 -2
- package/lib/Utils/filterMap.js +1 -1
- package/lib/Utils/findAncestor.js +17 -0
- package/lib/Utils/getActivityUniqueId.js +4 -2
- package/lib/Utils/intersectionOf.d.ts +5 -0
- package/lib/Utils/intersectionOf.d.ts.map +1 -0
- package/lib/Utils/intersectionOf.js +17 -2
- package/lib/Utils/isZeroOrPositive.d.ts +5 -0
- package/lib/Utils/isZeroOrPositive.d.ts.map +1 -0
- package/lib/Utils/isZeroOrPositive.js +4 -1
- package/lib/Utils/mapMap.js +10 -3
- package/lib/Utils/readDataURIToBlob.js +3 -3
- package/lib/Utils/scrollIntoViewWithBlockNearest.d.ts +7 -0
- package/lib/Utils/scrollIntoViewWithBlockNearest.d.ts.map +1 -0
- package/lib/Utils/scrollIntoViewWithBlockNearest.js +48 -0
- package/lib/Utils/shallowEquals.js +7 -3
- package/lib/Utils/singleToArray.js +1 -1
- package/lib/Utils/supportPseudoClass.d.ts +2 -0
- package/lib/Utils/supportPseudoClass.d.ts.map +1 -0
- package/lib/Utils/supportPseudoClass.js +23 -0
- package/lib/Utils/tabbableElements.d.ts +2 -0
- package/lib/Utils/tabbableElements.d.ts.map +1 -0
- package/lib/Utils/tabbableElements.js +2 -2
- package/lib/connectToWebChat.js +17 -7
- package/lib/hooks/index.d.ts +21 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/index.js +25 -25
- package/lib/hooks/internal/BypassSpeechSynthesisPonyfill.js +100 -41
- package/lib/hooks/internal/UITracker.js +2 -2
- package/lib/hooks/internal/useChanged.js +8 -1
- package/lib/hooks/internal/useDispatchScrollPosition.js +3 -7
- package/lib/hooks/internal/useDispatchTranscriptFocusByActivityKey.d.ts +2 -0
- package/lib/hooks/internal/useDispatchTranscriptFocusByActivityKey.d.ts.map +1 -0
- package/lib/hooks/internal/useDispatchTranscriptFocusByActivityKey.js +15 -0
- package/lib/hooks/internal/useEnterKeyHint.js +1 -1
- package/lib/hooks/internal/useFocusVisible.d.ts +3 -0
- package/lib/hooks/internal/useFocusVisible.d.ts.map +1 -0
- package/lib/hooks/internal/useFocusVisible.js +48 -0
- package/lib/hooks/internal/useForceRender.js +2 -2
- package/lib/hooks/internal/useForceRenderAtInterval.js +2 -2
- package/lib/hooks/internal/useInternalRenderMarkdownInline.js +1 -1
- package/lib/hooks/internal/useLocalizeAccessKey.js +2 -2
- package/lib/hooks/internal/useMemoWithPrevious.d.ts +3 -0
- package/lib/hooks/internal/useMemoWithPrevious.d.ts.map +1 -0
- package/lib/hooks/internal/useMemoWithPrevious.js +22 -0
- package/lib/hooks/internal/useMemoize.d.ts +14 -0
- package/lib/hooks/internal/useMemoize.d.ts.map +1 -0
- package/lib/hooks/internal/useMemoize.js +12 -3
- package/lib/hooks/internal/useNavigatorPlatform.js +1 -1
- package/lib/hooks/internal/useNonce.js +1 -1
- package/lib/hooks/internal/useObserveFocusVisible.d.ts +3 -0
- package/lib/hooks/internal/useObserveFocusVisible.d.ts.map +1 -0
- package/lib/hooks/internal/useObserveFocusVisible.js +208 -0
- package/lib/hooks/internal/usePrevious.d.ts +2 -0
- package/lib/hooks/internal/usePrevious.d.ts.map +1 -0
- package/lib/hooks/internal/usePrevious.js +18 -0
- package/lib/hooks/internal/useRegisterFocusSendBox.js +1 -1
- package/lib/hooks/internal/useRegisterFocusTranscript.js +1 -1
- package/lib/hooks/internal/useRegisterScrollRelative.js +1 -1
- package/lib/hooks/internal/useRegisterScrollTo.js +1 -1
- package/lib/hooks/internal/useRegisterScrollToEnd.js +1 -1
- package/lib/hooks/internal/useReplaceEmoticon.js +2 -2
- package/lib/hooks/internal/useResumeAudioContext.js +33 -0
- package/lib/hooks/internal/useScrollRelative.js +1 -1
- package/lib/hooks/internal/useSettableDictateAbortable.js +1 -1
- package/lib/hooks/internal/useStateRef.d.ts +3 -0
- package/lib/hooks/internal/useStateRef.d.ts.map +1 -0
- package/lib/hooks/internal/useStateRef.js +40 -0
- package/lib/hooks/internal/useSuggestedActionsAccessKey.js +1 -1
- package/lib/hooks/internal/useUniqueId.d.ts +2 -0
- package/lib/hooks/internal/useUniqueId.d.ts.map +1 -0
- package/lib/hooks/internal/useUniqueId.js +1 -1
- package/lib/hooks/internal/useValueRef.d.ts +3 -0
- package/lib/hooks/internal/useValueRef.d.ts.map +1 -0
- package/lib/hooks/internal/useValueRef.js +25 -0
- package/lib/hooks/useDictateAbortable.d.ts +2 -0
- package/lib/hooks/useDictateAbortable.d.ts.map +1 -0
- package/lib/hooks/useDictateAbortable.js +2 -2
- package/lib/hooks/useFocus.d.ts +2 -0
- package/lib/hooks/useFocus.d.ts.map +1 -0
- package/lib/hooks/useFocus.js +1 -1
- package/lib/hooks/useFocusSendBox.d.ts +3 -0
- package/lib/hooks/useFocusSendBox.d.ts.map +1 -0
- package/lib/hooks/useFocusSendBox.js +2 -1
- package/lib/hooks/useObserveScrollPosition.d.ts +3 -0
- package/lib/hooks/useObserveScrollPosition.d.ts.map +1 -0
- package/lib/hooks/useObserveScrollPosition.js +2 -2
- package/lib/hooks/useObserveTranscriptFocus.d.ts +5 -0
- package/lib/hooks/useObserveTranscriptFocus.d.ts.map +1 -0
- package/lib/hooks/useObserveTranscriptFocus.js +2 -2
- package/lib/hooks/useRenderMarkdownAsHTML.d.ts +5 -0
- package/lib/hooks/useRenderMarkdownAsHTML.d.ts.map +1 -0
- package/lib/hooks/useRenderMarkdownAsHTML.js +2 -2
- package/lib/hooks/useScrollDown.d.ts +4 -0
- package/lib/hooks/useScrollDown.d.ts.map +1 -0
- package/lib/hooks/useScrollDown.js +1 -1
- package/lib/hooks/useScrollTo.d.ts +5 -0
- package/lib/hooks/useScrollTo.d.ts.map +1 -0
- package/lib/hooks/useScrollTo.js +1 -1
- package/lib/hooks/useScrollToEnd.d.ts +2 -0
- package/lib/hooks/useScrollToEnd.d.ts.map +1 -0
- package/lib/hooks/useScrollToEnd.js +1 -1
- package/lib/hooks/useScrollUp.d.ts +4 -0
- package/lib/hooks/useScrollUp.d.ts.map +1 -0
- package/lib/hooks/useScrollUp.js +1 -1
- package/lib/hooks/useSendFiles.d.ts +2 -0
- package/lib/hooks/useSendFiles.d.ts.map +1 -0
- package/lib/hooks/useSendFiles.js +3 -3
- package/lib/hooks/useStyleSet.d.ts +2 -0
- package/lib/hooks/useStyleSet.d.ts.map +1 -0
- package/lib/hooks/useStyleSet.js +1 -1
- package/lib/hooks/useWebSpeechPonyfill.d.ts +3 -0
- package/lib/hooks/useWebSpeechPonyfill.d.ts.map +1 -0
- package/lib/hooks/useWebSpeechPonyfill.js +1 -1
- package/lib/index.d.ts +219 -22
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +22 -20
- package/lib/providers/ActivityTree/ActivityTreeComposer.d.ts +5 -0
- package/lib/providers/ActivityTree/ActivityTreeComposer.d.ts.map +1 -0
- package/lib/providers/ActivityTree/ActivityTreeComposer.js +86 -0
- package/lib/providers/ActivityTree/private/Context.d.ts +9 -0
- package/lib/providers/ActivityTree/private/Context.d.ts.map +1 -0
- package/lib/providers/ActivityTree/private/Context.js +13 -0
- package/lib/providers/ActivityTree/private/types.d.ts +10 -0
- package/lib/providers/ActivityTree/private/types.d.ts.map +1 -0
- package/lib/providers/ActivityTree/private/types.js +2 -0
- package/lib/providers/ActivityTree/private/useActivitiesWithRenderer.d.ts +4 -0
- package/lib/providers/ActivityTree/private/useActivitiesWithRenderer.d.ts.map +1 -0
- package/lib/providers/ActivityTree/private/useActivitiesWithRenderer.js +58 -0
- package/lib/providers/ActivityTree/private/useActivityTreeWithRenderer.d.ts +5 -0
- package/lib/providers/ActivityTree/private/useActivityTreeWithRenderer.d.ts.map +1 -0
- package/lib/providers/ActivityTree/private/useActivityTreeWithRenderer.js +166 -0
- package/lib/providers/ActivityTree/private/useContext.d.ts +3 -0
- package/lib/providers/ActivityTree/private/useContext.d.ts.map +1 -0
- package/lib/providers/ActivityTree/private/useContext.js +24 -0
- package/lib/providers/ActivityTree/useActivityTreeWithRenderer.d.ts +8 -0
- package/lib/providers/ActivityTree/useActivityTreeWithRenderer.d.ts.map +1 -0
- package/lib/providers/ActivityTree/useActivityTreeWithRenderer.js +17 -0
- package/lib/providers/LiveRegionTwin/LiveRegionTwinComposer.d.ts +35 -0
- package/lib/providers/LiveRegionTwin/LiveRegionTwinComposer.d.ts.map +1 -0
- package/lib/providers/LiveRegionTwin/LiveRegionTwinComposer.js +156 -0
- package/lib/providers/LiveRegionTwin/private/Context.d.ts +10 -0
- package/lib/providers/LiveRegionTwin/private/Context.d.ts.map +1 -0
- package/lib/providers/LiveRegionTwin/private/Context.js +13 -0
- package/lib/providers/LiveRegionTwin/private/LiveRegionTwinContainer.d.ts +11 -0
- package/lib/providers/LiveRegionTwin/private/LiveRegionTwinContainer.d.ts.map +1 -0
- package/lib/providers/LiveRegionTwin/private/LiveRegionTwinContainer.js +86 -0
- package/lib/providers/LiveRegionTwin/private/types.d.ts +8 -0
- package/lib/providers/LiveRegionTwin/private/types.d.ts.map +1 -0
- package/lib/providers/LiveRegionTwin/private/types.js +2 -0
- package/lib/providers/LiveRegionTwin/private/useContext.d.ts +3 -0
- package/lib/providers/LiveRegionTwin/private/useContext.d.ts.map +1 -0
- package/lib/providers/LiveRegionTwin/private/useContext.js +24 -0
- package/lib/providers/LiveRegionTwin/private/useMarkAllAsRenderedEffect.d.ts +2 -0
- package/lib/providers/LiveRegionTwin/private/useMarkAllAsRenderedEffect.d.ts.map +1 -0
- package/lib/providers/LiveRegionTwin/private/useMarkAllAsRenderedEffect.js +24 -0
- package/lib/providers/LiveRegionTwin/private/useStaticElementEntries.d.ts +3 -0
- package/lib/providers/LiveRegionTwin/private/useStaticElementEntries.d.ts.map +1 -0
- package/lib/providers/LiveRegionTwin/private/useStaticElementEntries.js +15 -0
- package/lib/providers/LiveRegionTwin/useQueueStaticElement.d.ts +8 -0
- package/lib/providers/LiveRegionTwin/useQueueStaticElement.d.ts.map +1 -0
- package/lib/providers/LiveRegionTwin/useQueueStaticElement.js +20 -0
- package/lib/providers/TranscriptFocus/TranscriptFocusComposer.d.ts +7 -0
- package/lib/providers/TranscriptFocus/TranscriptFocusComposer.d.ts.map +1 -0
- package/lib/providers/TranscriptFocus/TranscriptFocusComposer.js +184 -0
- package/lib/providers/TranscriptFocus/private/Context.d.ts +12 -0
- package/lib/providers/TranscriptFocus/private/Context.d.ts.map +1 -0
- package/lib/providers/TranscriptFocus/private/Context.js +13 -0
- package/lib/providers/TranscriptFocus/private/useContext.d.ts +2 -0
- package/lib/providers/TranscriptFocus/private/useContext.d.ts.map +1 -0
- package/lib/providers/TranscriptFocus/private/useContext.js +24 -0
- package/lib/providers/TranscriptFocus/useActiveDescendantId.d.ts +2 -0
- package/lib/providers/TranscriptFocus/useActiveDescendantId.d.ts.map +1 -0
- package/lib/providers/TranscriptFocus/useActiveDescendantId.js +15 -0
- package/lib/providers/TranscriptFocus/useFocusByActivityKey.d.ts +8 -0
- package/lib/providers/TranscriptFocus/useFocusByActivityKey.d.ts.map +1 -0
- package/lib/providers/TranscriptFocus/useFocusByActivityKey.js +21 -0
- package/lib/providers/TranscriptFocus/useFocusRelativeActivity.d.ts +2 -0
- package/lib/providers/TranscriptFocus/useFocusRelativeActivity.d.ts.map +1 -0
- package/lib/providers/TranscriptFocus/useFocusRelativeActivity.js +15 -0
- package/lib/providers/TranscriptFocus/useFocusedActivityKey.d.ts +2 -0
- package/lib/providers/TranscriptFocus/useFocusedActivityKey.d.ts.map +1 -0
- package/lib/providers/TranscriptFocus/useFocusedActivityKey.js +15 -0
- package/lib/providers/TranscriptFocus/useFocusedExplicitly.d.ts +2 -0
- package/lib/providers/TranscriptFocus/useFocusedExplicitly.d.ts.map +1 -0
- package/lib/providers/TranscriptFocus/useFocusedExplicitly.js +15 -0
- package/lib/providers/TranscriptFocus/useGetDescendantIdByActivityKey.d.ts +2 -0
- package/lib/providers/TranscriptFocus/useGetDescendantIdByActivityKey.d.ts.map +1 -0
- package/lib/providers/TranscriptFocus/useGetDescendantIdByActivityKey.js +15 -0
- package/lib/tsconfig.json +1 -1
- package/lib/types/ScrollPosition.d.ts +6 -0
- package/lib/types/ScrollPosition.d.ts.map +1 -0
- package/lib/types/ScrollPosition.js +2 -0
- package/package.json +33 -40
- package/src/Activity/{Avatar.js → Avatar.tsx} +9 -2
- package/src/Activity/{Bubble.js → Bubble.tsx} +10 -2
- package/src/Activity/CarouselFilmStrip.js +20 -29
- package/src/Activity/CarouselFilmStripAttachment.js +91 -0
- package/src/Activity/{Speak.js → Speak.tsx} +12 -5
- package/src/Activity/{StackedLayout.js → StackedLayout.tsx} +46 -20
- package/src/Attachment/Assets/DownloadIcon.js +8 -1
- package/src/Attachment/{AudioContent.js → AudioContent.tsx} +12 -3
- package/src/Attachment/FileAttachment.js +1 -1
- package/src/Attachment/{FileContent.js → FileContent.tsx} +22 -7
- package/src/Attachment/{HTMLVideoContent.js → HTMLVideoContent.tsx} +10 -2
- package/src/Attachment/{ImageContent.js → ImageContent.tsx} +7 -2
- package/src/Attachment/{TextContent.js → TextContent.tsx} +14 -7
- package/src/Attachment/{VideoContent.js → VideoContent.tsx} +10 -2
- package/src/Attachment/{VimeoContent.js → VimeoContent.tsx} +15 -8
- package/src/Attachment/{YouTubeContent.js → YouTubeContent.tsx} +12 -5
- package/src/{BasicSendBox.js → BasicSendBox.tsx} +9 -5
- package/src/BasicToaster.js +9 -5
- package/src/BasicTranscript.tsx +878 -0
- package/src/{BasicTypingIndicator.js → BasicTypingIndicator.tsx} +4 -3
- package/src/{BasicWebChat.js → BasicWebChat.tsx} +13 -4
- package/src/{Composer.js → Composer.tsx} +82 -71
- package/src/Dictation.js +13 -4
- package/src/{ErrorBox.js → ErrorBox.tsx} +7 -2
- package/src/Middleware/Activity/createCoreMiddleware.tsx +78 -0
- package/src/Middleware/ActivityStatus/SendStatus/{SendStatus.js → SendStatus.tsx} +8 -3
- package/src/Middleware/ActivityStatus/{Timestamp.js → Timestamp.tsx} +8 -2
- package/src/Middleware/ActivityStatus/{createCoreMiddleware.js → createCoreMiddleware.tsx} +3 -1
- package/src/Middleware/ActivityStatus/createSendStatusMiddleware.js +10 -6
- package/src/Middleware/ActivityStatus/createTimestampMiddleware.js +10 -8
- package/src/Middleware/Attachment/createCoreMiddleware.tsx +44 -0
- package/src/Middleware/AttachmentForScreenReader/createCoreMiddleware.tsx +40 -0
- package/src/Middleware/Avatar/{createCoreMiddleware.js → createCoreMiddleware.tsx} +19 -11
- package/src/Middleware/CardAction/createCoreMiddleware.js +51 -42
- package/src/Middleware/GroupActivities/createCoreMiddleware.js +6 -4
- package/src/Middleware/ScrollToEndButton/ScrollToEndButton.js +45 -0
- package/src/Middleware/ScrollToEndButton/createScrollToEndButtonMiddleware.ts +19 -0
- package/src/Middleware/Toast/createCoreMiddleware.tsx +24 -0
- package/src/Middleware/TypingIndicator/{createCoreMiddleware.js → createCoreMiddleware.tsx} +10 -5
- package/src/{ReactWebChat.js → ReactWebChat.tsx} +25 -7
- package/src/ScreenReaderActivity.js +65 -40
- package/src/{ScreenReaderText.js → ScreenReaderText.tsx} +27 -9
- package/src/SendBox/Assets/AttachmentIcon.js +1 -1
- package/src/SendBox/Assets/MicrophoneIcon.js +1 -1
- package/src/SendBox/{AutoResizeTextArea.js → AutoResizeTextArea.tsx} +30 -4
- package/src/SendBox/{DictationInterims.js → DictationInterims.tsx} +6 -2
- package/src/SendBox/{IconButton.js → IconButton.tsx} +19 -3
- package/src/SendBox/{MicrophoneButton.js → MicrophoneButton.tsx} +35 -25
- package/src/SendBox/{SendButton.js → SendButton.tsx} +8 -3
- package/src/SendBox/{SuggestedAction.js → SuggestedAction.tsx} +62 -39
- package/src/SendBox/{SuggestedActions.js → SuggestedActions.tsx} +70 -22
- package/src/SendBox/{TextBox.js → TextBox.tsx} +21 -7
- package/src/SendBox/{UploadButton.js → UploadButton.tsx} +7 -3
- package/src/Styles/StyleSet/BasicTranscript.ts +34 -20
- package/src/Styles/StyleSet/Bubble.ts +0 -1
- package/src/Styles/StyleSet/CarouselFilmStrip.ts +12 -30
- package/src/Styles/StyleSet/CarouselFilmStripAttachment.ts +57 -0
- package/src/Styles/StyleSet/KeyboardHelp.ts +157 -0
- package/src/Styles/StyleSet/ScrollToEndButton.ts +33 -31
- package/src/Styles/StyleSet/SendBoxButton.ts +84 -13
- package/src/Styles/StyleSet/SendBoxTextBox.ts +1 -2
- package/src/Styles/StyleSet/StackedLayout.ts +13 -11
- package/src/Styles/StyleSet/SuggestedAction.ts +130 -43
- package/src/Styles/StyleSet/SuggestedActions.ts +13 -5
- package/src/Styles/createStyleSet.ts +43 -40
- package/src/Styles/mirrorStyle.js +10 -2
- package/src/Toast/CollapseIcon.js +9 -1
- package/src/Toast/DismissIcon.js +9 -1
- package/src/Toast/ExpandIcon.js +9 -1
- package/src/Toast/NotificationIcon.js +4 -1
- package/src/Toast/createToastMiddleware.tsx +15 -0
- package/src/Transcript/ActivityRow.tsx +124 -0
- package/src/Transcript/ActivityTextAlt.tsx +32 -0
- package/src/Transcript/FocusTrap.tsx +64 -0
- package/src/Transcript/KeyboardHelp.tsx +282 -0
- package/src/Transcript/LiveRegionTranscript.tsx +181 -0
- package/src/Transcript/types.ts +1 -0
- package/src/Transcript/useActivityAccessibleName.ts +85 -0
- package/src/Utils/{AccessibleButton.js → AccessibleButton.tsx} +19 -4
- package/src/Utils/{AccessibleInputText.js → AccessibleInputText.tsx} +48 -5
- package/src/Utils/{AccessibleTextArea.js → AccessibleTextArea.tsx} +67 -6
- package/src/Utils/{FocusRedirector.js → FocusRedirector.tsx} +21 -8
- package/src/Utils/InlineMarkdown.js +18 -2
- package/src/Utils/TypeFocusSink/FocusBox.js +4 -4
- package/src/Utils/TypeFocusSink/getTabIndex.ts +1 -1
- package/src/Utils/TypeFocusSink/inputtableKey.ts +5 -1
- package/src/Utils/activityAltText.ts +135 -0
- package/src/Utils/createCustomEvent.js +7 -1
- package/src/Utils/detectBrowser.js +2 -1
- package/src/Utils/findAncestor.ts +12 -0
- package/src/Utils/getActivityUniqueId.ts +5 -0
- package/src/Utils/intersectionOf.spec.js +2 -0
- package/src/Utils/intersectionOf.ts +14 -0
- package/src/Utils/isZeroOrPositive.ts +7 -0
- package/src/Utils/mapMap.js +7 -1
- package/src/Utils/mapMap.spec.js +2 -0
- package/src/Utils/removeInline.spec.js +2 -0
- package/src/Utils/scrollIntoViewWithBlockNearest.ts +20 -0
- package/src/Utils/shallowEquals.js +8 -1
- package/src/Utils/{singleToArray.js → singleToArray.ts} +1 -1
- package/src/Utils/supportPseudoClass.ts +17 -0
- package/src/Utils/{tabbableElements.js → tabbableElements.ts} +6 -5
- package/src/Utils/walkMarkdownTokens.spec.js +3 -3
- package/src/connectToWebChat.js +11 -4
- package/src/hooks/{index.js → index.ts} +1 -0
- package/src/hooks/internal/BypassSpeechSynthesisPonyfill.js +70 -17
- package/src/hooks/internal/useChanged.ts +17 -0
- package/src/hooks/internal/useDispatchScrollPosition.js +1 -3
- package/src/hooks/internal/useDispatchTranscriptFocusByActivityKey.ts +5 -0
- package/src/hooks/internal/useFocusVisible.ts +22 -0
- package/src/hooks/internal/useMemoWithPrevious.ts +16 -0
- package/src/hooks/internal/useMemoize.spec.js +3 -1
- package/src/hooks/internal/useMemoize.ts +53 -0
- package/src/hooks/internal/useObserveFocusVisible.ts +252 -0
- package/src/hooks/internal/usePrevious.ts +12 -0
- package/src/hooks/internal/useResumeAudioContext.ts +7 -0
- package/src/hooks/internal/useScrollRelative.js +4 -3
- package/src/hooks/internal/useStateRef.ts +31 -0
- package/src/hooks/internal/{useUniqueId.js → useUniqueId.ts} +1 -1
- package/src/hooks/internal/useValueRef.ts +22 -0
- package/src/hooks/{useDictateAbortable.js → useDictateAbortable.ts} +1 -1
- package/src/hooks/{useFocus.js → useFocus.ts} +1 -1
- package/src/hooks/{useFocusSendBox.js → useFocusSendBox.ts} +2 -1
- package/src/hooks/{useObserveScrollPosition.js → useObserveScrollPosition.ts} +6 -1
- package/src/hooks/{useObserveTranscriptFocus.js → useObserveTranscriptFocus.ts} +6 -1
- package/src/hooks/useRenderMarkdownAsHTML.ts +23 -0
- package/src/hooks/{useScrollDown.js → useScrollDown.ts} +1 -1
- package/src/hooks/useScrollTo.ts +16 -0
- package/src/hooks/useScrollToEnd.ts +12 -0
- package/src/hooks/{useScrollUp.js → useScrollUp.ts} +1 -1
- package/src/hooks/{useSendFiles.js → useSendFiles.ts} +3 -2
- package/src/hooks/{useStyleSet.js → useStyleSet.ts} +1 -1
- package/src/hooks/useWebSpeechPonyfill.ts +7 -0
- package/src/index.ts +7 -12
- package/src/providers/ActivityTree/ActivityTreeComposer.tsx +74 -0
- package/src/providers/ActivityTree/private/Context.ts +12 -0
- package/src/providers/ActivityTree/private/types.ts +12 -0
- package/src/providers/ActivityTree/private/useActivitiesWithRenderer.ts +66 -0
- package/src/providers/ActivityTree/private/useActivityTreeWithRenderer.ts +140 -0
- package/src/providers/ActivityTree/private/useContext.ts +15 -0
- package/src/providers/ActivityTree/useActivityTreeWithRenderer.ts +16 -0
- package/src/providers/LiveRegionTwin/LiveRegionTwinComposer.tsx +154 -0
- package/src/providers/LiveRegionTwin/private/Context.ts +15 -0
- package/src/providers/LiveRegionTwin/private/LiveRegionTwinContainer.tsx +64 -0
- package/src/providers/LiveRegionTwin/private/types.ts +10 -0
- package/src/providers/LiveRegionTwin/private/useContext.ts +15 -0
- package/src/providers/LiveRegionTwin/private/useMarkAllAsRenderedEffect.ts +13 -0
- package/src/providers/LiveRegionTwin/private/useStaticElementEntries.ts +7 -0
- package/src/providers/LiveRegionTwin/useQueueStaticElement.ts +12 -0
- package/src/providers/TranscriptFocus/TranscriptFocusComposer.tsx +180 -0
- package/src/providers/TranscriptFocus/private/Context.ts +16 -0
- package/src/providers/TranscriptFocus/private/useContext.ts +13 -0
- package/src/providers/TranscriptFocus/useActiveDescendantId.ts +5 -0
- package/src/providers/TranscriptFocus/useFocusByActivityKey.ts +14 -0
- package/src/providers/TranscriptFocus/useFocusRelativeActivity.ts +5 -0
- package/src/providers/TranscriptFocus/useFocusedActivityKey.ts +5 -0
- package/src/providers/TranscriptFocus/useFocusedExplicitly.ts +5 -0
- package/src/providers/TranscriptFocus/useGetDescendantIdByActivityKey.ts +5 -0
- package/src/tsconfig.json +1 -1
- package/src/types/ScrollPosition.ts +6 -0
- package/.eslintignore +0 -9
- package/lib/Activity/ScrollToEndButton.js +0 -81
- package/lib/Attachment/Assets/ErrorIcon.js +0 -22
- package/lib/Utils/findLastIndex.js +0 -32
- package/lib/Utils/remarkStripMarkdown.js +0 -26
- package/lib/hooks/internal/useAcknowledgedActivity.js +0 -90
- package/lib/hooks/internal/useDispatchTranscriptFocus.js +0 -19
- package/lib/hooks/internal/useStripMarkdown.js +0 -19
- package/src/Activity/ScrollToEndButton.js +0 -58
- package/src/Attachment/Assets/ErrorIcon.js +0 -9
- package/src/BasicTranscript.js +0 -1123
- package/src/Middleware/Activity/createCoreMiddleware.js +0 -71
- package/src/Middleware/Attachment/createCoreMiddleware.js +0 -43
- package/src/Middleware/AttachmentForScreenReader/createCoreMiddleware.js +0 -37
- package/src/Middleware/Toast/createCoreMiddleware.js +0 -20
- package/src/Toast/createToastMiddleware.js +0 -11
- package/src/Utils/findLastIndex.js +0 -11
- package/src/Utils/findLastIndex.spec.js +0 -29
- package/src/Utils/getActivityUniqueId.js +0 -3
- package/src/Utils/intersectionOf.js +0 -11
- package/src/Utils/isZeroOrPositive.js +0 -4
- package/src/Utils/remarkStripMarkdown.js +0 -13
- package/src/hooks/internal/useAcknowledgedActivity.js +0 -65
- package/src/hooks/internal/useChanged.js +0 -10
- package/src/hooks/internal/useDispatchTranscriptFocus.js +0 -7
- package/src/hooks/internal/useMemoize.js +0 -37
- package/src/hooks/internal/useStripMarkdown.js +0 -7
- package/src/hooks/useRenderMarkdownAsHTML.js +0 -20
- package/src/hooks/useScrollTo.js +0 -11
- package/src/hooks/useScrollToEnd.js +0 -11
- package/src/hooks/useWebSpeechPonyfill.js +0 -5
- package/src/index.tsx +0 -35
|
@@ -7,76 +7,163 @@ export default function createSuggestedActionStyle({
|
|
|
7
7
|
paddingRegular,
|
|
8
8
|
paddingWide,
|
|
9
9
|
primaryFont,
|
|
10
|
-
|
|
10
|
+
suggestedActionBorderRadius,
|
|
11
|
+
|
|
12
|
+
suggestedActionBackgroundColor,
|
|
11
13
|
suggestedActionBorderColor,
|
|
12
14
|
suggestedActionBorderStyle,
|
|
13
15
|
suggestedActionBorderWidth,
|
|
14
|
-
suggestedActionBorderRadius,
|
|
15
|
-
suggestedActionImageHeight,
|
|
16
16
|
suggestedActionTextColor,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
|
|
18
|
+
suggestedActionBackgroundColorOnActive,
|
|
19
|
+
suggestedActionBorderColorOnActive,
|
|
20
|
+
suggestedActionBorderStyleOnActive,
|
|
21
|
+
suggestedActionBorderWidthOnActive,
|
|
22
|
+
suggestedActionTextColorOnActive,
|
|
23
|
+
|
|
24
|
+
suggestedActionBackgroundColorOnDisabled,
|
|
25
|
+
suggestedActionBorderColorOnDisabled,
|
|
26
|
+
suggestedActionBorderStyleOnDisabled,
|
|
27
|
+
suggestedActionBorderWidthOnDisabled,
|
|
28
|
+
suggestedActionTextColorOnDisabled,
|
|
29
|
+
|
|
30
|
+
suggestedActionBackgroundColorOnFocus,
|
|
31
|
+
suggestedActionBorderColorOnFocus,
|
|
32
|
+
suggestedActionBorderStyleOnFocus,
|
|
33
|
+
suggestedActionBorderWidthOnFocus,
|
|
34
|
+
suggestedActionTextColorOnFocus,
|
|
35
|
+
|
|
36
|
+
suggestedActionBackgroundColorOnHover,
|
|
37
|
+
suggestedActionBorderColorOnHover,
|
|
38
|
+
suggestedActionBorderStyleOnHover,
|
|
39
|
+
suggestedActionBorderWidthOnHover,
|
|
40
|
+
suggestedActionTextColorOnHover,
|
|
41
|
+
|
|
42
|
+
suggestedActionKeyboardFocusIndicatorBorderColor,
|
|
43
|
+
suggestedActionKeyboardFocusIndicatorBorderRadius,
|
|
44
|
+
suggestedActionKeyboardFocusIndicatorBorderStyle,
|
|
45
|
+
suggestedActionKeyboardFocusIndicatorBorderWidth,
|
|
46
|
+
suggestedActionKeyboardFocusIndicatorInset,
|
|
47
|
+
|
|
22
48
|
suggestedActionHeight,
|
|
49
|
+
suggestedActionImageHeight,
|
|
23
50
|
suggestedActionsStackedLayoutButtonMaxHeight,
|
|
24
|
-
subtle
|
|
51
|
+
subtle,
|
|
52
|
+
|
|
53
|
+
// Deprecated
|
|
54
|
+
suggestedActionActiveBackground,
|
|
55
|
+
suggestedActionBackground,
|
|
56
|
+
suggestedActionDisabledBackground,
|
|
57
|
+
suggestedActionFocusBackground,
|
|
58
|
+
suggestedActionHoverBackground
|
|
25
59
|
}: StrictStyleOptions) {
|
|
26
60
|
return {
|
|
27
61
|
'&.webchat__suggested-action': {
|
|
28
|
-
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
background: suggestedActionBackground, // Deprecated as of 4.15.0. Remove on or after 2021-09-16.
|
|
64
|
+
backgroundColor: suggestedActionBackgroundColor,
|
|
65
|
+
borderColor: suggestedActionBorderColor || accent,
|
|
66
|
+
borderRadius: suggestedActionBorderRadius,
|
|
67
|
+
borderStyle: suggestedActionBorderStyle,
|
|
68
|
+
borderWidth: suggestedActionBorderWidth,
|
|
69
|
+
color: suggestedActionTextColor || accent,
|
|
70
|
+
fontFamily: primaryFont,
|
|
71
|
+
fontSize: 'inherit',
|
|
72
|
+
height: suggestedActionHeight,
|
|
73
|
+
justifyContent: 'center',
|
|
29
74
|
maxWidth: '100%',
|
|
75
|
+
outline: 0,
|
|
76
|
+
paddingLeft: paddingWide,
|
|
77
|
+
paddingRight: paddingWide,
|
|
78
|
+
position: 'relative',
|
|
79
|
+
whiteSpace: 'nowrap',
|
|
80
|
+
width: '100%',
|
|
81
|
+
|
|
82
|
+
// Order of style preferences (based on effort of user gesture): disabled > active > hover > focus.
|
|
83
|
+
// Keyboard focus indicator styles applied by :focus-visible do not conflict with :active/:hover/:focus, so it is not included here.
|
|
84
|
+
'&:disabled, &[aria-disabled="true"]': {
|
|
85
|
+
background: suggestedActionDisabledBackground,
|
|
86
|
+
backgroundColor: suggestedActionBackgroundColorOnDisabled,
|
|
87
|
+
borderColor: suggestedActionBorderColorOnDisabled,
|
|
88
|
+
borderStyle: suggestedActionBorderStyleOnDisabled,
|
|
89
|
+
borderWidth: suggestedActionBorderWidthOnDisabled,
|
|
90
|
+
color: suggestedActionTextColorOnDisabled || subtle
|
|
91
|
+
},
|
|
30
92
|
|
|
31
|
-
'
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
paddingLeft: paddingWide,
|
|
40
|
-
paddingRight: paddingWide,
|
|
41
|
-
whiteSpace: 'nowrap',
|
|
42
|
-
width: '100%',
|
|
43
|
-
|
|
44
|
-
'&:disabled, &[aria-disabled="true"]': {
|
|
45
|
-
background: suggestedActionDisabledBackground || suggestedActionBackground,
|
|
46
|
-
borderColor: suggestedActionDisabledBorderColor,
|
|
47
|
-
borderStyle: suggestedActionDisabledBorderStyle,
|
|
48
|
-
borderWidth: suggestedActionDisabledBorderWidth,
|
|
49
|
-
color: suggestedActionDisabledTextColor || subtle
|
|
93
|
+
'&:not(:disabled):not([aria-disabled="true"])': {
|
|
94
|
+
'&:active': {
|
|
95
|
+
background: suggestedActionActiveBackground,
|
|
96
|
+
backgroundColor: suggestedActionBackgroundColorOnActive,
|
|
97
|
+
borderColor: suggestedActionBorderColorOnActive,
|
|
98
|
+
borderStyle: suggestedActionBorderStyleOnActive,
|
|
99
|
+
borderWidth: suggestedActionBorderWidthOnActive,
|
|
100
|
+
color: suggestedActionTextColorOnActive
|
|
50
101
|
},
|
|
51
102
|
|
|
52
|
-
'&:not(:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
103
|
+
'&:not(:active)': {
|
|
104
|
+
'&:hover': {
|
|
105
|
+
background: suggestedActionHoverBackground,
|
|
106
|
+
backgroundColor: suggestedActionBackgroundColorOnHover,
|
|
107
|
+
borderColor: suggestedActionBorderColorOnHover,
|
|
108
|
+
borderStyle: suggestedActionBorderStyleOnHover,
|
|
109
|
+
borderWidth: suggestedActionBorderWidthOnHover,
|
|
110
|
+
color: suggestedActionTextColorOnHover
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
'&:not(:hover)': {
|
|
114
|
+
'&:focus': {
|
|
115
|
+
background: suggestedActionFocusBackground,
|
|
116
|
+
backgroundColor: suggestedActionBackgroundColorOnFocus,
|
|
117
|
+
borderColor: suggestedActionBorderColorOnFocus,
|
|
118
|
+
borderStyle: suggestedActionBorderStyleOnFocus,
|
|
119
|
+
borderWidth: suggestedActionBorderWidthOnFocus,
|
|
120
|
+
color: suggestedActionTextColorOnFocus
|
|
121
|
+
}
|
|
122
|
+
}
|
|
58
123
|
}
|
|
59
124
|
},
|
|
60
125
|
|
|
61
|
-
|
|
62
|
-
|
|
126
|
+
// On unsupported browser, :focus-visible and :not(:focus-visible) is always false.
|
|
127
|
+
// And it will turn the whole CSS selector ":unsupported, .truthy" to false.
|
|
128
|
+
'&:not(:focus-visible) .webchat__suggested-action__keyboard-focus-indicator': {
|
|
129
|
+
display: 'none'
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
'&:not(.webchat__suggested-action--focus-visible) .webchat__suggested-action__keyboard-focus-indicator': {
|
|
133
|
+
display: 'none'
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
'&:not(.webchat__suggested-action--rtl) .webchat__suggested-action__image + .webchat__suggested-action__text': {
|
|
137
|
+
paddingLeft: paddingRegular
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
'&.webchat__suggested-action--rtl .webchat__suggested-action__image + .webchat__suggested-action__text': {
|
|
141
|
+
paddingRight: paddingRegular
|
|
63
142
|
},
|
|
64
143
|
|
|
65
|
-
'
|
|
144
|
+
'&.webchat__suggested-action--wrapping': {
|
|
66
145
|
height: 'auto',
|
|
67
146
|
maxHeight: suggestedActionsStackedLayoutButtonMaxHeight || '100%',
|
|
68
147
|
minHeight:
|
|
69
|
-
typeof suggestedActionsStackedLayoutButtonMaxHeight === 'number'
|
|
148
|
+
typeof suggestedActionsStackedLayoutButtonMaxHeight === 'number' && typeof suggestedActionHeight === 'number'
|
|
70
149
|
? Math.min(suggestedActionsStackedLayoutButtonMaxHeight, suggestedActionHeight)
|
|
71
150
|
: suggestedActionHeight
|
|
72
151
|
},
|
|
73
152
|
|
|
74
|
-
'
|
|
75
|
-
|
|
153
|
+
'& .webchat__suggested-action__image': {
|
|
154
|
+
height: suggestedActionImageHeight
|
|
76
155
|
},
|
|
77
156
|
|
|
78
|
-
'
|
|
79
|
-
|
|
157
|
+
'& .webchat__suggested-action__keyboard-focus-indicator': {
|
|
158
|
+
borderColor: suggestedActionKeyboardFocusIndicatorBorderColor,
|
|
159
|
+
borderRadius: suggestedActionKeyboardFocusIndicatorBorderRadius,
|
|
160
|
+
borderStyle: suggestedActionKeyboardFocusIndicatorBorderStyle,
|
|
161
|
+
borderWidth: suggestedActionKeyboardFocusIndicatorBorderWidth,
|
|
162
|
+
bottom: suggestedActionKeyboardFocusIndicatorInset,
|
|
163
|
+
left: suggestedActionKeyboardFocusIndicatorInset,
|
|
164
|
+
position: 'absolute',
|
|
165
|
+
right: suggestedActionKeyboardFocusIndicatorInset,
|
|
166
|
+
top: suggestedActionKeyboardFocusIndicatorInset
|
|
80
167
|
}
|
|
81
168
|
}
|
|
82
169
|
};
|
|
@@ -25,7 +25,7 @@ export default function createSuggestedActionsStyle({
|
|
|
25
25
|
paddingBottom: paddingRegular / 2,
|
|
26
26
|
paddingTop: paddingRegular / 2,
|
|
27
27
|
|
|
28
|
-
'& .webchat__suggested-
|
|
28
|
+
'& .webchat__suggested-actions__item-box': {
|
|
29
29
|
paddingBottom: paddingRegular / 2,
|
|
30
30
|
paddingLeft: paddingRegular / 2,
|
|
31
31
|
paddingRight: paddingRegular / 2,
|
|
@@ -113,13 +113,16 @@ export default function createSuggestedActionsStyle({
|
|
|
113
113
|
paddingTop: paddingRegular / 2
|
|
114
114
|
},
|
|
115
115
|
|
|
116
|
-
'& .webchat__suggested-
|
|
116
|
+
'& .webchat__suggested-actions__flow-item-box': {
|
|
117
117
|
maxWidth: '100%',
|
|
118
118
|
overflow: 'hidden' // This is required in IE11
|
|
119
119
|
},
|
|
120
120
|
|
|
121
|
-
'& .webchat__suggested-
|
|
122
|
-
|
|
121
|
+
'& .webchat__suggested-actions__item-box': {
|
|
122
|
+
paddingBottom: paddingRegular / 2,
|
|
123
|
+
paddingLeft: paddingRegular / 2,
|
|
124
|
+
paddingRight: paddingRegular / 2,
|
|
125
|
+
paddingTop: paddingRegular / 2
|
|
123
126
|
}
|
|
124
127
|
},
|
|
125
128
|
|
|
@@ -133,7 +136,7 @@ export default function createSuggestedActionsStyle({
|
|
|
133
136
|
paddingTop: paddingRegular / 2
|
|
134
137
|
},
|
|
135
138
|
|
|
136
|
-
'& .webchat__suggested-
|
|
139
|
+
'& .webchat__suggested-actions__item-box': {
|
|
137
140
|
paddingBottom: paddingRegular / 2,
|
|
138
141
|
paddingLeft: paddingRegular / 2,
|
|
139
142
|
paddingRight: paddingRegular / 2,
|
|
@@ -152,6 +155,11 @@ export default function createSuggestedActionsStyle({
|
|
|
152
155
|
display: 'flex',
|
|
153
156
|
whiteSpace: 'normal'
|
|
154
157
|
}
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
'& .webchat__suggested-actions__item-box': {
|
|
161
|
+
display: 'flex',
|
|
162
|
+
maxWidth: '100%'
|
|
155
163
|
}
|
|
156
164
|
}
|
|
157
165
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable complexity */
|
|
2
1
|
import { normalizeStyleOptions, StyleOptions } from 'botframework-webchat-api';
|
|
3
2
|
|
|
4
3
|
import createActivitiesStyle from './StyleSet/Activities';
|
|
@@ -9,6 +8,7 @@ import createAvatarStyle from './StyleSet/Avatar';
|
|
|
9
8
|
import createBasicTranscriptStyle from './StyleSet/BasicTranscript';
|
|
10
9
|
import createBubbleStyle from './StyleSet/Bubble';
|
|
11
10
|
import createCarouselFilmStrip from './StyleSet/CarouselFilmStrip';
|
|
11
|
+
import createCarouselFilmStripAttachment from './StyleSet/CarouselFilmStripAttachment';
|
|
12
12
|
import createCarouselFlipper from './StyleSet/CarouselFlipper';
|
|
13
13
|
import createConnectivityNotification from './StyleSet/ConnectivityNotification';
|
|
14
14
|
import createDictationInterimsStyle from './StyleSet/DictationInterims';
|
|
@@ -17,6 +17,7 @@ import createErrorNotificationStyle from './StyleSet/ErrorNotification';
|
|
|
17
17
|
import createFileContentStyle from './StyleSet/FileContent';
|
|
18
18
|
import createImageAvatarStyle from './StyleSet/ImageAvatar';
|
|
19
19
|
import createInitialsAvatarStyle from './StyleSet/InitialsAvatar';
|
|
20
|
+
import createKeyboardHelpStyle from './StyleSet/KeyboardHelp';
|
|
20
21
|
import createMicrophoneButtonStyle from './StyleSet/MicrophoneButton';
|
|
21
22
|
import createRootStyle from './StyleSet/Root';
|
|
22
23
|
import createScrollToEndButtonStyle from './StyleSet/ScrollToEndButton';
|
|
@@ -45,49 +46,51 @@ import createYouTubeContentStyle from './StyleSet/YouTubeContent';
|
|
|
45
46
|
// "styleSet" is actually CSS stylesheet and it is based on the DOM tree.
|
|
46
47
|
// DOM tree may change from time to time, thus, maintaining "styleSet" becomes a constant effort.
|
|
47
48
|
|
|
48
|
-
export default function createStyleSet(
|
|
49
|
-
|
|
49
|
+
export default function createStyleSet(styleOptions: StyleOptions) {
|
|
50
|
+
const strictStyleOptions = normalizeStyleOptions(styleOptions);
|
|
50
51
|
|
|
51
52
|
return {
|
|
52
53
|
activities: createActivitiesStyle(),
|
|
53
|
-
audioAttachment: createAudioAttachmentStyle(
|
|
54
|
+
audioAttachment: createAudioAttachmentStyle(strictStyleOptions),
|
|
54
55
|
audioContent: createAudioContentStyle(),
|
|
55
|
-
autoResizeTextArea: createAutoResizeTextAreaStyle(
|
|
56
|
-
avatar: createAvatarStyle(
|
|
57
|
-
basicTranscript: createBasicTranscriptStyle(
|
|
58
|
-
bubble: createBubbleStyle(
|
|
59
|
-
carouselFilmStrip: createCarouselFilmStrip(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
56
|
+
autoResizeTextArea: createAutoResizeTextAreaStyle(strictStyleOptions),
|
|
57
|
+
avatar: createAvatarStyle(strictStyleOptions),
|
|
58
|
+
basicTranscript: createBasicTranscriptStyle(strictStyleOptions),
|
|
59
|
+
bubble: createBubbleStyle(strictStyleOptions),
|
|
60
|
+
carouselFilmStrip: createCarouselFilmStrip(strictStyleOptions),
|
|
61
|
+
carouselFilmStripAttachment: createCarouselFilmStripAttachment(strictStyleOptions),
|
|
62
|
+
carouselFlipper: createCarouselFlipper(strictStyleOptions),
|
|
63
|
+
connectivityNotification: createConnectivityNotification(strictStyleOptions),
|
|
64
|
+
dictationInterims: createDictationInterimsStyle(strictStyleOptions),
|
|
65
|
+
errorBox: createErrorBoxStyle(strictStyleOptions),
|
|
66
|
+
errorNotification: createErrorNotificationStyle(strictStyleOptions),
|
|
67
|
+
fileContent: createFileContentStyle(strictStyleOptions),
|
|
68
|
+
imageAvatar: createImageAvatarStyle(strictStyleOptions),
|
|
69
|
+
initialsAvatar: createInitialsAvatarStyle(strictStyleOptions),
|
|
70
|
+
keyboardHelp: createKeyboardHelpStyle(strictStyleOptions),
|
|
71
|
+
microphoneButton: createMicrophoneButtonStyle(strictStyleOptions),
|
|
72
|
+
options: { ...strictStyleOptions }, // Cloned to make sure no additional modifications will propagate up.
|
|
73
|
+
root: createRootStyle(strictStyleOptions),
|
|
74
|
+
scrollToEndButton: createScrollToEndButtonStyle(strictStyleOptions),
|
|
75
|
+
sendBox: createSendBoxStyle(strictStyleOptions),
|
|
76
|
+
sendBoxButton: createSendBoxButtonStyle(strictStyleOptions),
|
|
77
|
+
sendBoxTextBox: createSendBoxTextBoxStyle(strictStyleOptions),
|
|
78
|
+
sendStatus: createSendStatusStyle(strictStyleOptions),
|
|
79
|
+
singleAttachmentActivity: createSingleAttachmentActivityStyle(strictStyleOptions),
|
|
80
|
+
spinnerAnimation: createSpinnerAnimationStyle(strictStyleOptions),
|
|
81
|
+
stackedLayout: createStackedLayoutStyle(strictStyleOptions),
|
|
82
|
+
suggestedAction: createSuggestedActionStyle(strictStyleOptions),
|
|
83
|
+
suggestedActions: createSuggestedActionsStyle(strictStyleOptions),
|
|
84
|
+
textContent: createTextContentStyle(strictStyleOptions),
|
|
85
|
+
toast: createToastStyle(strictStyleOptions),
|
|
86
|
+
toaster: createToasterStyle(strictStyleOptions),
|
|
87
|
+
typingAnimation: createTypingAnimationStyle(strictStyleOptions),
|
|
88
|
+
typingIndicator: createTypingIndicatorStyle(strictStyleOptions),
|
|
89
|
+
uploadButton: createUploadButtonStyle(strictStyleOptions),
|
|
87
90
|
videoAttachment: createVideoAttachmentStyle(),
|
|
88
|
-
videoContent: createVideoContentStyle(
|
|
89
|
-
vimeoContent: createVimeoContentStyle(
|
|
90
|
-
warningNotification: createWarningNotificationStyle(
|
|
91
|
-
youTubeContent: createYouTubeContentStyle(
|
|
91
|
+
videoContent: createVideoContentStyle(strictStyleOptions),
|
|
92
|
+
vimeoContent: createVimeoContentStyle(strictStyleOptions),
|
|
93
|
+
warningNotification: createWarningNotificationStyle(strictStyleOptions),
|
|
94
|
+
youTubeContent: createYouTubeContentStyle(strictStyleOptions)
|
|
92
95
|
};
|
|
93
96
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { isForbiddenPropertyName } from 'botframework-webchat-core';
|
|
2
|
+
|
|
1
3
|
export default function mirrorStyle(mirrorSelector, styles) {
|
|
2
4
|
const mirrored = {};
|
|
3
5
|
|
|
@@ -7,8 +9,14 @@ export default function mirrorStyle(mirrorSelector, styles) {
|
|
|
7
9
|
match === 'Left' ? 'Right' : match === 'left' ? 'right' : match === 'Right' ? 'Left' : 'left'
|
|
8
10
|
);
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
if (!isForbiddenPropertyName(patchedKey)) {
|
|
13
|
+
// Mitigated through denylisting.
|
|
14
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
15
|
+
mirrored[patchedKey] = value;
|
|
16
|
+
}
|
|
17
|
+
} else if (!isForbiddenPropertyName(key)) {
|
|
18
|
+
// Mitigated through denylisting.
|
|
19
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
12
20
|
mirrored[key] = mirrorStyle('', value);
|
|
13
21
|
}
|
|
14
22
|
}
|
|
@@ -2,7 +2,15 @@ import PropTypes from 'prop-types';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
const CollapseIcon = ({ className }) => (
|
|
5
|
-
<svg
|
|
5
|
+
<svg
|
|
6
|
+
className={(className || '') + ''}
|
|
7
|
+
focusable={false}
|
|
8
|
+
height="9"
|
|
9
|
+
role="presentation"
|
|
10
|
+
viewBox="0 0 16 9"
|
|
11
|
+
width="16"
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
+
>
|
|
6
14
|
<path d="M15.2734 8.97656L8 1.71094L0.726563 8.97656L0.0234375 8.27344L8 0.289062L15.9766 8.27344L15.2734 8.97656Z" />
|
|
7
15
|
</svg>
|
|
8
16
|
);
|
package/src/Toast/DismissIcon.js
CHANGED
|
@@ -2,7 +2,15 @@ import PropTypes from 'prop-types';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
const DismissIcon = ({ className }) => (
|
|
5
|
-
<svg
|
|
5
|
+
<svg
|
|
6
|
+
className={(className || '') + ''}
|
|
7
|
+
focusable={false}
|
|
8
|
+
height="14"
|
|
9
|
+
role="presentation"
|
|
10
|
+
viewBox="0 0 14 14"
|
|
11
|
+
width="14"
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
+
>
|
|
6
14
|
<path d="M7.71094 7L13.1016 12.3984L12.3984 13.1016L7 7.71094L1.60156 13.1016L0.898438 12.3984L6.28906 7L0.898438 1.60156L1.60156 0.898438L7 6.28906L12.3984 0.898438L13.1016 1.60156L7.71094 7Z" />
|
|
7
15
|
</svg>
|
|
8
16
|
);
|
package/src/Toast/ExpandIcon.js
CHANGED
|
@@ -2,7 +2,15 @@ import PropTypes from 'prop-types';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
const ExpandIcon = ({ className }) => (
|
|
5
|
-
<svg
|
|
5
|
+
<svg
|
|
6
|
+
className={(className || '') + ''}
|
|
7
|
+
focusable={false}
|
|
8
|
+
height="10"
|
|
9
|
+
role="presentation"
|
|
10
|
+
viewBox="0 0 16 10"
|
|
11
|
+
width="16"
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
+
>
|
|
6
14
|
<path d="M15.1484 0.648437L15.8516 1.35156L8 9.20312L0.148438 1.35156L0.851563 0.648438L8 7.79687L15.1484 0.648437Z" />
|
|
7
15
|
</svg>
|
|
8
16
|
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { hooks } from 'botframework-webchat-api';
|
|
2
|
+
import { isForbiddenPropertyName } from 'botframework-webchat-core';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import React from 'react';
|
|
4
5
|
|
|
@@ -17,7 +18,9 @@ const NotificationIcon = ({ className, level }) => {
|
|
|
17
18
|
warn: localize('TOAST_ALT_WARN')
|
|
18
19
|
};
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
// Mitigated through denylisting.
|
|
22
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
23
|
+
const prefix = (!isForbiddenPropertyName(level) && prefixes[level]) || '';
|
|
21
24
|
|
|
22
25
|
return (
|
|
23
26
|
<React.Fragment>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* eslint react/prop-types: "off" */
|
|
2
|
+
|
|
3
|
+
import { ToastMiddleware } from 'botframework-webchat-api';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import BasicToast from '../BasicToast';
|
|
7
|
+
|
|
8
|
+
function createToastMiddleware(): ToastMiddleware {
|
|
9
|
+
return () =>
|
|
10
|
+
() =>
|
|
11
|
+
({ notification }) =>
|
|
12
|
+
<BasicToast notification={notification} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default createToastMiddleware;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { hooks } from 'botframework-webchat-api';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import React, { forwardRef, useCallback, useRef } from 'react';
|
|
5
|
+
|
|
6
|
+
import type { DirectLineActivity } from 'botframework-webchat-core';
|
|
7
|
+
import type { MouseEventHandler, PropsWithChildren } from 'react';
|
|
8
|
+
|
|
9
|
+
import { android } from '../Utils/detectBrowser';
|
|
10
|
+
import FocusTrap from './FocusTrap';
|
|
11
|
+
import ScreenReaderText from '../ScreenReaderText';
|
|
12
|
+
import SpeakActivity from '../Activity/Speak';
|
|
13
|
+
import useActiveDescendantId from '../providers/TranscriptFocus/useActiveDescendantId';
|
|
14
|
+
import useActivityAccessibleName from './useActivityAccessibleName';
|
|
15
|
+
import useFocusByActivityKey from '../providers/TranscriptFocus/useFocusByActivityKey';
|
|
16
|
+
import useGetDescendantIdByActivityKey from '../providers/TranscriptFocus/useGetDescendantIdByActivityKey';
|
|
17
|
+
import useValueRef from '../hooks/internal/useValueRef';
|
|
18
|
+
|
|
19
|
+
const { useActivityKeysByRead, useGetHasAcknowledgedByActivityKey, useGetKeyByActivity } = hooks;
|
|
20
|
+
|
|
21
|
+
type ActivityRowProps = PropsWithChildren<{
|
|
22
|
+
activity: DirectLineActivity;
|
|
23
|
+
}>;
|
|
24
|
+
|
|
25
|
+
const ActivityRow = forwardRef<HTMLLIElement, ActivityRowProps>(({ activity, children }, ref) => {
|
|
26
|
+
const [activeDescendantId] = useActiveDescendantId();
|
|
27
|
+
const [readActivityKeys] = useActivityKeysByRead();
|
|
28
|
+
const bodyRef = useRef<HTMLDivElement>();
|
|
29
|
+
const focusByActivityKey = useFocusByActivityKey();
|
|
30
|
+
const getKeyByActivity = useGetKeyByActivity();
|
|
31
|
+
// TODO: [P2] #2858 We should use core/definitions/speakingActivity for this predicate instead
|
|
32
|
+
const shouldSpeak = activity.channelData?.speak;
|
|
33
|
+
|
|
34
|
+
const [accessibleName] = useActivityAccessibleName(activity, bodyRef);
|
|
35
|
+
const activityKey = getKeyByActivity(activity);
|
|
36
|
+
|
|
37
|
+
const acknowledged = useGetHasAcknowledgedByActivityKey()(activityKey);
|
|
38
|
+
const activityKeyRef = useValueRef<string>(activityKey);
|
|
39
|
+
const descendantId = useGetDescendantIdByActivityKey()(activityKey);
|
|
40
|
+
const descendantLabelId = `webchat__basic-transcript__active-descendant-label--${activityKey}`;
|
|
41
|
+
|
|
42
|
+
const isActiveDescendant = descendantId === activeDescendantId;
|
|
43
|
+
const read = readActivityKeys.includes(activityKey);
|
|
44
|
+
|
|
45
|
+
const focusSelf = useCallback<(withFocus?: boolean) => void>(
|
|
46
|
+
(withFocus?: boolean) => focusByActivityKey(activityKeyRef.current, withFocus),
|
|
47
|
+
[activityKeyRef, focusByActivityKey]
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
// When a child of the activity receives focus, notify the transcript to set the `aria-activedescendant` to this activity.
|
|
51
|
+
const handleDescendantFocus: () => void = useCallback(() => focusSelf(false), [focusSelf]);
|
|
52
|
+
|
|
53
|
+
// When receive Escape key from descendant, focus back to the activity.
|
|
54
|
+
const handleLeaveFocusTrap = useCallback(() => focusSelf(), [focusSelf]);
|
|
55
|
+
|
|
56
|
+
// When the user press UP/DOWN arrow keys, we put a visual focus indicator around the focused activity.
|
|
57
|
+
// We should do the same for mouse, when the user click on the activity, we should also put a visual focus indicator around the activity.
|
|
58
|
+
// We are doing it in event capture phase to prevent descendants from stopping event propagation to us.
|
|
59
|
+
const handleMouseDownCapture: MouseEventHandler = useCallback(() => focusSelf(false), [focusSelf]);
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
// TODO: [P2] Add `aria-roledescription="message"` for better AX, need localization strings.
|
|
63
|
+
<article
|
|
64
|
+
aria-hidden={activity.channelData?.['webchat:fallback-text'] === ''}
|
|
65
|
+
className={classNames('webchat__basic-transcript__activity', {
|
|
66
|
+
'webchat__basic-transcript__activity--acknowledged': acknowledged,
|
|
67
|
+
'webchat__basic-transcript__activity--read': read
|
|
68
|
+
})}
|
|
69
|
+
// When NVDA is in browse mode, using up/down arrow key to "browse" will dispatch "click" and "mousedown" events for <article> element (inside <ScreenReaderActivity>).
|
|
70
|
+
onMouseDownCapture={handleMouseDownCapture}
|
|
71
|
+
ref={ref}
|
|
72
|
+
>
|
|
73
|
+
{/* TODO: [P1] File a crbug for TalkBack. It should not able to read the content twice when scanning. */}
|
|
74
|
+
|
|
75
|
+
{/* The following <div> is designed for active descendant only.
|
|
76
|
+
We want to prevent screen reader from scanning the content that is authored only for active descendant.
|
|
77
|
+
The specific content should only read when user press UP/DOWN arrow keys to change `aria-activedescendant`.
|
|
78
|
+
However, Android TalkBack 12.1 is buggy when the there is an element with ID of one of the `aria-activedescendant` potential candidates,
|
|
79
|
+
TalkBack will narrate the message content twice (i.e. content of `bodyRef`), regardless whether the ID is currently set as `aria-activedescendant` or not.
|
|
80
|
+
As Android does not support active descendant, we are hiding the whole DOM element altogether. */}
|
|
81
|
+
|
|
82
|
+
{!android && (
|
|
83
|
+
<div
|
|
84
|
+
aria-labelledby={descendantLabelId}
|
|
85
|
+
className="webchat__basic-transcript__activity-active-descendant"
|
|
86
|
+
// "id" is required for "aria-labelledby"
|
|
87
|
+
// eslint-disable-next-line react/forbid-dom-props
|
|
88
|
+
id={descendantId}
|
|
89
|
+
role="article"
|
|
90
|
+
>
|
|
91
|
+
<ScreenReaderText aria-hidden={true} id={descendantLabelId} text={accessibleName} />
|
|
92
|
+
</div>
|
|
93
|
+
)}
|
|
94
|
+
{/* Add tests for focus trap */}
|
|
95
|
+
<FocusTrap onFocus={handleDescendantFocus} onLeave={handleLeaveFocusTrap}>
|
|
96
|
+
<div className="webchat__basic-transcript__activity-body" ref={bodyRef}>
|
|
97
|
+
{children}
|
|
98
|
+
</div>
|
|
99
|
+
</FocusTrap>
|
|
100
|
+
{shouldSpeak && <SpeakActivity activity={activity} />}
|
|
101
|
+
<div
|
|
102
|
+
className={classNames('webchat__basic-transcript__activity-indicator', {
|
|
103
|
+
'webchat__basic-transcript__activity-indicator--focus': isActiveDescendant
|
|
104
|
+
})}
|
|
105
|
+
/>
|
|
106
|
+
</article>
|
|
107
|
+
);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
ActivityRow.defaultProps = {
|
|
111
|
+
children: undefined
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
ActivityRow.propTypes = {
|
|
115
|
+
activity: PropTypes.shape({
|
|
116
|
+
channelData: PropTypes.shape({
|
|
117
|
+
speak: PropTypes.bool,
|
|
118
|
+
'webchat:fallback-text': PropTypes.string
|
|
119
|
+
})
|
|
120
|
+
}).isRequired,
|
|
121
|
+
children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)])
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export default ActivityRow;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import type { DirectLineActivity } from 'botframework-webchat-core';
|
|
5
|
+
import type { RefObject, VFC } from 'react';
|
|
6
|
+
|
|
7
|
+
import ScreenReaderText from '../ScreenReaderText';
|
|
8
|
+
import useActivityAccessibleName from './useActivityAccessibleName';
|
|
9
|
+
|
|
10
|
+
type ActivityTextAltProps = {
|
|
11
|
+
activity: DirectLineActivity;
|
|
12
|
+
bodyRef: RefObject<HTMLDivElement>;
|
|
13
|
+
id: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const ActivityTextAlt: VFC<ActivityTextAltProps> = ({ activity, bodyRef, id }) => {
|
|
17
|
+
const [accessibleName] = useActivityAccessibleName(activity, bodyRef);
|
|
18
|
+
|
|
19
|
+
return <ScreenReaderText aria-hidden={true} id={id} text={accessibleName} />;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
ActivityTextAlt.propTypes = {
|
|
23
|
+
activity: PropTypes.any.isRequired,
|
|
24
|
+
// PropTypes is not fully compatible with TypeScript
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
bodyRef: PropTypes.shape({
|
|
27
|
+
current: PropTypes.any
|
|
28
|
+
}).isRequired,
|
|
29
|
+
id: PropTypes.string.isRequired
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default ActivityTextAlt;
|