@azure/communication-react 1.11.0-alpha-202312120013 → 1.11.0-alpha-202312130012

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.
@@ -170,7 +170,7 @@ function getDefaultExportFromCjs (x) {
170
170
  // Copyright (c) Microsoft Corporation.
171
171
  // Licensed under the MIT License.
172
172
  // GENERATED FILE. DO NOT EDIT MANUALLY.
173
- var telemetryVersion = '1.11.0-alpha-202312120013';
173
+ var telemetryVersion = '1.11.0-alpha-202312130012';
174
174
 
175
175
 
176
176
  var telemetryVersion$1 = /*@__PURE__*/getDefaultExportFromCjs(telemetryVersion);
@@ -20024,8 +20024,9 @@ const extractTeamsAttachmentsMetadata = (attachments) => {
20024
20024
  const files = [];
20025
20025
  const inlineImages = [];
20026
20026
  attachments.forEach((attachment) => {
20027
- var _a, _b;
20027
+ var _a;
20028
20028
  const attachmentType = mapAttachmentType(attachment.attachmentType);
20029
+ const contentType = extractAttachmentContentTypeFromName(attachment.name);
20029
20030
  if (attachmentType === 'inlineImage') {
20030
20031
  inlineImages.push({
20031
20032
  attachmentType: attachmentType,
@@ -20039,7 +20040,7 @@ const extractTeamsAttachmentsMetadata = (attachments) => {
20039
20040
  attachmentType: attachmentType,
20040
20041
  id: attachment.id,
20041
20042
  name: (_a = attachment.name) !== null && _a !== void 0 ? _a : '',
20042
- extension: (_b = attachment.contentType) !== null && _b !== void 0 ? _b : '',
20043
+ extension: contentType !== null && contentType !== void 0 ? contentType : '',
20043
20044
  url: extractAttachmentUrl(attachment),
20044
20045
  payload: { teamsFileAttachment: 'true' }
20045
20046
  });
@@ -20049,7 +20050,7 @@ const extractTeamsAttachmentsMetadata = (attachments) => {
20049
20050
  };
20050
20051
  /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
20051
20052
  const mapAttachmentType = (attachmentType) => {
20052
- if (attachmentType === 'teamsImage' || attachmentType === 'teamsInlineImage') {
20053
+ if (attachmentType === 'image') {
20053
20054
  return 'inlineImage';
20054
20055
  }
20055
20056
  else if (attachmentType === 'file') {
@@ -20059,7 +20060,7 @@ const mapAttachmentType = (attachmentType) => {
20059
20060
  };
20060
20061
  /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
20061
20062
  const extractAttachmentUrl = (attachment) => {
20062
- return attachment.attachmentType === 'file' && attachment.previewUrl ? attachment.previewUrl : attachment.url;
20063
+ return attachment.attachmentType === 'file' && attachment.previewUrl ? attachment.previewUrl : attachment.url || '';
20063
20064
  };
20064
20065
  const processChatMessageContent = (message) => {
20065
20066
  var _a, _b, _c, _d, _e;
@@ -20067,7 +20068,7 @@ const processChatMessageContent = (message) => {
20067
20068
  if (sanitizedMessageContentType(message.type).includes('html') && ((_a = message.content) === null || _a === void 0 ? void 0 : _a.attachments)) {
20068
20069
  const attachments = (_b = message.content) === null || _b === void 0 ? void 0 : _b.attachments;
20069
20070
  const teamsImageHtmlContent = attachments
20070
- .filter((attachment) => attachment.attachmentType === 'teamsImage')
20071
+ .filter((attachment) => { var _a, _b; return attachment.attachmentType === 'image' && !((_b = (_a = message.content) === null || _a === void 0 ? void 0 : _a.message) === null || _b === void 0 ? void 0 : _b.includes(attachment.id)); })
20071
20072
  .map((attachment) => generateImageAttachmentImgHtml(attachment))
20072
20073
  .join('');
20073
20074
  if (teamsImageHtmlContent) {
@@ -20078,7 +20079,20 @@ const processChatMessageContent = (message) => {
20078
20079
  };
20079
20080
  /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
20080
20081
  const generateImageAttachmentImgHtml = (attachment) => {
20081
- return `\r\n<p><img alt="image" src="" itemscope="${attachment.contentType}" id="${attachment.id}"></p>`;
20082
+ const contentType = extractAttachmentContentTypeFromName(attachment.name);
20083
+ return `\r\n<p><img alt="image" src="" itemscope="${contentType}" id="${attachment.id}"></p>`;
20084
+ };
20085
+ /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
20086
+ const extractAttachmentContentTypeFromName = (name) => {
20087
+ if (name === undefined) {
20088
+ return '';
20089
+ }
20090
+ const indexOfLastDot = name.lastIndexOf('.');
20091
+ if (indexOfLastDot === undefined || indexOfLastDot < 0) {
20092
+ return '';
20093
+ }
20094
+ const contentType = name.substring(indexOfLastDot + 1);
20095
+ return contentType;
20082
20096
  };
20083
20097
  /* @conditional-compile-remove(file-sharing) @conditional-compile-remove(teams-inline-images-and-file-sharing) */
20084
20098
  const extractAttachmentsMetadata = (message) => {