@azure/communication-react 1.5.1-alpha-202303240013 → 1.5.1-alpha-202303260014
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 +2 -0
- package/dist/dist-cjs/communication-react/index.js +231 -171
- 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/ResponsiveHorizontalGallery.d.ts +2 -0
- package/dist/dist-esm/react-components/src/components/ResponsiveHorizontalGallery.js +2 -1
- package/dist/dist-esm/react-components/src/components/ResponsiveHorizontalGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.d.ts +2 -0
- package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.js +2 -1
- package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +11 -4
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +11 -4
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.d.ts +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js +6 -3
- package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +50 -41
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/gallery/dominantSpeaker.js +6 -14
- package/dist/dist-esm/react-components/src/gallery/dominantSpeaker.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +11 -0
- 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/AzureCommunicationFileUploadAdapter.d.ts +4 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js +29 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js.map +1 -1
- package/package.json +8 -8
@@ -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-
|
165
|
+
var telemetryVersion = '1.5.1-alpha-202303260014';
|
166
166
|
|
167
167
|
// Copyright (c) Microsoft Corporation.
|
168
168
|
/**
|
@@ -378,7 +378,7 @@ const getEnvironmentInfo = (state) => {
|
|
378
378
|
|
379
379
|
// Copyright (c) Microsoft Corporation.
|
380
380
|
// Licensed under the MIT license.
|
381
|
-
var __awaiter$
|
381
|
+
var __awaiter$F = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
382
382
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
383
383
|
return new (P || (P = Promise))(function (resolve, reject) {
|
384
384
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -416,7 +416,7 @@ const _isPreviewOn = (deviceManager) => {
|
|
416
416
|
*
|
417
417
|
* @private
|
418
418
|
*/
|
419
|
-
const disposeAllLocalPreviewViews = (callClient) => __awaiter$
|
419
|
+
const disposeAllLocalPreviewViews = (callClient) => __awaiter$F(void 0, void 0, void 0, function* () {
|
420
420
|
const unparentedViews = callClient.getState().deviceManager.unparentedViews;
|
421
421
|
for (const view of unparentedViews) {
|
422
422
|
yield callClient.disposeView(undefined, undefined, view);
|
@@ -549,7 +549,7 @@ const holdButtonSelector = reselect__namespace.createSelector([getCallState], (c
|
|
549
549
|
|
550
550
|
// Copyright (c) Microsoft Corporation.
|
551
551
|
// Licensed under the MIT license.
|
552
|
-
var __awaiter$
|
552
|
+
var __awaiter$E = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
553
553
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
554
554
|
return new (P || (P = Promise))(function (resolve, reject) {
|
555
555
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -570,7 +570,7 @@ const areStreamsEqual = (prevStream, newStream) => {
|
|
570
570
|
* @private
|
571
571
|
*/
|
572
572
|
const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callClient, deviceManager, call) => {
|
573
|
-
const onStartLocalVideo = () => __awaiter$
|
573
|
+
const onStartLocalVideo = () => __awaiter$E(void 0, void 0, void 0, function* () {
|
574
574
|
// Before the call object creates a stream, dispose of any local preview streams.
|
575
575
|
// @TODO: is there any way to parent the unparented view to the call object instead
|
576
576
|
// of disposing and creating a new stream?
|
@@ -590,7 +590,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
590
590
|
yield call.startVideo(stream);
|
591
591
|
}
|
592
592
|
});
|
593
|
-
const onStopLocalVideo = (stream) => __awaiter$
|
593
|
+
const onStopLocalVideo = (stream) => __awaiter$E(void 0, void 0, void 0, function* () {
|
594
594
|
const callId = call === null || call === void 0 ? void 0 : call.id;
|
595
595
|
if (!callId) {
|
596
596
|
return;
|
@@ -599,7 +599,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
599
599
|
yield call.stopVideo(stream);
|
600
600
|
}
|
601
601
|
});
|
602
|
-
const onToggleCamera = (options) => __awaiter$
|
602
|
+
const onToggleCamera = (options) => __awaiter$E(void 0, void 0, void 0, function* () {
|
603
603
|
const previewOn = _isPreviewOn(callClient.getState().deviceManager);
|
604
604
|
if (previewOn && call && call.state === 'Connecting') {
|
605
605
|
// This is to workaround: https://skype.visualstudio.com/SPOOL/_workitems/edit/3030558.
|
@@ -647,19 +647,19 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
647
647
|
}
|
648
648
|
}
|
649
649
|
});
|
650
|
-
const onSelectMicrophone = (device) => __awaiter$
|
650
|
+
const onSelectMicrophone = (device) => __awaiter$E(void 0, void 0, void 0, function* () {
|
651
651
|
if (!deviceManager) {
|
652
652
|
return;
|
653
653
|
}
|
654
654
|
return deviceManager.selectMicrophone(device);
|
655
655
|
});
|
656
|
-
const onSelectSpeaker = (device) => __awaiter$
|
656
|
+
const onSelectSpeaker = (device) => __awaiter$E(void 0, void 0, void 0, function* () {
|
657
657
|
if (!deviceManager) {
|
658
658
|
return;
|
659
659
|
}
|
660
660
|
return deviceManager.selectSpeaker(device);
|
661
661
|
});
|
662
|
-
const onSelectCamera = (device, options) => __awaiter$
|
662
|
+
const onSelectCamera = (device, options) => __awaiter$E(void 0, void 0, void 0, function* () {
|
663
663
|
if (!deviceManager) {
|
664
664
|
return;
|
665
665
|
}
|
@@ -682,19 +682,19 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
682
682
|
}, options);
|
683
683
|
}
|
684
684
|
});
|
685
|
-
const onToggleMicrophone = () => __awaiter$
|
685
|
+
const onToggleMicrophone = () => __awaiter$E(void 0, void 0, void 0, function* () {
|
686
686
|
if (!call || !_isInCall(call.state)) {
|
687
687
|
throw new Error(`Please invoke onToggleMicrophone after call is started`);
|
688
688
|
}
|
689
689
|
return call.isMuted ? yield call.unmute() : yield call.mute();
|
690
690
|
});
|
691
|
-
const onStartScreenShare = () => __awaiter$
|
692
|
-
const onStopScreenShare = () => __awaiter$
|
693
|
-
const onToggleScreenShare = () => __awaiter$
|
694
|
-
const onHangUp = (forEveryone) => __awaiter$
|
691
|
+
const onStartScreenShare = () => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
|
692
|
+
const onStopScreenShare = () => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
|
693
|
+
const onToggleScreenShare = () => __awaiter$E(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.isScreenSharingOn) ? yield onStopScreenShare() : yield onStartScreenShare(); });
|
694
|
+
const onHangUp = (forEveryone) => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.hangUp({ forEveryone: forEveryone === true ? true : false })); });
|
695
695
|
/* @conditional-compile-remove(PSTN-calls) */
|
696
|
-
const onToggleHold = () => __awaiter$
|
697
|
-
const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$
|
696
|
+
const onToggleHold = () => __awaiter$E(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.state) === 'LocalHold' ? yield (call === null || call === void 0 ? void 0 : call.resume()) : yield (call === null || call === void 0 ? void 0 : call.hold()); });
|
697
|
+
const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$E(void 0, void 0, void 0, function* () {
|
698
698
|
var _a;
|
699
699
|
if (!call || call.localVideoStreams.length === 0) {
|
700
700
|
return;
|
@@ -710,7 +710,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
710
710
|
const { view } = (_a = (yield callClient.createView(call.id, undefined, localStream, options))) !== null && _a !== void 0 ? _a : {};
|
711
711
|
return view ? { view } : undefined;
|
712
712
|
});
|
713
|
-
const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$
|
713
|
+
const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$E(void 0, void 0, void 0, function* () {
|
714
714
|
if (!call) {
|
715
715
|
return;
|
716
716
|
}
|
@@ -741,7 +741,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
741
741
|
}
|
742
742
|
return (createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view) ? { view: createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view } : undefined;
|
743
743
|
});
|
744
|
-
const onDisposeRemoteStreamView = (userId) => __awaiter$
|
744
|
+
const onDisposeRemoteStreamView = (userId) => __awaiter$E(void 0, void 0, void 0, function* () {
|
745
745
|
if (!call) {
|
746
746
|
return;
|
747
747
|
}
|
@@ -762,7 +762,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
762
762
|
callClient.disposeView(call.id, participant.identifier, screenShareStream);
|
763
763
|
}
|
764
764
|
});
|
765
|
-
const onDisposeLocalStreamView = () => __awaiter$
|
765
|
+
const onDisposeLocalStreamView = () => __awaiter$E(void 0, void 0, void 0, function* () {
|
766
766
|
// If the user is currently in a call, dispose of the local stream view attached to that call.
|
767
767
|
const callState = call && callClient.getState().calls[call.id];
|
768
768
|
const localStream = callState === null || callState === void 0 ? void 0 : callState.localVideoStreams.find((item) => item.mediaStreamType === 'Video');
|
@@ -775,18 +775,18 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
775
775
|
yield disposeAllLocalPreviewViews(callClient);
|
776
776
|
});
|
777
777
|
/* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */
|
778
|
-
const onSendDtmfTone = (dtmfTone) => __awaiter$
|
778
|
+
const onSendDtmfTone = (dtmfTone) => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.sendDtmf(dtmfTone)); });
|
779
779
|
const notImplemented = () => {
|
780
780
|
throw new Error('Not implemented, cannot call a method from an abstract object');
|
781
781
|
};
|
782
782
|
/* @conditional-compile-remove(call-readiness) */
|
783
|
-
const askDevicePermission = (constrain) => __awaiter$
|
783
|
+
const askDevicePermission = (constrain) => __awaiter$E(void 0, void 0, void 0, function* () {
|
784
784
|
if (deviceManager) {
|
785
785
|
yield (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.askDevicePermission(constrain));
|
786
786
|
}
|
787
787
|
});
|
788
788
|
/* @conditional-compile-remove(video-background-effects) */
|
789
|
-
const onRemoveVideoBackgroundEffects = () => __awaiter$
|
789
|
+
const onRemoveVideoBackgroundEffects = () => __awaiter$E(void 0, void 0, void 0, function* () {
|
790
790
|
const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
|
791
791
|
(deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
|
792
792
|
if (stream) {
|
@@ -794,7 +794,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
794
794
|
}
|
795
795
|
});
|
796
796
|
/* @conditional-compile-remove(video-background-effects) */
|
797
|
-
const onBlurVideoBackground = (bgBlurConfig) => __awaiter$
|
797
|
+
const onBlurVideoBackground = (bgBlurConfig) => __awaiter$E(void 0, void 0, void 0, function* () {
|
798
798
|
const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
|
799
799
|
(deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
|
800
800
|
if (stream) {
|
@@ -802,7 +802,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
802
802
|
}
|
803
803
|
});
|
804
804
|
/* @conditional-compile-remove(video-background-effects) */
|
805
|
-
const onReplaceVideoBackground = (bgReplacementConfig) => __awaiter$
|
805
|
+
const onReplaceVideoBackground = (bgReplacementConfig) => __awaiter$E(void 0, void 0, void 0, function* () {
|
806
806
|
const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
|
807
807
|
(deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
|
808
808
|
if (stream) {
|
@@ -844,7 +844,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
844
844
|
|
845
845
|
// Copyright (c) Microsoft Corporation.
|
846
846
|
// Licensed under the MIT license.
|
847
|
-
var __awaiter$
|
847
|
+
var __awaiter$D = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
848
848
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
849
849
|
return new (P || (P = Promise))(function (resolve, reject) {
|
850
850
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -871,7 +871,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
|
|
871
871
|
return callAgent ? callAgent.startCall(participants, options) : undefined;
|
872
872
|
},
|
873
873
|
/* @conditional-compile-remove(PSTN-calls) */
|
874
|
-
onAddParticipant: (userId, options) => __awaiter$
|
874
|
+
onAddParticipant: (userId, options) => __awaiter$D(void 0, void 0, void 0, function* () {
|
875
875
|
const participant = _toCommunicationIdentifier(userId);
|
876
876
|
if (communicationCommon.isPhoneNumberIdentifier(participant)) {
|
877
877
|
call === null || call === void 0 ? void 0 : call.addParticipant(participant, options);
|
@@ -879,7 +879,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
|
|
879
879
|
else if (communicationCommon.isCommunicationUserIdentifier(participant) || communicationCommon.isMicrosoftTeamsUserIdentifier(participant)) {
|
880
880
|
call === null || call === void 0 ? void 0 : call.addParticipant(participant);
|
881
881
|
}
|
882
|
-
}), onRemoveParticipant: (userId) => __awaiter$
|
882
|
+
}), onRemoveParticipant: (userId) => __awaiter$D(void 0, void 0, void 0, function* () {
|
883
883
|
const participant = _toCommunicationIdentifier(userId);
|
884
884
|
yield (call === null || call === void 0 ? void 0 : call.removeParticipant(participant));
|
885
885
|
}) });
|
@@ -887,7 +887,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
|
|
887
887
|
|
888
888
|
// Copyright (c) Microsoft Corporation.
|
889
889
|
// Licensed under the MIT license.
|
890
|
-
var __awaiter$
|
890
|
+
var __awaiter$C = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
891
891
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
892
892
|
return new (P || (P = Promise))(function (resolve, reject) {
|
893
893
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -919,7 +919,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
|
|
919
919
|
},
|
920
920
|
/* @conditional-compile-remove(teams-identity-support) */
|
921
921
|
/* @conditional-compile-remove(PSTN-calls) */
|
922
|
-
onAddParticipant: (userId, options) => __awaiter$
|
922
|
+
onAddParticipant: (userId, options) => __awaiter$C(void 0, void 0, void 0, function* () {
|
923
923
|
const participant = _toCommunicationIdentifier(userId);
|
924
924
|
/* @conditional-compile-remove(teams-identity-support) */
|
925
925
|
const threadId = options === null || options === void 0 ? void 0 : options.threadId;
|
@@ -932,7 +932,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
|
|
932
932
|
}
|
933
933
|
/* @conditional-compile-remove(teams-identity-support) */
|
934
934
|
call === null || call === void 0 ? void 0 : call.addParticipant(participant);
|
935
|
-
}), onRemoveParticipant: (userId) => __awaiter$
|
935
|
+
}), onRemoveParticipant: (userId) => __awaiter$C(void 0, void 0, void 0, function* () {
|
936
936
|
const participant = _toCommunicationIdentifier(userId);
|
937
937
|
if (communicationCommon.isCommunicationUserIdentifier(participant)) {
|
938
938
|
throw new Error('CommunicationIdentifier in Teams call is not supported!');
|
@@ -944,7 +944,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
|
|
944
944
|
|
945
945
|
// Copyright (c) Microsoft Corporation.
|
946
946
|
// Licensed under the MIT license.
|
947
|
-
var __awaiter$
|
947
|
+
var __awaiter$B = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
948
948
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
949
949
|
return new (P || (P = Promise))(function (resolve, reject) {
|
950
950
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -993,13 +993,13 @@ class ProxyDeviceManager {
|
|
993
993
|
this.selectCamera = (videoDeviceInfo) => {
|
994
994
|
this._context.setDeviceManagerSelectedCamera(videoDeviceInfo);
|
995
995
|
};
|
996
|
-
this.videoDevicesUpdated = () => __awaiter$
|
996
|
+
this.videoDevicesUpdated = () => __awaiter$B(this, void 0, void 0, function* () {
|
997
997
|
// Device Manager always has a camera with '' name if there are no real camera devices available.
|
998
998
|
// We don't want to show that in the UI.
|
999
999
|
const realCameras = (yield this._deviceManager.getCameras()).filter((c) => !!c.name);
|
1000
1000
|
this._context.setDeviceManagerCameras(dedupeById(realCameras));
|
1001
1001
|
});
|
1002
|
-
this.audioDevicesUpdated = () => __awaiter$
|
1002
|
+
this.audioDevicesUpdated = () => __awaiter$B(this, void 0, void 0, function* () {
|
1003
1003
|
this._context.setDeviceManagerMicrophones(dedupeById(yield this._deviceManager.getMicrophones()));
|
1004
1004
|
this._context.setDeviceManagerSpeakers(dedupeById(yield this._deviceManager.getSpeakers()));
|
1005
1005
|
});
|
@@ -1202,7 +1202,7 @@ class CallIdHistory {
|
|
1202
1202
|
|
1203
1203
|
// Copyright (c) Microsoft Corporation.
|
1204
1204
|
// Licensed under the MIT license.
|
1205
|
-
var __awaiter$
|
1205
|
+
var __awaiter$A = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
1206
1206
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
1207
1207
|
return new (P || (P = Promise))(function (resolve, reject) {
|
1208
1208
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -1786,7 +1786,7 @@ class CallContext$2 {
|
|
1786
1786
|
* @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.
|
1787
1787
|
*/
|
1788
1788
|
withAsyncErrorTeedToState(action, target) {
|
1789
|
-
return (...args) => __awaiter$
|
1789
|
+
return (...args) => __awaiter$A(this, void 0, void 0, function* () {
|
1790
1790
|
try {
|
1791
1791
|
return yield action(...args);
|
1792
1792
|
}
|
@@ -2313,7 +2313,7 @@ function _logStreamEvent(eventName, streamLogInfo, error) {
|
|
2313
2313
|
|
2314
2314
|
// Copyright (c) Microsoft Corporation.
|
2315
2315
|
// Licensed under the MIT license.
|
2316
|
-
var __awaiter$
|
2316
|
+
var __awaiter$z = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2317
2317
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
2318
2318
|
return new (P || (P = Promise))(function (resolve, reject) {
|
2319
2319
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -2323,7 +2323,7 @@ var __awaiter$y = (window && window.__awaiter) || function (thisArg, _arguments,
|
|
2323
2323
|
});
|
2324
2324
|
};
|
2325
2325
|
function createViewVideo(context, internalContext, callId, stream, participantId, options) {
|
2326
|
-
return __awaiter$
|
2326
|
+
return __awaiter$z(this, void 0, void 0, function* () {
|
2327
2327
|
// we can only have 3 types of createView
|
2328
2328
|
let streamEventType;
|
2329
2329
|
// we will reuse these for local as well but we need to make sure the remote stream is passed in like before.
|
@@ -2445,7 +2445,7 @@ function createViewVideo(context, internalContext, callId, stream, participantId
|
|
2445
2445
|
});
|
2446
2446
|
}
|
2447
2447
|
function createViewUnparentedVideo(context, internalContext, stream, options) {
|
2448
|
-
return __awaiter$
|
2448
|
+
return __awaiter$z(this, void 0, void 0, function* () {
|
2449
2449
|
const renderInfo = internalContext.getUnparentedRenderInfo(stream);
|
2450
2450
|
if (renderInfo && renderInfo.status === 'Rendered') {
|
2451
2451
|
console.warn('Unparented LocalVideoStream is already rendered');
|
@@ -2613,7 +2613,7 @@ function createView(context, internalContext, callId, participantId, stream, opt
|
|
2613
2613
|
// Render LocalVideoStream that is not part of a Call
|
2614
2614
|
// Because it is not part of the call we don't tee errors to state naturally (e.g. via a Call Client function such as startVideo).
|
2615
2615
|
// We do not have a startLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.
|
2616
|
-
return context.withAsyncErrorTeedToState(() => __awaiter$
|
2616
|
+
return context.withAsyncErrorTeedToState(() => __awaiter$z(this, void 0, void 0, function* () { return yield createViewUnparentedVideo(context, internalContext, stream, options); }), 'Call.startVideo')();
|
2617
2617
|
}
|
2618
2618
|
else {
|
2619
2619
|
_logStreamEvent(EventNames.CREATE_STREAM_INVALID_PARAMS, { streamType });
|
@@ -3047,7 +3047,7 @@ class CallSubscriber {
|
|
3047
3047
|
|
3048
3048
|
// Copyright (c) Microsoft Corporation.
|
3049
3049
|
// Licensed under the MIT license.
|
3050
|
-
var __awaiter$
|
3050
|
+
var __awaiter$y = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3051
3051
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3052
3052
|
return new (P || (P = Promise))(function (resolve, reject) {
|
3053
3053
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -3067,14 +3067,14 @@ class ProxyIncomingCall {
|
|
3067
3067
|
switch (prop) {
|
3068
3068
|
case 'accept': {
|
3069
3069
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3070
|
-
return __awaiter$
|
3070
|
+
return __awaiter$y(this, void 0, void 0, function* () {
|
3071
3071
|
return yield target.accept(...args);
|
3072
3072
|
});
|
3073
3073
|
}, 'IncomingCall.accept');
|
3074
3074
|
}
|
3075
3075
|
case 'reject': {
|
3076
3076
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3077
|
-
return __awaiter$
|
3077
|
+
return __awaiter$y(this, void 0, void 0, function* () {
|
3078
3078
|
return yield target.reject(...args);
|
3079
3079
|
});
|
3080
3080
|
}, 'IncomingCall.reject');
|
@@ -3311,7 +3311,7 @@ const clearCallRelatedState = (context, internalContext) => {
|
|
3311
3311
|
|
3312
3312
|
// Copyright (c) Microsoft Corporation.
|
3313
3313
|
// Licensed under the MIT license.
|
3314
|
-
var __awaiter$
|
3314
|
+
var __awaiter$x = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3315
3315
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3316
3316
|
return new (P || (P = Promise))(function (resolve, reject) {
|
3317
3317
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -3337,56 +3337,56 @@ class ProxyCallCommon {
|
|
3337
3337
|
switch (prop) {
|
3338
3338
|
case 'mute': {
|
3339
3339
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3340
|
-
return __awaiter$
|
3340
|
+
return __awaiter$x(this, void 0, void 0, function* () {
|
3341
3341
|
return yield target.mute(...args);
|
3342
3342
|
});
|
3343
3343
|
}, 'Call.mute');
|
3344
3344
|
}
|
3345
3345
|
case 'unmute': {
|
3346
3346
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3347
|
-
return __awaiter$
|
3347
|
+
return __awaiter$x(this, void 0, void 0, function* () {
|
3348
3348
|
return yield target.unmute(...args);
|
3349
3349
|
});
|
3350
3350
|
}, 'Call.unmute');
|
3351
3351
|
}
|
3352
3352
|
case 'startVideo': {
|
3353
3353
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3354
|
-
return __awaiter$
|
3354
|
+
return __awaiter$x(this, void 0, void 0, function* () {
|
3355
3355
|
return yield target.startVideo(...args);
|
3356
3356
|
});
|
3357
3357
|
}, 'Call.startVideo');
|
3358
3358
|
}
|
3359
3359
|
case 'stopVideo': {
|
3360
3360
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3361
|
-
return __awaiter$
|
3361
|
+
return __awaiter$x(this, void 0, void 0, function* () {
|
3362
3362
|
return yield target.stopVideo(...args);
|
3363
3363
|
});
|
3364
3364
|
}, 'Call.stopVideo');
|
3365
3365
|
}
|
3366
3366
|
case 'startScreenSharing': {
|
3367
3367
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3368
|
-
return __awaiter$
|
3368
|
+
return __awaiter$x(this, void 0, void 0, function* () {
|
3369
3369
|
return yield target.startScreenSharing(...args);
|
3370
3370
|
});
|
3371
3371
|
}, 'Call.startScreenSharing');
|
3372
3372
|
}
|
3373
3373
|
case 'stopScreenSharing': {
|
3374
3374
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3375
|
-
return __awaiter$
|
3375
|
+
return __awaiter$x(this, void 0, void 0, function* () {
|
3376
3376
|
return yield target.stopScreenSharing(...args);
|
3377
3377
|
});
|
3378
3378
|
}, 'Call.stopScreenSharing');
|
3379
3379
|
}
|
3380
3380
|
case 'hold': {
|
3381
3381
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3382
|
-
return __awaiter$
|
3382
|
+
return __awaiter$x(this, void 0, void 0, function* () {
|
3383
3383
|
return yield target.hold(...args);
|
3384
3384
|
});
|
3385
3385
|
}, 'Call.hold');
|
3386
3386
|
}
|
3387
3387
|
case 'resume': {
|
3388
3388
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3389
|
-
return __awaiter$
|
3389
|
+
return __awaiter$x(this, void 0, void 0, function* () {
|
3390
3390
|
return yield target.resume(...args);
|
3391
3391
|
});
|
3392
3392
|
}, 'Call.resume');
|
@@ -3399,7 +3399,7 @@ class ProxyCallCommon {
|
|
3399
3399
|
|
3400
3400
|
// Copyright (c) Microsoft Corporation.
|
3401
3401
|
// Licensed under the MIT license.
|
3402
|
-
var __awaiter$
|
3402
|
+
var __awaiter$w = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3403
3403
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3404
3404
|
return new (P || (P = Promise))(function (resolve, reject) {
|
3405
3405
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -3413,7 +3413,7 @@ class ProxyCall extends ProxyCallCommon {
|
|
3413
3413
|
switch (prop) {
|
3414
3414
|
case 'addParticipant': {
|
3415
3415
|
return this.getContext().withAsyncErrorTeedToState(function (...args) {
|
3416
|
-
return __awaiter$
|
3416
|
+
return __awaiter$w(this, void 0, void 0, function* () {
|
3417
3417
|
return yield target.addParticipant(...args);
|
3418
3418
|
});
|
3419
3419
|
}, 'Call.addParticipant');
|
@@ -3634,7 +3634,7 @@ class InternalCallContext {
|
|
3634
3634
|
|
3635
3635
|
// Copyright (c) Microsoft Corporation.
|
3636
3636
|
// Licensed under the MIT license.
|
3637
|
-
var __awaiter$
|
3637
|
+
var __awaiter$v = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3638
3638
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3639
3639
|
return new (P || (P = Promise))(function (resolve, reject) {
|
3640
3640
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -3649,7 +3649,7 @@ class ProxyTeamsCall extends ProxyCallCommon {
|
|
3649
3649
|
switch (prop) {
|
3650
3650
|
case 'addParticipant': {
|
3651
3651
|
return this.getContext().withAsyncErrorTeedToState(function (...args) {
|
3652
|
-
return __awaiter$
|
3652
|
+
return __awaiter$v(this, void 0, void 0, function* () {
|
3653
3653
|
return yield target.addParticipant(...args);
|
3654
3654
|
});
|
3655
3655
|
}, 'TeamsCall.addParticipant');
|
@@ -3764,7 +3764,7 @@ const teamsCallAgentDeclaratify = (callAgent, context, internalContext) => {
|
|
3764
3764
|
|
3765
3765
|
// Copyright (c) Microsoft Corporation.
|
3766
3766
|
// Licensed under the MIT license.
|
3767
|
-
var __awaiter$
|
3767
|
+
var __awaiter$u = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3768
3768
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3769
3769
|
return new (P || (P = Promise))(function (resolve, reject) {
|
3770
3770
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -3786,7 +3786,7 @@ class ProxyVideoStreamRendererView {
|
|
3786
3786
|
get(target, prop) {
|
3787
3787
|
switch (prop) {
|
3788
3788
|
case 'updateScalingMode': {
|
3789
|
-
return (...args) => __awaiter$
|
3789
|
+
return (...args) => __awaiter$u(this, void 0, void 0, function* () {
|
3790
3790
|
yield target.updateScalingMode(...args);
|
3791
3791
|
this._context.setRemoteVideoStreamViewScalingMode(this._callId, this._participantId, this._streamId, args[0]);
|
3792
3792
|
});
|
@@ -3807,7 +3807,7 @@ const videoStreamRendererViewDeclaratify = (view, context, callId, participantId
|
|
3807
3807
|
|
3808
3808
|
// Copyright (c) Microsoft Corporation.
|
3809
3809
|
// Licensed under the MIT license.
|
3810
|
-
var __awaiter$
|
3810
|
+
var __awaiter$t = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3811
3811
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3812
3812
|
return new (P || (P = Promise))(function (resolve, reject) {
|
3813
3813
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -3829,7 +3829,7 @@ class ProxyCallClient {
|
|
3829
3829
|
get(target, prop) {
|
3830
3830
|
switch (prop) {
|
3831
3831
|
case 'createCallAgent': {
|
3832
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
3832
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$t(this, void 0, void 0, function* () {
|
3833
3833
|
// createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
|
3834
3834
|
// callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
|
3835
3835
|
// callAgent if the createCallAgent succeeds.
|
@@ -3842,7 +3842,7 @@ class ProxyCallClient {
|
|
3842
3842
|
}), 'CallClient.createCallAgent');
|
3843
3843
|
}
|
3844
3844
|
case 'createTeamsCallAgent': {
|
3845
|
-
/* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
3845
|
+
/* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$t(this, void 0, void 0, function* () {
|
3846
3846
|
// createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
|
3847
3847
|
// callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
|
3848
3848
|
// callAgent if the createCallAgent succeeds.
|
@@ -3855,7 +3855,7 @@ class ProxyCallClient {
|
|
3855
3855
|
}), 'CallClient.createTeamsCallAgent');
|
3856
3856
|
}
|
3857
3857
|
case 'getDeviceManager': {
|
3858
|
-
return this._context.withAsyncErrorTeedToState(() => __awaiter$
|
3858
|
+
return this._context.withAsyncErrorTeedToState(() => __awaiter$t(this, void 0, void 0, function* () {
|
3859
3859
|
// As of writing, the SDK always returns the same instance of DeviceManager so we keep a reference of
|
3860
3860
|
// DeviceManager and if it does not change we return the cached DeclarativeDeviceManager. If it does not we'll
|
3861
3861
|
// throw an error that indicate we need to fix this issue as our implementation has diverged from the SDK.
|
@@ -3884,7 +3884,7 @@ class ProxyCallClient {
|
|
3884
3884
|
/**
|
3885
3885
|
* add to this object if we want to proxy anything else off the DebugInfo feature object.
|
3886
3886
|
*/
|
3887
|
-
return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter$
|
3887
|
+
return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter$t(this, void 0, void 0, function* () {
|
3888
3888
|
const environmentInfo = yield feature.getEnvironmentInfo();
|
3889
3889
|
this._context.setEnvironmentInfo(environmentInfo);
|
3890
3890
|
return environmentInfo;
|
@@ -3937,7 +3937,7 @@ const createStatefulCallClientWithDeps = (callClient, context, internalContext)
|
|
3937
3937
|
});
|
3938
3938
|
Object.defineProperty(callClient, 'createView', {
|
3939
3939
|
configurable: false,
|
3940
|
-
value: (callId, participantId, stream, options) => __awaiter$
|
3940
|
+
value: (callId, participantId, stream, options) => __awaiter$t(void 0, void 0, void 0, function* () {
|
3941
3941
|
const participantIdKind = participantId ? communicationCommon.getIdentifierKind(participantId) : undefined;
|
3942
3942
|
const result = yield createView(context, internalContext, callId, participantIdKind, stream, options);
|
3943
3943
|
// We only need to declaratify the VideoStreamRendererView object for remote participants. Because the updateScalingMode only needs to be called on remote participant stream views.
|
@@ -6770,7 +6770,7 @@ const chatMessageActionMenuProps = (menuProps) => {
|
|
6770
6770
|
return actionMenuProps;
|
6771
6771
|
};
|
6772
6772
|
|
6773
|
-
var __awaiter$
|
6773
|
+
var __awaiter$s = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
6774
6774
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
6775
6775
|
return new (P || (P = Promise))(function (resolve, reject) {
|
6776
6776
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -6795,7 +6795,7 @@ const _FileDownloadCards = (props) => {
|
|
6795
6795
|
var _a, _b;
|
6796
6796
|
return (_b = (_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile) !== null && _b !== void 0 ? _b : localeStrings.downloadFile;
|
6797
6797
|
}, [(_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile, localeStrings.downloadFile]);
|
6798
|
-
const fileDownloadHandler = React.useCallback((userId, file) => __awaiter$
|
6798
|
+
const fileDownloadHandler = React.useCallback((userId, file) => __awaiter$s(void 0, void 0, void 0, function* () {
|
6799
6799
|
if (!props.downloadHandler) {
|
6800
6800
|
window.open(file.url, '_blank', 'noopener,noreferrer');
|
6801
6801
|
}
|
@@ -6943,7 +6943,7 @@ const ChatMessageComponentAsMessageBubble = React__default['default'].memo(Messa
|
|
6943
6943
|
|
6944
6944
|
// Copyright (c) Microsoft Corporation.
|
6945
6945
|
// Licensed under the MIT license.
|
6946
|
-
var __awaiter$
|
6946
|
+
var __awaiter$r = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
6947
6947
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
6948
6948
|
return new (P || (P = Promise))(function (resolve, reject) {
|
6949
6949
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -6977,7 +6977,7 @@ const ChatMessageComponent = (props) => {
|
|
6977
6977
|
return React__default['default'].createElement(React__default['default'].Fragment, null);
|
6978
6978
|
}
|
6979
6979
|
else if (isEditing) {
|
6980
|
-
return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { message: message, inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text, metadata, options) => __awaiter$
|
6980
|
+
return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { message: message, inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text, metadata, options) => __awaiter$r(void 0, void 0, void 0, function* () {
|
6981
6981
|
props.onUpdateMessage &&
|
6982
6982
|
props.message.messageId &&
|
6983
6983
|
(yield props.onUpdateMessage(props.message.messageId, text, metadata, options));
|
@@ -7083,7 +7083,7 @@ const getParticipantsWhoHaveReadMessage = (message, readReceiptsBySenderId) => {
|
|
7083
7083
|
|
7084
7084
|
// Copyright (c) Microsoft Corporation.
|
7085
7085
|
// Licensed under the MIT license.
|
7086
|
-
var __awaiter$
|
7086
|
+
var __awaiter$q = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
7087
7087
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
7088
7088
|
return new (P || (P = Promise))(function (resolve, reject) {
|
7089
7089
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -7318,7 +7318,7 @@ const MessageThread = (props) => {
|
|
7318
7318
|
setChatMessagesInitialized(chatMessagesInitialized);
|
7319
7319
|
};
|
7320
7320
|
// we try to only send those message status if user is scrolled to the bottom.
|
7321
|
-
const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$
|
7321
|
+
const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$q(void 0, void 0, void 0, function* () {
|
7322
7322
|
if (!isAtBottomOfScrollRef.current ||
|
7323
7323
|
!document.hasFocus() ||
|
7324
7324
|
!messagesRef.current ||
|
@@ -7369,7 +7369,7 @@ const MessageThread = (props) => {
|
|
7369
7369
|
setIsAtBottomOfScrollRef(atBottom);
|
7370
7370
|
}, [scrollToBottom, sendMessageStatusIfAtBottom]);
|
7371
7371
|
// Infinite scrolling + threadInitialize function
|
7372
|
-
const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$
|
7372
|
+
const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$q(void 0, void 0, void 0, function* () {
|
7373
7373
|
if (!isLoadingChatMessagesRef.current) {
|
7374
7374
|
if (onLoadPreviousChatMessages) {
|
7375
7375
|
isLoadingChatMessagesRef.current = true;
|
@@ -9224,10 +9224,7 @@ const smartDominantSpeakerParticipants = (args) => {
|
|
9224
9224
|
}
|
9225
9225
|
const participantsMap = participantsById(participants);
|
9226
9226
|
// Only use the Max allowed dominant speakers that exist in participants
|
9227
|
-
const dominantSpeakerIds =
|
9228
|
-
.filter((id) => !!participantsMap[id])
|
9229
|
-
.slice(0, maxDominantSpeakers);
|
9230
|
-
const lastVisibleParticipantIds = lastVisibleParticipants.map((p) => p.userId);
|
9227
|
+
const dominantSpeakerIds = dominantSpeakers.filter((id) => !!participantsMap[id]).slice(0, maxDominantSpeakers);
|
9231
9228
|
const newVisibleParticipantIds = lastVisibleParticipants.map((p) => p.userId).slice(0, maxDominantSpeakers);
|
9232
9229
|
const newDominantSpeakerIds = dominantSpeakerIds.filter((id) => !newVisibleParticipantIds.includes(id));
|
9233
9230
|
// Remove participants that are no longer dominant and replace them with new dominant speakers.
|
@@ -9241,17 +9238,12 @@ const smartDominantSpeakerParticipants = (args) => {
|
|
9241
9238
|
newVisibleParticipantIds[index] = replacement;
|
9242
9239
|
}
|
9243
9240
|
}
|
9244
|
-
|
9245
|
-
removedVisibleParticipantIds.forEach((p) => newVisibleParticipantIds.push(p));
|
9246
|
-
const newVisibleParticipantIdSet = new Set(newVisibleParticipantIds);
|
9247
|
-
const leftoverParticipants = participants.filter((p) => !newVisibleParticipantIdSet.has(p.userId));
|
9248
|
-
leftoverParticipants.forEach((p) => {
|
9249
|
-
newVisibleParticipantIds.push(p.userId);
|
9250
|
-
});
|
9251
|
-
// newVisibleParticipantIds can contain identifiers for participants that are no longer in the call. So we ignore those IDs.
|
9252
|
-
const newVisibleParticipants = newVisibleParticipantIds
|
9241
|
+
let newVisibleParticipants = newVisibleParticipantIds
|
9253
9242
|
.map((participantId) => participantsMap[participantId])
|
9254
|
-
.filter((p) =>
|
9243
|
+
.filter((p) => p !== undefined);
|
9244
|
+
const newVisibleParticipantIdsSet = new Set(newVisibleParticipantIds);
|
9245
|
+
const remainingParticipants = participants.filter((p) => !newVisibleParticipantIdsSet.has(p.userId));
|
9246
|
+
newVisibleParticipants = newVisibleParticipants.concat(remainingParticipants);
|
9255
9247
|
return newVisibleParticipants;
|
9256
9248
|
};
|
9257
9249
|
const participantsById = (participants) => {
|
@@ -9262,38 +9254,42 @@ const participantsById = (participants) => {
|
|
9262
9254
|
|
9263
9255
|
// Copyright (c) Microsoft Corporation.
|
9264
9256
|
const DEFAULT_MAX_REMOTE_VIDEOSTREAMS = 4;
|
9265
|
-
const
|
9257
|
+
const DEFAULT_MAX_HORIZONTAL_GALLERY_DOMINANT_SPEAKERS = 6;
|
9266
9258
|
const _useOrganizedParticipants = (props) => {
|
9267
|
-
|
9268
|
-
const
|
9269
|
-
const
|
9270
|
-
const
|
9271
|
-
|
9272
|
-
|
9273
|
-
|
9274
|
-
|
9275
|
-
|
9276
|
-
|
9277
|
-
|
9259
|
+
const visibleGridParticipants = React.useRef([]);
|
9260
|
+
const visibleHorizontalGalleryParticipants = React.useRef([]);
|
9261
|
+
const { remoteParticipants = [], dominantSpeakers = [], maxRemoteVideoStreams = DEFAULT_MAX_REMOTE_VIDEOSTREAMS, maxHorizontalGalleryDominantSpeakers = DEFAULT_MAX_HORIZONTAL_GALLERY_DOMINANT_SPEAKERS, isScreenShareActive = false, pinnedParticipantUserIds = [] } = props;
|
9262
|
+
const videoParticipants = remoteParticipants.filter((p) => { var _a; return (_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable; });
|
9263
|
+
visibleGridParticipants.current =
|
9264
|
+
pinnedParticipantUserIds.length > 0 || isScreenShareActive
|
9265
|
+
? []
|
9266
|
+
: smartDominantSpeakerParticipants({
|
9267
|
+
participants: videoParticipants,
|
9268
|
+
dominantSpeakers,
|
9269
|
+
lastVisibleParticipants: visibleGridParticipants.current,
|
9270
|
+
maxDominantSpeakers: maxRemoteVideoStreams
|
9271
|
+
}).slice(0, maxRemoteVideoStreams);
|
9272
|
+
const visibleGridParticipantsSet = new Set(visibleGridParticipants.current.map((p) => p.userId));
|
9273
|
+
const remoteParticipantsOrdered = putVideoParticipantsFirst(remoteParticipants);
|
9278
9274
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
9279
|
-
const callingParticipants =
|
9275
|
+
const callingParticipants = remoteParticipantsOrdered.filter((p) => p.state === ('Connecting' ));
|
9280
9276
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
9281
9277
|
const callingParticipantsSet = new Set(callingParticipants.map((p) => p.userId));
|
9282
|
-
|
9283
|
-
participants:
|
9284
|
-
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ !callingParticipantsSet.has(p.userId))
|
9285
|
-
dominantSpeakers,
|
9286
|
-
lastVisibleParticipants:
|
9287
|
-
maxDominantSpeakers:
|
9278
|
+
visibleHorizontalGalleryParticipants.current = smartDominantSpeakerParticipants({
|
9279
|
+
participants: remoteParticipantsOrdered.filter((p) => !visibleGridParticipantsSet.has(p.userId) &&
|
9280
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ !callingParticipantsSet.has(p.userId)),
|
9281
|
+
dominantSpeakers: dominantSpeakers,
|
9282
|
+
lastVisibleParticipants: visibleHorizontalGalleryParticipants.current,
|
9283
|
+
maxDominantSpeakers: maxHorizontalGalleryDominantSpeakers
|
9288
9284
|
});
|
9289
9285
|
const getGridParticipants = React.useCallback(() => {
|
9290
9286
|
if (isScreenShareActive) {
|
9291
9287
|
return [];
|
9292
9288
|
}
|
9293
9289
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
9294
|
-
return
|
9295
|
-
?
|
9296
|
-
:
|
9290
|
+
return visibleGridParticipants.current.length > 0
|
9291
|
+
? visibleGridParticipants.current
|
9292
|
+
: visibleHorizontalGalleryParticipants.current.concat(callingParticipants);
|
9297
9293
|
}, [
|
9298
9294
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ callingParticipants,
|
9299
9295
|
isScreenShareActive
|
@@ -9303,14 +9299,14 @@ const _useOrganizedParticipants = (props) => {
|
|
9303
9299
|
if (isScreenShareActive) {
|
9304
9300
|
// If screen sharing is active, assign video and audio participants as horizontal gallery participants
|
9305
9301
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
9306
|
-
return
|
9302
|
+
return visibleGridParticipants.current.concat(visibleHorizontalGalleryParticipants.current.concat(callingParticipants));
|
9307
9303
|
}
|
9308
9304
|
else {
|
9309
9305
|
// If screen sharing is not active, then assign all video tiles as grid tiles.
|
9310
9306
|
// If there are no video tiles, then assign audio tiles as grid tiles.
|
9311
9307
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
9312
|
-
return
|
9313
|
-
?
|
9308
|
+
return visibleGridParticipants.current.length > 0
|
9309
|
+
? visibleHorizontalGalleryParticipants.current.concat(callingParticipants)
|
9314
9310
|
: [];
|
9315
9311
|
}
|
9316
9312
|
}, [
|
@@ -9328,18 +9324,12 @@ const _useOrganizedParticipantsWithPinnedParticipants = (props) => {
|
|
9328
9324
|
map[remoteParticipant.userId] = remoteParticipant;
|
9329
9325
|
return map;
|
9330
9326
|
}, {});
|
9331
|
-
// count pinned participants with video
|
9332
|
-
let pinnedParticipantsWithVideoOnCount = 0;
|
9333
9327
|
// get pinned participants in the same order of pinned participant user ids using remoteParticipantMap
|
9334
9328
|
const pinnedParticipants = [];
|
9335
9329
|
(_a = props.pinnedParticipantUserIds) === null || _a === void 0 ? void 0 : _a.forEach((id) => {
|
9336
|
-
var _a;
|
9337
9330
|
const pinnedParticipant = remoteParticipantMap[id];
|
9338
9331
|
if (pinnedParticipant) {
|
9339
9332
|
pinnedParticipants.push(pinnedParticipant);
|
9340
|
-
if ((_a = pinnedParticipant.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable) {
|
9341
|
-
pinnedParticipantsWithVideoOnCount++;
|
9342
|
-
}
|
9343
9333
|
}
|
9344
9334
|
});
|
9345
9335
|
// get unpinned participants by filtering all remote participants using a set of pinned participant user ids
|
@@ -9347,11 +9337,7 @@ const _useOrganizedParticipantsWithPinnedParticipants = (props) => {
|
|
9347
9337
|
const unpinnedParticipants = props.remoteParticipants.filter((p) => !pinnedParticipantUserIdSet.has(p.userId));
|
9348
9338
|
const useOrganizedParticipantsProps = Object.assign(Object.assign({}, props), {
|
9349
9339
|
// if there are pinned participants then we should only consider unpinned participants
|
9350
|
-
remoteParticipants: unpinnedParticipants
|
9351
|
-
// if there is a maximum of remote video streams we need to subtract pinned participants with video
|
9352
|
-
maxRemoteVideoStreams: props.maxRemoteVideoStreams
|
9353
|
-
? props.maxRemoteVideoStreams - pinnedParticipantsWithVideoOnCount
|
9354
|
-
: undefined });
|
9340
|
+
remoteParticipants: unpinnedParticipants });
|
9355
9341
|
const useOrganizedParticipantsResult = _useOrganizedParticipants(useOrganizedParticipantsProps);
|
9356
9342
|
if (pinnedParticipants.length === 0) {
|
9357
9343
|
return useOrganizedParticipantsResult;
|
@@ -9363,6 +9349,21 @@ const _useOrganizedParticipantsWithPinnedParticipants = (props) => {
|
|
9363
9349
|
: useOrganizedParticipantsResult.gridParticipants.concat(useOrganizedParticipantsResult.horizontalGalleryParticipants)
|
9364
9350
|
};
|
9365
9351
|
};
|
9352
|
+
const putVideoParticipantsFirst = (remoteParticipants) => {
|
9353
|
+
const videoParticipants = [];
|
9354
|
+
const audioParticipants = [];
|
9355
|
+
remoteParticipants.forEach((p) => {
|
9356
|
+
var _a;
|
9357
|
+
if ((_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable) {
|
9358
|
+
videoParticipants.push(p);
|
9359
|
+
}
|
9360
|
+
else {
|
9361
|
+
audioParticipants.push(p);
|
9362
|
+
}
|
9363
|
+
});
|
9364
|
+
const remoteParticipantSortedByVideo = videoParticipants.concat(audioParticipants);
|
9365
|
+
return remoteParticipantSortedByVideo;
|
9366
|
+
};
|
9366
9367
|
/**
|
9367
9368
|
* Hook to determine which participants should be in grid and horizontal gallery and their order respectively
|
9368
9369
|
* @private
|
@@ -9814,7 +9815,7 @@ const calculateVerticalChildrenPerPage = (args) => {
|
|
9814
9815
|
* available width obtained from a ResizeObserver, width per child, gap width, and button width
|
9815
9816
|
*/
|
9816
9817
|
const ResponsiveHorizontalGallery = (props) => {
|
9817
|
-
const { gapWidthRem, buttonWidthRem = 0, onFetchTilesToRender } = props;
|
9818
|
+
const { gapWidthRem, buttonWidthRem = 0, onFetchTilesToRender, onChildrenPerPageChange } = props;
|
9818
9819
|
const containerRef = React.useRef(null);
|
9819
9820
|
const containerWidth = _useContainerWidth(containerRef);
|
9820
9821
|
const leftPadding = containerRef.current ? parseFloat(getComputedStyle(containerRef.current).paddingLeft) : 0;
|
@@ -9825,6 +9826,7 @@ const ResponsiveHorizontalGallery = (props) => {
|
|
9825
9826
|
gapWidthRem,
|
9826
9827
|
buttonWidthRem
|
9827
9828
|
});
|
9829
|
+
onChildrenPerPageChange === null || onChildrenPerPageChange === void 0 ? void 0 : onChildrenPerPageChange(childrenPerPage);
|
9828
9830
|
return (React__default['default'].createElement("div", { "data-ui-id": "responsive-horizontal-gallery", ref: containerRef, className: react.mergeStyles(props.containerStyles) },
|
9829
9831
|
React__default['default'].createElement(HorizontalGallery, { childrenPerPage: childrenPerPage, styles: props.horizontalGalleryStyles, onFetchTilesToRender: onFetchTilesToRender }, props.children)));
|
9830
9832
|
};
|
@@ -10007,7 +10009,7 @@ const VerticalGalleryControlBar = (props) => {
|
|
10007
10009
|
* @beta
|
10008
10010
|
*/
|
10009
10011
|
const ResponsiveVerticalGallery = (props) => {
|
10010
|
-
const { children, containerStyles, verticalGalleryStyles, gapHeightRem, controlBarHeightRem, isShort, onFetchTilesToRender } = props;
|
10012
|
+
const { children, containerStyles, verticalGalleryStyles, gapHeightRem, controlBarHeightRem, isShort, onFetchTilesToRender, onChildrenPerPageChange } = props;
|
10011
10013
|
const containerRef = React.useRef(null);
|
10012
10014
|
const containerHeight = _useContainerHeight(containerRef);
|
10013
10015
|
const topPadding = containerRef.current ? parseFloat(getComputedStyle(containerRef.current).paddingTop) : 0;
|
@@ -10019,6 +10021,7 @@ const ResponsiveVerticalGallery = (props) => {
|
|
10019
10021
|
controlBarHeight: controlBarHeightRem !== null && controlBarHeightRem !== void 0 ? controlBarHeightRem : 2,
|
10020
10022
|
isShort: isShort !== null && isShort !== void 0 ? isShort : false
|
10021
10023
|
});
|
10024
|
+
onChildrenPerPageChange === null || onChildrenPerPageChange === void 0 ? void 0 : onChildrenPerPageChange(childrenPerPage);
|
10022
10025
|
return (React__default['default'].createElement("div", { "data-ui-id": "responsive-vertical-gallery", ref: containerRef, className: react.mergeStyles(containerStyles) },
|
10023
10026
|
React__default['default'].createElement(VerticalGallery, { childrenPerPage: childrenPerPage, styles: verticalGalleryStyles, onFetchTilesToRender: onFetchTilesToRender }, children)));
|
10024
10027
|
};
|
@@ -10078,7 +10081,7 @@ const OverflowGallery = (props) => {
|
|
10078
10081
|
/* @conditional-compile-remove(vertical-gallery) */
|
10079
10082
|
isShort = false, overflowGalleryElements, horizontalGalleryStyles,
|
10080
10083
|
/* @conditional-compile-remove(vertical-gallery) */ overflowGalleryLayout = 'HorizontalBottom',
|
10081
|
-
/* @conditional-compile-remove(vertical-gallery) */ veritcalGalleryStyles } = props;
|
10084
|
+
/* @conditional-compile-remove(vertical-gallery) */ veritcalGalleryStyles, onChildrenPerPageChange } = props;
|
10082
10085
|
const containerStyles = React.useMemo(() => {
|
10083
10086
|
/* @conditional-compile-remove(vertical-gallery) */
|
10084
10087
|
if (overflowGalleryLayout === 'VerticalRight') {
|
@@ -10106,13 +10109,16 @@ const OverflowGallery = (props) => {
|
|
10106
10109
|
]);
|
10107
10110
|
/* @conditional-compile-remove(vertical-gallery) */
|
10108
10111
|
if (overflowGalleryLayout === 'VerticalRight') {
|
10109
|
-
return (React__default['default'].createElement(ResponsiveVerticalGallery, { key: "responsive-vertical-gallery", containerStyles: containerStyles, verticalGalleryStyles: galleryStyles, controlBarHeightRem: HORIZONTAL_GALLERY_BUTTON_WIDTH, gapHeightRem: HORIZONTAL_GALLERY_GAP, isShort: isShort, onFetchTilesToRender: onFetchTilesToRender }, overflowGalleryElements));
|
10112
|
+
return (React__default['default'].createElement(ResponsiveVerticalGallery, { key: "responsive-vertical-gallery", containerStyles: containerStyles, verticalGalleryStyles: galleryStyles, controlBarHeightRem: HORIZONTAL_GALLERY_BUTTON_WIDTH, gapHeightRem: HORIZONTAL_GALLERY_GAP, isShort: isShort, onFetchTilesToRender: onFetchTilesToRender, onChildrenPerPageChange: onChildrenPerPageChange }, overflowGalleryElements));
|
10110
10113
|
}
|
10111
10114
|
/* @conditional-compile-remove(pinned-participants) */
|
10112
10115
|
if (isNarrow) {
|
10116
|
+
// There are no pages for ScrollableHorizontalGallery so we will approximate the first 3 remote
|
10117
|
+
// participant tiles are visible
|
10118
|
+
onChildrenPerPageChange === null || onChildrenPerPageChange === void 0 ? void 0 : onChildrenPerPageChange(3);
|
10113
10119
|
return (React__default['default'].createElement(ScrollableHorizontalGallery, { horizontalGalleryElements: overflowGalleryElements, onFetchTilesToRender: onFetchTilesToRender, key: "scrollable-horizontal-gallery" }));
|
10114
10120
|
}
|
10115
|
-
return (React__default['default'].createElement(ResponsiveHorizontalGallery, { key: "responsive-horizontal-gallery", containerStyles: containerStyles, onFetchTilesToRender: onFetchTilesToRender, horizontalGalleryStyles: galleryStyles, buttonWidthRem: HORIZONTAL_GALLERY_BUTTON_WIDTH, gapWidthRem: HORIZONTAL_GALLERY_GAP }, overflowGalleryElements));
|
10121
|
+
return (React__default['default'].createElement(ResponsiveHorizontalGallery, { key: "responsive-horizontal-gallery", containerStyles: containerStyles, onFetchTilesToRender: onFetchTilesToRender, horizontalGalleryStyles: galleryStyles, buttonWidthRem: HORIZONTAL_GALLERY_BUTTON_WIDTH, gapWidthRem: HORIZONTAL_GALLERY_GAP, onChildrenPerPageChange: onChildrenPerPageChange }, overflowGalleryElements));
|
10116
10122
|
};
|
10117
10123
|
|
10118
10124
|
// Copyright (c) Microsoft Corporation.
|
@@ -10125,17 +10131,22 @@ const OverflowGallery = (props) => {
|
|
10125
10131
|
const DefaultLayout = (props) => {
|
10126
10132
|
const { remoteParticipants = [], dominantSpeakers, localVideoComponent, screenShareComponent, onRenderRemoteParticipant, styles, maxRemoteVideoStreams, parentWidth,
|
10127
10133
|
/* @conditional-compile-remove(vertical-gallery) */
|
10128
|
-
parentHeight,
|
10129
|
-
/* @conditional-compile-remove(pinned-participants) */ pinnedParticipantUserIds,
|
10134
|
+
parentHeight, pinnedParticipantUserIds = [],
|
10130
10135
|
/* @conditional-compile-remove(vertical-gallery) */ overflowGalleryLayout = 'HorizontalBottom' } = props;
|
10131
10136
|
const isNarrow = parentWidth ? isNarrowWidth(parentWidth) : false;
|
10132
10137
|
/* @conditional-compile-remove(vertical-gallery) */
|
10133
10138
|
const isShort = parentHeight ? isShortHeight(parentHeight) : false;
|
10139
|
+
// This is for tracking the number of children in the first page of horizontal gallery.
|
10140
|
+
// This number will be used for the maxHorizontalDominantSpeakers when organizing the remote participants.
|
10141
|
+
const childrenPerPage = React.useRef(4);
|
10134
10142
|
const { gridParticipants, horizontalGalleryParticipants } = useOrganizedParticipants({
|
10135
10143
|
remoteParticipants,
|
10136
10144
|
dominantSpeakers,
|
10137
10145
|
maxRemoteVideoStreams,
|
10138
10146
|
isScreenShareActive: !!screenShareComponent,
|
10147
|
+
maxHorizontalGalleryDominantSpeakers: screenShareComponent
|
10148
|
+
? childrenPerPage.current - (pinnedParticipantUserIds.length % childrenPerPage.current)
|
10149
|
+
: childrenPerPage.current,
|
10139
10150
|
/* @conditional-compile-remove(pinned-participants) */ pinnedParticipantUserIds
|
10140
10151
|
});
|
10141
10152
|
let activeVideoStreams = 0;
|
@@ -10174,7 +10185,9 @@ const DefaultLayout = (props) => {
|
|
10174
10185
|
/* @conditional-compile-remove(vertical-gallery) */
|
10175
10186
|
veritcalGalleryStyles: styles === null || styles === void 0 ? void 0 : styles.verticalGallery,
|
10176
10187
|
/* @conditional-compile-remove(pinned-participants) */
|
10177
|
-
overflowGalleryLayout: overflowGalleryLayout, onFetchTilesToRender: setIndexesToRender
|
10188
|
+
overflowGalleryLayout: overflowGalleryLayout, onFetchTilesToRender: setIndexesToRender, onChildrenPerPageChange: (n) => {
|
10189
|
+
childrenPerPage.current = n;
|
10190
|
+
} }));
|
10178
10191
|
}, [
|
10179
10192
|
isNarrow,
|
10180
10193
|
/* @conditional-compile-remove(vertical-gallery) */ isShort,
|
@@ -10937,18 +10950,23 @@ const layerHostStyle = {
|
|
10937
10950
|
* @private
|
10938
10951
|
*/
|
10939
10952
|
const FloatingLocalVideoLayout = (props) => {
|
10940
|
-
const { remoteParticipants = [], dominantSpeakers, localVideoComponent, screenShareComponent, onRenderRemoteParticipant, styles, maxRemoteVideoStreams, showCameraSwitcherInLocalPreview, parentWidth, parentHeight,
|
10941
|
-
/* @conditional-compile-remove(pinned-participants) */ pinnedParticipantUserIds,
|
10953
|
+
const { remoteParticipants = [], dominantSpeakers, localVideoComponent, screenShareComponent, onRenderRemoteParticipant, styles, maxRemoteVideoStreams, showCameraSwitcherInLocalPreview, parentWidth, parentHeight, pinnedParticipantUserIds = [],
|
10942
10954
|
/* @conditional-compile-remove(vertical-gallery) */ overflowGalleryLayout = 'HorizontalBottom' } = props;
|
10943
10955
|
const theme = useTheme();
|
10944
10956
|
const isNarrow = parentWidth ? isNarrowWidth(parentWidth) : false;
|
10945
10957
|
/* @conditional-compile-remove(vertical-gallery) */
|
10946
10958
|
const isShort = parentHeight ? isShortHeight(parentHeight) : false;
|
10959
|
+
// This is for tracking the number of children in the first page of horizontal gallery.
|
10960
|
+
// This number will be used for the maxHorizontalDominantSpeakers when organizing the remote participants.
|
10961
|
+
const childrenPerPage = React.useRef(4);
|
10947
10962
|
const { gridParticipants, horizontalGalleryParticipants } = useOrganizedParticipants({
|
10948
10963
|
remoteParticipants,
|
10949
10964
|
dominantSpeakers,
|
10950
10965
|
maxRemoteVideoStreams,
|
10951
10966
|
isScreenShareActive: !!screenShareComponent,
|
10967
|
+
maxHorizontalGalleryDominantSpeakers: screenShareComponent
|
10968
|
+
? childrenPerPage.current - (pinnedParticipantUserIds.length % childrenPerPage.current)
|
10969
|
+
: childrenPerPage.current,
|
10952
10970
|
/* @conditional-compile-remove(pinned-participants) */ pinnedParticipantUserIds
|
10953
10971
|
});
|
10954
10972
|
let activeVideoStreams = 0;
|
@@ -11017,7 +11035,9 @@ const FloatingLocalVideoLayout = (props) => {
|
|
11017
11035
|
/* @conditional-compile-remove(vertical-gallery) */
|
11018
11036
|
veritcalGalleryStyles: styles === null || styles === void 0 ? void 0 : styles.verticalGallery,
|
11019
11037
|
/* @conditional-compile-remove(vertical-gallery) */
|
11020
|
-
overflowGalleryLayout: overflowGalleryLayout
|
11038
|
+
overflowGalleryLayout: overflowGalleryLayout, onChildrenPerPageChange: (n) => {
|
11039
|
+
childrenPerPage.current = n;
|
11040
|
+
} }));
|
11021
11041
|
}, [
|
11022
11042
|
isNarrow,
|
11023
11043
|
/* @conditional-compile-remove(vertical-gallery) */ isShort,
|
@@ -11669,7 +11689,7 @@ const DevicesButton = (props) => {
|
|
11669
11689
|
|
11670
11690
|
// Copyright (c) Microsoft Corporation.
|
11671
11691
|
// Licensed under the MIT license.
|
11672
|
-
var __awaiter$
|
11692
|
+
var __awaiter$p = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
11673
11693
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
11674
11694
|
return new (P || (P = Promise))(function (resolve, reject) {
|
11675
11695
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -11707,7 +11727,7 @@ const CameraButton = (props) => {
|
|
11707
11727
|
const toggleAnnouncerString = React.useCallback((isCameraOn) => {
|
11708
11728
|
setAnnouncerString(!isCameraOn ? strings.cameraActionTurnedOffAnnouncement : strings.cameraActionTurnedOnAnnouncement);
|
11709
11729
|
}, [strings.cameraActionTurnedOffAnnouncement, strings.cameraActionTurnedOnAnnouncement]);
|
11710
|
-
const onToggleClick = React.useCallback(() => __awaiter$
|
11730
|
+
const onToggleClick = React.useCallback(() => __awaiter$p(void 0, void 0, void 0, function* () {
|
11711
11731
|
// Throttle click on camera, need to await onToggleCamera then allow another click
|
11712
11732
|
if (onToggleCamera) {
|
11713
11733
|
setWaitForCamera(true);
|
@@ -11872,7 +11892,7 @@ const lightThemeCallButtonStyles = {
|
|
11872
11892
|
|
11873
11893
|
// Copyright (c) Microsoft Corporation.
|
11874
11894
|
// Licensed under the MIT license.
|
11875
|
-
var __awaiter$
|
11895
|
+
var __awaiter$o = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
11876
11896
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
11877
11897
|
return new (P || (P = Promise))(function (resolve, reject) {
|
11878
11898
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -11913,7 +11933,7 @@ const MicrophoneButton = (props) => {
|
|
11913
11933
|
const toggleAnnouncerString = React.useCallback((isMicOn) => {
|
11914
11934
|
setAnnouncerString(!isMicOn ? strings.microphoneActionTurnedOffAnnouncement : strings.microphoneActionTurnedOnAnnouncement);
|
11915
11935
|
}, [strings.microphoneActionTurnedOffAnnouncement, strings.microphoneActionTurnedOnAnnouncement]);
|
11916
|
-
const onToggleClick = React.useCallback(() => __awaiter$
|
11936
|
+
const onToggleClick = React.useCallback(() => __awaiter$o(void 0, void 0, void 0, function* () {
|
11917
11937
|
if (onToggleMicrophone) {
|
11918
11938
|
try {
|
11919
11939
|
yield onToggleMicrophone();
|
@@ -12801,7 +12821,7 @@ const formatPhoneNumber = (phoneNumber) => {
|
|
12801
12821
|
|
12802
12822
|
// Copyright (c) Microsoft Corporation.
|
12803
12823
|
// Licensed under the MIT license.
|
12804
|
-
var __awaiter$
|
12824
|
+
var __awaiter$n = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
12805
12825
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
12806
12826
|
return new (P || (P = Promise))(function (resolve, reject) {
|
12807
12827
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -12843,10 +12863,10 @@ const DialpadButton = (props) => {
|
|
12843
12863
|
const theme = react.useTheme();
|
12844
12864
|
const { digit, index, onClick, onLongPress, isMobile = false } = props;
|
12845
12865
|
const useLongPressProps = React__default['default'].useMemo(() => ({
|
12846
|
-
onClick: () => __awaiter$
|
12866
|
+
onClick: () => __awaiter$n(void 0, void 0, void 0, function* () {
|
12847
12867
|
onClick(digit, index);
|
12848
12868
|
}),
|
12849
|
-
onLongPress: () => __awaiter$
|
12869
|
+
onLongPress: () => __awaiter$n(void 0, void 0, void 0, function* () {
|
12850
12870
|
onLongPress(digit, index);
|
12851
12871
|
}),
|
12852
12872
|
touchEventsOnly: isMobile
|
@@ -13771,7 +13791,7 @@ const findConditionalCompiledSelector = (component) => {
|
|
13771
13791
|
|
13772
13792
|
// Copyright (c) Microsoft Corporation.
|
13773
13793
|
// Licensed under the MIT license.
|
13774
|
-
var __awaiter$
|
13794
|
+
var __awaiter$m = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
13775
13795
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
13776
13796
|
return new (P || (P = Promise))(function (resolve, reject) {
|
13777
13797
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -13794,35 +13814,35 @@ const createDefaultChatHandlers = memoizeOne__default['default']((chatClient, ch
|
|
13794
13814
|
let messageIterator = undefined;
|
13795
13815
|
let readReceiptIterator = undefined;
|
13796
13816
|
return {
|
13797
|
-
onSendMessage: (content, options) => __awaiter$
|
13817
|
+
onSendMessage: (content, options) => __awaiter$m(void 0, void 0, void 0, function* () {
|
13798
13818
|
const sendMessageRequest = {
|
13799
13819
|
content,
|
13800
13820
|
senderDisplayName: chatClient.getState().displayName
|
13801
13821
|
};
|
13802
13822
|
yield chatThreadClient.sendMessage(sendMessageRequest, options);
|
13803
13823
|
}),
|
13804
|
-
onUpdateMessage: (messageId, content, metadata, options) => __awaiter$
|
13824
|
+
onUpdateMessage: (messageId, content, metadata, options) => __awaiter$m(void 0, void 0, void 0, function* () {
|
13805
13825
|
const updatedMetadata = metadata ? Object.assign({}, metadata) : {};
|
13806
13826
|
updatedMetadata['fileSharingMetadata'] = JSON.stringify((options === null || options === void 0 ? void 0 : options.attachedFilesMetadata) || []);
|
13807
13827
|
yield chatThreadClient.updateMessage(messageId, { content, metadata: updatedMetadata });
|
13808
13828
|
}),
|
13809
|
-
onDeleteMessage: (messageId) => __awaiter$
|
13829
|
+
onDeleteMessage: (messageId) => __awaiter$m(void 0, void 0, void 0, function* () {
|
13810
13830
|
yield chatThreadClient.deleteMessage(messageId);
|
13811
13831
|
}),
|
13812
13832
|
// This handler is designed for chatThread to consume
|
13813
|
-
onMessageSeen: (chatMessageId) => __awaiter$
|
13833
|
+
onMessageSeen: (chatMessageId) => __awaiter$m(void 0, void 0, void 0, function* () {
|
13814
13834
|
yield chatThreadClient.sendReadReceipt({ chatMessageId });
|
13815
13835
|
}),
|
13816
|
-
onTyping: () => __awaiter$
|
13836
|
+
onTyping: () => __awaiter$m(void 0, void 0, void 0, function* () {
|
13817
13837
|
yield chatThreadClient.sendTypingNotification();
|
13818
13838
|
}),
|
13819
|
-
onRemoveParticipant: (userId) => __awaiter$
|
13839
|
+
onRemoveParticipant: (userId) => __awaiter$m(void 0, void 0, void 0, function* () {
|
13820
13840
|
yield chatThreadClient.removeParticipant(fromFlatCommunicationIdentifier(userId));
|
13821
13841
|
}),
|
13822
|
-
updateThreadTopicName: (topicName) => __awaiter$
|
13842
|
+
updateThreadTopicName: (topicName) => __awaiter$m(void 0, void 0, void 0, function* () {
|
13823
13843
|
yield chatThreadClient.updateTopic(topicName);
|
13824
13844
|
}),
|
13825
|
-
onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$
|
13845
|
+
onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$m(void 0, void 0, void 0, function* () {
|
13826
13846
|
var _a, _b, _c;
|
13827
13847
|
if (messageIterator === undefined) {
|
13828
13848
|
// Lazy definition so that errors in the method call are reported correctly.
|
@@ -14559,7 +14579,7 @@ const chatStatefulLogger = logger.createClientLogger('communication-react:chat-s
|
|
14559
14579
|
|
14560
14580
|
// Copyright (c) Microsoft Corporation.
|
14561
14581
|
// Licensed under the MIT license.
|
14562
|
-
var __awaiter$
|
14582
|
+
var __awaiter$l = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
14563
14583
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
14564
14584
|
return new (P || (P = Promise))(function (resolve, reject) {
|
14565
14585
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -14834,7 +14854,7 @@ class ChatContext$1 {
|
|
14834
14854
|
* @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.
|
14835
14855
|
*/
|
14836
14856
|
withAsyncErrorTeedToState(f, target) {
|
14837
|
-
return (...args) => __awaiter$
|
14857
|
+
return (...args) => __awaiter$l(this, void 0, void 0, function* () {
|
14838
14858
|
try {
|
14839
14859
|
return yield f(...args);
|
14840
14860
|
}
|
@@ -14941,7 +14961,7 @@ const convertChatMessage = (message, status = 'delivered', clientMessageId) => {
|
|
14941
14961
|
|
14942
14962
|
// Copyright (c) Microsoft Corporation.
|
14943
14963
|
// Licensed under the MIT license.
|
14944
|
-
var __awaiter$
|
14964
|
+
var __awaiter$k = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
14945
14965
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
14946
14966
|
return new (P || (P = Promise))(function (resolve, reject) {
|
14947
14967
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -15026,7 +15046,7 @@ class EventSubscriber {
|
|
15026
15046
|
};
|
15027
15047
|
// This is a temporary fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK.
|
15028
15048
|
// Without the temporary fix, there are missing 'participant joined' and 'participant left' system messages in the chat thread.
|
15029
|
-
this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$
|
15049
|
+
this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$k(this, void 0, void 0, function* () {
|
15030
15050
|
var e_1, _a;
|
15031
15051
|
try {
|
15032
15052
|
for (var _b = __asyncValues$1(this.chatClient
|
@@ -15118,7 +15138,7 @@ class EventSubscriber {
|
|
15118
15138
|
|
15119
15139
|
// Copyright (c) Microsoft Corporation.
|
15120
15140
|
// Licensed under the MIT license.
|
15121
|
-
var __awaiter$
|
15141
|
+
var __awaiter$j = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
15122
15142
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
15123
15143
|
return new (P || (P = Promise))(function (resolve, reject) {
|
15124
15144
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -15140,7 +15160,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
|
|
15140
15160
|
const threadsIterator = iteratorCreator(...args);
|
15141
15161
|
return {
|
15142
15162
|
next() {
|
15143
|
-
return __awaiter$
|
15163
|
+
return __awaiter$j(this, void 0, void 0, function* () {
|
15144
15164
|
const result = yield threadsIterator.next();
|
15145
15165
|
if (!result.done && result.value) {
|
15146
15166
|
decorateFn(result.value, context);
|
@@ -15155,7 +15175,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
|
|
15155
15175
|
const pages = threadsIterator.byPage(settings);
|
15156
15176
|
return {
|
15157
15177
|
next() {
|
15158
|
-
return __awaiter$
|
15178
|
+
return __awaiter$j(this, void 0, void 0, function* () {
|
15159
15179
|
const result = yield pages.next();
|
15160
15180
|
const page = result.value;
|
15161
15181
|
if (!result.done && result.value) {
|
@@ -15239,7 +15259,7 @@ const createDecoratedListParticipants = (chatThreadClient, context) => {
|
|
15239
15259
|
|
15240
15260
|
// Copyright (c) Microsoft Corporation.
|
15241
15261
|
// Licensed under the MIT license.
|
15242
|
-
var __awaiter$
|
15262
|
+
var __awaiter$i = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
15243
15263
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
15244
15264
|
return new (P || (P = Promise))(function (resolve, reject) {
|
15245
15265
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -15258,14 +15278,14 @@ class ProxyChatThreadClient {
|
|
15258
15278
|
return createDecoratedListMessages(chatThreadClient, this._context);
|
15259
15279
|
}
|
15260
15280
|
case 'getMessage': {
|
15261
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
15281
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
|
15262
15282
|
const message = yield chatThreadClient.getMessage(...args);
|
15263
15283
|
this._context.setChatMessage(chatThreadClient.threadId, convertChatMessage(message));
|
15264
15284
|
return message;
|
15265
15285
|
}), 'ChatThreadClient.getMessage');
|
15266
15286
|
}
|
15267
15287
|
case 'sendMessage': {
|
15268
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
15288
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
|
15269
15289
|
// Retry logic?
|
15270
15290
|
const [request, options] = args;
|
15271
15291
|
const { content } = request;
|
@@ -15305,7 +15325,7 @@ class ProxyChatThreadClient {
|
|
15305
15325
|
}), 'ChatThreadClient.sendMessage');
|
15306
15326
|
}
|
15307
15327
|
case 'addParticipants': {
|
15308
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
15328
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
|
15309
15329
|
const result = yield chatThreadClient.addParticipants(...args);
|
15310
15330
|
const [addRequest] = args;
|
15311
15331
|
const participantsToAdd = addRequest.participants;
|
@@ -15314,7 +15334,7 @@ class ProxyChatThreadClient {
|
|
15314
15334
|
}), 'ChatThreadClient.addParticipants');
|
15315
15335
|
}
|
15316
15336
|
case 'deleteMessage': {
|
15317
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
15337
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
|
15318
15338
|
// DeleteMessage is able to either delete local one(for failed message) or synced message
|
15319
15339
|
const [messageId] = args;
|
15320
15340
|
if (this._context.deleteLocalMessage(chatThreadClient.threadId, messageId)) {
|
@@ -15332,12 +15352,12 @@ class ProxyChatThreadClient {
|
|
15332
15352
|
return createDecoratedListReadReceipts(chatThreadClient, this._context);
|
15333
15353
|
}
|
15334
15354
|
case 'sendTypingNotification': {
|
15335
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
15355
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
|
15336
15356
|
return yield chatThreadClient.sendTypingNotification(...args);
|
15337
15357
|
}), 'ChatThreadClient.sendTypingNotification');
|
15338
15358
|
}
|
15339
15359
|
case 'removeParticipant': {
|
15340
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
15360
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
|
15341
15361
|
const result = yield chatThreadClient.removeParticipant(...args);
|
15342
15362
|
const [removeIdentifier] = args;
|
15343
15363
|
this._context.deleteParticipant(chatThreadClient.threadId, communicationCommon.getIdentifierKind(removeIdentifier));
|
@@ -15345,7 +15365,7 @@ class ProxyChatThreadClient {
|
|
15345
15365
|
}), 'ChatThreadClient.removeParticipant');
|
15346
15366
|
}
|
15347
15367
|
case 'updateMessage': {
|
15348
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
15368
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
|
15349
15369
|
const result = yield chatThreadClient.updateMessage(...args);
|
15350
15370
|
const [messageId, updateOption] = args;
|
15351
15371
|
this._context.updateChatMessageContent(chatThreadClient.threadId, messageId, updateOption === null || updateOption === void 0 ? void 0 : updateOption.content);
|
@@ -15353,7 +15373,7 @@ class ProxyChatThreadClient {
|
|
15353
15373
|
}), 'ChatThreadClient.updateMessage');
|
15354
15374
|
}
|
15355
15375
|
case 'updateTopic': {
|
15356
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
15376
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
|
15357
15377
|
const result = yield chatThreadClient.updateTopic(...args);
|
15358
15378
|
const [topic] = args;
|
15359
15379
|
this._context.updateThreadTopic(chatThreadClient.threadId, topic);
|
@@ -15361,7 +15381,7 @@ class ProxyChatThreadClient {
|
|
15361
15381
|
}), 'ChatThreadClient.updateTopic');
|
15362
15382
|
}
|
15363
15383
|
case 'getProperties': {
|
15364
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
15384
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
|
15365
15385
|
const result = yield chatThreadClient.getProperties(...args);
|
15366
15386
|
this._context.updateThread(chatThreadClient.threadId, result);
|
15367
15387
|
return result;
|
@@ -15398,7 +15418,7 @@ const createDecoratedListThreads = (chatClient, context) => {
|
|
15398
15418
|
|
15399
15419
|
// Copyright (c) Microsoft Corporation.
|
15400
15420
|
// Licensed under the MIT license.
|
15401
|
-
var __awaiter$
|
15421
|
+
var __awaiter$h = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
15402
15422
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
15403
15423
|
return new (P || (P = Promise))(function (resolve, reject) {
|
15404
15424
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -15417,7 +15437,7 @@ const proxyChatClient = {
|
|
15417
15437
|
switch (prop) {
|
15418
15438
|
case 'createChatThread': {
|
15419
15439
|
return context.withAsyncErrorTeedToState(function (...args) {
|
15420
|
-
return __awaiter$
|
15440
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
15421
15441
|
const result = yield chatClient.createChatThread(...args);
|
15422
15442
|
const thread = result.chatThread;
|
15423
15443
|
if (thread) {
|
@@ -15430,7 +15450,7 @@ const proxyChatClient = {
|
|
15430
15450
|
}
|
15431
15451
|
case 'deleteChatThread': {
|
15432
15452
|
return context.withAsyncErrorTeedToState(function (...args) {
|
15433
|
-
return __awaiter$
|
15453
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
15434
15454
|
const result = yield chatClient.deleteChatThread(...args);
|
15435
15455
|
context.deleteThread(args[0]);
|
15436
15456
|
return result;
|
@@ -15450,7 +15470,7 @@ const proxyChatClient = {
|
|
15450
15470
|
}
|
15451
15471
|
case 'startRealtimeNotifications': {
|
15452
15472
|
return context.withAsyncErrorTeedToState(function (...args) {
|
15453
|
-
return __awaiter$
|
15473
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
15454
15474
|
const ret = yield chatClient.startRealtimeNotifications(...args);
|
15455
15475
|
if (!receiver.eventSubscriber) {
|
15456
15476
|
receiver.eventSubscriber = new EventSubscriber(chatClient, context);
|
@@ -15461,7 +15481,7 @@ const proxyChatClient = {
|
|
15461
15481
|
}
|
15462
15482
|
case 'stopRealtimeNotifications': {
|
15463
15483
|
return context.withAsyncErrorTeedToState(function (...args) {
|
15464
|
-
return __awaiter$
|
15484
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
15465
15485
|
const ret = yield chatClient.stopRealtimeNotifications(...args);
|
15466
15486
|
if (receiver.eventSubscriber) {
|
15467
15487
|
receiver.eventSubscriber.unsubscribe();
|
@@ -15899,6 +15919,16 @@ const uploadFileButtonStringTrampoline = () => {
|
|
15899
15919
|
};
|
15900
15920
|
|
15901
15921
|
// Copyright (c) Microsoft Corporation.
|
15922
|
+
// Licensed under the MIT license.
|
15923
|
+
var __awaiter$g = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
15924
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
15925
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
15926
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
15927
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
15928
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
15929
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
15930
|
+
});
|
15931
|
+
};
|
15902
15932
|
/* @conditional-compile-remove(file-sharing) */
|
15903
15933
|
/**
|
15904
15934
|
* @internal
|
@@ -15944,9 +15974,10 @@ class FileUploadContext {
|
|
15944
15974
|
* @internal
|
15945
15975
|
*/
|
15946
15976
|
class AzureCommunicationFileUploadAdapter {
|
15947
|
-
constructor(chatContext) {
|
15977
|
+
constructor(chatContext, getAuthToken) {
|
15948
15978
|
this.fileUploads = [];
|
15949
15979
|
this.context = new FileUploadContext(chatContext);
|
15980
|
+
this.getAuthToken = getAuthToken;
|
15950
15981
|
}
|
15951
15982
|
findFileUpload(id) {
|
15952
15983
|
return this.fileUploads.find((fileUpload) => fileUpload.id === id);
|
@@ -16006,6 +16037,24 @@ class AzureCommunicationFileUploadAdapter {
|
|
16006
16037
|
updateFileUploadMetadata(id, metadata) {
|
16007
16038
|
this.context.updateFileUpload(id, { progress: 1, metadata });
|
16008
16039
|
}
|
16040
|
+
/* @conditional-compile-remove(teams-inline-images) */
|
16041
|
+
downloadAuthenticatedAttachment(attachmentUrl) {
|
16042
|
+
return __awaiter$g(this, void 0, void 0, function* () {
|
16043
|
+
function fetchWithAuthentication(url, token) {
|
16044
|
+
const headers = new Headers();
|
16045
|
+
headers.append('Authorization', `Bearer ${token}`);
|
16046
|
+
return fetch(url, { headers });
|
16047
|
+
}
|
16048
|
+
if (!this.getAuthToken) {
|
16049
|
+
return '';
|
16050
|
+
}
|
16051
|
+
// ToDo InlineAttachments: If GET fails might need to send failure up to contoso
|
16052
|
+
const token = yield this.getAuthToken();
|
16053
|
+
const response = yield fetchWithAuthentication(attachmentUrl !== null && attachmentUrl !== void 0 ? attachmentUrl : '', token);
|
16054
|
+
const blob = yield response.blob();
|
16055
|
+
return URL.createObjectURL(blob);
|
16056
|
+
});
|
16057
|
+
}
|
16009
16058
|
subscribeAllEvents(fileUpload) {
|
16010
16059
|
fileUpload.on('uploadProgressChange', this.updateFileUploadProgress.bind(this));
|
16011
16060
|
fileUpload.on('uploadComplete', this.updateFileUploadMetadata.bind(this));
|
@@ -16519,6 +16568,8 @@ class AzureCommunicationChatAdapter {
|
|
16519
16568
|
this.updateFileUploadErrorMessage = this.updateFileUploadErrorMessage.bind(this);
|
16520
16569
|
/* @conditional-compile-remove(file-sharing) */
|
16521
16570
|
this.updateFileUploadMetadata = this.updateFileUploadMetadata.bind(this);
|
16571
|
+
/* @conditional-compile-remove(teams-inline-images) */
|
16572
|
+
this.downloadAuthenticatedAttachment = this.downloadAuthenticatedAttachment.bind(this);
|
16522
16573
|
}
|
16523
16574
|
dispose() {
|
16524
16575
|
this.unsubscribeAllEvents();
|
@@ -16655,6 +16706,15 @@ class AzureCommunicationChatAdapter {
|
|
16655
16706
|
updateFileUploadMetadata(id, metadata) {
|
16656
16707
|
this.fileUploadAdapter.updateFileUploadMetadata(id, metadata);
|
16657
16708
|
}
|
16709
|
+
/* @conditional-compile-remove(teams-inline-images) */
|
16710
|
+
downloadAuthenticatedAttachment(attachmentUrl) {
|
16711
|
+
return __awaiter$e(this, void 0, void 0, function* () {
|
16712
|
+
if (!this.fileUploadAdapter.downloadAuthenticatedAttachment) {
|
16713
|
+
return '';
|
16714
|
+
}
|
16715
|
+
return yield this.fileUploadAdapter.downloadAuthenticatedAttachment(attachmentUrl);
|
16716
|
+
});
|
16717
|
+
}
|
16658
16718
|
messageReceivedListener(event) {
|
16659
16719
|
const message = convertEventToChatMessage(event);
|
16660
16720
|
this.emitter.emit('messageReceived', { message });
|