@azure/communication-react 1.13.0-alpha-202402130013 → 1.13.0-alpha-202402140012

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.
@@ -173,7 +173,7 @@ function getDefaultExportFromCjs (x) {
173
173
  // Copyright (c) Microsoft Corporation.
174
174
  // Licensed under the MIT License.
175
175
  // GENERATED FILE. DO NOT EDIT MANUALLY.
176
- var telemetryVersion = '1.13.0-alpha-202402130013';
176
+ var telemetryVersion = '1.13.0-alpha-202402140012';
177
177
 
178
178
 
179
179
  var telemetryVersion$1 = /*@__PURE__*/getDefaultExportFromCjs(telemetryVersion);
@@ -10672,21 +10672,36 @@ const generateLiveMessage = (props) => {
10672
10672
  return `${props.message.editedOn ? props.strings.editedTag : ''} ${props.message.mine ? '' : liveAuthor} ${extractContent(props.message.content || '')} `;
10673
10673
  };
10674
10674
  const messageContentAriaText = (props) => {
10675
- // Strip all html tags from the content for aria.
10676
- return props.message.content
10677
- ? props.message.mine
10675
+ if (props.message.content) {
10676
+ // Replace all <img> tags with 'image' for aria.
10677
+ const parsedContent = DOMPurify.sanitize(props.message.content, {
10678
+ ALLOWED_TAGS: ['img'],
10679
+ RETURN_DOM_FRAGMENT: true
10680
+ });
10681
+ parsedContent.childNodes.forEach((child) => {
10682
+ if (child.nodeName.toLowerCase() !== 'img') {
10683
+ return;
10684
+ }
10685
+ const imageTextNode = document.createElement('div');
10686
+ imageTextNode.innerHTML = 'image ';
10687
+ parsedContent.replaceChild(imageTextNode, child);
10688
+ });
10689
+ // Strip all html tags from the content for aria.
10690
+ const message = DOMPurify.sanitize(parsedContent, { ALLOWED_TAGS: [] });
10691
+ return props.message.mine
10678
10692
  ? _formatString(props.strings.messageContentMineAriaText, {
10679
- message: DOMPurify.sanitize(props.message.content, { ALLOWED_TAGS: [] })
10693
+ message: message
10680
10694
  })
10681
10695
  : _formatString(props.strings.messageContentAriaText, {
10682
10696
  author: `${props.message.senderDisplayName}`,
10683
- message: DOMPurify.sanitize(props.message.content, { ALLOWED_TAGS: [] })
10684
- })
10685
- : undefined;
10697
+ message: message
10698
+ });
10699
+ }
10700
+ return undefined;
10686
10701
  };
10687
10702
  /* @conditional-compile-remove(image-overlay) */
10688
10703
  const defaultOnRenderInlineImage = (inlineImage) => {
10689
- return (React.createElement("img", Object.assign({}, inlineImage.imgAttrs, { "data-ui-id": inlineImage.imgAttrs.id, tabIndex: 0, role: "button", style: Object.assign({ cursor: 'pointer' }, inlineImage.imgAttrs.style) })));
10704
+ return React.createElement("img", Object.assign({ tabIndex: 0, "data-ui-id": inlineImage.imgAttrs.id }, inlineImage.imgAttrs));
10690
10705
  };
10691
10706
  const processHtmlToReact = (props) => {
10692
10707
  var _a;