botframework-webchat-component 4.13.0 → 4.14.2
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/.eslintignore +1 -9
- package/.eslintrc.yml +6 -0
- 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 +20 -30
- 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 +10 -12
- package/lib/Activity/StackedLayout.d.ts +18 -0
- package/lib/Activity/StackedLayout.d.ts.map +1 -0
- package/lib/Activity/StackedLayout.js +18 -14
- 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/FileContent.d.ts +10 -0
- package/lib/Attachment/FileContent.d.ts.map +1 -0
- package/lib/Attachment/FileContent.js +4 -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 +6 -5
- package/lib/BasicToast.js +4 -4
- package/lib/BasicToaster.js +4 -4
- package/lib/BasicTranscript.js +143 -123
- package/lib/BasicTypingIndicator.d.ts +5 -0
- package/lib/BasicTypingIndicator.d.ts.map +1 -0
- package/lib/BasicTypingIndicator.js +2 -2
- 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 +33 -55
- 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 +4 -4
- 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 +5 -3
- 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 +9 -9
- 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 +2 -2
- package/lib/Middleware/CardAction/createCoreMiddleware.js +2 -2
- 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 +3 -2
- 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 +64 -45
- 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 +2 -2
- package/lib/SendBox/IconButton.js +2 -2
- 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 +7 -5
- package/lib/SendBox/SuggestedAction.js +5 -9
- package/lib/SendBox/SuggestedActions.d.ts +5 -0
- package/lib/SendBox/SuggestedActions.d.ts.map +1 -0
- package/lib/SendBox/SuggestedActions.js +10 -7
- package/lib/SendBox/TextBox.d.ts +28 -0
- package/lib/SendBox/TextBox.d.ts.map +1 -0
- package/lib/SendBox/TextBox.js +12 -7
- package/lib/SendBox/UploadButton.d.ts +9 -0
- package/lib/SendBox/UploadButton.d.ts.map +1 -0
- package/lib/SendBox/UploadButton.js +5 -5
- 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 +77 -0
- package/lib/Styles/StyleSet/BasicTranscript.d.ts.map +1 -0
- 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 +1 -1
- 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/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 +33 -0
- package/lib/Styles/StyleSet/SendBoxButton.d.ts.map +1 -0
- package/lib/Styles/StyleSet/SendBoxTextBox.d.ts +41 -0
- package/lib/Styles/StyleSet/SendBoxTextBox.d.ts.map +1 -0
- 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/SuggestedAction.d.ts +49 -0
- package/lib/Styles/StyleSet/SuggestedAction.d.ts.map +1 -0
- package/lib/Styles/StyleSet/SuggestedAction.js +2 -2
- package/lib/Styles/StyleSet/SuggestedActions.d.ts +118 -0
- package/lib/Styles/StyleSet/SuggestedActions.d.ts.map +1 -0
- 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 +1103 -0
- package/lib/Styles/createStyleSet.d.ts.map +1 -0
- package/lib/Styles/createStyleSet.js +44 -41
- package/lib/Styles/mirrorStyle.js +2 -2
- 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 +1 -1
- 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/Utils/AccessKeySink/Surface.js +7 -5
- package/lib/Utils/AccessibleButton.js +6 -4
- 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.js +3 -3
- package/lib/Utils/InlineMarkdown.js +6 -6
- 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/navigableEvent.js +1 -1
- package/lib/Utils/activityAltText.js +100 -0
- package/lib/Utils/addTargetBlankToHyperlinksMarkdown.js +1 -1
- package/lib/Utils/createCustomEvent.js +1 -1
- package/lib/Utils/debounce.js +1 -1
- package/lib/Utils/detectBrowser.js +1 -1
- package/lib/Utils/downscaleImageToDataURL/downscaleImageToDataURLUsingWorker.js +2 -2
- package/lib/Utils/downscaleImageToDataURL/index.js +2 -2
- package/lib/Utils/filterMap.js +1 -1
- package/lib/Utils/findLastIndex.js +2 -2
- package/lib/Utils/mapMap.js +1 -1
- package/lib/Utils/readDataURIToBlob.js +2 -2
- package/lib/Utils/singleToArray.js +1 -1
- package/lib/connectToWebChat.js +5 -3
- package/lib/hooks/index.d.ts +21 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/index.js +1 -1
- package/lib/hooks/internal/BypassSpeechSynthesisPonyfill.js +97 -39
- package/lib/hooks/internal/UITracker.js +2 -2
- package/lib/hooks/internal/useAcknowledgedActivity.js +2 -2
- package/lib/hooks/internal/useDispatchScrollPosition.js +1 -1
- package/lib/hooks/internal/useDispatchTranscriptFocus.js +1 -1
- package/lib/hooks/internal/useEnterKeyHint.js +1 -1
- 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/useMemoize.js +2 -2
- package/lib/hooks/internal/useNavigatorPlatform.js +1 -1
- package/lib/hooks/internal/useNonce.js +1 -1
- 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/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/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 +209 -22
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +19 -19
- 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 +38 -38
- 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 +92 -0
- package/src/Activity/{Speak.js → Speak.tsx} +12 -5
- package/src/Activity/{StackedLayout.js → StackedLayout.tsx} +36 -11
- package/src/Attachment/Assets/DownloadIcon.js +8 -1
- package/src/Attachment/{AudioContent.js → AudioContent.tsx} +12 -3
- package/src/Attachment/{FileContent.js → FileContent.tsx} +10 -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 +4 -4
- package/src/BasicTranscript.js +114 -98
- package/src/{BasicTypingIndicator.js → BasicTypingIndicator.tsx} +1 -1
- package/src/{BasicWebChat.js → BasicWebChat.tsx} +13 -4
- package/src/{Composer.js → Composer.tsx} +41 -42
- package/src/Dictation.js +13 -4
- package/src/{ErrorBox.js → ErrorBox.tsx} +7 -2
- package/src/Middleware/Activity/{createCoreMiddleware.js → createCoreMiddleware.tsx} +2 -1
- 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 +8 -6
- package/src/Middleware/ActivityStatus/createTimestampMiddleware.js +10 -8
- package/src/Middleware/Attachment/{createCoreMiddleware.js → createCoreMiddleware.tsx} +8 -7
- package/src/Middleware/AttachmentForScreenReader/{createCoreMiddleware.js → createCoreMiddleware.tsx} +4 -3
- package/src/Middleware/Avatar/{createCoreMiddleware.js → createCoreMiddleware.tsx} +10 -3
- package/src/Middleware/CardAction/createCoreMiddleware.js +43 -41
- package/src/Middleware/GroupActivities/createCoreMiddleware.js +6 -4
- package/src/Middleware/ScrollToEndButton/ScrollToEndButton.js +45 -0
- package/src/Middleware/ScrollToEndButton/createScrollToEndButtonMiddleware.ts +17 -0
- package/src/Middleware/Toast/{createCoreMiddleware.js → createCoreMiddleware.tsx} +3 -1
- package/src/Middleware/TypingIndicator/{createCoreMiddleware.js → createCoreMiddleware.tsx} +3 -4
- package/src/{ReactWebChat.js → ReactWebChat.tsx} +25 -7
- package/src/ScreenReaderActivity.js +47 -37
- 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/{MicrophoneButton.js → MicrophoneButton.tsx} +35 -25
- package/src/SendBox/{SendButton.js → SendButton.tsx} +8 -3
- package/src/SendBox/SuggestedAction.js +1 -15
- package/src/SendBox/{SuggestedActions.js → SuggestedActions.tsx} +42 -21
- package/src/SendBox/{TextBox.js → TextBox.tsx} +21 -7
- package/src/SendBox/{UploadButton.js → UploadButton.tsx} +7 -3
- package/src/Styles/StyleSet/CarouselFilmStrip.ts +0 -20
- package/src/Styles/StyleSet/CarouselFilmStripAttachment.ts +56 -0
- package/src/Styles/StyleSet/ScrollToEndButton.ts +33 -31
- package/src/Styles/StyleSet/SuggestedAction.ts +1 -1
- package/src/Styles/createStyleSet.ts +41 -39
- package/src/Toast/CollapseIcon.js +9 -1
- package/src/Toast/DismissIcon.js +9 -1
- package/src/Toast/ExpandIcon.js +9 -1
- package/src/Toast/{createToastMiddleware.js → createToastMiddleware.tsx} +3 -2
- package/src/Utils/{AccessibleInputText.js → AccessibleInputText.tsx} +48 -5
- package/src/Utils/{AccessibleTextArea.js → AccessibleTextArea.tsx} +67 -6
- package/src/Utils/TypeFocusSink/FocusBox.js +4 -4
- package/src/Utils/TypeFocusSink/getTabIndex.ts +1 -1
- package/src/Utils/activityAltText.ts +135 -0
- package/src/Utils/findLastIndex.spec.js +2 -0
- package/src/Utils/intersectionOf.spec.js +2 -0
- package/src/Utils/mapMap.spec.js +2 -0
- package/src/Utils/removeInline.spec.js +2 -0
- package/src/Utils/{singleToArray.js → singleToArray.ts} +1 -1
- package/src/Utils/walkMarkdownTokens.spec.js +3 -3
- package/src/hooks/{index.js → index.ts} +1 -0
- package/src/hooks/internal/BypassSpeechSynthesisPonyfill.js +68 -17
- package/src/hooks/internal/useMemoize.spec.js +2 -0
- package/src/hooks/internal/useResumeAudioContext.ts +7 -0
- package/src/hooks/internal/useScrollRelative.js +4 -3
- package/src/hooks/internal/{useUniqueId.js → useUniqueId.ts} +1 -1
- 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.js → useRenderMarkdownAsHTML.ts} +6 -2
- package/src/hooks/{useScrollDown.js → useScrollDown.ts} +1 -1
- package/src/hooks/{useScrollTo.js → useScrollTo.ts} +5 -1
- package/src/hooks/{useScrollToEnd.js → useScrollToEnd.ts} +1 -1
- 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 -11
- package/src/tsconfig.json +1 -1
- package/src/types/ScrollPosition.ts +6 -0
- package/lib/Activity/ScrollToEndButton.js +0 -81
- package/lib/Attachment/Assets/ErrorIcon.js +0 -22
- package/lib/Utils/remarkStripMarkdown.js +0 -26
- 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/Utils/remarkStripMarkdown.js +0 -13
- package/src/hooks/internal/useStripMarkdown.js +0 -7
- package/src/hooks/useWebSpeechPonyfill.js +0 -5
- package/src/index.tsx +0 -35
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* eslint no-magic-numbers: ["error", { "ignore": [2] }] */
|
|
2
|
+
import { StrictStyleOptions } from 'botframework-webchat-api';
|
|
3
|
+
|
|
4
|
+
import mirrorStyle from '../mirrorStyle';
|
|
5
|
+
|
|
6
|
+
export default function CarouselFilmStripAttachment({
|
|
7
|
+
avatarSize,
|
|
8
|
+
bubbleMaxWidth,
|
|
9
|
+
bubbleMinWidth,
|
|
10
|
+
paddingRegular,
|
|
11
|
+
transcriptVisualKeyboardIndicatorColor,
|
|
12
|
+
transcriptVisualKeyboardIndicatorStyle,
|
|
13
|
+
transcriptVisualKeyboardIndicatorWidth,
|
|
14
|
+
transitionDuration
|
|
15
|
+
}: StrictStyleOptions) {
|
|
16
|
+
return {
|
|
17
|
+
'&.webchat__carousel-filmstrip-attachment': {
|
|
18
|
+
minWidth: bubbleMinWidth,
|
|
19
|
+
maxWidth: bubbleMaxWidth,
|
|
20
|
+
transitionDuration,
|
|
21
|
+
transitionProperty: 'max-width, min-width',
|
|
22
|
+
|
|
23
|
+
'&:focus': {
|
|
24
|
+
outline: 0
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
'&:focus .webchat__carousel-filmstrip-attachment--focus': {
|
|
28
|
+
borderColor: transcriptVisualKeyboardIndicatorColor,
|
|
29
|
+
borderStyle: transcriptVisualKeyboardIndicatorStyle,
|
|
30
|
+
borderWidth: transcriptVisualKeyboardIndicatorWidth,
|
|
31
|
+
boxSizing: 'border-box',
|
|
32
|
+
height: `calc(100% - ${transcriptVisualKeyboardIndicatorWidth}px)`,
|
|
33
|
+
left: 0,
|
|
34
|
+
pointerEvents: 'none',
|
|
35
|
+
position: 'absolute',
|
|
36
|
+
top: 0,
|
|
37
|
+
width: `calc(100% - ${transcriptVisualKeyboardIndicatorWidth}px)`
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
...mirrorStyle('&.webchat__carousel-filmstrip-attachment--rtl', {
|
|
41
|
+
paddingLeft: paddingRegular,
|
|
42
|
+
|
|
43
|
+
'&.webchat__carousel-filmstrip-attachment--hide-avatar, &.webchat__carousel-filmstrip-attachment--show-avatar': {
|
|
44
|
+
'&:first-child': {
|
|
45
|
+
paddingLeft: avatarSize + paddingRegular * 2
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
'&.webchat__carousel-filmstrip-attachment--hide-nub, &.webchat__carousel-filmstrip-attachment--show-nub': {
|
|
50
|
+
'&:not(.webchat__carousel-filmstrip-attachment--hide-avatar.webchat__carousel-filmstrip-attachment--show-avatar):first-child': {
|
|
51
|
+
paddingLeft: paddingRegular * 2
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { StrictStyleOptions } from 'botframework-webchat-api';
|
|
2
2
|
|
|
3
3
|
export default function createScrollToEndButtonStyle({
|
|
4
|
-
newMessagesButtonFontSize,
|
|
5
4
|
paddingRegular,
|
|
6
5
|
primaryFont,
|
|
6
|
+
scrollToEndButtonFontSize,
|
|
7
7
|
transcriptOverlayButtonBackground,
|
|
8
8
|
transcriptOverlayButtonBackgroundOnFocus,
|
|
9
9
|
transcriptOverlayButtonBackgroundOnHover,
|
|
@@ -12,41 +12,43 @@ export default function createScrollToEndButtonStyle({
|
|
|
12
12
|
transcriptOverlayButtonColorOnHover
|
|
13
13
|
}: StrictStyleOptions) {
|
|
14
14
|
return {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
'&.webchat__scroll-to-end-button': {
|
|
16
|
+
// TODO: [P3] Can we not to unset borderWidth and outline earlier?
|
|
17
|
+
'@media screen and (-ms-high-contrast: active)': {
|
|
18
|
+
borderWidth: 'initial',
|
|
19
|
+
outline: 'initial'
|
|
20
|
+
},
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
appearance: 'none',
|
|
23
|
+
backgroundColor: transcriptOverlayButtonBackground,
|
|
24
|
+
borderRadius: paddingRegular,
|
|
25
|
+
borderWidth: 0,
|
|
26
|
+
bottom: 5,
|
|
27
|
+
color: transcriptOverlayButtonColor,
|
|
28
|
+
fontFamily: primaryFont,
|
|
29
|
+
fontSize: scrollToEndButtonFontSize,
|
|
30
|
+
outline: 0,
|
|
31
|
+
padding: paddingRegular,
|
|
32
|
+
position: 'absolute',
|
|
33
|
+
zIndex: 1, // We formed a stacking context in the parent container, so we can use "z-index" here.
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
'&:hover': {
|
|
36
|
+
backgroundColor: transcriptOverlayButtonBackgroundOnHover,
|
|
37
|
+
color: transcriptOverlayButtonColorOnHover || transcriptOverlayButtonColor
|
|
38
|
+
},
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
'&:focus': {
|
|
41
|
+
backgroundColor: transcriptOverlayButtonBackgroundOnFocus,
|
|
42
|
+
color: transcriptOverlayButtonColorOnFocus || transcriptOverlayButtonColor
|
|
43
|
+
},
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
'&:not(.webchat__scroll-to-end-button--rtl)': {
|
|
46
|
+
right: 20
|
|
47
|
+
},
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
'&.webchat__scroll-to-end-button--rtl': {
|
|
50
|
+
left: 20
|
|
51
|
+
}
|
|
50
52
|
}
|
|
51
53
|
};
|
|
52
54
|
}
|
|
@@ -66,7 +66,7 @@ export default function createSuggestedActionStyle({
|
|
|
66
66
|
height: 'auto',
|
|
67
67
|
maxHeight: suggestedActionsStackedLayoutButtonMaxHeight || '100%',
|
|
68
68
|
minHeight:
|
|
69
|
-
typeof suggestedActionsStackedLayoutButtonMaxHeight === 'number'
|
|
69
|
+
typeof suggestedActionsStackedLayoutButtonMaxHeight === 'number' && typeof suggestedActionHeight === 'number'
|
|
70
70
|
? Math.min(suggestedActionsStackedLayoutButtonMaxHeight, suggestedActionHeight)
|
|
71
71
|
: suggestedActionHeight
|
|
72
72
|
},
|
|
@@ -9,6 +9,7 @@ import createAvatarStyle from './StyleSet/Avatar';
|
|
|
9
9
|
import createBasicTranscriptStyle from './StyleSet/BasicTranscript';
|
|
10
10
|
import createBubbleStyle from './StyleSet/Bubble';
|
|
11
11
|
import createCarouselFilmStrip from './StyleSet/CarouselFilmStrip';
|
|
12
|
+
import createCarouselFilmStripAttachment from './StyleSet/CarouselFilmStripAttachment';
|
|
12
13
|
import createCarouselFlipper from './StyleSet/CarouselFlipper';
|
|
13
14
|
import createConnectivityNotification from './StyleSet/ConnectivityNotification';
|
|
14
15
|
import createDictationInterimsStyle from './StyleSet/DictationInterims';
|
|
@@ -45,49 +46,50 @@ 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
|
+
microphoneButton: createMicrophoneButtonStyle(strictStyleOptions),
|
|
71
|
+
options: { ...strictStyleOptions }, // Cloned to make sure no additional modifications will propagate up.
|
|
72
|
+
root: createRootStyle(strictStyleOptions),
|
|
73
|
+
scrollToEndButton: createScrollToEndButtonStyle(strictStyleOptions),
|
|
74
|
+
sendBox: createSendBoxStyle(strictStyleOptions),
|
|
75
|
+
sendBoxButton: createSendBoxButtonStyle(strictStyleOptions),
|
|
76
|
+
sendBoxTextBox: createSendBoxTextBoxStyle(strictStyleOptions),
|
|
77
|
+
sendStatus: createSendStatusStyle(strictStyleOptions),
|
|
78
|
+
singleAttachmentActivity: createSingleAttachmentActivityStyle(strictStyleOptions),
|
|
79
|
+
spinnerAnimation: createSpinnerAnimationStyle(strictStyleOptions),
|
|
80
|
+
stackedLayout: createStackedLayoutStyle(strictStyleOptions),
|
|
81
|
+
suggestedAction: createSuggestedActionStyle(strictStyleOptions),
|
|
82
|
+
suggestedActions: createSuggestedActionsStyle(strictStyleOptions),
|
|
83
|
+
textContent: createTextContentStyle(strictStyleOptions),
|
|
84
|
+
toast: createToastStyle(strictStyleOptions),
|
|
85
|
+
toaster: createToasterStyle(strictStyleOptions),
|
|
86
|
+
typingAnimation: createTypingAnimationStyle(strictStyleOptions),
|
|
87
|
+
typingIndicator: createTypingIndicatorStyle(strictStyleOptions),
|
|
88
|
+
uploadButton: createUploadButtonStyle(strictStyleOptions),
|
|
87
89
|
videoAttachment: createVideoAttachmentStyle(),
|
|
88
|
-
videoContent: createVideoContentStyle(
|
|
89
|
-
vimeoContent: createVimeoContentStyle(
|
|
90
|
-
warningNotification: createWarningNotificationStyle(
|
|
91
|
-
youTubeContent: createYouTubeContentStyle(
|
|
90
|
+
videoContent: createVideoContentStyle(strictStyleOptions),
|
|
91
|
+
vimeoContent: createVimeoContentStyle(strictStyleOptions),
|
|
92
|
+
warningNotification: createWarningNotificationStyle(strictStyleOptions),
|
|
93
|
+
youTubeContent: createYouTubeContentStyle(strictStyleOptions)
|
|
92
94
|
};
|
|
93
95
|
}
|
|
@@ -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,10 +1,11 @@
|
|
|
1
|
-
/* eslint react/prop-types: "off"*/
|
|
1
|
+
/* eslint react/prop-types: "off" */
|
|
2
2
|
|
|
3
|
+
import { ToastMiddleware } from 'botframework-webchat-api';
|
|
3
4
|
import React from 'react';
|
|
4
5
|
|
|
5
6
|
import BasicToast from '../BasicToast';
|
|
6
7
|
|
|
7
|
-
function createToastMiddleware() {
|
|
8
|
+
function createToastMiddleware(): ToastMiddleware {
|
|
8
9
|
return () => () => ({ notification }) => <BasicToast notification={notification} />;
|
|
9
10
|
}
|
|
10
11
|
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
/* eslint no-magic-numbers: ["error", { "ignore": [-1] }] */
|
|
2
2
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import React, {
|
|
4
|
+
import React, {
|
|
5
|
+
ChangeEventHandler,
|
|
6
|
+
FocusEventHandler,
|
|
7
|
+
forwardRef,
|
|
8
|
+
KeyboardEventHandler,
|
|
9
|
+
ReactEventHandler,
|
|
10
|
+
useRef
|
|
11
|
+
} from 'react';
|
|
5
12
|
|
|
6
13
|
import useEnterKeyHint from '../hooks/internal/useEnterKeyHint';
|
|
7
14
|
|
|
@@ -23,9 +30,28 @@ import useEnterKeyHint from '../hooks/internal/useEnterKeyHint';
|
|
|
23
30
|
// - aria-disabled="true" is the source of truth
|
|
24
31
|
// - If the widget is contained by a <form>, the developer need to filter out some `onSubmit` event caused by this widget
|
|
25
32
|
|
|
26
|
-
|
|
33
|
+
type AccessibleInputTextProps = {
|
|
34
|
+
className?: string;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
enterKeyHint?: string;
|
|
37
|
+
inputMode?: 'text' | 'none' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
|
|
38
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
39
|
+
onFocus?: FocusEventHandler<HTMLInputElement>;
|
|
40
|
+
onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
|
|
41
|
+
onKeyDownCapture?: KeyboardEventHandler<HTMLInputElement>;
|
|
42
|
+
onKeyPress?: KeyboardEventHandler<HTMLInputElement>;
|
|
43
|
+
onSelect?: ReactEventHandler<HTMLInputElement>;
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
readOnly?: boolean;
|
|
46
|
+
tabIndex?: number;
|
|
47
|
+
type: 'text';
|
|
48
|
+
value?: string;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const AccessibleInputText = forwardRef<HTMLInputElement, AccessibleInputTextProps>(
|
|
27
52
|
(
|
|
28
53
|
{
|
|
54
|
+
className,
|
|
29
55
|
disabled,
|
|
30
56
|
enterKeyHint,
|
|
31
57
|
onChange,
|
|
@@ -34,7 +60,10 @@ const AccessibleInputText = forwardRef(
|
|
|
34
60
|
onKeyDownCapture,
|
|
35
61
|
onKeyPress,
|
|
36
62
|
onSelect,
|
|
63
|
+
placeholder,
|
|
64
|
+
readOnly,
|
|
37
65
|
tabIndex,
|
|
66
|
+
value,
|
|
38
67
|
...props
|
|
39
68
|
},
|
|
40
69
|
forwardedRef
|
|
@@ -48,15 +77,18 @@ const AccessibleInputText = forwardRef(
|
|
|
48
77
|
return (
|
|
49
78
|
<input
|
|
50
79
|
aria-disabled={disabled || undefined}
|
|
80
|
+
className={className}
|
|
51
81
|
onChange={disabled ? undefined : onChange}
|
|
52
82
|
onFocus={disabled ? undefined : onFocus}
|
|
53
83
|
onKeyDown={disabled ? undefined : onKeyDown}
|
|
54
84
|
onKeyDownCapture={disabled ? undefined : onKeyDownCapture}
|
|
55
85
|
onKeyPress={disabled ? undefined : onKeyPress}
|
|
56
86
|
onSelect={disabled ? undefined : onSelect}
|
|
57
|
-
|
|
87
|
+
placeholder={placeholder}
|
|
88
|
+
readOnly={readOnly || disabled}
|
|
58
89
|
ref={ref}
|
|
59
90
|
tabIndex={disabled ? -1 : tabIndex}
|
|
91
|
+
value={value}
|
|
60
92
|
{...props}
|
|
61
93
|
type="text"
|
|
62
94
|
/>
|
|
@@ -65,30 +97,41 @@ const AccessibleInputText = forwardRef(
|
|
|
65
97
|
);
|
|
66
98
|
|
|
67
99
|
AccessibleInputText.defaultProps = {
|
|
100
|
+
className: undefined,
|
|
68
101
|
disabled: undefined,
|
|
69
102
|
enterKeyHint: undefined,
|
|
103
|
+
inputMode: undefined,
|
|
70
104
|
onChange: undefined,
|
|
71
105
|
onFocus: undefined,
|
|
72
106
|
onKeyDown: undefined,
|
|
73
107
|
onKeyDownCapture: undefined,
|
|
74
108
|
onKeyPress: undefined,
|
|
75
109
|
onSelect: undefined,
|
|
76
|
-
|
|
110
|
+
placeholder: undefined,
|
|
111
|
+
readOnly: undefined,
|
|
112
|
+
tabIndex: undefined,
|
|
113
|
+
value: undefined
|
|
77
114
|
};
|
|
78
115
|
|
|
79
116
|
AccessibleInputText.displayName = 'AccessibleInputText';
|
|
80
117
|
|
|
81
118
|
AccessibleInputText.propTypes = {
|
|
119
|
+
className: PropTypes.string,
|
|
82
120
|
disabled: PropTypes.bool,
|
|
83
121
|
enterKeyHint: PropTypes.string,
|
|
122
|
+
inputMode: PropTypes.oneOf(['text', 'none', 'tel', 'url', 'email', 'numeric', 'decimal', 'search']),
|
|
84
123
|
onChange: PropTypes.func,
|
|
85
124
|
onFocus: PropTypes.func,
|
|
86
125
|
onKeyDown: PropTypes.func,
|
|
87
126
|
onKeyDownCapture: PropTypes.func,
|
|
88
127
|
onKeyPress: PropTypes.func,
|
|
89
128
|
onSelect: PropTypes.func,
|
|
129
|
+
placeholder: PropTypes.string,
|
|
130
|
+
readOnly: PropTypes.bool,
|
|
90
131
|
tabIndex: PropTypes.number,
|
|
91
|
-
type
|
|
132
|
+
// @ts-ignore PropTypes and TypeScript type do not well understood each other.
|
|
133
|
+
type: PropTypes.oneOf(['text']).isRequired,
|
|
134
|
+
value: PropTypes.string
|
|
92
135
|
};
|
|
93
136
|
|
|
94
137
|
export default AccessibleInputText;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
/* eslint no-magic-numbers: ["error", { "ignore": [-1] }] */
|
|
2
2
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import React, {
|
|
4
|
+
import React, {
|
|
5
|
+
ChangeEventHandler,
|
|
6
|
+
FocusEventHandler,
|
|
7
|
+
forwardRef,
|
|
8
|
+
KeyboardEventHandler,
|
|
9
|
+
ReactEventHandler,
|
|
10
|
+
useRef
|
|
11
|
+
} from 'react';
|
|
5
12
|
|
|
6
13
|
// Differences between <textarea> and <AccessibleTextArea>:
|
|
7
14
|
// - Disable behavior
|
|
@@ -21,8 +28,43 @@ import React, { forwardRef, useRef } from 'react';
|
|
|
21
28
|
// - aria-disabled="true" is the source of truth
|
|
22
29
|
// - If the widget is contained by a <form>, the developer need to filter out some `onSubmit` event caused by this widget
|
|
23
30
|
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
type AccessibleTextAreaProps = {
|
|
32
|
+
className?: string;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
inputMode?: 'text' | 'none' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
|
|
35
|
+
onChange?: ChangeEventHandler<HTMLTextAreaElement>;
|
|
36
|
+
onFocus?: FocusEventHandler<HTMLTextAreaElement>;
|
|
37
|
+
onKeyDown?: KeyboardEventHandler<HTMLTextAreaElement>;
|
|
38
|
+
onKeyDownCapture?: KeyboardEventHandler<HTMLTextAreaElement>;
|
|
39
|
+
onKeyPress?: KeyboardEventHandler<HTMLTextAreaElement>;
|
|
40
|
+
onSelect?: ReactEventHandler<HTMLTextAreaElement>;
|
|
41
|
+
placeholder?: string;
|
|
42
|
+
readOnly?: boolean;
|
|
43
|
+
rows?: number;
|
|
44
|
+
tabIndex?: number;
|
|
45
|
+
value?: string;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const AccessibleTextArea = forwardRef<HTMLTextAreaElement, AccessibleTextAreaProps>(
|
|
49
|
+
(
|
|
50
|
+
{
|
|
51
|
+
className,
|
|
52
|
+
disabled,
|
|
53
|
+
inputMode,
|
|
54
|
+
onChange,
|
|
55
|
+
onFocus,
|
|
56
|
+
onKeyDown,
|
|
57
|
+
onKeyDownCapture,
|
|
58
|
+
onKeyPress,
|
|
59
|
+
onSelect,
|
|
60
|
+
placeholder,
|
|
61
|
+
readOnly,
|
|
62
|
+
rows,
|
|
63
|
+
tabIndex,
|
|
64
|
+
...props
|
|
65
|
+
},
|
|
66
|
+
forwardedRef
|
|
67
|
+
) => {
|
|
26
68
|
const targetRef = useRef();
|
|
27
69
|
|
|
28
70
|
const ref = forwardedRef || targetRef;
|
|
@@ -30,13 +72,18 @@ const AccessibleTextArea = forwardRef(
|
|
|
30
72
|
return (
|
|
31
73
|
<textarea
|
|
32
74
|
aria-disabled={disabled || undefined}
|
|
75
|
+
className={className}
|
|
76
|
+
inputMode={inputMode}
|
|
33
77
|
onChange={disabled ? undefined : onChange}
|
|
34
78
|
onFocus={disabled ? undefined : onFocus}
|
|
35
79
|
onKeyDown={disabled ? undefined : onKeyDown}
|
|
80
|
+
onKeyDownCapture={disabled ? undefined : onKeyDownCapture}
|
|
36
81
|
onKeyPress={disabled ? undefined : onKeyPress}
|
|
37
82
|
onSelect={disabled ? undefined : onSelect}
|
|
38
|
-
|
|
83
|
+
placeholder={placeholder}
|
|
84
|
+
readOnly={readOnly || disabled}
|
|
39
85
|
ref={ref}
|
|
86
|
+
rows={rows}
|
|
40
87
|
tabIndex={disabled ? -1 : tabIndex}
|
|
41
88
|
{...props}
|
|
42
89
|
/>
|
|
@@ -45,25 +92,39 @@ const AccessibleTextArea = forwardRef(
|
|
|
45
92
|
);
|
|
46
93
|
|
|
47
94
|
AccessibleTextArea.defaultProps = {
|
|
95
|
+
className: undefined,
|
|
48
96
|
disabled: undefined,
|
|
97
|
+
inputMode: undefined,
|
|
49
98
|
onChange: undefined,
|
|
50
99
|
onFocus: undefined,
|
|
51
100
|
onKeyDown: undefined,
|
|
101
|
+
onKeyDownCapture: undefined,
|
|
52
102
|
onKeyPress: undefined,
|
|
53
103
|
onSelect: undefined,
|
|
54
|
-
|
|
104
|
+
placeholder: undefined,
|
|
105
|
+
readOnly: undefined,
|
|
106
|
+
rows: undefined,
|
|
107
|
+
tabIndex: undefined,
|
|
108
|
+
value: undefined
|
|
55
109
|
};
|
|
56
110
|
|
|
57
111
|
AccessibleTextArea.displayName = 'AccessibleTextArea';
|
|
58
112
|
|
|
59
113
|
AccessibleTextArea.propTypes = {
|
|
114
|
+
className: PropTypes.string,
|
|
60
115
|
disabled: PropTypes.bool,
|
|
116
|
+
inputMode: PropTypes.oneOf(['text', 'none', 'tel', 'url', 'email', 'numeric', 'decimal', 'search']),
|
|
61
117
|
onChange: PropTypes.func,
|
|
62
118
|
onFocus: PropTypes.func,
|
|
63
119
|
onKeyDown: PropTypes.func,
|
|
120
|
+
onKeyDownCapture: PropTypes.func,
|
|
64
121
|
onKeyPress: PropTypes.func,
|
|
65
122
|
onSelect: PropTypes.func,
|
|
66
|
-
|
|
123
|
+
placeholder: PropTypes.string,
|
|
124
|
+
readOnly: PropTypes.bool,
|
|
125
|
+
rows: PropTypes.number,
|
|
126
|
+
tabIndex: PropTypes.number,
|
|
127
|
+
value: PropTypes.string
|
|
67
128
|
};
|
|
68
129
|
|
|
69
130
|
export default AccessibleTextArea;
|
|
@@ -12,10 +12,10 @@ const DEFAULT_STYLE = { outline: 0 };
|
|
|
12
12
|
|
|
13
13
|
const BaseFocusBox = ({ children, disabled, onKeyDownCapture, sendFocusRef: sendFocusRefProp, ...otherProps }, ref) => {
|
|
14
14
|
const sendFocusRefPersist = useRef(null);
|
|
15
|
-
const patchedSendFocusRef = useMemo(
|
|
16
|
-
sendFocusRefPersist,
|
|
17
|
-
sendFocusRefProp
|
|
18
|
-
|
|
15
|
+
const patchedSendFocusRef = useMemo(
|
|
16
|
+
() => sendFocusRefProp || sendFocusRefPersist,
|
|
17
|
+
[sendFocusRefPersist, sendFocusRefProp]
|
|
18
|
+
);
|
|
19
19
|
|
|
20
20
|
const context = useMemo(
|
|
21
21
|
() => ({
|
|
@@ -19,7 +19,7 @@ const IE_FOCUSABLE_LIST = [
|
|
|
19
19
|
const IS_FIREFOX = /Firefox\//iu.test(userAgent);
|
|
20
20
|
const IS_IE = /Trident\//iu.test(userAgent);
|
|
21
21
|
|
|
22
|
-
export default function getTabIndex(element) {
|
|
22
|
+
export default function getTabIndex(element: HTMLElement): number | null {
|
|
23
23
|
const { tabIndex } = element;
|
|
24
24
|
|
|
25
25
|
if (IS_IE) {
|