@azure/communication-react 1.14.0-alpha-202403030013 → 1.14.0-alpha-202403050012
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/dist-cjs/communication-react/index.js +45 -52
- 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/react-components/src/components/Survey/TagsSurvey/TagsSurvey.js +6 -10
- package/dist/dist-esm/react-components/src/components/Survey/TagsSurvey/TagsSurvey.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +37 -40
- 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 +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
- package/package.json +1 -1
@@ -174,7 +174,7 @@ function getDefaultExportFromCjs (x) {
|
|
174
174
|
// Copyright (c) Microsoft Corporation.
|
175
175
|
// Licensed under the MIT License.
|
176
176
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
177
|
-
var telemetryVersion = '1.14.0-alpha-
|
177
|
+
var telemetryVersion = '1.14.0-alpha-202403050012';
|
178
178
|
|
179
179
|
|
180
180
|
var telemetryVersion$1 = /*@__PURE__*/getDefaultExportFromCjs(telemetryVersion);
|
@@ -19318,16 +19318,12 @@ const _TagsSurvey = (props) => {
|
|
19318
19318
|
else {
|
19319
19319
|
if (issue) {
|
19320
19320
|
setSelectedTags((prevState) => {
|
19321
|
-
var _a;
|
19322
|
-
|
19323
|
-
|
19324
|
-
|
19325
|
-
|
19326
|
-
|
19327
|
-
delete prevState[issueCategory];
|
19328
|
-
}
|
19329
|
-
}
|
19330
|
-
return prevState;
|
19321
|
+
var _a, _b;
|
19322
|
+
// 'prevState[issueCategory]?.issues as ...' typing is required here to avoid a typescript limitation
|
19323
|
+
// "This expression is not callable" caused by filter().
|
19324
|
+
// More information can be found here: https://github.com/microsoft/TypeScript/issues/44373
|
19325
|
+
const categoryIssues = (_b = (_a = prevState[issueCategory]) === null || _a === void 0 ? void 0 : _a.issues) === null || _b === void 0 ? void 0 : _b.filter((value) => value !== issue);
|
19326
|
+
return Object.assign(Object.assign({}, prevState), { [issueCategory]: Object.assign(Object.assign({}, (prevState[issueCategory] || {})), { issues: categoryIssues }) });
|
19331
19327
|
});
|
19332
19328
|
}
|
19333
19329
|
else {
|
@@ -24139,7 +24135,7 @@ class AzureCommunicationChatAdapter {
|
|
24139
24135
|
return __awaiter$n(this, void 0, void 0, function* () {
|
24140
24136
|
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$n(this, void 0, void 0, function* () {
|
24141
24137
|
/* @conditional-compile-remove(file-sharing) */
|
24142
|
-
const updatedOptions = options ?
|
24138
|
+
const updatedOptions = { attachmentMetadata: options === null || options === void 0 ? void 0 : options.attachmentMetadata, metadata: metadata };
|
24143
24139
|
/* @conditional-compile-remove(file-sharing) */
|
24144
24140
|
return yield this.handlers.onUpdateMessage(messageId, content, updatedOptions);
|
24145
24141
|
}));
|
@@ -25153,28 +25149,17 @@ const ChatScreen = (props) => {
|
|
25153
25149
|
const errorBarProps = usePropsFor$2(ErrorBar);
|
25154
25150
|
/* @conditional-compile-remove(image-overlay) */
|
25155
25151
|
React.useEffect(() => {
|
25156
|
-
var _a;
|
25157
25152
|
if (overlayImageItem === undefined) {
|
25158
25153
|
return;
|
25159
25154
|
}
|
25160
|
-
const
|
25161
|
-
|
25162
|
-
|
25163
|
-
|
25164
|
-
|
25165
|
-
}
|
25166
|
-
const message = messages[0];
|
25167
|
-
if (overlayImageItem.imageSrc === '' && message.inlineImages && ((_a = message.inlineImages) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
25168
|
-
const inlineImages = message.inlineImages.filter((attachment) => {
|
25169
|
-
return attachment.id === (overlayImageItem === null || overlayImageItem === void 0 ? void 0 : overlayImageItem.attachmentId);
|
25170
|
-
});
|
25171
|
-
if (inlineImages.length <= 0 ||
|
25172
|
-
inlineImages[0].fullSizeImageSrc === undefined ||
|
25173
|
-
inlineImages[0].fullSizeImageSrc === '' ||
|
25174
|
-
overlayImageItem.imageSrc === inlineImages[0].fullSizeImageSrc) {
|
25155
|
+
const message = adapter.getState().thread.chatMessages[overlayImageItem === null || overlayImageItem === void 0 ? void 0 : overlayImageItem.messageId];
|
25156
|
+
const resourceCache = message.resourceCache;
|
25157
|
+
if (overlayImageItem.imageSrc === '' && resourceCache) {
|
25158
|
+
const fullSizeImageSrc = resourceCache[overlayImageItem.imageUrl];
|
25159
|
+
if (fullSizeImageSrc === undefined || fullSizeImageSrc === '' || overlayImageItem.imageSrc === fullSizeImageSrc) {
|
25175
25160
|
return;
|
25176
25161
|
}
|
25177
|
-
setOverlayImageItem(Object.assign(Object.assign({}, overlayImageItem), { imageSrc:
|
25162
|
+
setOverlayImageItem(Object.assign(Object.assign({}, overlayImageItem), { imageSrc: fullSizeImageSrc }));
|
25178
25163
|
}
|
25179
25164
|
// Disable eslint because we are using the overlayImageItem in this effect but don't want to have it as a dependency, as it will cause an infinite loop.
|
25180
25165
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
@@ -25208,44 +25193,47 @@ const ChatScreen = (props) => {
|
|
25208
25193
|
/* @conditional-compile-remove(image-overlay) */
|
25209
25194
|
const onInlineImageClicked = React.useCallback((attachmentId, messageId) => __awaiter$l(void 0, void 0, void 0, function* () {
|
25210
25195
|
var _a, _b;
|
25211
|
-
const
|
25212
|
-
|
25213
|
-
|
25214
|
-
if (!messages || messages.length <= 0) {
|
25215
|
-
return;
|
25216
|
-
}
|
25217
|
-
const chatMessage = messages[0];
|
25218
|
-
const inlinedImages = (_b = chatMessage.inlineImages) === null || _b === void 0 ? void 0 : _b.filter((attachment) => {
|
25219
|
-
return attachment.id === attachmentId;
|
25196
|
+
const message = adapter.getState().thread.chatMessages[messageId];
|
25197
|
+
const inlinedImages = (_b = (_a = message.content) === null || _a === void 0 ? void 0 : _a.attachments) === null || _b === void 0 ? void 0 : _b.filter((attachment) => {
|
25198
|
+
return attachment.attachmentType === 'image' && attachment.id === attachmentId;
|
25220
25199
|
});
|
25221
25200
|
if (!inlinedImages || inlinedImages.length <= 0) {
|
25222
25201
|
return;
|
25223
25202
|
}
|
25224
25203
|
const attachment = inlinedImages[0];
|
25204
|
+
const resourceCache = message.resourceCache;
|
25205
|
+
let imageSrc = '';
|
25206
|
+
if (attachment.url) {
|
25207
|
+
if (resourceCache && resourceCache[attachment.url]) {
|
25208
|
+
imageSrc = resourceCache[attachment.url];
|
25209
|
+
}
|
25210
|
+
else {
|
25211
|
+
adapter.downloadResourceToCache({
|
25212
|
+
threadId: adapter.getState().thread.threadId,
|
25213
|
+
messageId: messageId,
|
25214
|
+
resourceUrl: attachment.url
|
25215
|
+
});
|
25216
|
+
}
|
25217
|
+
}
|
25225
25218
|
const titleIconRenderOptions = {
|
25226
|
-
text:
|
25219
|
+
text: message.senderDisplayName,
|
25227
25220
|
size: react.PersonaSize.size32,
|
25228
25221
|
showOverflowTooltip: false,
|
25229
|
-
imageAlt:
|
25222
|
+
imageAlt: message.senderDisplayName
|
25230
25223
|
};
|
25231
|
-
const
|
25224
|
+
const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;
|
25225
|
+
const titleIcon = onRenderAvatarCallback && onRenderAvatarCallback(messageSenderId, titleIconRenderOptions);
|
25232
25226
|
const overlayImage = {
|
25233
|
-
title:
|
25227
|
+
title: message.senderDisplayName || '',
|
25234
25228
|
titleIcon: titleIcon,
|
25235
25229
|
attachmentId: attachment.id,
|
25236
|
-
imageSrc:
|
25237
|
-
messageId: messageId
|
25230
|
+
imageSrc: imageSrc,
|
25231
|
+
messageId: messageId,
|
25232
|
+
imageUrl: attachment.url || ''
|
25238
25233
|
};
|
25239
25234
|
setIsImageOverlayOpen(true);
|
25240
25235
|
setOverlayImageItem(overlayImage);
|
25241
|
-
|
25242
|
-
adapter.downloadResourceToCache({
|
25243
|
-
threadId: adapter.getState().thread.threadId,
|
25244
|
-
messageId: messageId,
|
25245
|
-
resourceUrl: attachment.url
|
25246
|
-
});
|
25247
|
-
}
|
25248
|
-
}), [adapter, messageThreadProps, onRenderAvatarCallback]);
|
25236
|
+
}), [adapter, onRenderAvatarCallback, userId]);
|
25249
25237
|
/* @conditional-compile-remove(image-overlay) */
|
25250
25238
|
const inlineImageOptions = {
|
25251
25239
|
onRenderInlineImage: (inlineImage, defaultOnRender) => {
|
@@ -25316,6 +25304,11 @@ const ChatScreen = (props) => {
|
|
25316
25304
|
overlayImageItem && (React.createElement(ImageOverlay, Object.assign({}, overlayImageItem, { isOpen: isImageOverlayOpen, onDismiss: () => {
|
25317
25305
|
setOverlayImageItem(undefined);
|
25318
25306
|
setIsImageOverlayOpen(false);
|
25307
|
+
adapter.removeResourceFromCache({
|
25308
|
+
threadId: adapter.getState().thread.threadId,
|
25309
|
+
messageId: overlayImageItem.messageId,
|
25310
|
+
resourceUrl: overlayImageItem.imageUrl
|
25311
|
+
});
|
25319
25312
|
}, onDownloadButtonClicked: onDownloadButtonClicked })))));
|
25320
25313
|
};
|
25321
25314
|
|