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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFocusRelativeActivity.d.ts","sourceRoot":"","sources":["../../../src/providers/TranscriptFocus/useFocusRelativeActivity.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,qBAAqB,IAAI,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAEvE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useFocusByActivityKey;
|
|
7
|
+
|
|
8
|
+
var _useContext = _interopRequireDefault(require("./private/useContext"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
function useFocusByActivityKey() {
|
|
13
|
+
return (0, _useContext.default)().focusRelativeActivity;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wcm92aWRlcnMvVHJhbnNjcmlwdEZvY3VzL3VzZUZvY3VzUmVsYXRpdmVBY3Rpdml0eS50cyJdLCJuYW1lcyI6WyJ1c2VGb2N1c0J5QWN0aXZpdHlLZXkiLCJmb2N1c1JlbGF0aXZlQWN0aXZpdHkiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFBQTs7OztBQUVlLFNBQVNBLHFCQUFULEdBQTBEO0FBQ3ZFLFNBQU8sMkJBQTRCQyxxQkFBbkM7QUFDRCIsInNvdXJjZVJvb3QiOiJjb21wb25lbnQ6Ly8vIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHVzZVRyYW5zY3JpcHRGb2N1c0NvbnRleHQgZnJvbSAnLi9wcml2YXRlL3VzZUNvbnRleHQnO1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiB1c2VGb2N1c0J5QWN0aXZpdHlLZXkoKTogKGRlbHRhOiBudW1iZXIpID0+IHZvaWQge1xuICByZXR1cm4gdXNlVHJhbnNjcmlwdEZvY3VzQ29udGV4dCgpLmZvY3VzUmVsYXRpdmVBY3Rpdml0eTtcbn1cbiJdfQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFocusedActivityKey.d.ts","sourceRoot":"","sources":["../../../src/providers/TranscriptFocus/useFocusedActivityKey.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,qBAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,CAEjE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useFocusedActivityKey;
|
|
7
|
+
|
|
8
|
+
var _useContext = _interopRequireDefault(require("./private/useContext"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
function useFocusedActivityKey() {
|
|
13
|
+
return (0, _useContext.default)().focusedActivityKeyState;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wcm92aWRlcnMvVHJhbnNjcmlwdEZvY3VzL3VzZUZvY3VzZWRBY3Rpdml0eUtleS50cyJdLCJuYW1lcyI6WyJ1c2VGb2N1c2VkQWN0aXZpdHlLZXkiLCJmb2N1c2VkQWN0aXZpdHlLZXlTdGF0ZSJdLCJtYXBwaW5ncyI6Ijs7Ozs7OztBQUFBOzs7O0FBRWUsU0FBU0EscUJBQVQsR0FBb0Q7QUFDakUsU0FBTywyQkFBNEJDLHVCQUFuQztBQUNEIiwic291cmNlUm9vdCI6ImNvbXBvbmVudDovLy8iLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdXNlVHJhbnNjcmlwdEZvY3VzQ29udGV4dCBmcm9tICcuL3ByaXZhdGUvdXNlQ29udGV4dCc7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIHVzZUZvY3VzZWRBY3Rpdml0eUtleSgpOiByZWFkb25seSBbc3RyaW5nXSB7XG4gIHJldHVybiB1c2VUcmFuc2NyaXB0Rm9jdXNDb250ZXh0KCkuZm9jdXNlZEFjdGl2aXR5S2V5U3RhdGU7XG59XG4iXX0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFocusedExplicitly.d.ts","sourceRoot":"","sources":["../../../src/providers/TranscriptFocus/useFocusedExplicitly.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,oBAAoB,IAAI,SAAS,CAAC,OAAO,CAAC,CAEjE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useFocusedExplicitly;
|
|
7
|
+
|
|
8
|
+
var _useContext = _interopRequireDefault(require("./private/useContext"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
function useFocusedExplicitly() {
|
|
13
|
+
return (0, _useContext.default)().focusedExplicitlyState;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wcm92aWRlcnMvVHJhbnNjcmlwdEZvY3VzL3VzZUZvY3VzZWRFeHBsaWNpdGx5LnRzIl0sIm5hbWVzIjpbInVzZUZvY3VzZWRFeHBsaWNpdGx5IiwiZm9jdXNlZEV4cGxpY2l0bHlTdGF0ZSJdLCJtYXBwaW5ncyI6Ijs7Ozs7OztBQUFBOzs7O0FBRWUsU0FBU0Esb0JBQVQsR0FBb0Q7QUFDakUsU0FBTywyQkFBNEJDLHNCQUFuQztBQUNEIiwic291cmNlUm9vdCI6ImNvbXBvbmVudDovLy8iLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdXNlVHJhbnNjcmlwdEZvY3VzQ29udGV4dCBmcm9tICcuL3ByaXZhdGUvdXNlQ29udGV4dCc7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIHVzZUZvY3VzZWRFeHBsaWNpdGx5KCk6IHJlYWRvbmx5IFtib29sZWFuXSB7XG4gIHJldHVybiB1c2VUcmFuc2NyaXB0Rm9jdXNDb250ZXh0KCkuZm9jdXNlZEV4cGxpY2l0bHlTdGF0ZTtcbn1cbiJdfQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGetDescendantIdByActivityKey.d.ts","sourceRoot":"","sources":["../../../src/providers/TranscriptFocus/useGetDescendantIdByActivityKey.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,+BAA+B,IAAI,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAEtG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useGetDescendantIdByActivityKey;
|
|
7
|
+
|
|
8
|
+
var _useContext = _interopRequireDefault(require("./private/useContext"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
function useGetDescendantIdByActivityKey() {
|
|
13
|
+
return (0, _useContext.default)().getDescendantIdByActivityKey;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wcm92aWRlcnMvVHJhbnNjcmlwdEZvY3VzL3VzZUdldERlc2NlbmRhbnRJZEJ5QWN0aXZpdHlLZXkudHMiXSwibmFtZXMiOlsidXNlR2V0RGVzY2VuZGFudElkQnlBY3Rpdml0eUtleSIsImdldERlc2NlbmRhbnRJZEJ5QWN0aXZpdHlLZXkiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFBQTs7OztBQUVlLFNBQVNBLCtCQUFULEdBQXlGO0FBQ3RHLFNBQU8sMkJBQTRCQyw0QkFBbkM7QUFDRCIsInNvdXJjZVJvb3QiOiJjb21wb25lbnQ6Ly8vIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHVzZVRyYW5zY3JpcHRGb2N1c0NvbnRleHQgZnJvbSAnLi9wcml2YXRlL3VzZUNvbnRleHQnO1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiB1c2VHZXREZXNjZW5kYW50SWRCeUFjdGl2aXR5S2V5KCk6IChhY3Rpdml0eUtleT86IHN0cmluZykgPT4gc3RyaW5nIHwgdW5kZWZpbmVkIHtcbiAgcmV0dXJuIHVzZVRyYW5zY3JpcHRGb2N1c0NvbnRleHQoKS5nZXREZXNjZW5kYW50SWRCeUFjdGl2aXR5S2V5O1xufVxuIl19
|
package/lib/tsconfig.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollPosition.d.ts","sourceRoot":"","sources":["../../src/types/ScrollPosition.ts"],"names":[],"mappings":"AAAA,aAAK,cAAc,GAAG;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "botframework-webchat-component",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.15.0",
|
|
4
4
|
"description": "React component of botframework-webchat",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -16,64 +16,57 @@
|
|
|
16
16
|
"bugs": {
|
|
17
17
|
"url": "https://github.com/microsoft/BotFramework-WebChat/issues"
|
|
18
18
|
},
|
|
19
|
-
"homepage": "https://github.com/microsoft/BotFramework-WebChat/tree/
|
|
19
|
+
"homepage": "https://github.com/microsoft/BotFramework-WebChat/tree/main/packages/component#readme",
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build": "npm run build:typescript && npm run build:babel",
|
|
22
22
|
"build:babel": "babel src --copy-files --extensions .js,.ts,.tsx --ignore **/*.spec.js,**/*.spec.ts,**/*.spec.tsx,**/*.test.js,**/*.test.ts,**/*.test.tsx,__tests__/**/*.js,__tests__/**/*.ts,__tests__/**/*.tsx --no-copy-ignored --out-dir lib --verbose",
|
|
23
23
|
"build:typescript": "tsc --project src/tsconfig.json",
|
|
24
|
-
"eslint": "
|
|
24
|
+
"eslint": "npm run precommit",
|
|
25
|
+
"precommit": "npm run precommit:eslint -- src && npm run precommit:typecheck",
|
|
26
|
+
"precommit:eslint": "../../node_modules/.bin/eslint --report-unused-disable-directives --max-warnings 0",
|
|
27
|
+
"precommit:typecheck": "tsc --project ./src --emitDeclarationOnly false --esModuleInterop true --noEmit --pretty false",
|
|
25
28
|
"prestart": "npm run build:babel",
|
|
26
29
|
"start": "concurrently --kill-others --names \"babel,tsc\" \"npm run start:babel\" \"npm run start:typescript\"",
|
|
27
30
|
"start:babel": "npm run build:babel -- --skip-initial-build --watch",
|
|
28
31
|
"start:typescript": "npm run build:typescript -- --watch"
|
|
29
32
|
},
|
|
30
33
|
"devDependencies": {
|
|
31
|
-
"@babel/cli": "^7.
|
|
32
|
-
"@babel/core": "^7.
|
|
33
|
-
"@babel/preset-env": "^7.
|
|
34
|
-
"@babel/preset-react": "^7.
|
|
35
|
-
"@babel/preset-typescript": "^7.
|
|
36
|
-
"@types/node": "^
|
|
37
|
-
"@types/react": "^
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "^4.19.0",
|
|
39
|
-
"@typescript-eslint/parser": "^4.19.0",
|
|
34
|
+
"@babel/cli": "^7.15.7",
|
|
35
|
+
"@babel/core": "^7.15.8",
|
|
36
|
+
"@babel/preset-env": "^7.15.8",
|
|
37
|
+
"@babel/preset-react": "^7.14.5",
|
|
38
|
+
"@babel/preset-typescript": "^7.15.0",
|
|
39
|
+
"@types/node": "^16.10.9",
|
|
40
|
+
"@types/react": "^17.0.29",
|
|
40
41
|
"babel-plugin-istanbul": "^6.0.0",
|
|
41
42
|
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
|
|
42
|
-
"concurrently": "^6.
|
|
43
|
-
"core-js": "^3.
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"eslint-plugin-react": "^7.22.0",
|
|
47
|
-
"eslint-plugin-react-hooks": "^4.2.0",
|
|
48
|
-
"node-dev": "^6.4.0",
|
|
49
|
-
"prettier": "^2.2.1",
|
|
50
|
-
"typescript": "^4.2.3"
|
|
43
|
+
"concurrently": "^6.3.0",
|
|
44
|
+
"core-js": "^3.18.3",
|
|
45
|
+
"node-dev": "^7.0.0",
|
|
46
|
+
"typescript": "^4.3.5"
|
|
51
47
|
},
|
|
52
48
|
"dependencies": {
|
|
49
|
+
"@emotion/css": "11.1.3",
|
|
53
50
|
"base64-js": "1.5.1",
|
|
54
|
-
"botframework-webchat-api": "4.
|
|
55
|
-
"botframework-webchat-core": "4.
|
|
56
|
-
"classnames": "2.
|
|
57
|
-
"
|
|
58
|
-
"event-target-shim": "
|
|
59
|
-
"
|
|
60
|
-
"markdown-it": "12.0.4",
|
|
51
|
+
"botframework-webchat-api": "4.15.0",
|
|
52
|
+
"botframework-webchat-core": "4.15.0",
|
|
53
|
+
"classnames": "2.3.1",
|
|
54
|
+
"compute-scroll-into-view": "1.0.17",
|
|
55
|
+
"event-target-shim": "6.0.2",
|
|
56
|
+
"markdown-it": "12.3.2",
|
|
61
57
|
"math-random": "2.0.1",
|
|
62
|
-
"memoize-one": "5.
|
|
58
|
+
"memoize-one": "5.2.1",
|
|
63
59
|
"prop-types": "15.7.2",
|
|
64
|
-
"react-dictate-button": "
|
|
65
|
-
"react-film": "3.
|
|
66
|
-
"react-redux": "7.2.
|
|
67
|
-
"react-say": "2.0
|
|
68
|
-
"react-scroll-to-bottom": "4.
|
|
60
|
+
"react-dictate-button": "2.0.1",
|
|
61
|
+
"react-film": "3.1.0",
|
|
62
|
+
"react-redux": "7.2.4",
|
|
63
|
+
"react-say": "2.1.0",
|
|
64
|
+
"react-scroll-to-bottom": "4.2.0",
|
|
69
65
|
"redux": "4.0.5",
|
|
70
|
-
"
|
|
71
|
-
"sanitize-html": "1.27.5",
|
|
72
|
-
"simple-update-in": "2.2.0",
|
|
73
|
-
"strip-markdown": "3.0.4"
|
|
66
|
+
"simple-update-in": "2.2.0"
|
|
74
67
|
},
|
|
75
68
|
"peerDependencies": {
|
|
76
|
-
"react": "16.8.6",
|
|
77
|
-
"react-dom": "16.8.6"
|
|
69
|
+
"react": ">= 16.8.6",
|
|
70
|
+
"react-dom": ">= 16.8.6"
|
|
78
71
|
}
|
|
79
72
|
}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { VFC } from 'react';
|
|
3
3
|
|
|
4
4
|
import { DefaultAvatar } from '../Middleware/Avatar/createCoreMiddleware';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
type AvatarProps = {
|
|
7
|
+
'aria-hidden'?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
fromUser?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/** @deprecated Please use `useRenderAvatar` hook instead. */
|
|
13
|
+
const Avatar: VFC<AvatarProps> = ({ 'aria-hidden': ariaHidden, className, fromUser }) => {
|
|
7
14
|
console.warn(
|
|
8
15
|
'botframework-webchat: <Avatar> component is deprecated and will be removed on or after 2022-02-25. Please use `useRenderAvatar` hook instead.'
|
|
9
16
|
);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { hooks } from 'botframework-webchat-api';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import React from 'react';
|
|
6
|
+
import React, { FC, ReactNode } from 'react';
|
|
7
7
|
|
|
8
8
|
import isZeroOrPositive from '../Utils/isZeroOrPositive';
|
|
9
9
|
import useStyleSet from '../hooks/useStyleSet';
|
|
@@ -62,7 +62,15 @@ function acuteNubSVG(nubSize, strokeWidth, side, upSideDown = false) {
|
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
type BubbleProps = {
|
|
66
|
+
'aria-hidden'?: boolean;
|
|
67
|
+
children?: ReactNode;
|
|
68
|
+
className?: string;
|
|
69
|
+
fromUser?: boolean;
|
|
70
|
+
nub?: boolean | 'hidden';
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const Bubble: FC<BubbleProps> = ({ 'aria-hidden': ariaHidden, children, className, fromUser, nub }) => {
|
|
66
74
|
const [{ bubble: bubbleStyleSet }] = useStyleSet();
|
|
67
75
|
const [direction] = useDirection();
|
|
68
76
|
const [
|
|
@@ -7,13 +7,13 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
9
|
import Bubble from './Bubble';
|
|
10
|
+
import CarouselFilmStripAttachment from './CarouselFilmStripAttachment';
|
|
10
11
|
import connectToWebChat from '../connectToWebChat';
|
|
11
12
|
import isZeroOrPositive from '../Utils/isZeroOrPositive';
|
|
12
13
|
import ScreenReaderText from '../ScreenReaderText';
|
|
13
14
|
import textFormatToContentType from '../Utils/textFormatToContentType';
|
|
14
15
|
import useStyleSet from '../hooks/useStyleSet';
|
|
15
16
|
import useStyleToEmotionObject from '../hooks/internal/useStyleToEmotionObject';
|
|
16
|
-
import useUniqueId from '../hooks/internal/useUniqueId';
|
|
17
17
|
|
|
18
18
|
const { useAvatarForBot, useAvatarForUser, useDirection, useLocalizer, useStyleOptions } = hooks;
|
|
19
19
|
|
|
@@ -36,7 +36,7 @@ const ROOT_STYLE = {
|
|
|
36
36
|
flexShrink: 0
|
|
37
37
|
},
|
|
38
38
|
|
|
39
|
-
'& .webchat__carousel-
|
|
39
|
+
'& .webchat__carousel-filmstrip-attachment': {
|
|
40
40
|
flex: 1
|
|
41
41
|
},
|
|
42
42
|
|
|
@@ -127,7 +127,6 @@ const CarouselFilmStrip = ({
|
|
|
127
127
|
const [{ initials: botInitials }] = useAvatarForBot();
|
|
128
128
|
const [{ initials: userInitials }] = useAvatarForUser();
|
|
129
129
|
const [direction] = useDirection();
|
|
130
|
-
const ariaLabelId = useUniqueId('webchat__carousel-filmstrip__id');
|
|
131
130
|
const localize = useLocalizer();
|
|
132
131
|
const rootClassName = useStyleToEmotionObject()(ROOT_STYLE) + '';
|
|
133
132
|
const showActivityStatus = typeof renderActivityStatus === 'function';
|
|
@@ -146,10 +145,8 @@ const CarouselFilmStrip = ({
|
|
|
146
145
|
const activityDisplayText = messageBackDisplayText || text;
|
|
147
146
|
const fromUser = role === 'user';
|
|
148
147
|
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
? localize('ACTIVITY_YOU_SAID_ALT')
|
|
152
|
-
: localize('ACTIVITY_BOT_SAID_ALT', botInitials || '')
|
|
148
|
+
const greetingAlt = (
|
|
149
|
+
fromUser ? localize('ACTIVITY_YOU_SAID_ALT') : localize('ACTIVITY_BOT_SAID_ALT', botInitials || '')
|
|
153
150
|
).replace(/\s{2,}/gu, ' ');
|
|
154
151
|
|
|
155
152
|
const initials = fromUser ? userInitials : botInitials;
|
|
@@ -169,15 +166,16 @@ const CarouselFilmStrip = ({
|
|
|
169
166
|
const showAvatar = showCallout && hasAvatar && !!renderAvatar;
|
|
170
167
|
const showNub = showCallout && hasNub && (topAlignedCallout || !attachments.length);
|
|
171
168
|
|
|
169
|
+
const hideNub = hasNub && !showNub;
|
|
170
|
+
|
|
172
171
|
return (
|
|
173
172
|
<div
|
|
174
|
-
aria-labelledby={ariaLabelId}
|
|
175
173
|
className={classNames(
|
|
176
174
|
'webchat__carousel-filmstrip',
|
|
177
175
|
{
|
|
178
176
|
'webchat__carousel-filmstrip--extra-trailing': extraTrailing,
|
|
179
177
|
'webchat__carousel-filmstrip--hide-avatar': hasAvatar && !showAvatar,
|
|
180
|
-
'webchat__carousel-filmstrip--hide-nub':
|
|
178
|
+
'webchat__carousel-filmstrip--hide-nub': hideNub,
|
|
181
179
|
'webchat__carousel-filmstrip--no-message': !activityDisplayText,
|
|
182
180
|
'webchat__carousel-filmstrip--rtl': direction === 'rtl',
|
|
183
181
|
'webchat__carousel-filmstrip--show-avatar': showAvatar,
|
|
@@ -196,14 +194,7 @@ const CarouselFilmStrip = ({
|
|
|
196
194
|
<div className="webchat__carousel-filmstrip__avatar-gutter">{showAvatar && renderAvatar({ activity })}</div>
|
|
197
195
|
<div className="webchat__carousel-filmstrip__content">
|
|
198
196
|
{!!activityDisplayText && (
|
|
199
|
-
<div
|
|
200
|
-
aria-roledescription="message"
|
|
201
|
-
className="webchat__carousel-filmstrip__message"
|
|
202
|
-
// Disable "Prop `id` is forbidden on DOM Nodes" rule because we are using the ID prop for accessibility.
|
|
203
|
-
/* eslint-disable-next-line react/forbid-dom-props */
|
|
204
|
-
id={ariaLabelId}
|
|
205
|
-
role="group"
|
|
206
|
-
>
|
|
197
|
+
<div aria-roledescription="message" className="webchat__carousel-filmstrip__message" role="group">
|
|
207
198
|
<ScreenReaderText text={greetingAlt} />
|
|
208
199
|
<Bubble
|
|
209
200
|
className="webchat__carousel-filmstrip__bubble"
|
|
@@ -229,20 +220,20 @@ const CarouselFilmStrip = ({
|
|
|
229
220
|
ref={itemContainerCallbackRef}
|
|
230
221
|
>
|
|
231
222
|
{attachments.map((attachment, index) => (
|
|
232
|
-
<
|
|
233
|
-
|
|
234
|
-
|
|
223
|
+
<CarouselFilmStripAttachment
|
|
224
|
+
activity={activity}
|
|
225
|
+
attachment={attachment}
|
|
226
|
+
fromUser={fromUser}
|
|
227
|
+
hasAvatar={hasAvatar}
|
|
228
|
+
hideNub={hideNub}
|
|
229
|
+
index={index}
|
|
235
230
|
/* Attachments do not have an ID; it is always indexed by number */
|
|
236
|
-
|
|
231
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
237
232
|
key={index}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
<Bubble fromUser={fromUser} key={index} nub={false}>
|
|
243
|
-
{renderAttachment({ activity, attachment })}
|
|
244
|
-
</Bubble>
|
|
245
|
-
</li>
|
|
233
|
+
renderAttachment={renderAttachment}
|
|
234
|
+
showAvatar={showAvatar}
|
|
235
|
+
showNub={showNub}
|
|
236
|
+
/>
|
|
246
237
|
))}
|
|
247
238
|
</ul>
|
|
248
239
|
</div>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { hooks } from 'botframework-webchat-api';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import Bubble from './Bubble';
|
|
7
|
+
import ScreenReaderText from '../ScreenReaderText';
|
|
8
|
+
import useStyleSet from '../hooks/useStyleSet';
|
|
9
|
+
|
|
10
|
+
const { useDirection, useLocalizer } = hooks;
|
|
11
|
+
|
|
12
|
+
const CarouselFilmStripAttachment = ({
|
|
13
|
+
activity,
|
|
14
|
+
attachment,
|
|
15
|
+
className,
|
|
16
|
+
fromUser,
|
|
17
|
+
hasAvatar,
|
|
18
|
+
hideNub,
|
|
19
|
+
index,
|
|
20
|
+
renderAttachment,
|
|
21
|
+
showAvatar,
|
|
22
|
+
showNub
|
|
23
|
+
}) => {
|
|
24
|
+
const [direction] = useDirection();
|
|
25
|
+
const localize = useLocalizer();
|
|
26
|
+
const [{ carouselFilmStripAttachment: carouselFilmStripAttachmentStyleSet }] = useStyleSet();
|
|
27
|
+
|
|
28
|
+
const attachedAlt = localize(fromUser ? 'ACTIVITY_YOU_ATTACHED_ALT' : 'ACTIVITY_BOT_ATTACHED_ALT');
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<li
|
|
32
|
+
aria-roledescription="attachment"
|
|
33
|
+
className={classNames(
|
|
34
|
+
'webchat__carousel-filmstrip-attachment',
|
|
35
|
+
{
|
|
36
|
+
'webchat__carousel-filmstrip-attachment--hide-avatar': hasAvatar && !showAvatar,
|
|
37
|
+
'webchat__carousel-filmstrip-attachment--hide-nub': hideNub,
|
|
38
|
+
'webchat__carousel-filmstrip-attachment--rtl': direction === 'rtl',
|
|
39
|
+
'webchat__carousel-filmstrip-attachment--show-avatar': showAvatar,
|
|
40
|
+
'webchat__carousel-filmstrip-attachment--show-nub': showNub
|
|
41
|
+
},
|
|
42
|
+
'react-film__filmstrip__item',
|
|
43
|
+
carouselFilmStripAttachmentStyleSet + '',
|
|
44
|
+
(className || '') + ''
|
|
45
|
+
)}
|
|
46
|
+
role="listitem"
|
|
47
|
+
tabIndex={0}
|
|
48
|
+
>
|
|
49
|
+
<ScreenReaderText text={attachedAlt} />
|
|
50
|
+
<Bubble fromUser={fromUser} key={index} nub={false}>
|
|
51
|
+
{renderAttachment({ activity, attachment })}
|
|
52
|
+
<div className="webchat__carousel-filmstrip-attachment--focus" />
|
|
53
|
+
</Bubble>
|
|
54
|
+
</li>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
CarouselFilmStripAttachment.defaultProps = {
|
|
59
|
+
className: ''
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
CarouselFilmStripAttachment.propTypes = {
|
|
63
|
+
activity: PropTypes.shape({
|
|
64
|
+
attachments: PropTypes.array,
|
|
65
|
+
channelData: PropTypes.shape({
|
|
66
|
+
messageBack: PropTypes.shape({
|
|
67
|
+
displayText: PropTypes.string
|
|
68
|
+
}),
|
|
69
|
+
state: PropTypes.string
|
|
70
|
+
}),
|
|
71
|
+
from: PropTypes.shape({
|
|
72
|
+
role: PropTypes.string.isRequired
|
|
73
|
+
}).isRequired,
|
|
74
|
+
text: PropTypes.string,
|
|
75
|
+
textFormat: PropTypes.string,
|
|
76
|
+
timestamp: PropTypes.string
|
|
77
|
+
}).isRequired,
|
|
78
|
+
attachment: PropTypes.shape({
|
|
79
|
+
content: PropTypes.any
|
|
80
|
+
}).isRequired,
|
|
81
|
+
className: PropTypes.string,
|
|
82
|
+
fromUser: PropTypes.any.isRequired,
|
|
83
|
+
hasAvatar: PropTypes.any.isRequired,
|
|
84
|
+
hideNub: PropTypes.bool.isRequired,
|
|
85
|
+
index: PropTypes.number.isRequired,
|
|
86
|
+
renderAttachment: PropTypes.func.isRequired,
|
|
87
|
+
showAvatar: PropTypes.bool.isRequired,
|
|
88
|
+
showNub: PropTypes.bool.isRequired
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export default CarouselFilmStripAttachment;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { DirectLineActivity } from 'botframework-webchat-core';
|
|
1
2
|
import { hooks } from 'botframework-webchat-api';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
|
-
import React, { useCallback, useMemo } from 'react';
|
|
4
|
+
import React, { FC, useCallback, useMemo } from 'react';
|
|
4
5
|
import Say, { SayUtterance } from 'react-say';
|
|
5
6
|
|
|
6
7
|
import connectToWebChat from '../connectToWebChat';
|
|
@@ -22,7 +23,11 @@ const connectSpeakActivity = (...selectors) =>
|
|
|
22
23
|
...selectors
|
|
23
24
|
);
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
type SpeakProps = {
|
|
27
|
+
activity: DirectLineActivity;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const Speak: FC<SpeakProps> = ({ activity }) => {
|
|
26
31
|
const [{ showSpokenText }] = useStyleOptions();
|
|
27
32
|
const markActivityAsSpoken = useMarkActivityAsSpoken();
|
|
28
33
|
const selectVoice = useVoiceSelector(activity);
|
|
@@ -40,14 +45,16 @@ const Speak = ({ activity }) => {
|
|
|
40
45
|
speak || text,
|
|
41
46
|
...attachments
|
|
42
47
|
.filter(({ contentType }) => contentType === 'application/vnd.microsoft.card.adaptive')
|
|
43
|
-
.map(
|
|
48
|
+
.map(attachment => attachment?.content?.speak)
|
|
44
49
|
]
|
|
45
50
|
.filter(line => line)
|
|
46
51
|
.join('\r\n')
|
|
47
52
|
);
|
|
48
53
|
}, [activity]);
|
|
49
54
|
|
|
50
|
-
const {
|
|
55
|
+
const {
|
|
56
|
+
channelData: { speechSynthesisUtterance } = {}
|
|
57
|
+
}: { channelData: { speechSynthesisUtterance?: SpeechSynthesisUtterance } } = activity;
|
|
51
58
|
|
|
52
59
|
return (
|
|
53
60
|
!!activity && (
|
|
@@ -57,7 +64,7 @@ const Speak = ({ activity }) => {
|
|
|
57
64
|
) : (
|
|
58
65
|
<Say onEnd={markAsSpoken} onError={markAsSpoken} text={singleLine} voice={selectVoice} />
|
|
59
66
|
)}
|
|
60
|
-
{!!showSpokenText && <SayAlt speak={singleLine}
|
|
67
|
+
{!!showSpokenText && <SayAlt speak={singleLine} />}
|
|
61
68
|
</React.Fragment>
|
|
62
69
|
)
|
|
63
70
|
);
|