@azure/communication-react 1.12.1-alpha-202401250013 → 1.12.1-alpha-202401270011
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 +66 -6
- package/dist/dist-cjs/communication-react/index.js +823 -645
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +33 -10
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/ChatContext.d.ts +4 -1
- package/dist/dist-esm/chat-stateful-client/src/ChatContext.js +26 -1
- package/dist/dist-esm/chat-stateful-client/src/ChatContext.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.d.ts +32 -0
- package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js +127 -0
- package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js.map +1 -0
- package/dist/dist-esm/chat-stateful-client/src/StatefulChatClient.js +2 -1
- package/dist/dist-esm/chat-stateful-client/src/StatefulChatClient.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/types/ChatMessageWithStatus.d.ts +1 -0
- package/dist/dist-esm/chat-stateful-client/src/types/ChatMessageWithStatus.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.d.ts +1 -1
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.d.ts +0 -9
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js +0 -4
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.d.ts +0 -9
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js +0 -4
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +0 -3
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +0 -3
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +0 -27
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/FluentChatMessageComponentWrapper.js +0 -13
- package/dist/dist-esm/react-components/src/components/ChatMessage/FluentChatMessageComponentWrapper.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/LocalVideoTile.d.ts +2 -0
- package/dist/dist-esm/react-components/src/components/LocalVideoTile.js +6 -2
- package/dist/dist-esm/react-components/src/components/LocalVideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +0 -7
- package/dist/dist-esm/react-components/src/components/MessageThread.js +0 -28
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ReactionButton.d.ts +5 -0
- package/dist/dist-esm/react-components/src/components/ReactionButton.js +23 -15
- package/dist/dist-esm/react-components/src/components/ReactionButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.d.ts +2 -0
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +5 -2
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.d.ts +5 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +20 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +5 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery.js +14 -5
- package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoTile.d.ts +5 -0
- package/dist/dist-esm/react-components/src/components/VideoTile.js +28 -9
- package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.js +2 -1
- package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js +19 -16
- package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/videoTileStylesUtils.d.ts +0 -5
- package/dist/dist-esm/react-components/src/components/utils/videoTileStylesUtils.js +0 -12
- package/dist/dist-esm/react-components/src/components/utils/videoTileStylesUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/index.d.ts +1 -1
- package/dist/dist-esm/react-components/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/ReactionTypes.d.ts +45 -0
- package/dist/dist-esm/react-components/src/types/ReactionTypes.js +4 -0
- package/dist/dist-esm/react-components/src/types/ReactionTypes.js.map +1 -0
- package/dist/dist-esm/react-components/src/types/index.d.ts +1 -0
- package/dist/dist-esm/react-components/src/types/index.js +1 -0
- package/dist/dist-esm/react-components/src/types/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +2 -1
- 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/CallAdapter.d.ts +6 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +5 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +3 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +8 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Reaction.d.ts +2 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Reaction.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Reaction.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +3 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +1 -13
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +6 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.d.ts +8 -0
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +42 -19
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.d.ts +2 -0
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.js.map +1 -1
- package/package.json +1 -1
@@ -173,7 +173,7 @@ function getDefaultExportFromCjs (x) {
|
|
173
173
|
// Copyright (c) Microsoft Corporation.
|
174
174
|
// Licensed under the MIT License.
|
175
175
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
176
|
-
var telemetryVersion = '1.12.1-alpha-
|
176
|
+
var telemetryVersion = '1.12.1-alpha-202401270011';
|
177
177
|
|
178
178
|
|
179
179
|
var telemetryVersion$1 = /*@__PURE__*/getDefaultExportFromCjs(telemetryVersion);
|
@@ -525,7 +525,7 @@ const getSupportedSpokenLanguages = (state, props) => {
|
|
525
525
|
|
526
526
|
// Copyright (c) Microsoft Corporation.
|
527
527
|
// Licensed under the MIT License.
|
528
|
-
var __awaiter$
|
528
|
+
var __awaiter$P = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
529
529
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
530
530
|
return new (P || (P = Promise))(function (resolve, reject) {
|
531
531
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -564,7 +564,7 @@ const _isPreviewOn = (deviceManager) => {
|
|
564
564
|
*
|
565
565
|
* @private
|
566
566
|
*/
|
567
|
-
const disposeAllLocalPreviewViews = (callClient) => __awaiter$
|
567
|
+
const disposeAllLocalPreviewViews = (callClient) => __awaiter$P(void 0, void 0, void 0, function* () {
|
568
568
|
const unparentedViews = callClient.getState().deviceManager.unparentedViews;
|
569
569
|
for (const view of unparentedViews) {
|
570
570
|
yield callClient.disposeView(undefined, undefined, view);
|
@@ -772,7 +772,7 @@ const holdButtonSelector = reselect__namespace.createSelector([getCallState], (c
|
|
772
772
|
|
773
773
|
// Copyright (c) Microsoft Corporation.
|
774
774
|
// Licensed under the MIT License.
|
775
|
-
var __awaiter$
|
775
|
+
var __awaiter$O = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
776
776
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
777
777
|
return new (P || (P = Promise))(function (resolve, reject) {
|
778
778
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -793,7 +793,7 @@ const areStreamsEqual = (prevStream, newStream) => {
|
|
793
793
|
* @private
|
794
794
|
*/
|
795
795
|
const createDefaultCommonCallingHandlers = memoizeOne((callClient, deviceManager, call, options) => {
|
796
|
-
const onStartLocalVideo = () => __awaiter$
|
796
|
+
const onStartLocalVideo = () => __awaiter$O(void 0, void 0, void 0, function* () {
|
797
797
|
// Before the call object creates a stream, dispose of any local preview streams.
|
798
798
|
// @TODO: is there any way to parent the unparented view to the call object instead
|
799
799
|
// of disposing and creating a new stream?
|
@@ -813,7 +813,7 @@ const createDefaultCommonCallingHandlers = memoizeOne((callClient, deviceManager
|
|
813
813
|
yield call.startVideo(stream);
|
814
814
|
}
|
815
815
|
});
|
816
|
-
const onStopLocalVideo = (stream) => __awaiter$
|
816
|
+
const onStopLocalVideo = (stream) => __awaiter$O(void 0, void 0, void 0, function* () {
|
817
817
|
const callId = call === null || call === void 0 ? void 0 : call.id;
|
818
818
|
if (!callId) {
|
819
819
|
return;
|
@@ -822,7 +822,7 @@ const createDefaultCommonCallingHandlers = memoizeOne((callClient, deviceManager
|
|
822
822
|
yield call.stopVideo(stream);
|
823
823
|
}
|
824
824
|
});
|
825
|
-
const onToggleCamera = (options) => __awaiter$
|
825
|
+
const onToggleCamera = (options) => __awaiter$O(void 0, void 0, void 0, function* () {
|
826
826
|
const previewOn = _isPreviewOn(callClient.getState().deviceManager);
|
827
827
|
// the disposal of the unparented views is to workaround: https://skype.visualstudio.com/SPOOL/_workitems/edit/3030558.
|
828
828
|
// The root cause of the issue is caused by never transitioning the unparented view to the
|
@@ -879,19 +879,19 @@ const createDefaultCommonCallingHandlers = memoizeOne((callClient, deviceManager
|
|
879
879
|
}
|
880
880
|
}
|
881
881
|
});
|
882
|
-
const onSelectMicrophone = (device) => __awaiter$
|
882
|
+
const onSelectMicrophone = (device) => __awaiter$O(void 0, void 0, void 0, function* () {
|
883
883
|
if (!deviceManager) {
|
884
884
|
return;
|
885
885
|
}
|
886
886
|
return deviceManager.selectMicrophone(device);
|
887
887
|
});
|
888
|
-
const onSelectSpeaker = (device) => __awaiter$
|
888
|
+
const onSelectSpeaker = (device) => __awaiter$O(void 0, void 0, void 0, function* () {
|
889
889
|
if (!deviceManager) {
|
890
890
|
return;
|
891
891
|
}
|
892
892
|
return deviceManager.selectSpeaker(device);
|
893
893
|
});
|
894
|
-
const onSelectCamera = (device, options) => __awaiter$
|
894
|
+
const onSelectCamera = (device, options) => __awaiter$O(void 0, void 0, void 0, function* () {
|
895
895
|
if (!deviceManager) {
|
896
896
|
return;
|
897
897
|
}
|
@@ -922,11 +922,11 @@ const createDefaultCommonCallingHandlers = memoizeOne((callClient, deviceManager
|
|
922
922
|
}
|
923
923
|
});
|
924
924
|
/* @conditional-compile-remove(raise-hand) */
|
925
|
-
const onRaiseHand = () => __awaiter$
|
925
|
+
const onRaiseHand = () => __awaiter$O(void 0, void 0, void 0, function* () { var _a; return yield ((_a = call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.RaiseHand)) === null || _a === void 0 ? void 0 : _a.raiseHand()); });
|
926
926
|
/* @conditional-compile-remove(raise-hand) */
|
927
|
-
const onLowerHand = () => __awaiter$
|
927
|
+
const onLowerHand = () => __awaiter$O(void 0, void 0, void 0, function* () { var _b; return yield ((_b = call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.RaiseHand)) === null || _b === void 0 ? void 0 : _b.lowerHand()); });
|
928
928
|
/* @conditional-compile-remove(raise-hand) */
|
929
|
-
const onToggleRaiseHand = () => __awaiter$
|
929
|
+
const onToggleRaiseHand = () => __awaiter$O(void 0, void 0, void 0, function* () {
|
930
930
|
const raiseHandFeature = call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.RaiseHand);
|
931
931
|
const localUserId = callClient.getState().userId;
|
932
932
|
const isLocalRaisedHand = raiseHandFeature === null || raiseHandFeature === void 0 ? void 0 : raiseHandFeature.getRaisedHands().find((publishedState) => toFlatCommunicationIdentifier(publishedState.identifier) === toFlatCommunicationIdentifier(localUserId));
|
@@ -938,7 +938,7 @@ const createDefaultCommonCallingHandlers = memoizeOne((callClient, deviceManager
|
|
938
938
|
}
|
939
939
|
});
|
940
940
|
/* @conditional-compile-remove(reaction) */
|
941
|
-
const onReactionClicked = (reaction) => __awaiter$
|
941
|
+
const onReactionClicked = (reaction) => __awaiter$O(void 0, void 0, void 0, function* () {
|
942
942
|
var _c;
|
943
943
|
if (reaction === 'like' ||
|
944
944
|
reaction === 'applause' ||
|
@@ -952,19 +952,19 @@ const createDefaultCommonCallingHandlers = memoizeOne((callClient, deviceManager
|
|
952
952
|
}
|
953
953
|
return;
|
954
954
|
});
|
955
|
-
const onToggleMicrophone = () => __awaiter$
|
955
|
+
const onToggleMicrophone = () => __awaiter$O(void 0, void 0, void 0, function* () {
|
956
956
|
if (!call || !(_isInCall(call.state) || _isInLobbyOrConnecting(call.state))) {
|
957
957
|
throw new Error(`Please invoke onToggleMicrophone after call is started`);
|
958
958
|
}
|
959
959
|
return call.isMuted ? yield call.unmute() : yield call.mute();
|
960
960
|
});
|
961
|
-
const onStartScreenShare = () => __awaiter$
|
962
|
-
const onStopScreenShare = () => __awaiter$
|
963
|
-
const onToggleScreenShare = () => __awaiter$
|
964
|
-
const onHangUp = (forEveryone) => __awaiter$
|
961
|
+
const onStartScreenShare = () => __awaiter$O(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
|
962
|
+
const onStopScreenShare = () => __awaiter$O(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
|
963
|
+
const onToggleScreenShare = () => __awaiter$O(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.isScreenSharingOn) ? yield onStopScreenShare() : yield onStartScreenShare(); });
|
964
|
+
const onHangUp = (forEveryone) => __awaiter$O(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.hangUp({ forEveryone: forEveryone === true ? true : false })); });
|
965
965
|
/* @conditional-compile-remove(PSTN-calls) */
|
966
|
-
const onToggleHold = () => __awaiter$
|
967
|
-
const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$
|
966
|
+
const onToggleHold = () => __awaiter$O(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()); });
|
967
|
+
const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$O(void 0, void 0, void 0, function* () {
|
968
968
|
var _d;
|
969
969
|
if (!call || call.localVideoStreams.length === 0) {
|
970
970
|
return;
|
@@ -980,7 +980,7 @@ const createDefaultCommonCallingHandlers = memoizeOne((callClient, deviceManager
|
|
980
980
|
const { view } = (_d = (yield callClient.createView(call.id, undefined, localStream, options))) !== null && _d !== void 0 ? _d : {};
|
981
981
|
return view ? { view } : undefined;
|
982
982
|
});
|
983
|
-
const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$
|
983
|
+
const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$O(void 0, void 0, void 0, function* () {
|
984
984
|
if (!call) {
|
985
985
|
return;
|
986
986
|
}
|
@@ -1011,7 +1011,7 @@ const createDefaultCommonCallingHandlers = memoizeOne((callClient, deviceManager
|
|
1011
1011
|
}
|
1012
1012
|
return (createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view) ? { view: createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view } : undefined;
|
1013
1013
|
});
|
1014
|
-
const onDisposeRemoteStreamView = (userId) => __awaiter$
|
1014
|
+
const onDisposeRemoteStreamView = (userId) => __awaiter$O(void 0, void 0, void 0, function* () {
|
1015
1015
|
if (!call) {
|
1016
1016
|
return;
|
1017
1017
|
}
|
@@ -1032,7 +1032,7 @@ const createDefaultCommonCallingHandlers = memoizeOne((callClient, deviceManager
|
|
1032
1032
|
callClient.disposeView(call.id, participant.identifier, screenShareStream);
|
1033
1033
|
}
|
1034
1034
|
});
|
1035
|
-
const onDisposeRemoteVideoStreamView = (userId) => __awaiter$
|
1035
|
+
const onDisposeRemoteVideoStreamView = (userId) => __awaiter$O(void 0, void 0, void 0, function* () {
|
1036
1036
|
if (!call) {
|
1037
1037
|
return;
|
1038
1038
|
}
|
@@ -1049,7 +1049,7 @@ const createDefaultCommonCallingHandlers = memoizeOne((callClient, deviceManager
|
|
1049
1049
|
callClient.disposeView(call.id, participant.identifier, remoteVideoStream);
|
1050
1050
|
}
|
1051
1051
|
});
|
1052
|
-
const onDisposeRemoteScreenShareStreamView = (userId) => __awaiter$
|
1052
|
+
const onDisposeRemoteScreenShareStreamView = (userId) => __awaiter$O(void 0, void 0, void 0, function* () {
|
1053
1053
|
if (!call) {
|
1054
1054
|
return;
|
1055
1055
|
}
|
@@ -1066,7 +1066,7 @@ const createDefaultCommonCallingHandlers = memoizeOne((callClient, deviceManager
|
|
1066
1066
|
callClient.disposeView(call.id, participant.identifier, screenShareStream);
|
1067
1067
|
}
|
1068
1068
|
});
|
1069
|
-
const onDisposeLocalStreamView = () => __awaiter$
|
1069
|
+
const onDisposeLocalStreamView = () => __awaiter$O(void 0, void 0, void 0, function* () {
|
1070
1070
|
// If the user is currently in a call, dispose of the local stream view attached to that call.
|
1071
1071
|
const callState = call && callClient.getState().calls[call.id];
|
1072
1072
|
const localStream = callState === null || callState === void 0 ? void 0 : callState.localVideoStreams.find((item) => item.mediaStreamType === 'Video');
|
@@ -1079,18 +1079,18 @@ const createDefaultCommonCallingHandlers = memoizeOne((callClient, deviceManager
|
|
1079
1079
|
yield disposeAllLocalPreviewViews(callClient);
|
1080
1080
|
});
|
1081
1081
|
/* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */
|
1082
|
-
const onSendDtmfTone = (dtmfTone) => __awaiter$
|
1082
|
+
const onSendDtmfTone = (dtmfTone) => __awaiter$O(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.sendDtmf(dtmfTone)); });
|
1083
1083
|
const notImplemented = () => {
|
1084
1084
|
throw new Error('Not implemented, cannot call a method from an abstract object');
|
1085
1085
|
};
|
1086
1086
|
/* @conditional-compile-remove(call-readiness) */
|
1087
|
-
const askDevicePermission = (constrain) => __awaiter$
|
1087
|
+
const askDevicePermission = (constrain) => __awaiter$O(void 0, void 0, void 0, function* () {
|
1088
1088
|
if (deviceManager) {
|
1089
1089
|
yield (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.askDevicePermission(constrain));
|
1090
1090
|
}
|
1091
1091
|
});
|
1092
1092
|
/* @conditional-compile-remove(video-background-effects) */
|
1093
|
-
const onRemoveVideoBackgroundEffects = () => __awaiter$
|
1093
|
+
const onRemoveVideoBackgroundEffects = () => __awaiter$O(void 0, void 0, void 0, function* () {
|
1094
1094
|
const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
|
1095
1095
|
(deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
|
1096
1096
|
if (stream) {
|
@@ -1103,7 +1103,7 @@ const createDefaultCommonCallingHandlers = memoizeOne((callClient, deviceManager
|
|
1103
1103
|
}
|
1104
1104
|
});
|
1105
1105
|
/* @conditional-compile-remove(video-background-effects) */
|
1106
|
-
const onBlurVideoBackground = (backgroundBlurConfig) => __awaiter$
|
1106
|
+
const onBlurVideoBackground = (backgroundBlurConfig) => __awaiter$O(void 0, void 0, void 0, function* () {
|
1107
1107
|
var _e;
|
1108
1108
|
const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
|
1109
1109
|
(deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
|
@@ -1117,7 +1117,7 @@ const createDefaultCommonCallingHandlers = memoizeOne((callClient, deviceManager
|
|
1117
1117
|
}
|
1118
1118
|
});
|
1119
1119
|
/* @conditional-compile-remove(video-background-effects) */
|
1120
|
-
const onReplaceVideoBackground = (backgroundReplacementConfig) => __awaiter$
|
1120
|
+
const onReplaceVideoBackground = (backgroundReplacementConfig) => __awaiter$O(void 0, void 0, void 0, function* () {
|
1121
1121
|
var _f;
|
1122
1122
|
const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
|
1123
1123
|
(deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
|
@@ -1131,34 +1131,34 @@ const createDefaultCommonCallingHandlers = memoizeOne((callClient, deviceManager
|
|
1131
1131
|
}
|
1132
1132
|
});
|
1133
1133
|
/* @conditional-compile-remove(close-captions) */
|
1134
|
-
const onStartCaptions = (options) => __awaiter$
|
1134
|
+
const onStartCaptions = (options) => __awaiter$O(void 0, void 0, void 0, function* () {
|
1135
1135
|
const captionsFeature = call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.Captions).captions;
|
1136
1136
|
yield (captionsFeature === null || captionsFeature === void 0 ? void 0 : captionsFeature.startCaptions(options));
|
1137
1137
|
});
|
1138
1138
|
/* @conditional-compile-remove(close-captions) */
|
1139
|
-
const onStopCaptions = () => __awaiter$
|
1139
|
+
const onStopCaptions = () => __awaiter$O(void 0, void 0, void 0, function* () {
|
1140
1140
|
const captionsFeature = call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.Captions).captions;
|
1141
1141
|
yield (captionsFeature === null || captionsFeature === void 0 ? void 0 : captionsFeature.stopCaptions());
|
1142
1142
|
});
|
1143
1143
|
/* @conditional-compile-remove(close-captions) */
|
1144
|
-
const onSetSpokenLanguage = (language) => __awaiter$
|
1144
|
+
const onSetSpokenLanguage = (language) => __awaiter$O(void 0, void 0, void 0, function* () {
|
1145
1145
|
const captionsFeature = call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.Captions).captions;
|
1146
1146
|
yield (captionsFeature === null || captionsFeature === void 0 ? void 0 : captionsFeature.setSpokenLanguage(language));
|
1147
1147
|
});
|
1148
1148
|
/* @conditional-compile-remove(close-captions) */
|
1149
|
-
const onSetCaptionLanguage = (language) => __awaiter$
|
1149
|
+
const onSetCaptionLanguage = (language) => __awaiter$O(void 0, void 0, void 0, function* () {
|
1150
1150
|
const captionsFeature = call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.Captions).captions;
|
1151
1151
|
yield captionsFeature.setCaptionLanguage(language);
|
1152
1152
|
});
|
1153
1153
|
/* @conditional-compile-remove(end-of-call-survey) */
|
1154
|
-
const onSubmitSurvey = (survey) => __awaiter$
|
1154
|
+
const onSubmitSurvey = (survey) => __awaiter$O(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.CallSurvey).submitSurvey(survey)); });
|
1155
1155
|
/* @conditional-compile-remove(spotlight) */
|
1156
|
-
const onStartSpotlight = (userId) => __awaiter$
|
1156
|
+
const onStartSpotlight = (userId) => __awaiter$O(void 0, void 0, void 0, function* () {
|
1157
1157
|
const participant = _toCommunicationIdentifier(userId);
|
1158
1158
|
yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.Spotlight).startSpotlight([participant]));
|
1159
1159
|
});
|
1160
1160
|
/* @conditional-compile-remove(spotlight) */
|
1161
|
-
const onStopSpotlight = (userId) => __awaiter$
|
1161
|
+
const onStopSpotlight = (userId) => __awaiter$O(void 0, void 0, void 0, function* () {
|
1162
1162
|
const participant = _toCommunicationIdentifier(userId);
|
1163
1163
|
yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.Spotlight).stopSpotlight([participant]));
|
1164
1164
|
});
|
@@ -1221,7 +1221,7 @@ const createDefaultCommonCallingHandlers = memoizeOne((callClient, deviceManager
|
|
1221
1221
|
|
1222
1222
|
// Copyright (c) Microsoft Corporation.
|
1223
1223
|
// Licensed under the MIT License.
|
1224
|
-
var __awaiter$
|
1224
|
+
var __awaiter$N = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
1225
1225
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
1226
1226
|
return new (P || (P = Promise))(function (resolve, reject) {
|
1227
1227
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -1249,7 +1249,7 @@ const createDefaultCallingHandlers = memoizeOne((...args) => {
|
|
1249
1249
|
return callAgent === null || callAgent === void 0 ? void 0 : callAgent.startCall(participants, options);
|
1250
1250
|
},
|
1251
1251
|
/* @conditional-compile-remove(PSTN-calls) */
|
1252
|
-
onAddParticipant: (userId, options) => __awaiter$
|
1252
|
+
onAddParticipant: (userId, options) => __awaiter$N(void 0, void 0, void 0, function* () {
|
1253
1253
|
const participant = _toCommunicationIdentifier(userId);
|
1254
1254
|
if (communicationCommon.isPhoneNumberIdentifier(participant)) {
|
1255
1255
|
call === null || call === void 0 ? void 0 : call.addParticipant(participant, options);
|
@@ -1257,7 +1257,7 @@ const createDefaultCallingHandlers = memoizeOne((...args) => {
|
|
1257
1257
|
else if (communicationCommon.isCommunicationUserIdentifier(participant) || communicationCommon.isMicrosoftTeamsUserIdentifier(participant)) {
|
1258
1258
|
call === null || call === void 0 ? void 0 : call.addParticipant(participant);
|
1259
1259
|
}
|
1260
|
-
}), onRemoveParticipant: (userId) => __awaiter$
|
1260
|
+
}), onRemoveParticipant: (userId) => __awaiter$N(void 0, void 0, void 0, function* () {
|
1261
1261
|
const participant = _toCommunicationIdentifier(userId);
|
1262
1262
|
yield (call === null || call === void 0 ? void 0 : call.removeParticipant(participant));
|
1263
1263
|
}) });
|
@@ -1265,7 +1265,7 @@ const createDefaultCallingHandlers = memoizeOne((...args) => {
|
|
1265
1265
|
|
1266
1266
|
// Copyright (c) Microsoft Corporation.
|
1267
1267
|
// Licensed under the MIT License.
|
1268
|
-
var __awaiter$
|
1268
|
+
var __awaiter$M = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
1269
1269
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
1270
1270
|
return new (P || (P = Promise))(function (resolve, reject) {
|
1271
1271
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -1297,7 +1297,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne((callClient, callAgent, dev
|
|
1297
1297
|
},
|
1298
1298
|
/* @conditional-compile-remove(teams-identity-support) */
|
1299
1299
|
/* @conditional-compile-remove(PSTN-calls) */
|
1300
|
-
onAddParticipant: (userId, options) => __awaiter$
|
1300
|
+
onAddParticipant: (userId, options) => __awaiter$M(void 0, void 0, void 0, function* () {
|
1301
1301
|
const participant = _toCommunicationIdentifier(userId);
|
1302
1302
|
/* @conditional-compile-remove(teams-identity-support) */
|
1303
1303
|
const threadId = options === null || options === void 0 ? void 0 : options.threadId;
|
@@ -1313,7 +1313,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne((callClient, callAgent, dev
|
|
1313
1313
|
}
|
1314
1314
|
/* @conditional-compile-remove(teams-identity-support) */
|
1315
1315
|
call === null || call === void 0 ? void 0 : call.addParticipant(participant);
|
1316
|
-
}), onRemoveParticipant: (userId) => __awaiter$
|
1316
|
+
}), onRemoveParticipant: (userId) => __awaiter$M(void 0, void 0, void 0, function* () {
|
1317
1317
|
const participant = _toCommunicationIdentifier(userId);
|
1318
1318
|
if (communicationCommon.isCommunicationUserIdentifier(participant)) {
|
1319
1319
|
throw new Error('CommunicationIdentifier in Teams call is not supported!');
|
@@ -1404,7 +1404,7 @@ const getCaptionsSpeakerIdentifier = (captions) => {
|
|
1404
1404
|
|
1405
1405
|
// Copyright (c) Microsoft Corporation.
|
1406
1406
|
// Licensed under the MIT License.
|
1407
|
-
var __awaiter$
|
1407
|
+
var __awaiter$L = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
1408
1408
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
1409
1409
|
return new (P || (P = Promise))(function (resolve, reject) {
|
1410
1410
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -1453,13 +1453,13 @@ class ProxyDeviceManager {
|
|
1453
1453
|
this.selectCamera = (videoDeviceInfo) => {
|
1454
1454
|
this._context.setDeviceManagerSelectedCamera(videoDeviceInfo);
|
1455
1455
|
};
|
1456
|
-
this.videoDevicesUpdated = () => __awaiter$
|
1456
|
+
this.videoDevicesUpdated = () => __awaiter$L(this, void 0, void 0, function* () {
|
1457
1457
|
// Device Manager always has a camera with '' name if there are no real camera devices available.
|
1458
1458
|
// We don't want to show that in the UI.
|
1459
1459
|
const realCameras = (yield this._deviceManager.getCameras()).filter((c) => !!c.name);
|
1460
1460
|
this._context.setDeviceManagerCameras(dedupeById(realCameras));
|
1461
1461
|
});
|
1462
|
-
this.audioDevicesUpdated = () => __awaiter$
|
1462
|
+
this.audioDevicesUpdated = () => __awaiter$L(this, void 0, void 0, function* () {
|
1463
1463
|
this._context.setDeviceManagerMicrophones(dedupeById(yield this._deviceManager.getMicrophones()));
|
1464
1464
|
this._context.setDeviceManagerSpeakers(dedupeById(yield this._deviceManager.getSpeakers()));
|
1465
1465
|
});
|
@@ -1860,7 +1860,7 @@ function convertFromSDKToRaisedHandState(raisedHand) {
|
|
1860
1860
|
|
1861
1861
|
// Copyright (c) Microsoft Corporation.
|
1862
1862
|
// Licensed under the MIT License.
|
1863
|
-
var __awaiter$
|
1863
|
+
var __awaiter$K = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
1864
1864
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
1865
1865
|
return new (P || (P = Promise))(function (resolve, reject) {
|
1866
1866
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -2679,7 +2679,7 @@ let CallContext$2 = class CallContext {
|
|
2679
2679
|
* @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.
|
2680
2680
|
*/
|
2681
2681
|
withAsyncErrorTeedToState(action, target) {
|
2682
|
-
return (...args) => __awaiter$
|
2682
|
+
return (...args) => __awaiter$K(this, void 0, void 0, function* () {
|
2683
2683
|
try {
|
2684
2684
|
return yield action(...args);
|
2685
2685
|
}
|
@@ -3133,7 +3133,7 @@ function _logStreamEvent(eventName, streamLogInfo, error) {
|
|
3133
3133
|
|
3134
3134
|
// Copyright (c) Microsoft Corporation.
|
3135
3135
|
// Licensed under the MIT License.
|
3136
|
-
var __awaiter$
|
3136
|
+
var __awaiter$J = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3137
3137
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3138
3138
|
return new (P || (P = Promise))(function (resolve, reject) {
|
3139
3139
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -3143,7 +3143,7 @@ var __awaiter$I = (window && window.__awaiter) || function (thisArg, _arguments,
|
|
3143
3143
|
});
|
3144
3144
|
};
|
3145
3145
|
function createViewVideo(context, internalContext, callId, stream, participantId, options) {
|
3146
|
-
return __awaiter$
|
3146
|
+
return __awaiter$J(this, void 0, void 0, function* () {
|
3147
3147
|
// we can only have 3 types of createView
|
3148
3148
|
let streamEventType;
|
3149
3149
|
// we will reuse these for local as well but we need to make sure the remote stream is passed in like before.
|
@@ -3272,7 +3272,7 @@ function createViewVideo(context, internalContext, callId, stream, participantId
|
|
3272
3272
|
});
|
3273
3273
|
}
|
3274
3274
|
function createViewUnparentedVideo(context, internalContext, stream, options) {
|
3275
|
-
return __awaiter$
|
3275
|
+
return __awaiter$J(this, void 0, void 0, function* () {
|
3276
3276
|
const renderInfo = internalContext.getUnparentedRenderInfo(stream);
|
3277
3277
|
if (renderInfo && renderInfo.status === 'Rendered') {
|
3278
3278
|
console.warn('Unparented LocalVideoStream is already rendered');
|
@@ -3441,7 +3441,7 @@ function createView(context, internalContext, callId, participantId, stream, opt
|
|
3441
3441
|
// Render LocalVideoStream that is not part of a Call
|
3442
3442
|
// 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).
|
3443
3443
|
// We do not have a startLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.
|
3444
|
-
return context.withAsyncErrorTeedToState(() => __awaiter$
|
3444
|
+
return context.withAsyncErrorTeedToState(() => __awaiter$J(this, void 0, void 0, function* () { return yield createViewUnparentedVideo(context, internalContext, stream, options); }), 'Call.startVideo')();
|
3445
3445
|
}
|
3446
3446
|
else {
|
3447
3447
|
_logStreamEvent(EventNames.CREATE_STREAM_INVALID_PARAMS, { streamType });
|
@@ -4051,7 +4051,7 @@ class CallSubscriber {
|
|
4051
4051
|
|
4052
4052
|
// Copyright (c) Microsoft Corporation.
|
4053
4053
|
// Licensed under the MIT License.
|
4054
|
-
var __awaiter$
|
4054
|
+
var __awaiter$I = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
4055
4055
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4056
4056
|
return new (P || (P = Promise))(function (resolve, reject) {
|
4057
4057
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -4071,14 +4071,14 @@ class ProxyIncomingCall {
|
|
4071
4071
|
switch (prop) {
|
4072
4072
|
case 'accept': {
|
4073
4073
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
4074
|
-
return __awaiter$
|
4074
|
+
return __awaiter$I(this, void 0, void 0, function* () {
|
4075
4075
|
return yield target.accept(...args);
|
4076
4076
|
});
|
4077
4077
|
}, 'IncomingCall.accept');
|
4078
4078
|
}
|
4079
4079
|
case 'reject': {
|
4080
4080
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
4081
|
-
return __awaiter$
|
4081
|
+
return __awaiter$I(this, void 0, void 0, function* () {
|
4082
4082
|
return yield target.reject(...args);
|
4083
4083
|
});
|
4084
4084
|
}, 'IncomingCall.reject');
|
@@ -4319,7 +4319,7 @@ const clearCallRelatedState = (context, internalContext) => {
|
|
4319
4319
|
|
4320
4320
|
// Copyright (c) Microsoft Corporation.
|
4321
4321
|
// Licensed under the MIT License.
|
4322
|
-
var __awaiter$
|
4322
|
+
var __awaiter$H = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
4323
4323
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4324
4324
|
return new (P || (P = Promise))(function (resolve, reject) {
|
4325
4325
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -4345,56 +4345,56 @@ class ProxyCallCommon {
|
|
4345
4345
|
switch (prop) {
|
4346
4346
|
case 'mute': {
|
4347
4347
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
4348
|
-
return __awaiter$
|
4348
|
+
return __awaiter$H(this, void 0, void 0, function* () {
|
4349
4349
|
return yield target.mute(...args);
|
4350
4350
|
});
|
4351
4351
|
}, 'Call.mute');
|
4352
4352
|
}
|
4353
4353
|
case 'unmute': {
|
4354
4354
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
4355
|
-
return __awaiter$
|
4355
|
+
return __awaiter$H(this, void 0, void 0, function* () {
|
4356
4356
|
return yield target.unmute(...args);
|
4357
4357
|
});
|
4358
4358
|
}, 'Call.unmute');
|
4359
4359
|
}
|
4360
4360
|
case 'startVideo': {
|
4361
4361
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
4362
|
-
return __awaiter$
|
4362
|
+
return __awaiter$H(this, void 0, void 0, function* () {
|
4363
4363
|
return yield target.startVideo(...args);
|
4364
4364
|
});
|
4365
4365
|
}, 'Call.startVideo');
|
4366
4366
|
}
|
4367
4367
|
case 'stopVideo': {
|
4368
4368
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
4369
|
-
return __awaiter$
|
4369
|
+
return __awaiter$H(this, void 0, void 0, function* () {
|
4370
4370
|
return yield target.stopVideo(...args);
|
4371
4371
|
});
|
4372
4372
|
}, 'Call.stopVideo');
|
4373
4373
|
}
|
4374
4374
|
case 'startScreenSharing': {
|
4375
4375
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
4376
|
-
return __awaiter$
|
4376
|
+
return __awaiter$H(this, void 0, void 0, function* () {
|
4377
4377
|
return yield target.startScreenSharing(...args);
|
4378
4378
|
});
|
4379
4379
|
}, 'Call.startScreenSharing');
|
4380
4380
|
}
|
4381
4381
|
case 'stopScreenSharing': {
|
4382
4382
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
4383
|
-
return __awaiter$
|
4383
|
+
return __awaiter$H(this, void 0, void 0, function* () {
|
4384
4384
|
return yield target.stopScreenSharing(...args);
|
4385
4385
|
});
|
4386
4386
|
}, 'Call.stopScreenSharing');
|
4387
4387
|
}
|
4388
4388
|
case 'hold': {
|
4389
4389
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
4390
|
-
return __awaiter$
|
4390
|
+
return __awaiter$H(this, void 0, void 0, function* () {
|
4391
4391
|
return yield target.hold(...args);
|
4392
4392
|
});
|
4393
4393
|
}, 'Call.hold');
|
4394
4394
|
}
|
4395
4395
|
case 'resume': {
|
4396
4396
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
4397
|
-
return __awaiter$
|
4397
|
+
return __awaiter$H(this, void 0, void 0, function* () {
|
4398
4398
|
return yield target.resume(...args);
|
4399
4399
|
});
|
4400
4400
|
}, 'Call.resume');
|
@@ -4434,7 +4434,7 @@ class ProxyTeamsCaptions {
|
|
4434
4434
|
get(target, prop) {
|
4435
4435
|
switch (prop) {
|
4436
4436
|
case 'startCaptions':
|
4437
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
4437
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$H(this, void 0, void 0, function* () {
|
4438
4438
|
var _a, _b;
|
4439
4439
|
this._context.setStartCaptionsInProgress(this._call.id, true);
|
4440
4440
|
const ret = yield target.startCaptions(...args);
|
@@ -4442,7 +4442,7 @@ class ProxyTeamsCaptions {
|
|
4442
4442
|
return ret;
|
4443
4443
|
}), 'Call.feature');
|
4444
4444
|
case 'stopCaptions':
|
4445
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
4445
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$H(this, void 0, void 0, function* () {
|
4446
4446
|
const ret = yield target.stopCaptions(...args);
|
4447
4447
|
this._context.setIsCaptionActive(this._call.id, false);
|
4448
4448
|
this._context.setStartCaptionsInProgress(this._call.id, false);
|
@@ -4450,13 +4450,13 @@ class ProxyTeamsCaptions {
|
|
4450
4450
|
return ret;
|
4451
4451
|
}), 'Call.feature');
|
4452
4452
|
case 'setSpokenLanguage':
|
4453
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
4453
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$H(this, void 0, void 0, function* () {
|
4454
4454
|
const ret = yield target.setSpokenLanguage(...args);
|
4455
4455
|
this._context.setSelectedSpokenLanguage(this._call.id, args[0]);
|
4456
4456
|
return ret;
|
4457
4457
|
}), 'Call.feature');
|
4458
4458
|
case 'setCaptionLanguage':
|
4459
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
4459
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$H(this, void 0, void 0, function* () {
|
4460
4460
|
const ret = yield target.setCaptionLanguage(...args);
|
4461
4461
|
this._context.setSelectedCaptionLanguage(this._call.id, args[0]);
|
4462
4462
|
return ret;
|
@@ -4504,7 +4504,7 @@ class ProxyTransferCallFeature {
|
|
4504
4504
|
|
4505
4505
|
// Copyright (c) Microsoft Corporation.
|
4506
4506
|
// Licensed under the MIT License.
|
4507
|
-
var __awaiter$
|
4507
|
+
var __awaiter$G = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
4508
4508
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4509
4509
|
return new (P || (P = Promise))(function (resolve, reject) {
|
4510
4510
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -4518,7 +4518,7 @@ class ProxyCall extends ProxyCallCommon {
|
|
4518
4518
|
switch (prop) {
|
4519
4519
|
case 'addParticipant': {
|
4520
4520
|
return this.getContext().withAsyncErrorTeedToState(function (...args) {
|
4521
|
-
return __awaiter$
|
4521
|
+
return __awaiter$G(this, void 0, void 0, function* () {
|
4522
4522
|
return yield target.addParticipant(...args);
|
4523
4523
|
});
|
4524
4524
|
}, 'Call.addParticipant');
|
@@ -4756,7 +4756,7 @@ class InternalCallContext {
|
|
4756
4756
|
|
4757
4757
|
// Copyright (c) Microsoft Corporation.
|
4758
4758
|
// Licensed under the MIT License.
|
4759
|
-
var __awaiter$
|
4759
|
+
var __awaiter$F = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
4760
4760
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4761
4761
|
return new (P || (P = Promise))(function (resolve, reject) {
|
4762
4762
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -4771,7 +4771,7 @@ class ProxyTeamsCall extends ProxyCallCommon {
|
|
4771
4771
|
switch (prop) {
|
4772
4772
|
case 'addParticipant': {
|
4773
4773
|
return this.getContext().withAsyncErrorTeedToState(function (...args) {
|
4774
|
-
return __awaiter$
|
4774
|
+
return __awaiter$F(this, void 0, void 0, function* () {
|
4775
4775
|
return yield target.addParticipant(...args);
|
4776
4776
|
});
|
4777
4777
|
}, 'TeamsCall.addParticipant');
|
@@ -4888,7 +4888,7 @@ const teamsCallAgentDeclaratify = (callAgent, context, internalContext) => {
|
|
4888
4888
|
|
4889
4889
|
// Copyright (c) Microsoft Corporation.
|
4890
4890
|
// Licensed under the MIT License.
|
4891
|
-
var __awaiter$
|
4891
|
+
var __awaiter$E = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
4892
4892
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4893
4893
|
return new (P || (P = Promise))(function (resolve, reject) {
|
4894
4894
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -4910,7 +4910,7 @@ class ProxyVideoStreamRendererView {
|
|
4910
4910
|
get(target, prop) {
|
4911
4911
|
switch (prop) {
|
4912
4912
|
case 'updateScalingMode': {
|
4913
|
-
return (...args) => __awaiter$
|
4913
|
+
return (...args) => __awaiter$E(this, void 0, void 0, function* () {
|
4914
4914
|
yield target.updateScalingMode(...args);
|
4915
4915
|
this._context.setRemoteVideoStreamViewScalingMode(this._callId, this._participantId, this._streamId, args[0]);
|
4916
4916
|
});
|
@@ -4931,7 +4931,7 @@ const videoStreamRendererViewDeclaratify = (view, context, callId, participantId
|
|
4931
4931
|
|
4932
4932
|
// Copyright (c) Microsoft Corporation.
|
4933
4933
|
// Licensed under the MIT License.
|
4934
|
-
var __awaiter$
|
4934
|
+
var __awaiter$D = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
4935
4935
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4936
4936
|
return new (P || (P = Promise))(function (resolve, reject) {
|
4937
4937
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -4953,7 +4953,7 @@ class ProxyCallClient {
|
|
4953
4953
|
get(target, prop) {
|
4954
4954
|
switch (prop) {
|
4955
4955
|
case 'createCallAgent': {
|
4956
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
4956
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$D(this, void 0, void 0, function* () {
|
4957
4957
|
// createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
|
4958
4958
|
// callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
|
4959
4959
|
// callAgent if the createCallAgent succeeds.
|
@@ -4966,7 +4966,7 @@ class ProxyCallClient {
|
|
4966
4966
|
}), 'CallClient.createCallAgent');
|
4967
4967
|
}
|
4968
4968
|
case 'createTeamsCallAgent': {
|
4969
|
-
/* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
4969
|
+
/* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$D(this, void 0, void 0, function* () {
|
4970
4970
|
// createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
|
4971
4971
|
// callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
|
4972
4972
|
// callAgent if the createCallAgent succeeds.
|
@@ -4979,7 +4979,7 @@ class ProxyCallClient {
|
|
4979
4979
|
}), 'CallClient.createTeamsCallAgent');
|
4980
4980
|
}
|
4981
4981
|
case 'getDeviceManager': {
|
4982
|
-
return this._context.withAsyncErrorTeedToState(() => __awaiter$
|
4982
|
+
return this._context.withAsyncErrorTeedToState(() => __awaiter$D(this, void 0, void 0, function* () {
|
4983
4983
|
// As of writing, the SDK always returns the same instance of DeviceManager so we keep a reference of
|
4984
4984
|
// DeviceManager and if it does not change we return the cached DeclarativeDeviceManager. If it does not we'll
|
4985
4985
|
// throw an error that indicate we need to fix this issue as our implementation has diverged from the SDK.
|
@@ -5008,7 +5008,7 @@ class ProxyCallClient {
|
|
5008
5008
|
/**
|
5009
5009
|
* add to this object if we want to proxy anything else off the DebugInfo feature object.
|
5010
5010
|
*/
|
5011
|
-
return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter$
|
5011
|
+
return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter$D(this, void 0, void 0, function* () {
|
5012
5012
|
const environmentInfo = yield feature.getEnvironmentInfo();
|
5013
5013
|
this._context.setEnvironmentInfo(environmentInfo);
|
5014
5014
|
return environmentInfo;
|
@@ -5069,7 +5069,7 @@ const createStatefulCallClientWithDeps = (callClient, context, internalContext)
|
|
5069
5069
|
});
|
5070
5070
|
Object.defineProperty(callClient, 'createView', {
|
5071
5071
|
configurable: false,
|
5072
|
-
value: (callId, participantId, stream, options) => __awaiter$
|
5072
|
+
value: (callId, participantId, stream, options) => __awaiter$D(void 0, void 0, void 0, function* () {
|
5073
5073
|
const participantIdKind = participantId ? communicationCommon.getIdentifierKind(participantId) : undefined;
|
5074
5074
|
const result = yield createView(context, internalContext, callId, participantIdKind, stream, options);
|
5075
5075
|
// We only need to declaratify the VideoStreamRendererView object for remote participants. Because the updateScalingMode only needs to be called on remote participant stream views.
|
@@ -7618,7 +7618,7 @@ const _MentionPopover = (props) => {
|
|
7618
7618
|
|
7619
7619
|
// Copyright (c) Microsoft Corporation.
|
7620
7620
|
// Licensed under the MIT License.
|
7621
|
-
var __awaiter$
|
7621
|
+
var __awaiter$C = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
7622
7622
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
7623
7623
|
return new (P || (P = Promise))(function (resolve, reject) {
|
7624
7624
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -7804,7 +7804,7 @@ const TextFieldWithMention = (props) => {
|
|
7804
7804
|
onSuggestionSelected,
|
7805
7805
|
updateMentionSuggestions
|
7806
7806
|
]);
|
7807
|
-
const debouncedQueryUpdate = useDebounce.useDebouncedCallback((query) => __awaiter$
|
7807
|
+
const debouncedQueryUpdate = useDebounce.useDebouncedCallback((query) => __awaiter$C(void 0, void 0, void 0, function* () {
|
7808
7808
|
var _a;
|
7809
7809
|
let suggestions = (_a = (yield (mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.onQueryUpdated(query)))) !== null && _a !== void 0 ? _a : [];
|
7810
7810
|
suggestions = suggestions.filter((suggestion) => suggestion.displayText.trim() !== '');
|
@@ -7981,7 +7981,7 @@ const TextFieldWithMention = (props) => {
|
|
7981
7981
|
});
|
7982
7982
|
}
|
7983
7983
|
}, [updateSelectionIndexesWithMentionIfNeeded, setSelectionStartValue, setSelectionEndValue]);
|
7984
|
-
const handleOnChange = React.useCallback(({ currentSelectionEnd, currentSelectionStart, currentTriggerStartIndex, event, htmlTextValue, inputTextValue, previousSelectionEnd, previousSelectionStart, tagsValue, updatedValue }) => __awaiter$
|
7984
|
+
const handleOnChange = React.useCallback(({ currentSelectionEnd, currentSelectionStart, currentTriggerStartIndex, event, htmlTextValue, inputTextValue, previousSelectionEnd, previousSelectionStart, tagsValue, updatedValue }) => __awaiter$C(void 0, void 0, void 0, function* () {
|
7985
7985
|
var _b;
|
7986
7986
|
debouncedQueryUpdate.cancel();
|
7987
7987
|
if (event.currentTarget === null) {
|
@@ -10534,27 +10534,6 @@ const MessageContentWithLiveAria = (props) => {
|
|
10534
10534
|
props.content));
|
10535
10535
|
};
|
10536
10536
|
const MessageContentAsRichTextHTML = (props) => {
|
10537
|
-
const {
|
10538
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10539
|
-
// message is used only in useEffect that is under teams-inline-images-and-file-sharing cc
|
10540
|
-
message,
|
10541
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10542
|
-
attachmentsMap,
|
10543
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10544
|
-
onFetchAttachments } = props;
|
10545
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10546
|
-
React.useEffect(() => {
|
10547
|
-
var _a;
|
10548
|
-
if (!attachmentsMap || !onFetchAttachments) {
|
10549
|
-
return;
|
10550
|
-
}
|
10551
|
-
const attachments = (_a = message.inlineImages) === null || _a === void 0 ? void 0 : _a.filter((inlinedImages) => {
|
10552
|
-
return attachmentsMap[inlinedImages.id] === undefined;
|
10553
|
-
});
|
10554
|
-
if (attachments && attachments.length > 0) {
|
10555
|
-
onFetchAttachments(attachments, message.messageId);
|
10556
|
-
}
|
10557
|
-
}, [message.inlineImages, message.messageId, onFetchAttachments, attachmentsMap]);
|
10558
10537
|
return (React.createElement(MessageContentWithLiveAria, { message: props.message, liveMessage: generateLiveMessage(props), ariaLabel: messageContentAriaText(props), content: processHtmlToReact(props) }));
|
10559
10538
|
};
|
10560
10539
|
const MessageContentAsText = (props) => {
|
@@ -10630,10 +10609,6 @@ const processHtmlToReact = (props) => {
|
|
10630
10609
|
return metadata.id === domNode.attribs.id;
|
10631
10610
|
}))) {
|
10632
10611
|
domNode.attribs['aria-label'] = domNode.attribs.name;
|
10633
|
-
// logic to check id in map/list
|
10634
|
-
if (props.attachmentsMap && domNode.attribs.id in props.attachmentsMap) {
|
10635
|
-
domNode.attribs.src = props.attachmentsMap[domNode.attribs.id];
|
10636
|
-
}
|
10637
10612
|
/* @conditional-compile-remove(image-gallery) */
|
10638
10613
|
const handleOnClick = () => {
|
10639
10614
|
props.onInlineImageClicked && props.onInlineImageClicked(domNode.attribs.id);
|
@@ -10682,7 +10657,7 @@ const chatMessageActionMenuProps = (menuProps) => {
|
|
10682
10657
|
|
10683
10658
|
// Copyright (c) Microsoft Corporation.
|
10684
10659
|
// Licensed under the MIT License.
|
10685
|
-
var __awaiter$
|
10660
|
+
var __awaiter$B = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
10686
10661
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
10687
10662
|
return new (P || (P = Promise))(function (resolve, reject) {
|
10688
10663
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -10725,7 +10700,7 @@ const _FileDownloadCards = (props) => {
|
|
10725
10700
|
fileCount: `${(_c = fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.filter(isFileSharingAttachment).length) !== null && _c !== void 0 ? _c : 0}`
|
10726
10701
|
});
|
10727
10702
|
}, [(_b = props.strings) === null || _b === void 0 ? void 0 : _b.fileCardGroupMessage, localeStrings.fileCardGroupMessage, fileMetadata, isFileSharingAttachment]);
|
10728
|
-
const fileDownloadHandler = React.useCallback((userId, file) => __awaiter$
|
10703
|
+
const fileDownloadHandler = React.useCallback((userId, file) => __awaiter$B(void 0, void 0, void 0, function* () {
|
10729
10704
|
if (!props.downloadHandler) {
|
10730
10705
|
window.open(file.url, '_blank', 'noopener,noreferrer');
|
10731
10706
|
}
|
@@ -10777,7 +10752,7 @@ const useLocaleStringsTrampoline = () => {
|
|
10777
10752
|
|
10778
10753
|
// Copyright (c) Microsoft Corporation.
|
10779
10754
|
// Licensed under the MIT License.
|
10780
|
-
var __awaiter$
|
10755
|
+
var __awaiter$A = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
10781
10756
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
10782
10757
|
return new (P || (P = Promise))(function (resolve, reject) {
|
10783
10758
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -10878,7 +10853,7 @@ const MessageBubble = (props) => {
|
|
10878
10853
|
return undefined;
|
10879
10854
|
}, [editedOn, message.messageType, messageStatus, strings.editedTag, strings.failToSendTag, theme]);
|
10880
10855
|
/* @conditional-compile-remove(image-gallery) */
|
10881
|
-
const handleOnInlineImageClicked = React.useCallback((attachmentId) => __awaiter$
|
10856
|
+
const handleOnInlineImageClicked = React.useCallback((attachmentId) => __awaiter$A(void 0, void 0, void 0, function* () {
|
10882
10857
|
if (onInlineImageClicked === undefined) {
|
10883
10858
|
return;
|
10884
10859
|
}
|
@@ -10892,10 +10867,6 @@ const MessageBubble = (props) => {
|
|
10892
10867
|
}
|
10893
10868
|
return (React.createElement("div", { tabIndex: 0, className: "ui-chat__message__content" },
|
10894
10869
|
React.createElement(ChatMessageContent, { message: message, strings: strings,
|
10895
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10896
|
-
onFetchAttachments: props.onFetchAttachments,
|
10897
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10898
|
-
attachmentsMap: props.attachmentsMap,
|
10899
10870
|
/* @conditional-compile-remove(mention) */
|
10900
10871
|
mentionDisplayOptions: props.mentionDisplayOptions,
|
10901
10872
|
/* @conditional-compile-remove(image-gallery) */
|
@@ -10998,7 +10969,7 @@ const ChatMessageComponentAsMessageBubble = React.memo(MessageBubble);
|
|
10998
10969
|
|
10999
10970
|
// Copyright (c) Microsoft Corporation.
|
11000
10971
|
// Licensed under the MIT License.
|
11001
|
-
var __awaiter$
|
10972
|
+
var __awaiter$z = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
11002
10973
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
11003
10974
|
return new (P || (P = Promise))(function (resolve, reject) {
|
11004
10975
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -11031,7 +11002,7 @@ const ChatMessageComponent = (props) => {
|
|
11031
11002
|
onSendMessage && onSendMessage(content !== undefined ? content : '');
|
11032
11003
|
}, [clientMessageId, content, onSendMessage, onDeleteMessage]);
|
11033
11004
|
if (isEditing && message.messageType === 'chat') {
|
11034
|
-
return (React.createElement(ChatMessageComponentAsEditBox, { message: message, strings: props.strings, onSubmit: (text, metadata, options) => __awaiter$
|
11005
|
+
return (React.createElement(ChatMessageComponentAsEditBox, { message: message, strings: props.strings, onSubmit: (text, metadata, options) => __awaiter$z(void 0, void 0, void 0, function* () {
|
11035
11006
|
props.onUpdateMessage &&
|
11036
11007
|
message.messageId &&
|
11037
11008
|
(yield props.onUpdateMessage(message.messageId, text, metadata, options));
|
@@ -11047,12 +11018,8 @@ const ChatMessageComponent = (props) => {
|
|
11047
11018
|
return (React.createElement(ChatMessageComponentAsMessageBubble, Object.assign({}, props, { onRemoveClick: onRemoveClick, onEditClick: onEditClick, onResendClick: onResendClick, onRenderAvatar: props.onRenderAvatar,
|
11048
11019
|
/* @conditional-compile-remove(date-time-customization) */
|
11049
11020
|
onDisplayDateTimeString: props.onDisplayDateTimeString, strings: props.strings,
|
11050
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11051
|
-
onFetchAttachments: props.onFetchAttachments,
|
11052
11021
|
/* @conditional-compile-remove(image-gallery) */
|
11053
11022
|
onInlineImageClicked: props.onInlineImageClicked,
|
11054
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11055
|
-
attachmentsMap: props.attachmentsMap,
|
11056
11023
|
/* @conditional-compile-remove(mention) */
|
11057
11024
|
mentionDisplayOptions: (_b = props.mentionOptions) === null || _b === void 0 ? void 0 : _b.displayOptions })));
|
11058
11025
|
}
|
@@ -11072,12 +11039,8 @@ const FluentChatMessageComponentWrapper = (props) => {
|
|
11072
11039
|
const { message, styles, shouldOverlapAvatarAndMessage, onRenderMessage, onRenderAvatar, showMessageStatus, onRenderMessageStatus, participantCount, readCount, onActionButtonClick,
|
11073
11040
|
/* @conditional-compile-remove(date-time-customization) */
|
11074
11041
|
onDisplayDateTimeString,
|
11075
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11076
|
-
onFetchInlineAttachment,
|
11077
11042
|
/* @conditional-compile-remove(image-gallery) */
|
11078
11043
|
onInlineImageClicked,
|
11079
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11080
|
-
inlineAttachments,
|
11081
11044
|
/* @conditional-compile-remove(mention) */
|
11082
11045
|
mentionOptions,
|
11083
11046
|
/* @conditional-compile-remove(file-sharing) */
|
@@ -11092,7 +11055,6 @@ const FluentChatMessageComponentWrapper = (props) => {
|
|
11092
11055
|
// To rerender the defaultChatMessageRenderer if app running across days(every new day chat time stamp
|
11093
11056
|
// needs to be regenerated), the dependency on "new Date().toDateString()"" is added.
|
11094
11057
|
const defaultChatMessageRenderer = React.useCallback((messageProps) => {
|
11095
|
-
var _a;
|
11096
11058
|
if (messageProps.message.messageType === 'chat' ||
|
11097
11059
|
/* @conditional-compile-remove(data-loss-prevention) */ messageProps.message.messageType === 'blocked') {
|
11098
11060
|
return (React.createElement(ChatMessageComponent, Object.assign({}, messageProps, {
|
@@ -11102,12 +11064,8 @@ const FluentChatMessageComponentWrapper = (props) => {
|
|
11102
11064
|
strings: messageProps.strings, message: messageProps.message, userId: userId, remoteParticipantsCount: participantCount ? participantCount - 1 : 0, shouldOverlapAvatarAndMessage: shouldOverlapAvatarAndMessage, onRenderAvatar: onRenderAvatar, showMessageStatus: showMessageStatus, messageStatus: messageProps.message.status, onActionButtonClick: onActionButtonClick,
|
11103
11065
|
/* @conditional-compile-remove(date-time-customization) */
|
11104
11066
|
onDisplayDateTimeString: onDisplayDateTimeString,
|
11105
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11106
|
-
onFetchAttachments: onFetchInlineAttachment,
|
11107
11067
|
/* @conditional-compile-remove(image-gallery) */
|
11108
11068
|
onInlineImageClicked: onInlineImageClicked,
|
11109
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11110
|
-
attachmentsMap: (_a = inlineAttachments[messageProps.message.messageId]) !== null && _a !== void 0 ? _a : {},
|
11111
11069
|
/* @conditional-compile-remove(mention) */
|
11112
11070
|
mentionOptions: mentionOptions,
|
11113
11071
|
/* @conditional-compile-remove(file-sharing) */
|
@@ -11124,12 +11082,8 @@ const FluentChatMessageComponentWrapper = (props) => {
|
|
11124
11082
|
userId,
|
11125
11083
|
/* @conditional-compile-remove(date-time-customization) */
|
11126
11084
|
onDisplayDateTimeString,
|
11127
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11128
|
-
onFetchInlineAttachment,
|
11129
11085
|
/* @conditional-compile-remove(image-gallery) */
|
11130
11086
|
onInlineImageClicked,
|
11131
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11132
|
-
inlineAttachments,
|
11133
11087
|
/* @conditional-compile-remove(mention) */
|
11134
11088
|
mentionOptions,
|
11135
11089
|
/* @conditional-compile-remove(file-sharing) */
|
@@ -11342,7 +11296,7 @@ const ChatMessageComponentWrapper = (props) => {
|
|
11342
11296
|
|
11343
11297
|
// Copyright (c) Microsoft Corporation.
|
11344
11298
|
// Licensed under the MIT License.
|
11345
|
-
var __awaiter$
|
11299
|
+
var __awaiter$y = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
11346
11300
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
11347
11301
|
return new (P || (P = Promise))(function (resolve, reject) {
|
11348
11302
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -11487,8 +11441,6 @@ const MessageThreadWrapper = (props) => {
|
|
11487
11441
|
const { messages: newMessages, userId, participantCount, readReceiptsBySenderId, styles, disableJumpToNewMessageButton = false, showMessageDate = false, showMessageStatus = false, numberOfChatMessagesToReload = 5, onMessageSeen, onRenderMessageStatus, onRenderAvatar, onLoadPreviousChatMessages, onRenderJumpToNewMessageButton, onRenderMessage, onUpdateMessage, onCancelEditMessage, onDeleteMessage, onSendMessage,
|
11488
11442
|
/* @conditional-compile-remove(date-time-customization) */
|
11489
11443
|
onDisplayDateTimeString,
|
11490
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11491
|
-
onFetchAttachments,
|
11492
11444
|
/* @conditional-compile-remove(mention) */
|
11493
11445
|
mentionOptions,
|
11494
11446
|
/* @conditional-compile-remove(image-gallery) */
|
@@ -11509,28 +11461,6 @@ const MessageThreadWrapper = (props) => {
|
|
11509
11461
|
const [lastSendingChatMessage, setLastSendingChatMessage] = React.useState(undefined);
|
11510
11462
|
// readCount and participantCount will only need to be updated on-fly when user hover on an indicator
|
11511
11463
|
const [readCountForHoveredIndicator, setReadCountForHoveredIndicator] = React.useState(undefined);
|
11512
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11513
|
-
const [inlineAttachments, setInlineAttachments] = React.useState({});
|
11514
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11515
|
-
const onFetchInlineAttachment = React.useCallback((attachments, messageId) => __awaiter$x(void 0, void 0, void 0, function* () {
|
11516
|
-
if (!onFetchAttachments || attachments.length === 0) {
|
11517
|
-
return;
|
11518
|
-
}
|
11519
|
-
const attachmentDownloadResult = yield onFetchAttachments(attachments);
|
11520
|
-
if (attachmentDownloadResult.length > 0) {
|
11521
|
-
setInlineAttachments((prev) => {
|
11522
|
-
var _a;
|
11523
|
-
// The new state should always be based on the previous one
|
11524
|
-
// otherwise there can be issues with renders
|
11525
|
-
const listOfAttachments = (_a = prev[messageId]) !== null && _a !== void 0 ? _a : {};
|
11526
|
-
for (const result of attachmentDownloadResult) {
|
11527
|
-
const { attachmentId, blobUrl } = result;
|
11528
|
-
listOfAttachments[attachmentId] = blobUrl;
|
11529
|
-
}
|
11530
|
-
return Object.assign(Object.assign({}, prev), { [messageId]: listOfAttachments });
|
11531
|
-
});
|
11532
|
-
}
|
11533
|
-
}), [onFetchAttachments]);
|
11534
11464
|
const localeStrings = useLocale$1().strings.messageThread;
|
11535
11465
|
const strings = React.useMemo(() => (Object.assign(Object.assign({}, localeStrings), props.strings)), [localeStrings, props.strings]);
|
11536
11466
|
// it is required to use useState for messages
|
@@ -11542,7 +11472,7 @@ const MessageThreadWrapper = (props) => {
|
|
11542
11472
|
const previousMessagesRef = React.useRef([]);
|
11543
11473
|
// an aria label for Narrator to notify when a message is deleted
|
11544
11474
|
const [deletedMessageAriaLabel, setDeletedMessageAriaLabel] = React.useState(undefined);
|
11545
|
-
const onDeleteMessageCallback = React.useCallback((messageId) => __awaiter$
|
11475
|
+
const onDeleteMessageCallback = React.useCallback((messageId) => __awaiter$y(void 0, void 0, void 0, function* () {
|
11546
11476
|
if (!onDeleteMessage) {
|
11547
11477
|
return;
|
11548
11478
|
}
|
@@ -11622,7 +11552,7 @@ const MessageThreadWrapper = (props) => {
|
|
11622
11552
|
*/
|
11623
11553
|
const clientHeight = (_a = chatThreadRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight;
|
11624
11554
|
// we try to only send those message status if user is scrolled to the bottom.
|
11625
|
-
const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$
|
11555
|
+
const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$y(void 0, void 0, void 0, function* () {
|
11626
11556
|
if (!isAtBottomOfScrollRef.current ||
|
11627
11557
|
!document.hasFocus() ||
|
11628
11558
|
!messagesRef.current ||
|
@@ -11673,7 +11603,7 @@ const MessageThreadWrapper = (props) => {
|
|
11673
11603
|
setIsAtBottomOfScrollRef(atBottom);
|
11674
11604
|
}, [scrollToBottom, sendMessageStatusIfAtBottom]);
|
11675
11605
|
// Infinite scrolling + threadInitialize function
|
11676
|
-
const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$
|
11606
|
+
const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$y(void 0, void 0, void 0, function* () {
|
11677
11607
|
if (!isLoadingChatMessagesRef.current) {
|
11678
11608
|
if (onLoadPreviousChatMessages) {
|
11679
11609
|
isLoadingChatMessagesRef.current = true;
|
@@ -11829,10 +11759,6 @@ const MessageThreadWrapper = (props) => {
|
|
11829
11759
|
return (React.createElement(MemoChatMessageComponentWrapper, Object.assign({}, message, { userId: userId, key: message.key, styles: styles, shouldOverlapAvatarAndMessage: isNarrow, strings: strings, onRenderAvatar: onRenderAvatar, onRenderMessage: onRenderMessage, onRenderMessageStatus: onRenderMessageStatus, defaultStatusRenderer: defaultStatusRenderer, onActionButtonClick: onActionButtonClickMemo, readCount: readCountForHoveredIndicator, participantCount: participantCount,
|
11830
11760
|
/* @conditional-compile-remove(file-sharing) */
|
11831
11761
|
fileDownloadHandler: props.fileDownloadHandler,
|
11832
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11833
|
-
onFetchInlineAttachment: onFetchInlineAttachment,
|
11834
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11835
|
-
inlineAttachments: inlineAttachments,
|
11836
11762
|
/* @conditional-compile-remove(image-gallery) */
|
11837
11763
|
onInlineImageClicked: onInlineImageClicked,
|
11838
11764
|
/* @conditional-compile-remove(date-time-customization) */
|
@@ -13146,22 +13072,25 @@ const playFrames$1 = react.memoizeFunction(() => react.keyframes({
|
|
13146
13072
|
/**
|
13147
13073
|
* @private
|
13148
13074
|
*/
|
13149
|
-
const reactionRenderingStyle = (args) =>
|
13150
|
-
|
13151
|
-
|
13152
|
-
|
13153
|
-
|
13154
|
-
|
13155
|
-
|
13156
|
-
|
13157
|
-
|
13158
|
-
|
13159
|
-
|
13160
|
-
|
13161
|
-
|
13162
|
-
|
13163
|
-
|
13164
|
-
|
13075
|
+
const reactionRenderingStyle = (args) => {
|
13076
|
+
const imageUrl = `url(${args.spriteImageUrl})`;
|
13077
|
+
return react.mergeStyles({
|
13078
|
+
height: '100%',
|
13079
|
+
width: '100%',
|
13080
|
+
overflow: 'hidden',
|
13081
|
+
animationName: playFrames$1(),
|
13082
|
+
backgroundImage: imageUrl,
|
13083
|
+
animationDuration: '5.12s',
|
13084
|
+
animationTimingFunction: `steps(102)`,
|
13085
|
+
backgroundSize: `cover`,
|
13086
|
+
animationPlayState: 'running',
|
13087
|
+
animationIterationCount: 'infinite',
|
13088
|
+
justifyContent: 'center',
|
13089
|
+
alignItems: 'center',
|
13090
|
+
backgroundPosition: `center`,
|
13091
|
+
transform: `scale(${84 < args.personaSize ? 84 / args.personaSize : args.personaSize / 84})`
|
13092
|
+
});
|
13093
|
+
};
|
13165
13094
|
|
13166
13095
|
// Copyright (c) Microsoft Corporation.
|
13167
13096
|
// Licensed under the MIT License.
|
@@ -13172,18 +13101,6 @@ const getVideoTileOverrideColor = (isVideoRendered, theme, color) => {
|
|
13172
13101
|
// when video is being rendered, the info has a grey-ish background, so no use of theme
|
13173
13102
|
return { color: isVideoRendered ? react.DefaultPalette[color] : theme.palette[color] };
|
13174
13103
|
};
|
13175
|
-
/* @conditional-compile-remove(reaction) */
|
13176
|
-
/**
|
13177
|
-
* Temporary mapping of paths for the reaction emoji resources.
|
13178
|
-
* @private
|
13179
|
-
*/
|
13180
|
-
const reactionEmoji = new Map([
|
13181
|
-
['like', `url('/assets/reactions/likeEmoji.png')`],
|
13182
|
-
['applause', `url('/assets/reactions/clapEmoji.png')`],
|
13183
|
-
['heart', `url('/assets/reactions/heartEmoji.png')`],
|
13184
|
-
['laugh', `url('/assets/reactions/laughEmoji.png')`],
|
13185
|
-
['surprised', `url('/assets/reactions/surprisedEmoji.png')`]
|
13186
|
-
]);
|
13187
13104
|
|
13188
13105
|
// Copyright (c) Microsoft Corporation.
|
13189
13106
|
// Licensed under the MIT License.
|
@@ -13280,99 +13197,345 @@ function useLongPress(props) {
|
|
13280
13197
|
|
13281
13198
|
// Copyright (c) Microsoft Corporation.
|
13282
13199
|
// Licensed under the MIT License.
|
13283
|
-
|
13284
|
-
|
13285
|
-
|
13286
|
-
|
13287
|
-
|
13288
|
-
|
13289
|
-
|
13290
|
-
|
13291
|
-
|
13292
|
-
|
13293
|
-
|
13294
|
-
const videoTileMoreMenuIconProps = { iconName: undefined, style: { display: 'none' } };
|
13295
|
-
/* @conditional-compile-remove(pinned-participants) */
|
13296
|
-
const videoTileMoreMenuProps = {
|
13297
|
-
directionalHint: react.DirectionalHint.topLeftEdge,
|
13298
|
-
isBeakVisible: false,
|
13299
|
-
styles: { container: { maxWidth: '8rem' } }
|
13300
|
-
};
|
13301
|
-
/* @conditional-compile-remove(pinned-participants) */
|
13302
|
-
const VideoTileMoreOptionsButton = (props) => {
|
13303
|
-
const { contextualMenu, canShowContextMenuButton } = props;
|
13304
|
-
if (!contextualMenu) {
|
13305
|
-
return React.createElement(React.Fragment, null);
|
13200
|
+
/**
|
13201
|
+
* Calculates the participants that should be rendered based on the list of dominant
|
13202
|
+
* speakers and currently rendered participants in a call.
|
13203
|
+
* @param args - SmartDominantSpeakerParticipantsArgs
|
13204
|
+
* @returns VideoGalleryRemoteParticipant[] {@link @azure/communication-react#VideoGalleryRemoteParticipant}
|
13205
|
+
*/
|
13206
|
+
const smartDominantSpeakerParticipants = (args) => {
|
13207
|
+
const { participants, dominantSpeakers = [], lastVisibleParticipants = [], maxDominantSpeakers } = args;
|
13208
|
+
// Don't apply any logic if total number of video streams is less than max dominant speakers.
|
13209
|
+
if (participants.length <= maxDominantSpeakers) {
|
13210
|
+
return participants;
|
13306
13211
|
}
|
13307
|
-
const
|
13308
|
-
|
13212
|
+
const participantsMap = participantsById(participants);
|
13213
|
+
// Only use the Max allowed dominant speakers that exist in participants
|
13214
|
+
const dominantSpeakerIds = dominantSpeakers.filter((id) => !!participantsMap[id]).slice(0, maxDominantSpeakers);
|
13215
|
+
const newVisibleParticipantIds = lastVisibleParticipants.map((p) => p.userId).slice(0, maxDominantSpeakers);
|
13216
|
+
const newDominantSpeakerIds = dominantSpeakerIds.filter((id) => !newVisibleParticipantIds.includes(id));
|
13217
|
+
// Remove participants that are no longer dominant and replace them with new dominant speakers.
|
13218
|
+
for (let index = 0; index < maxDominantSpeakers; index++) {
|
13219
|
+
const newVisibleParticipantId = newVisibleParticipantIds[index];
|
13220
|
+
if (newVisibleParticipantId === undefined || !dominantSpeakerIds.includes(newVisibleParticipantId)) {
|
13221
|
+
const replacement = newDominantSpeakerIds.shift();
|
13222
|
+
if (!replacement) {
|
13223
|
+
break;
|
13224
|
+
}
|
13225
|
+
newVisibleParticipantIds[index] = replacement;
|
13226
|
+
}
|
13227
|
+
}
|
13228
|
+
let newVisibleParticipants = newVisibleParticipantIds
|
13229
|
+
.map((participantId) => participantsMap[participantId])
|
13230
|
+
.filter((p) => p !== undefined);
|
13231
|
+
const newVisibleParticipantIdsSet = new Set(newVisibleParticipantIds);
|
13232
|
+
const remainingParticipants = participants.filter((p) => !newVisibleParticipantIdsSet.has(p.userId));
|
13233
|
+
newVisibleParticipants = newVisibleParticipants.concat(remainingParticipants);
|
13234
|
+
return newVisibleParticipants;
|
13309
13235
|
};
|
13310
13236
|
/**
|
13311
|
-
*
|
13312
|
-
*
|
13313
|
-
* Use with {@link GridLayout} in a {@link VideoGallery}.
|
13314
|
-
*
|
13315
|
-
* @public
|
13237
|
+
* maps the participants array to an object with userId as key
|
13238
|
+
* @private
|
13316
13239
|
*/
|
13317
|
-
const
|
13318
|
-
const
|
13319
|
-
|
13320
|
-
|
13321
|
-
|
13322
|
-
|
13323
|
-
|
13324
|
-
|
13325
|
-
|
13326
|
-
|
13327
|
-
|
13328
|
-
|
13329
|
-
|
13330
|
-
const
|
13331
|
-
|
13332
|
-
const [
|
13333
|
-
|
13334
|
-
|
13335
|
-
const
|
13336
|
-
|
13337
|
-
|
13338
|
-
|
13339
|
-
const observer = React.useRef(new ResizeObserver((entries) => {
|
13340
|
-
const { width, height } = entries[0].contentRect;
|
13341
|
-
const personaCalcSize = Math.min(width, height) / 3;
|
13342
|
-
// we only want to set the persona size if it has changed
|
13343
|
-
if (personaCalcSize !== personaSize) {
|
13344
|
-
setPersonaSize(Math.max(Math.min(personaCalcSize, personaMaxSize), personaMinSize));
|
13240
|
+
const participantsById = (participants) => {
|
13241
|
+
const response = {};
|
13242
|
+
participants.forEach((p) => (response[p.userId] = p));
|
13243
|
+
return response;
|
13244
|
+
};
|
13245
|
+
|
13246
|
+
// Copyright (c) Microsoft Corporation.
|
13247
|
+
// Licensed under the MIT License.
|
13248
|
+
const DEFAULT_MAX_OVERFLOW_GALLERY_DOMINANT_SPEAKERS = 6;
|
13249
|
+
const DEFAULT_MAX_VIDEO_SREAMS = 4;
|
13250
|
+
/* @conditional-compile-remove(gallery-layouts) */
|
13251
|
+
const MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY = 9;
|
13252
|
+
const _useOrganizedParticipants = (props) => {
|
13253
|
+
const visibleGridParticipants = React.useRef([]);
|
13254
|
+
const visibleOverflowGalleryParticipants = React.useRef([]);
|
13255
|
+
const { remoteParticipants = [], localParticipant, dominantSpeakers = [], maxRemoteVideoStreams = DEFAULT_MAX_VIDEO_SREAMS, maxOverflowGalleryDominantSpeakers = DEFAULT_MAX_OVERFLOW_GALLERY_DOMINANT_SPEAKERS, isScreenShareActive = false, pinnedParticipantUserIds = [],
|
13256
|
+
/* @conditional-compile-remove(gallery-layouts) */
|
13257
|
+
layout } = props;
|
13258
|
+
const calculateMaxRemoteVideoStreams = () => {
|
13259
|
+
/* @conditional-compile-remove(gallery-layouts) */
|
13260
|
+
if (maxRemoteVideoStreams > MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY) {
|
13261
|
+
return MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY;
|
13345
13262
|
}
|
13346
|
-
|
13347
|
-
|
13348
|
-
if (videoTileRef.current) {
|
13349
|
-
observer.current.observe(videoTileRef.current);
|
13263
|
+
else {
|
13264
|
+
return maxRemoteVideoStreams;
|
13350
13265
|
}
|
13351
|
-
|
13352
|
-
|
13353
|
-
|
13354
|
-
|
13355
|
-
|
13356
|
-
return
|
13357
|
-
|
13358
|
-
|
13359
|
-
|
13360
|
-
|
13361
|
-
|
13362
|
-
|
13363
|
-
|
13364
|
-
|
13365
|
-
|
13366
|
-
|
13367
|
-
|
13368
|
-
|
13369
|
-
|
13370
|
-
|
13371
|
-
|
13372
|
-
|
13373
|
-
|
13374
|
-
|
13375
|
-
|
13266
|
+
};
|
13267
|
+
const maxRemoteVideoStreamsToUse = calculateMaxRemoteVideoStreams();
|
13268
|
+
const videoParticipants = remoteParticipants.filter((p) => { var _a; return (_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable; });
|
13269
|
+
const participantsToSortTrampoline = () => {
|
13270
|
+
/* @conditional-compile-remove(gallery-layouts) */
|
13271
|
+
return layout !== 'floatingLocalVideo' ? putVideoParticipantsFirst(remoteParticipants) : videoParticipants;
|
13272
|
+
};
|
13273
|
+
visibleGridParticipants.current =
|
13274
|
+
pinnedParticipantUserIds.length > 0 || isScreenShareActive
|
13275
|
+
? []
|
13276
|
+
: smartDominantSpeakerParticipants({
|
13277
|
+
participants: participantsToSortTrampoline(),
|
13278
|
+
dominantSpeakers,
|
13279
|
+
lastVisibleParticipants: visibleGridParticipants.current,
|
13280
|
+
maxDominantSpeakers: maxRemoteVideoStreamsToUse
|
13281
|
+
}).slice(0, maxRemoteVideoStreamsToUse);
|
13282
|
+
/* @conditional-compile-remove(gallery-layouts) */
|
13283
|
+
const dominantSpeakerToGrid = layout === 'speaker'
|
13284
|
+
? dominantSpeakers && dominantSpeakers[0]
|
13285
|
+
? visibleGridParticipants.current.filter((p) => p.userId === dominantSpeakers[0])
|
13286
|
+
: [visibleGridParticipants.current[0]]
|
13287
|
+
: [];
|
13288
|
+
/* @conditional-compile-remove(gallery-layouts) */
|
13289
|
+
if (dominantSpeakerToGrid[0]) {
|
13290
|
+
visibleGridParticipants.current = dominantSpeakerToGrid;
|
13291
|
+
}
|
13292
|
+
const visibleGridParticipantsSet = new Set(visibleGridParticipants.current.map((p) => p.userId));
|
13293
|
+
const remoteParticipantsOrdered = putVideoParticipantsFirst(remoteParticipants);
|
13294
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
13295
|
+
const callingParticipants = remoteParticipantsOrdered.filter((p) => p.state === ('Connecting' ));
|
13296
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
13297
|
+
const callingParticipantsSet = new Set(callingParticipants.map((p) => p.userId));
|
13298
|
+
visibleOverflowGalleryParticipants.current = smartDominantSpeakerParticipants({
|
13299
|
+
participants: remoteParticipantsOrdered.filter((p) => !visibleGridParticipantsSet.has(p.userId) &&
|
13300
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ !callingParticipantsSet.has(p.userId)),
|
13301
|
+
dominantSpeakers: dominantSpeakers,
|
13302
|
+
lastVisibleParticipants: visibleOverflowGalleryParticipants.current,
|
13303
|
+
maxDominantSpeakers: maxOverflowGalleryDominantSpeakers
|
13304
|
+
});
|
13305
|
+
const getGridParticipants = React.useCallback(() => {
|
13306
|
+
if (isScreenShareActive) {
|
13307
|
+
return [];
|
13308
|
+
}
|
13309
|
+
// if we have no grid participants we need to cap the max number of overflowGallery participants in the grid
|
13310
|
+
// we will use the max streams provided to the function to find the max participants that can go in the grid
|
13311
|
+
// if there are less participants than max streams then we will use all participants including joining in the grid
|
13312
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
13313
|
+
return visibleGridParticipants.current.length > 0
|
13314
|
+
? visibleGridParticipants.current
|
13315
|
+
: visibleOverflowGalleryParticipants.current.length > maxRemoteVideoStreamsToUse
|
13316
|
+
? visibleOverflowGalleryParticipants.current.slice(0, maxRemoteVideoStreamsToUse)
|
13317
|
+
: visibleOverflowGalleryParticipants.current.slice(0, maxRemoteVideoStreamsToUse).concat(callingParticipants);
|
13318
|
+
}, [
|
13319
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ callingParticipants,
|
13320
|
+
isScreenShareActive,
|
13321
|
+
maxRemoteVideoStreamsToUse
|
13322
|
+
]);
|
13323
|
+
const gridParticipants = getGridParticipants();
|
13324
|
+
const getOverflowGalleryRemoteParticipants = React.useCallback(() => {
|
13325
|
+
if (isScreenShareActive && localParticipant) {
|
13326
|
+
const localParticipantPlusOverflow = [localParticipant].concat(visibleGridParticipants.current.concat(visibleOverflowGalleryParticipants.current));
|
13327
|
+
// If screen sharing is active, assign video and audio participants as overflow gallery participants
|
13328
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
13329
|
+
return localParticipantPlusOverflow.concat(callingParticipants);
|
13330
|
+
}
|
13331
|
+
else if (isScreenShareActive) {
|
13332
|
+
// If screen sharing is active, assign video and audio participants as overflow gallery participants
|
13333
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
13334
|
+
return visibleGridParticipants.current.concat(visibleOverflowGalleryParticipants.current.concat(callingParticipants));
|
13335
|
+
}
|
13336
|
+
else {
|
13337
|
+
// If screen sharing is not active, then assign all video tiles as grid tiles.
|
13338
|
+
// If there are no video tiles, then assign audio tiles as grid tiles.
|
13339
|
+
// if there are more overflow tiles than max streams then find the tiles that don't fit in the grid and put them in overflow
|
13340
|
+
// overflow should be empty if total participants including calling participants is less than max streams
|
13341
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
13342
|
+
return visibleGridParticipants.current.length > 0
|
13343
|
+
? visibleOverflowGalleryParticipants.current.concat(callingParticipants)
|
13344
|
+
: visibleOverflowGalleryParticipants.current.length > maxRemoteVideoStreamsToUse
|
13345
|
+
? visibleOverflowGalleryParticipants.current.slice(maxRemoteVideoStreamsToUse).concat(callingParticipants)
|
13346
|
+
: [];
|
13347
|
+
}
|
13348
|
+
}, [
|
13349
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ callingParticipants,
|
13350
|
+
isScreenShareActive,
|
13351
|
+
localParticipant,
|
13352
|
+
maxRemoteVideoStreamsToUse
|
13353
|
+
]);
|
13354
|
+
const overflowGalleryParticipants = getOverflowGalleryRemoteParticipants();
|
13355
|
+
return { gridParticipants, overflowGalleryParticipants: overflowGalleryParticipants };
|
13356
|
+
};
|
13357
|
+
/* @conditional-compile-remove(pinned-participants) */
|
13358
|
+
const _useOrganizedParticipantsWithFocusedParticipants = (props) => {
|
13359
|
+
var _a, _b;
|
13360
|
+
// map remote participants by userId
|
13361
|
+
const remoteParticipantMap = props.remoteParticipants.reduce((map, remoteParticipant) => {
|
13362
|
+
map[remoteParticipant.userId] = remoteParticipant;
|
13363
|
+
return map;
|
13364
|
+
}, {});
|
13365
|
+
const spotlightedParticipantUserIds = (_a = props.spotlightedParticipantUserIds) !== null && _a !== void 0 ? _a : [];
|
13366
|
+
// declare focused participant user ids as spotlighted participants user ids followed by
|
13367
|
+
// pinned participants user ids
|
13368
|
+
const focusedParticipantUserIds = [
|
13369
|
+
...new Set(spotlightedParticipantUserIds.concat((_b = props.pinnedParticipantUserIds) !== null && _b !== void 0 ? _b : []))
|
13370
|
+
];
|
13371
|
+
// get focused participants from map of remote participants in the order of the user ids
|
13372
|
+
const focusedParticipants = [];
|
13373
|
+
focusedParticipantUserIds.forEach((id) => {
|
13374
|
+
const pinnedParticipant = remoteParticipantMap[id];
|
13375
|
+
if (pinnedParticipant) {
|
13376
|
+
focusedParticipants.push(pinnedParticipant);
|
13377
|
+
}
|
13378
|
+
});
|
13379
|
+
// get unfocused participants by filtering out set of focused participant user ids from all remote participants
|
13380
|
+
const focusedParticipantUserIdSet = new Set(focusedParticipantUserIds);
|
13381
|
+
const unfocusedParticipants = props.remoteParticipants.filter((p) => !focusedParticipantUserIdSet.has(p.userId));
|
13382
|
+
const useOrganizedParticipantsProps = Object.assign(Object.assign({}, props), {
|
13383
|
+
// if there are pinned participants then we should only consider unpinned participants
|
13384
|
+
remoteParticipants: unfocusedParticipants });
|
13385
|
+
const useOrganizedParticipantsResult = _useOrganizedParticipants(useOrganizedParticipantsProps);
|
13386
|
+
if (focusedParticipants.length === 0) {
|
13387
|
+
return useOrganizedParticipantsResult;
|
13388
|
+
}
|
13389
|
+
return {
|
13390
|
+
gridParticipants: props.isScreenShareActive ? [] : focusedParticipants,
|
13391
|
+
overflowGalleryParticipants: props.isScreenShareActive
|
13392
|
+
? focusedParticipants.concat(useOrganizedParticipantsResult.overflowGalleryParticipants)
|
13393
|
+
: useOrganizedParticipantsResult.gridParticipants.concat(useOrganizedParticipantsResult.overflowGalleryParticipants)
|
13394
|
+
};
|
13395
|
+
};
|
13396
|
+
const putVideoParticipantsFirst = (remoteParticipants) => {
|
13397
|
+
const videoParticipants = [];
|
13398
|
+
const audioParticipants = [];
|
13399
|
+
remoteParticipants.forEach((p) => {
|
13400
|
+
var _a;
|
13401
|
+
if ((_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable) {
|
13402
|
+
videoParticipants.push(p);
|
13403
|
+
}
|
13404
|
+
else {
|
13405
|
+
audioParticipants.push(p);
|
13406
|
+
}
|
13407
|
+
});
|
13408
|
+
const remoteParticipantSortedByVideo = videoParticipants.concat(audioParticipants);
|
13409
|
+
return remoteParticipantSortedByVideo;
|
13410
|
+
};
|
13411
|
+
/**
|
13412
|
+
* Hook to determine which participants should be in grid and overflow gallery and their order respectively
|
13413
|
+
* @private
|
13414
|
+
*/
|
13415
|
+
const useOrganizedParticipants = (args) => {
|
13416
|
+
/* @conditional-compile-remove(pinned-participants) */
|
13417
|
+
return _useOrganizedParticipantsWithFocusedParticipants(args);
|
13418
|
+
};
|
13419
|
+
/* @conditional-compile-remove(reaction) */
|
13420
|
+
/**
|
13421
|
+
* @private
|
13422
|
+
*/
|
13423
|
+
const getEmojiResource = (reactionName, reactionResources) => {
|
13424
|
+
var _a, _b, _c, _d, _e;
|
13425
|
+
switch (reactionName) {
|
13426
|
+
case 'like':
|
13427
|
+
return (_a = reactionResources.likeReaction) === null || _a === void 0 ? void 0 : _a.url;
|
13428
|
+
case 'heart':
|
13429
|
+
return (_b = reactionResources.heartReaction) === null || _b === void 0 ? void 0 : _b.url;
|
13430
|
+
case 'laugh':
|
13431
|
+
return (_c = reactionResources.laughReaction) === null || _c === void 0 ? void 0 : _c.url;
|
13432
|
+
case 'applause':
|
13433
|
+
return (_d = reactionResources.applauseReaction) === null || _d === void 0 ? void 0 : _d.url;
|
13434
|
+
case 'surprised':
|
13435
|
+
return (_e = reactionResources.surprisedReaction) === null || _e === void 0 ? void 0 : _e.url;
|
13436
|
+
}
|
13437
|
+
return '';
|
13438
|
+
};
|
13439
|
+
|
13440
|
+
// Copyright (c) Microsoft Corporation.
|
13441
|
+
// Licensed under the MIT License.
|
13442
|
+
// Coin max size is set to PersonaSize.size100
|
13443
|
+
const DEFAULT_PERSONA_MAX_SIZE_PX = 100;
|
13444
|
+
// Coin min size is set PersonaSize.size32
|
13445
|
+
const DEFAULT_PERSONA_MIN_SIZE_PX = 32;
|
13446
|
+
const DefaultPlaceholder = (props) => {
|
13447
|
+
const { text, noVideoAvailableAriaLabel, coinSize, hidePersonaDetails } = props;
|
13448
|
+
return (React.createElement(react.Stack, { className: react.mergeStyles({ position: 'absolute', height: '100%', width: '100%' }) },
|
13449
|
+
React.createElement(react.Stack, { styles: defaultPersonaStyles$1 }, coinSize && (React.createElement(react.Persona, { coinSize: coinSize, hidePersonaDetails: hidePersonaDetails, text: text !== null && text !== void 0 ? text : '', initialsTextColor: "white", "aria-label": noVideoAvailableAriaLabel !== null && noVideoAvailableAriaLabel !== void 0 ? noVideoAvailableAriaLabel : '', showOverflowTooltip: false })))));
|
13450
|
+
};
|
13451
|
+
const defaultPersonaStyles$1 = { root: { margin: 'auto', maxHeight: '100%' } };
|
13452
|
+
/* @conditional-compile-remove(pinned-participants) */
|
13453
|
+
const videoTileMoreMenuIconProps = { iconName: undefined, style: { display: 'none' } };
|
13454
|
+
/* @conditional-compile-remove(pinned-participants) */
|
13455
|
+
const videoTileMoreMenuProps = {
|
13456
|
+
directionalHint: react.DirectionalHint.topLeftEdge,
|
13457
|
+
isBeakVisible: false,
|
13458
|
+
styles: { container: { maxWidth: '8rem' } }
|
13459
|
+
};
|
13460
|
+
/* @conditional-compile-remove(pinned-participants) */
|
13461
|
+
const VideoTileMoreOptionsButton = (props) => {
|
13462
|
+
const { contextualMenu, canShowContextMenuButton } = props;
|
13463
|
+
if (!contextualMenu) {
|
13464
|
+
return React.createElement(React.Fragment, null);
|
13465
|
+
}
|
13466
|
+
const optionsIcon = canShowContextMenuButton ? 'VideoTileMoreOptions' : undefined;
|
13467
|
+
return (React.createElement(react.IconButton, { "data-ui-id": "video-tile-more-options-button", styles: moreButtonStyles, menuIconProps: videoTileMoreMenuIconProps, menuProps: Object.assign(Object.assign({}, videoTileMoreMenuProps), contextualMenu), iconProps: { iconName: optionsIcon } }));
|
13468
|
+
};
|
13469
|
+
/**
|
13470
|
+
* A component to render the video stream for a single call participant.
|
13471
|
+
*
|
13472
|
+
* Use with {@link GridLayout} in a {@link VideoGallery}.
|
13473
|
+
*
|
13474
|
+
* @public
|
13475
|
+
*/
|
13476
|
+
const VideoTile = (props) => {
|
13477
|
+
const { children, displayName, initialsName, isMirrored, isMuted,
|
13478
|
+
/* @conditional-compile-remove(spotlight) */
|
13479
|
+
isSpotlighted,
|
13480
|
+
/* @conditional-compile-remove(pinned-participants) */
|
13481
|
+
isPinned, onRenderPlaceholder, renderElement, showLabel = true, showMuteIndicator = true, styles, userId, noVideoAvailableAriaLabel, isSpeaking,
|
13482
|
+
/* @conditional-compile-remove(raise-hand) */
|
13483
|
+
raisedHand,
|
13484
|
+
/* @conditional-compile-remove(reaction) */
|
13485
|
+
reaction, personaMinSize = DEFAULT_PERSONA_MIN_SIZE_PX, personaMaxSize = DEFAULT_PERSONA_MAX_SIZE_PX,
|
13486
|
+
/* @conditional-compile-remove(pinned-participants) */
|
13487
|
+
contextualMenu,
|
13488
|
+
/* @conditional-compile-remove(reaction) */
|
13489
|
+
reactionResources } = props;
|
13490
|
+
/* @conditional-compile-remove(pinned-participants) */
|
13491
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
13492
|
+
/* @conditional-compile-remove(pinned-participants) */
|
13493
|
+
const [isFocused, setIsFocused] = React.useState(false);
|
13494
|
+
// need to set a default otherwise the resizeObserver will get stuck in an infinite loop.
|
13495
|
+
const [personaSize, setPersonaSize] = React.useState(1);
|
13496
|
+
/* @conditional-compile-remove(reaction) */
|
13497
|
+
const [isValidImageSource, setIsValidImageSource] = React.useState(false);
|
13498
|
+
const videoTileRef = React.useRef(null);
|
13499
|
+
const locale = useLocale$1();
|
13500
|
+
const theme = useTheme();
|
13501
|
+
const isVideoRendered = !!renderElement;
|
13502
|
+
const observer = React.useRef(new ResizeObserver((entries) => {
|
13503
|
+
const { width, height } = entries[0].contentRect;
|
13504
|
+
const personaCalcSize = Math.min(width, height) / 3;
|
13505
|
+
// we only want to set the persona size if it has changed
|
13506
|
+
if (personaCalcSize !== personaSize) {
|
13507
|
+
setPersonaSize(Math.max(Math.min(personaCalcSize, personaMaxSize), personaMinSize));
|
13508
|
+
}
|
13509
|
+
}));
|
13510
|
+
React.useLayoutEffect(() => {
|
13511
|
+
if (videoTileRef.current) {
|
13512
|
+
observer.current.observe(videoTileRef.current);
|
13513
|
+
}
|
13514
|
+
const currentObserver = observer.current;
|
13515
|
+
return () => currentObserver.disconnect();
|
13516
|
+
}, [videoTileRef]);
|
13517
|
+
/* @conditional-compile-remove(pinned-participants) */
|
13518
|
+
const useLongPressProps = React.useMemo(() => {
|
13519
|
+
return {
|
13520
|
+
onLongPress: () => {
|
13521
|
+
var _a;
|
13522
|
+
(_a = props.onLongTouch) === null || _a === void 0 ? void 0 : _a.call(props);
|
13523
|
+
},
|
13524
|
+
touchEventsOnly: true
|
13525
|
+
};
|
13526
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
13527
|
+
}, [props.onLongTouch]);
|
13528
|
+
/* @conditional-compile-remove(pinned-participants) */
|
13529
|
+
const longPressHandlers = useLongPress(useLongPressProps);
|
13530
|
+
const longPressHandlersTrampoline = React.useMemo(() => {
|
13531
|
+
/* @conditional-compile-remove(pinned-participants) */
|
13532
|
+
return longPressHandlers;
|
13533
|
+
}, [
|
13534
|
+
/* @conditional-compile-remove(pinned-participants) */
|
13535
|
+
longPressHandlers
|
13536
|
+
]);
|
13537
|
+
const hoverHandlers = React.useMemo(() => {
|
13538
|
+
/* @conditional-compile-remove(pinned-participants) */
|
13376
13539
|
return {
|
13377
13540
|
onMouseEnter: () => setIsHovered(true),
|
13378
13541
|
onMouseLeave: () => setIsHovered(false),
|
@@ -13401,7 +13564,9 @@ const VideoTile = (props) => {
|
|
13401
13564
|
/* @conditional-compile-remove(raise-hand) */
|
13402
13565
|
raisedHandBackgroundColor = callingPalette.raiseHandGold;
|
13403
13566
|
/* @conditional-compile-remove(reaction) */
|
13404
|
-
const backgroundImageUrl = reaction !== undefined
|
13567
|
+
const backgroundImageUrl = reaction !== undefined && reactionResources !== undefined
|
13568
|
+
? getEmojiResource(reaction === null || reaction === void 0 ? void 0 : reaction.reactionType, reactionResources)
|
13569
|
+
: '';
|
13405
13570
|
/* @conditional-compile-remove(reaction) */
|
13406
13571
|
const currentTimestamp = new Date();
|
13407
13572
|
/* @conditional-compile-remove(reaction) */
|
@@ -13409,12 +13574,25 @@ const VideoTile = (props) => {
|
|
13409
13574
|
/* @conditional-compile-remove(reaction) */
|
13410
13575
|
const receivedUnixTimestamp = reaction ? Math.floor(reaction.receivedAt.getTime() / 1000) : undefined;
|
13411
13576
|
/* @conditional-compile-remove(reaction) */
|
13412
|
-
const canRenderReaction = receivedUnixTimestamp ? currentUnixTimeStamp - receivedUnixTimestamp < 3000 : false
|
13577
|
+
const canRenderReaction = (receivedUnixTimestamp ? currentUnixTimeStamp - receivedUnixTimestamp < 3000 : false) &&
|
13578
|
+
backgroundImageUrl !== undefined;
|
13579
|
+
/* @conditional-compile-remove(reaction) */
|
13580
|
+
React.useEffect(() => {
|
13581
|
+
if (!backgroundImageUrl || backgroundImageUrl.length === 0) {
|
13582
|
+
return;
|
13583
|
+
}
|
13584
|
+
fetch(`${backgroundImageUrl}`)
|
13585
|
+
.then((res) => setIsValidImageSource(res.ok))
|
13586
|
+
.catch((warning) => console.warn(`Sprite image for animation rendering failed with warning: ${warning}`));
|
13587
|
+
return () => setIsValidImageSource(false);
|
13588
|
+
}, [backgroundImageUrl]);
|
13589
|
+
/* @conditional-compile-remove(reaction) */
|
13590
|
+
const spriteImageUrl = backgroundImageUrl !== undefined ? backgroundImageUrl : '';
|
13413
13591
|
/* @conditional-compile-remove(reaction) */
|
13414
13592
|
const reactionContainerStyles = React.useCallback(() => reactionRenderingStyle({
|
13415
|
-
|
13593
|
+
spriteImageUrl,
|
13416
13594
|
personaSize
|
13417
|
-
}), [
|
13595
|
+
}), [spriteImageUrl, personaSize]);
|
13418
13596
|
return (React.createElement(react.Stack, Object.assign({ "data-ui-id": ids.videoTile, className: react.mergeStyles(rootStyles, {
|
13419
13597
|
background: theme.palette.neutralLighter,
|
13420
13598
|
borderRadius: theme.effects.roundedCorner4
|
@@ -13437,7 +13615,7 @@ const VideoTile = (props) => {
|
|
13437
13615
|
: 1
|
13438
13616
|
}) }, onRenderPlaceholder ? (onRenderPlaceholder(userId !== null && userId !== void 0 ? userId : '', placeholderOptions, DefaultPlaceholder)) : (React.createElement(DefaultPlaceholder, Object.assign({}, placeholderOptions))))),
|
13439
13617
|
/* @conditional-compile-remove(reaction) */
|
13440
|
-
canRenderReaction && (React.createElement(react.Stack, { className: react.mergeStyles(videoContainerStyles, {
|
13618
|
+
canRenderReaction && isValidImageSource && (React.createElement(react.Stack, { className: react.mergeStyles(videoContainerStyles, {
|
13441
13619
|
display: 'flex',
|
13442
13620
|
justifyContent: 'center',
|
13443
13621
|
alignItems: 'center',
|
@@ -13501,7 +13679,8 @@ const _RemoteVideoTile = React.memo((props) => {
|
|
13501
13679
|
var _a;
|
13502
13680
|
const { isAvailable, isReceiving = true, // default to true to prevent any breaking change
|
13503
13681
|
isScreenSharingOn, onCreateRemoteStreamView, onDisposeRemoteStreamView, remoteVideoViewOptions, renderElement, userId, onRenderAvatar, showMuteIndicator, remoteParticipant, participantState, menuKind, isPinned, onPinParticipant, onUnpinParticipant,
|
13504
|
-
/* @conditional-compile-remove(spotlight) */ isSpotlighted, onUpdateScalingMode, disablePinMenuItem, toggleAnnouncerString, strings
|
13682
|
+
/* @conditional-compile-remove(spotlight) */ isSpotlighted, onUpdateScalingMode, disablePinMenuItem, toggleAnnouncerString, strings,
|
13683
|
+
/* @conditional-compile-remove(reaction) */ reactionResources } = props;
|
13505
13684
|
const remoteVideoStreamProps = React.useMemo(() => ({
|
13506
13685
|
isMirrored: remoteVideoViewOptions === null || remoteVideoViewOptions === void 0 ? void 0 : remoteVideoViewOptions.isMirrored,
|
13507
13686
|
isScreenSharingOn,
|
@@ -13592,7 +13771,9 @@ const _RemoteVideoTile = React.memo((props) => {
|
|
13592
13771
|
/* @conditional-compile-remove(pinned-participants) */
|
13593
13772
|
onLongTouch: () => setDrawerMenuItemProps(convertContextualMenuItemsToDrawerMenuItemProps(contextualMenuProps, () => setDrawerMenuItemProps([]))),
|
13594
13773
|
/* @conditional-compile-remove(spotlight) */
|
13595
|
-
isSpotlighted: isSpotlighted
|
13774
|
+
isSpotlighted: isSpotlighted,
|
13775
|
+
/* @conditional-compile-remove(reaction) */
|
13776
|
+
reactionResources: reactionResources })),
|
13596
13777
|
drawerMenuItemProps.length > 0 && (React.createElement(react.Layer, { hostId: props.drawerMenuHostId },
|
13597
13778
|
React.createElement(react.Stack, { styles: drawerMenuWrapperStyles },
|
13598
13779
|
React.createElement(_DrawerMenu, { onLightDismiss: () => setDrawerMenuItemProps([]), items: drawerMenuItemProps, heading: remoteParticipant.displayName }))))));
|
@@ -13794,7 +13975,7 @@ const localVideoTileContainerStyles = {
|
|
13794
13975
|
|
13795
13976
|
// Copyright (c) Microsoft Corporation.
|
13796
13977
|
// Licensed under the MIT License.
|
13797
|
-
var __awaiter$
|
13978
|
+
var __awaiter$x = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
13798
13979
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
13799
13980
|
return new (P || (P = Promise))(function (resolve, reject) {
|
13800
13981
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -13811,7 +13992,7 @@ const LocalVideoCameraCycleButton = (props) => {
|
|
13811
13992
|
const { cameras, selectedCamera, onSelectCamera, label, ariaDescription, size } = props;
|
13812
13993
|
const theme = react.useTheme();
|
13813
13994
|
const [waitForCamera, setWaitForCamera] = React.useState(false);
|
13814
|
-
const onChangeCameraClick = React.useCallback((device) => __awaiter$
|
13995
|
+
const onChangeCameraClick = React.useCallback((device) => __awaiter$x(void 0, void 0, void 0, function* () {
|
13815
13996
|
// Throttle changing camera to prevent too many callbacks
|
13816
13997
|
if (onSelectCamera) {
|
13817
13998
|
setWaitForCamera(true);
|
@@ -13848,7 +14029,9 @@ const _LocalVideoTile = React.memo((props) => {
|
|
13848
14029
|
/* @conditional-compile-remove(reaction) */
|
13849
14030
|
reaction,
|
13850
14031
|
/* @conditional-compile-remove(spotlight) */
|
13851
|
-
isSpotlighted
|
14032
|
+
isSpotlighted,
|
14033
|
+
/* @conditional-compile-remove(reaction) */
|
14034
|
+
reactionResources } = props;
|
13852
14035
|
/* @conditional-compile-remove(spotlight) */
|
13853
14036
|
const theme = useTheme();
|
13854
14037
|
const localVideoStreamProps = React.useMemo(() => ({
|
@@ -13888,275 +14071,55 @@ const _LocalVideoTile = React.memo((props) => {
|
|
13888
14071
|
React.createElement(StreamMedia, { videoStreamElement: renderElement, isMirrored: true }), /* @conditional-compile-remove(spotlight) */
|
13889
14072
|
isSpotlighted && spotlightBorder));
|
13890
14073
|
}, [
|
13891
|
-
localVideoCameraCycleButtonProps,
|
13892
|
-
localVideoCameraSwitcherLabel,
|
13893
|
-
localVideoSelectedDescription,
|
13894
|
-
renderElement,
|
13895
|
-
showCameraSwitcherInLocalPreview,
|
13896
|
-
/* @conditional-compile-remove(spotlight) */ isSpotlighted,
|
13897
|
-
/* @conditional-compile-remove(spotlight) */ spotlightBorder
|
13898
|
-
]);
|
13899
|
-
return (React.createElement(React.Fragment, null,
|
13900
|
-
React.createElement(VideoTile, { key: userId !== null && userId !== void 0 ? userId : 'local-video-tile', userId: userId, renderElement: renderVideoStreamElement, showLabel: showLabel, displayName: displayName, initialsName: initialsName, styles: styles, onRenderPlaceholder: onRenderAvatar, isMuted: isMuted, showMuteIndicator: showMuteIndicator, personaMinSize: props.personaMinSize,
|
13901
|
-
/* @conditional-compile-remove(raise-hand) */
|
13902
|
-
raisedHand: raisedHand,
|
13903
|
-
/* @conditional-compile-remove(reaction) */
|
13904
|
-
reaction: reaction,
|
13905
|
-
/* @conditional-compile-remove(spotlight) */
|
13906
|
-
isSpotlighted: isSpotlighted }), /* @conditional-compile-remove(spotlight) */
|
13907
|
-
isSpotlighted && spotlightBorder));
|
13908
|
-
});
|
13909
|
-
const FloatingLocalCameraCycleButton = (props) => {
|
13910
|
-
const { showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps, localVideoCameraSwitcherLabel, localVideoSelectedDescription } = props;
|
13911
|
-
const ariaDescription = (localVideoCameraCycleButtonProps === null || localVideoCameraCycleButtonProps === void 0 ? void 0 : localVideoCameraCycleButtonProps.selectedCamera) &&
|
13912
|
-
localVideoSelectedDescription &&
|
13913
|
-
_formatString(localVideoSelectedDescription, {
|
13914
|
-
cameraName: localVideoCameraCycleButtonProps.selectedCamera.name
|
13915
|
-
});
|
13916
|
-
return (React.createElement(react.Stack, { horizontalAlign: "end" }, showCameraSwitcherInLocalPreview &&
|
13917
|
-
(localVideoCameraCycleButtonProps === null || localVideoCameraCycleButtonProps === void 0 ? void 0 : localVideoCameraCycleButtonProps.cameras) !== undefined &&
|
13918
|
-
(localVideoCameraCycleButtonProps === null || localVideoCameraCycleButtonProps === void 0 ? void 0 : localVideoCameraCycleButtonProps.selectedCamera) !== undefined &&
|
13919
|
-
(localVideoCameraCycleButtonProps === null || localVideoCameraCycleButtonProps === void 0 ? void 0 : localVideoCameraCycleButtonProps.onSelectCamera) !== undefined && (React.createElement(LocalVideoCameraCycleButton, { cameras: localVideoCameraCycleButtonProps.cameras, selectedCamera: localVideoCameraCycleButtonProps.selectedCamera, onSelectCamera: localVideoCameraCycleButtonProps.onSelectCamera, label: localVideoCameraSwitcherLabel, ariaDescription: ariaDescription }))));
|
13920
|
-
};
|
13921
|
-
|
13922
|
-
// Copyright (c) Microsoft Corporation.
|
13923
|
-
// Licensed under the MIT License.
|
13924
|
-
/**
|
13925
|
-
* @private
|
13926
|
-
*/
|
13927
|
-
const rootLayoutStyle$1 = {
|
13928
|
-
root: { position: 'relative', height: '100%', width: '100%', padding: '0.5rem' }
|
13929
|
-
};
|
13930
|
-
|
13931
|
-
// Copyright (c) Microsoft Corporation.
|
13932
|
-
// Licensed under the MIT License.
|
13933
|
-
/**
|
13934
|
-
* @private
|
13935
|
-
*/
|
13936
|
-
const videoGalleryLayoutGap = {
|
13937
|
-
childrenGap: '0.5rem'
|
13938
|
-
};
|
13939
|
-
|
13940
|
-
// Copyright (c) Microsoft Corporation.
|
13941
|
-
// Licensed under the MIT License.
|
13942
|
-
/**
|
13943
|
-
* Calculates the participants that should be rendered based on the list of dominant
|
13944
|
-
* speakers and currently rendered participants in a call.
|
13945
|
-
* @param args - SmartDominantSpeakerParticipantsArgs
|
13946
|
-
* @returns VideoGalleryRemoteParticipant[] {@link @azure/communication-react#VideoGalleryRemoteParticipant}
|
13947
|
-
*/
|
13948
|
-
const smartDominantSpeakerParticipants = (args) => {
|
13949
|
-
const { participants, dominantSpeakers = [], lastVisibleParticipants = [], maxDominantSpeakers } = args;
|
13950
|
-
// Don't apply any logic if total number of video streams is less than max dominant speakers.
|
13951
|
-
if (participants.length <= maxDominantSpeakers) {
|
13952
|
-
return participants;
|
13953
|
-
}
|
13954
|
-
const participantsMap = participantsById(participants);
|
13955
|
-
// Only use the Max allowed dominant speakers that exist in participants
|
13956
|
-
const dominantSpeakerIds = dominantSpeakers.filter((id) => !!participantsMap[id]).slice(0, maxDominantSpeakers);
|
13957
|
-
const newVisibleParticipantIds = lastVisibleParticipants.map((p) => p.userId).slice(0, maxDominantSpeakers);
|
13958
|
-
const newDominantSpeakerIds = dominantSpeakerIds.filter((id) => !newVisibleParticipantIds.includes(id));
|
13959
|
-
// Remove participants that are no longer dominant and replace them with new dominant speakers.
|
13960
|
-
for (let index = 0; index < maxDominantSpeakers; index++) {
|
13961
|
-
const newVisibleParticipantId = newVisibleParticipantIds[index];
|
13962
|
-
if (newVisibleParticipantId === undefined || !dominantSpeakerIds.includes(newVisibleParticipantId)) {
|
13963
|
-
const replacement = newDominantSpeakerIds.shift();
|
13964
|
-
if (!replacement) {
|
13965
|
-
break;
|
13966
|
-
}
|
13967
|
-
newVisibleParticipantIds[index] = replacement;
|
13968
|
-
}
|
13969
|
-
}
|
13970
|
-
let newVisibleParticipants = newVisibleParticipantIds
|
13971
|
-
.map((participantId) => participantsMap[participantId])
|
13972
|
-
.filter((p) => p !== undefined);
|
13973
|
-
const newVisibleParticipantIdsSet = new Set(newVisibleParticipantIds);
|
13974
|
-
const remainingParticipants = participants.filter((p) => !newVisibleParticipantIdsSet.has(p.userId));
|
13975
|
-
newVisibleParticipants = newVisibleParticipants.concat(remainingParticipants);
|
13976
|
-
return newVisibleParticipants;
|
13977
|
-
};
|
13978
|
-
/**
|
13979
|
-
* maps the participants array to an object with userId as key
|
13980
|
-
* @private
|
13981
|
-
*/
|
13982
|
-
const participantsById = (participants) => {
|
13983
|
-
const response = {};
|
13984
|
-
participants.forEach((p) => (response[p.userId] = p));
|
13985
|
-
return response;
|
13986
|
-
};
|
13987
|
-
|
13988
|
-
// Copyright (c) Microsoft Corporation.
|
13989
|
-
// Licensed under the MIT License.
|
13990
|
-
const DEFAULT_MAX_OVERFLOW_GALLERY_DOMINANT_SPEAKERS = 6;
|
13991
|
-
const DEFAULT_MAX_VIDEO_SREAMS = 4;
|
13992
|
-
/* @conditional-compile-remove(gallery-layouts) */
|
13993
|
-
const MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY = 9;
|
13994
|
-
const _useOrganizedParticipants = (props) => {
|
13995
|
-
const visibleGridParticipants = React.useRef([]);
|
13996
|
-
const visibleOverflowGalleryParticipants = React.useRef([]);
|
13997
|
-
const { remoteParticipants = [], localParticipant, dominantSpeakers = [], maxRemoteVideoStreams = DEFAULT_MAX_VIDEO_SREAMS, maxOverflowGalleryDominantSpeakers = DEFAULT_MAX_OVERFLOW_GALLERY_DOMINANT_SPEAKERS, isScreenShareActive = false, pinnedParticipantUserIds = [],
|
13998
|
-
/* @conditional-compile-remove(gallery-layouts) */
|
13999
|
-
layout } = props;
|
14000
|
-
const calculateMaxRemoteVideoStreams = () => {
|
14001
|
-
/* @conditional-compile-remove(gallery-layouts) */
|
14002
|
-
if (maxRemoteVideoStreams > MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY) {
|
14003
|
-
return MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY;
|
14004
|
-
}
|
14005
|
-
else {
|
14006
|
-
return maxRemoteVideoStreams;
|
14007
|
-
}
|
14008
|
-
};
|
14009
|
-
const maxRemoteVideoStreamsToUse = calculateMaxRemoteVideoStreams();
|
14010
|
-
const videoParticipants = remoteParticipants.filter((p) => { var _a; return (_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable; });
|
14011
|
-
const participantsToSortTrampoline = () => {
|
14012
|
-
/* @conditional-compile-remove(gallery-layouts) */
|
14013
|
-
return layout !== 'floatingLocalVideo' ? putVideoParticipantsFirst(remoteParticipants) : videoParticipants;
|
14014
|
-
};
|
14015
|
-
visibleGridParticipants.current =
|
14016
|
-
pinnedParticipantUserIds.length > 0 || isScreenShareActive
|
14017
|
-
? []
|
14018
|
-
: smartDominantSpeakerParticipants({
|
14019
|
-
participants: participantsToSortTrampoline(),
|
14020
|
-
dominantSpeakers,
|
14021
|
-
lastVisibleParticipants: visibleGridParticipants.current,
|
14022
|
-
maxDominantSpeakers: maxRemoteVideoStreamsToUse
|
14023
|
-
}).slice(0, maxRemoteVideoStreamsToUse);
|
14024
|
-
/* @conditional-compile-remove(gallery-layouts) */
|
14025
|
-
const dominantSpeakerToGrid = layout === 'speaker'
|
14026
|
-
? dominantSpeakers && dominantSpeakers[0]
|
14027
|
-
? visibleGridParticipants.current.filter((p) => p.userId === dominantSpeakers[0])
|
14028
|
-
: [visibleGridParticipants.current[0]]
|
14029
|
-
: [];
|
14030
|
-
/* @conditional-compile-remove(gallery-layouts) */
|
14031
|
-
if (dominantSpeakerToGrid[0]) {
|
14032
|
-
visibleGridParticipants.current = dominantSpeakerToGrid;
|
14033
|
-
}
|
14034
|
-
const visibleGridParticipantsSet = new Set(visibleGridParticipants.current.map((p) => p.userId));
|
14035
|
-
const remoteParticipantsOrdered = putVideoParticipantsFirst(remoteParticipants);
|
14036
|
-
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
14037
|
-
const callingParticipants = remoteParticipantsOrdered.filter((p) => p.state === ('Connecting' ));
|
14038
|
-
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
14039
|
-
const callingParticipantsSet = new Set(callingParticipants.map((p) => p.userId));
|
14040
|
-
visibleOverflowGalleryParticipants.current = smartDominantSpeakerParticipants({
|
14041
|
-
participants: remoteParticipantsOrdered.filter((p) => !visibleGridParticipantsSet.has(p.userId) &&
|
14042
|
-
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ !callingParticipantsSet.has(p.userId)),
|
14043
|
-
dominantSpeakers: dominantSpeakers,
|
14044
|
-
lastVisibleParticipants: visibleOverflowGalleryParticipants.current,
|
14045
|
-
maxDominantSpeakers: maxOverflowGalleryDominantSpeakers
|
14046
|
-
});
|
14047
|
-
const getGridParticipants = React.useCallback(() => {
|
14048
|
-
if (isScreenShareActive) {
|
14049
|
-
return [];
|
14050
|
-
}
|
14051
|
-
// if we have no grid participants we need to cap the max number of overflowGallery participants in the grid
|
14052
|
-
// we will use the max streams provided to the function to find the max participants that can go in the grid
|
14053
|
-
// if there are less participants than max streams then we will use all participants including joining in the grid
|
14054
|
-
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
14055
|
-
return visibleGridParticipants.current.length > 0
|
14056
|
-
? visibleGridParticipants.current
|
14057
|
-
: visibleOverflowGalleryParticipants.current.length > maxRemoteVideoStreamsToUse
|
14058
|
-
? visibleOverflowGalleryParticipants.current.slice(0, maxRemoteVideoStreamsToUse)
|
14059
|
-
: visibleOverflowGalleryParticipants.current.slice(0, maxRemoteVideoStreamsToUse).concat(callingParticipants);
|
14060
|
-
}, [
|
14061
|
-
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ callingParticipants,
|
14062
|
-
isScreenShareActive,
|
14063
|
-
maxRemoteVideoStreamsToUse
|
14064
|
-
]);
|
14065
|
-
const gridParticipants = getGridParticipants();
|
14066
|
-
const getOverflowGalleryRemoteParticipants = React.useCallback(() => {
|
14067
|
-
if (isScreenShareActive && localParticipant) {
|
14068
|
-
const localParticipantPlusOverflow = [localParticipant].concat(visibleGridParticipants.current.concat(visibleOverflowGalleryParticipants.current));
|
14069
|
-
// If screen sharing is active, assign video and audio participants as overflow gallery participants
|
14070
|
-
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
14071
|
-
return localParticipantPlusOverflow.concat(callingParticipants);
|
14072
|
-
}
|
14073
|
-
else if (isScreenShareActive) {
|
14074
|
-
// If screen sharing is active, assign video and audio participants as overflow gallery participants
|
14075
|
-
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
14076
|
-
return visibleGridParticipants.current.concat(visibleOverflowGalleryParticipants.current.concat(callingParticipants));
|
14077
|
-
}
|
14078
|
-
else {
|
14079
|
-
// If screen sharing is not active, then assign all video tiles as grid tiles.
|
14080
|
-
// If there are no video tiles, then assign audio tiles as grid tiles.
|
14081
|
-
// if there are more overflow tiles than max streams then find the tiles that don't fit in the grid and put them in overflow
|
14082
|
-
// overflow should be empty if total participants including calling participants is less than max streams
|
14083
|
-
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
14084
|
-
return visibleGridParticipants.current.length > 0
|
14085
|
-
? visibleOverflowGalleryParticipants.current.concat(callingParticipants)
|
14086
|
-
: visibleOverflowGalleryParticipants.current.length > maxRemoteVideoStreamsToUse
|
14087
|
-
? visibleOverflowGalleryParticipants.current.slice(maxRemoteVideoStreamsToUse).concat(callingParticipants)
|
14088
|
-
: [];
|
14089
|
-
}
|
14090
|
-
}, [
|
14091
|
-
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ callingParticipants,
|
14092
|
-
isScreenShareActive,
|
14093
|
-
localParticipant,
|
14094
|
-
maxRemoteVideoStreamsToUse
|
14074
|
+
localVideoCameraCycleButtonProps,
|
14075
|
+
localVideoCameraSwitcherLabel,
|
14076
|
+
localVideoSelectedDescription,
|
14077
|
+
renderElement,
|
14078
|
+
showCameraSwitcherInLocalPreview,
|
14079
|
+
/* @conditional-compile-remove(spotlight) */ isSpotlighted,
|
14080
|
+
/* @conditional-compile-remove(spotlight) */ spotlightBorder
|
14095
14081
|
]);
|
14096
|
-
|
14097
|
-
|
14098
|
-
|
14099
|
-
|
14100
|
-
|
14101
|
-
|
14102
|
-
|
14103
|
-
|
14104
|
-
|
14105
|
-
|
14106
|
-
|
14107
|
-
|
14108
|
-
|
14109
|
-
|
14110
|
-
const
|
14111
|
-
|
14112
|
-
|
14113
|
-
|
14114
|
-
|
14115
|
-
|
14116
|
-
|
14117
|
-
|
14118
|
-
|
14119
|
-
}
|
14120
|
-
});
|
14121
|
-
// get unfocused participants by filtering out set of focused participant user ids from all remote participants
|
14122
|
-
const focusedParticipantUserIdSet = new Set(focusedParticipantUserIds);
|
14123
|
-
const unfocusedParticipants = props.remoteParticipants.filter((p) => !focusedParticipantUserIdSet.has(p.userId));
|
14124
|
-
const useOrganizedParticipantsProps = Object.assign(Object.assign({}, props), {
|
14125
|
-
// if there are pinned participants then we should only consider unpinned participants
|
14126
|
-
remoteParticipants: unfocusedParticipants });
|
14127
|
-
const useOrganizedParticipantsResult = _useOrganizedParticipants(useOrganizedParticipantsProps);
|
14128
|
-
if (focusedParticipants.length === 0) {
|
14129
|
-
return useOrganizedParticipantsResult;
|
14130
|
-
}
|
14131
|
-
return {
|
14132
|
-
gridParticipants: props.isScreenShareActive ? [] : focusedParticipants,
|
14133
|
-
overflowGalleryParticipants: props.isScreenShareActive
|
14134
|
-
? focusedParticipants.concat(useOrganizedParticipantsResult.overflowGalleryParticipants)
|
14135
|
-
: useOrganizedParticipantsResult.gridParticipants.concat(useOrganizedParticipantsResult.overflowGalleryParticipants)
|
14136
|
-
};
|
14082
|
+
return (React.createElement(React.Fragment, null,
|
14083
|
+
React.createElement(VideoTile, { key: userId !== null && userId !== void 0 ? userId : 'local-video-tile', userId: userId, renderElement: renderVideoStreamElement, showLabel: showLabel, displayName: displayName, initialsName: initialsName, styles: styles, onRenderPlaceholder: onRenderAvatar, isMuted: isMuted, showMuteIndicator: showMuteIndicator, personaMinSize: props.personaMinSize,
|
14084
|
+
/* @conditional-compile-remove(raise-hand) */
|
14085
|
+
raisedHand: raisedHand,
|
14086
|
+
/* @conditional-compile-remove(reaction) */
|
14087
|
+
reaction: reaction,
|
14088
|
+
/* @conditional-compile-remove(spotlight) */
|
14089
|
+
isSpotlighted: isSpotlighted,
|
14090
|
+
/* @conditional-compile-remove(reaction) */
|
14091
|
+
reactionResources: reactionResources }), /* @conditional-compile-remove(spotlight) */
|
14092
|
+
isSpotlighted && spotlightBorder));
|
14093
|
+
});
|
14094
|
+
const FloatingLocalCameraCycleButton = (props) => {
|
14095
|
+
const { showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps, localVideoCameraSwitcherLabel, localVideoSelectedDescription } = props;
|
14096
|
+
const ariaDescription = (localVideoCameraCycleButtonProps === null || localVideoCameraCycleButtonProps === void 0 ? void 0 : localVideoCameraCycleButtonProps.selectedCamera) &&
|
14097
|
+
localVideoSelectedDescription &&
|
14098
|
+
_formatString(localVideoSelectedDescription, {
|
14099
|
+
cameraName: localVideoCameraCycleButtonProps.selectedCamera.name
|
14100
|
+
});
|
14101
|
+
return (React.createElement(react.Stack, { horizontalAlign: "end" }, showCameraSwitcherInLocalPreview &&
|
14102
|
+
(localVideoCameraCycleButtonProps === null || localVideoCameraCycleButtonProps === void 0 ? void 0 : localVideoCameraCycleButtonProps.cameras) !== undefined &&
|
14103
|
+
(localVideoCameraCycleButtonProps === null || localVideoCameraCycleButtonProps === void 0 ? void 0 : localVideoCameraCycleButtonProps.selectedCamera) !== undefined &&
|
14104
|
+
(localVideoCameraCycleButtonProps === null || localVideoCameraCycleButtonProps === void 0 ? void 0 : localVideoCameraCycleButtonProps.onSelectCamera) !== undefined && (React.createElement(LocalVideoCameraCycleButton, { cameras: localVideoCameraCycleButtonProps.cameras, selectedCamera: localVideoCameraCycleButtonProps.selectedCamera, onSelectCamera: localVideoCameraCycleButtonProps.onSelectCamera, label: localVideoCameraSwitcherLabel, ariaDescription: ariaDescription }))));
|
14137
14105
|
};
|
14138
|
-
|
14139
|
-
|
14140
|
-
|
14141
|
-
|
14142
|
-
|
14143
|
-
|
14144
|
-
|
14145
|
-
|
14146
|
-
else {
|
14147
|
-
audioParticipants.push(p);
|
14148
|
-
}
|
14149
|
-
});
|
14150
|
-
const remoteParticipantSortedByVideo = videoParticipants.concat(audioParticipants);
|
14151
|
-
return remoteParticipantSortedByVideo;
|
14106
|
+
|
14107
|
+
// Copyright (c) Microsoft Corporation.
|
14108
|
+
// Licensed under the MIT License.
|
14109
|
+
/**
|
14110
|
+
* @private
|
14111
|
+
*/
|
14112
|
+
const rootLayoutStyle$1 = {
|
14113
|
+
root: { position: 'relative', height: '100%', width: '100%', padding: '0.5rem' }
|
14152
14114
|
};
|
14115
|
+
|
14116
|
+
// Copyright (c) Microsoft Corporation.
|
14117
|
+
// Licensed under the MIT License.
|
14153
14118
|
/**
|
14154
|
-
* Hook to determine which participants should be in grid and overflow gallery and their order respectively
|
14155
14119
|
* @private
|
14156
14120
|
*/
|
14157
|
-
const
|
14158
|
-
|
14159
|
-
return _useOrganizedParticipantsWithFocusedParticipants(args);
|
14121
|
+
const videoGalleryLayoutGap = {
|
14122
|
+
childrenGap: '0.5rem'
|
14160
14123
|
};
|
14161
14124
|
|
14162
14125
|
// Copyright (c) Microsoft Corporation.
|
@@ -16233,7 +16196,9 @@ const VideoGallery = (props) => {
|
|
16233
16196
|
/* @conditional-compile-remove(rooms) */
|
16234
16197
|
localVideoTileSize = 'followDeviceOrientation',
|
16235
16198
|
/* @conditional-compile-remove(spotlight) */
|
16236
|
-
spotlightedParticipants
|
16199
|
+
spotlightedParticipants,
|
16200
|
+
/* @conditional-compile-remove(reaction) */
|
16201
|
+
reactionResources } = props;
|
16237
16202
|
const ids = useIdentifiers();
|
16238
16203
|
const theme = useTheme();
|
16239
16204
|
const localeStrings = useLocale$1().strings.videoGallery;
|
@@ -16307,7 +16272,9 @@ const VideoGallery = (props) => {
|
|
16307
16272
|
/* @conditional-compile-remove(reaction) */
|
16308
16273
|
reaction: localParticipant.reaction,
|
16309
16274
|
/* @conditional-compile-remove(spotlight) */
|
16310
|
-
isSpotlighted: isSpotlighted
|
16275
|
+
isSpotlighted: isSpotlighted,
|
16276
|
+
/* @conditional-compile-remove(reaction) */
|
16277
|
+
reactionResources: reactionResources })));
|
16311
16278
|
}, [
|
16312
16279
|
isNarrow,
|
16313
16280
|
localParticipant,
|
@@ -16332,7 +16299,9 @@ const VideoGallery = (props) => {
|
|
16332
16299
|
layout,
|
16333
16300
|
showLocalVideoTileLabel,
|
16334
16301
|
/* @conditional-compile-remove(spotlight) */
|
16335
|
-
spotlightedParticipants
|
16302
|
+
spotlightedParticipants,
|
16303
|
+
/* @conditional-compile-remove(reaction) */
|
16304
|
+
reactionResources
|
16336
16305
|
]);
|
16337
16306
|
/* @conditional-compile-remove(pinned-participants) */
|
16338
16307
|
const onPinParticipant = React.useCallback((userId) => {
|
@@ -16415,7 +16384,9 @@ const VideoGallery = (props) => {
|
|
16415
16384
|
/* @conditional-compile-remove(pinned-participants) */
|
16416
16385
|
toggleAnnouncerString: toggleAnnouncerString,
|
16417
16386
|
/* @conditional-compile-remove(spotlight) */
|
16418
|
-
isSpotlighted: isSpotlighted
|
16387
|
+
isSpotlighted: isSpotlighted,
|
16388
|
+
/* @conditional-compile-remove(reaction) */
|
16389
|
+
reactionResources: reactionResources }));
|
16419
16390
|
}, [
|
16420
16391
|
onCreateRemoteStreamView,
|
16421
16392
|
onDisposeRemoteVideoStreamView,
|
@@ -16432,7 +16403,8 @@ const VideoGallery = (props) => {
|
|
16432
16403
|
/* @conditional-compile-remove(pinned-participants) */ onUnpinParticipant,
|
16433
16404
|
/* @conditional-compile-remove(pinned-participants) */ toggleAnnouncerString,
|
16434
16405
|
/* @conditional-compile-remove(pinned-participants) */ onUpdateScalingMode,
|
16435
|
-
/* @conditional-compile-remove(spotlight) */ spotlightedParticipants
|
16406
|
+
/* @conditional-compile-remove(spotlight) */ spotlightedParticipants,
|
16407
|
+
/* @conditional-compile-remove(reaction) */ reactionResources
|
16436
16408
|
]);
|
16437
16409
|
const screenShareParticipant = remoteParticipants.find((participant) => { var _a; return (_a = participant.screenShareStream) === null || _a === void 0 ? void 0 : _a.isAvailable; });
|
16438
16410
|
const localScreenShareStreamComponent = React.createElement(LocalScreenShare, { localParticipant: localParticipant });
|
@@ -16917,7 +16889,7 @@ const DevicesButton = (props) => {
|
|
16917
16889
|
|
16918
16890
|
// Copyright (c) Microsoft Corporation.
|
16919
16891
|
// Licensed under the MIT License.
|
16920
|
-
var __awaiter$
|
16892
|
+
var __awaiter$w = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
16921
16893
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
16922
16894
|
return new (P || (P = Promise))(function (resolve, reject) {
|
16923
16895
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -16955,7 +16927,7 @@ const CameraButton = (props) => {
|
|
16955
16927
|
const toggleAnnouncerString = React.useCallback((isCameraOn) => {
|
16956
16928
|
setAnnouncerString(!isCameraOn ? strings.cameraActionTurnedOffAnnouncement : strings.cameraActionTurnedOnAnnouncement);
|
16957
16929
|
}, [strings.cameraActionTurnedOffAnnouncement, strings.cameraActionTurnedOnAnnouncement]);
|
16958
|
-
const onToggleClick = React.useCallback(() => __awaiter$
|
16930
|
+
const onToggleClick = React.useCallback(() => __awaiter$w(void 0, void 0, void 0, function* () {
|
16959
16931
|
// Throttle click on camera, need to await onToggleCamera then allow another click
|
16960
16932
|
if (onToggleCamera) {
|
16961
16933
|
setWaitForCamera(true);
|
@@ -16969,7 +16941,7 @@ const CameraButton = (props) => {
|
|
16969
16941
|
}
|
16970
16942
|
}
|
16971
16943
|
}), [cameraOn, localVideoViewOptions, onToggleCamera, toggleAnnouncerString]);
|
16972
|
-
const onChangeCameraClick = React.useCallback((device) => __awaiter$
|
16944
|
+
const onChangeCameraClick = React.useCallback((device) => __awaiter$w(void 0, void 0, void 0, function* () {
|
16973
16945
|
// Throttle changing camera to prevent too many callbacks
|
16974
16946
|
if (onSelectCamera) {
|
16975
16947
|
setWaitForCamera(true);
|
@@ -17140,7 +17112,7 @@ const lightThemeCallButtonStyles = {
|
|
17140
17112
|
|
17141
17113
|
// Copyright (c) Microsoft Corporation.
|
17142
17114
|
// Licensed under the MIT License.
|
17143
|
-
var __awaiter$
|
17115
|
+
var __awaiter$v = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
17144
17116
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
17145
17117
|
return new (P || (P = Promise))(function (resolve, reject) {
|
17146
17118
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -17181,7 +17153,7 @@ const MicrophoneButton = (props) => {
|
|
17181
17153
|
const toggleAnnouncerString = React.useCallback((isMicOn) => {
|
17182
17154
|
setAnnouncerString(!isMicOn ? strings.microphoneActionTurnedOffAnnouncement : strings.microphoneActionTurnedOnAnnouncement);
|
17183
17155
|
}, [strings.microphoneActionTurnedOffAnnouncement, strings.microphoneActionTurnedOnAnnouncement]);
|
17184
|
-
const onToggleClick = React.useCallback(() => __awaiter$
|
17156
|
+
const onToggleClick = React.useCallback(() => __awaiter$v(void 0, void 0, void 0, function* () {
|
17185
17157
|
if (onToggleMicrophone) {
|
17186
17158
|
try {
|
17187
17159
|
yield onToggleMicrophone();
|
@@ -17702,12 +17674,13 @@ const playFrames = react.memoizeFunction(() => react.keyframes({
|
|
17702
17674
|
* @private
|
17703
17675
|
*/
|
17704
17676
|
const emojiStyles = (backgroundImage, animationPlayState) => {
|
17677
|
+
const imageResourceUrl = `url(${backgroundImage})`;
|
17705
17678
|
return {
|
17706
17679
|
display: 'flex',
|
17707
17680
|
flexDirection: 'column',
|
17708
17681
|
height: '100%',
|
17709
17682
|
width: '100%',
|
17710
|
-
backgroundImage:
|
17683
|
+
backgroundImage: imageResourceUrl,
|
17711
17684
|
animationName: playFrames(),
|
17712
17685
|
animationDuration: '8.12s',
|
17713
17686
|
animationTimingFunction: `steps(102)`,
|
@@ -17765,7 +17738,7 @@ const reactionToolTipHostStyle = () => {
|
|
17765
17738
|
* @beta
|
17766
17739
|
*/
|
17767
17740
|
const ReactionButton = (props) => {
|
17768
|
-
var _a, _b;
|
17741
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
17769
17742
|
const localeStrings = useLocale$1().strings.reactionButton;
|
17770
17743
|
const strings = Object.assign(Object.assign({}, localeStrings), props.strings);
|
17771
17744
|
const theme = react.useTheme();
|
@@ -17780,31 +17753,41 @@ const ReactionButton = (props) => {
|
|
17780
17753
|
['applause', strings.applauseReactionTooltipContent],
|
17781
17754
|
['surprised', strings.surprisedReactionTooltipContent]
|
17782
17755
|
]);
|
17756
|
+
const emojiResource = new Map([
|
17757
|
+
['like', (_a = props.reactionResources.likeReaction) === null || _a === void 0 ? void 0 : _a.url],
|
17758
|
+
['heart', (_b = props.reactionResources.heartReaction) === null || _b === void 0 ? void 0 : _b.url],
|
17759
|
+
['laugh', (_c = props.reactionResources.laughReaction) === null || _c === void 0 ? void 0 : _c.url],
|
17760
|
+
['applause', (_d = props.reactionResources.applauseReaction) === null || _d === void 0 ? void 0 : _d.url],
|
17761
|
+
['surprised', (_e = props.reactionResources.surprisedReaction) === null || _e === void 0 ? void 0 : _e.url]
|
17762
|
+
]);
|
17783
17763
|
const calloutStyle = { root: { padding: 0 }, calloutMain: { padding: '0.5rem' } };
|
17784
17764
|
const calloutProps = {
|
17785
17765
|
gapSpace: 4,
|
17786
17766
|
styles: calloutStyle,
|
17787
17767
|
backgroundColor: isDarkThemed(theme) ? theme.palette.neutralLighter : ''
|
17788
17768
|
};
|
17789
|
-
const renderEmoji = (item, dismissMenu) => (React.createElement("div", { style: reactionEmojiMenuStyles() }, emojis.map((emoji, index) =>
|
17790
|
-
|
17791
|
-
|
17792
|
-
|
17769
|
+
const renderEmoji = (item, dismissMenu) => (React.createElement("div", { style: reactionEmojiMenuStyles() }, emojis.map((emoji, index) => {
|
17770
|
+
const resourceUrl = emojiResource.get(emoji);
|
17771
|
+
return (React.createElement(react.TooltipHost, { key: index, "data-ui-id": index, hidden: props.disableTooltip, content: emojiButtonTooltip.get(emoji), styles: reactionToolTipHostStyle(), calloutProps: Object.assign({}, calloutProps) },
|
17772
|
+
React.createElement(react.IconButton, { key: index, onClick: () => {
|
17773
|
+
props.onReactionClicked(emoji);
|
17774
|
+
setIsHoveredMap((prevMap) => {
|
17775
|
+
return new Map(prevMap).set(emoji, false);
|
17776
|
+
});
|
17777
|
+
dismissMenu();
|
17778
|
+
}, style: emojiStyles(resourceUrl ? resourceUrl : '', isHoveredMap.get(emoji) ? 'running' : 'paused'), onMouseEnter: () => setIsHoveredMap((prevMap) => {
|
17779
|
+
return new Map(prevMap).set(emoji, true);
|
17780
|
+
}), onMouseLeave: () => setIsHoveredMap((prevMap) => {
|
17793
17781
|
return new Map(prevMap).set(emoji, false);
|
17794
|
-
});
|
17795
|
-
|
17796
|
-
}, style: emojiStyles(reactionEmoji.get(emoji), isHoveredMap.get(emoji) ? 'running' : 'paused'), onMouseEnter: () => setIsHoveredMap((prevMap) => {
|
17797
|
-
return new Map(prevMap).set(emoji, true);
|
17798
|
-
}), onMouseLeave: () => setIsHoveredMap((prevMap) => {
|
17799
|
-
return new Map(prevMap).set(emoji, false);
|
17800
|
-
}) }))))));
|
17782
|
+
}) })));
|
17783
|
+
})));
|
17801
17784
|
const emojiList = [
|
17802
17785
|
{ key: 'reactions', itemType: react.ContextualMenuItemType.Normal, onRender: renderEmoji }
|
17803
17786
|
];
|
17804
17787
|
return (React.createElement(ControlBarButton, Object.assign({}, props, { className: react.mergeStyles(styles, props.styles), menuProps: {
|
17805
17788
|
shouldFocusOnMount: true,
|
17806
17789
|
items: emojiList
|
17807
|
-
}, onRenderIcon: (
|
17790
|
+
}, onRenderIcon: (_f = props.onRenderIcon) !== null && _f !== void 0 ? _f : onRenderIcon, strings: strings, labelKey: (_g = props.labelKey) !== null && _g !== void 0 ? _g : 'reactionButtonLabel', onRenderMenuIcon: () => React.createElement("div", null), disabled: props.disabled })));
|
17808
17791
|
};
|
17809
17792
|
/* @conditional-compile-remove(reaction) */
|
17810
17793
|
const reactionButtonStyles = (theme) => ({
|
@@ -18356,7 +18339,7 @@ const dtmfFrequencies = {
|
|
18356
18339
|
|
18357
18340
|
// Copyright (c) Microsoft Corporation.
|
18358
18341
|
// Licensed under the MIT License.
|
18359
|
-
var __awaiter$
|
18342
|
+
var __awaiter$u = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
18360
18343
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
18361
18344
|
return new (P || (P = Promise))(function (resolve, reject) {
|
18362
18345
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -18400,10 +18383,10 @@ const DialpadButton = (props) => {
|
|
18400
18383
|
const [buttonPressed, setButtonPressed] = React.useState(false);
|
18401
18384
|
const dtmfToneSound = React.useRef(new Tone(dtmfToneAudioContext, dtmfFrequencies[digit].f1, dtmfFrequencies[digit].f2));
|
18402
18385
|
const useLongPressProps = React.useMemo(() => ({
|
18403
|
-
onClick: () => __awaiter$
|
18386
|
+
onClick: () => __awaiter$u(void 0, void 0, void 0, function* () {
|
18404
18387
|
onClick(digit, index);
|
18405
18388
|
}),
|
18406
|
-
onLongPress: () => __awaiter$
|
18389
|
+
onLongPress: () => __awaiter$u(void 0, void 0, void 0, function* () {
|
18407
18390
|
onLongPress(digit, index);
|
18408
18391
|
}),
|
18409
18392
|
touchEventsOnly: isMobile
|
@@ -19548,7 +19531,7 @@ const _spokenLanguageToCaptionLanguage = {
|
|
19548
19531
|
|
19549
19532
|
// Copyright (c) Microsoft Corporation.
|
19550
19533
|
// Licensed under the MIT License.
|
19551
|
-
var __awaiter$
|
19534
|
+
var __awaiter$t = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
19552
19535
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
19553
19536
|
return new (P || (P = Promise))(function (resolve, reject) {
|
19554
19537
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -19591,7 +19574,7 @@ const _CaptionsSettingsModal = (props) => {
|
|
19591
19574
|
onDismissCaptionsSettings();
|
19592
19575
|
}
|
19593
19576
|
}, [onDismissCaptionsSettings]);
|
19594
|
-
const onConfirm = React.useCallback(() => __awaiter$
|
19577
|
+
const onConfirm = React.useCallback(() => __awaiter$t(void 0, void 0, void 0, function* () {
|
19595
19578
|
const spokenLanguageCode = selectedSpokenLanguage.key.toString();
|
19596
19579
|
const captionLanguageCode = selectedCaptionLanguage.key.toString();
|
19597
19580
|
if (isCaptionsFeatureActive) {
|
@@ -20679,7 +20662,7 @@ const findConditionalCompiledSelector = (component) => {
|
|
20679
20662
|
|
20680
20663
|
// Copyright (c) Microsoft Corporation.
|
20681
20664
|
// Licensed under the MIT License.
|
20682
|
-
var __awaiter$
|
20665
|
+
var __awaiter$s = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
20683
20666
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
20684
20667
|
return new (P || (P = Promise))(function (resolve, reject) {
|
20685
20668
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
@@ -20702,35 +20685,35 @@ const createDefaultChatHandlers = memoizeOne((chatClient, chatThreadClient) => {
|
|
20702
20685
|
let messageIterator = undefined;
|
20703
20686
|
let readReceiptIterator = undefined;
|
20704
20687
|
return {
|
20705
|
-
onSendMessage: (content, options) => __awaiter$
|
20688
|
+
onSendMessage: (content, options) => __awaiter$s(void 0, void 0, void 0, function* () {
|
20706
20689
|
const sendMessageRequest = {
|
20707
20690
|
content,
|
20708
20691
|
senderDisplayName: chatClient.getState().displayName
|
20709
20692
|
};
|
20710
20693
|
yield chatThreadClient.sendMessage(sendMessageRequest, options);
|
20711
20694
|
}),
|
20712
|
-
onUpdateMessage: (messageId, content, options) => __awaiter$
|
20695
|
+
onUpdateMessage: (messageId, content, options) => __awaiter$s(void 0, void 0, void 0, function* () {
|
20713
20696
|
const updatedMetadata = (options === null || options === void 0 ? void 0 : options.metadata) ? Object.assign({}, options.metadata) : {};
|
20714
20697
|
updatedMetadata.fileSharingMetadata = JSON.stringify((options === null || options === void 0 ? void 0 : options.attachmentMetadata) || []);
|
20715
20698
|
yield chatThreadClient.updateMessage(messageId, { content, metadata: updatedMetadata });
|
20716
20699
|
}),
|
20717
|
-
onDeleteMessage: (messageId) => __awaiter$
|
20700
|
+
onDeleteMessage: (messageId) => __awaiter$s(void 0, void 0, void 0, function* () {
|
20718
20701
|
yield chatThreadClient.deleteMessage(messageId);
|
20719
20702
|
}),
|
20720
20703
|
// This handler is designed for chatThread to consume
|
20721
|
-
onMessageSeen: (chatMessageId) => __awaiter$
|
20704
|
+
onMessageSeen: (chatMessageId) => __awaiter$s(void 0, void 0, void 0, function* () {
|
20722
20705
|
yield chatThreadClient.sendReadReceipt({ chatMessageId });
|
20723
20706
|
}),
|
20724
|
-
onTyping: () => __awaiter$
|
20707
|
+
onTyping: () => __awaiter$s(void 0, void 0, void 0, function* () {
|
20725
20708
|
yield chatThreadClient.sendTypingNotification();
|
20726
20709
|
}),
|
20727
|
-
onRemoveParticipant: (userId) => __awaiter$
|
20710
|
+
onRemoveParticipant: (userId) => __awaiter$s(void 0, void 0, void 0, function* () {
|
20728
20711
|
yield chatThreadClient.removeParticipant(fromFlatCommunicationIdentifier(userId));
|
20729
20712
|
}),
|
20730
|
-
updateThreadTopicName: (topicName) => __awaiter$
|
20713
|
+
updateThreadTopicName: (topicName) => __awaiter$s(void 0, void 0, void 0, function* () {
|
20731
20714
|
yield chatThreadClient.updateTopic(topicName);
|
20732
20715
|
}),
|
20733
|
-
onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$
|
20716
|
+
onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$s(void 0, void 0, void 0, function* () {
|
20734
20717
|
var _a, _b, _c;
|
20735
20718
|
if (messageIterator === undefined) {
|
20736
20719
|
// Lazy definition so that errors in the method call are reported correctly.
|
@@ -21166,24 +21149,47 @@ const extractAttachmentUrl = (attachment) => {
|
|
21166
21149
|
return attachment.attachmentType === 'file' && attachment.previewUrl ? attachment.previewUrl : attachment.url || '';
|
21167
21150
|
};
|
21168
21151
|
const processChatMessageContent = (message) => {
|
21169
|
-
var _a, _b, _c
|
21152
|
+
var _a, _b, _c;
|
21153
|
+
let content = (_a = message.content) === null || _a === void 0 ? void 0 : _a.message;
|
21170
21154
|
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
21171
|
-
if (
|
21172
|
-
const attachments = (
|
21155
|
+
if (content && ((_b = message.content) === null || _b === void 0 ? void 0 : _b.attachments) && sanitizedMessageContentType(message.type).includes('html')) {
|
21156
|
+
const attachments = (_c = message.content) === null || _c === void 0 ? void 0 : _c.attachments;
|
21157
|
+
// Fill in the src here
|
21158
|
+
const document = new DOMParser().parseFromString(content, 'text/html');
|
21159
|
+
document.querySelectorAll('img').forEach((img) => {
|
21160
|
+
var _a, _b, _c;
|
21161
|
+
const attachmentPreviewUrl = (_a = attachments.find((attachment) => attachment.id === img.id)) === null || _a === void 0 ? void 0 : _a.previewUrl;
|
21162
|
+
if (attachmentPreviewUrl) {
|
21163
|
+
const src = (_c = (_b = message.resourceCache) === null || _b === void 0 ? void 0 : _b[attachmentPreviewUrl]) !== null && _c !== void 0 ? _c : '';
|
21164
|
+
img.src = src;
|
21165
|
+
}
|
21166
|
+
});
|
21167
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
21168
|
+
content = document.documentElement.innerHTML;
|
21173
21169
|
const teamsImageHtmlContent = attachments
|
21174
|
-
.filter((attachment) => {
|
21175
|
-
|
21170
|
+
.filter((attachment) => {
|
21171
|
+
var _a, _b;
|
21172
|
+
return attachment.attachmentType === 'image' &&
|
21173
|
+
attachment.previewUrl !== undefined &&
|
21174
|
+
!((_b = (_a = message.content) === null || _a === void 0 ? void 0 : _a.message) === null || _b === void 0 ? void 0 : _b.includes(attachment.id));
|
21175
|
+
})
|
21176
|
+
.map((attachment) => generateImageAttachmentImgHtml(message, attachment))
|
21176
21177
|
.join('');
|
21177
21178
|
if (teamsImageHtmlContent) {
|
21178
|
-
return (
|
21179
|
+
return (content !== null && content !== void 0 ? content : '') + teamsImageHtmlContent;
|
21179
21180
|
}
|
21180
21181
|
}
|
21181
|
-
return
|
21182
|
+
return content;
|
21182
21183
|
};
|
21183
21184
|
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
21184
|
-
const generateImageAttachmentImgHtml = (attachment) => {
|
21185
|
-
|
21186
|
-
|
21185
|
+
const generateImageAttachmentImgHtml = (message, attachment) => {
|
21186
|
+
var _a, _b;
|
21187
|
+
if (attachment.previewUrl !== undefined) {
|
21188
|
+
const contentType = extractAttachmentContentTypeFromName(attachment.name);
|
21189
|
+
const src = (_b = (_a = message.resourceCache) === null || _a === void 0 ? void 0 : _a[attachment.previewUrl]) !== null && _b !== void 0 ? _b : '';
|
21190
|
+
return `\r\n<p><img alt="image" src="${src}" itemscope="${contentType}" id="${attachment.id}"></p>`;
|
21191
|
+
}
|
21192
|
+
return '';
|
21187
21193
|
};
|
21188
21194
|
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
21189
21195
|
const extractAttachmentContentTypeFromName = (name) => {
|
@@ -21637,6 +21643,131 @@ const Constants = {
|
|
21637
21643
|
*/
|
21638
21644
|
const chatStatefulLogger = logger.createClientLogger('communication-react:chat-stateful');
|
21639
21645
|
|
21646
|
+
var __awaiter$r = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
21647
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
21648
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
21649
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
21650
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
21651
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
21652
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
21653
|
+
});
|
21654
|
+
};
|
21655
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
21656
|
+
/**
|
21657
|
+
* @private
|
21658
|
+
*/
|
21659
|
+
class ResourceDownloadQueue {
|
21660
|
+
constructor(context, credential) {
|
21661
|
+
this._messagesNeedingResourceRetrieval = [];
|
21662
|
+
this.isActive = false;
|
21663
|
+
this._context = context;
|
21664
|
+
this._credential = credential;
|
21665
|
+
}
|
21666
|
+
containsMessageWithSameAttachments(message) {
|
21667
|
+
var _a, _b, _c;
|
21668
|
+
let contains = false;
|
21669
|
+
const incomingAttachment = (_a = message.content) === null || _a === void 0 ? void 0 : _a.attachments;
|
21670
|
+
if (incomingAttachment) {
|
21671
|
+
for (const m of this._messagesNeedingResourceRetrieval) {
|
21672
|
+
const existingAttachment = (_c = (_b = m.content) === null || _b === void 0 ? void 0 : _b.attachments) !== null && _c !== void 0 ? _c : [];
|
21673
|
+
contains = incomingAttachment.every((element, index) => element === existingAttachment[index]);
|
21674
|
+
if (contains) {
|
21675
|
+
break;
|
21676
|
+
}
|
21677
|
+
}
|
21678
|
+
}
|
21679
|
+
return contains;
|
21680
|
+
}
|
21681
|
+
addMessage(message) {
|
21682
|
+
// make a copy of message and add to queue
|
21683
|
+
const copy = Object.assign({}, message);
|
21684
|
+
this._messagesNeedingResourceRetrieval.push(copy);
|
21685
|
+
}
|
21686
|
+
startQueue(threadId, operation) {
|
21687
|
+
return __awaiter$r(this, void 0, void 0, function* () {
|
21688
|
+
if (this.isActive) {
|
21689
|
+
return;
|
21690
|
+
}
|
21691
|
+
while (this._messagesNeedingResourceRetrieval.length > 0) {
|
21692
|
+
this.isActive = true;
|
21693
|
+
const message = this._messagesNeedingResourceRetrieval.shift();
|
21694
|
+
if (!message) {
|
21695
|
+
this.isActive = false;
|
21696
|
+
continue;
|
21697
|
+
}
|
21698
|
+
try {
|
21699
|
+
const newMessage = yield operation(message, this._credential);
|
21700
|
+
if (newMessage) {
|
21701
|
+
this.isActive = false;
|
21702
|
+
this._context.setChatMessage(threadId, newMessage);
|
21703
|
+
}
|
21704
|
+
}
|
21705
|
+
catch (error) {
|
21706
|
+
console.log('Downloading Resource error: ', error);
|
21707
|
+
}
|
21708
|
+
}
|
21709
|
+
});
|
21710
|
+
}
|
21711
|
+
}
|
21712
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
21713
|
+
/**
|
21714
|
+
* @private
|
21715
|
+
*/
|
21716
|
+
const requestAttachments = (message, credential) => __awaiter$r(void 0, void 0, void 0, function* () {
|
21717
|
+
var _a;
|
21718
|
+
const attachments = (_a = message.content) === null || _a === void 0 ? void 0 : _a.attachments;
|
21719
|
+
if (message.type === 'html' && attachments) {
|
21720
|
+
if (message.resourceCache === undefined) {
|
21721
|
+
message.resourceCache = {};
|
21722
|
+
}
|
21723
|
+
for (const attachment of attachments) {
|
21724
|
+
if (attachment.previewUrl) {
|
21725
|
+
const previewUrl = attachment.previewUrl;
|
21726
|
+
try {
|
21727
|
+
const src = yield fetchImageSource(previewUrl, credential);
|
21728
|
+
message.resourceCache[previewUrl] = src;
|
21729
|
+
}
|
21730
|
+
catch (error) {
|
21731
|
+
throw new ResourceDownloadError(message);
|
21732
|
+
}
|
21733
|
+
}
|
21734
|
+
}
|
21735
|
+
}
|
21736
|
+
return message;
|
21737
|
+
});
|
21738
|
+
/**
|
21739
|
+
* @private
|
21740
|
+
*/
|
21741
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
21742
|
+
const fetchImageSource = (src, credential) => __awaiter$r(void 0, void 0, void 0, function* () {
|
21743
|
+
function fetchWithAuthentication(url, token) {
|
21744
|
+
return __awaiter$r(this, void 0, void 0, function* () {
|
21745
|
+
const headers = new Headers();
|
21746
|
+
headers.append('Authorization', `Bearer ${token}`);
|
21747
|
+
try {
|
21748
|
+
return yield fetch(url, { headers });
|
21749
|
+
}
|
21750
|
+
catch (err) {
|
21751
|
+
throw new ChatError('ChatThreadClient.getMessage', err);
|
21752
|
+
}
|
21753
|
+
});
|
21754
|
+
}
|
21755
|
+
const accessToken = yield credential.getToken();
|
21756
|
+
const response = yield fetchWithAuthentication(src, accessToken.token);
|
21757
|
+
const blob = yield response.blob();
|
21758
|
+
return URL.createObjectURL(blob);
|
21759
|
+
});
|
21760
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
21761
|
+
/**
|
21762
|
+
* @private
|
21763
|
+
*/
|
21764
|
+
class ResourceDownloadError extends Error {
|
21765
|
+
constructor(chatMessageWithStatus) {
|
21766
|
+
super();
|
21767
|
+
this.chatMessageWithStatus = chatMessageWithStatus;
|
21768
|
+
}
|
21769
|
+
}
|
21770
|
+
|
21640
21771
|
// Copyright (c) Microsoft Corporation.
|
21641
21772
|
// Licensed under the MIT License.
|
21642
21773
|
var __awaiter$q = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
@@ -21655,7 +21786,8 @@ immer.enablePatches();
|
|
21655
21786
|
* @private
|
21656
21787
|
*/
|
21657
21788
|
let ChatContext$1 = class ChatContext {
|
21658
|
-
constructor(maxListeners
|
21789
|
+
constructor(maxListeners,
|
21790
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ credential) {
|
21659
21791
|
this._state = {
|
21660
21792
|
userId: { id: '' },
|
21661
21793
|
displayName: '',
|
@@ -21664,8 +21796,14 @@ let ChatContext$1 = class ChatContext {
|
|
21664
21796
|
};
|
21665
21797
|
this._batchMode = false;
|
21666
21798
|
this.typingIndicatorInterval = undefined;
|
21799
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
21800
|
+
this._messageQueue = undefined;
|
21667
21801
|
this._logger = logger.createClientLogger('communication-react:chat-context');
|
21668
21802
|
this._emitter = new EventEmitter();
|
21803
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
21804
|
+
if (credential) {
|
21805
|
+
this._messageQueue = new ResourceDownloadQueue(this, credential);
|
21806
|
+
}
|
21669
21807
|
if (maxListeners) {
|
21670
21808
|
this._emitter.setMaxListeners(maxListeners);
|
21671
21809
|
}
|
@@ -21887,6 +22025,8 @@ let ChatContext$1 = class ChatContext {
|
|
21887
22025
|
this.startTypingIndicatorCleanUp();
|
21888
22026
|
}
|
21889
22027
|
setChatMessage(threadId, message) {
|
22028
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
22029
|
+
this.parseAttachments(threadId, message);
|
21890
22030
|
const { id: messageId, clientMessageId } = message;
|
21891
22031
|
if (messageId || clientMessageId) {
|
21892
22032
|
this.modifyState((draft) => {
|
@@ -21905,6 +22045,20 @@ let ChatContext$1 = class ChatContext {
|
|
21905
22045
|
});
|
21906
22046
|
}
|
21907
22047
|
}
|
22048
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
22049
|
+
parseAttachments(threadId, message) {
|
22050
|
+
var _a, _b;
|
22051
|
+
const attachments = (_a = message.content) === null || _a === void 0 ? void 0 : _a.attachments;
|
22052
|
+
if (message.type === 'html' && ((_b = message.content) === null || _b === void 0 ? void 0 : _b.message) && attachments && attachments.length > 0) {
|
22053
|
+
if (this._messageQueue &&
|
22054
|
+
!this._messageQueue.containsMessageWithSameAttachments(message) &&
|
22055
|
+
message.resourceCache === undefined) {
|
22056
|
+
// Need to discuss retry logic in case of failure
|
22057
|
+
this._messageQueue.addMessage(message);
|
22058
|
+
this._messageQueue.startQueue(threadId, requestAttachments);
|
22059
|
+
}
|
22060
|
+
}
|
22061
|
+
}
|
21908
22062
|
/**
|
21909
22063
|
* Tees any errors encountered in an async function to the state.
|
21910
22064
|
*
|
@@ -22599,7 +22753,8 @@ const _createStatefulChatClientInner = (args, options, telemetryImplementationHi
|
|
22599
22753
|
* @internal
|
22600
22754
|
*/
|
22601
22755
|
const _createStatefulChatClientWithDeps = (chatClient, args, options) => {
|
22602
|
-
const context = new ChatContext$1(options === null || options === void 0 ? void 0 : options.maxStateChangeListeners
|
22756
|
+
const context = new ChatContext$1(options === null || options === void 0 ? void 0 : options.maxStateChangeListeners,
|
22757
|
+
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ args.credential);
|
22603
22758
|
let eventSubscriber;
|
22604
22759
|
context.updateChatConfig(communicationCommon.getIdentifierKind(args.userId), args.displayName);
|
22605
22760
|
const proxy = new Proxy(chatClient, proxyChatClient);
|
@@ -24345,17 +24500,6 @@ const ChatScreen = (props) => {
|
|
24345
24500
|
const onRenderFileDownloads = React.useCallback((userId, message) => (React.createElement(_FileDownloadCards, { userId: userId, fileMetadata: message.files || [], downloadHandler: fileSharing === null || fileSharing === void 0 ? void 0 : fileSharing.downloadHandler, onDownloadErrorMessage: (errorMessage) => {
|
24346
24501
|
setDownloadErrorMessage(errorMessage);
|
24347
24502
|
} })), [fileSharing === null || fileSharing === void 0 ? void 0 : fileSharing.downloadHandler]);
|
24348
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
24349
|
-
const onRenderInlineAttachment = React.useCallback((attachment) => __awaiter$j(void 0, void 0, void 0, function* () {
|
24350
|
-
const entry = {};
|
24351
|
-
attachment.forEach((target) => {
|
24352
|
-
if (target.attachmentType === 'inlineImage' && target.previewUrl) {
|
24353
|
-
entry[target.id] = target.previewUrl;
|
24354
|
-
}
|
24355
|
-
});
|
24356
|
-
const blob = yield adapter.downloadAttachments({ attachmentUrls: entry });
|
24357
|
-
return blob;
|
24358
|
-
}), [adapter]);
|
24359
24503
|
/* @conditional-compile-remove(image-gallery) */
|
24360
24504
|
const onInlineImageClicked = React.useCallback((attachmentId, messageId) => __awaiter$j(void 0, void 0, void 0, function* () {
|
24361
24505
|
var _a, _b;
|
@@ -24394,6 +24538,7 @@ const ChatScreen = (props) => {
|
|
24394
24538
|
return;
|
24395
24539
|
}
|
24396
24540
|
if (attachment.attachmentType === 'inlineImage' && attachment.url) {
|
24541
|
+
// TBD: Need to begin investigating how to download HQ images.
|
24397
24542
|
const blob = yield adapter.downloadAttachments({ attachmentUrls: { [attachment.id]: attachment.url } });
|
24398
24543
|
if (blob[0]) {
|
24399
24544
|
const blobUrl = blob[0].blobUrl;
|
@@ -24444,8 +24589,6 @@ const ChatScreen = (props) => {
|
|
24444
24589
|
React.createElement(MessageThread, Object.assign({}, messageThreadProps, { onRenderAvatar: onRenderAvatarCallback, onRenderMessage: onRenderMessage,
|
24445
24590
|
/* @conditional-compile-remove(file-sharing) */
|
24446
24591
|
onRenderFileDownloads: onRenderFileDownloads,
|
24447
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
24448
|
-
onFetchAttachments: onRenderInlineAttachment,
|
24449
24592
|
/* @conditional-compile-remove(image-gallery) */
|
24450
24593
|
onInlineImageClicked: onInlineImageClicked, numberOfChatMessagesToReload: defaultNumberOfChatMessagesToReload, styles: messageThreadStyles })),
|
24451
24594
|
React.createElement(react.Stack, { className: react.mergeStyles(sendboxContainerStyles) },
|
@@ -26196,7 +26339,7 @@ const Reaction = (props) => {
|
|
26196
26339
|
const reactionButtonProps = usePropsFor$1(ReactionButton);
|
26197
26340
|
const styles = React.useMemo(() => { var _a; return concatButtonBaseStyles((_a = props.styles) !== null && _a !== void 0 ? _a : {}); }, [props.styles]);
|
26198
26341
|
const reactionButtonDisabled = isDisabled(props.option) || reactionButtonProps.disabled;
|
26199
|
-
return (React.createElement(ReactionButton, Object.assign({ "data-ui-id": "call-composite-reaction-button" }, reactionButtonProps, { showLabel: props.displayType !== 'compact', disabled: reactionButtonDisabled || props.disabled, styles: styles, disableTooltip: props.disableTooltip, persistMenu: true })));
|
26342
|
+
return (React.createElement(ReactionButton, Object.assign({ "data-ui-id": "call-composite-reaction-button" }, reactionButtonProps, { showLabel: props.displayType !== 'compact', disabled: reactionButtonDisabled || props.disabled, styles: styles, disableTooltip: props.disableTooltip, persistMenu: true, reactionResources: props.reactionResource })));
|
26200
26343
|
};
|
26201
26344
|
/* @conditional-compile-remove(reaction) */
|
26202
26345
|
const isDisabled = (option) => {
|
@@ -26366,6 +26509,8 @@ const CallControls = (props) => {
|
|
26366
26509
|
showDevicesButtonInControlBar = false;
|
26367
26510
|
showMoreButton = isEnabled$2(options === null || options === void 0 ? void 0 : options.moreButton);
|
26368
26511
|
}
|
26512
|
+
/* @conditional-compile-remove(reaction) */
|
26513
|
+
const reactionResources = adapter.getState().reactions;
|
26369
26514
|
/* @conditional-compile-remove(raise-hand) */
|
26370
26515
|
const raiseHandButtonIsEnabled = isEnabled$2(options === null || options === void 0 ? void 0 : options.raiseHandButton);
|
26371
26516
|
/* @conditional-compile-remove(raise-hand) */
|
@@ -26461,7 +26606,7 @@ const CallControls = (props) => {
|
|
26461
26606
|
microphoneButtonIsEnabled && (React.createElement(Microphone, { displayType: options === null || options === void 0 ? void 0 : options.displayType, disabled: isDisabled$4(options === null || options === void 0 ? void 0 : options.microphoneButton) })),
|
26462
26607
|
cameraButtonIsEnabled && (React.createElement(Camera, { displayType: options === null || options === void 0 ? void 0 : options.displayType, disabled: isDisabled$4(options === null || options === void 0 ? void 0 : options.cameraButton) })),
|
26463
26608
|
/* @conditional-compile-remove(reaction) */
|
26464
|
-
showReactionButtonInControlBar && React.createElement(Reaction, { displayType: options === null || options === void 0 ? void 0 : options.displayType }),
|
26609
|
+
showReactionButtonInControlBar && reactionResources && (React.createElement(Reaction, { displayType: options === null || options === void 0 ? void 0 : options.displayType, reactionResource: reactionResources })),
|
26465
26610
|
/* @conditional-compile-remove(raise-hand) */ showRaiseHandButtonInControlBar &&
|
26466
26611
|
/* @conditional-compile-remove(rooms) */ !hideRaiseHandButtonInRoomsCall && (React.createElement(RaiseHand, { displayType: options === null || options === void 0 ? void 0 : options.displayType })),
|
26467
26612
|
screenShareButtonIsEnabled && (React.createElement(ScreenShare, { option: options === null || options === void 0 ? void 0 : options.screenShareButton, displayType: options === null || options === void 0 ? void 0 : options.displayType, disabled: isDisabled$4(options === null || options === void 0 ? void 0 : options.screenShareButton) })),
|
@@ -27196,6 +27341,8 @@ const CommonCallControlBar = (props) => {
|
|
27196
27341
|
const role = (_a = props.callAdapter.getState().call) === null || _a === void 0 ? void 0 : _a.role;
|
27197
27342
|
/*@conditional-compile-remove(rooms) */
|
27198
27343
|
const hideRaiseHandButtonInRoomsCall = props.callAdapter.getState().isRoomsCall && role && ['Consumer', 'Unknown'].includes(role);
|
27344
|
+
/*@conditional-compile-remove(reaction) */
|
27345
|
+
const reactionResources = props.callAdapter.getState().reactions;
|
27199
27346
|
return (React.createElement("div", { ref: controlBarSizeRef },
|
27200
27347
|
React.createElement(CallAdapterProvider, { adapter: props.callAdapter },
|
27201
27348
|
/* @conditional-compile-remove(close-captions) */ showCaptionsSettingsModal && (React.createElement(CaptionsSettingsModal, { showCaptionsSettingsModal: showCaptionsSettingsModal, onDismissCaptionsSettings: onDismissCaptionsSettings, changeCaptionLanguage: props.isCaptionsOn }))),
|
@@ -27216,7 +27363,10 @@ const CommonCallControlBar = (props) => {
|
|
27216
27363
|
/* @conditional-compile-remove(video-background-effects) */
|
27217
27364
|
onClickVideoEffects: props.onClickVideoEffects, componentRef: props.cameraButtonRef, disableTooltip: props.mobileView })),
|
27218
27365
|
/* @conditional-compile-remove(reaction) */
|
27219
|
-
!props.mobileView &&
|
27366
|
+
!props.mobileView &&
|
27367
|
+
isReactionAllowed &&
|
27368
|
+
isEnabled$1(options.reactionButton) &&
|
27369
|
+
reactionResources && (React.createElement(Reaction, { displayType: options.displayType, styles: commonButtonStyles, disabled: props.disableButtonsForHoldScreen, reactionResource: reactionResources })),
|
27220
27370
|
/* @conditional-compile-remove(raise-hand) */ !props.mobileView &&
|
27221
27371
|
isEnabled$1(options.raiseHandButton) &&
|
27222
27372
|
/* @conditional-compile-remove(rooms) */ !hideRaiseHandButtonInRoomsCall && (React.createElement(RaiseHand, { displayType: options.displayType, styles: commonButtonStyles,
|
@@ -27531,7 +27681,7 @@ const inferCallWithChatControlOptions = (callWithChatControls) => {
|
|
27531
27681
|
};
|
27532
27682
|
/** @private */
|
27533
27683
|
const MoreDrawer = (props) => {
|
27534
|
-
var _a, _b, _c, _d;
|
27684
|
+
var _a, _b, _c, _d, _e;
|
27535
27685
|
/* @conditional-compile-remove(close-captions) */
|
27536
27686
|
const theme = react.useTheme();
|
27537
27687
|
/* @conditional-compile-remove(rooms) */
|
@@ -27542,6 +27692,12 @@ const MoreDrawer = (props) => {
|
|
27542
27692
|
const localeStrings = useLocale();
|
27543
27693
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
27544
27694
|
const holdButtonProps = usePropsFor$1(HoldButton);
|
27695
|
+
/* @conditional-compile-remove(dtmf-dialer) */
|
27696
|
+
const callees = useSelector$1(getTargetCallees);
|
27697
|
+
/* @conditional-compile-remove(dtmf-dialer) */
|
27698
|
+
const allowDtmfDialer = showDtmfDialer(callees);
|
27699
|
+
/* @conditional-compile-remove(dtmf-dialer) */
|
27700
|
+
const [dtmfDialerChecked, setDtmfDialerChecked] = React.useState((_a = props.dtmfDialerPresent) !== null && _a !== void 0 ? _a : false);
|
27545
27701
|
/* @conditional-compile-remove(raise-hand) */
|
27546
27702
|
const raiseHandButtonProps = usePropsFor$1(RaiseHandButton);
|
27547
27703
|
const onSpeakerItemClick = React.useCallback((_ev, itemKey) => {
|
@@ -27571,7 +27727,7 @@ const MoreDrawer = (props) => {
|
|
27571
27727
|
onItemClick: onSpeakerItemClick,
|
27572
27728
|
secondaryIconProps: isDeviceSelected(speaker, props.selectedSpeaker) ? { iconName: 'Accept' } : undefined
|
27573
27729
|
})),
|
27574
|
-
secondaryText: (
|
27730
|
+
secondaryText: (_b = props.selectedSpeaker) === null || _b === void 0 ? void 0 : _b.name
|
27575
27731
|
});
|
27576
27732
|
}
|
27577
27733
|
const { microphones, onSelectMicrophone } = props;
|
@@ -27606,9 +27762,34 @@ const MoreDrawer = (props) => {
|
|
27606
27762
|
secondaryIconProps: isDeviceSelected(mic, props.selectedMicrophone) ? { iconName: 'Accept' } : undefined,
|
27607
27763
|
disabled: drawerSelectionOptions !== false ? isDisabled$4(drawerSelectionOptions.microphoneButton) : undefined
|
27608
27764
|
})),
|
27609
|
-
secondaryText: (
|
27765
|
+
secondaryText: (_c = props.selectedMicrophone) === null || _c === void 0 ? void 0 : _c.name
|
27610
27766
|
});
|
27611
27767
|
}
|
27768
|
+
/* @conditional-compile-remove(dtmf-dialer) */
|
27769
|
+
const dtmfDialerScreenOption = {
|
27770
|
+
itemKey: 'dtmfDialerScreenKey',
|
27771
|
+
text: !dtmfDialerChecked
|
27772
|
+
? localeStrings.strings.call.dtmfDialerMoreButtonLabelOn
|
27773
|
+
: localeStrings.strings.call.dtmfDialerMoreButtonLabelOff,
|
27774
|
+
onItemClick: () => {
|
27775
|
+
if (props.onSetDialpadPage) {
|
27776
|
+
props.onSetDialpadPage();
|
27777
|
+
}
|
27778
|
+
setDtmfDialerChecked(!dtmfDialerChecked);
|
27779
|
+
onLightDismiss();
|
27780
|
+
},
|
27781
|
+
iconProps: {
|
27782
|
+
iconName: 'DtmfDialpadButton',
|
27783
|
+
styles: { root: { lineHeight: 0 } }
|
27784
|
+
}
|
27785
|
+
};
|
27786
|
+
/* @conditional-compile-remove(dtmf-dialer) */
|
27787
|
+
/**
|
27788
|
+
* Only render the dtmf dialer if the dialpad for PSTN calls is not present
|
27789
|
+
*/
|
27790
|
+
if (props.onSetDialpadPage && allowDtmfDialer) {
|
27791
|
+
drawerMenuItems.push(dtmfDialerScreenOption);
|
27792
|
+
}
|
27612
27793
|
/* @conditional-compile-remove(gallery-layouts) */
|
27613
27794
|
const galleryLayoutOptions = {
|
27614
27795
|
itemKey: 'galleryPositionKey',
|
@@ -27662,7 +27843,7 @@ const MoreDrawer = (props) => {
|
|
27662
27843
|
secondaryIconProps: props.userSetGalleryLayout === 'default' ? { iconName: 'Accept' } : undefined
|
27663
27844
|
};
|
27664
27845
|
/* @conditional-compile-remove(gallery-layout-composite) */
|
27665
|
-
(
|
27846
|
+
(_d = galleryLayoutOptions.subMenuProps) === null || _d === void 0 ? void 0 : _d.push(galleryOption);
|
27666
27847
|
/* @conditional-compile-remove(gallery-layouts) */
|
27667
27848
|
drawerMenuItems.push(galleryLayoutOptions);
|
27668
27849
|
if (drawerSelectionOptions !== false && isEnabled(drawerSelectionOptions === null || drawerSelectionOptions === void 0 ? void 0 : drawerSelectionOptions.peopleButton)) {
|
@@ -27689,7 +27870,7 @@ const MoreDrawer = (props) => {
|
|
27689
27870
|
});
|
27690
27871
|
}
|
27691
27872
|
/*@conditional-compile-remove(rooms) */
|
27692
|
-
const role = (
|
27873
|
+
const role = (_e = callAdapter.getState().call) === null || _e === void 0 ? void 0 : _e.role;
|
27693
27874
|
/*@conditional-compile-remove(rooms) */
|
27694
27875
|
const hideRaiseHandButtonInRoomsCall = callAdapter.getState().isRoomsCall && role && ['Consumer', 'Unknown'].includes(role);
|
27695
27876
|
/* @conditional-compile-remove(raise-hand) */
|
@@ -27715,20 +27896,6 @@ const MoreDrawer = (props) => {
|
|
27715
27896
|
}
|
27716
27897
|
});
|
27717
27898
|
}
|
27718
|
-
/*@conditional-compile-remove(PSTN-calls) */
|
27719
|
-
// dtmf tone sending only works for 1:1 PSTN call
|
27720
|
-
if (drawerSelectionOptions !== false && props.onClickShowDialpad) {
|
27721
|
-
drawerMenuItems.push({
|
27722
|
-
itemKey: 'showDialpadKey',
|
27723
|
-
disabled: props.disableButtonsForHoldScreen,
|
27724
|
-
text: localeStrings.strings.callWithChat.openDtmfDialpadLabel,
|
27725
|
-
onItemClick: () => {
|
27726
|
-
props.onClickShowDialpad && props.onClickShowDialpad();
|
27727
|
-
onLightDismiss();
|
27728
|
-
},
|
27729
|
-
iconProps: { iconName: 'Dialpad', styles: { root: { lineHeight: 0 } } }
|
27730
|
-
});
|
27731
|
-
}
|
27732
27899
|
/* @conditional-compile-remove(close-captions) */
|
27733
27900
|
//Captions drawer menu
|
27734
27901
|
const supportedSpokenLanguageStrings = useLocale().strings.call.spokenLanguageStrings;
|
@@ -29506,7 +29673,11 @@ const CallArrangement = (props) => {
|
|
29506
29673
|
/* @conditional-compile-remove(gallery-layouts) */
|
29507
29674
|
onUserSetGalleryLayout: props.onUserSetGalleryLayoutChange,
|
29508
29675
|
/* @conditional-compile-remove(gallery-layouts) */
|
29509
|
-
userSetGalleryLayout: props.userSetGalleryLayout
|
29676
|
+
userSetGalleryLayout: props.userSetGalleryLayout,
|
29677
|
+
/* @conditional-compile-remove(dtmf-dialer) */
|
29678
|
+
onSetDialpadPage: props.onSetDialpadPage,
|
29679
|
+
/* @conditional-compile-remove(dtmf-dialer) */
|
29680
|
+
dtmfDialerPresent: props.dtmfDialerPresent }))),
|
29510
29681
|
/* @conditional-compile-remove(PSTN-calls) */
|
29511
29682
|
((_h = props.callControlProps) === null || _h === void 0 ? void 0 : _h.options) !== false && showDtmfDialpad && (React.createElement(react.Stack, { styles: drawerContainerStylesValue },
|
29512
29683
|
React.createElement(SendDtmfDialpad, { isMobile: props.mobileView, strings: dialpadStrings, showDialpad: showDtmfDialpad, onDismissDialpad: onDismissDtmfDialpad }))),
|
@@ -29607,6 +29778,8 @@ const MediaGallery = (props) => {
|
|
29607
29778
|
const containerHeight = _useContainerHeight(containerRef);
|
29608
29779
|
/* @conditional-compile-remove(click-to-call) */ /* @conditional-compile-remove(rooms) */ /* @conditional-compile-remove(vertical-gallery) */
|
29609
29780
|
const containerAspectRatio = containerWidth && containerHeight ? containerWidth / containerHeight : 0;
|
29781
|
+
/* @conditional-compile-remove(reaction) */
|
29782
|
+
const reactionResources = adapter.getState().reactions;
|
29610
29783
|
const layoutBasedOnTilePosition = localVideoTileLayoutTrampoline(
|
29611
29784
|
/* @conditional-compile-remove(click-to-call) */ (_b = props.localVideoTileOptions) === null || _b === void 0 ? void 0 : _b.position);
|
29612
29785
|
const cameraSwitcherProps = React.useMemo(() => {
|
@@ -29654,7 +29827,9 @@ const MediaGallery = (props) => {
|
|
29654
29827
|
? 'hidden'
|
29655
29828
|
: props.isMobile && containerAspectRatio < 1
|
29656
29829
|
? '9:16'
|
29657
|
-
: '16:9'
|
29830
|
+
: '16:9',
|
29831
|
+
/* @conditional-compile-remove(reaction) */
|
29832
|
+
reactionResources: reactionResources })));
|
29658
29833
|
}, [
|
29659
29834
|
videoGalleryProps,
|
29660
29835
|
props.isMobile,
|
@@ -29674,7 +29849,9 @@ const MediaGallery = (props) => {
|
|
29674
29849
|
containerAspectRatio,
|
29675
29850
|
/* @conditional-compile-remove(gallery-layouts) */
|
29676
29851
|
props.userSetGalleryLayout,
|
29677
|
-
layoutBasedOnTilePosition
|
29852
|
+
layoutBasedOnTilePosition,
|
29853
|
+
/* @conditional-compile-remove(reaction) */
|
29854
|
+
reactionResources
|
29678
29855
|
]);
|
29679
29856
|
return (React.createElement("div", { ref: containerRef, style: mediaGalleryContainerStyles },
|
29680
29857
|
React.createElement(Announcer$1, { announcementString: announcerString, ariaLive: 'polite' }),
|
@@ -32710,7 +32887,8 @@ class CallContext {
|
|
32710
32887
|
onResolveVideoEffectDependency: (_c = options === null || options === void 0 ? void 0 : options.videoBackgroundOptions) === null || _c === void 0 ? void 0 : _c.onResolveDependency,
|
32711
32888
|
/* @conditional-compile-remove(video-background-effects) */ selectedVideoBackgroundEffect: undefined,
|
32712
32889
|
cameraStatus: undefined,
|
32713
|
-
/* @conditional-compile-remove(calling-sounds) */ sounds: options === null || options === void 0 ? void 0 : options.callingSounds
|
32890
|
+
/* @conditional-compile-remove(calling-sounds) */ sounds: options === null || options === void 0 ? void 0 : options.callingSounds,
|
32891
|
+
/* @conditional-compile-remove(reaction) */ reactions: options === null || options === void 0 ? void 0 : options.reactionResources
|
32714
32892
|
};
|
32715
32893
|
this.emitter.setMaxListeners((_d = options === null || options === void 0 ? void 0 : options.maxListeners) !== null && _d !== void 0 ? _d : 50);
|
32716
32894
|
this.bindPublicMethods();
|