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
|
@@ -1,12 +1,38 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import React, {
|
|
3
|
+
import React, {
|
|
4
|
+
ChangeEventHandler,
|
|
5
|
+
FocusEventHandler,
|
|
6
|
+
forwardRef,
|
|
7
|
+
KeyboardEventHandler,
|
|
8
|
+
ReactEventHandler
|
|
9
|
+
} from 'react';
|
|
4
10
|
|
|
5
11
|
import AccessibleTextArea from '../Utils/AccessibleTextArea';
|
|
6
12
|
import useEnterKeyHint from '../hooks/internal/useEnterKeyHint';
|
|
7
13
|
import useStyleSet from '../hooks/useStyleSet';
|
|
8
14
|
|
|
9
|
-
|
|
15
|
+
type AutoResizeTextAreaProps = {
|
|
16
|
+
'aria-label'?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
'data-id'?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
enterKeyHint?: string;
|
|
21
|
+
inputMode?: 'text' | 'none' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
|
|
22
|
+
onChange?: ChangeEventHandler<HTMLTextAreaElement>;
|
|
23
|
+
onFocus?: FocusEventHandler<HTMLTextAreaElement>;
|
|
24
|
+
onKeyDown?: KeyboardEventHandler<HTMLTextAreaElement>;
|
|
25
|
+
onKeyDownCapture?: KeyboardEventHandler<HTMLTextAreaElement>;
|
|
26
|
+
onKeyPress?: KeyboardEventHandler<HTMLTextAreaElement>;
|
|
27
|
+
onSelect?: ReactEventHandler<HTMLTextAreaElement>;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
readOnly?: boolean;
|
|
30
|
+
rows?: number;
|
|
31
|
+
textAreaClassName?: string;
|
|
32
|
+
value?: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const AutoResizeTextArea = forwardRef<HTMLTextAreaElement, AutoResizeTextAreaProps>(
|
|
10
36
|
(
|
|
11
37
|
{
|
|
12
38
|
'aria-label': ariaLabel,
|
|
@@ -88,7 +114,7 @@ AutoResizeTextArea.propTypes = {
|
|
|
88
114
|
'data-id': PropTypes.string,
|
|
89
115
|
disabled: PropTypes.bool,
|
|
90
116
|
enterKeyHint: PropTypes.string,
|
|
91
|
-
inputMode: PropTypes.
|
|
117
|
+
inputMode: PropTypes.oneOf(['text', 'none', 'tel', 'url', 'email', 'numeric', 'decimal', 'search']),
|
|
92
118
|
onChange: PropTypes.func,
|
|
93
119
|
onFocus: PropTypes.func,
|
|
94
120
|
onKeyDown: PropTypes.func,
|
|
@@ -97,7 +123,7 @@ AutoResizeTextArea.propTypes = {
|
|
|
97
123
|
onSelect: PropTypes.func,
|
|
98
124
|
placeholder: PropTypes.string,
|
|
99
125
|
readOnly: PropTypes.bool,
|
|
100
|
-
rows: PropTypes.
|
|
126
|
+
rows: PropTypes.number,
|
|
101
127
|
textAreaClassName: PropTypes.string,
|
|
102
128
|
value: PropTypes.string
|
|
103
129
|
};
|
|
@@ -4,7 +4,7 @@ import { Constants } from 'botframework-webchat-core';
|
|
|
4
4
|
import { hooks } from 'botframework-webchat-api';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import React from 'react';
|
|
7
|
+
import React, { FC } from 'react';
|
|
8
8
|
|
|
9
9
|
import connectToWebChat from '../connectToWebChat';
|
|
10
10
|
import useStyleSet from '../hooks/useStyleSet';
|
|
@@ -31,7 +31,11 @@ const connectDictationInterims = (...selectors) =>
|
|
|
31
31
|
...selectors
|
|
32
32
|
);
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
type DictationInterimsProps = {
|
|
35
|
+
className?: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const DictationInterims: FC<DictationInterimsProps> = ({ className }) => {
|
|
35
39
|
const [dictateInterims] = useDictateInterims();
|
|
36
40
|
const [dictateState] = useDictateState();
|
|
37
41
|
const [{ dictationInterims: dictationInterimsStyleSet }] = useStyleSet();
|
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
import { hooks } from 'botframework-webchat-api';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import React from 'react';
|
|
4
|
+
import React, { FC, MouseEventHandler, ReactNode, useRef } from 'react';
|
|
5
5
|
|
|
6
6
|
import AccessibleButton from '../Utils/AccessibleButton';
|
|
7
|
+
import useFocusVisible from '../hooks/internal/useFocusVisible';
|
|
7
8
|
import useStyleSet from '../hooks/useStyleSet';
|
|
8
9
|
|
|
9
10
|
const { useStyleOptions } = hooks;
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
type IconButtonProps = {
|
|
13
|
+
alt?: string;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const IconButton: FC<IconButtonProps> = ({ alt, children, className, disabled, onClick }) => {
|
|
13
21
|
const [{ sendBoxButton: sendBoxButtonStyleSet }] = useStyleSet();
|
|
22
|
+
const [{ sendBoxButtonAlignment }] = useStyleOptions();
|
|
23
|
+
const buttonRef = useRef<HTMLButtonElement>();
|
|
24
|
+
|
|
25
|
+
const [focusVisible] = useFocusVisible(buttonRef);
|
|
14
26
|
|
|
15
27
|
return (
|
|
16
28
|
<AccessibleButton
|
|
@@ -18,16 +30,20 @@ const IconButton = ({ alt, children, className, disabled, onClick }) => {
|
|
|
18
30
|
sendBoxButtonStyleSet + '',
|
|
19
31
|
'webchat__icon-button',
|
|
20
32
|
{
|
|
33
|
+
'webchat__icon-button--focus-visible': focusVisible,
|
|
21
34
|
'webchat__icon-button--stretch': sendBoxButtonAlignment !== 'bottom' && sendBoxButtonAlignment !== 'top'
|
|
22
35
|
},
|
|
23
36
|
className + ''
|
|
24
37
|
)}
|
|
25
38
|
disabled={disabled}
|
|
26
39
|
onClick={disabled ? undefined : onClick}
|
|
40
|
+
ref={buttonRef}
|
|
27
41
|
title={alt}
|
|
28
42
|
type="button"
|
|
29
43
|
>
|
|
44
|
+
<div className="webchat__icon-button__shade" />
|
|
30
45
|
{children}
|
|
46
|
+
<div className="webchat__icon-button__keyboard-focus-indicator" />
|
|
31
47
|
</AccessibleButton>
|
|
32
48
|
);
|
|
33
49
|
};
|
|
@@ -6,7 +6,7 @@ import { hooks } from 'botframework-webchat-api';
|
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import memoize from 'memoize-one';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
|
-
import React, { useCallback, useState } from 'react';
|
|
9
|
+
import React, { FC, useCallback, useState } from 'react';
|
|
10
10
|
|
|
11
11
|
import connectToWebChat from '../connectToWebChat';
|
|
12
12
|
import IconButton from './IconButton';
|
|
@@ -66,38 +66,44 @@ const connectMicrophoneButton = (...selectors) => {
|
|
|
66
66
|
startDictate,
|
|
67
67
|
stopDictate,
|
|
68
68
|
stopSpeakingActivity,
|
|
69
|
-
webSpeechPonyfill
|
|
70
|
-
}) =>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
69
|
+
webSpeechPonyfill
|
|
70
|
+
}) => {
|
|
71
|
+
const { speechSynthesis, SpeechSynthesisUtterance } = webSpeechPonyfill || {};
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
click: () => {
|
|
75
|
+
if (dictateState === DictateState.WILL_START) {
|
|
76
|
+
stopSpeakingActivity();
|
|
77
|
+
} else if (dictateState === DictateState.DICTATING) {
|
|
78
|
+
stopDictate();
|
|
79
|
+
setSendBox(dictateInterims.join(' '));
|
|
80
|
+
} else {
|
|
81
|
+
stopSpeakingActivity();
|
|
82
|
+
startDictate();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
primeSpeechSynthesis(speechSynthesis, SpeechSynthesisUtterance);
|
|
86
|
+
},
|
|
87
|
+
dictating: dictateState === DictateState.DICTATING,
|
|
88
|
+
disabled: disabled || (dictateState === DictateState.STARTING && dictateState === DictateState.STOPPING),
|
|
89
|
+
language
|
|
90
|
+
};
|
|
91
|
+
},
|
|
88
92
|
...selectors
|
|
89
93
|
);
|
|
90
94
|
};
|
|
91
95
|
|
|
92
|
-
|
|
96
|
+
function useMicrophoneButtonClick(): () => void {
|
|
93
97
|
const [, setSendBox] = useSendBoxValue();
|
|
94
98
|
const [, setShouldSpeakIncomingActivity] = useShouldSpeakIncomingActivity();
|
|
95
|
-
const [{ speechSynthesis, SpeechSynthesisUtterance } = {}] = useWebSpeechPonyfill();
|
|
96
99
|
const [dictateInterims] = useDictateInterims();
|
|
97
100
|
const [dictateState] = useDictateState();
|
|
101
|
+
const [webSpeechPonyfill] = useWebSpeechPonyfill();
|
|
98
102
|
const startDictate = useStartDictate();
|
|
99
103
|
const stopDictate = useStopDictate();
|
|
100
104
|
|
|
105
|
+
const { speechSynthesis, SpeechSynthesisUtterance } = webSpeechPonyfill || {};
|
|
106
|
+
|
|
101
107
|
const [primeSpeechSynthesis] = useState(() =>
|
|
102
108
|
memoize((speechSynthesis, SpeechSynthesisUtterance) => {
|
|
103
109
|
if (speechSynthesis && SpeechSynthesisUtterance) {
|
|
@@ -134,9 +140,9 @@ const useMicrophoneButtonClick = () => {
|
|
|
134
140
|
startDictate,
|
|
135
141
|
stopDictate
|
|
136
142
|
]);
|
|
137
|
-
}
|
|
143
|
+
}
|
|
138
144
|
|
|
139
|
-
function useMicrophoneButtonDisabled() {
|
|
145
|
+
function useMicrophoneButtonDisabled(): [boolean] {
|
|
140
146
|
const [abortable] = useDictateAbortable();
|
|
141
147
|
const [dictateState] = useDictateState();
|
|
142
148
|
const [disabled] = useDisabled();
|
|
@@ -149,7 +155,11 @@ function useMicrophoneButtonDisabled() {
|
|
|
149
155
|
];
|
|
150
156
|
}
|
|
151
157
|
|
|
152
|
-
|
|
158
|
+
type MicrophoneButtonProps = {
|
|
159
|
+
className?: string;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const MicrophoneButton: FC<MicrophoneButtonProps> = ({ className }) => {
|
|
153
163
|
const [{ microphoneButton: microphoneButtonStyleSet }] = useStyleSet();
|
|
154
164
|
const [dictateState] = useDictateState();
|
|
155
165
|
const [disabled] = useMicrophoneButtonDisabled();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { hooks } from 'botframework-webchat-api';
|
|
2
|
+
import classNames from 'classnames';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
|
-
import React, { useCallback } from 'react';
|
|
4
|
+
import React, { FC, useCallback } from 'react';
|
|
4
5
|
|
|
5
6
|
import connectToWebChat from '../connectToWebChat';
|
|
6
7
|
import IconButton from './IconButton';
|
|
@@ -20,7 +21,11 @@ const connectSendButton = (...selectors) =>
|
|
|
20
21
|
...selectors
|
|
21
22
|
);
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
type SendButtonProps = {
|
|
25
|
+
className?: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const SendButton: FC<SendButtonProps> = ({ className }) => {
|
|
24
29
|
const [disabled] = useDisabled();
|
|
25
30
|
const focus = useFocus();
|
|
26
31
|
const localize = useLocalizer();
|
|
@@ -36,7 +41,7 @@ const SendButton = ({ className }) => {
|
|
|
36
41
|
return (
|
|
37
42
|
<IconButton
|
|
38
43
|
alt={localize('TEXT_INPUT_SEND_BUTTON_ALT')}
|
|
39
|
-
className={className}
|
|
44
|
+
className={classNames('webchat__send-button', className)}
|
|
40
45
|
disabled={disabled}
|
|
41
46
|
onClick={handleClick}
|
|
42
47
|
>
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { hooks } from 'botframework-webchat-api';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import React, { useCallback, useRef } from 'react';
|
|
4
|
+
import React, { MouseEventHandler, useCallback, useRef, VFC } from 'react';
|
|
5
5
|
|
|
6
6
|
import AccessibleButton from '../Utils/AccessibleButton';
|
|
7
7
|
import connectToWebChat from '../connectToWebChat';
|
|
8
8
|
import useFocus from '../hooks/useFocus';
|
|
9
9
|
import useFocusAccessKeyEffect from '../Utils/AccessKeySink/useFocusAccessKeyEffect';
|
|
10
|
+
import useFocusVisible from '../hooks/internal/useFocusVisible';
|
|
10
11
|
import useLocalizeAccessKey from '../hooks/internal/useLocalizeAccessKey';
|
|
11
12
|
import useScrollToEnd from '../hooks/useScrollToEnd';
|
|
12
13
|
import useSuggestedActionsAccessKey from '../hooks/internal/useSuggestedActionsAccessKey';
|
|
13
14
|
import useStyleSet from '../hooks/useStyleSet';
|
|
14
15
|
import useStyleToEmotionObject from '../hooks/internal/useStyleToEmotionObject';
|
|
16
|
+
import { DirectLineCardAction } from 'botframework-webchat-core';
|
|
15
17
|
|
|
16
18
|
const { useDirection, useDisabled, usePerformCardAction, useStyleOptions, useSuggestedActions } = hooks;
|
|
17
19
|
|
|
18
20
|
const ROOT_STYLE = {
|
|
19
21
|
'&.webchat__suggested-action': {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
overflow: 'hidden' // Prevent image from leaking; object-fit does not work with IE11
|
|
23
|
-
}
|
|
22
|
+
display: 'flex',
|
|
23
|
+
overflow: 'hidden' // Prevent image from leaking; object-fit does not work with IE11
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
|
|
@@ -37,8 +37,29 @@ const connectSuggestedAction = (...selectors) =>
|
|
|
37
37
|
...selectors
|
|
38
38
|
);
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
type SuggestedActionProps = {
|
|
41
|
+
buttonText: string;
|
|
42
|
+
className?: string;
|
|
43
|
+
displayText?: string;
|
|
44
|
+
image?: string;
|
|
45
|
+
imageAlt?: string;
|
|
46
|
+
text?: string;
|
|
47
|
+
textClassName?: string;
|
|
48
|
+
type?:
|
|
49
|
+
| 'call'
|
|
50
|
+
| 'downloadFile'
|
|
51
|
+
| 'imBack'
|
|
52
|
+
| 'messageBack'
|
|
53
|
+
| 'openUrl'
|
|
54
|
+
| 'playAudio'
|
|
55
|
+
| 'playVideo'
|
|
56
|
+
| 'postBack'
|
|
57
|
+
| 'showImage'
|
|
58
|
+
| 'signin';
|
|
59
|
+
value?: any;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const SuggestedAction: VFC<SuggestedActionProps> = ({
|
|
42
63
|
buttonText,
|
|
43
64
|
className,
|
|
44
65
|
displayText,
|
|
@@ -59,12 +80,16 @@ const SuggestedAction = ({
|
|
|
59
80
|
const focusRef = useRef();
|
|
60
81
|
const localizeAccessKey = useLocalizeAccessKey();
|
|
61
82
|
const performCardAction = usePerformCardAction();
|
|
62
|
-
const scrollToEnd = useScrollToEnd();
|
|
63
83
|
const rootClassName = useStyleToEmotionObject()(ROOT_STYLE) + '';
|
|
84
|
+
const scrollToEnd = useScrollToEnd();
|
|
64
85
|
|
|
65
|
-
const
|
|
86
|
+
const [focusVisible] = useFocusVisible(focusRef);
|
|
87
|
+
|
|
88
|
+
const handleClick = useCallback<MouseEventHandler<HTMLButtonElement>>(
|
|
66
89
|
({ target }) => {
|
|
67
|
-
|
|
90
|
+
// TODO: [P3] #XXX We should not destruct DirectLineCardAction into React props and pass them in. It makes typings difficult.
|
|
91
|
+
// Instead, we should pass a "cardAction" props.
|
|
92
|
+
performCardAction({ displayText, text, type, value } as DirectLineCardAction, { target });
|
|
68
93
|
|
|
69
94
|
// Since "openUrl" action do not submit, the suggested action buttons do not hide after click.
|
|
70
95
|
type === 'openUrl' && setSuggestedActions([]);
|
|
@@ -78,56 +103,52 @@ const SuggestedAction = ({
|
|
|
78
103
|
useFocusAccessKeyEffect(accessKey, focusRef);
|
|
79
104
|
|
|
80
105
|
return (
|
|
81
|
-
<
|
|
82
|
-
aria-
|
|
106
|
+
<AccessibleButton
|
|
107
|
+
{...(accessKey ? { 'aria-keyshortcuts': localizeAccessKey(accessKey) } : {})}
|
|
83
108
|
className={classNames(
|
|
84
109
|
'webchat__suggested-action',
|
|
85
|
-
{
|
|
110
|
+
{
|
|
111
|
+
'webchat__suggested-action--focus-visible': focusVisible,
|
|
112
|
+
'webchat__suggested-action--rtl': direction === 'rtl',
|
|
113
|
+
'webchat__suggested-action--wrapping': suggestedActionsStackedLayoutButtonTextWrap
|
|
114
|
+
},
|
|
86
115
|
rootClassName,
|
|
87
116
|
suggestedActionStyleSet + '',
|
|
88
117
|
(className || '') + ''
|
|
89
118
|
)}
|
|
119
|
+
disabled={disabled}
|
|
120
|
+
onClick={handleClick}
|
|
121
|
+
ref={focusRef}
|
|
122
|
+
type="button"
|
|
90
123
|
>
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
className={classNames(
|
|
105
|
-
'webchat__suggested-action__image',
|
|
106
|
-
direction === 'rtl' && 'webchat__suggested-action__image--rtl'
|
|
107
|
-
)}
|
|
108
|
-
src={image}
|
|
109
|
-
/>
|
|
110
|
-
)}
|
|
111
|
-
<span className={classNames('webchat__suggested-action__text', (textClassName || '') + '')}>{buttonText}</span>
|
|
112
|
-
</AccessibleButton>
|
|
113
|
-
</div>
|
|
124
|
+
{image && (
|
|
125
|
+
<img
|
|
126
|
+
alt={imageAlt}
|
|
127
|
+
className={classNames(
|
|
128
|
+
'webchat__suggested-action__image',
|
|
129
|
+
direction === 'rtl' && 'webchat__suggested-action__image--rtl'
|
|
130
|
+
)}
|
|
131
|
+
src={image}
|
|
132
|
+
/>
|
|
133
|
+
)}
|
|
134
|
+
<span className={classNames('webchat__suggested-action__text', (textClassName || '') + '')}>{buttonText}</span>
|
|
135
|
+
<div className="webchat__suggested-action__keyboard-focus-indicator" />
|
|
136
|
+
</AccessibleButton>
|
|
114
137
|
);
|
|
115
138
|
};
|
|
116
139
|
|
|
117
140
|
SuggestedAction.defaultProps = {
|
|
118
|
-
'aria-hidden': false,
|
|
119
141
|
className: '',
|
|
120
142
|
displayText: '',
|
|
121
143
|
image: '',
|
|
122
144
|
imageAlt: undefined,
|
|
123
145
|
text: '',
|
|
124
146
|
textClassName: '',
|
|
125
|
-
type:
|
|
147
|
+
type: undefined,
|
|
126
148
|
value: undefined
|
|
127
149
|
};
|
|
128
150
|
|
|
129
151
|
SuggestedAction.propTypes = {
|
|
130
|
-
'aria-hidden': PropTypes.bool,
|
|
131
152
|
buttonText: PropTypes.string.isRequired,
|
|
132
153
|
className: PropTypes.string,
|
|
133
154
|
displayText: PropTypes.string,
|
|
@@ -135,6 +156,8 @@ SuggestedAction.propTypes = {
|
|
|
135
156
|
imageAlt: PropTypes.string,
|
|
136
157
|
text: PropTypes.string,
|
|
137
158
|
textClassName: PropTypes.string,
|
|
159
|
+
// TypeScript class is not mappable to PropTypes.
|
|
160
|
+
// @ts-ignore
|
|
138
161
|
type: PropTypes.string,
|
|
139
162
|
value: PropTypes.any
|
|
140
163
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/* eslint react/no-array-index-key: "off" */
|
|
2
2
|
|
|
3
|
+
import { DirectLineCardAction } from 'botframework-webchat-core';
|
|
3
4
|
import { hooks } from 'botframework-webchat-api';
|
|
4
5
|
import BasicFilm, { createBasicStyleSet as createBasicStyleSetForReactFilm } from 'react-film';
|
|
5
6
|
import classNames from 'classnames';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
7
|
-
import React, { useMemo } from 'react';
|
|
8
|
+
import React, { FC, useMemo, useRef } from 'react';
|
|
8
9
|
|
|
9
10
|
import connectToWebChat from '../connectToWebChat';
|
|
10
11
|
import ScreenReaderText from '../ScreenReaderText';
|
|
@@ -150,7 +151,7 @@ const SuggestedActionFlowContainer = ({ children, className, screenReaderText })
|
|
|
150
151
|
{!!children && !!React.Children.count(children) && (
|
|
151
152
|
<div className="webchat__suggested-actions__flow-box">
|
|
152
153
|
{React.Children.map(children, child => (
|
|
153
|
-
<div className="webchat__suggested-
|
|
154
|
+
<div className="webchat__suggested-actions__flow-item-box">{child}</div>
|
|
154
155
|
))}
|
|
155
156
|
</div>
|
|
156
157
|
)}
|
|
@@ -206,9 +207,15 @@ SuggestedActionStackedContainer.propTypes = {
|
|
|
206
207
|
screenReaderText: PropTypes.string.isRequired
|
|
207
208
|
};
|
|
208
209
|
|
|
209
|
-
|
|
210
|
+
type SuggestedActionsProps = {
|
|
211
|
+
className?: string;
|
|
212
|
+
suggestedActions?: DirectLineCardAction[];
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const SuggestedActions: FC<SuggestedActionsProps> = ({ className, suggestedActions = [] }) => {
|
|
210
216
|
const [{ suggestedActionLayout, suggestedActionsStackedLayoutButtonTextWrap }] = useStyleOptions();
|
|
211
217
|
const [accessKey] = useSuggestedActionsAccessKey();
|
|
218
|
+
const hideEmptyRef = useRef(true);
|
|
212
219
|
const localize = useLocalizer();
|
|
213
220
|
const localizeAccessKey = useLocalizeAccessKey();
|
|
214
221
|
|
|
@@ -221,25 +228,63 @@ const SuggestedActions = ({ className, suggestedActions = [] }) => {
|
|
|
221
228
|
: localize('SUGGESTED_ACTIONS_ALT_NO_CONTENT')
|
|
222
229
|
);
|
|
223
230
|
|
|
224
|
-
const children = suggestedActions.map((
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
231
|
+
const children = suggestedActions.map((cardAction, index) => {
|
|
232
|
+
const { displayText, image, imageAltText, text, title, type, value } = cardAction as {
|
|
233
|
+
displayText?: string;
|
|
234
|
+
image?: string;
|
|
235
|
+
imageAltText?: string;
|
|
236
|
+
text?: string;
|
|
237
|
+
title?: string;
|
|
238
|
+
type:
|
|
239
|
+
| 'call'
|
|
240
|
+
| 'downloadFile'
|
|
241
|
+
| 'imBack'
|
|
242
|
+
| 'messageBack'
|
|
243
|
+
| 'openUrl'
|
|
244
|
+
| 'playAudio'
|
|
245
|
+
| 'playVideo'
|
|
246
|
+
| 'postBack'
|
|
247
|
+
| 'showImage'
|
|
248
|
+
| 'signin';
|
|
249
|
+
value?: { [key: string]: any } | string;
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
return (
|
|
253
|
+
<div className="webchat__suggested-actions__item-box" key={index}>
|
|
254
|
+
<SuggestedAction
|
|
255
|
+
buttonText={suggestedActionText({ displayText, title, type, value })}
|
|
256
|
+
className="webchat__suggested-actions__button"
|
|
257
|
+
displayText={displayText}
|
|
258
|
+
image={image}
|
|
259
|
+
imageAlt={imageAltText}
|
|
260
|
+
text={text}
|
|
261
|
+
textClassName={
|
|
262
|
+
suggestedActionLayout === 'stacked' && suggestedActionsStackedLayoutButtonTextWrap
|
|
263
|
+
? 'webchat__suggested-actions__button-text-stacked-text-wrap'
|
|
264
|
+
: 'webchat__suggested-actions__button-text'
|
|
265
|
+
}
|
|
266
|
+
type={type}
|
|
267
|
+
value={value}
|
|
268
|
+
/>
|
|
269
|
+
</div>
|
|
270
|
+
);
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
// (Related to #4021)
|
|
274
|
+
//
|
|
275
|
+
// To improve accessibility UX, if there are no suggested actions, and this container was never shown.
|
|
276
|
+
// Then, avoid rendering the alt-text "Suggested Actions Container: Is empty".
|
|
277
|
+
//
|
|
278
|
+
// This is to reduce the narration of "Is empty".
|
|
279
|
+
//
|
|
280
|
+
// After any suggested actions were shown during the lifetime of this container, then we will
|
|
281
|
+
// continue to start showing "Suggested Actions Container: Is empty" when the container is empty.
|
|
282
|
+
if (!children.length && hideEmptyRef.current) {
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Otherwise, if we have rendered once, we will continue to render "Is empty".
|
|
287
|
+
hideEmptyRef.current = false;
|
|
243
288
|
|
|
244
289
|
if (suggestedActionLayout === 'flow') {
|
|
245
290
|
return (
|
|
@@ -268,6 +313,9 @@ SuggestedActions.defaultProps = {
|
|
|
268
313
|
|
|
269
314
|
SuggestedActions.propTypes = {
|
|
270
315
|
className: PropTypes.string,
|
|
316
|
+
|
|
317
|
+
// TypeScript class is not mappable to PropTypes.func
|
|
318
|
+
// @ts-ignore
|
|
271
319
|
suggestedActions: PropTypes.arrayOf(
|
|
272
320
|
PropTypes.shape({
|
|
273
321
|
displayText: PropTypes.string,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { hooks } from 'botframework-webchat-api';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import React, { useCallback, useEffect, useRef } from 'react';
|
|
4
|
+
import React, { MutableRefObject, useCallback, useEffect, useRef } from 'react';
|
|
5
5
|
|
|
6
|
+
import { ie11 } from '../Utils/detectBrowser';
|
|
6
7
|
import AccessibleInputText from '../Utils/AccessibleInputText';
|
|
7
8
|
import AutoResizeTextArea from './AutoResizeTextArea';
|
|
8
9
|
import connectToWebChat from '../connectToWebChat';
|
|
@@ -66,7 +67,7 @@ const connectSendTextBox = (...selectors) =>
|
|
|
66
67
|
...selectors
|
|
67
68
|
);
|
|
68
69
|
|
|
69
|
-
function useTextBoxSubmit() {
|
|
70
|
+
function useTextBoxSubmit(): (setFocus?: boolean | 'sendBox') => void {
|
|
70
71
|
const [sendBoxValue] = useSendBoxValue();
|
|
71
72
|
const focus = useFocus();
|
|
72
73
|
const scrollToEnd = useScrollToEnd();
|
|
@@ -97,7 +98,13 @@ function useTextBoxSubmit() {
|
|
|
97
98
|
);
|
|
98
99
|
}
|
|
99
100
|
|
|
100
|
-
function useTextBoxValue()
|
|
101
|
+
function useTextBoxValue(): [
|
|
102
|
+
string,
|
|
103
|
+
(
|
|
104
|
+
textBoxValue: string,
|
|
105
|
+
options: { selectionEnd: number; selectionStart: number }
|
|
106
|
+
) => { selectionEnd: number; selectionStart: number; value: string }
|
|
107
|
+
] {
|
|
101
108
|
const [value, setValue] = useSendBoxValue();
|
|
102
109
|
const replaceEmoticon = useReplaceEmoticon();
|
|
103
110
|
const stopDictate = useStopDictate();
|
|
@@ -146,10 +153,14 @@ const TextBox = ({ className }) => {
|
|
|
146
153
|
const [{ sendBoxTextWrap }] = useStyleOptions();
|
|
147
154
|
const [disabled] = useDisabled();
|
|
148
155
|
const [textBoxValue, setTextBoxValue] = useTextBoxValue();
|
|
149
|
-
const inputElementRef = useRef();
|
|
156
|
+
const inputElementRef: MutableRefObject<HTMLInputElement & HTMLTextAreaElement> = useRef();
|
|
150
157
|
const localize = useLocalizer();
|
|
151
158
|
const placeCheckpointOnChangeRef = useRef(false);
|
|
152
|
-
const prevInputStateRef
|
|
159
|
+
const prevInputStateRef: MutableRefObject<{
|
|
160
|
+
selectionEnd: number;
|
|
161
|
+
selectionStart: number;
|
|
162
|
+
value: string;
|
|
163
|
+
}> = useRef();
|
|
153
164
|
const rootClassName = useStyleToEmotionObject()(ROOT_STYLE) + '';
|
|
154
165
|
const scrollDown = useScrollDown();
|
|
155
166
|
const scrollUp = useScrollUp();
|
|
@@ -332,7 +343,10 @@ const TextBox = ({ className }) => {
|
|
|
332
343
|
const { current } = inputElementRef;
|
|
333
344
|
|
|
334
345
|
if (current) {
|
|
335
|
-
|
|
346
|
+
// The "disable soft keyboard on mobile devices" logic will not work on IE11. It will cause the <input> to become read-only until next focus.
|
|
347
|
+
// Thus, no mobile devices carry IE11 so we don't need to explicitly disable soft keyboard on IE11.
|
|
348
|
+
// See #3757 for repro and details.
|
|
349
|
+
if (noKeyboard && !ie11) {
|
|
336
350
|
// To not activate the virtual keyboard while changing focus to an input, we will temporarily set it as read-only and flip it back.
|
|
337
351
|
// https://stackoverflow.com/questions/7610758/prevent-iphone-default-keyboard-when-focusing-an-input/7610923
|
|
338
352
|
const readOnly = current.getAttribute('readonly');
|
|
@@ -405,7 +419,7 @@ const TextBox = ({ className }) => {
|
|
|
405
419
|
placeholder={typeYourMessageString}
|
|
406
420
|
readOnly={disabled}
|
|
407
421
|
ref={inputElementRef}
|
|
408
|
-
rows=
|
|
422
|
+
rows={1}
|
|
409
423
|
textAreaClassName="webchat__send-box-text-box__html-text-area"
|
|
410
424
|
value={textBoxValue}
|
|
411
425
|
/>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { hooks } from 'botframework-webchat-api';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import React, { useCallback, useRef } from 'react';
|
|
4
|
+
import React, { FC, useCallback, useRef } from 'react';
|
|
5
5
|
|
|
6
6
|
import AttachmentIcon from './Assets/AttachmentIcon';
|
|
7
7
|
import connectToWebChat from '../connectToWebChat';
|
|
@@ -89,10 +89,14 @@ const connectUploadButton = (...selectors) =>
|
|
|
89
89
|
...selectors
|
|
90
90
|
);
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
type UploadButtonProps = {
|
|
93
|
+
className?: string;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const UploadButton: FC<UploadButtonProps> = ({ className }) => {
|
|
93
97
|
const [{ uploadButton: uploadButtonStyleSet }] = useStyleSet();
|
|
94
98
|
const [disabled] = useDisabled();
|
|
95
|
-
const inputRef = useRef();
|
|
99
|
+
const inputRef = useRef<HTMLInputElement>();
|
|
96
100
|
const localize = useLocalizer();
|
|
97
101
|
const rootClassName = useStyleToEmotionObject()(ROOT_STYLE) + '';
|
|
98
102
|
const sendFiles = useSendFiles();
|