@azure/communication-react 1.5.1-alpha-202304190014 → 1.5.1-alpha-202304200013

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.
@@ -162,7 +162,7 @@ const _toCommunicationIdentifier = (id) => {
162
162
  // Copyright (c) Microsoft Corporation.
163
163
  // Licensed under the MIT license.
164
164
  // GENERATED FILE. DO NOT EDIT MANUALLY.
165
- var telemetryVersion = '1.5.1-alpha-202304190014';
165
+ var telemetryVersion = '1.5.1-alpha-202304200013';
166
166
 
167
167
  // Copyright (c) Microsoft Corporation.
168
168
  /**
@@ -7146,6 +7146,15 @@ const MessageContentWithLiveAria = (props) => {
7146
7146
  };
7147
7147
  const MessageContentAsRichTextHTML = (props) => {
7148
7148
  const liveAuthor = _formatString(props.strings.liveAuthorIntro, { author: `${props.message.senderDisplayName}` });
7149
+ /* @conditional-compile-remove(teams-inline-images) */
7150
+ React.useEffect(() => {
7151
+ var _a;
7152
+ (_a = props.message.attachedFilesMetadata) === null || _a === void 0 ? void 0 : _a.map((fileMetadata) => {
7153
+ if (props.onFetchAttachment && props.attachmentsMap && props.attachmentsMap[fileMetadata.id] === undefined) {
7154
+ props.onFetchAttachment(fileMetadata);
7155
+ }
7156
+ });
7157
+ }, [props]);
7149
7158
  return (React__default['default'].createElement(MessageContentWithLiveAria, { message: props.message, liveMessage: `${props.message.mine ? '' : liveAuthor} ${extractContent(props.message.content || '')}`, ariaLabel: messageContentAriaText(props), content: processHtmlToReact(props) }));
7150
7159
  };
7151
7160
  const MessageContentAsText = (props) => {
@@ -7210,20 +7219,9 @@ const processHtmlToReact = (props) => {
7210
7219
  ((_a = props.message.attachedFilesMetadata) === null || _a === void 0 ? void 0 : _a.find((f) => f.id === node.attribs.id)));
7211
7220
  },
7212
7221
  processNode: (node, children, index) => {
7213
- var _a;
7214
7222
  // logic to check id in map/list
7215
- const fileMetadata = (_a = props.message.attachedFilesMetadata) === null || _a === void 0 ? void 0 : _a.find((f) => f.id === node.attribs.id);
7216
- // if in cache, early return
7217
7223
  if (props.attachmentsMap && node.attribs.id in props.attachmentsMap) {
7218
7224
  node.attribs = Object.assign(Object.assign({}, node.attribs), { src: props.attachmentsMap[node.attribs.id] });
7219
- return processNodeDefinitions.processDefaultNode(node, children, index);
7220
- }
7221
- // not yet in cache
7222
- if (fileMetadata && props.onFetchAttachment && props.attachmentsMap) {
7223
- props.onFetchAttachment(fileMetadata);
7224
- if (node.attribs.id in props.attachmentsMap) {
7225
- node.attribs = Object.assign(Object.assign({}, node.attribs), { src: props.attachmentsMap[node.attribs.id] });
7226
- }
7227
7225
  }
7228
7226
  return processNodeDefinitions.processDefaultNode(node, children, index);
7229
7227
  }
@@ -7839,6 +7837,7 @@ const MessageThread = (props) => {
7839
7837
  if (!onFetchAttachments || attachment.id in inlineAttachments) {
7840
7838
  return;
7841
7839
  }
7840
+ setInlineAttachments((prev) => (Object.assign(Object.assign({}, prev), { [attachment.id]: '' })));
7842
7841
  const attachmentDownloadResult = yield onFetchAttachments(attachment);
7843
7842
  if (attachmentDownloadResult[0]) {
7844
7843
  setInlineAttachments((prev) => (Object.assign(Object.assign({}, prev), { [attachment.id]: attachmentDownloadResult[0].blobUrl })));