@azure/communication-react 1.13.1-alpha-202402280012 → 1.14.0-alpha-202403010014
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 +161 -66
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/common.d.ts +5 -0
- package/dist/dist-esm/acs-ui-common/src/common.js +7 -0
- package/dist/dist-esm/acs-ui-common/src/common.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/index.d.ts +1 -1
- package/dist/dist-esm/acs-ui-common/src/index.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/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 +12 -2
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.d.ts +1 -0
- package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js +33 -17
- package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.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/ChatMessageComponentAsMessageBubble.js +4 -4
- 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 +6 -3
- 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.js +1 -1
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ImageOverlay.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/ImageOverlay.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Survey/TagsSurvey/TagsSurvey.js +4 -4
- package/dist/dist-esm/react-components/src/components/Survey/TagsSurvey/TagsSurvey.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils.d.ts +0 -6
- package/dist/dist-esm/react-components/src/components/utils.js +0 -8
- package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/utils.js +2 -2
- package/dist/dist-esm/react-components/src/localization/locales/utils.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/CallComposite/adapter/AzureCommunicationCallAdapter.js +3 -7
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.js +3 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +15 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/TrackCapabilityChangedNotifications.js +9 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/TrackCapabilityChangedNotifications.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +8 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.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/ChatComposite/ChatComposite.js +6 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.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/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js +3 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.d.ts +10 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.js +5 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/CaptionLanguageSettingsDrawer.d.ts +21 -0
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/CaptionLanguageSettingsDrawer.js +43 -0
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/CaptionLanguageSettingsDrawer.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +4 -3
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageSettingsDrawer.d.ts +21 -0
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/{CaptionSettingsDrawer.js → SpokenLanguageSettingsDrawer.js} +4 -3
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageSettingsDrawer.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/MoreButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Survey.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Survey.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/styles/Survey.styles.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/styles/Survey.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/utils.js +5 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/CaptionSettingsDrawer.d.ts +0 -21
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/CaptionSettingsDrawer.js.map +0 -1
@@ -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.
|
176
|
+
var telemetryVersion = '1.14.0-alpha-202403010014';
|
177
177
|
|
178
178
|
|
179
179
|
var telemetryVersion$1 = /*@__PURE__*/getDefaultExportFromCjs(telemetryVersion);
|
@@ -333,6 +333,13 @@ const _convertPxToRem = (px) => {
|
|
333
333
|
const _preventDismissOnEvent = (ev) => {
|
334
334
|
return ev.type === 'resize' || ev.type === 'scroll';
|
335
335
|
};
|
336
|
+
/**
|
337
|
+
* @internal
|
338
|
+
* Helper function to get the keys of an object
|
339
|
+
*/
|
340
|
+
function _getKeys(obj) {
|
341
|
+
return Object.keys(obj);
|
342
|
+
}
|
336
343
|
|
337
344
|
// Copyright (c) Microsoft Corporation.
|
338
345
|
// Licensed under the MIT License.
|
@@ -5912,14 +5919,6 @@ e.nativeEvent.isComposing ||
|
|
5912
5919
|
* @private
|
5913
5920
|
*/
|
5914
5921
|
const nullToUndefined = (value) => (value === null ? undefined : value);
|
5915
|
-
/**
|
5916
|
-
* Helper function to get the keys of an object
|
5917
|
-
*
|
5918
|
-
* @private
|
5919
|
-
*/
|
5920
|
-
function getKeys(obj) {
|
5921
|
-
return Object.keys(obj);
|
5922
|
-
}
|
5923
5922
|
|
5924
5923
|
// Copyright (c) Microsoft Corporation.
|
5925
5924
|
// Licensed under the MIT License.
|
@@ -10976,7 +10975,7 @@ const calloutMenuProps = Object.assign(Object.assign({}, preventUnwantedDismissP
|
|
10976
10975
|
const defaultOnMentionRender = (mention) => {
|
10977
10976
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
10978
10977
|
const MsftMention = 'msft-mention';
|
10979
|
-
return React.createElement(MsftMention, { id: mention.id }, mention.displayText);
|
10978
|
+
return (React.createElement(MsftMention, { id: mention.id, key: Math.random().toString() }, mention.displayText));
|
10980
10979
|
};
|
10981
10980
|
|
10982
10981
|
// Copyright (c) Microsoft Corporation.
|
@@ -11077,13 +11076,16 @@ const processHtmlToReact = (props) => {
|
|
11077
11076
|
if (domNode instanceof parse.Element && domNode.attribs) {
|
11078
11077
|
// Transform custom rendering of mentions
|
11079
11078
|
/* @conditional-compile-remove(mention) */
|
11080
|
-
if (
|
11079
|
+
if (domNode.name === 'msft-mention') {
|
11081
11080
|
const { id } = domNode.attribs;
|
11082
11081
|
const mention = {
|
11083
11082
|
id: id,
|
11084
|
-
displayText: (
|
11083
|
+
displayText: (_a = domNode.children[0].nodeValue) !== null && _a !== void 0 ? _a : ''
|
11085
11084
|
};
|
11086
|
-
|
11085
|
+
if ((_b = props.mentionDisplayOptions) === null || _b === void 0 ? void 0 : _b.onRenderMention) {
|
11086
|
+
return props.mentionDisplayOptions.onRenderMention(mention, defaultOnMentionRender);
|
11087
|
+
}
|
11088
|
+
return defaultOnMentionRender(mention);
|
11087
11089
|
}
|
11088
11090
|
// Transform inline images
|
11089
11091
|
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
@@ -11225,7 +11227,7 @@ const DownloadIconTrampoline = () => {
|
|
11225
11227
|
return React.createElement(react.Icon, { "data-ui-id": "file-download-card-download-icon", iconName: "DownloadFile", style: actionIconStyle });
|
11226
11228
|
};
|
11227
11229
|
const useLocaleStringsTrampoline = () => {
|
11228
|
-
/* @conditional-compile-remove(file-sharing)
|
11230
|
+
/* @conditional-compile-remove(file-sharing) */
|
11229
11231
|
return useLocale$1().strings.messageThread;
|
11230
11232
|
};
|
11231
11233
|
|
@@ -11298,18 +11300,18 @@ const MessageBubble = (props) => {
|
|
11298
11300
|
const defaultOnRenderFileDownloads = React.useCallback(() => {
|
11299
11301
|
/* @conditional-compile-remove(file-sharing) */
|
11300
11302
|
return (React.createElement(_FileDownloadCards, { userId: userId,
|
11301
|
-
/* @conditional-compile-remove(file-sharing)
|
11303
|
+
/* @conditional-compile-remove(file-sharing) */
|
11302
11304
|
fileMetadata: message.files || [],
|
11303
11305
|
/* @conditional-compile-remove(file-sharing) */
|
11304
11306
|
downloadHandler: fileDownloadHandler,
|
11305
|
-
/* @conditional-compile-remove(file-sharing)
|
11307
|
+
/* @conditional-compile-remove(file-sharing) */
|
11306
11308
|
strings: { downloadFile: strings.downloadFile, fileCardGroupMessage: strings.fileCardGroupMessage } }));
|
11307
11309
|
}, [
|
11308
11310
|
userId,
|
11309
11311
|
message,
|
11310
|
-
/* @conditional-compile-remove(file-sharing)
|
11312
|
+
/* @conditional-compile-remove(file-sharing) */
|
11311
11313
|
strings,
|
11312
|
-
/* @conditional-compile-remove(file-sharing)
|
11314
|
+
/* @conditional-compile-remove(file-sharing) */
|
11313
11315
|
fileDownloadHandler
|
11314
11316
|
]);
|
11315
11317
|
const editedOn = 'editedOn' in message ? message.editedOn : undefined;
|
@@ -19303,8 +19305,8 @@ const _TagsSurvey = (props) => {
|
|
19303
19305
|
videoRating: [],
|
19304
19306
|
screenshareRating: []
|
19305
19307
|
};
|
19306
|
-
|
19307
|
-
|
19308
|
+
_getKeys(callIssuesToTag).forEach((issueCategory) => {
|
19309
|
+
_getKeys(callIssuesToTag[issueCategory]).map((issue) => {
|
19308
19310
|
const issueCapitalized = ((issue === null || issue === void 0 ? void 0 : issue.charAt(0).toUpperCase()) + (issue === null || issue === void 0 ? void 0 : issue.slice(1)));
|
19309
19311
|
const issueMessages = callIssuesToTag[issueCategory];
|
19310
19312
|
if (tags[issueCategory]) {
|
@@ -19396,7 +19398,7 @@ const _TagsSurvey = (props) => {
|
|
19396
19398
|
return (React.createElement(React.Fragment, null,
|
19397
19399
|
React.createElement(react.Stack, { verticalAlign: "center" },
|
19398
19400
|
React.createElement(react.Text, { className: questionTextStyle$1(theme) }, strings === null || strings === void 0 ? void 0 : strings.tagsSurveyQuestion)),
|
19399
|
-
React.createElement(react.Pivot, null,
|
19401
|
+
React.createElement(react.Pivot, null, _getKeys(tags).map((key, i) => {
|
19400
19402
|
return (React.createElement(react.PivotItem, { key: `key-${i}`, headerText: categoryHeadings[key], headerButtonProps: {
|
19401
19403
|
'data-order': i,
|
19402
19404
|
'data-title': key
|
@@ -20274,7 +20276,7 @@ const _CaptionsSettingsModal = (props) => {
|
|
20274
20276
|
*/
|
20275
20277
|
const createComponentStrings = (localizedStrings) => {
|
20276
20278
|
const strings = Object.assign({}, en_US$1);
|
20277
|
-
|
20279
|
+
_getKeys(localizedStrings).forEach((key) => {
|
20278
20280
|
// mark the value as unknown because the type changes based on the key.
|
20279
20281
|
// this is unsafe at runtime as we could assign the wrong type based on the key here.
|
20280
20282
|
// but typescript isn't smart enough to know that the key used across each access will result in the same type
|
@@ -21718,12 +21720,14 @@ const extractAttachedFilesMetadata = (metadata) => {
|
|
21718
21720
|
const extractTeamsAttachmentsMetadata = (attachments, resourceCache) => {
|
21719
21721
|
/* @conditional-compile-remove(file-sharing) */
|
21720
21722
|
const files = [];
|
21723
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
21721
21724
|
const inlineImages = [];
|
21722
21725
|
attachments.forEach((attachment) => {
|
21723
21726
|
var _a, _b, _c;
|
21724
21727
|
const attachmentType = mapAttachmentType(attachment.attachmentType);
|
21725
21728
|
/* @conditional-compile-remove(file-sharing) */
|
21726
21729
|
const contentType = extractAttachmentContentTypeFromName(attachment.name);
|
21730
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
21727
21731
|
if (attachmentType === 'inlineImage') {
|
21728
21732
|
inlineImages.push({
|
21729
21733
|
attachmentType: attachmentType,
|
@@ -21745,7 +21749,10 @@ const extractTeamsAttachmentsMetadata = (attachments, resourceCache) => {
|
|
21745
21749
|
});
|
21746
21750
|
}
|
21747
21751
|
});
|
21748
|
-
return {
|
21752
|
+
return {
|
21753
|
+
/* @conditional-compile-remove(file-sharing) */ files,
|
21754
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ inlineImages
|
21755
|
+
};
|
21749
21756
|
};
|
21750
21757
|
/* @conditional-compile-remove(data-loss-prevention) */
|
21751
21758
|
const convertToUiBlockedMessage = (message, userId, isSeen, isLargeGroup) => {
|
@@ -21843,6 +21850,7 @@ const extractAttachmentsMetadata = (message) => {
|
|
21843
21850
|
var _a, _b;
|
21844
21851
|
/* @conditional-compile-remove(file-sharing) */
|
21845
21852
|
let files = [];
|
21853
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
21846
21854
|
let inlineImages = [];
|
21847
21855
|
/* @conditional-compile-remove(file-sharing) */
|
21848
21856
|
if (message.metadata) {
|
@@ -21853,9 +21861,13 @@ const extractAttachmentsMetadata = (message) => {
|
|
21853
21861
|
const teamsAttachments = extractTeamsAttachmentsMetadata((_b = message.content) === null || _b === void 0 ? void 0 : _b.attachments, message.resourceCache);
|
21854
21862
|
/* @conditional-compile-remove(file-sharing) */
|
21855
21863
|
files = files.concat(teamsAttachments.files);
|
21864
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
21856
21865
|
inlineImages = inlineImages.concat(teamsAttachments.inlineImages);
|
21857
21866
|
}
|
21858
|
-
return {
|
21867
|
+
return {
|
21868
|
+
/* @conditional-compile-remove(file-sharing) */ files,
|
21869
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ inlineImages
|
21870
|
+
};
|
21859
21871
|
};
|
21860
21872
|
const convertToUiChatMessage = (message, userId, isSeen, isLargeGroup) => {
|
21861
21873
|
const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;
|
@@ -22330,28 +22342,21 @@ class ResourceDownloadQueue {
|
|
22330
22342
|
this.isActive = false;
|
22331
22343
|
continue;
|
22332
22344
|
}
|
22333
|
-
|
22334
|
-
|
22335
|
-
|
22336
|
-
message = yield this.downloadSingleUrl(message, singleUrl, operation);
|
22337
|
-
}
|
22338
|
-
else {
|
22339
|
-
message = yield this.downloadAllPreviewUrls(message, operation);
|
22340
|
-
}
|
22341
|
-
this._context.setChatMessage(threadId, message);
|
22342
|
-
}
|
22343
|
-
catch (error) {
|
22344
|
-
console.log('Downloading Resource error: ', error);
|
22345
|
+
if (options) {
|
22346
|
+
const singleUrl = options.singleUrl;
|
22347
|
+
message = yield this.downloadSingleUrl(message, singleUrl, operation);
|
22345
22348
|
}
|
22346
|
-
|
22347
|
-
this.
|
22349
|
+
else {
|
22350
|
+
message = yield this.downloadAllPreviewUrls(message, operation);
|
22348
22351
|
}
|
22352
|
+
this._context.setChatMessage(threadId, message);
|
22353
|
+
this.isActive = false;
|
22349
22354
|
}
|
22350
22355
|
});
|
22351
22356
|
}
|
22352
22357
|
downloadSingleUrl(message, resourceUrl, operation) {
|
22353
22358
|
return __awaiter$t(this, void 0, void 0, function* () {
|
22354
|
-
const blobUrl = yield operation
|
22359
|
+
const blobUrl = yield this.downloadResource(operation, resourceUrl);
|
22355
22360
|
message = Object.assign(Object.assign({}, message), { resourceCache: Object.assign(Object.assign({}, message.resourceCache), { [resourceUrl]: blobUrl }) });
|
22356
22361
|
return message;
|
22357
22362
|
});
|
@@ -22366,7 +22371,7 @@ class ResourceDownloadQueue {
|
|
22366
22371
|
}
|
22367
22372
|
for (const attachment of attachments) {
|
22368
22373
|
if (attachment.previewUrl && attachment.attachmentType === 'image') {
|
22369
|
-
const blobUrl = yield operation
|
22374
|
+
const blobUrl = yield this.downloadResource(operation, attachment.previewUrl);
|
22370
22375
|
message.resourceCache[attachment.previewUrl] = blobUrl;
|
22371
22376
|
}
|
22372
22377
|
}
|
@@ -22374,6 +22379,18 @@ class ResourceDownloadQueue {
|
|
22374
22379
|
return message;
|
22375
22380
|
});
|
22376
22381
|
}
|
22382
|
+
downloadResource(operation, url) {
|
22383
|
+
return __awaiter$t(this, void 0, void 0, function* () {
|
22384
|
+
let blobUrl = URL.createObjectURL(new Blob());
|
22385
|
+
try {
|
22386
|
+
blobUrl = yield operation(url, this._credential);
|
22387
|
+
}
|
22388
|
+
catch (error) {
|
22389
|
+
console.log('Downloading Resource error: ', error);
|
22390
|
+
}
|
22391
|
+
return blobUrl;
|
22392
|
+
});
|
22393
|
+
}
|
22377
22394
|
}
|
22378
22395
|
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
22379
22396
|
/**
|
@@ -22385,13 +22402,24 @@ const fetchImageSource = (src, credential) => __awaiter$t(void 0, void 0, void 0
|
|
22385
22402
|
const headers = new Headers();
|
22386
22403
|
headers.append('Authorization', `Bearer ${token}`);
|
22387
22404
|
try {
|
22388
|
-
return yield
|
22405
|
+
return yield fetchWithTimeout(url, { headers });
|
22389
22406
|
}
|
22390
22407
|
catch (err) {
|
22391
22408
|
throw new ChatError('ChatThreadClient.getMessage', err);
|
22392
22409
|
}
|
22393
22410
|
});
|
22394
22411
|
}
|
22412
|
+
function fetchWithTimeout(resource, options) {
|
22413
|
+
return __awaiter$t(this, void 0, void 0, function* () {
|
22414
|
+
// default timeout is 30 seconds
|
22415
|
+
const { timeout = 30000 } = options;
|
22416
|
+
const controller = new AbortController();
|
22417
|
+
const id = setTimeout(() => controller.abort(), timeout);
|
22418
|
+
const response = yield fetch(resource, Object.assign(Object.assign({}, options), { signal: controller.signal }));
|
22419
|
+
clearTimeout(id);
|
22420
|
+
return response;
|
22421
|
+
});
|
22422
|
+
}
|
22395
22423
|
const accessToken = yield credential.getToken();
|
22396
22424
|
const response = yield fetchWithAuthentication(src, accessToken.token);
|
22397
22425
|
const blob = yield response.blob();
|
@@ -24828,7 +24856,9 @@ const createCompositeHandlers$1 = memoizeOne((adapter) => ({
|
|
24828
24856
|
onTyping: adapter.sendTypingIndicator,
|
24829
24857
|
onRemoveParticipant: adapter.removeParticipant,
|
24830
24858
|
updateThreadTopicName: adapter.setTopic,
|
24831
|
-
onUpdateMessage: (messageId, content,
|
24859
|
+
onUpdateMessage: (messageId, content,
|
24860
|
+
/* @conditional-compile-remove(file-sharing) */
|
24861
|
+
options) => {
|
24832
24862
|
const metadata = options === null || options === void 0 ? void 0 : options.metadata;
|
24833
24863
|
/* @conditional-compile-remove(file-sharing) */
|
24834
24864
|
const updatedOptions = (options === null || options === void 0 ? void 0 : options.attachmentMetadata) ? Object.assign({}, options.attachmentMetadata) : {};
|
@@ -25312,11 +25342,16 @@ const ChatScreen = (props) => {
|
|
25312
25342
|
*/
|
25313
25343
|
const ChatComposite = (props) => {
|
25314
25344
|
const { adapter, options, onFetchAvatarPersonaData, onRenderTypingIndicator, onRenderMessage, onFetchParticipantMenuItems } = props;
|
25345
|
+
/* @conditional-compile-remove(file-sharing) */
|
25315
25346
|
const formFactor = props['formFactor'] || 'desktop';
|
25316
25347
|
return (React.createElement("div", { className: chatScreenContainerStyle },
|
25317
25348
|
React.createElement(BaseProvider, Object.assign({}, props),
|
25318
25349
|
React.createElement(ChatAdapterProvider, { adapter: adapter },
|
25319
|
-
React.createElement(ChatScreen
|
25350
|
+
React.createElement(ChatScreen
|
25351
|
+
/* @conditional-compile-remove(file-sharing) */
|
25352
|
+
, {
|
25353
|
+
/* @conditional-compile-remove(file-sharing) */
|
25354
|
+
formFactor: formFactor, options: options, onFetchAvatarPersonaData: onFetchAvatarPersonaData, onRenderTypingIndicator: onRenderTypingIndicator, onRenderMessage: onRenderMessage, onFetchParticipantMenuItems: onFetchParticipantMenuItems,
|
25320
25355
|
/* @conditional-compile-remove(file-sharing) */
|
25321
25356
|
fileSharing: options === null || options === void 0 ? void 0 : options.fileSharing })))));
|
25322
25357
|
};
|
@@ -25791,13 +25826,21 @@ const disableCallControls = (callControlOptions, disabledControls) => {
|
|
25791
25826
|
let newOptions = (_a = (callControlOptions instanceof Object ? Object.assign({}, callControlOptions) : callControlOptions)) !== null && _a !== void 0 ? _a : {};
|
25792
25827
|
if (newOptions === true || newOptions === undefined) {
|
25793
25828
|
newOptions = disabledControls.reduce((acc, key) => {
|
25829
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
25830
|
+
// @ts-expect-error TODO: fix noImplicitAny error here
|
25831
|
+
// Not solveable at this time due to typescript limitations. The typing is too complex for typescript to
|
25832
|
+
// understand. Will need to revisit when either typescript or the calling component bindings are updated.
|
25794
25833
|
acc[key] = { disabled: true };
|
25795
25834
|
return acc;
|
25796
25835
|
}, {});
|
25797
25836
|
}
|
25798
25837
|
else {
|
25799
25838
|
disabledControls.forEach((key) => {
|
25839
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
25840
|
+
// @ts-expect-error refer to above comment
|
25800
25841
|
if (newOptions[key] !== false) {
|
25842
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
25843
|
+
// @ts-expect-error refer to above comment
|
25801
25844
|
newOptions[key] = { disabled: true };
|
25802
25845
|
}
|
25803
25846
|
});
|
@@ -25983,14 +26026,25 @@ const createCompositeHandlers = memoizeOne((adapter) => {
|
|
25983
26026
|
}),
|
25984
26027
|
/* @conditional-compile-remove(PSTN-calls) */
|
25985
26028
|
onAddParticipant: (participant, options) => __awaiter$j(void 0, void 0, void 0, function* () {
|
25986
|
-
|
26029
|
+
if ('communicationUserId' in participant) {
|
26030
|
+
return yield adapter.addParticipant(participant);
|
26031
|
+
}
|
26032
|
+
else if ('phoneNumber' in participant) {
|
26033
|
+
return yield adapter.addParticipant(participant, options);
|
26034
|
+
}
|
25987
26035
|
}),
|
25988
26036
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(dtmf-dialer) */
|
25989
26037
|
onSendDtmfTone: (dtmfTone) => __awaiter$j(void 0, void 0, void 0, function* () {
|
25990
26038
|
yield adapter.sendDtmfTone(dtmfTone);
|
25991
26039
|
}),
|
25992
26040
|
onRemoveParticipant: (userId) => __awaiter$j(void 0, void 0, void 0, function* () {
|
25993
|
-
|
26041
|
+
if (typeof userId === 'string') {
|
26042
|
+
yield adapter.removeParticipant(userId);
|
26043
|
+
}
|
26044
|
+
else {
|
26045
|
+
/* @conditional-compile-remove(PSTN-calls) */
|
26046
|
+
yield adapter.removeParticipant(_toCommunicationIdentifier(userId));
|
26047
|
+
}
|
25994
26048
|
}),
|
25995
26049
|
/* @conditional-compile-remove(raise-hand) */
|
25996
26050
|
onRaiseHand: () => __awaiter$j(void 0, void 0, void 0, function* () {
|
@@ -26901,7 +26955,11 @@ const generateCustomControlBarButtons = (placement, customButtons) => customButt
|
|
26901
26955
|
.filter((buttonProps) => buttonProps.placement === placement)
|
26902
26956
|
.map((buttonProps, i) => (internalProps) => {
|
26903
26957
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
26904
|
-
|
26958
|
+
// onRenderButton is a custom prop that can be passed to override the default rendering of the button
|
26959
|
+
// This is useful for custom buttons that need to render more than just an icon and label and is used
|
26960
|
+
// for CallWithChat button notification badge. However, onRenderButton is not a public prop and is
|
26961
|
+
// not documented in the API. This is a temporary solution and will need to be revisited.
|
26962
|
+
if ('onRenderButton' in buttonProps) {
|
26905
26963
|
return buttonProps['onRenderButton'](internalProps);
|
26906
26964
|
}
|
26907
26965
|
return (React.createElement(ControlBarButton, { ariaDescription: (_b = (_a = buttonProps.strings) === null || _a === void 0 ? void 0 : _a.ariaDescription) !== null && _b !== void 0 ? _b : internalProps.ariaDescription, ariaLabel: (_f = (_d = (_c = buttonProps.strings) === null || _c === void 0 ? void 0 : _c.ariaLabel) !== null && _d !== void 0 ? _d : (_e = buttonProps.strings) === null || _e === void 0 ? void 0 : _e.tooltipContent) !== null && _f !== void 0 ? _f : internalProps.ariaLabel, disabled: (_g = buttonProps.disabled) !== null && _g !== void 0 ? _g : internalProps.disabled, id: (_h = buttonProps.id) !== null && _h !== void 0 ? _h : internalProps.id, key: `${buttonProps.placement}_${i}`, onClick: (_j = buttonProps.onItemClick) !== null && _j !== void 0 ? _j : internalProps.onClick, onRenderIcon: () => {
|
@@ -28235,7 +28293,7 @@ const captionSettingsDrawerStyles = (theme) => ({
|
|
28235
28293
|
// Copyright (c) Microsoft Corporation.
|
28236
28294
|
// Licensed under the MIT License.
|
28237
28295
|
/** @private */
|
28238
|
-
const
|
28296
|
+
const CaptionLanguageSettingsDrawer = (props) => {
|
28239
28297
|
var _a;
|
28240
28298
|
/* @conditional-compile-remove(close-captions) */
|
28241
28299
|
const theme = useTheme();
|
@@ -28246,7 +28304,7 @@ const CaptionSettingsDrawer = (props) => {
|
|
28246
28304
|
/* @conditional-compile-remove(close-captions) */
|
28247
28305
|
const drawerItems = React.useMemo(() => {
|
28248
28306
|
var _a;
|
28249
|
-
return
|
28307
|
+
return _getKeys((_a = props.supportedLanguageStrings) !== null && _a !== void 0 ? _a : []).map((languageCode) => ({
|
28250
28308
|
itemKey: languageCode,
|
28251
28309
|
text: props.supportedLanguageStrings ? props.supportedLanguageStrings[languageCode] : languageCode,
|
28252
28310
|
onItemClick: () => onDrawerItemClick(languageCode),
|
@@ -28290,6 +28348,38 @@ const themedToggleButtonStyle = (theme, checked) => {
|
|
28290
28348
|
};
|
28291
28349
|
};
|
28292
28350
|
|
28351
|
+
// Copyright (c) Microsoft Corporation.
|
28352
|
+
// Licensed under the MIT License.
|
28353
|
+
/** @private */
|
28354
|
+
const SpokenLanguageSettingsDrawer = (props) => {
|
28355
|
+
var _a;
|
28356
|
+
/* @conditional-compile-remove(close-captions) */
|
28357
|
+
const theme = useTheme();
|
28358
|
+
/* @conditional-compile-remove(close-captions) */
|
28359
|
+
const onDrawerItemClick = React.useCallback((languageCode) => {
|
28360
|
+
props.selectLanguage(languageCode);
|
28361
|
+
}, [props]);
|
28362
|
+
/* @conditional-compile-remove(close-captions) */
|
28363
|
+
const drawerItems = React.useMemo(() => {
|
28364
|
+
var _a;
|
28365
|
+
return _getKeys((_a = props.supportedLanguageStrings) !== null && _a !== void 0 ? _a : []).map((languageCode) => ({
|
28366
|
+
itemKey: languageCode,
|
28367
|
+
text: props.supportedLanguageStrings ? props.supportedLanguageStrings[languageCode] : languageCode,
|
28368
|
+
onItemClick: () => onDrawerItemClick(languageCode),
|
28369
|
+
secondaryIconProps: props.currentLanguage === languageCode ? { iconName: 'Accept' } : undefined
|
28370
|
+
}));
|
28371
|
+
}, [props.currentLanguage, props.supportedLanguageStrings, onDrawerItemClick]);
|
28372
|
+
const sortedDrawerItems = React.useMemo(() => {
|
28373
|
+
const copy = [...drawerItems];
|
28374
|
+
return copy.sort((a, b) => (a.text && b.text && a.text > b.text ? 1 : -1));
|
28375
|
+
}, [drawerItems]);
|
28376
|
+
/* @conditional-compile-remove(close-captions) */
|
28377
|
+
return (React.createElement(_DrawerMenu, { heading: (_a = props.strings) === null || _a === void 0 ? void 0 : _a.menuTitle, items: sortedDrawerItems !== null && sortedDrawerItems !== void 0 ? sortedDrawerItems : [], onLightDismiss: () => {
|
28378
|
+
props.setCurrentLanguage(props.currentLanguage);
|
28379
|
+
props.onLightDismiss();
|
28380
|
+
}, styles: captionSettingsDrawerStyles(theme) }));
|
28381
|
+
};
|
28382
|
+
|
28293
28383
|
// Copyright (c) Microsoft Corporation.
|
28294
28384
|
// Licensed under the MIT License.
|
28295
28385
|
var __awaiter$g = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
@@ -28640,8 +28730,8 @@ const MoreDrawer = (props) => {
|
|
28640
28730
|
});
|
28641
28731
|
/* @conditional-compile-remove(close-captions) */
|
28642
28732
|
return (React.createElement(React.Fragment, null,
|
28643
|
-
isSpokenLanguageDrawerOpen && props.isCaptionsSupported && (React.createElement(
|
28644
|
-
isCaptionLanguageDrawerOpen && props.isCaptionsSupported && (React.createElement(
|
28733
|
+
isSpokenLanguageDrawerOpen && props.isCaptionsSupported && (React.createElement(SpokenLanguageSettingsDrawer, { onLightDismiss: props.onLightDismiss, selectLanguage: setCurrentSpokenLanguage, setCurrentLanguage: captionSettingsHandlers.onSetSpokenLanguage, currentLanguage: currentSpokenLanguage, strings: { menuTitle: props.strings.spokenLanguageMenuTitle }, supportedLanguageStrings: supportedSpokenLanguageStrings })),
|
28734
|
+
isCaptionLanguageDrawerOpen && props.isCaptionsSupported && (React.createElement(CaptionLanguageSettingsDrawer, { onLightDismiss: props.onLightDismiss, selectLanguage: setCurrentCaptionLanguage, setCurrentLanguage: captionSettingsHandlers.onSetCaptionLanguage, currentLanguage: currentCaptionLanguage, strings: { menuTitle: props.strings.captionLanguageMenuTitle }, supportedLanguageStrings: supportedCaptionLanguageStrings })),
|
28645
28735
|
!isSpokenLanguageDrawerOpen && !isCaptionLanguageDrawerOpen && (React.createElement(_DrawerMenu, { items: drawerMenuItems, onLightDismiss: props.onLightDismiss }))));
|
28646
28736
|
};
|
28647
28737
|
const isDeviceSelected = (speaker, selectedSpeaker) => !!selectedSpeaker && speaker.id === selectedSpeaker.id;
|
@@ -31037,7 +31127,7 @@ const DtmfDialpadPageContent = (props) => {
|
|
31037
31127
|
return (React.createElement(react.Stack, { style: { height: '100%', width: '100%', background: theme.palette.white } },
|
31038
31128
|
React.createElement(react.Stack, { verticalAlign: 'center', style: { margin: 'auto' } },
|
31039
31129
|
React.createElement(DtmfDialerContentTimer, null),
|
31040
|
-
React.createElement(react.Text, { style: { margin: 'auto' } }, calleeName !== 'Unnamed participant' ? calleeName : ''),
|
31130
|
+
React.createElement(react.Text, { style: { margin: 'auto' } }, calleeName && calleeName !== 'Unnamed participant' ? calleeName === null || calleeName === void 0 ? void 0 : calleeName.toString() : ''),
|
31041
31131
|
React.createElement(Dialpad, { onSendDtmfTone: (tone) => __awaiter$c(void 0, void 0, void 0, function* () {
|
31042
31132
|
/* @conditional-compile-remove(dtmf-dialer) */
|
31043
31133
|
yield adapter.sendDtmfTone(tone);
|
@@ -33144,15 +33234,21 @@ const trackCapabilityChangedNotificationAsDismissed = (capabilityName, trackedNo
|
|
33144
33234
|
};
|
33145
33235
|
/* @conditional-compile-remove(capabilities) */
|
33146
33236
|
const updateLatestCapabilityChangedNotificationMap = (capabilitiesChangedInfoAndRole, activeNotifications) => {
|
33237
|
+
var _a, _b;
|
33147
33238
|
if (!capabilitiesChangedInfoAndRole.capabilitiesChangeInfo) {
|
33148
33239
|
return activeNotifications;
|
33149
33240
|
}
|
33150
|
-
for (const [
|
33241
|
+
for (const [capabilityKey, newCapabilityValue] of Object.entries(capabilitiesChangedInfoAndRole.capabilitiesChangeInfo.newValue)) {
|
33242
|
+
// Cast is safe because we are iterating over the enum keys on the object.entries where
|
33243
|
+
// newCapabilityValue typing is correctly returned. Object.entries limitations
|
33244
|
+
// always returns string for the key
|
33245
|
+
const capabilityName = capabilityKey;
|
33151
33246
|
// If the active notification for a capability has the same `isPresent` value and the same reason as the new
|
33152
33247
|
// capability value from the SDK then we will not create a new notification to avoid redundancy
|
33153
33248
|
if (activeNotifications[capabilityName] &&
|
33154
|
-
newCapabilityValue.isPresent === activeNotifications[capabilityName].isPresent &&
|
33155
|
-
capabilitiesChangedInfoAndRole.capabilitiesChangeInfo.reason ===
|
33249
|
+
newCapabilityValue.isPresent === ((_a = activeNotifications[capabilityName]) === null || _a === void 0 ? void 0 : _a.isPresent) &&
|
33250
|
+
capabilitiesChangedInfoAndRole.capabilitiesChangeInfo.reason ===
|
33251
|
+
((_b = activeNotifications[capabilityName]) === null || _b === void 0 ? void 0 : _b.changedReason)) {
|
33156
33252
|
continue;
|
33157
33253
|
}
|
33158
33254
|
const newCapabilityChangeNotification = {
|
@@ -33356,7 +33452,7 @@ const Survey = (props) => {
|
|
33356
33452
|
return (React.createElement(React.Fragment, null,
|
33357
33453
|
showDefaultAfterSubmitScreen && React.createElement(ThankYouForFeedbackPage, { iconName: iconName }),
|
33358
33454
|
showDefaultAfterDismissedScreen && (React.createElement(NoticePage, { iconName: iconName, title: title, moreDetails: moreDetails, dataUiId: 'left-call-page', disableStartCallButton: disableStartCallButton })),
|
33359
|
-
!showDefaultAfterSubmitScreen && !showDefaultAfterDismissedScreen && (React.createElement(react.Stack, { verticalAlign: "center", className: surveyContainerStyle(isMobile) },
|
33455
|
+
!showDefaultAfterSubmitScreen && !showDefaultAfterDismissedScreen && (React.createElement(react.Stack, { verticalAlign: "center", className: surveyContainerStyle(!!isMobile) },
|
33360
33456
|
React.createElement(react.Text, { className: questionTextStyle(theme) }, strings.surveyTitle),
|
33361
33457
|
React.createElement(SurveyContent, { setShowSubmitFeedbackButton: (showButton) => {
|
33362
33458
|
setShowSubmitFeedbackButton(showButton);
|
@@ -33873,9 +33969,9 @@ class CallingSoundSubscriber {
|
|
33873
33969
|
this.onCallStateChanged();
|
33874
33970
|
}
|
33875
33971
|
unsubscribeAll() {
|
33876
|
-
var _a;
|
33877
|
-
this.call.off('stateChanged', this.onCallStateChanged);
|
33878
|
-
if ((
|
33972
|
+
var _a, _b;
|
33973
|
+
(_a = this.call) === null || _a === void 0 ? void 0 : _a.off('stateChanged', this.onCallStateChanged);
|
33974
|
+
if ((_b = this.soundsLoaded) === null || _b === void 0 ? void 0 : _b.callRingingSound) {
|
33879
33975
|
this.soundsLoaded.callRingingSound.pause();
|
33880
33976
|
}
|
33881
33977
|
}
|
@@ -34614,15 +34710,11 @@ class AzureCommunicationCallAdapter {
|
|
34614
34710
|
: {};
|
34615
34711
|
const combinedCallOptions = Object.assign(Object.assign({}, startCallVideoOptions), options);
|
34616
34712
|
const idsToAdd = participants.map((participant) => {
|
34617
|
-
|
34618
|
-
if (
|
34619
|
-
backendId = _toCommunicationIdentifier(participant);
|
34620
|
-
}
|
34621
|
-
if (backendId.phoneNumber) {
|
34713
|
+
const backendId = _toCommunicationIdentifier(participant);
|
34714
|
+
if ('phoneNumber' in backendId) {
|
34622
34715
|
if ((options === null || options === void 0 ? void 0 : options.alternateCallerId) === undefined) {
|
34623
34716
|
throw new Error('Unable to start call, PSTN user present with no alternateCallerId.');
|
34624
34717
|
}
|
34625
|
-
return backendId;
|
34626
34718
|
}
|
34627
34719
|
return backendId;
|
34628
34720
|
});
|
@@ -35285,7 +35377,7 @@ const createTeamsCallAdapterFromClient = (callClient, callAgent, locator, option
|
|
35285
35377
|
return new AzureCommunicationCallAdapter(callClient, locator, callAgent, deviceManager, options);
|
35286
35378
|
});
|
35287
35379
|
const isCallError = (e) => {
|
35288
|
-
return
|
35380
|
+
return 'target' in e && 'innerError' in e;
|
35289
35381
|
};
|
35290
35382
|
|
35291
35383
|
// Copyright (c) Microsoft Corporation.
|
@@ -37006,7 +37098,10 @@ var call$j={cameraLabel:"Camera",noCamerasLabel:"No cameras found",cameraPermiss
|
|
37006
37098
|
*/
|
37007
37099
|
const createCompositeStrings = (localizedStrings) => {
|
37008
37100
|
const strings = Object.assign({}, en_US);
|
37009
|
-
|
37101
|
+
_getKeys(localizedStrings).forEach((key) => {
|
37102
|
+
// mark the value as unknown because the type changes based on the key.
|
37103
|
+
// this is unsafe at runtime as we could assign the wrong type based on the key here.
|
37104
|
+
// but typescript isn't smart enough to know that the key used across each access will result in the same type
|
37010
37105
|
strings[key] = Object.assign(Object.assign({}, strings[key]), localizedStrings[key]);
|
37011
37106
|
});
|
37012
37107
|
return strings;
|