diff --git a/CHANGELOG.md b/CHANGELOG.md
index b836f46116..55360a9550 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fix [#2160](https://github.com/microsoft/BotFramework-WebChat/issues/2160). Clear suggested actions after clicking on a suggested actions of type `openUrl`, by [@tdurnford](https://github.com/tdurnford) in PR [#2190](https://github.com/microsoft/BotFramework-WebChat/pull/2190)
- Fix [#2187](https://github.com/microsoft/BotFramework-WebChat/issues/2187). Bump core-js and update core-js modules on index-es5.js, by [@corinagum](https://github.com/corinagum) in PR [#2195](https://github.com/microsoft/BotFramework-WebChat/pull/2195)
+- Fix [#2193](https://github.com/microsoft/BotFramework-WebChat/issues/2193). Fix Adaptive Card/attachments do not get read by Narrator, by [@corinagum](https://github.com/corinagum) in PR [#XXX](https://github.com/microsoft/BotFramework-WebChat/pull/XXX)
## [4.5.0] - 2019-07-10
diff --git a/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.js b/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.js
index d126a692f0..382afefdf7 100644
--- a/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.js
+++ b/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.js
@@ -178,7 +178,7 @@ class AdaptiveCardRenderer extends React.PureComponent {
{JSON.stringify(error, null, 2)}
) : (
-
+
);
}
}
diff --git a/packages/component/src/Activity/Bubble.js b/packages/component/src/Activity/Bubble.js
index e4c1e2ad5b..c4149f5378 100644
--- a/packages/component/src/Activity/Bubble.js
+++ b/packages/component/src/Activity/Bubble.js
@@ -4,21 +4,20 @@ import React from 'react';
import connectToWebChat from '../connectToWebChat';
-const Bubble = ({ 'aria-hidden': ariaHidden, children, className, fromUser, styleSet }) => (
+const Bubble = ({ ariaHidden, children, className, fromUser, styleSet }) => (
{children}
);
Bubble.defaultProps = {
- 'aria-hidden': true,
children: undefined,
className: '',
fromUser: false
};
Bubble.propTypes = {
- 'aria-hidden': PropTypes.bool,
+ ariaHidden: PropTypes.bool.isRequired,
children: PropTypes.any,
className: PropTypes.string,
fromUser: PropTypes.bool,
diff --git a/packages/component/src/Activity/StackedLayout.js b/packages/component/src/Activity/StackedLayout.js
index 14a9cb27c2..d96bd4030f 100644
--- a/packages/component/src/Activity/StackedLayout.js
+++ b/packages/component/src/Activity/StackedLayout.js
@@ -118,8 +118,9 @@ const StackedLayout = ({ activity, avatarInitials, children, language, styleSet,
) : (
!!activityDisplayText && (
-
-
+
+
+
{children({
activity,
attachment: {
@@ -133,8 +134,9 @@ const StackedLayout = ({ activity, avatarInitials, children, language, styleSet,
)
)}
{attachments.map((attachment, index) => (
-
-
+
+
+
{children({ attachment })}
@@ -143,7 +145,7 @@ const StackedLayout = ({ activity, avatarInitials, children, language, styleSet,
{showSendStatus ? (
) : (
-
+
)}
diff --git a/packages/component/src/Attachment/Assets/DownloadIcon.js b/packages/component/src/Attachment/Assets/DownloadIcon.js
index d6e26c3e99..b546428bd5 100644
--- a/packages/component/src/Attachment/Assets/DownloadIcon.js
+++ b/packages/component/src/Attachment/Assets/DownloadIcon.js
@@ -3,9 +3,9 @@ import React from 'react';
const ICON_SIZE_FACTOR = 22;
-const DownloadIcon = ({ className, label, size }) => (
+const DownloadIcon = ({ className, size }) => (
(
DownloadIcon.defaultProps = {
className: '',
- label: '',
size: 1
};
DownloadIcon.propTypes = {
className: PropTypes.string,
- label: PropTypes.string,
size: PropTypes.number
};
diff --git a/packages/component/src/Attachment/Assets/TypingAnimation.js b/packages/component/src/Attachment/Assets/TypingAnimation.js
index 95465d3777..467d542da6 100644
--- a/packages/component/src/Attachment/Assets/TypingAnimation.js
+++ b/packages/component/src/Attachment/Assets/TypingAnimation.js
@@ -3,7 +3,7 @@ import React from 'react';
import connectToWebChat from '../../connectToWebChat';
-const TypingAnimation = ({ styleSet }) =>
;
+const TypingAnimation = ({ styleSet }) =>
;
TypingAnimation.propTypes = {
styleSet: PropTypes.shape({
diff --git a/packages/component/src/Attachment/AudioContent.js b/packages/component/src/Attachment/AudioContent.js
index d2f7a739e1..bd4f92062b 100644
--- a/packages/component/src/Attachment/AudioContent.js
+++ b/packages/component/src/Attachment/AudioContent.js
@@ -3,17 +3,27 @@ import React from 'react';
import connectToWebChat from '../connectToWebChat';
-const AudioContent = ({ autoPlay, loop, poster, src, styleSet }) => (
-
+const AudioContent = ({ alt, autoPlay, loop, poster, src, styleSet }) => (
+
);
AudioContent.defaultProps = {
+ alt: '',
autoPlay: false,
loop: false,
poster: ''
};
AudioContent.propTypes = {
+ alt: PropTypes.string,
autoPlay: PropTypes.bool,
loop: PropTypes.bool,
poster: PropTypes.string,
diff --git a/packages/component/src/Attachment/DownloadAttachment.js b/packages/component/src/Attachment/DownloadAttachment.js
index 9124c3e75e..edb913f4b1 100644
--- a/packages/component/src/Attachment/DownloadAttachment.js
+++ b/packages/component/src/Attachment/DownloadAttachment.js
@@ -13,17 +13,24 @@ const DownloadAttachment = ({
styleSet
}) => {
const attachmentIndex = attachments.indexOf(attachment);
- const label = localize('Download file', language);
+ const downloadLabel = localize('Download file', language);
const size = attachmentSizes[attachmentIndex];
-
+ const formattedSize = typeof size === 'number' && format(size);
+ const downloadFileWithFileSizeLabel = localize(
+ 'DownloadFileWithFileSize',
+ language,
+ downloadLabel,
+ attachment.name,
+ formattedSize
+ );
return (
-
-
+
);
diff --git a/packages/component/src/Attachment/TextContent.js b/packages/component/src/Attachment/TextContent.js
index 05b42a0621..fcd14cdf89 100644
--- a/packages/component/src/Attachment/TextContent.js
+++ b/packages/component/src/Attachment/TextContent.js
@@ -10,15 +10,24 @@ import connectToWebChat from '../connectToWebChat';
const TextContent = ({ contentType, renderMarkdown, styleSet, text }) =>
contentType === 'text/markdown' && renderMarkdown ? (
-
+
+ {/* Because of differences in browser implementations, is used to make screenreader perform the same on different browsers */}
+
+
+
) : (
(text || '').split('\n').map((line, index) => (
-
- {line.trim()}
-
+
+ {/* Because of differences in browser implementations, is used to make screenreader perform the same on different browsers */}
+
+
+ {line.trim()}
+
+
))
);
diff --git a/packages/component/src/ErrorBox.js b/packages/component/src/ErrorBox.js
index fc0b97d63c..3883d58d39 100644
--- a/packages/component/src/ErrorBox.js
+++ b/packages/component/src/ErrorBox.js
@@ -2,13 +2,18 @@ import PropTypes from 'prop-types';
import React from 'react';
import connectToWebChat from './connectToWebChat';
+import { localize } from './Localization/Localize';
-const ErrorBox = ({ children, message, styleSet }) => (
-
-
{message}
-
{children}
-
-);
+const ErrorBox = ({ children, language, message, styleSet }) => {
+ const errorMessageLabel = localize('ErrorMessage', language);
+
+ return (
+
+
{message}
+
{children}
+
+ );
+};
ErrorBox.defaultProps = {
children: undefined,
@@ -17,6 +22,7 @@ ErrorBox.defaultProps = {
ErrorBox.propTypes = {
children: PropTypes.any,
+ language: PropTypes.string.isRequired,
message: PropTypes.string,
styleSet: PropTypes.shape({
errorBox: PropTypes.any.isRequired
diff --git a/packages/component/src/Localization/en-US.js b/packages/component/src/Localization/en-US.js
index d2c744b417..a8d4aa5147 100644
--- a/packages/component/src/Localization/en-US.js
+++ b/packages/component/src/Localization/en-US.js
@@ -45,6 +45,11 @@ function botSaidSomething(avatarInitials, text) {
return `Bot ${avatarInitials} said, ${text}`;
}
+function downloadFileWithFileSize(downloadFileText, fileName, size) {
+ // Full text should read: "Download file of size "
+ return `${downloadFileText} ${fileName} of size ${size}`;
+}
+
function userSaidSomething(avatarInitials, text) {
return `User ${avatarInitials} said, ${text}`;
}
@@ -64,8 +69,11 @@ export default {
// '[Unknown Card '%1']': '[Unknown Card '%1']',
'Adaptive Card parse error': 'Adaptive Card parse error',
'Adaptive Card render error': 'Adaptive Card render error',
+ BotSent: 'Bot sent: ',
Chat: 'Chat',
'Download file': 'Download file',
+ DownloadFileWithFileSize: downloadFileWithFileSize,
+ ErrorMessage: 'Error message',
'Microphone off': 'Microphone off',
'Microphone on': 'Microphone on',
Left: 'Left',
@@ -75,11 +83,14 @@ export default {
Right: 'Right',
Send: 'Send',
Sending: 'Sending',
+ SendStatus: 'Send status: ',
+ SentAt: 'Sent at: ',
Speak: 'Speak',
'Starting…': 'Starting…',
Tax: 'Tax',
Total: 'Total',
'Type your message': 'Type your message',
'Upload file': 'Upload file',
+ UserSent: 'User sent: ',
VAT: 'VAT'
};