@azure/communication-react 1.5.1-alpha-202301280013 → 1.5.1-alpha-202302020013
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 +39 -2
- package/dist/dist-cjs/communication-react/index.js +274 -174
- 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-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +25 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +24 -6
- 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/OnFetchProfileCallback.d.ts +23 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/OnFetchProfileCallback.js +45 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/OnFetchProfileCallback.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +2 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +9 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +39 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
- package/package.json +10 -8
@@ -159,7 +159,7 @@ const _toCommunicationIdentifier = (id) => {
|
|
159
159
|
// Copyright (c) Microsoft Corporation.
|
160
160
|
// Licensed under the MIT license.
|
161
161
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
162
|
-
var telemetryVersion = '1.5.1-alpha-
|
162
|
+
var telemetryVersion = '1.5.1-alpha-202302020013';
|
163
163
|
|
164
164
|
// Copyright (c) Microsoft Corporation.
|
165
165
|
/**
|
@@ -375,7 +375,7 @@ const getEnvironmentInfo = (state) => {
|
|
375
375
|
|
376
376
|
// Copyright (c) Microsoft Corporation.
|
377
377
|
// Licensed under the MIT license.
|
378
|
-
var __awaiter$
|
378
|
+
var __awaiter$D = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
379
379
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
380
380
|
return new (P || (P = Promise))(function (resolve, reject) {
|
381
381
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -413,7 +413,7 @@ const _isPreviewOn = (deviceManager) => {
|
|
413
413
|
*
|
414
414
|
* @private
|
415
415
|
*/
|
416
|
-
const disposeAllLocalPreviewViews = (callClient) => __awaiter$
|
416
|
+
const disposeAllLocalPreviewViews = (callClient) => __awaiter$D(void 0, void 0, void 0, function* () {
|
417
417
|
const unparentedViews = callClient.getState().deviceManager.unparentedViews;
|
418
418
|
for (const view of unparentedViews) {
|
419
419
|
yield callClient.disposeView(undefined, undefined, view);
|
@@ -546,7 +546,7 @@ const holdButtonSelector = reselect__namespace.createSelector([getCallState], (c
|
|
546
546
|
|
547
547
|
// Copyright (c) Microsoft Corporation.
|
548
548
|
// Licensed under the MIT license.
|
549
|
-
var __awaiter$
|
549
|
+
var __awaiter$C = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
550
550
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
551
551
|
return new (P || (P = Promise))(function (resolve, reject) {
|
552
552
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -567,7 +567,7 @@ const areStreamsEqual = (prevStream, newStream) => {
|
|
567
567
|
* @private
|
568
568
|
*/
|
569
569
|
const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callClient, deviceManager, call) => {
|
570
|
-
const onStartLocalVideo = () => __awaiter$
|
570
|
+
const onStartLocalVideo = () => __awaiter$C(void 0, void 0, void 0, function* () {
|
571
571
|
// Before the call object creates a stream, dispose of any local preview streams.
|
572
572
|
// @TODO: is there any way to parent the unparented view to the call object instead
|
573
573
|
// of disposing and creating a new stream?
|
@@ -587,7 +587,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
587
587
|
yield call.startVideo(stream);
|
588
588
|
}
|
589
589
|
});
|
590
|
-
const onStopLocalVideo = (stream) => __awaiter$
|
590
|
+
const onStopLocalVideo = (stream) => __awaiter$C(void 0, void 0, void 0, function* () {
|
591
591
|
const callId = call === null || call === void 0 ? void 0 : call.id;
|
592
592
|
if (!callId) {
|
593
593
|
return;
|
@@ -600,7 +600,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
600
600
|
});
|
601
601
|
}
|
602
602
|
});
|
603
|
-
const onToggleCamera = (options) => __awaiter$
|
603
|
+
const onToggleCamera = (options) => __awaiter$C(void 0, void 0, void 0, function* () {
|
604
604
|
const previewOn = _isPreviewOn(callClient.getState().deviceManager);
|
605
605
|
if (previewOn && call && call.state === 'Connecting') {
|
606
606
|
// This is to workaround: https://skype.visualstudio.com/SPOOL/_workitems/edit/3030558.
|
@@ -648,19 +648,19 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
648
648
|
}
|
649
649
|
}
|
650
650
|
});
|
651
|
-
const onSelectMicrophone = (device) => __awaiter$
|
651
|
+
const onSelectMicrophone = (device) => __awaiter$C(void 0, void 0, void 0, function* () {
|
652
652
|
if (!deviceManager) {
|
653
653
|
return;
|
654
654
|
}
|
655
655
|
return deviceManager.selectMicrophone(device);
|
656
656
|
});
|
657
|
-
const onSelectSpeaker = (device) => __awaiter$
|
657
|
+
const onSelectSpeaker = (device) => __awaiter$C(void 0, void 0, void 0, function* () {
|
658
658
|
if (!deviceManager) {
|
659
659
|
return;
|
660
660
|
}
|
661
661
|
return deviceManager.selectSpeaker(device);
|
662
662
|
});
|
663
|
-
const onSelectCamera = (device, options) => __awaiter$
|
663
|
+
const onSelectCamera = (device, options) => __awaiter$C(void 0, void 0, void 0, function* () {
|
664
664
|
if (!deviceManager) {
|
665
665
|
return;
|
666
666
|
}
|
@@ -683,19 +683,19 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
683
683
|
}, options);
|
684
684
|
}
|
685
685
|
});
|
686
|
-
const onToggleMicrophone = () => __awaiter$
|
686
|
+
const onToggleMicrophone = () => __awaiter$C(void 0, void 0, void 0, function* () {
|
687
687
|
if (!call || !_isInCall(call.state)) {
|
688
688
|
throw new Error(`Please invoke onToggleMicrophone after call is started`);
|
689
689
|
}
|
690
690
|
return call.isMuted ? yield call.unmute() : yield call.mute();
|
691
691
|
});
|
692
|
-
const onStartScreenShare = () => __awaiter$
|
693
|
-
const onStopScreenShare = () => __awaiter$
|
694
|
-
const onToggleScreenShare = () => __awaiter$
|
695
|
-
const onHangUp = (forEveryone) => __awaiter$
|
692
|
+
const onStartScreenShare = () => __awaiter$C(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
|
693
|
+
const onStopScreenShare = () => __awaiter$C(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
|
694
|
+
const onToggleScreenShare = () => __awaiter$C(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.isScreenSharingOn) ? yield onStopScreenShare() : yield onStartScreenShare(); });
|
695
|
+
const onHangUp = (forEveryone) => __awaiter$C(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.hangUp({ forEveryone: forEveryone === true ? true : false })); });
|
696
696
|
/* @conditional-compile-remove(PSTN-calls) */
|
697
|
-
const onToggleHold = () => __awaiter$
|
698
|
-
const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$
|
697
|
+
const onToggleHold = () => __awaiter$C(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()); });
|
698
|
+
const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$C(void 0, void 0, void 0, function* () {
|
699
699
|
var _a;
|
700
700
|
if (!call || call.localVideoStreams.length === 0) {
|
701
701
|
return;
|
@@ -711,7 +711,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
711
711
|
const { view } = (_a = (yield callClient.createView(call.id, undefined, localStream, options))) !== null && _a !== void 0 ? _a : {};
|
712
712
|
return view ? { view } : undefined;
|
713
713
|
});
|
714
|
-
const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$
|
714
|
+
const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$C(void 0, void 0, void 0, function* () {
|
715
715
|
if (!call) {
|
716
716
|
return;
|
717
717
|
}
|
@@ -739,7 +739,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
739
739
|
}
|
740
740
|
return (createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view) ? { view: createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view } : undefined;
|
741
741
|
});
|
742
|
-
const onDisposeRemoteStreamView = (userId) => __awaiter$
|
742
|
+
const onDisposeRemoteStreamView = (userId) => __awaiter$C(void 0, void 0, void 0, function* () {
|
743
743
|
if (!call) {
|
744
744
|
return;
|
745
745
|
}
|
@@ -760,7 +760,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
760
760
|
callClient.disposeView(call.id, participant.identifier, screenShareStream);
|
761
761
|
}
|
762
762
|
});
|
763
|
-
const onDisposeLocalStreamView = () => __awaiter$
|
763
|
+
const onDisposeLocalStreamView = () => __awaiter$C(void 0, void 0, void 0, function* () {
|
764
764
|
// If the user is currently in a call, dispose of the local stream view attached to that call.
|
765
765
|
const callState = call && callClient.getState().calls[call.id];
|
766
766
|
const localStream = callState === null || callState === void 0 ? void 0 : callState.localVideoStreams.find((item) => item.mediaStreamType === 'Video');
|
@@ -773,12 +773,12 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
773
773
|
yield disposeAllLocalPreviewViews(callClient);
|
774
774
|
});
|
775
775
|
/* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */
|
776
|
-
const onSendDtmfTone = (dtmfTone) => __awaiter$
|
776
|
+
const onSendDtmfTone = (dtmfTone) => __awaiter$C(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.sendDtmf(dtmfTone)); });
|
777
777
|
const notImplemented = () => {
|
778
778
|
throw new Error('Not implemented, cannot call a method from an abstract object');
|
779
779
|
};
|
780
780
|
/* @conditional-compile-remove(call-readiness) */
|
781
|
-
const askDevicePermission = (constrain) => __awaiter$
|
781
|
+
const askDevicePermission = (constrain) => __awaiter$C(void 0, void 0, void 0, function* () {
|
782
782
|
if (deviceManager) {
|
783
783
|
yield (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.askDevicePermission(constrain));
|
784
784
|
}
|
@@ -812,7 +812,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
|
|
812
812
|
|
813
813
|
// Copyright (c) Microsoft Corporation.
|
814
814
|
// Licensed under the MIT license.
|
815
|
-
var __awaiter$
|
815
|
+
var __awaiter$B = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
816
816
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
817
817
|
return new (P || (P = Promise))(function (resolve, reject) {
|
818
818
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -839,7 +839,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
|
|
839
839
|
return callAgent ? callAgent.startCall(participants, options) : undefined;
|
840
840
|
},
|
841
841
|
/* @conditional-compile-remove(PSTN-calls) */
|
842
|
-
onAddParticipant: (userId, options) => __awaiter$
|
842
|
+
onAddParticipant: (userId, options) => __awaiter$B(void 0, void 0, void 0, function* () {
|
843
843
|
const participant = _toCommunicationIdentifier(userId);
|
844
844
|
if (communicationCommon.isPhoneNumberIdentifier(participant)) {
|
845
845
|
call === null || call === void 0 ? void 0 : call.addParticipant(participant, options);
|
@@ -847,7 +847,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
|
|
847
847
|
else if (communicationCommon.isCommunicationUserIdentifier(participant) || communicationCommon.isMicrosoftTeamsUserIdentifier(participant)) {
|
848
848
|
call === null || call === void 0 ? void 0 : call.addParticipant(participant);
|
849
849
|
}
|
850
|
-
}), onRemoveParticipant: (userId) => __awaiter$
|
850
|
+
}), onRemoveParticipant: (userId) => __awaiter$B(void 0, void 0, void 0, function* () {
|
851
851
|
const participant = _toCommunicationIdentifier(userId);
|
852
852
|
yield (call === null || call === void 0 ? void 0 : call.removeParticipant(participant));
|
853
853
|
}) });
|
@@ -855,7 +855,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
|
|
855
855
|
|
856
856
|
// Copyright (c) Microsoft Corporation.
|
857
857
|
// Licensed under the MIT license.
|
858
|
-
var __awaiter$
|
858
|
+
var __awaiter$A = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
859
859
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
860
860
|
return new (P || (P = Promise))(function (resolve, reject) {
|
861
861
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -887,7 +887,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
|
|
887
887
|
},
|
888
888
|
/* @conditional-compile-remove(teams-identity-support) */
|
889
889
|
/* @conditional-compile-remove(PSTN-calls) */
|
890
|
-
onAddParticipant: (userId, options) => __awaiter$
|
890
|
+
onAddParticipant: (userId, options) => __awaiter$A(void 0, void 0, void 0, function* () {
|
891
891
|
const participant = _toCommunicationIdentifier(userId);
|
892
892
|
/* @conditional-compile-remove(teams-identity-support) */
|
893
893
|
const threadId = options === null || options === void 0 ? void 0 : options.threadId;
|
@@ -900,7 +900,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
|
|
900
900
|
}
|
901
901
|
/* @conditional-compile-remove(teams-identity-support) */
|
902
902
|
call === null || call === void 0 ? void 0 : call.addParticipant(participant);
|
903
|
-
}), onRemoveParticipant: (userId) => __awaiter$
|
903
|
+
}), onRemoveParticipant: (userId) => __awaiter$A(void 0, void 0, void 0, function* () {
|
904
904
|
const participant = _toCommunicationIdentifier(userId);
|
905
905
|
if (communicationCommon.isCommunicationUserIdentifier(participant)) {
|
906
906
|
throw new Error('CommunicationIdentifier in Teams call is not supported!');
|
@@ -912,7 +912,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
|
|
912
912
|
|
913
913
|
// Copyright (c) Microsoft Corporation.
|
914
914
|
// Licensed under the MIT license.
|
915
|
-
var __awaiter$
|
915
|
+
var __awaiter$z = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
916
916
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
917
917
|
return new (P || (P = Promise))(function (resolve, reject) {
|
918
918
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -961,13 +961,13 @@ class ProxyDeviceManager {
|
|
961
961
|
this.selectCamera = (videoDeviceInfo) => {
|
962
962
|
this._context.setDeviceManagerSelectedCamera(videoDeviceInfo);
|
963
963
|
};
|
964
|
-
this.videoDevicesUpdated = () => __awaiter$
|
964
|
+
this.videoDevicesUpdated = () => __awaiter$z(this, void 0, void 0, function* () {
|
965
965
|
// Device Manager always has a camera with '' name if there are no real camera devices available.
|
966
966
|
// We don't want to show that in the UI.
|
967
967
|
const realCameras = (yield this._deviceManager.getCameras()).filter((c) => !!c.name);
|
968
968
|
this._context.setDeviceManagerCameras(dedupeById(realCameras));
|
969
969
|
});
|
970
|
-
this.audioDevicesUpdated = () => __awaiter$
|
970
|
+
this.audioDevicesUpdated = () => __awaiter$z(this, void 0, void 0, function* () {
|
971
971
|
this._context.setDeviceManagerMicrophones(dedupeById(yield this._deviceManager.getMicrophones()));
|
972
972
|
this._context.setDeviceManagerSpeakers(dedupeById(yield this._deviceManager.getSpeakers()));
|
973
973
|
});
|
@@ -1176,7 +1176,7 @@ class CallIdHistory {
|
|
1176
1176
|
|
1177
1177
|
// Copyright (c) Microsoft Corporation.
|
1178
1178
|
// Licensed under the MIT license.
|
1179
|
-
var __awaiter$
|
1179
|
+
var __awaiter$y = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
1180
1180
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
1181
1181
|
return new (P || (P = Promise))(function (resolve, reject) {
|
1182
1182
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -1716,7 +1716,7 @@ class CallContext$2 {
|
|
1716
1716
|
* @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.
|
1717
1717
|
*/
|
1718
1718
|
withAsyncErrorTeedToState(action, target) {
|
1719
|
-
return (...args) => __awaiter$
|
1719
|
+
return (...args) => __awaiter$y(this, void 0, void 0, function* () {
|
1720
1720
|
try {
|
1721
1721
|
return yield action(...args);
|
1722
1722
|
}
|
@@ -1993,7 +1993,7 @@ class RemoteVideoStreamSubscriber {
|
|
1993
1993
|
|
1994
1994
|
// Copyright (c) Microsoft Corporation.
|
1995
1995
|
// Licensed under the MIT license.
|
1996
|
-
var __awaiter$
|
1996
|
+
var __awaiter$x = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
1997
1997
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
1998
1998
|
return new (P || (P = Promise))(function (resolve, reject) {
|
1999
1999
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -2003,7 +2003,7 @@ var __awaiter$w = (window && window.__awaiter) || function (thisArg, _arguments,
|
|
2003
2003
|
});
|
2004
2004
|
};
|
2005
2005
|
function createViewRemoteVideo(context, internalContext, callId, participantId, stream, options) {
|
2006
|
-
return __awaiter$
|
2006
|
+
return __awaiter$x(this, void 0, void 0, function* () {
|
2007
2007
|
// Render RemoteVideoStream that is part of a Call
|
2008
2008
|
const streamId = stream.id;
|
2009
2009
|
let participantKey;
|
@@ -2128,7 +2128,7 @@ function createViewRemoteVideo(context, internalContext, callId, participantId,
|
|
2128
2128
|
});
|
2129
2129
|
}
|
2130
2130
|
function createViewLocalVideo(context, internalContext, callId, options) {
|
2131
|
-
return __awaiter$
|
2131
|
+
return __awaiter$x(this, void 0, void 0, function* () {
|
2132
2132
|
_logEvent(callingStatefulLogger, {
|
2133
2133
|
name: EventNames.START_LOCAL_STREAM_RENDERING,
|
2134
2134
|
level: 'info',
|
@@ -2246,7 +2246,7 @@ function createViewLocalVideo(context, internalContext, callId, options) {
|
|
2246
2246
|
});
|
2247
2247
|
}
|
2248
2248
|
function createViewUnparentedVideo(context, internalContext, stream, options) {
|
2249
|
-
return __awaiter$
|
2249
|
+
return __awaiter$x(this, void 0, void 0, function* () {
|
2250
2250
|
const renderInfo = internalContext.getUnparentedRenderInfo(stream);
|
2251
2251
|
if (renderInfo && renderInfo.status === 'Rendered') {
|
2252
2252
|
console.warn('Unparented LocalVideoStream is already rendered');
|
@@ -2518,7 +2518,7 @@ function createView(context, internalContext, callId, participantId, stream, opt
|
|
2518
2518
|
// Render LocalVideoStream that is not part of a Call
|
2519
2519
|
// 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).
|
2520
2520
|
// We do not have a startLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.
|
2521
|
-
return context.withAsyncErrorTeedToState(() => __awaiter$
|
2521
|
+
return context.withAsyncErrorTeedToState(() => __awaiter$x(this, void 0, void 0, function* () { return yield createViewUnparentedVideo(context, internalContext, stream, options); }), 'Call.startVideo')();
|
2522
2522
|
}
|
2523
2523
|
else {
|
2524
2524
|
_logEvent(callingStatefulLogger, {
|
@@ -2945,7 +2945,7 @@ class CallSubscriber {
|
|
2945
2945
|
|
2946
2946
|
// Copyright (c) Microsoft Corporation.
|
2947
2947
|
// Licensed under the MIT license.
|
2948
|
-
var __awaiter$
|
2948
|
+
var __awaiter$w = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2949
2949
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
2950
2950
|
return new (P || (P = Promise))(function (resolve, reject) {
|
2951
2951
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -2965,14 +2965,14 @@ class ProxyIncomingCall {
|
|
2965
2965
|
switch (prop) {
|
2966
2966
|
case 'accept': {
|
2967
2967
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
2968
|
-
return __awaiter$
|
2968
|
+
return __awaiter$w(this, void 0, void 0, function* () {
|
2969
2969
|
return yield target.accept(...args);
|
2970
2970
|
});
|
2971
2971
|
}, 'IncomingCall.accept');
|
2972
2972
|
}
|
2973
2973
|
case 'reject': {
|
2974
2974
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
2975
|
-
return __awaiter$
|
2975
|
+
return __awaiter$w(this, void 0, void 0, function* () {
|
2976
2976
|
return yield target.reject(...args);
|
2977
2977
|
});
|
2978
2978
|
}, 'IncomingCall.reject');
|
@@ -3209,7 +3209,7 @@ const clearCallRelatedState = (context, internalContext) => {
|
|
3209
3209
|
|
3210
3210
|
// Copyright (c) Microsoft Corporation.
|
3211
3211
|
// Licensed under the MIT license.
|
3212
|
-
var __awaiter$
|
3212
|
+
var __awaiter$v = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3213
3213
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3214
3214
|
return new (P || (P = Promise))(function (resolve, reject) {
|
3215
3215
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -3235,56 +3235,56 @@ class ProxyCallCommon {
|
|
3235
3235
|
switch (prop) {
|
3236
3236
|
case 'mute': {
|
3237
3237
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3238
|
-
return __awaiter$
|
3238
|
+
return __awaiter$v(this, void 0, void 0, function* () {
|
3239
3239
|
return yield target.mute(...args);
|
3240
3240
|
});
|
3241
3241
|
}, 'Call.mute');
|
3242
3242
|
}
|
3243
3243
|
case 'unmute': {
|
3244
3244
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3245
|
-
return __awaiter$
|
3245
|
+
return __awaiter$v(this, void 0, void 0, function* () {
|
3246
3246
|
return yield target.unmute(...args);
|
3247
3247
|
});
|
3248
3248
|
}, 'Call.unmute');
|
3249
3249
|
}
|
3250
3250
|
case 'startVideo': {
|
3251
3251
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3252
|
-
return __awaiter$
|
3252
|
+
return __awaiter$v(this, void 0, void 0, function* () {
|
3253
3253
|
return yield target.startVideo(...args);
|
3254
3254
|
});
|
3255
3255
|
}, 'Call.startVideo');
|
3256
3256
|
}
|
3257
3257
|
case 'stopVideo': {
|
3258
3258
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3259
|
-
return __awaiter$
|
3259
|
+
return __awaiter$v(this, void 0, void 0, function* () {
|
3260
3260
|
return yield target.stopVideo(...args);
|
3261
3261
|
});
|
3262
3262
|
}, 'Call.stopVideo');
|
3263
3263
|
}
|
3264
3264
|
case 'startScreenSharing': {
|
3265
3265
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3266
|
-
return __awaiter$
|
3266
|
+
return __awaiter$v(this, void 0, void 0, function* () {
|
3267
3267
|
return yield target.startScreenSharing(...args);
|
3268
3268
|
});
|
3269
3269
|
}, 'Call.startScreenSharing');
|
3270
3270
|
}
|
3271
3271
|
case 'stopScreenSharing': {
|
3272
3272
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3273
|
-
return __awaiter$
|
3273
|
+
return __awaiter$v(this, void 0, void 0, function* () {
|
3274
3274
|
return yield target.stopScreenSharing(...args);
|
3275
3275
|
});
|
3276
3276
|
}, 'Call.stopScreenSharing');
|
3277
3277
|
}
|
3278
3278
|
case 'hold': {
|
3279
3279
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3280
|
-
return __awaiter$
|
3280
|
+
return __awaiter$v(this, void 0, void 0, function* () {
|
3281
3281
|
return yield target.hold(...args);
|
3282
3282
|
});
|
3283
3283
|
}, 'Call.hold');
|
3284
3284
|
}
|
3285
3285
|
case 'resume': {
|
3286
3286
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
3287
|
-
return __awaiter$
|
3287
|
+
return __awaiter$v(this, void 0, void 0, function* () {
|
3288
3288
|
return yield target.resume(...args);
|
3289
3289
|
});
|
3290
3290
|
}, 'Call.resume');
|
@@ -3297,7 +3297,7 @@ class ProxyCallCommon {
|
|
3297
3297
|
|
3298
3298
|
// Copyright (c) Microsoft Corporation.
|
3299
3299
|
// Licensed under the MIT license.
|
3300
|
-
var __awaiter$
|
3300
|
+
var __awaiter$u = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3301
3301
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3302
3302
|
return new (P || (P = Promise))(function (resolve, reject) {
|
3303
3303
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -3311,7 +3311,7 @@ class ProxyCall extends ProxyCallCommon {
|
|
3311
3311
|
switch (prop) {
|
3312
3312
|
case 'addParticipant': {
|
3313
3313
|
return this.getContext().withAsyncErrorTeedToState(function (...args) {
|
3314
|
-
return __awaiter$
|
3314
|
+
return __awaiter$u(this, void 0, void 0, function* () {
|
3315
3315
|
return yield target.addParticipant(...args);
|
3316
3316
|
});
|
3317
3317
|
}, 'Call.addParticipant');
|
@@ -3508,7 +3508,7 @@ class InternalCallContext {
|
|
3508
3508
|
|
3509
3509
|
// Copyright (c) Microsoft Corporation.
|
3510
3510
|
// Licensed under the MIT license.
|
3511
|
-
var __awaiter$
|
3511
|
+
var __awaiter$t = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3512
3512
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3513
3513
|
return new (P || (P = Promise))(function (resolve, reject) {
|
3514
3514
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -3523,7 +3523,7 @@ class ProxyTeamsCall extends ProxyCallCommon {
|
|
3523
3523
|
switch (prop) {
|
3524
3524
|
case 'addParticipant': {
|
3525
3525
|
return this.getContext().withAsyncErrorTeedToState(function (...args) {
|
3526
|
-
return __awaiter$
|
3526
|
+
return __awaiter$t(this, void 0, void 0, function* () {
|
3527
3527
|
return yield target.addParticipant(...args);
|
3528
3528
|
});
|
3529
3529
|
}, 'TeamsCall.addParticipant');
|
@@ -3638,7 +3638,7 @@ const teamsCallAgentDeclaratify = (callAgent, context, internalContext) => {
|
|
3638
3638
|
|
3639
3639
|
// Copyright (c) Microsoft Corporation.
|
3640
3640
|
// Licensed under the MIT license.
|
3641
|
-
var __awaiter$
|
3641
|
+
var __awaiter$s = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3642
3642
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3643
3643
|
return new (P || (P = Promise))(function (resolve, reject) {
|
3644
3644
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -3660,7 +3660,7 @@ class ProxyVideoStreamRendererView {
|
|
3660
3660
|
get(target, prop) {
|
3661
3661
|
switch (prop) {
|
3662
3662
|
case 'updateScalingMode': {
|
3663
|
-
return (...args) => __awaiter$
|
3663
|
+
return (...args) => __awaiter$s(this, void 0, void 0, function* () {
|
3664
3664
|
yield target.updateScalingMode(...args);
|
3665
3665
|
this._context.setRemoteVideoStreamViewScalingMode(this._callId, this._participantId, this._streamId, args[0]);
|
3666
3666
|
});
|
@@ -3681,7 +3681,7 @@ const videoStreamRendererViewDeclaratify = (view, context, callId, participantId
|
|
3681
3681
|
|
3682
3682
|
// Copyright (c) Microsoft Corporation.
|
3683
3683
|
// Licensed under the MIT license.
|
3684
|
-
var __awaiter$
|
3684
|
+
var __awaiter$r = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3685
3685
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3686
3686
|
return new (P || (P = Promise))(function (resolve, reject) {
|
3687
3687
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -3703,7 +3703,7 @@ class ProxyCallClient {
|
|
3703
3703
|
get(target, prop) {
|
3704
3704
|
switch (prop) {
|
3705
3705
|
case 'createCallAgent': {
|
3706
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
3706
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$r(this, void 0, void 0, function* () {
|
3707
3707
|
// createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
|
3708
3708
|
// callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
|
3709
3709
|
// callAgent if the createCallAgent succeeds.
|
@@ -3716,7 +3716,7 @@ class ProxyCallClient {
|
|
3716
3716
|
}), 'CallClient.createCallAgent');
|
3717
3717
|
}
|
3718
3718
|
case 'createTeamsCallAgent': {
|
3719
|
-
/* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
3719
|
+
/* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$r(this, void 0, void 0, function* () {
|
3720
3720
|
// createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
|
3721
3721
|
// callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
|
3722
3722
|
// callAgent if the createCallAgent succeeds.
|
@@ -3729,7 +3729,7 @@ class ProxyCallClient {
|
|
3729
3729
|
}), 'CallClient.createTeamsCallAgent');
|
3730
3730
|
}
|
3731
3731
|
case 'getDeviceManager': {
|
3732
|
-
return this._context.withAsyncErrorTeedToState(() => __awaiter$
|
3732
|
+
return this._context.withAsyncErrorTeedToState(() => __awaiter$r(this, void 0, void 0, function* () {
|
3733
3733
|
// As of writing, the SDK always returns the same instance of DeviceManager so we keep a reference of
|
3734
3734
|
// DeviceManager and if it does not change we return the cached DeclarativeDeviceManager. If it does not we'll
|
3735
3735
|
// throw an error that indicate we need to fix this issue as our implementation has diverged from the SDK.
|
@@ -3758,7 +3758,7 @@ class ProxyCallClient {
|
|
3758
3758
|
/**
|
3759
3759
|
* add to this object if we want to proxy anything else off the DebugInfo feature object.
|
3760
3760
|
*/
|
3761
|
-
return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter$
|
3761
|
+
return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter$r(this, void 0, void 0, function* () {
|
3762
3762
|
const environmentInfo = yield feature.getEnvironmentInfo();
|
3763
3763
|
this._context.setEnvironmentInfo(environmentInfo);
|
3764
3764
|
return environmentInfo;
|
@@ -3811,7 +3811,7 @@ const createStatefulCallClientWithDeps = (callClient, context, internalContext)
|
|
3811
3811
|
});
|
3812
3812
|
Object.defineProperty(callClient, 'createView', {
|
3813
3813
|
configurable: false,
|
3814
|
-
value: (callId, participantId, stream, options) => __awaiter$
|
3814
|
+
value: (callId, participantId, stream, options) => __awaiter$r(void 0, void 0, void 0, function* () {
|
3815
3815
|
const participantIdKind = participantId ? communicationCommon.getIdentifierKind(participantId) : undefined;
|
3816
3816
|
const result = yield createView(context, internalContext, callId, participantIdKind, stream, options);
|
3817
3817
|
// We only need to declaratify the VideoStreamRendererView object for remote participants. Because the updateScalingMode only needs to be called on remote participant stream views.
|
@@ -6624,7 +6624,7 @@ const chatMessageActionMenuProps = (menuProps) => {
|
|
6624
6624
|
return actionMenuProps;
|
6625
6625
|
};
|
6626
6626
|
|
6627
|
-
var __awaiter$
|
6627
|
+
var __awaiter$q = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
6628
6628
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
6629
6629
|
return new (P || (P = Promise))(function (resolve, reject) {
|
6630
6630
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -6649,7 +6649,7 @@ const _FileDownloadCards = (props) => {
|
|
6649
6649
|
var _a, _b;
|
6650
6650
|
return (_b = (_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile) !== null && _b !== void 0 ? _b : localeStrings.downloadFile;
|
6651
6651
|
}, [(_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile, localeStrings.downloadFile]);
|
6652
|
-
const fileDownloadHandler = React.useCallback((userId, file) => __awaiter$
|
6652
|
+
const fileDownloadHandler = React.useCallback((userId, file) => __awaiter$q(void 0, void 0, void 0, function* () {
|
6653
6653
|
if (!props.downloadHandler) {
|
6654
6654
|
window.open(file.url, '_blank', 'noopener,noreferrer');
|
6655
6655
|
}
|
@@ -6797,7 +6797,7 @@ const ChatMessageComponentAsMessageBubble = React__default['default'].memo(Messa
|
|
6797
6797
|
|
6798
6798
|
// Copyright (c) Microsoft Corporation.
|
6799
6799
|
// Licensed under the MIT license.
|
6800
|
-
var __awaiter$
|
6800
|
+
var __awaiter$p = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
6801
6801
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
6802
6802
|
return new (P || (P = Promise))(function (resolve, reject) {
|
6803
6803
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -6831,7 +6831,7 @@ const ChatMessageComponent = (props) => {
|
|
6831
6831
|
return React__default['default'].createElement(React__default['default'].Fragment, null);
|
6832
6832
|
}
|
6833
6833
|
else if (isEditing) {
|
6834
|
-
return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { message: message, inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text, metadata, options) => __awaiter$
|
6834
|
+
return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { message: message, inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text, metadata, options) => __awaiter$p(void 0, void 0, void 0, function* () {
|
6835
6835
|
props.onUpdateMessage &&
|
6836
6836
|
props.message.messageId &&
|
6837
6837
|
(yield props.onUpdateMessage(props.message.messageId, text, metadata, options));
|
@@ -6930,7 +6930,7 @@ const getParticipantsWhoHaveReadMessage = (message, readReceiptsBySenderId) => {
|
|
6930
6930
|
|
6931
6931
|
// Copyright (c) Microsoft Corporation.
|
6932
6932
|
// Licensed under the MIT license.
|
6933
|
-
var __awaiter$
|
6933
|
+
var __awaiter$o = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
6934
6934
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
6935
6935
|
return new (P || (P = Promise))(function (resolve, reject) {
|
6936
6936
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -7158,7 +7158,7 @@ const MessageThread = (props) => {
|
|
7158
7158
|
setChatMessagesInitialized(chatMessagesInitialized);
|
7159
7159
|
};
|
7160
7160
|
// we try to only send those message status if user is scrolled to the bottom.
|
7161
|
-
const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$
|
7161
|
+
const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$o(void 0, void 0, void 0, function* () {
|
7162
7162
|
if (!isAtBottomOfScrollRef.current ||
|
7163
7163
|
!document.hasFocus() ||
|
7164
7164
|
!messagesRef.current ||
|
@@ -7209,7 +7209,7 @@ const MessageThread = (props) => {
|
|
7209
7209
|
setIsAtBottomOfScrollRef(atBottom);
|
7210
7210
|
}, [scrollToBottom, sendMessageStatusIfAtBottom]);
|
7211
7211
|
// Infinite scrolling + threadInitialize function
|
7212
|
-
const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$
|
7212
|
+
const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$o(void 0, void 0, void 0, function* () {
|
7213
7213
|
if (!isLoadingChatMessagesRef.current) {
|
7214
7214
|
if (onLoadPreviousChatMessages) {
|
7215
7215
|
isLoadingChatMessagesRef.current = true;
|
@@ -10963,7 +10963,7 @@ const DevicesButton = (props) => {
|
|
10963
10963
|
|
10964
10964
|
// Copyright (c) Microsoft Corporation.
|
10965
10965
|
// Licensed under the MIT license.
|
10966
|
-
var __awaiter$
|
10966
|
+
var __awaiter$n = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
10967
10967
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
10968
10968
|
return new (P || (P = Promise))(function (resolve, reject) {
|
10969
10969
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -11001,7 +11001,7 @@ const CameraButton = (props) => {
|
|
11001
11001
|
const toggleAnnouncerString = React.useCallback((isCameraOn) => {
|
11002
11002
|
setAnnouncerString(!isCameraOn ? strings.cameraActionTurnedOffAnnouncement : strings.cameraActionTurnedOnAnnouncement);
|
11003
11003
|
}, [strings.cameraActionTurnedOffAnnouncement, strings.cameraActionTurnedOnAnnouncement]);
|
11004
|
-
const onToggleClick = React.useCallback(() => __awaiter$
|
11004
|
+
const onToggleClick = React.useCallback(() => __awaiter$n(void 0, void 0, void 0, function* () {
|
11005
11005
|
// Throttle click on camera, need to await onToggleCamera then allow another click
|
11006
11006
|
if (onToggleCamera) {
|
11007
11007
|
setWaitForCamera(true);
|
@@ -11133,7 +11133,7 @@ const lightThemeCallButtonStyles = {
|
|
11133
11133
|
|
11134
11134
|
// Copyright (c) Microsoft Corporation.
|
11135
11135
|
// Licensed under the MIT license.
|
11136
|
-
var __awaiter$
|
11136
|
+
var __awaiter$m = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
11137
11137
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
11138
11138
|
return new (P || (P = Promise))(function (resolve, reject) {
|
11139
11139
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -11174,7 +11174,7 @@ const MicrophoneButton = (props) => {
|
|
11174
11174
|
const toggleAnnouncerString = React.useCallback((isMicOn) => {
|
11175
11175
|
setAnnouncerString(!isMicOn ? strings.microphoneActionTurnedOffAnnouncement : strings.microphoneActionTurnedOnAnnouncement);
|
11176
11176
|
}, [strings.microphoneActionTurnedOffAnnouncement, strings.microphoneActionTurnedOnAnnouncement]);
|
11177
|
-
const onToggleClick = React.useCallback(() => __awaiter$
|
11177
|
+
const onToggleClick = React.useCallback(() => __awaiter$m(void 0, void 0, void 0, function* () {
|
11178
11178
|
if (onToggleMicrophone) {
|
11179
11179
|
try {
|
11180
11180
|
yield onToggleMicrophone();
|
@@ -12035,7 +12035,7 @@ const formatPhoneNumber = (phoneNumber) => {
|
|
12035
12035
|
|
12036
12036
|
// Copyright (c) Microsoft Corporation.
|
12037
12037
|
// Licensed under the MIT license.
|
12038
|
-
var __awaiter$
|
12038
|
+
var __awaiter$l = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
12039
12039
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
12040
12040
|
return new (P || (P = Promise))(function (resolve, reject) {
|
12041
12041
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -12077,10 +12077,10 @@ const DialpadButton = (props) => {
|
|
12077
12077
|
const theme = react.useTheme();
|
12078
12078
|
const { digit, index, onClick, onLongPress, isMobile = false } = props;
|
12079
12079
|
const useLongPressProps = React__default['default'].useMemo(() => ({
|
12080
|
-
onClick: () => __awaiter$
|
12080
|
+
onClick: () => __awaiter$l(void 0, void 0, void 0, function* () {
|
12081
12081
|
onClick(digit, index);
|
12082
12082
|
}),
|
12083
|
-
onLongPress: () => __awaiter$
|
12083
|
+
onLongPress: () => __awaiter$l(void 0, void 0, void 0, function* () {
|
12084
12084
|
onLongPress(digit, index);
|
12085
12085
|
}),
|
12086
12086
|
touchEventsOnly: isMobile
|
@@ -12995,7 +12995,7 @@ const findConditionalCompiledSelector = (component) => {
|
|
12995
12995
|
|
12996
12996
|
// Copyright (c) Microsoft Corporation.
|
12997
12997
|
// Licensed under the MIT license.
|
12998
|
-
var __awaiter$
|
12998
|
+
var __awaiter$k = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
12999
12999
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
13000
13000
|
return new (P || (P = Promise))(function (resolve, reject) {
|
13001
13001
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -13018,35 +13018,35 @@ const createDefaultChatHandlers = memoizeOne__default['default']((chatClient, ch
|
|
13018
13018
|
let messageIterator = undefined;
|
13019
13019
|
let readReceiptIterator = undefined;
|
13020
13020
|
return {
|
13021
|
-
onSendMessage: (content, options) => __awaiter$
|
13021
|
+
onSendMessage: (content, options) => __awaiter$k(void 0, void 0, void 0, function* () {
|
13022
13022
|
const sendMessageRequest = {
|
13023
13023
|
content,
|
13024
13024
|
senderDisplayName: chatClient.getState().displayName
|
13025
13025
|
};
|
13026
13026
|
yield chatThreadClient.sendMessage(sendMessageRequest, options);
|
13027
13027
|
}),
|
13028
|
-
onUpdateMessage: (messageId, content, metadata, options) => __awaiter$
|
13028
|
+
onUpdateMessage: (messageId, content, metadata, options) => __awaiter$k(void 0, void 0, void 0, function* () {
|
13029
13029
|
const updatedMetadata = metadata ? Object.assign({}, metadata) : {};
|
13030
13030
|
updatedMetadata['fileSharingMetadata'] = JSON.stringify((options === null || options === void 0 ? void 0 : options.attachedFilesMetadata) || []);
|
13031
13031
|
yield chatThreadClient.updateMessage(messageId, { content, metadata: updatedMetadata });
|
13032
13032
|
}),
|
13033
|
-
onDeleteMessage: (messageId) => __awaiter$
|
13033
|
+
onDeleteMessage: (messageId) => __awaiter$k(void 0, void 0, void 0, function* () {
|
13034
13034
|
yield chatThreadClient.deleteMessage(messageId);
|
13035
13035
|
}),
|
13036
13036
|
// This handler is designed for chatThread to consume
|
13037
|
-
onMessageSeen: (chatMessageId) => __awaiter$
|
13037
|
+
onMessageSeen: (chatMessageId) => __awaiter$k(void 0, void 0, void 0, function* () {
|
13038
13038
|
yield chatThreadClient.sendReadReceipt({ chatMessageId });
|
13039
13039
|
}),
|
13040
|
-
onTyping: () => __awaiter$
|
13040
|
+
onTyping: () => __awaiter$k(void 0, void 0, void 0, function* () {
|
13041
13041
|
yield chatThreadClient.sendTypingNotification();
|
13042
13042
|
}),
|
13043
|
-
onRemoveParticipant: (userId) => __awaiter$
|
13043
|
+
onRemoveParticipant: (userId) => __awaiter$k(void 0, void 0, void 0, function* () {
|
13044
13044
|
yield chatThreadClient.removeParticipant(fromFlatCommunicationIdentifier(userId));
|
13045
13045
|
}),
|
13046
|
-
updateThreadTopicName: (topicName) => __awaiter$
|
13046
|
+
updateThreadTopicName: (topicName) => __awaiter$k(void 0, void 0, void 0, function* () {
|
13047
13047
|
yield chatThreadClient.updateTopic(topicName);
|
13048
13048
|
}),
|
13049
|
-
onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$
|
13049
|
+
onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$k(void 0, void 0, void 0, function* () {
|
13050
13050
|
var _a, _b, _c;
|
13051
13051
|
if (messageIterator === undefined) {
|
13052
13052
|
// Lazy definition so that errors in the method call are reported correctly.
|
@@ -13783,7 +13783,7 @@ const chatStatefulLogger = logger.createClientLogger('communication-react:chat-s
|
|
13783
13783
|
|
13784
13784
|
// Copyright (c) Microsoft Corporation.
|
13785
13785
|
// Licensed under the MIT license.
|
13786
|
-
var __awaiter$
|
13786
|
+
var __awaiter$j = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
13787
13787
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
13788
13788
|
return new (P || (P = Promise))(function (resolve, reject) {
|
13789
13789
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -14058,7 +14058,7 @@ class ChatContext$1 {
|
|
14058
14058
|
* @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.
|
14059
14059
|
*/
|
14060
14060
|
withAsyncErrorTeedToState(f, target) {
|
14061
|
-
return (...args) => __awaiter$
|
14061
|
+
return (...args) => __awaiter$j(this, void 0, void 0, function* () {
|
14062
14062
|
try {
|
14063
14063
|
return yield f(...args);
|
14064
14064
|
}
|
@@ -14165,7 +14165,7 @@ const convertChatMessage = (message, status = 'delivered', clientMessageId) => {
|
|
14165
14165
|
|
14166
14166
|
// Copyright (c) Microsoft Corporation.
|
14167
14167
|
// Licensed under the MIT license.
|
14168
|
-
var __awaiter$
|
14168
|
+
var __awaiter$i = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
14169
14169
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
14170
14170
|
return new (P || (P = Promise))(function (resolve, reject) {
|
14171
14171
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -14249,7 +14249,7 @@ class EventSubscriber {
|
|
14249
14249
|
this.fetchLastParticipantMessage(event.threadId, 'participantAdded');
|
14250
14250
|
};
|
14251
14251
|
// This is a hot fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK
|
14252
|
-
this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$
|
14252
|
+
this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$i(this, void 0, void 0, function* () {
|
14253
14253
|
var e_1, _a;
|
14254
14254
|
try {
|
14255
14255
|
for (var _b = __asyncValues$1(this.chatClient
|
@@ -14335,7 +14335,7 @@ class EventSubscriber {
|
|
14335
14335
|
|
14336
14336
|
// Copyright (c) Microsoft Corporation.
|
14337
14337
|
// Licensed under the MIT license.
|
14338
|
-
var __awaiter$
|
14338
|
+
var __awaiter$h = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
14339
14339
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
14340
14340
|
return new (P || (P = Promise))(function (resolve, reject) {
|
14341
14341
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -14357,7 +14357,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
|
|
14357
14357
|
const threadsIterator = iteratorCreator(...args);
|
14358
14358
|
return {
|
14359
14359
|
next() {
|
14360
|
-
return __awaiter$
|
14360
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
14361
14361
|
const result = yield threadsIterator.next();
|
14362
14362
|
if (!result.done && result.value) {
|
14363
14363
|
decorateFn(result.value, context);
|
@@ -14372,7 +14372,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
|
|
14372
14372
|
const pages = threadsIterator.byPage(settings);
|
14373
14373
|
return {
|
14374
14374
|
next() {
|
14375
|
-
return __awaiter$
|
14375
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
14376
14376
|
const result = yield pages.next();
|
14377
14377
|
const page = result.value;
|
14378
14378
|
if (!result.done && result.value) {
|
@@ -14456,7 +14456,7 @@ const createDecoratedListParticipants = (chatThreadClient, context) => {
|
|
14456
14456
|
|
14457
14457
|
// Copyright (c) Microsoft Corporation.
|
14458
14458
|
// Licensed under the MIT license.
|
14459
|
-
var __awaiter$
|
14459
|
+
var __awaiter$g = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
14460
14460
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
14461
14461
|
return new (P || (P = Promise))(function (resolve, reject) {
|
14462
14462
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -14475,14 +14475,14 @@ class ProxyChatThreadClient {
|
|
14475
14475
|
return createDecoratedListMessages(chatThreadClient, this._context);
|
14476
14476
|
}
|
14477
14477
|
case 'getMessage': {
|
14478
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
14478
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$g(this, void 0, void 0, function* () {
|
14479
14479
|
const message = yield chatThreadClient.getMessage(...args);
|
14480
14480
|
this._context.setChatMessage(chatThreadClient.threadId, convertChatMessage(message));
|
14481
14481
|
return message;
|
14482
14482
|
}), 'ChatThreadClient.getMessage');
|
14483
14483
|
}
|
14484
14484
|
case 'sendMessage': {
|
14485
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
14485
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$g(this, void 0, void 0, function* () {
|
14486
14486
|
// Retry logic?
|
14487
14487
|
const [request, options] = args;
|
14488
14488
|
const { content } = request;
|
@@ -14522,7 +14522,7 @@ class ProxyChatThreadClient {
|
|
14522
14522
|
}), 'ChatThreadClient.sendMessage');
|
14523
14523
|
}
|
14524
14524
|
case 'addParticipants': {
|
14525
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
14525
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$g(this, void 0, void 0, function* () {
|
14526
14526
|
const result = yield chatThreadClient.addParticipants(...args);
|
14527
14527
|
const [addRequest] = args;
|
14528
14528
|
const participantsToAdd = addRequest.participants;
|
@@ -14531,7 +14531,7 @@ class ProxyChatThreadClient {
|
|
14531
14531
|
}), 'ChatThreadClient.addParticipants');
|
14532
14532
|
}
|
14533
14533
|
case 'deleteMessage': {
|
14534
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
14534
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$g(this, void 0, void 0, function* () {
|
14535
14535
|
// DeleteMessage is able to either delete local one(for failed message) or synced message
|
14536
14536
|
const [messageId] = args;
|
14537
14537
|
if (this._context.deleteLocalMessage(chatThreadClient.threadId, messageId)) {
|
@@ -14549,12 +14549,12 @@ class ProxyChatThreadClient {
|
|
14549
14549
|
return createDecoratedListReadReceipts(chatThreadClient, this._context);
|
14550
14550
|
}
|
14551
14551
|
case 'sendTypingNotification': {
|
14552
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
14552
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$g(this, void 0, void 0, function* () {
|
14553
14553
|
return yield chatThreadClient.sendTypingNotification(...args);
|
14554
14554
|
}), 'ChatThreadClient.sendTypingNotification');
|
14555
14555
|
}
|
14556
14556
|
case 'removeParticipant': {
|
14557
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
14557
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$g(this, void 0, void 0, function* () {
|
14558
14558
|
const result = yield chatThreadClient.removeParticipant(...args);
|
14559
14559
|
const [removeIdentifier] = args;
|
14560
14560
|
this._context.deleteParticipant(chatThreadClient.threadId, communicationCommon.getIdentifierKind(removeIdentifier));
|
@@ -14562,7 +14562,7 @@ class ProxyChatThreadClient {
|
|
14562
14562
|
}), 'ChatThreadClient.removeParticipant');
|
14563
14563
|
}
|
14564
14564
|
case 'updateMessage': {
|
14565
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
14565
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$g(this, void 0, void 0, function* () {
|
14566
14566
|
const result = yield chatThreadClient.updateMessage(...args);
|
14567
14567
|
const [messageId, updateOption] = args;
|
14568
14568
|
this._context.updateChatMessageContent(chatThreadClient.threadId, messageId, updateOption === null || updateOption === void 0 ? void 0 : updateOption.content);
|
@@ -14570,7 +14570,7 @@ class ProxyChatThreadClient {
|
|
14570
14570
|
}), 'ChatThreadClient.updateMessage');
|
14571
14571
|
}
|
14572
14572
|
case 'updateTopic': {
|
14573
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
14573
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$g(this, void 0, void 0, function* () {
|
14574
14574
|
const result = yield chatThreadClient.updateTopic(...args);
|
14575
14575
|
const [topic] = args;
|
14576
14576
|
this._context.updateThreadTopic(chatThreadClient.threadId, topic);
|
@@ -14578,7 +14578,7 @@ class ProxyChatThreadClient {
|
|
14578
14578
|
}), 'ChatThreadClient.updateTopic');
|
14579
14579
|
}
|
14580
14580
|
case 'getProperties': {
|
14581
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
14581
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$g(this, void 0, void 0, function* () {
|
14582
14582
|
const result = yield chatThreadClient.getProperties(...args);
|
14583
14583
|
this._context.updateThread(chatThreadClient.threadId, result);
|
14584
14584
|
return result;
|
@@ -14615,7 +14615,7 @@ const createDecoratedListThreads = (chatClient, context) => {
|
|
14615
14615
|
|
14616
14616
|
// Copyright (c) Microsoft Corporation.
|
14617
14617
|
// Licensed under the MIT license.
|
14618
|
-
var __awaiter$
|
14618
|
+
var __awaiter$f = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
14619
14619
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
14620
14620
|
return new (P || (P = Promise))(function (resolve, reject) {
|
14621
14621
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -14634,7 +14634,7 @@ const proxyChatClient = {
|
|
14634
14634
|
switch (prop) {
|
14635
14635
|
case 'createChatThread': {
|
14636
14636
|
return context.withAsyncErrorTeedToState(function (...args) {
|
14637
|
-
return __awaiter$
|
14637
|
+
return __awaiter$f(this, void 0, void 0, function* () {
|
14638
14638
|
const result = yield chatClient.createChatThread(...args);
|
14639
14639
|
const thread = result.chatThread;
|
14640
14640
|
if (thread) {
|
@@ -14647,7 +14647,7 @@ const proxyChatClient = {
|
|
14647
14647
|
}
|
14648
14648
|
case 'deleteChatThread': {
|
14649
14649
|
return context.withAsyncErrorTeedToState(function (...args) {
|
14650
|
-
return __awaiter$
|
14650
|
+
return __awaiter$f(this, void 0, void 0, function* () {
|
14651
14651
|
const result = yield chatClient.deleteChatThread(...args);
|
14652
14652
|
context.deleteThread(args[0]);
|
14653
14653
|
return result;
|
@@ -14667,7 +14667,7 @@ const proxyChatClient = {
|
|
14667
14667
|
}
|
14668
14668
|
case 'startRealtimeNotifications': {
|
14669
14669
|
return context.withAsyncErrorTeedToState(function (...args) {
|
14670
|
-
return __awaiter$
|
14670
|
+
return __awaiter$f(this, void 0, void 0, function* () {
|
14671
14671
|
const ret = yield chatClient.startRealtimeNotifications(...args);
|
14672
14672
|
if (!receiver.eventSubscriber) {
|
14673
14673
|
receiver.eventSubscriber = new EventSubscriber(chatClient, context);
|
@@ -14678,7 +14678,7 @@ const proxyChatClient = {
|
|
14678
14678
|
}
|
14679
14679
|
case 'stopRealtimeNotifications': {
|
14680
14680
|
return context.withAsyncErrorTeedToState(function (...args) {
|
14681
|
-
return __awaiter$
|
14681
|
+
return __awaiter$f(this, void 0, void 0, function* () {
|
14682
14682
|
const ret = yield chatClient.stopRealtimeNotifications(...args);
|
14683
14683
|
if (receiver.eventSubscriber) {
|
14684
14684
|
receiver.eventSubscriber.unsubscribe();
|
@@ -15285,7 +15285,7 @@ const END_CALL_PAGES = [
|
|
15285
15285
|
|
15286
15286
|
// Copyright (c) Microsoft Corporation.
|
15287
15287
|
// Licensed under the MIT license.
|
15288
|
-
var __awaiter$
|
15288
|
+
var __awaiter$e = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
15289
15289
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
15290
15290
|
return new (P || (P = Promise))(function (resolve, reject) {
|
15291
15291
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -15508,7 +15508,7 @@ const isDisabled$2 = (option) => {
|
|
15508
15508
|
/**
|
15509
15509
|
* @returns Permissions state for the camera.
|
15510
15510
|
*/
|
15511
|
-
const queryCameraPermissionFromPermissionsAPI = () => __awaiter$
|
15511
|
+
const queryCameraPermissionFromPermissionsAPI = () => __awaiter$e(void 0, void 0, void 0, function* () {
|
15512
15512
|
try {
|
15513
15513
|
return (yield navigator.permissions.query({ name: 'camera' })).state;
|
15514
15514
|
}
|
@@ -15521,7 +15521,7 @@ const queryCameraPermissionFromPermissionsAPI = () => __awaiter$d(void 0, void 0
|
|
15521
15521
|
/**
|
15522
15522
|
* @returns Permissions state for the microphone.
|
15523
15523
|
*/
|
15524
|
-
const queryMicrophonePermissionFromPermissionsAPI = () => __awaiter$
|
15524
|
+
const queryMicrophonePermissionFromPermissionsAPI = () => __awaiter$e(void 0, void 0, void 0, function* () {
|
15525
15525
|
try {
|
15526
15526
|
return (yield navigator.permissions.query({ name: 'microphone' })).state;
|
15527
15527
|
}
|
@@ -15538,7 +15538,7 @@ const queryMicrophonePermissionFromPermissionsAPI = () => __awaiter$d(void 0, vo
|
|
15538
15538
|
* If permission API is not supported on this browser, permission state is set to unsupported.
|
15539
15539
|
* @private
|
15540
15540
|
*/
|
15541
|
-
const getDevicePermissionState = (setVideoState, setAudioState) => __awaiter$
|
15541
|
+
const getDevicePermissionState = (setVideoState, setAudioState) => __awaiter$e(void 0, void 0, void 0, function* () {
|
15542
15542
|
const [cameraResult, microphoneResult] = yield Promise.all([
|
15543
15543
|
queryCameraPermissionFromPermissionsAPI(),
|
15544
15544
|
queryMicrophonePermissionFromPermissionsAPI()
|
@@ -15573,10 +15573,49 @@ const _isSafari = (environmentInfo) => {
|
|
15573
15573
|
/* @conditional-compile-remove(unsupported-browser) */
|
15574
15574
|
return (environmentInfo === null || environmentInfo === void 0 ? void 0 : environmentInfo.environment.browser) === 'safari';
|
15575
15575
|
};
|
15576
|
+
/**
|
15577
|
+
* @private
|
15578
|
+
* This is the util function to create a participant modifier for remote participantList
|
15579
|
+
* It memoize previous original participant items and only update the changed participant
|
15580
|
+
* It takes in one modifier function to generate one single participant object, it returns undefined if the object keeps unmodified
|
15581
|
+
*/
|
15582
|
+
const createParticipantModifier = (createModifiedParticipant) => {
|
15583
|
+
let previousParticipantState = undefined;
|
15584
|
+
let modifiedParticipants = {};
|
15585
|
+
const memoizedParticipants = {};
|
15586
|
+
return (state) => {
|
15587
|
+
var _a, _b, _c, _d;
|
15588
|
+
// if root state is the same, we don't need to update the participants
|
15589
|
+
if (((_a = state.call) === null || _a === void 0 ? void 0 : _a.remoteParticipants) !== previousParticipantState) {
|
15590
|
+
modifiedParticipants = {};
|
15591
|
+
const originalParticipants = (_b = state.call) === null || _b === void 0 ? void 0 : _b.remoteParticipants;
|
15592
|
+
for (const key in originalParticipants) {
|
15593
|
+
const modifiedParticipant = createModifiedParticipant(key, originalParticipants[key]);
|
15594
|
+
if (modifiedParticipant === undefined) {
|
15595
|
+
modifiedParticipants[key] = originalParticipants[key];
|
15596
|
+
continue;
|
15597
|
+
}
|
15598
|
+
// Generate the new item if original cached item has been changed
|
15599
|
+
if (((_c = memoizedParticipants[key]) === null || _c === void 0 ? void 0 : _c.originalRef) !== originalParticipants[key]) {
|
15600
|
+
memoizedParticipants[key] = {
|
15601
|
+
newParticipant: modifiedParticipant,
|
15602
|
+
originalRef: originalParticipants[key]
|
15603
|
+
};
|
15604
|
+
}
|
15605
|
+
// the modified participant is always coming from the memoized cache, whether is was refreshed
|
15606
|
+
// from the previous closure or not
|
15607
|
+
modifiedParticipants[key] = memoizedParticipants[key].newParticipant;
|
15608
|
+
}
|
15609
|
+
previousParticipantState = (_d = state.call) === null || _d === void 0 ? void 0 : _d.remoteParticipants;
|
15610
|
+
}
|
15611
|
+
return Object.assign(Object.assign({}, state), { call: state.call
|
15612
|
+
? Object.assign(Object.assign({}, state.call), { remoteParticipants: modifiedParticipants }) : undefined });
|
15613
|
+
};
|
15614
|
+
};
|
15576
15615
|
|
15577
15616
|
// Copyright (c) Microsoft Corporation.
|
15578
15617
|
// Licensed under the MIT license.
|
15579
|
-
var __awaiter$
|
15618
|
+
var __awaiter$d = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
15580
15619
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
15581
15620
|
return new (P || (P = Promise))(function (resolve, reject) {
|
15582
15621
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -15702,9 +15741,9 @@ class AzureCommunicationChatAdapter {
|
|
15702
15741
|
this.unsubscribeAllEvents();
|
15703
15742
|
}
|
15704
15743
|
fetchInitialData() {
|
15705
|
-
return __awaiter$
|
15744
|
+
return __awaiter$d(this, void 0, void 0, function* () {
|
15706
15745
|
// If get properties fails we dont want to try to get the participants after.
|
15707
|
-
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
15746
|
+
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$d(this, void 0, void 0, function* () {
|
15708
15747
|
var e_1, _a;
|
15709
15748
|
yield this.chatThreadClient.getProperties();
|
15710
15749
|
try {
|
@@ -15738,8 +15777,8 @@ class AzureCommunicationChatAdapter {
|
|
15738
15777
|
this.context.offStateChange(handler);
|
15739
15778
|
}
|
15740
15779
|
sendMessage(content, options = {}) {
|
15741
|
-
return __awaiter$
|
15742
|
-
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
15780
|
+
return __awaiter$d(this, void 0, void 0, function* () {
|
15781
|
+
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$d(this, void 0, void 0, function* () {
|
15743
15782
|
/* @conditional-compile-remove(file-sharing) */
|
15744
15783
|
options.metadata = Object.assign(Object.assign({}, options.metadata), convertFileUploadsUiStateToMessageMetadata(this.context.getState().fileUploads));
|
15745
15784
|
/* @conditional-compile-remove(file-sharing) */
|
@@ -15756,51 +15795,51 @@ class AzureCommunicationChatAdapter {
|
|
15756
15795
|
});
|
15757
15796
|
}
|
15758
15797
|
sendReadReceipt(chatMessageId) {
|
15759
|
-
return __awaiter$
|
15760
|
-
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
15798
|
+
return __awaiter$d(this, void 0, void 0, function* () {
|
15799
|
+
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$d(this, void 0, void 0, function* () {
|
15761
15800
|
yield this.handlers.onMessageSeen(chatMessageId);
|
15762
15801
|
}));
|
15763
15802
|
});
|
15764
15803
|
}
|
15765
15804
|
sendTypingIndicator() {
|
15766
|
-
return __awaiter$
|
15767
|
-
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
15805
|
+
return __awaiter$d(this, void 0, void 0, function* () {
|
15806
|
+
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$d(this, void 0, void 0, function* () {
|
15768
15807
|
yield this.handlers.onTyping();
|
15769
15808
|
}));
|
15770
15809
|
});
|
15771
15810
|
}
|
15772
15811
|
removeParticipant(userId) {
|
15773
|
-
return __awaiter$
|
15774
|
-
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
15812
|
+
return __awaiter$d(this, void 0, void 0, function* () {
|
15813
|
+
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$d(this, void 0, void 0, function* () {
|
15775
15814
|
yield this.handlers.onRemoveParticipant(userId);
|
15776
15815
|
}));
|
15777
15816
|
});
|
15778
15817
|
}
|
15779
15818
|
setTopic(topicName) {
|
15780
|
-
return __awaiter$
|
15781
|
-
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
15819
|
+
return __awaiter$d(this, void 0, void 0, function* () {
|
15820
|
+
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$d(this, void 0, void 0, function* () {
|
15782
15821
|
yield this.handlers.updateThreadTopicName(topicName);
|
15783
15822
|
}));
|
15784
15823
|
});
|
15785
15824
|
}
|
15786
15825
|
loadPreviousChatMessages(messagesToLoad) {
|
15787
|
-
return __awaiter$
|
15788
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
15826
|
+
return __awaiter$d(this, void 0, void 0, function* () {
|
15827
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$d(this, void 0, void 0, function* () {
|
15789
15828
|
return yield this.handlers.onLoadPreviousChatMessages(messagesToLoad);
|
15790
15829
|
}));
|
15791
15830
|
});
|
15792
15831
|
}
|
15793
15832
|
updateMessage(messageId, content, metadata, options) {
|
15794
|
-
return __awaiter$
|
15795
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
15833
|
+
return __awaiter$d(this, void 0, void 0, function* () {
|
15834
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$d(this, void 0, void 0, function* () {
|
15796
15835
|
/* @conditional-compile-remove(file-sharing) */
|
15797
15836
|
return yield this.handlers.onUpdateMessage(messageId, content, metadata, options);
|
15798
15837
|
}));
|
15799
15838
|
});
|
15800
15839
|
}
|
15801
15840
|
deleteMessage(messageId) {
|
15802
|
-
return __awaiter$
|
15803
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
15841
|
+
return __awaiter$d(this, void 0, void 0, function* () {
|
15842
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$d(this, void 0, void 0, function* () {
|
15804
15843
|
return yield this.handlers.onDeleteMessage(messageId);
|
15805
15844
|
}));
|
15806
15845
|
});
|
@@ -15881,7 +15920,7 @@ class AzureCommunicationChatAdapter {
|
|
15881
15920
|
this.emitter.off(event, listener);
|
15882
15921
|
}
|
15883
15922
|
asyncTeeErrorToEventEmitter(f) {
|
15884
|
-
return __awaiter$
|
15923
|
+
return __awaiter$d(this, void 0, void 0, function* () {
|
15885
15924
|
try {
|
15886
15925
|
return yield f();
|
15887
15926
|
}
|
@@ -15923,7 +15962,7 @@ const convertEventType = (type) => {
|
|
15923
15962
|
*
|
15924
15963
|
* @public
|
15925
15964
|
*/
|
15926
|
-
const createAzureCommunicationChatAdapter = ({ endpoint: endpointUrl, userId, displayName, credential, threadId }) => __awaiter$
|
15965
|
+
const createAzureCommunicationChatAdapter = ({ endpoint: endpointUrl, userId, displayName, credential, threadId }) => __awaiter$d(void 0, void 0, void 0, function* () {
|
15927
15966
|
if (!isValidIdentifier(userId)) {
|
15928
15967
|
throw new Error('Provided userId is invalid. Please provide valid identifier object.');
|
15929
15968
|
}
|
@@ -15989,7 +16028,7 @@ beforeDispose) => {
|
|
15989
16028
|
if (!credential || !displayName || !endpoint || !threadId || !userId) {
|
15990
16029
|
return;
|
15991
16030
|
}
|
15992
|
-
(() => __awaiter$
|
16031
|
+
(() => __awaiter$d(void 0, void 0, void 0, function* () {
|
15993
16032
|
if (adapterRef.current) {
|
15994
16033
|
// Dispose the old adapter when a new one is created.
|
15995
16034
|
//
|
@@ -16021,7 +16060,7 @@ beforeDispose) => {
|
|
16021
16060
|
// Dispose any existing adapter when the component unmounts.
|
16022
16061
|
React.useEffect(() => {
|
16023
16062
|
return () => {
|
16024
|
-
(() => __awaiter$
|
16063
|
+
(() => __awaiter$d(void 0, void 0, void 0, function* () {
|
16025
16064
|
if (adapterRef.current) {
|
16026
16065
|
if (beforeDisposeRef.current) {
|
16027
16066
|
yield beforeDisposeRef.current(adapterRef.current);
|
@@ -16042,7 +16081,7 @@ beforeDispose) => {
|
|
16042
16081
|
*
|
16043
16082
|
* @public
|
16044
16083
|
*/
|
16045
|
-
const createAzureCommunicationChatAdapterFromClient = (chatClient, chatThreadClient) => __awaiter$
|
16084
|
+
const createAzureCommunicationChatAdapterFromClient = (chatClient, chatThreadClient) => __awaiter$d(void 0, void 0, void 0, function* () {
|
16046
16085
|
return new AzureCommunicationChatAdapter(chatClient, chatThreadClient);
|
16047
16086
|
});
|
16048
16087
|
const isChatError = (e) => {
|
@@ -16253,7 +16292,7 @@ const sendboxContainerStyles = {
|
|
16253
16292
|
|
16254
16293
|
// Copyright (c) Microsoft Corporation.
|
16255
16294
|
// Licensed under the MIT license.
|
16256
|
-
var __awaiter$
|
16295
|
+
var __awaiter$c = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
16257
16296
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
16258
16297
|
return new (P || (P = Promise))(function (resolve, reject) {
|
16259
16298
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -16274,7 +16313,7 @@ const AvatarPersona = (props) => {
|
|
16274
16313
|
const { userId, dataProvider, text, imageUrl, imageInitials, initialsColor, initialsTextColor, showOverflowTooltip } = props;
|
16275
16314
|
const [data, setData] = React.useState();
|
16276
16315
|
React.useEffect(() => {
|
16277
|
-
(() => __awaiter$
|
16316
|
+
(() => __awaiter$c(void 0, void 0, void 0, function* () {
|
16278
16317
|
if (dataProvider && userId) {
|
16279
16318
|
const newData = yield dataProvider(userId);
|
16280
16319
|
if (avatarDeepDifferenceCheck(data, newData)) {
|
@@ -16848,7 +16887,7 @@ const adaptCompositeState = (compositeState) => {
|
|
16848
16887
|
|
16849
16888
|
// Copyright (c) Microsoft Corporation.
|
16850
16889
|
// Licensed under the MIT license.
|
16851
|
-
var __awaiter$
|
16890
|
+
var __awaiter$b = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
16852
16891
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
16853
16892
|
return new (P || (P = Promise))(function (resolve, reject) {
|
16854
16893
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -16867,76 +16906,76 @@ _component) => {
|
|
16867
16906
|
return createCompositeHandlers(useAdapter());
|
16868
16907
|
};
|
16869
16908
|
const createCompositeHandlers = memoizeOne__default['default']((adapter) => ({
|
16870
|
-
onCreateLocalStreamView: (options) => __awaiter$
|
16909
|
+
onCreateLocalStreamView: (options) => __awaiter$b(void 0, void 0, void 0, function* () {
|
16871
16910
|
return yield adapter.createStreamView(undefined, options);
|
16872
16911
|
}),
|
16873
|
-
onCreateRemoteStreamView: (userId, options) => __awaiter$
|
16912
|
+
onCreateRemoteStreamView: (userId, options) => __awaiter$b(void 0, void 0, void 0, function* () {
|
16874
16913
|
return yield adapter.createStreamView(userId, options);
|
16875
16914
|
}),
|
16876
|
-
onHangUp: (forEveryone) => __awaiter$
|
16915
|
+
onHangUp: (forEveryone) => __awaiter$b(void 0, void 0, void 0, function* () {
|
16877
16916
|
yield adapter.leaveCall(forEveryone);
|
16878
16917
|
}),
|
16879
16918
|
/* @conditional-compile-remove(PSTN-calls) */
|
16880
|
-
onToggleHold: () => __awaiter$
|
16919
|
+
onToggleHold: () => __awaiter$b(void 0, void 0, void 0, function* () {
|
16881
16920
|
var _a;
|
16882
16921
|
return ((_a = adapter.getState().call) === null || _a === void 0 ? void 0 : _a.state) === 'LocalHold' ? yield adapter.resumeCall() : yield adapter.holdCall();
|
16883
16922
|
}),
|
16884
16923
|
/* @conditional-compile-remove(PSTN-calls) */
|
16885
|
-
onAddParticipant: (participant, options) => __awaiter$
|
16924
|
+
onAddParticipant: (participant, options) => __awaiter$b(void 0, void 0, void 0, function* () {
|
16886
16925
|
return yield adapter.addParticipant(participant, options);
|
16887
16926
|
}),
|
16888
16927
|
/* @conditional-compile-remove(PSTN-calls) */
|
16889
|
-
onSendDtmfTone: (dtmfTone) => __awaiter$
|
16928
|
+
onSendDtmfTone: (dtmfTone) => __awaiter$b(void 0, void 0, void 0, function* () {
|
16890
16929
|
yield adapter.sendDtmfTone(dtmfTone);
|
16891
16930
|
}),
|
16892
|
-
onRemoveParticipant: (userId) => __awaiter$
|
16931
|
+
onRemoveParticipant: (userId) => __awaiter$b(void 0, void 0, void 0, function* () {
|
16893
16932
|
yield adapter.removeParticipant(userId);
|
16894
16933
|
}),
|
16895
|
-
onSelectCamera: (deviceInfo, options) => __awaiter$
|
16934
|
+
onSelectCamera: (deviceInfo, options) => __awaiter$b(void 0, void 0, void 0, function* () {
|
16896
16935
|
yield adapter.setCamera(deviceInfo, options);
|
16897
16936
|
}),
|
16898
|
-
onSelectMicrophone: (deviceInfo) => __awaiter$
|
16937
|
+
onSelectMicrophone: (deviceInfo) => __awaiter$b(void 0, void 0, void 0, function* () {
|
16899
16938
|
yield adapter.setMicrophone(deviceInfo);
|
16900
16939
|
}),
|
16901
|
-
onSelectSpeaker: (deviceInfo) => __awaiter$
|
16940
|
+
onSelectSpeaker: (deviceInfo) => __awaiter$b(void 0, void 0, void 0, function* () {
|
16902
16941
|
yield adapter.setSpeaker(deviceInfo);
|
16903
16942
|
}),
|
16904
16943
|
onStartCall: (participants, options) => {
|
16905
16944
|
const rawIds = participants.map((participant) => toFlatCommunicationIdentifier(participant));
|
16906
16945
|
return adapter.startCall(rawIds, options);
|
16907
16946
|
},
|
16908
|
-
onStartScreenShare: () => __awaiter$
|
16947
|
+
onStartScreenShare: () => __awaiter$b(void 0, void 0, void 0, function* () {
|
16909
16948
|
yield adapter.startScreenShare();
|
16910
16949
|
}),
|
16911
|
-
onStopScreenShare: () => __awaiter$
|
16950
|
+
onStopScreenShare: () => __awaiter$b(void 0, void 0, void 0, function* () {
|
16912
16951
|
yield adapter.stopScreenShare();
|
16913
16952
|
}),
|
16914
|
-
onToggleCamera: (options) => __awaiter$
|
16953
|
+
onToggleCamera: (options) => __awaiter$b(void 0, void 0, void 0, function* () {
|
16915
16954
|
isCameraOn(adapter.getState()) ? yield adapter.stopCamera() : yield adapter.startCamera(options);
|
16916
16955
|
}),
|
16917
|
-
onToggleMicrophone: () => __awaiter$
|
16956
|
+
onToggleMicrophone: () => __awaiter$b(void 0, void 0, void 0, function* () {
|
16918
16957
|
var _b;
|
16919
16958
|
return ((_b = adapter.getState().call) === null || _b === void 0 ? void 0 : _b.isMuted) ? yield adapter.unmute() : yield adapter.mute();
|
16920
16959
|
}),
|
16921
|
-
onToggleScreenShare: () => __awaiter$
|
16960
|
+
onToggleScreenShare: () => __awaiter$b(void 0, void 0, void 0, function* () {
|
16922
16961
|
var _c;
|
16923
16962
|
return ((_c = adapter.getState().call) === null || _c === void 0 ? void 0 : _c.isScreenSharingOn)
|
16924
16963
|
? yield adapter.stopScreenShare()
|
16925
16964
|
: yield adapter.startScreenShare();
|
16926
16965
|
}),
|
16927
|
-
onStartLocalVideo: () => __awaiter$
|
16966
|
+
onStartLocalVideo: () => __awaiter$b(void 0, void 0, void 0, function* () {
|
16928
16967
|
if (adapter.getState().call) {
|
16929
16968
|
return adapter.startCamera();
|
16930
16969
|
}
|
16931
16970
|
}),
|
16932
|
-
onDisposeLocalStreamView: () => __awaiter$
|
16971
|
+
onDisposeLocalStreamView: () => __awaiter$b(void 0, void 0, void 0, function* () {
|
16933
16972
|
return adapter.disposeStreamView();
|
16934
16973
|
}),
|
16935
|
-
onDisposeRemoteStreamView: (userId) => __awaiter$
|
16974
|
+
onDisposeRemoteStreamView: (userId) => __awaiter$b(void 0, void 0, void 0, function* () {
|
16936
16975
|
return adapter.disposeStreamView(userId);
|
16937
16976
|
}),
|
16938
16977
|
/* @conditional-compile-remove(call-readiness) */
|
16939
|
-
askDevicePermission: (constrain) => __awaiter$
|
16978
|
+
askDevicePermission: (constrain) => __awaiter$b(void 0, void 0, void 0, function* () {
|
16940
16979
|
return adapter.askDevicePermission(constrain);
|
16941
16980
|
})
|
16942
16981
|
}));
|
@@ -18290,7 +18329,7 @@ const AddPeopleButton = (props) => {
|
|
18290
18329
|
|
18291
18330
|
// Copyright (c) Microsoft Corporation.
|
18292
18331
|
// Licensed under the MIT license.
|
18293
|
-
var __awaiter$
|
18332
|
+
var __awaiter$a = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
18294
18333
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
18295
18334
|
return new (P || (P = Promise))(function (resolve, reject) {
|
18296
18335
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -18326,7 +18365,7 @@ const PeoplePaneContent = (props) => {
|
|
18326
18365
|
setDrawerMenuItems
|
18327
18366
|
]);
|
18328
18367
|
const participantListProps = React.useMemo(() => {
|
18329
|
-
const onRemoveAParticipant = (participantId) => __awaiter$
|
18368
|
+
const onRemoveAParticipant = (participantId) => __awaiter$a(void 0, void 0, void 0, function* () { return onRemoveParticipant(participantId); });
|
18330
18369
|
return Object.assign(Object.assign({}, participantListDefaultProps), {
|
18331
18370
|
// Passing undefined callback for mobile to avoid context menus for participants in ParticipantList are clicked
|
18332
18371
|
onRemoveParticipant: props.mobileView ? undefined : onRemoveAParticipant,
|
@@ -18525,7 +18564,7 @@ const useMinMaxDragPosition = (modalLayerHostId, rtl) => {
|
|
18525
18564
|
return { minDragPosition: minDragPosition, maxDragPosition: maxDragPosition };
|
18526
18565
|
};
|
18527
18566
|
|
18528
|
-
var __awaiter$
|
18567
|
+
var __awaiter$9 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
18529
18568
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
18530
18569
|
return new (P || (P = Promise))(function (resolve, reject) {
|
18531
18570
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -18555,11 +18594,11 @@ const CallPane = (props) => {
|
|
18555
18594
|
/**
|
18556
18595
|
* In a Call Composite when a participant is removed, we must remove them from the call.
|
18557
18596
|
*/
|
18558
|
-
const removeParticipantFromCall = (participantId) => __awaiter$
|
18597
|
+
const removeParticipantFromCall = (participantId) => __awaiter$9(void 0, void 0, void 0, function* () {
|
18559
18598
|
yield props.callAdapter.removeParticipant(participantId);
|
18560
18599
|
});
|
18561
18600
|
/* @conditional-compile-remove(PSTN-calls) */
|
18562
|
-
const addParticipantToCall = (participant, options) => __awaiter$
|
18601
|
+
const addParticipantToCall = (participant, options) => __awaiter$9(void 0, void 0, void 0, function* () {
|
18563
18602
|
yield props.callAdapter.addParticipant(participant, options);
|
18564
18603
|
});
|
18565
18604
|
const minMaxDragPosition = useMinMaxDragPosition(props.modalLayerHostId, props.rtl);
|
@@ -19477,7 +19516,7 @@ const localPreviewTileStyle = {
|
|
19477
19516
|
|
19478
19517
|
// Copyright (c) Microsoft Corporation.
|
19479
19518
|
// Licensed under the MIT license.
|
19480
|
-
var __awaiter$
|
19519
|
+
var __awaiter$8 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
19481
19520
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
19482
19521
|
return new (P || (P = Promise))(function (resolve, reject) {
|
19483
19522
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -19497,7 +19536,7 @@ const LocalPreview = (props) => {
|
|
19497
19536
|
const { audio: microphonePermissionGranted, video: cameraPermissionGranted } = useSelector$1(devicePermissionSelector);
|
19498
19537
|
const isLocalMicrophoneEnabled = useSelector$1(getLocalMicrophoneEnabled);
|
19499
19538
|
const adapter = useAdapter();
|
19500
|
-
const onToggleMic = React.useCallback(() => __awaiter$
|
19539
|
+
const onToggleMic = React.useCallback(() => __awaiter$8(void 0, void 0, void 0, function* () {
|
19501
19540
|
isLocalMicrophoneEnabled ? adapter.mute() : adapter.unmute();
|
19502
19541
|
}), [adapter, isLocalMicrophoneEnabled]);
|
19503
19542
|
const hasNoDevices = devicesButtonProps.cameras.length === 0 &&
|
@@ -20267,7 +20306,7 @@ const holdPaneContentStyles = {
|
|
20267
20306
|
|
20268
20307
|
// Copyright (c) Microsoft Corporation.
|
20269
20308
|
// Licensed under the MIT license.
|
20270
|
-
var __awaiter$
|
20309
|
+
var __awaiter$7 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
20271
20310
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
20272
20311
|
return new (P || (P = Promise))(function (resolve, reject) {
|
20273
20312
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -20302,7 +20341,7 @@ const HoldPane = () => {
|
|
20302
20341
|
React__default['default'].createElement(react.Stack, { horizontal: true, styles: holdPaneContentStyles },
|
20303
20342
|
React__default['default'].createElement(react.Text, { styles: holdPaneTimerStyles }, elapsedTime),
|
20304
20343
|
React__default['default'].createElement(react.Text, { styles: holdPaneLabelStyles }, strings.holdScreenLabel),
|
20305
|
-
React__default['default'].createElement(react.PrimaryButton, { text: !resumingCall ? strings.resumeCallButtonLabel : strings.resumingCallButtonLabel, ariaLabel: !resumingCall ? strings.resumeCallButtonAriaLabel : strings.resumingCallButtonAriaLabel, styles: resumeButtonStyles, disabled: resumingCall, onClick: () => __awaiter$
|
20344
|
+
React__default['default'].createElement(react.PrimaryButton, { text: !resumingCall ? strings.resumeCallButtonLabel : strings.resumingCallButtonLabel, ariaLabel: !resumingCall ? strings.resumeCallButtonAriaLabel : strings.resumingCallButtonAriaLabel, styles: resumeButtonStyles, disabled: resumingCall, onClick: () => __awaiter$7(void 0, void 0, void 0, function* () {
|
20306
20345
|
setResumingCall(true);
|
20307
20346
|
try {
|
20308
20347
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
@@ -20420,7 +20459,7 @@ const containerStyles = {
|
|
20420
20459
|
|
20421
20460
|
// Copyright (c) Microsoft Corporation.
|
20422
20461
|
// Licensed under the MIT license.
|
20423
|
-
var __awaiter$
|
20462
|
+
var __awaiter$6 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
20424
20463
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
20425
20464
|
return new (P || (P = Promise))(function (resolve, reject) {
|
20426
20465
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -20522,7 +20561,7 @@ const CallComposite = (props) => {
|
|
20522
20561
|
/* @conditional-compile-remove(rooms) */
|
20523
20562
|
const roleHint = adapter.getState().roleHint;
|
20524
20563
|
React.useEffect(() => {
|
20525
|
-
(() => __awaiter$
|
20564
|
+
(() => __awaiter$6(void 0, void 0, void 0, function* () {
|
20526
20565
|
const constrain = getQueryOptions({
|
20527
20566
|
/* @conditional-compile-remove(rooms) */ role: roleHint
|
20528
20567
|
});
|
@@ -20663,6 +20702,50 @@ const createHandlers = (callClient, callAgent, deviceManager, call) => {
|
|
20663
20702
|
throw new Error('Unhandled agent type');
|
20664
20703
|
};
|
20665
20704
|
|
20705
|
+
// Copyright (c) Microsoft Corporation.
|
20706
|
+
// Licensed under the MIT license.
|
20707
|
+
var __awaiter$5 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
20708
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
20709
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
20710
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
20711
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
20712
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
20713
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
20714
|
+
});
|
20715
|
+
};
|
20716
|
+
/**
|
20717
|
+
* @private
|
20718
|
+
*/
|
20719
|
+
const createProfileStateModifier = (onFetchProfile, notifyUpdate) => {
|
20720
|
+
const cachedDisplayName = {};
|
20721
|
+
return (state) => {
|
20722
|
+
var _a;
|
20723
|
+
const originalParticipants = (_a = state.call) === null || _a === void 0 ? void 0 : _a.remoteParticipants;
|
20724
|
+
(() => __awaiter$5(void 0, void 0, void 0, function* () {
|
20725
|
+
let shouldNotifyUpdates = false;
|
20726
|
+
for (const key in originalParticipants) {
|
20727
|
+
if (cachedDisplayName[key]) {
|
20728
|
+
continue;
|
20729
|
+
}
|
20730
|
+
const profile = yield onFetchProfile(key);
|
20731
|
+
if ((profile === null || profile === void 0 ? void 0 : profile.displayName) && originalParticipants[key].displayName !== (profile === null || profile === void 0 ? void 0 : profile.displayName)) {
|
20732
|
+
cachedDisplayName[key] = profile === null || profile === void 0 ? void 0 : profile.displayName;
|
20733
|
+
}
|
20734
|
+
shouldNotifyUpdates = true;
|
20735
|
+
}
|
20736
|
+
// notify update only when there is a change, which most likely will trigger modifier and setState again
|
20737
|
+
shouldNotifyUpdates && notifyUpdate();
|
20738
|
+
}))();
|
20739
|
+
const participantsModifier = createParticipantModifier((id, participant) => {
|
20740
|
+
if (cachedDisplayName[id]) {
|
20741
|
+
return Object.assign(Object.assign({}, participant), { displayName: cachedDisplayName[id] });
|
20742
|
+
}
|
20743
|
+
return undefined;
|
20744
|
+
});
|
20745
|
+
return participantsModifier(state);
|
20746
|
+
};
|
20747
|
+
};
|
20748
|
+
|
20666
20749
|
// Copyright (c) Microsoft Corporation.
|
20667
20750
|
// Licensed under the MIT license.
|
20668
20751
|
var __awaiter$4 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
@@ -20696,6 +20779,11 @@ class CallContext {
|
|
20696
20779
|
};
|
20697
20780
|
this.emitter.setMaxListeners((_b = options === null || options === void 0 ? void 0 : options.maxListeners) !== null && _b !== void 0 ? _b : 50);
|
20698
20781
|
this.bindPublicMethods();
|
20782
|
+
this.displayNameModifier = (options === null || options === void 0 ? void 0 : options.onFetchProfile)
|
20783
|
+
? createProfileStateModifier(options.onFetchProfile, () => {
|
20784
|
+
this.setState(this.getState());
|
20785
|
+
})
|
20786
|
+
: undefined;
|
20699
20787
|
}
|
20700
20788
|
bindPublicMethods() {
|
20701
20789
|
/* @conditional-compile-remove(unsupported-browser) */
|
@@ -20708,7 +20796,7 @@ class CallContext {
|
|
20708
20796
|
this.emitter.off('stateChanged', handler);
|
20709
20797
|
}
|
20710
20798
|
setState(state) {
|
20711
|
-
this.state = state;
|
20799
|
+
this.state = this.displayNameModifier ? this.displayNameModifier(state) : state;
|
20712
20800
|
this.emitter.emit('stateChanged', this.state);
|
20713
20801
|
}
|
20714
20802
|
getState() {
|
@@ -21276,14 +21364,14 @@ const createAzureCommunicationCallAdapter = ({ userId, displayName, credential,
|
|
21276
21364
|
/**
|
21277
21365
|
* @beta
|
21278
21366
|
*/
|
21279
|
-
const createTeamsCallAdapter = ({ userId, credential, locator }) => __awaiter$4(void 0, void 0, void 0, function* () {
|
21367
|
+
const createTeamsCallAdapter = ({ userId, credential, locator, options }) => __awaiter$4(void 0, void 0, void 0, function* () {
|
21280
21368
|
const callClient = createStatefulCallClient({
|
21281
21369
|
userId
|
21282
21370
|
});
|
21283
21371
|
const callAgent = yield callClient.createTeamsCallAgent(credential, {
|
21284
21372
|
undefined
|
21285
21373
|
});
|
21286
|
-
const adapter = createTeamsCallAdapterFromClient(callClient, callAgent, locator);
|
21374
|
+
const adapter = createTeamsCallAdapterFromClient(callClient, callAgent, locator, options);
|
21287
21375
|
return adapter;
|
21288
21376
|
});
|
21289
21377
|
/**
|
@@ -21334,6 +21422,11 @@ const useAzureCommunicationCallAdapterGeneric = (args, afterCreate, beforeDispos
|
|
21334
21422
|
if (!displayName) {
|
21335
21423
|
throw new Error('Unreachable code, displayName already checked above.');
|
21336
21424
|
}
|
21425
|
+
// This is just the type check to ensure that roleHint is defined.
|
21426
|
+
/* @conditional-compile-remove(rooms) */
|
21427
|
+
if (options && !('roleHint' in options)) {
|
21428
|
+
throw new Error('Unreachable code, provided a options without roleHint.');
|
21429
|
+
}
|
21337
21430
|
newAdapter = (yield createAzureCommunicationCallAdapter({
|
21338
21431
|
credential,
|
21339
21432
|
displayName: displayName,
|
@@ -21344,11 +21437,17 @@ const useAzureCommunicationCallAdapterGeneric = (args, afterCreate, beforeDispos
|
|
21344
21437
|
}));
|
21345
21438
|
}
|
21346
21439
|
else if (adapterKind === 'Teams') {
|
21440
|
+
// This is just the type check to ensure that roleHint is defined.
|
21441
|
+
/* @conditional-compile-remove(teams-identity-support)) */
|
21442
|
+
if (options && !('onFetchProfile' in options)) {
|
21443
|
+
throw new Error('Unreachable code, provided a options without roleHint.');
|
21444
|
+
}
|
21347
21445
|
/* @conditional-compile-remove(teams-identity-support) */
|
21348
21446
|
newAdapter = (yield createTeamsCallAdapter({
|
21349
21447
|
credential,
|
21350
21448
|
locator: locator,
|
21351
|
-
userId: userId
|
21449
|
+
userId: userId,
|
21450
|
+
options
|
21352
21451
|
}));
|
21353
21452
|
}
|
21354
21453
|
else {
|
@@ -21377,6 +21476,7 @@ const useAzureCommunicationCallAdapterGeneric = (args, afterCreate, beforeDispos
|
|
21377
21476
|
/* @conditional-compile-remove(PSTN-calls) */
|
21378
21477
|
alternateCallerId,
|
21379
21478
|
/* @conditional-compile-remove(rooms) */
|
21479
|
+
/* @conditional-compile-remove(teams-identity-support) */
|
21380
21480
|
options
|
21381
21481
|
]);
|
21382
21482
|
// Dispose any existing adapter when the component unmounts.
|
@@ -21492,11 +21592,11 @@ const createAzureCommunicationCallAdapterFromClient = (callClient, callAgent, lo
|
|
21492
21592
|
*
|
21493
21593
|
* @beta
|
21494
21594
|
*/
|
21495
|
-
const createTeamsCallAdapterFromClient = (callClient, callAgent, locator) => __awaiter$4(void 0, void 0, void 0, function* () {
|
21595
|
+
const createTeamsCallAdapterFromClient = (callClient, callAgent, locator, options) => __awaiter$4(void 0, void 0, void 0, function* () {
|
21496
21596
|
const deviceManager = (yield callClient.getDeviceManager());
|
21497
21597
|
/* @conditional-compile-remove(unsupported-browser) */
|
21498
21598
|
yield callClient.feature(communicationCalling.Features.DebugInfo).getEnvironmentInfo();
|
21499
|
-
return new AzureCommunicationCallAdapter(callClient, locator, callAgent, deviceManager);
|
21599
|
+
return new AzureCommunicationCallAdapter(callClient, locator, callAgent, deviceManager, options);
|
21500
21600
|
});
|
21501
21601
|
const isCallError = (e) => {
|
21502
21602
|
return e['target'] !== undefined && e['innerError'] !== undefined;
|