@azure/communication-react 1.5.1-alpha-202306020014 → 1.5.1-alpha-202306030013
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/dist/communication-react.d.ts +1 -1
- package/dist/dist-cjs/communication-react/index.js +89 -55
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +37 -13
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js +1 -1
- package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js +2 -2
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js +2 -2
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +4 -4
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.js +10 -5
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +2 -1
- package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.js +16 -8
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +4 -4
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +11 -11
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
- package/package.json +8 -8
@@ -5858,7 +5858,7 @@ export declare interface FileMetadata {
|
|
5858
5858
|
/**
|
5859
5859
|
* @beta
|
5860
5860
|
*/
|
5861
|
-
export declare type FileMetadataAttachmentType = 'fileSharing' | /* @conditional-compile-remove(teams-inline-images) */ 'teamsInlineImage' | 'unknown';
|
5861
|
+
export declare type FileMetadataAttachmentType = 'fileSharing' | /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ 'teamsInlineImage' | 'unknown';
|
5862
5862
|
|
5863
5863
|
/**
|
5864
5864
|
* Properties for configuring the File Sharing feature.
|
@@ -167,7 +167,7 @@ const _toCommunicationIdentifier = (id) => {
|
|
167
167
|
// Copyright (c) Microsoft Corporation.
|
168
168
|
// Licensed under the MIT license.
|
169
169
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
170
|
-
var telemetryVersion = '1.5.1-alpha-
|
170
|
+
var telemetryVersion = '1.5.1-alpha-202306030013';
|
171
171
|
|
172
172
|
// Copyright (c) Microsoft Corporation.
|
173
173
|
/**
|
@@ -7355,8 +7355,9 @@ const findStringsDiffIndexes = (props) => {
|
|
7355
7355
|
*/
|
7356
7356
|
const htmlStringForMentionSuggestion = (suggestion, localeStrings) => {
|
7357
7357
|
const idHTML = ' id ="' + suggestion.id + '"';
|
7358
|
+
const displayTextHTML = ' displayText ="' + suggestion.displayText + '"';
|
7358
7359
|
const displayText = getDisplayNameForMentionSuggestion(suggestion, localeStrings);
|
7359
|
-
return '<' + MSFT_MENTION_TAG + idHTML + '>' + displayText + '</' + MSFT_MENTION_TAG + '>';
|
7360
|
+
return '<' + MSFT_MENTION_TAG + idHTML + displayTextHTML + '>' + displayText + '</' + MSFT_MENTION_TAG + '>';
|
7360
7361
|
};
|
7361
7362
|
/* @conditional-compile-remove(mention) */
|
7362
7363
|
/**
|
@@ -8767,7 +8768,7 @@ const preventUnwantedDismissProps = {
|
|
8767
8768
|
const defaultOnMentionRender = (mention) => {
|
8768
8769
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
8769
8770
|
const MsftMention = 'msft-mention';
|
8770
|
-
return React__default['default'].createElement(MsftMention, { id: mention.id }, mention.displayText);
|
8771
|
+
return (React__default['default'].createElement(MsftMention, { id: mention.id, displayText: mention.displayText }, mention.displayText));
|
8771
8772
|
};
|
8772
8773
|
|
8773
8774
|
// Copyright (c) Microsoft Corporation.
|
@@ -8792,7 +8793,7 @@ const MessageContentWithLiveAria = (props) => {
|
|
8792
8793
|
};
|
8793
8794
|
const MessageContentAsRichTextHTML = (props) => {
|
8794
8795
|
const liveAuthor = _formatString(props.strings.liveAuthorIntro, { author: `${props.message.senderDisplayName}` });
|
8795
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
8796
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
8796
8797
|
React.useEffect(() => {
|
8797
8798
|
var _a;
|
8798
8799
|
(_a = props.message.attachedFilesMetadata) === null || _a === void 0 ? void 0 : _a.map((fileMetadata) => {
|
@@ -8849,7 +8850,7 @@ const messageContentAriaText = (props) => {
|
|
8849
8850
|
};
|
8850
8851
|
const processNodeDefinitions = htmlToReact.ProcessNodeDefinitions();
|
8851
8852
|
const htmlToReactParser = htmlToReact.Parser();
|
8852
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
8853
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
8853
8854
|
const processInlineImage = (props) => ({
|
8854
8855
|
// Custom <img> processing
|
8855
8856
|
shouldProcessNode: (node) => {
|
@@ -8895,7 +8896,7 @@ const processMention = (props) => ({
|
|
8895
8896
|
const processHtmlToReact = (props) => {
|
8896
8897
|
var _a;
|
8897
8898
|
const steps = [
|
8898
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
8899
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
8899
8900
|
processInlineImage(props),
|
8900
8901
|
/* @conditional-compile-remove(mention) */
|
8901
8902
|
processMention(props),
|
@@ -8986,17 +8987,20 @@ const _FileDownloadCards = (props) => {
|
|
8986
8987
|
}
|
8987
8988
|
}
|
8988
8989
|
}), [props]);
|
8989
|
-
// Its safe to assume that if the first item in the fileMetadata is not a fileSharing type we don't want to display the FileDownloadCard.
|
8990
|
-
// Since you can't have both fileSharing and teamsInlineImage in the same message.
|
8991
8990
|
if (!fileMetadata ||
|
8992
8991
|
fileMetadata.length === 0 ||
|
8993
|
-
/* @conditional-compile-remove(teams-inline-images) */ fileMetadata
|
8992
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ !fileMetadata.some((attachment) => attachment.attachmentType === 'fileSharing')) {
|
8994
8993
|
return React__default['default'].createElement(React__default['default'].Fragment, null);
|
8995
8994
|
}
|
8996
8995
|
return (React__default['default'].createElement("div", { style: fileDownloadCardsStyle, "data-ui-id": "file-download-card-group" },
|
8997
8996
|
React__default['default'].createElement(_FileCardGroup, null, fileMetadata &&
|
8998
|
-
fileMetadata
|
8999
|
-
|
8997
|
+
fileMetadata
|
8998
|
+
.filter((attachment) => {
|
8999
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
9000
|
+
return attachment.attachmentType === 'fileSharing';
|
9001
|
+
})
|
9002
|
+
.map((file) => (React__default['default'].createElement(_FileCard, { fileName: file.name, key: file.name, fileExtension: file.extension, actionIcon: showSpinner ? (React__default['default'].createElement(react.Spinner, { size: react.SpinnerSize.medium, "aria-live": 'polite', role: 'status' })) : /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ !file.previewUrl ? (React__default['default'].createElement(react.IconButton, { className: iconButtonClassName, ariaLabel: downloadFileButtonString() },
|
9003
|
+
React__default['default'].createElement(DownloadIconTrampoline, null))) : undefined, actionHandler: () => fileDownloadHandler(userId, file) }))))));
|
9000
9004
|
};
|
9001
9005
|
/**
|
9002
9006
|
* @private
|
@@ -9104,9 +9108,9 @@ const MessageBubble = (props) => {
|
|
9104
9108
|
}
|
9105
9109
|
return (React__default['default'].createElement("div", { tabIndex: 0 },
|
9106
9110
|
React__default['default'].createElement(ChatMessageContent, { message: message, strings: strings,
|
9107
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
9111
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
9108
9112
|
onFetchAttachment: props.onFetchAttachments,
|
9109
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
9113
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
9110
9114
|
attachmentsMap: props.attachmentsMap,
|
9111
9115
|
/* @conditional-compile-remove(mention) */
|
9112
9116
|
mentionDisplayOptions: props.mentionDisplayOptions }),
|
@@ -9185,9 +9189,9 @@ const ChatMessageComponent = (props) => {
|
|
9185
9189
|
return (React__default['default'].createElement(ChatMessageComponentAsMessageBubble, Object.assign({}, props, { onRemoveClick: onRemoveClick, onEditClick: onEditClick, onResendClick: onResendClick, onRenderAvatar: props.onRenderAvatar,
|
9186
9190
|
/* @conditional-compile-remove(date-time-customization) */
|
9187
9191
|
onDisplayDateTimeString: props.onDisplayDateTimeString, strings: props.strings,
|
9188
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
9192
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
9189
9193
|
onFetchAttachments: props.onFetchAttachments,
|
9190
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
9194
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
9191
9195
|
attachmentsMap: props.attachmentsMap,
|
9192
9196
|
/* @conditional-compile-remove(mention) */
|
9193
9197
|
mentionDisplayOptions: (_b = props.mentionOptions) === null || _b === void 0 ? void 0 : _b.displayOptions })));
|
@@ -9557,7 +9561,7 @@ const MessageThread = (props) => {
|
|
9557
9561
|
const { messages: newMessages, userId, participantCount, readReceiptsBySenderId, styles, disableJumpToNewMessageButton = false, showMessageDate = false, showMessageStatus = false, numberOfChatMessagesToReload = 5, onMessageSeen, onRenderMessageStatus, onRenderAvatar, onLoadPreviousChatMessages, onRenderJumpToNewMessageButton, onRenderMessage, onUpdateMessage, onCancelMessageEdit, onDeleteMessage, onSendMessage,
|
9558
9562
|
/* @conditional-compile-remove(date-time-customization) */
|
9559
9563
|
onDisplayDateTimeString,
|
9560
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
9564
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
9561
9565
|
onFetchAttachments,
|
9562
9566
|
/* @conditional-compile-remove(mention) */
|
9563
9567
|
mentionOptions } = props;
|
@@ -9577,11 +9581,13 @@ const MessageThread = (props) => {
|
|
9577
9581
|
const [lastSendingChatMessage, setLastSendingChatMessage] = React.useState(undefined);
|
9578
9582
|
// readCount and participantCount will only need to be updated on-fly when user hover on an indicator
|
9579
9583
|
const [readCountForHoveredIndicator, setReadCountForHoveredIndicator] = React.useState(undefined);
|
9580
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
9584
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
9581
9585
|
const [inlineAttachments, setInlineAttachments] = React.useState({});
|
9582
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
9586
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
9583
9587
|
const onFetchInlineAttachment = React.useCallback((attachment) => __awaiter$t(void 0, void 0, void 0, function* () {
|
9584
|
-
if (!onFetchAttachments ||
|
9588
|
+
if (!onFetchAttachments ||
|
9589
|
+
attachment.id in inlineAttachments ||
|
9590
|
+
attachment.attachmentType !== 'teamsInlineImage') {
|
9585
9591
|
return;
|
9586
9592
|
}
|
9587
9593
|
setInlineAttachments((prev) => (Object.assign(Object.assign({}, prev), { [attachment.id]: '' })));
|
@@ -9598,6 +9604,10 @@ const MessageThread = (props) => {
|
|
9598
9604
|
isAllChatMessagesLoadedRef.current = false;
|
9599
9605
|
}
|
9600
9606
|
}, [onLoadPreviousChatMessages]);
|
9607
|
+
/* @conditional-compile-remove(file-sharing) */ /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
9608
|
+
React.useEffect(() => {
|
9609
|
+
reactFileTypeIcons.initializeFileTypeIcons();
|
9610
|
+
}, []);
|
9601
9611
|
const previousTopRef = React.useRef(-1);
|
9602
9612
|
const previousHeightRef = React.useRef(-1);
|
9603
9613
|
const messageIdSeenByMeRef = React.useRef('');
|
@@ -9801,9 +9811,9 @@ const MessageThread = (props) => {
|
|
9801
9811
|
strings: strings, message: messageProps.message, userId: props.userId, remoteParticipantsCount: participantCount ? participantCount - 1 : 0, inlineAcceptRejectEditButtons: !isNarrow, onRenderAvatar: onRenderAvatar, showMessageStatus: showMessageStatus, messageStatus: messageProps.message.status, onActionButtonClick: onActionButtonClickMemo,
|
9802
9812
|
/* @conditional-compile-remove(date-time-customization) */
|
9803
9813
|
onDisplayDateTimeString: onDisplayDateTimeString,
|
9804
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
9814
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
9805
9815
|
onFetchAttachments: onFetchInlineAttachment,
|
9806
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
9816
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
9807
9817
|
attachmentsMap: inlineAttachments,
|
9808
9818
|
/* @conditional-compile-remove(mention) */
|
9809
9819
|
mentionOptions: mentionOptions })));
|
@@ -9821,9 +9831,9 @@ const MessageThread = (props) => {
|
|
9821
9831
|
onActionButtonClickMemo,
|
9822
9832
|
/* @conditional-compile-remove(date-time-customization) */
|
9823
9833
|
onDisplayDateTimeString,
|
9824
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
9834
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
9825
9835
|
onFetchInlineAttachment,
|
9826
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
9836
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
9827
9837
|
inlineAttachments,
|
9828
9838
|
/* @conditional-compile-remove(mention) */
|
9829
9839
|
mentionOptions
|
@@ -17044,8 +17054,8 @@ const extractAttachedFilesMetadata = (metadata) => {
|
|
17044
17054
|
return [];
|
17045
17055
|
}
|
17046
17056
|
};
|
17047
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
17048
|
-
const
|
17057
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
17058
|
+
const extractTeamsAttachmentsMetadata = (attachments) => {
|
17049
17059
|
return attachments.map((attachment) => {
|
17050
17060
|
var _a, _b;
|
17051
17061
|
return ({
|
@@ -17053,12 +17063,12 @@ const extractInlineImageFilesMetadata = (attachments) => {
|
|
17053
17063
|
id: attachment.id,
|
17054
17064
|
name: (_a = attachment.name) !== null && _a !== void 0 ? _a : '',
|
17055
17065
|
extension: (_b = attachment.contentType) !== null && _b !== void 0 ? _b : '',
|
17056
|
-
url: attachment
|
17066
|
+
url: extractAttachmentUrl(attachment),
|
17057
17067
|
previewUrl: attachment.previewUrl
|
17058
17068
|
});
|
17059
17069
|
});
|
17060
17070
|
};
|
17061
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
17071
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
17062
17072
|
const mapAttachmentType = (attachmentType) => {
|
17063
17073
|
if (attachmentType === 'teamsImage' || attachmentType === 'teamsInlineImage') {
|
17064
17074
|
return 'teamsInlineImage';
|
@@ -17068,7 +17078,30 @@ const mapAttachmentType = (attachmentType) => {
|
|
17068
17078
|
}
|
17069
17079
|
return 'unknown';
|
17070
17080
|
};
|
17071
|
-
/* @conditional-compile-remove(
|
17081
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
17082
|
+
const extractAttachmentUrl = (attachment) => {
|
17083
|
+
return attachment.attachmentType === 'file' && attachment.previewUrl ? attachment.previewUrl : attachment.url;
|
17084
|
+
};
|
17085
|
+
const processChatMessageContent = (message) => {
|
17086
|
+
var _a, _b, _c, _d, _e;
|
17087
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
17088
|
+
if (sanitizedMessageContentType(message.type).includes('html') && ((_a = message.content) === null || _a === void 0 ? void 0 : _a.attachments)) {
|
17089
|
+
const attachments = (_b = message.content) === null || _b === void 0 ? void 0 : _b.attachments;
|
17090
|
+
const teamsImageHtmlContent = attachments
|
17091
|
+
.filter((attachment) => attachment.attachmentType === 'teamsImage')
|
17092
|
+
.map((attachment) => generateImageAttachmentImgHtml(attachment))
|
17093
|
+
.join('');
|
17094
|
+
if (teamsImageHtmlContent) {
|
17095
|
+
return ((_d = (_c = message.content) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : '') + teamsImageHtmlContent;
|
17096
|
+
}
|
17097
|
+
}
|
17098
|
+
return (_e = message.content) === null || _e === void 0 ? void 0 : _e.message;
|
17099
|
+
};
|
17100
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
17101
|
+
const generateImageAttachmentImgHtml = (attachment) => {
|
17102
|
+
return `\r\n<p><img alt="image" src="" itemscope="${attachment.contentType}" id="${attachment.id}"></p>`;
|
17103
|
+
};
|
17104
|
+
/* @conditional-compile-remove(file-sharing) @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
17072
17105
|
const extractFilesMetadata = (message) => {
|
17073
17106
|
var _a, _b;
|
17074
17107
|
let fileMetadata = [];
|
@@ -17076,9 +17109,9 @@ const extractFilesMetadata = (message) => {
|
|
17076
17109
|
if (message.metadata) {
|
17077
17110
|
fileMetadata = fileMetadata.concat(extractAttachedFilesMetadata(message.metadata));
|
17078
17111
|
}
|
17079
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
17112
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
17080
17113
|
if ((_a = message.content) === null || _a === void 0 ? void 0 : _a.attachments) {
|
17081
|
-
fileMetadata = fileMetadata.concat(
|
17114
|
+
fileMetadata = fileMetadata.concat(extractTeamsAttachmentsMetadata((_b = message.content) === null || _b === void 0 ? void 0 : _b.attachments));
|
17082
17115
|
}
|
17083
17116
|
return fileMetadata;
|
17084
17117
|
};
|
@@ -17099,12 +17132,11 @@ const convertToUiBlockedMessage = (message, userId, isSeen, isLargeGroup) => {
|
|
17099
17132
|
};
|
17100
17133
|
};
|
17101
17134
|
const convertToUiChatMessage = (message, userId, isSeen, isLargeGroup) => {
|
17102
|
-
var _a;
|
17103
17135
|
const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;
|
17104
17136
|
return {
|
17105
17137
|
messageType: 'chat',
|
17106
17138
|
createdOn: message.createdOn,
|
17107
|
-
content: (
|
17139
|
+
content: processChatMessageContent(message),
|
17108
17140
|
contentType: sanitizedMessageContentType(message.type),
|
17109
17141
|
status: !isLargeGroup && message.status === 'delivered' && isSeen ? 'seen' : message.status,
|
17110
17142
|
senderDisplayName: message.senderDisplayName,
|
@@ -17115,7 +17147,7 @@ const convertToUiChatMessage = (message, userId, isSeen, isLargeGroup) => {
|
|
17115
17147
|
deletedOn: message.deletedOn,
|
17116
17148
|
mine: messageSenderId === userId,
|
17117
17149
|
metadata: message.metadata,
|
17118
|
-
/* @conditional-compile-remove(file-sharing) @conditional-compile-remove(teams-inline-images) */
|
17150
|
+
/* @conditional-compile-remove(file-sharing) @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
17119
17151
|
attachedFilesMetadata: extractFilesMetadata(message)
|
17120
17152
|
};
|
17121
17153
|
};
|
@@ -17207,18 +17239,20 @@ const sanitizedMessageContentType = (type) => {
|
|
17207
17239
|
: 'unknown';
|
17208
17240
|
};
|
17209
17241
|
const isMessageValidToRender = (message) => {
|
17210
|
-
var _a, _b;
|
17242
|
+
var _a, _b, _c;
|
17211
17243
|
if (message.deletedOn) {
|
17212
17244
|
return false;
|
17213
17245
|
}
|
17214
|
-
if ((_a = message.metadata) === null || _a === void 0 ? void 0 : _a['fileSharingMetadata'])
|
17246
|
+
if (((_a = message.metadata) === null || _a === void 0 ? void 0 : _a['fileSharingMetadata']) ||
|
17247
|
+
(
|
17248
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ (_b = message.content) === null || _b === void 0 ? void 0 : _b.attachments)) {
|
17215
17249
|
return true;
|
17216
17250
|
}
|
17217
17251
|
/* @conditional-compile-remove(data-loss-prevention) */
|
17218
17252
|
if (message.policyViolation) {
|
17219
17253
|
return true;
|
17220
17254
|
}
|
17221
|
-
return !!(message.content && ((
|
17255
|
+
return !!(message.content && ((_c = message.content) === null || _c === void 0 ? void 0 : _c.message) !== '');
|
17222
17256
|
};
|
17223
17257
|
|
17224
17258
|
// Copyright (c) Microsoft Corporation.
|
@@ -17906,7 +17940,7 @@ class EventSubscriber {
|
|
17906
17940
|
version: event.version,
|
17907
17941
|
content: {
|
17908
17942
|
message: event.message,
|
17909
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
17943
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
17910
17944
|
attachments: event.attachments
|
17911
17945
|
},
|
17912
17946
|
type: this.convertEventType(event.type),
|
@@ -19433,19 +19467,19 @@ class ChatContext {
|
|
19433
19467
|
*/
|
19434
19468
|
class AzureCommunicationChatAdapter {
|
19435
19469
|
constructor(chatClient, chatThreadClient,
|
19436
|
-
/* @conditional-compile-remove(teams-inline-images) */ options) {
|
19437
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
19470
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ options) {
|
19471
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
19438
19472
|
this.credential = undefined;
|
19439
19473
|
this.emitter = new EventEmitter__default['default']();
|
19440
19474
|
this.bindAllPublicMethods();
|
19441
19475
|
this.chatClient = chatClient;
|
19442
19476
|
this.chatThreadClient = chatThreadClient;
|
19443
19477
|
this.context = new ChatContext(chatClient.getState(), chatThreadClient.threadId);
|
19444
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
19478
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
19445
19479
|
if (options && options.credential) {
|
19446
19480
|
this.credential = options.credential;
|
19447
19481
|
}
|
19448
|
-
/* @conditional-compile-remove(file-sharing) */ /* @conditional-compile-remove(teams-inline-images) */
|
19482
|
+
/* @conditional-compile-remove(file-sharing) */ /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
19449
19483
|
this.fileUploadAdapter = new AzureCommunicationFileUploadAdapter(this.context);
|
19450
19484
|
const onStateChange = (clientState) => {
|
19451
19485
|
// unsubscribe when the instance gets disposed
|
@@ -19489,7 +19523,7 @@ class AzureCommunicationChatAdapter {
|
|
19489
19523
|
this.updateFileUploadErrorMessage = this.updateFileUploadErrorMessage.bind(this);
|
19490
19524
|
/* @conditional-compile-remove(file-sharing) */
|
19491
19525
|
this.updateFileUploadMetadata = this.updateFileUploadMetadata.bind(this);
|
19492
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
19526
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
19493
19527
|
this.downloadAttachments = this.downloadAttachments.bind(this);
|
19494
19528
|
}
|
19495
19529
|
dispose() {
|
@@ -19627,7 +19661,7 @@ class AzureCommunicationChatAdapter {
|
|
19627
19661
|
updateFileUploadMetadata(id, metadata) {
|
19628
19662
|
this.fileUploadAdapter.updateFileUploadMetadata(id, metadata);
|
19629
19663
|
}
|
19630
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
19664
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
19631
19665
|
downloadAttachments(options) {
|
19632
19666
|
return __awaiter$h(this, void 0, void 0, function* () {
|
19633
19667
|
return this.asyncTeeErrorToEventEmitter(() => __awaiter$h(this, void 0, void 0, function* () {
|
@@ -19648,7 +19682,7 @@ class AzureCommunicationChatAdapter {
|
|
19648
19682
|
}));
|
19649
19683
|
});
|
19650
19684
|
}
|
19651
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
19685
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
19652
19686
|
downloadAuthenticatedFile(accessToken, options) {
|
19653
19687
|
return __awaiter$h(this, void 0, void 0, function* () {
|
19654
19688
|
function fetchWithAuthentication(url, token) {
|
@@ -19778,10 +19812,10 @@ const createAzureCommunicationChatAdapter = ({ endpoint: endpointUrl, userId, di
|
|
19778
19812
|
});
|
19779
19813
|
const chatThreadClient = yield chatClient.getChatThreadClient(threadId);
|
19780
19814
|
yield chatClient.startRealtimeNotifications();
|
19781
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
19815
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
19782
19816
|
const options = { credential: credential };
|
19783
19817
|
const adapter = yield createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient,
|
19784
|
-
/* @conditional-compile-remove(teams-inline-images) */ options);
|
19818
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ options);
|
19785
19819
|
return adapter;
|
19786
19820
|
});
|
19787
19821
|
/**
|
@@ -19889,11 +19923,11 @@ beforeDispose) => {
|
|
19889
19923
|
* @public
|
19890
19924
|
*/
|
19891
19925
|
function createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient,
|
19892
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
19926
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
19893
19927
|
options) {
|
19894
19928
|
return __awaiter$h(this, void 0, void 0, function* () {
|
19895
19929
|
return new AzureCommunicationChatAdapter(chatClient, chatThreadClient,
|
19896
|
-
/* @conditional-compile-remove(teams-inline-images) */ options);
|
19930
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ options);
|
19897
19931
|
});
|
19898
19932
|
}
|
19899
19933
|
const isChatError = (e) => {
|
@@ -20547,7 +20581,7 @@ const ChatScreen = (props) => {
|
|
20547
20581
|
const onRenderFileDownloads = React.useCallback((userId, message) => (React__default['default'].createElement(_FileDownloadCards, { userId: userId, fileMetadata: message.attachedFilesMetadata || [], downloadHandler: fileSharing === null || fileSharing === void 0 ? void 0 : fileSharing.downloadHandler, onDownloadErrorMessage: (errorMessage) => {
|
20548
20582
|
setDownloadErrorMessage(errorMessage);
|
20549
20583
|
} })), [fileSharing === null || fileSharing === void 0 ? void 0 : fileSharing.downloadHandler]);
|
20550
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
20584
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
20551
20585
|
const onRenderInlineAttachment = React.useCallback((attachment) => __awaiter$f(void 0, void 0, void 0, function* () {
|
20552
20586
|
if (attachment.previewUrl) {
|
20553
20587
|
const blob = yield adapter.downloadAttachments({ attachmentUrls: [attachment.previewUrl] });
|
@@ -20573,7 +20607,7 @@ const ChatScreen = (props) => {
|
|
20573
20607
|
React__default['default'].createElement(MessageThread, Object.assign({}, messageThreadProps, { onRenderAvatar: onRenderAvatarCallback, onRenderMessage: onRenderMessage,
|
20574
20608
|
/* @conditional-compile-remove(file-sharing) */
|
20575
20609
|
onRenderFileDownloads: onRenderFileDownloads,
|
20576
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
20610
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
20577
20611
|
onFetchAttachments: onRenderInlineAttachment, numberOfChatMessagesToReload: defaultNumberOfChatMessagesToReload, styles: messageThreadStyles })),
|
20578
20612
|
React__default['default'].createElement(react.Stack, { className: react.mergeStyles(sendboxContainerStyles) },
|
20579
20613
|
React__default['default'].createElement("div", { className: react.mergeStyles(typingIndicatorContainerStyles) }, onRenderTypingIndicator ? (onRenderTypingIndicator(typingIndicatorProps.typingUsers)) : (React__default['default'].createElement(TypingIndicator, Object.assign({}, typingIndicatorProps, { styles: typingIndicatorStyles })))),
|
@@ -27619,7 +27653,7 @@ class CallWithChatBackedChatAdapter {
|
|
27619
27653
|
};
|
27620
27654
|
this.callWithChatAdapter = callWithChatAdapter;
|
27621
27655
|
}
|
27622
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
27656
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
27623
27657
|
downloadAttachments(options) {
|
27624
27658
|
return __awaiter$1(this, void 0, void 0, function* () {
|
27625
27659
|
return yield this.callWithChatAdapter.downloadAttachments(options);
|
@@ -28183,7 +28217,7 @@ class AzureCommunicationCallWithChatAdapter {
|
|
28183
28217
|
this.updateFileUploadErrorMessage = this.updateFileUploadErrorMessage.bind(this);
|
28184
28218
|
/* @conditional-compile-remove(file-sharing) */
|
28185
28219
|
this.updateFileUploadMetadata = this.updateFileUploadMetadata.bind(this);
|
28186
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
28220
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
28187
28221
|
this.downloadAttachments = this.downloadAttachments.bind(this);
|
28188
28222
|
/* @conditional-compile-remove(PSTN-calls) */
|
28189
28223
|
this.holdCall.bind(this);
|
@@ -28392,7 +28426,7 @@ class AzureCommunicationCallWithChatAdapter {
|
|
28392
28426
|
return yield this.chatAdapter.deleteMessage(messageId);
|
28393
28427
|
});
|
28394
28428
|
}
|
28395
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
28429
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
28396
28430
|
downloadAttachments(options) {
|
28397
28431
|
return __awaiter(this, void 0, void 0, function* () {
|
28398
28432
|
return yield this.chatAdapter.downloadAttachments(options);
|
@@ -28765,11 +28799,11 @@ beforeDispose) => {
|
|
28765
28799
|
* @public
|
28766
28800
|
*/
|
28767
28801
|
const createAzureCommunicationCallWithChatAdapterFromClients = ({ callClient, callAgent, callLocator, chatClient, chatThreadClient,
|
28768
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
28802
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
28769
28803
|
options }) => __awaiter(void 0, void 0, void 0, function* () {
|
28770
28804
|
const createCallAdapterPromise = createAzureCommunicationCallAdapterFromClient(callClient, callAgent, callLocator);
|
28771
28805
|
const createChatAdapterPromise = createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient,
|
28772
|
-
/* @conditional-compile-remove(teams-inline-images) */
|
28806
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
28773
28807
|
options);
|
28774
28808
|
const [callAdapter, chatAdapter] = yield Promise.all([createCallAdapterPromise, createChatAdapterPromise]);
|
28775
28809
|
return new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter);
|