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,9 +1,10 @@
|
|
|
1
1
|
/* eslint complexity: ["error", 30] */
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { DirectLineActivity } from 'botframework-webchat-core';
|
|
4
|
+
import { hooks, RenderAttachment } from 'botframework-webchat-api';
|
|
4
5
|
import classNames from 'classnames';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
|
-
import React from 'react';
|
|
7
|
+
import React, { FC, ReactNode } from 'react';
|
|
7
8
|
|
|
8
9
|
import Bubble from './Bubble';
|
|
9
10
|
import connectToWebChat from '../connectToWebChat';
|
|
@@ -21,9 +22,10 @@ const ROOT_STYLE = {
|
|
|
21
22
|
'&.webchat__stacked-layout': {
|
|
22
23
|
position: 'relative', // This is to keep screen reader text in the destinated area.
|
|
23
24
|
|
|
24
|
-
'& .webchat__stacked-layout__attachment-row, & .webchat__stacked-layout__main, & .webchat__stacked-layout__message-row, & .webchat__stacked-layout__status':
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
'& .webchat__stacked-layout__attachment-row, & .webchat__stacked-layout__main, & .webchat__stacked-layout__message-row, & .webchat__stacked-layout__status':
|
|
26
|
+
{
|
|
27
|
+
display: 'flex'
|
|
28
|
+
},
|
|
27
29
|
|
|
28
30
|
'& .webchat__stacked-layout__alignment-pad': {
|
|
29
31
|
flexShrink: 0
|
|
@@ -40,9 +42,10 @@ const ROOT_STYLE = {
|
|
|
40
42
|
},
|
|
41
43
|
|
|
42
44
|
'&.webchat__stacked-layout--from-user': {
|
|
43
|
-
'& .webchat__stacked-layout__attachment-row, & .webchat__stacked-layout__main, & .webchat__stacked-layout__message-row, & .webchat__stacked-layout__status':
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
'& .webchat__stacked-layout__attachment-row, & .webchat__stacked-layout__main, & .webchat__stacked-layout__message-row, & .webchat__stacked-layout__status':
|
|
46
|
+
{
|
|
47
|
+
flexDirection: 'row-reverse'
|
|
48
|
+
}
|
|
46
49
|
},
|
|
47
50
|
|
|
48
51
|
'& .webchat__stacked-layout__content': {
|
|
@@ -73,7 +76,7 @@ const connectStackedLayout = (...selectors) =>
|
|
|
73
76
|
options: { botAvatarInitials, userAvatarInitials }
|
|
74
77
|
}
|
|
75
78
|
},
|
|
76
|
-
{ activity: { from: { role } = {} } = {} }
|
|
79
|
+
{ activity: { from: { role = undefined } = {} } = {} }
|
|
77
80
|
) => ({
|
|
78
81
|
avatarInitials: role === 'user' ? userAvatarInitials : botAvatarInitials,
|
|
79
82
|
language,
|
|
@@ -85,7 +88,16 @@ const connectStackedLayout = (...selectors) =>
|
|
|
85
88
|
...selectors
|
|
86
89
|
);
|
|
87
90
|
|
|
88
|
-
|
|
91
|
+
type StackedLayoutProps = {
|
|
92
|
+
activity: DirectLineActivity;
|
|
93
|
+
hideTimestamp?: boolean;
|
|
94
|
+
renderActivityStatus?: (({ hideTimestamp: boolean }) => Exclude<ReactNode, boolean | null | undefined>) | false;
|
|
95
|
+
renderAttachment?: RenderAttachment;
|
|
96
|
+
renderAvatar?: (activity: DirectLineActivity) => (() => Exclude<ReactNode, boolean | null | undefined>) | false;
|
|
97
|
+
showCallout?: boolean;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const StackedLayout: FC<StackedLayoutProps> = ({
|
|
89
101
|
activity,
|
|
90
102
|
hideTimestamp,
|
|
91
103
|
renderActivityStatus,
|
|
@@ -93,14 +105,15 @@ const StackedLayout = ({
|
|
|
93
105
|
renderAvatar,
|
|
94
106
|
showCallout
|
|
95
107
|
}) => {
|
|
96
|
-
const [
|
|
108
|
+
const [styleOptions] = useStyleOptions();
|
|
97
109
|
const [{ initials: botInitials }] = useAvatarForBot();
|
|
98
110
|
const [{ initials: userInitials }] = useAvatarForUser();
|
|
99
111
|
const [{ stackedLayout: stackedLayoutStyleSet }] = useStyleSet();
|
|
100
112
|
const ariaLabelId = useUniqueId('webchat__stacked-layout__id');
|
|
101
113
|
const localize = useLocalizer();
|
|
102
114
|
const rootClassName = useStyleToEmotionObject()(ROOT_STYLE) + '';
|
|
103
|
-
|
|
115
|
+
|
|
116
|
+
const { bubbleNubOffset, bubbleNubSize, bubbleFromUserNubOffset, bubbleFromUserNubSize } = styleOptions;
|
|
104
117
|
|
|
105
118
|
const {
|
|
106
119
|
attachments = [],
|
|
@@ -108,15 +121,20 @@ const StackedLayout = ({
|
|
|
108
121
|
from: { role } = {},
|
|
109
122
|
text,
|
|
110
123
|
textFormat
|
|
124
|
+
}: {
|
|
125
|
+
attachments?: [];
|
|
126
|
+
channelData?: { messageBack?: { displayText?: string } };
|
|
127
|
+
from?: { role?: 'bot' | 'user' };
|
|
128
|
+
text?: string;
|
|
129
|
+
textFormat?: string;
|
|
111
130
|
} = activity;
|
|
112
131
|
|
|
113
132
|
const activityDisplayText = messageBackDisplayText || text;
|
|
114
133
|
const fromUser = role === 'user';
|
|
115
134
|
|
|
116
135
|
const attachedAlt = localize(fromUser ? 'ACTIVITY_YOU_ATTACHED_ALT' : 'ACTIVITY_BOT_ATTACHED_ALT');
|
|
117
|
-
const greetingAlt = (
|
|
118
|
-
? localize('ACTIVITY_YOU_SAID_ALT')
|
|
119
|
-
: localize('ACTIVITY_BOT_SAID_ALT', botInitials || '')
|
|
136
|
+
const greetingAlt = (
|
|
137
|
+
fromUser ? localize('ACTIVITY_YOU_SAID_ALT') : localize('ACTIVITY_BOT_SAID_ALT', botInitials || '')
|
|
120
138
|
).replace(/\s{2,}/gu, ' ');
|
|
121
139
|
|
|
122
140
|
const initials = fromUser ? userInitials : botInitials;
|
|
@@ -153,7 +171,9 @@ const StackedLayout = ({
|
|
|
153
171
|
role="group"
|
|
154
172
|
>
|
|
155
173
|
<div className="webchat__stacked-layout__main">
|
|
156
|
-
<div className="webchat__stacked-layout__avatar-gutter">
|
|
174
|
+
<div className="webchat__stacked-layout__avatar-gutter">
|
|
175
|
+
{showAvatar && renderAvatar && renderAvatar({ activity })}
|
|
176
|
+
</div>
|
|
157
177
|
<div className="webchat__stacked-layout__content">
|
|
158
178
|
{!!activityDisplayText && (
|
|
159
179
|
<div
|
|
@@ -168,7 +188,7 @@ const StackedLayout = ({
|
|
|
168
188
|
<Bubble
|
|
169
189
|
className="webchat__stacked-layout__message"
|
|
170
190
|
fromUser={fromUser}
|
|
171
|
-
nub={showNub || (
|
|
191
|
+
nub={showNub || (hasAvatar || hasNub ? 'hidden' : false)}
|
|
172
192
|
>
|
|
173
193
|
{renderAttachment({
|
|
174
194
|
activity,
|
|
@@ -197,7 +217,7 @@ const StackedLayout = ({
|
|
|
197
217
|
fromUser={fromUser}
|
|
198
218
|
/* eslint-disable-next-line react/no-array-index-key */
|
|
199
219
|
key={index}
|
|
200
|
-
nub={
|
|
220
|
+
nub={hasAvatar || hasNub ? 'hidden' : false}
|
|
201
221
|
>
|
|
202
222
|
{renderAttachment({ activity, attachment })}
|
|
203
223
|
</Bubble>
|
|
@@ -206,7 +226,7 @@ const StackedLayout = ({
|
|
|
206
226
|
</div>
|
|
207
227
|
<div className="webchat__stacked-layout__alignment-pad" />
|
|
208
228
|
</div>
|
|
209
|
-
{
|
|
229
|
+
{typeof renderActivityStatus === 'function' && (
|
|
210
230
|
<div className="webchat__stacked-layout__status">
|
|
211
231
|
<div className="webchat__stacked-layout__avatar-gutter" />
|
|
212
232
|
<div className="webchat__stacked-layout__nub-pad" />
|
|
@@ -221,7 +241,7 @@ const StackedLayout = ({
|
|
|
221
241
|
StackedLayout.defaultProps = {
|
|
222
242
|
hideTimestamp: false,
|
|
223
243
|
renderActivityStatus: false,
|
|
224
|
-
renderAvatar:
|
|
244
|
+
renderAvatar: undefined,
|
|
225
245
|
showCallout: true
|
|
226
246
|
};
|
|
227
247
|
|
|
@@ -242,8 +262,14 @@ StackedLayout.propTypes = {
|
|
|
242
262
|
type: PropTypes.string.isRequired
|
|
243
263
|
}).isRequired,
|
|
244
264
|
hideTimestamp: PropTypes.bool,
|
|
265
|
+
|
|
266
|
+
// PropTypes cannot validate precisely with its TypeScript counterpart.
|
|
267
|
+
// @ts-ignore
|
|
245
268
|
renderActivityStatus: PropTypes.oneOfType([PropTypes.oneOf([false]), PropTypes.func]),
|
|
246
269
|
renderAttachment: PropTypes.func.isRequired,
|
|
270
|
+
|
|
271
|
+
// PropTypes cannot validate precisely with its TypeScript counterpart.
|
|
272
|
+
// @ts-ignore
|
|
247
273
|
renderAvatar: PropTypes.oneOfType([PropTypes.oneOf([false]), PropTypes.func]),
|
|
248
274
|
showCallout: PropTypes.bool
|
|
249
275
|
};
|
|
@@ -4,7 +4,14 @@ import React from 'react';
|
|
|
4
4
|
const ICON_SIZE_FACTOR = 22;
|
|
5
5
|
|
|
6
6
|
const DownloadIcon = ({ className, size }) => (
|
|
7
|
-
<svg
|
|
7
|
+
<svg
|
|
8
|
+
className={className}
|
|
9
|
+
focusable={false}
|
|
10
|
+
height={ICON_SIZE_FACTOR * size}
|
|
11
|
+
role="presentation"
|
|
12
|
+
viewBox="0 0 31.8 46"
|
|
13
|
+
width={ICON_SIZE_FACTOR * size}
|
|
14
|
+
>
|
|
8
15
|
<path d="M26.8,23.8l-10.9,11L5,23.8l1.6-1.6l8.2,8.3V5H17v25.5l8.2-8.3L26.8,23.8z M5.8,41v-2.2H26V41H5.8z" />
|
|
9
16
|
</svg>
|
|
10
17
|
);
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { FC } from 'react';
|
|
3
3
|
|
|
4
4
|
import useStyleSet from '../hooks/useStyleSet';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
type AudioContentProps = {
|
|
7
|
+
alt?: string;
|
|
8
|
+
autoPlay?: boolean;
|
|
9
|
+
loop?: boolean;
|
|
10
|
+
poster?: string;
|
|
11
|
+
src: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const AudioContent: FC<AudioContentProps> = ({ alt, autoPlay, loop, src }) => {
|
|
7
15
|
const [{ audioContent: audioContentStyleSet }] = useStyleSet();
|
|
8
16
|
|
|
9
17
|
return (
|
|
@@ -13,7 +21,6 @@ const AudioContent = ({ alt, autoPlay, loop, poster, src }) => {
|
|
|
13
21
|
className={audioContentStyleSet}
|
|
14
22
|
controls={true}
|
|
15
23
|
loop={loop}
|
|
16
|
-
poster={poster}
|
|
17
24
|
src={src}
|
|
18
25
|
/>
|
|
19
26
|
);
|
|
@@ -30,6 +37,8 @@ AudioContent.propTypes = {
|
|
|
30
37
|
alt: PropTypes.string,
|
|
31
38
|
autoPlay: PropTypes.bool,
|
|
32
39
|
loop: PropTypes.bool,
|
|
40
|
+
// We will keep the "poster" prop for #3315.
|
|
41
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
33
42
|
poster: PropTypes.string,
|
|
34
43
|
src: PropTypes.string.isRequired
|
|
35
44
|
};
|
|
@@ -8,7 +8,7 @@ const FileAttachment = ({
|
|
|
8
8
|
attachment
|
|
9
9
|
}) => {
|
|
10
10
|
const attachmentIndex = attachments.indexOf(attachment);
|
|
11
|
-
const size = attachmentSizes[attachmentIndex];
|
|
11
|
+
const size = attachmentSizes[+attachmentIndex];
|
|
12
12
|
|
|
13
13
|
return <FileContent fileName={attachment.name} href={attachment.contentUrl} size={size} />;
|
|
14
14
|
};
|
|
@@ -1,10 +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 from 'react';
|
|
4
|
+
import React, { FC } from 'react';
|
|
5
5
|
|
|
6
6
|
import DownloadIcon from './Assets/DownloadIcon';
|
|
7
|
-
import ScreenReaderText from '../ScreenReaderText';
|
|
8
7
|
import useStyleSet from '../hooks/useStyleSet';
|
|
9
8
|
import useStyleToEmotionObject from '../hooks/internal/useStyleToEmotionObject';
|
|
10
9
|
|
|
@@ -25,6 +24,16 @@ const ROOT_STYLE = {
|
|
|
25
24
|
}
|
|
26
25
|
};
|
|
27
26
|
|
|
27
|
+
const ALLOWED_PROTOCOLS = ['data:', 'http:', 'https:'];
|
|
28
|
+
|
|
29
|
+
function isAllowedProtocol(url) {
|
|
30
|
+
try {
|
|
31
|
+
return ALLOWED_PROTOCOLS.includes(new URL(url).protocol);
|
|
32
|
+
} catch (err) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
28
37
|
const FileContentBadge = ({ downloadIcon, fileName, size }) => {
|
|
29
38
|
const [direction] = useDirection();
|
|
30
39
|
const formatByte = useByteFormatter();
|
|
@@ -61,7 +70,14 @@ FileContentBadge.propTypes = {
|
|
|
61
70
|
size: PropTypes.number
|
|
62
71
|
};
|
|
63
72
|
|
|
64
|
-
|
|
73
|
+
type FileContentProps = {
|
|
74
|
+
className?: string;
|
|
75
|
+
fileName: string;
|
|
76
|
+
href?: string;
|
|
77
|
+
size?: number;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const FileContent: FC<FileContentProps> = ({ className, href, fileName, size }) => {
|
|
65
81
|
const [{ fileContent: fileContentStyleSet }] = useStyleSet();
|
|
66
82
|
const localize = useLocalizer();
|
|
67
83
|
const localizeBytes = useByteFormatter();
|
|
@@ -69,6 +85,8 @@ const FileContent = ({ className, href, fileName, size }) => {
|
|
|
69
85
|
|
|
70
86
|
const localizedSize = typeof size === 'number' && localizeBytes(size);
|
|
71
87
|
|
|
88
|
+
href = href && isAllowedProtocol(href) ? href : undefined;
|
|
89
|
+
|
|
72
90
|
const alt = localize(
|
|
73
91
|
href
|
|
74
92
|
? localizedSize
|
|
@@ -83,20 +101,17 @@ const FileContent = ({ className, href, fileName, size }) => {
|
|
|
83
101
|
|
|
84
102
|
return (
|
|
85
103
|
<div
|
|
86
|
-
aria-hidden={true}
|
|
87
104
|
className={classNames('webchat__fileContent', rootClassName, fileContentStyleSet + '', (className || '') + '')}
|
|
88
105
|
>
|
|
89
|
-
<ScreenReaderText text={alt} />
|
|
90
106
|
{href ? (
|
|
91
107
|
<a
|
|
92
|
-
aria-
|
|
108
|
+
aria-label={alt}
|
|
93
109
|
className="webchat__fileContent__buttonLink"
|
|
94
110
|
download={fileName}
|
|
95
111
|
href={href}
|
|
96
112
|
rel="noopener noreferrer"
|
|
97
113
|
target="_blank"
|
|
98
114
|
>
|
|
99
|
-
{/* Although nested, Chrome v75 does not respect the above aria-hidden and makes the below aria-hidden in FileContentBadge necessary */}
|
|
100
115
|
<FileContentBadge downloadIcon={true} fileName={fileName} size={size} />
|
|
101
116
|
</a>
|
|
102
117
|
) : (
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { FC } from 'react';
|
|
3
3
|
|
|
4
4
|
import useStyleSet from '../hooks/useStyleSet';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
type HTMLVideoContentProps = {
|
|
7
|
+
alt?: string;
|
|
8
|
+
autoPlay?: boolean;
|
|
9
|
+
loop?: boolean;
|
|
10
|
+
poster?: string;
|
|
11
|
+
src: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const HTMLVideoContent: FC<HTMLVideoContentProps> = ({ alt, autoPlay, loop, poster, src }) => {
|
|
7
15
|
const [{ videoContent: videoContentStyleSet }] = useStyleSet();
|
|
8
16
|
|
|
9
17
|
return (
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { hooks } from 'botframework-webchat-api';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { FC } from 'react';
|
|
4
4
|
|
|
5
5
|
import CroppedImage from '../Utils/CroppedImage';
|
|
6
6
|
|
|
7
7
|
const { useStyleOptions } = hooks;
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
type ImageContentProps = {
|
|
10
|
+
alt?: string;
|
|
11
|
+
src: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const ImageContent: FC<ImageContentProps> = ({ alt, src }) => {
|
|
10
15
|
const [{ bubbleImageHeight }] = useStyleOptions();
|
|
11
16
|
|
|
12
17
|
return <CroppedImage alt={alt} height={bubbleImageHeight} src={src} width="100%" />;
|
|
@@ -5,12 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import React from 'react';
|
|
8
|
+
import React, { FC } from 'react';
|
|
9
9
|
|
|
10
10
|
import useRenderMarkdownAsHTML from '../hooks/useRenderMarkdownAsHTML';
|
|
11
11
|
import useStyleSet from '../hooks/useStyleSet';
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
type TextContentProps = {
|
|
14
|
+
contentType?: string;
|
|
15
|
+
text: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const TextContent: FC<TextContentProps> = ({ contentType, text }) => {
|
|
14
19
|
const [{ textContent: textContentStyleSet }] = useStyleSet();
|
|
15
20
|
const renderMarkdownAsHTML = useRenderMarkdownAsHTML();
|
|
16
21
|
const contentTypeMarkdown = contentType === 'text/markdown';
|
|
@@ -21,11 +26,13 @@ const TextContent = ({ contentType, text }) => {
|
|
|
21
26
|
dangerouslySetInnerHTML={{ __html: renderMarkdownAsHTML(text || '') }}
|
|
22
27
|
/>
|
|
23
28
|
) : (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
<React.Fragment>
|
|
30
|
+
{(text || '').split('\n').map((line, index) => (
|
|
31
|
+
<p className={classNames('plain', textContentStyleSet + '')} key={index}>
|
|
32
|
+
{line.trim()}
|
|
33
|
+
</p>
|
|
34
|
+
))}
|
|
35
|
+
</React.Fragment>
|
|
29
36
|
);
|
|
30
37
|
};
|
|
31
38
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { FC } from 'react';
|
|
3
3
|
|
|
4
4
|
import HTMLVideoContent from './HTMLVideoContent';
|
|
5
5
|
import VimeoContent from './VimeoContent';
|
|
@@ -30,7 +30,15 @@ function parseURL(url) {
|
|
|
30
30
|
return { hostname, pathname, search };
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
type VideoContentProps = {
|
|
34
|
+
alt?: string;
|
|
35
|
+
autoPlay?: boolean;
|
|
36
|
+
loop?: boolean;
|
|
37
|
+
poster?: string;
|
|
38
|
+
src: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const VideoContent: FC<VideoContentProps> = ({ alt, autoPlay, loop, poster, src }) => {
|
|
34
42
|
const { hostname, pathname, search } = parseURL(src);
|
|
35
43
|
const lastSegment = pathname.split('/').pop();
|
|
36
44
|
const searchParams = new URLSearchParams(search);
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { FC } from 'react';
|
|
3
3
|
|
|
4
4
|
import useStyleSet from '../hooks/useStyleSet';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
type VimeoContentProps = {
|
|
7
|
+
alt?: string;
|
|
8
|
+
autoPlay?: boolean;
|
|
9
|
+
embedID: string;
|
|
10
|
+
loop?: boolean;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const VimeoContent: FC<VimeoContentProps> = ({ alt, autoPlay, embedID, loop }) => {
|
|
7
14
|
const [{ vimeoContent: vimeoContentStyleSet }] = useStyleSet();
|
|
8
15
|
|
|
9
16
|
const search = new URLSearchParams({
|
|
10
|
-
autoplay: autoPlay ? 1 : 0,
|
|
11
|
-
badge: 0,
|
|
12
|
-
byline: 0,
|
|
13
|
-
loop: loop ? 1 : 0,
|
|
14
|
-
portrait: 0,
|
|
15
|
-
title: 0
|
|
17
|
+
autoplay: autoPlay ? '1' : '0',
|
|
18
|
+
badge: '0',
|
|
19
|
+
byline: '0',
|
|
20
|
+
loop: loop ? '1' : '0',
|
|
21
|
+
portrait: '0',
|
|
22
|
+
title: '0'
|
|
16
23
|
}).toString();
|
|
17
24
|
|
|
18
25
|
return (
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { FC } from 'react';
|
|
3
3
|
|
|
4
4
|
import useStyleSet from '../hooks/useStyleSet';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
type YouTubeContentProps = {
|
|
7
|
+
alt?: string;
|
|
8
|
+
autoPlay?: boolean;
|
|
9
|
+
embedID: string;
|
|
10
|
+
loop?: boolean;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const YouTubeContent: FC<YouTubeContentProps> = ({ alt, autoPlay, embedID, loop }) => {
|
|
7
14
|
const [{ youTubeContent: youTubeContentStyleSet }] = useStyleSet();
|
|
8
15
|
|
|
9
16
|
const search = new URLSearchParams({
|
|
10
|
-
autoplay: autoPlay ? 1 : 0,
|
|
11
|
-
loop: loop ? 1 : 0,
|
|
12
|
-
modestbranding: 1
|
|
17
|
+
autoplay: autoPlay ? '1' : '0',
|
|
18
|
+
loop: loop ? '1' : '0',
|
|
19
|
+
modestbranding: '1'
|
|
13
20
|
}).toString();
|
|
14
21
|
|
|
15
22
|
return (
|
|
@@ -2,7 +2,7 @@ import { Constants } from 'botframework-webchat-core';
|
|
|
2
2
|
import { hooks } from 'botframework-webchat-api';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { FC } from 'react';
|
|
6
6
|
|
|
7
7
|
import DictationInterims from './SendBox/DictationInterims';
|
|
8
8
|
import MicrophoneButton from './SendBox/MicrophoneButton';
|
|
@@ -31,11 +31,11 @@ const ROOT_STYLE = {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
// TODO: [P3] We should consider exposing core/src/definitions and use it instead
|
|
34
|
-
function activityIsSpeakingOrQueuedToSpeak({ channelData: { speak } = {} }) {
|
|
34
|
+
function activityIsSpeakingOrQueuedToSpeak({ channelData: { speak } = {} }: { channelData: { speak?: any } }) {
|
|
35
35
|
return !!speak;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
function useSendBoxSpeechInterimsVisible() {
|
|
38
|
+
function useSendBoxSpeechInterimsVisible(): [boolean] {
|
|
39
39
|
const [activities] = useActivities();
|
|
40
40
|
const [dictateState] = useDictateState();
|
|
41
41
|
|
|
@@ -45,10 +45,14 @@ function useSendBoxSpeechInterimsVisible() {
|
|
|
45
45
|
];
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
type BasicSendBoxProps = {
|
|
49
|
+
className?: string;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const BasicSendBox: FC<BasicSendBoxProps> = ({ className }) => {
|
|
49
53
|
const [{ hideUploadButton, sendBoxButtonAlignment }] = useStyleOptions();
|
|
50
54
|
const [{ sendBox: sendBoxStyleSet }] = useStyleSet();
|
|
51
|
-
const [{ SpeechRecognition } = {}] = useWebSpeechPonyfill();
|
|
55
|
+
const [{ SpeechRecognition = undefined } = {}] = useWebSpeechPonyfill();
|
|
52
56
|
const [direction] = useDirection();
|
|
53
57
|
const [speechInterimsVisible] = useSendBoxSpeechInterimsVisible();
|
|
54
58
|
const styleToEmotionObject = useStyleToEmotionObject();
|
package/src/BasicToaster.js
CHANGED
|
@@ -40,8 +40,12 @@ const LEVEL_AS_NUMBER = {
|
|
|
40
40
|
success: 4
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
const LEVEL_AS_NUMBER_KEYS = Object.keys(LEVEL_AS_NUMBER);
|
|
44
|
+
|
|
43
45
|
function getLevelAsNumber(level) {
|
|
44
|
-
|
|
46
|
+
// Mitigated through allowlisting.
|
|
47
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
48
|
+
return LEVEL_AS_NUMBER_KEYS.includes(level) ? LEVEL_AS_NUMBER[level] : 5;
|
|
45
49
|
}
|
|
46
50
|
|
|
47
51
|
function compareLevel(x, y) {
|
|
@@ -94,10 +98,10 @@ const BasicToaster = () => {
|
|
|
94
98
|
() => (!expandable || expanded ? `webchat__toaster__list__${instanceId}` : undefined),
|
|
95
99
|
[expandable, expanded, instanceId]
|
|
96
100
|
);
|
|
97
|
-
const headerElementId = useMemo(
|
|
98
|
-
expandable,
|
|
99
|
-
instanceId
|
|
100
|
-
|
|
101
|
+
const headerElementId = useMemo(
|
|
102
|
+
() => (expandable ? `webchat__toaster__header__${instanceId}` : undefined),
|
|
103
|
+
[expandable, instanceId]
|
|
104
|
+
);
|
|
101
105
|
|
|
102
106
|
useEffect(() => {
|
|
103
107
|
!expandable && setExpanded(false);
|