@azure/communication-react 1.0.0-alpha-20211126.11.0 → 1.0.0-alpha
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 +229 -4
- package/dist/dist-cjs/communication-react/index.js +1300 -264
- 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/calling-stateful-client/src/StreamUtils.d.ts.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js +6 -3
- package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js +1 -1
- package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/CameraButton.d.ts +3 -1
- package/dist/dist-esm/react-components/src/components/CameraButton.d.ts.map +1 -1
- package/dist/dist-esm/react-components/src/components/CameraButton.js +4 -4
- package/dist/dist-esm/react-components/src/components/CameraButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ControlBarButton.d.ts +5 -1
- package/dist/dist-esm/react-components/src/components/ControlBarButton.d.ts.map +1 -1
- package/dist/dist-esm/react-components/src/components/ControlBarButton.js +10 -12
- package/dist/dist-esm/react-components/src/components/ControlBarButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.js +1 -1
- package/dist/dist-esm/react-components/src/components/MicrophoneButton.d.ts +2 -0
- package/dist/dist-esm/react-components/src/components/MicrophoneButton.d.ts.map +1 -1
- package/dist/dist-esm/react-components/src/components/MicrophoneButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.d.ts +2 -1
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.d.ts.map +1 -1
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +7 -5
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ScreenShareButton.d.ts +2 -0
- package/dist/dist-esm/react-components/src/components/ScreenShareButton.d.ts.map +1 -1
- package/dist/dist-esm/react-components/src/components/ScreenShareButton.js +18 -2
- package/dist/dist-esm/react-components/src/components/ScreenShareButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.d.ts +9 -2
- package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.d.ts.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.js +14 -8
- package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +3 -2
- package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery.js +13 -10
- package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/ControlBar.styles.d.ts +0 -4
- package/dist/dist-esm/react-components/src/components/styles/ControlBar.styles.d.ts.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/ControlBar.styles.js +8 -10
- package/dist/dist-esm/react-components/src/components/styles/ControlBar.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/VideoGallery.styles.d.ts +10 -0
- package/dist/dist-esm/react-components/src/components/styles/VideoGallery.styles.d.ts.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/VideoGallery.styles.js +15 -17
- package/dist/dist-esm/react-components/src/components/styles/VideoGallery.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +3 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +3 -5
- 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/ExpandedLocalVideoTile.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ExpandedLocalVideoTile.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +20 -17
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +3 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallControls.styles.d.ts +1 -5
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallControls.styles.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallControls.styles.js +0 -12
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallControls.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts +7 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +14 -7
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/ChatButton.d.ts +7 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/ChatButton.d.ts.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/ChatButton.js +16 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/ChatButton.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/MeetingCallControlBar.d.ts +19 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/MeetingCallControlBar.d.ts.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/MeetingCallControlBar.js +38 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/MeetingCallControlBar.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/MeetingComposite.d.ts +37 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/MeetingComposite.d.ts.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/MeetingComposite.js +59 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/MeetingComposite.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/PeopleButton.d.ts +7 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/PeopleButton.d.ts.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/PeopleButton.js +16 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/PeopleButton.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/SidePane.d.ts +25 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/SidePane.d.ts.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/SidePane.js +76 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/SidePane.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/AzureCommunicationMeetingAdapter.d.ts +129 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/AzureCommunicationMeetingAdapter.d.ts.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/AzureCommunicationMeetingAdapter.js +385 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/AzureCommunicationMeetingAdapter.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingAdapter.d.ts +73 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingAdapter.d.ts.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingAdapter.js +4 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingAdapter.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingBackedCallAdapter.d.ts +40 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingBackedCallAdapter.d.ts.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingBackedCallAdapter.js +100 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingBackedCallAdapter.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingBackedChatAdapter.d.ts +30 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingBackedChatAdapter.d.ts.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingBackedChatAdapter.js +79 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingBackedChatAdapter.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/index.d.ts +10 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/index.d.ts.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/index.js +5 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/index.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingAdapterState.d.ts +50 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingAdapterState.d.ts.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingAdapterState.js +50 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingAdapterState.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingCompositePage.d.ts +21 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingCompositePage.d.ts.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingCompositePage.js +41 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingCompositePage.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingEndReason.d.ts +8 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingEndReason.d.ts.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingEndReason.js +4 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingEndReason.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingParticipants.d.ts +35 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingParticipants.d.ts.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingParticipants.js +51 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingParticipants.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingState.d.ts +42 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingState.d.ts.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingState.js +72 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingState.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/styles/MeetingCompositeStyles.d.ts +6 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/styles/MeetingCompositeStyles.d.ts.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/styles/MeetingCompositeStyles.js +17 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/styles/MeetingCompositeStyles.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/styles/SidePane.styles.d.ts +38 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/styles/SidePane.styles.d.ts.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/styles/SidePane.styles.js +63 -0
- package/dist/dist-esm/react-composites/src/composites/MeetingComposite/styles/SidePane.styles.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/index.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/index.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/index.js +1 -0
- package/dist/dist-esm/react-composites/src/composites/index.js.map +1 -1
- package/package.json +7 -7
|
@@ -187,7 +187,7 @@ const fromFlatCommunicationIdentifier = (id) => {
|
|
|
187
187
|
// Copyright (c) Microsoft Corporation.
|
|
188
188
|
// Licensed under the MIT license.
|
|
189
189
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
|
190
|
-
var telemetryVersion = '1.0.0-alpha
|
|
190
|
+
var telemetryVersion = '1.0.0-alpha+20211203.0008.0';
|
|
191
191
|
|
|
192
192
|
// Copyright (c) Microsoft Corporation.
|
|
193
193
|
/**
|
|
@@ -291,7 +291,7 @@ const getDiagnostics = (state, props) => { var _a; return (_a = state.calls[prop
|
|
|
291
291
|
|
|
292
292
|
// Copyright (c) Microsoft Corporation.
|
|
293
293
|
// Licensed under the MIT license.
|
|
294
|
-
var __awaiter$
|
|
294
|
+
var __awaiter$p = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
295
295
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
296
296
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
297
297
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -329,7 +329,7 @@ const _isPreviewOn = (deviceManager) => {
|
|
|
329
329
|
*
|
|
330
330
|
* @private
|
|
331
331
|
*/
|
|
332
|
-
const disposeAllLocalPreviewViews = (callClient) => __awaiter$
|
|
332
|
+
const disposeAllLocalPreviewViews = (callClient) => __awaiter$p(void 0, void 0, void 0, function* () {
|
|
333
333
|
const unparentedViews = callClient.getState().deviceManager.unparentedViews;
|
|
334
334
|
for (const view of unparentedViews) {
|
|
335
335
|
yield callClient.disposeView(undefined, undefined, view);
|
|
@@ -391,7 +391,7 @@ const devicesButtonSelector = reselect__namespace.createSelector([getDeviceManag
|
|
|
391
391
|
|
|
392
392
|
// Copyright (c) Microsoft Corporation.
|
|
393
393
|
// Licensed under the MIT license.
|
|
394
|
-
var __awaiter$
|
|
394
|
+
var __awaiter$o = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
395
395
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
396
396
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
397
397
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -415,7 +415,7 @@ const areStreamsEqual = (prevStream, newStream) => {
|
|
|
415
415
|
* @public
|
|
416
416
|
*/
|
|
417
417
|
const createDefaultCallingHandlers = memoizeOne__default['default']((callClient, callAgent, deviceManager, call) => {
|
|
418
|
-
const onStartLocalVideo = () => __awaiter$
|
|
418
|
+
const onStartLocalVideo = () => __awaiter$o(void 0, void 0, void 0, function* () {
|
|
419
419
|
// Before the call object creates a stream, dispose of any local preview streams.
|
|
420
420
|
// @TODO: is there any way to parent the unparented view to the call object instead
|
|
421
421
|
// of disposing and creating a new stream?
|
|
@@ -435,7 +435,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
|
|
|
435
435
|
yield call.startVideo(stream);
|
|
436
436
|
}
|
|
437
437
|
});
|
|
438
|
-
const onStopLocalVideo = (stream) => __awaiter$
|
|
438
|
+
const onStopLocalVideo = (stream) => __awaiter$o(void 0, void 0, void 0, function* () {
|
|
439
439
|
const callId = call === null || call === void 0 ? void 0 : call.id;
|
|
440
440
|
if (!callId) {
|
|
441
441
|
return;
|
|
@@ -448,7 +448,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
|
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
450
|
});
|
|
451
|
-
const onToggleCamera = (options) => __awaiter$
|
|
451
|
+
const onToggleCamera = (options) => __awaiter$o(void 0, void 0, void 0, function* () {
|
|
452
452
|
if (call && _isInCall(call.state)) {
|
|
453
453
|
const stream = call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video');
|
|
454
454
|
if (stream) {
|
|
@@ -478,19 +478,19 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
|
|
|
478
478
|
const onStartCall = (participants, options) => {
|
|
479
479
|
return callAgent ? callAgent.startCall(participants, options) : undefined;
|
|
480
480
|
};
|
|
481
|
-
const onSelectMicrophone = (device) => __awaiter$
|
|
481
|
+
const onSelectMicrophone = (device) => __awaiter$o(void 0, void 0, void 0, function* () {
|
|
482
482
|
if (!deviceManager) {
|
|
483
483
|
return;
|
|
484
484
|
}
|
|
485
485
|
return deviceManager.selectMicrophone(device);
|
|
486
486
|
});
|
|
487
|
-
const onSelectSpeaker = (device) => __awaiter$
|
|
487
|
+
const onSelectSpeaker = (device) => __awaiter$o(void 0, void 0, void 0, function* () {
|
|
488
488
|
if (!deviceManager) {
|
|
489
489
|
return;
|
|
490
490
|
}
|
|
491
491
|
return deviceManager.selectSpeaker(device);
|
|
492
492
|
});
|
|
493
|
-
const onSelectCamera = (device, options) => __awaiter$
|
|
493
|
+
const onSelectCamera = (device, options) => __awaiter$o(void 0, void 0, void 0, function* () {
|
|
494
494
|
if (!deviceManager) {
|
|
495
495
|
return;
|
|
496
496
|
}
|
|
@@ -513,17 +513,17 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
|
|
|
513
513
|
}, options);
|
|
514
514
|
}
|
|
515
515
|
});
|
|
516
|
-
const onToggleMicrophone = () => __awaiter$
|
|
516
|
+
const onToggleMicrophone = () => __awaiter$o(void 0, void 0, void 0, function* () {
|
|
517
517
|
if (!call || !_isInCall(call.state)) {
|
|
518
518
|
throw new Error(`Please invoke onToggleMicrophone after call is started`);
|
|
519
519
|
}
|
|
520
520
|
return call.isMuted ? yield call.unmute() : yield call.mute();
|
|
521
521
|
});
|
|
522
|
-
const onStartScreenShare = () => __awaiter$
|
|
523
|
-
const onStopScreenShare = () => __awaiter$
|
|
524
|
-
const onToggleScreenShare = () => __awaiter$
|
|
525
|
-
const onHangUp = () => __awaiter$
|
|
526
|
-
const onCreateLocalStreamView = (options) => __awaiter$
|
|
522
|
+
const onStartScreenShare = () => __awaiter$o(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
|
|
523
|
+
const onStopScreenShare = () => __awaiter$o(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
|
|
524
|
+
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(); });
|
|
525
|
+
const onHangUp = () => __awaiter$o(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.hangUp()); });
|
|
526
|
+
const onCreateLocalStreamView = (options) => __awaiter$o(void 0, void 0, void 0, function* () {
|
|
527
527
|
if (!call || call.localVideoStreams.length === 0) {
|
|
528
528
|
return;
|
|
529
529
|
}
|
|
@@ -537,7 +537,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
|
|
|
537
537
|
}
|
|
538
538
|
return callClient.createView(call.id, undefined, localStream, options);
|
|
539
539
|
});
|
|
540
|
-
const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$
|
|
540
|
+
const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$o(void 0, void 0, void 0, function* () {
|
|
541
541
|
if (!call) {
|
|
542
542
|
return;
|
|
543
543
|
}
|
|
@@ -561,7 +561,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
|
|
|
561
561
|
callClient.createView(call.id, participant.identifier, screenShareStream, { scalingMode: 'Fit' });
|
|
562
562
|
}
|
|
563
563
|
});
|
|
564
|
-
const onDisposeRemoteStreamView = (userId) => __awaiter$
|
|
564
|
+
const onDisposeRemoteStreamView = (userId) => __awaiter$o(void 0, void 0, void 0, function* () {
|
|
565
565
|
if (!call) {
|
|
566
566
|
return;
|
|
567
567
|
}
|
|
@@ -582,13 +582,13 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
|
|
|
582
582
|
callClient.disposeView(call.id, participant.identifier, screenShareStream);
|
|
583
583
|
}
|
|
584
584
|
});
|
|
585
|
-
const onDisposeLocalStreamView = () => __awaiter$
|
|
585
|
+
const onDisposeLocalStreamView = () => __awaiter$o(void 0, void 0, void 0, function* () {
|
|
586
586
|
// TODO: we need to remember which LocalVideoStream was used for LocalPreview and dispose that one. For now
|
|
587
587
|
// assume any unparented view is a LocalPreview and stop all since those are only used for LocalPreview
|
|
588
588
|
// currently.
|
|
589
589
|
yield disposeAllLocalPreviewViews(callClient);
|
|
590
590
|
});
|
|
591
|
-
const onRemoveParticipant = (userId) => __awaiter$
|
|
591
|
+
const onRemoveParticipant = (userId) => __awaiter$o(void 0, void 0, void 0, function* () {
|
|
592
592
|
yield (call === null || call === void 0 ? void 0 : call.removeParticipant(fromFlatCommunicationIdentifier(userId)));
|
|
593
593
|
});
|
|
594
594
|
return {
|
|
@@ -780,7 +780,7 @@ const typingIndicatorStringStyle = react.mergeStyles({
|
|
|
780
780
|
wordBreak: 'break-word'
|
|
781
781
|
});
|
|
782
782
|
|
|
783
|
-
var participantItem$d={isMeText:"(you)",menuTitle:"More Options",removeButtonLabel:"Remove",sharingIconLabel:"Sharing",mutedIconLabel:"Muted"};var typingIndicator$d={singleUser:"{user} is typing ...",multipleUsers:"{users} are typing ...",multipleUsersAbbreviateOne:"{users} and 1 other are typing ...",multipleUsersAbbreviateMany:"{users} and {numOthers} others are typing ...",delimiter:", "};var sendBox$d={placeholderText:"Enter a message",textTooLong:"Your message length is over the maximum limit."};var messageStatusIndicator$d={deliveredTooltipText:"Sent",seenTooltipText:"Seen",sendingTooltipText:"Sending",failedToSendTooltipText:"Failed to send"};var endCallButton$d={label:"Leave",tooltipContent:"Leave Call"};var cameraButton$d={onLabel:"Turn off",offLabel:"Turn on",tooltipOnContent:"Turn off camera",tooltipOffContent:"Turn on camera"};var microphoneButton$d={onLabel:"Mute",offLabel:"Unmute",tooltipOnContent:"Mute microphone",tooltipOffContent:"Unmute microphone"};var devicesButton$d={label:"Devices",tooltipContent:"Manage devices",cameraMenuTitle:"Camera",cameraMenuTooltip:"Choose Camera",microphoneMenuTitle:"Microphone",microphoneMenuTooltip:"Choose Microphone",speakerMenuTitle:"Speaker",speakerMenuTooltip:"Choose Speaker"};var participantsButton$d={label:"People",tooltipContent:"Show Participants",menuHeader:"In this call",participantsListButtonLabel:"{numParticipants} people",muteAllButtonLabel:"Mute all",copyInviteLinkButtonLabel:"Copy invite link"};var screenShareButton$d={onLabel:"Stop sharing",offLabel:"Share",tooltipOnContent:"Stop sharing your screen",tooltipOffContent:"Share your screen"};var messageThread$d={yesterday:"Yesterday",sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday",participantJoined:"joined the chat.",participantLeft:"left the chat.",editMessage:"Edit",removeMessage:"Remove",editedTag:"Edited",liveAuthorIntro:"{author} says",editBoxTextLimit:"Your message is over the limit of {limitNumber} characters",editBoxPlaceholderText:"Edit your message",newMessagesIndicator:"New messages",noDisplayNameSub:"No name",editBoxCancelButton:"Cancel",editBoxSubmitButton:"Submit"};var errorBar$d={unableToReachChatService:"You are offline",accessDenied:"Unable to access chat services - please check the user credentials provided",userNotInChatThread:"You are no longer in this chat thread",sendMessageNotInChatThread:"Failed to send message because you are no longer in this chat thread",sendMessageGeneric:"Failed to send message",callingNetworkFailure:"Troubling connecting call - you seem to be offline",startVideoGeneric:"Failed to start video",stopVideoGeneric:"Failed to stop video",muteGeneric:"Failed to mute microphone",unmuteGeneric:"Failed to unmute microphone",speakingWhileMuted:"Your microphone is muted",startScreenShareGeneric:"Failed to start screen sharing",stopScreenShareGeneric:"Failed to stop screen sharing",callNetworkQualityLow:"Network quality is low.",callNoSpeakerFound:"No speakers or headphones found. Connect an audio device to hear the call.",callNoMicrophoneFound:"No microphones found. Connect an audio input device.",callMicrophoneAccessDenied:"Unable to access microphone. Click the lock in the address bar to grant permission to this webpage.",callMicrophoneMutedBySystem:"You are muted by your system.",callMacOsMicrophoneAccessDenied:"Unable to access microphone. Grant microphone permission in your macOS privacy settings.",callLocalVideoFreeze:"Network bandwidth is poor. Your video may appear paused for others on the call.",callCameraAccessDenied:"Unable to access camera. Click the lock in the address bar to grant permission to this webpage.",callCameraAlreadyInUse:"Unable to access camera. It may already be in use by another application.",callMacOsCameraAccessDenied:"MacOS is blocking access to your camera. Update your privacy settings to allow this browser to access your camera.",callMacOsScreenShareAccessDenied:"MacOS is blocking screen sharing. Update your privacy settings to allow this browser to record your screen."};var videoGallery$d={screenIsBeingSharedMessage:"You are sharing your screen",screenShareLoadingMessage:"Loading {participant}'s screen",localVideoLabel:"You"};var en_US$1 = {participantItem:participantItem$d,typingIndicator:typingIndicator$d,sendBox:sendBox$d,messageStatusIndicator:messageStatusIndicator$d,endCallButton:endCallButton$d,cameraButton:cameraButton$d,microphoneButton:microphoneButton$d,devicesButton:devicesButton$d,participantsButton:participantsButton$d,screenShareButton:screenShareButton$d,messageThread:messageThread$d,errorBar:errorBar$d,videoGallery:videoGallery$d};
|
|
783
|
+
var participantItem$d={isMeText:"(you)",menuTitle:"More Options",removeButtonLabel:"Remove",sharingIconLabel:"Sharing",mutedIconLabel:"Muted"};var typingIndicator$d={singleUser:"{user} is typing ...",multipleUsers:"{users} are typing ...",multipleUsersAbbreviateOne:"{users} and 1 other are typing ...",multipleUsersAbbreviateMany:"{users} and {numOthers} others are typing ...",delimiter:", "};var sendBox$d={placeholderText:"Enter a message",textTooLong:"Your message length is over the maximum limit."};var messageStatusIndicator$d={deliveredTooltipText:"Sent",seenTooltipText:"Seen",sendingTooltipText:"Sending",failedToSendTooltipText:"Failed to send"};var endCallButton$d={label:"Leave",tooltipContent:"Leave Call"};var cameraButton$d={onLabel:"Turn off",offLabel:"Turn on",tooltipDisabledContent:"Camera is disabled",tooltipOnContent:"Turn off camera",tooltipOffContent:"Turn on camera"};var microphoneButton$d={onLabel:"Mute",offLabel:"Unmute",tooltipDisabledContent:"Microphone is disabled",tooltipOnContent:"Mute microphone",tooltipOffContent:"Unmute microphone"};var devicesButton$d={label:"Devices",tooltipContent:"Manage devices",cameraMenuTitle:"Camera",cameraMenuTooltip:"Choose Camera",microphoneMenuTitle:"Microphone",microphoneMenuTooltip:"Choose Microphone",speakerMenuTitle:"Speaker",speakerMenuTooltip:"Choose Speaker"};var participantsButton$d={label:"People",tooltipContent:"Show Participants",menuHeader:"In this call",participantsListButtonLabel:"{numParticipants} people",muteAllButtonLabel:"Mute all",copyInviteLinkButtonLabel:"Copy invite link"};var screenShareButton$d={onLabel:"Stop sharing",offLabel:"Share",tooltipDisabledContent:"Screen sharing is disabled",tooltipOnContent:"Stop sharing your screen",tooltipOffContent:"Share your screen"};var messageThread$d={yesterday:"Yesterday",sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday",participantJoined:"joined the chat.",participantLeft:"left the chat.",editMessage:"Edit",removeMessage:"Remove",editedTag:"Edited",liveAuthorIntro:"{author} says",editBoxTextLimit:"Your message is over the limit of {limitNumber} characters",editBoxPlaceholderText:"Edit your message",newMessagesIndicator:"New messages",noDisplayNameSub:"No name",editBoxCancelButton:"Cancel",editBoxSubmitButton:"Submit"};var errorBar$d={unableToReachChatService:"You are offline",accessDenied:"Unable to access chat services - please check the user credentials provided",userNotInChatThread:"You are no longer in this chat thread",sendMessageNotInChatThread:"Failed to send message because you are no longer in this chat thread",sendMessageGeneric:"Failed to send message",callingNetworkFailure:"Troubling connecting call - you seem to be offline",startVideoGeneric:"Failed to start video",stopVideoGeneric:"Failed to stop video",muteGeneric:"Failed to mute microphone",unmuteGeneric:"Failed to unmute microphone",speakingWhileMuted:"Your microphone is muted",startScreenShareGeneric:"Failed to start screen sharing",stopScreenShareGeneric:"Failed to stop screen sharing",callNetworkQualityLow:"Network quality is low.",callNoSpeakerFound:"No speakers or headphones found. Connect an audio device to hear the call.",callNoMicrophoneFound:"No microphones found. Connect an audio input device.",callMicrophoneAccessDenied:"Unable to access microphone. Click the lock in the address bar to grant permission to this webpage.",callMicrophoneMutedBySystem:"You are muted by your system.",callMacOsMicrophoneAccessDenied:"Unable to access microphone. Grant microphone permission in your macOS privacy settings.",callLocalVideoFreeze:"Network bandwidth is poor. Your video may appear paused for others on the call.",callCameraAccessDenied:"Unable to access camera. Click the lock in the address bar to grant permission to this webpage.",callCameraAlreadyInUse:"Unable to access camera. It may already be in use by another application.",callMacOsCameraAccessDenied:"MacOS is blocking access to your camera. Update your privacy settings to allow this browser to access your camera.",callMacOsScreenShareAccessDenied:"MacOS is blocking screen sharing. Update your privacy settings to allow this browser to record your screen."};var videoGallery$d={screenIsBeingSharedMessage:"You are sharing your screen",screenShareLoadingMessage:"Loading {participant}'s screen",localVideoLabel:"You"};var en_US$1 = {participantItem:participantItem$d,typingIndicator:typingIndicator$d,sendBox:sendBox$d,messageStatusIndicator:messageStatusIndicator$d,endCallButton:endCallButton$d,cameraButton:cameraButton$d,microphoneButton:microphoneButton$d,devicesButton:devicesButton$d,participantsButton:participantsButton$d,screenShareButton:screenShareButton$d,messageThread:messageThread$d,errorBar:errorBar$d,videoGallery:videoGallery$d};
|
|
784
784
|
|
|
785
785
|
var participantItem$c={isMeText:"(you)",menuTitle:"More Options",removeButtonLabel:"Remove",sharingIconLabel:"Sharing",mutedIconLabel:"Muted"};var typingIndicator$c={singleUser:"{user} is typing ...",multipleUsers:"{users} are typing ...",multipleUsersAbbreviateOne:"{users} and 1 other are typing ...",multipleUsersAbbreviateMany:"{users} and {numOthers} others are typing ...",delimiter:", "};var sendBox$c={placeholderText:"Enter a message",textTooLong:"Your message length is over the maximum limit."};var messageStatusIndicator$c={deliveredTooltipText:"Sent",seenTooltipText:"Seen",sendingTooltipText:"Sending",failedToSendTooltipText:"Failed to send"};var endCallButton$c={label:"Leave"};var cameraButton$c={onLabel:"Turn off",offLabel:"Turn on"};var microphoneButton$c={onLabel:"Mute",offLabel:"Unmute"};var devicesButton$c={label:"Options",cameraMenuTitle:"Camera",cameraMenuTooltip:"Choose Camera",microphoneMenuTitle:"Microphone",microphoneMenuTooltip:"Choose Microphone",speakerMenuTitle:"Speaker",speakerMenuTooltip:"Choose Speaker"};var participantsButton$c={label:"People",menuHeader:"In this call",participantsListButtonLabel:"{numParticipants} people",muteAllButtonLabel:"Mute all",copyInviteLinkButtonLabel:"Copy invite link"};var screenShareButton$c={onLabel:"Stop",offLabel:"Share"};var messageThread$c={yesterday:"Yesterday",sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday",participantJoined:"joined the chat.",participantLeft:"left the chat.",editMessage:"Edit",removeMessage:"Remove",editedTag:"Edited",liveAuthorIntro:"{author} says",editBoxTextLimit:"Your message is over the limit of {limitNumber} characters",editBoxPlaceholderText:"Edit your message",newMessagesIndicator:"New messages",noDisplayNameSub:"No name",editBoxCancelButton:"Cancel",editBoxSubmitButton:"Submit"};var errorBar$c={unableToReachChatService:"You are offline",accessDenied:"Unable to access chat services - please check the user credentials provided",userNotInChatThread:"You are no longer in this chat thread",sendMessageNotInChatThread:"Failed to send message because you are no longer in this chat thread",sendMessageGeneric:"Failed to send message",callingNetworkFailure:"Troubling connecting call - you seem to be offline",startVideoGeneric:"Failed to start video",stopVideoGeneric:"Failed to stop video",muteGeneric:"Failed to mute microphone",unmuteGeneric:"Failed to unmute microphone",speakingWhileMuted:"Your microphone is muted",startScreenShareGeneric:"Failed to start screen sharing",stopScreenShareGeneric:"Failed to stop screen sharing",callNetworkQualityLow:"Network quality is low.",callNoSpeakerFound:"No speakers or headphones found. Connect an audio device to hear the call.",callNoMicrophoneFound:"No microphones found. Connect an audio input device.",callMicrophoneAccessDenied:"Unable to access microphone. Click the lock in the address bar to grant permission to this webpage.",callMicrophoneMutedBySystem:"You are muted by your system.",callMacOsMicrophoneAccessDenied:"Unable to access microphone. Grant microphone permission in your macOS privacy settings.",callLocalVideoFreeze:"Network bandwidth is poor. Your video may appear paused for others on the call.",callCameraAccessDenied:"Unable to access camera. Click the lock in the address bar to grant permission to this webpage.",callCameraAlreadyInUse:"Unable to access camera. It may already be in use by another application.",callMacOsCameraAccessDenied:"MacOS is blocking access to your camera. Update your privacy settings to allow this browser to access your camera.",callMacOsScreenShareAccessDenied:"MacOS is blocking screen sharing. Update your privacy settings to allow this browser to record your screen."};var videoGallery$c={screenIsBeingSharedMessage:"You are sharing your screen",screenShareLoadingMessage:"Loading {participant}'s screen",localVideoLabel:"You"};var en_GB$1 = {participantItem:participantItem$c,typingIndicator:typingIndicator$c,sendBox:sendBox$c,messageStatusIndicator:messageStatusIndicator$c,endCallButton:endCallButton$c,cameraButton:cameraButton$c,microphoneButton:microphoneButton$c,devicesButton:devicesButton$c,participantsButton:participantsButton$c,screenShareButton:screenShareButton$c,messageThread:messageThread$c,errorBar:errorBar$c,videoGallery:videoGallery$c};
|
|
786
786
|
|
|
@@ -2526,7 +2526,7 @@ const ChatMessageComponentAsMessageBubble = (props) => {
|
|
|
2526
2526
|
|
|
2527
2527
|
// Copyright (c) Microsoft Corporation.
|
|
2528
2528
|
// Licensed under the MIT license.
|
|
2529
|
-
var __awaiter$
|
|
2529
|
+
var __awaiter$n = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2530
2530
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2531
2531
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2532
2532
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -2552,7 +2552,7 @@ const ChatMessageComponent = (props) => {
|
|
|
2552
2552
|
return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
2553
2553
|
}
|
|
2554
2554
|
else if (isEditing) {
|
|
2555
|
-
return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { initialValue: (_a = props.message.content) !== null && _a !== void 0 ? _a : '', inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text) => __awaiter$
|
|
2555
|
+
return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { initialValue: (_a = props.message.content) !== null && _a !== void 0 ? _a : '', inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text) => __awaiter$n(void 0, void 0, void 0, function* () {
|
|
2556
2556
|
props.onUpdateMessage &&
|
|
2557
2557
|
props.message.messageId &&
|
|
2558
2558
|
(yield props.onUpdateMessage(props.message.messageId, text));
|
|
@@ -2610,7 +2610,7 @@ const isNarrowWidth = (containerWidthRem) => containerWidthRem <= convertRemToPx
|
|
|
2610
2610
|
|
|
2611
2611
|
// Copyright (c) Microsoft Corporation.
|
|
2612
2612
|
// Licensed under the MIT license.
|
|
2613
|
-
var __awaiter$
|
|
2613
|
+
var __awaiter$m = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2614
2614
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2615
2615
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2616
2616
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -2787,7 +2787,7 @@ const getLastChatMessageIdWithStatus = (messages, status) => {
|
|
|
2787
2787
|
*/
|
|
2788
2788
|
const MessageThread = (props) => {
|
|
2789
2789
|
var _a;
|
|
2790
|
-
const { messages: newMessages, userId, styles, disableJumpToNewMessageButton = false, showMessageDate = false, showMessageStatus = false, numberOfChatMessagesToReload =
|
|
2790
|
+
const { messages: newMessages, userId, styles, disableJumpToNewMessageButton = false, showMessageDate = false, showMessageStatus = false, numberOfChatMessagesToReload = 5, onMessageSeen, onRenderMessageStatus, onRenderAvatar, onLoadPreviousChatMessages, onRenderJumpToNewMessageButton, onRenderMessage, onUpdateMessage, onDeleteMessage } = props;
|
|
2791
2791
|
const [messages, setMessages] = React.useState([]);
|
|
2792
2792
|
// We need this state to wait for one tick and scroll to bottom after messages have been initialized.
|
|
2793
2793
|
// Otherwise chatScrollDivRef.current.clientHeight is wrong if we scroll to bottom before messages are initialized.
|
|
@@ -2829,7 +2829,7 @@ const MessageThread = (props) => {
|
|
|
2829
2829
|
setChatMessagesInitialized(chatMessagesInitialized);
|
|
2830
2830
|
};
|
|
2831
2831
|
// we try to only send those message status if user is scrolled to the bottom.
|
|
2832
|
-
const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$
|
|
2832
|
+
const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$m(void 0, void 0, void 0, function* () {
|
|
2833
2833
|
if (!isAtBottomOfScrollRef.current ||
|
|
2834
2834
|
!document.hasFocus() ||
|
|
2835
2835
|
!messagesRef.current ||
|
|
@@ -2880,7 +2880,7 @@ const MessageThread = (props) => {
|
|
|
2880
2880
|
setIsAtBottomOfScrollRef(atBottom);
|
|
2881
2881
|
}, [scrollToBottom, sendMessageStatusIfAtBottom]);
|
|
2882
2882
|
// Infinite scrolling + threadInitialize function
|
|
2883
|
-
const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$
|
|
2883
|
+
const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$m(void 0, void 0, void 0, function* () {
|
|
2884
2884
|
if (chatScrollDivRef.current && !isLoadingChatMessagesRef.current) {
|
|
2885
2885
|
if (onLoadPreviousChatMessages) {
|
|
2886
2886
|
isLoadingChatMessagesRef.current = true;
|
|
@@ -3225,7 +3225,7 @@ const ParticipantItem = (props) => {
|
|
|
3225
3225
|
/**
|
|
3226
3226
|
* @private
|
|
3227
3227
|
*/
|
|
3228
|
-
const participantListStyle = react.mergeStyles({
|
|
3228
|
+
const participantListStyle$1 = react.mergeStyles({
|
|
3229
3229
|
height: '100%',
|
|
3230
3230
|
padding: '0.125rem'
|
|
3231
3231
|
});
|
|
@@ -3318,7 +3318,7 @@ const ParticipantList = (props) => {
|
|
|
3318
3318
|
return menuItems;
|
|
3319
3319
|
};
|
|
3320
3320
|
const participantItemStyles = react.merge(participantListItemStyle, (_a = props.styles) === null || _a === void 0 ? void 0 : _a.participantItemStyles);
|
|
3321
|
-
return (React__default['default'].createElement(react.Stack, { "data-ui-id": ids.participantList, className: react.mergeStyles(participantListStyle, (_b = props.styles) === null || _b === void 0 ? void 0 : _b.root) }, displayedParticipants.map((participant) => onRenderParticipant
|
|
3321
|
+
return (React__default['default'].createElement(react.Stack, { "data-ui-id": ids.participantList, className: react.mergeStyles(participantListStyle$1, (_b = props.styles) === null || _b === void 0 ? void 0 : _b.root) }, displayedParticipants.map((participant) => onRenderParticipant
|
|
3322
3322
|
? onRenderParticipant(participant)
|
|
3323
3323
|
: onRenderParticipantDefault(participant, strings, myUserId, onRemoveParticipant, onRenderAvatar, createParticipantMenuItems, participantItemStyles))));
|
|
3324
3324
|
};
|
|
@@ -3550,10 +3550,10 @@ const VideoTile = (props) => {
|
|
|
3550
3550
|
* array changes causing a rerender in the parent component. https://reactjs.org/docs/react-api.html#reactmemo
|
|
3551
3551
|
*/
|
|
3552
3552
|
const RemoteVideoTile = React__default['default'].memo((props) => {
|
|
3553
|
-
const { isAvailable, isMuted, isSpeaking, onCreateRemoteStreamView, onDisposeRemoteStreamView,
|
|
3553
|
+
const { isAvailable, isMuted, isSpeaking, isScreenSharing, onCreateRemoteStreamView, onDisposeRemoteStreamView, remoteVideoViewOptions, renderElement, userId, displayName, onRenderAvatar, showMuteIndicator } = props;
|
|
3554
3554
|
React.useEffect(() => {
|
|
3555
3555
|
if (isAvailable && !renderElement) {
|
|
3556
|
-
onCreateRemoteStreamView && onCreateRemoteStreamView(userId,
|
|
3556
|
+
onCreateRemoteStreamView && onCreateRemoteStreamView(userId, remoteVideoViewOptions);
|
|
3557
3557
|
}
|
|
3558
3558
|
if (!isAvailable) {
|
|
3559
3559
|
onDisposeRemoteStreamView && onDisposeRemoteStreamView(userId);
|
|
@@ -3562,15 +3562,17 @@ const RemoteVideoTile = React__default['default'].memo((props) => {
|
|
|
3562
3562
|
isAvailable,
|
|
3563
3563
|
onCreateRemoteStreamView,
|
|
3564
3564
|
onDisposeRemoteStreamView,
|
|
3565
|
-
|
|
3565
|
+
remoteVideoViewOptions,
|
|
3566
3566
|
renderElement,
|
|
3567
3567
|
userId
|
|
3568
3568
|
]);
|
|
3569
3569
|
React.useEffect(() => {
|
|
3570
3570
|
return () => {
|
|
3571
|
-
|
|
3571
|
+
if (isScreenSharing) {
|
|
3572
|
+
onDisposeRemoteStreamView && onDisposeRemoteStreamView(userId);
|
|
3573
|
+
}
|
|
3572
3574
|
};
|
|
3573
|
-
}, [onDisposeRemoteStreamView, userId]);
|
|
3575
|
+
}, [onDisposeRemoteStreamView, userId, isScreenSharing]);
|
|
3574
3576
|
const renderVideoStreamElement = React.useMemo(() => {
|
|
3575
3577
|
// Checking if renderElement is well defined or not as calling SDK has a number of video streams limitation which
|
|
3576
3578
|
// implies that, after their threshold, all streams have no child (blank video)
|
|
@@ -3739,7 +3741,13 @@ const videoGalleryOuterDivStyle = react.mergeStyles({ position: 'relative', widt
|
|
|
3739
3741
|
* @private
|
|
3740
3742
|
*/
|
|
3741
3743
|
const videoGalleryContainerStyle = {
|
|
3742
|
-
root: { position: 'relative', height: '100%', width: '100%', padding: '0.5rem'
|
|
3744
|
+
root: { position: 'relative', height: '100%', width: '100%', padding: '0.5rem' }
|
|
3745
|
+
};
|
|
3746
|
+
/**
|
|
3747
|
+
* @private
|
|
3748
|
+
*/
|
|
3749
|
+
const videoGalleryContainerTokens = {
|
|
3750
|
+
childrenGap: '0.5rem'
|
|
3743
3751
|
};
|
|
3744
3752
|
/**
|
|
3745
3753
|
* Small floating modal width and height in rem for small screen
|
|
@@ -3754,22 +3762,14 @@ const LARGE_FLOATING_MODAL_SIZE_REM = { width: 10, height: 7.5 };
|
|
|
3754
3762
|
*/
|
|
3755
3763
|
const floatingLocalVideoModalStyle = (theme, isNarrow) => {
|
|
3756
3764
|
return react.concatStyleSets({
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
: `${LARGE_FLOATING_MODAL_SIZE_REM.height}rem`,
|
|
3766
|
-
position: 'absolute',
|
|
3767
|
-
bottom: '0.5rem',
|
|
3768
|
-
boxShadow: theme.effects.elevation8,
|
|
3769
|
-
borderRadius: theme.effects.roundedCorner4,
|
|
3770
|
-
overflow: 'hidden'
|
|
3771
|
-
}
|
|
3772
|
-
}, { main: theme.rtl ? { left: '0.5rem' } : { right: '0.5rem' } });
|
|
3765
|
+
main: localVideoTileContainerStyle(theme, isNarrow)
|
|
3766
|
+
}, { main: { boxShadow: theme.effects.elevation8 } });
|
|
3767
|
+
};
|
|
3768
|
+
/**
|
|
3769
|
+
* @private
|
|
3770
|
+
*/
|
|
3771
|
+
const localVideoTileContainerStyle = (theme, isNarrow) => {
|
|
3772
|
+
return Object.assign({ minWidth: isNarrow ? `${SMALL_FLOATING_MODAL_SIZE_REM.width}rem` : `${LARGE_FLOATING_MODAL_SIZE_REM.width}rem`, minHeight: isNarrow ? `${SMALL_FLOATING_MODAL_SIZE_REM.height}rem` : `${LARGE_FLOATING_MODAL_SIZE_REM.height}rem`, position: 'absolute', bottom: '0.5rem', borderRadius: theme.effects.roundedCorner4, overflow: 'hidden' }, (theme.rtl ? { left: '0.5rem' } : { right: '0.5rem' }));
|
|
3773
3773
|
};
|
|
3774
3774
|
/**
|
|
3775
3775
|
* @private
|
|
@@ -3917,18 +3917,24 @@ const loadingStyle = react.mergeStyles({
|
|
|
3917
3917
|
* https://reactjs.org/docs/react-api.html#reactmemo
|
|
3918
3918
|
*/
|
|
3919
3919
|
const RemoteScreenShare = React__default['default'].memo((props) => {
|
|
3920
|
-
const { onCreateRemoteStreamView,
|
|
3920
|
+
const { userId, displayName, isMuted, renderElement, isVideoStreamOn, onCreateRemoteStreamView, onDisposeRemoteStreamView } = props;
|
|
3921
3921
|
const locale = useLocale$1();
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
screenShareParticipant && onCreateRemoteStreamView && onCreateRemoteStreamView(screenShareParticipant.userId);
|
|
3922
|
+
if (!renderElement) {
|
|
3923
|
+
onCreateRemoteStreamView && onCreateRemoteStreamView(userId);
|
|
3925
3924
|
}
|
|
3926
|
-
|
|
3925
|
+
React.useEffect(() => {
|
|
3926
|
+
return () => {
|
|
3927
|
+
if (isVideoStreamOn) {
|
|
3928
|
+
onDisposeRemoteStreamView && onDisposeRemoteStreamView(userId);
|
|
3929
|
+
}
|
|
3930
|
+
};
|
|
3931
|
+
}, [onDisposeRemoteStreamView, userId, isVideoStreamOn]);
|
|
3932
|
+
const loadingMessage = displayName
|
|
3927
3933
|
? _formatString(locale.strings.videoGallery.screenShareLoadingMessage, {
|
|
3928
|
-
participant:
|
|
3934
|
+
participant: displayName
|
|
3929
3935
|
})
|
|
3930
3936
|
: '';
|
|
3931
|
-
return (React__default['default'].createElement(VideoTile, { displayName:
|
|
3937
|
+
return (React__default['default'].createElement(VideoTile, { displayName: displayName, isMuted: isMuted, renderElement: renderElement ? React__default['default'].createElement(StreamMedia, { videoStreamElement: renderElement }) : undefined, onRenderPlaceholder: () => React__default['default'].createElement(LoadingSpinner, { loadingMessage: loadingMessage }) }));
|
|
3932
3938
|
});
|
|
3933
3939
|
const LoadingSpinner = (props) => {
|
|
3934
3940
|
return (React__default['default'].createElement(react.Stack, { verticalAlign: "center", className: loadingStyle },
|
|
@@ -3953,8 +3959,8 @@ const DRAG_OPTIONS = {
|
|
|
3953
3959
|
* @public
|
|
3954
3960
|
*/
|
|
3955
3961
|
const VideoGallery = (props) => {
|
|
3956
|
-
var _a, _b, _c, _d;
|
|
3957
|
-
const { localParticipant, remoteParticipants = [],
|
|
3962
|
+
var _a, _b, _c, _d, _e;
|
|
3963
|
+
const { localParticipant, remoteParticipants = [], localVideoViewOptions, remoteVideoViewOptions, dominantSpeakers, onRenderLocalVideoTile, onRenderRemoteVideoTile, onCreateLocalStreamView, onCreateRemoteStreamView, onDisposeRemoteStreamView, styles, layout, onRenderAvatar, showMuteIndicator, maxRemoteVideoStreams = DEFAULT_MAX_REMOTE_VIDEO_STREAMS } = props;
|
|
3958
3964
|
const ids = useIdentifiers();
|
|
3959
3965
|
const theme = useTheme();
|
|
3960
3966
|
const localeStrings = useLocale$1().strings.videoGallery;
|
|
@@ -3992,7 +3998,7 @@ const VideoGallery = (props) => {
|
|
|
3992
3998
|
root: { borderRadius: theme.effects.roundedCorner4 }
|
|
3993
3999
|
}, styles === null || styles === void 0 ? void 0 : styles.localVideo);
|
|
3994
4000
|
if (localVideoStream && !localVideoStream.renderElement) {
|
|
3995
|
-
onCreateLocalStreamView && onCreateLocalStreamView(
|
|
4001
|
+
onCreateLocalStreamView && onCreateLocalStreamView(localVideoViewOptions);
|
|
3996
4002
|
}
|
|
3997
4003
|
return (React__default['default'].createElement(VideoTile, { key: localParticipant.userId, userId: localParticipant.userId, renderElement: (localVideoStream === null || localVideoStream === void 0 ? void 0 : localVideoStream.renderElement) ? (React__default['default'].createElement(StreamMedia, { videoStreamElement: localVideoStream.renderElement })) : undefined, showLabel: !(shouldFloatLocalVideo && isNarrow), displayName: isNarrow ? '' : strings.localVideoLabel, initialsName: localParticipant.displayName, styles: localVideoTileStylesThemed, onRenderPlaceholder: onRenderAvatar, isMuted: localParticipant.isMuted, showMuteIndicator: showMuteIndicator }));
|
|
3998
4004
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -4009,8 +4015,8 @@ const VideoGallery = (props) => {
|
|
|
4009
4015
|
]);
|
|
4010
4016
|
const defaultOnRenderVideoTile = React.useCallback((participant, isVideoParticipant) => {
|
|
4011
4017
|
const remoteVideoStream = participant.videoStream;
|
|
4012
|
-
return (React__default['default'].createElement(RemoteVideoTile, { key: participant.userId,
|
|
4013
|
-
}, [onCreateRemoteStreamView, onDisposeRemoteStreamView,
|
|
4018
|
+
return (React__default['default'].createElement(RemoteVideoTile, Object.assign({ key: participant.userId }, participant, { onCreateRemoteStreamView: isVideoParticipant ? onCreateRemoteStreamView : undefined, onDisposeRemoteStreamView: isVideoParticipant ? onDisposeRemoteStreamView : undefined, isAvailable: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.isAvailable : false, renderElement: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.renderElement : undefined, remoteVideoViewOptions: isVideoParticipant ? remoteVideoViewOptions : undefined, onRenderAvatar: onRenderAvatar, showMuteIndicator: showMuteIndicator })));
|
|
4019
|
+
}, [onCreateRemoteStreamView, onDisposeRemoteStreamView, remoteVideoViewOptions, onRenderAvatar, showMuteIndicator]);
|
|
4014
4020
|
const videoTiles = onRenderRemoteVideoTile
|
|
4015
4021
|
? visibleVideoParticipants.current.map((participant) => onRenderRemoteVideoTile(participant))
|
|
4016
4022
|
: visibleVideoParticipants.current.map((participant) => {
|
|
@@ -4039,17 +4045,20 @@ const VideoGallery = (props) => {
|
|
|
4039
4045
|
gridTiles.push(localVideoTile);
|
|
4040
4046
|
}
|
|
4041
4047
|
const localScreenShareStreamComponent = React__default['default'].createElement(LocalScreenShare, { localParticipant: localParticipant });
|
|
4042
|
-
const remoteScreenShareComponent = (React__default['default'].createElement(RemoteScreenShare, { screenShareParticipant: screenShareParticipant, onCreateRemoteStreamView: onCreateRemoteStreamView }));
|
|
4048
|
+
const remoteScreenShareComponent = screenShareParticipant && (React__default['default'].createElement(RemoteScreenShare, Object.assign({}, screenShareParticipant, { renderElement: (_d = screenShareParticipant.screenShareStream) === null || _d === void 0 ? void 0 : _d.renderElement, onCreateRemoteStreamView: onCreateRemoteStreamView, onDisposeRemoteStreamView: onDisposeRemoteStreamView })));
|
|
4043
4049
|
React.useEffect(() => {
|
|
4044
4050
|
if (containerRef.current) {
|
|
4045
4051
|
containerRef.current.id = `video-gallery-${uuid.v4()}`;
|
|
4046
4052
|
}
|
|
4047
4053
|
}, [containerRef]);
|
|
4054
|
+
const horizontalGalleryPresent = horizontalGalleryTiles && horizontalGalleryTiles.length > 0;
|
|
4048
4055
|
return (React__default['default'].createElement("div", { "data-ui-id": ids.videoGallery, ref: containerRef, className: react.mergeStyles(videoGalleryOuterDivStyle, styles === null || styles === void 0 ? void 0 : styles.root) },
|
|
4049
|
-
shouldFloatLocalVideo &&
|
|
4050
|
-
|
|
4056
|
+
shouldFloatLocalVideo &&
|
|
4057
|
+
localParticipant &&
|
|
4058
|
+
(horizontalGalleryPresent ? (React__default['default'].createElement(react.Stack, { className: react.mergeStyles(localVideoTileContainerStyle(theme, isNarrow)) }, localVideoTile)) : (React__default['default'].createElement(react.Modal, { isOpen: true, isModeless: true, dragOptions: DRAG_OPTIONS, styles: floatingLocalVideoModalStyle(theme, isNarrow), layerProps: { hostId: (_e = containerRef.current) === null || _e === void 0 ? void 0 : _e.id } }, localVideoTile))),
|
|
4059
|
+
React__default['default'].createElement(react.Stack, { horizontal: false, styles: videoGalleryContainerStyle, tokens: videoGalleryContainerTokens },
|
|
4051
4060
|
screenShareParticipant ? (remoteScreenShareComponent) : (localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.isScreenSharingOn) ? (localScreenShareStreamComponent) : (React__default['default'].createElement(GridLayout, { key: "grid-layout", styles: styles === null || styles === void 0 ? void 0 : styles.gridLayout }, gridTiles)),
|
|
4052
|
-
|
|
4061
|
+
horizontalGalleryPresent && (React__default['default'].createElement(ResponsiveHorizontalGallery, { key: "responsive-horizontal-gallery", containerStyles: horizontalGalleryContainerStyle(shouldFloatLocalVideo, isNarrow), horizontalGalleryStyles: react.concatStyleSets(horizontalGalleryStyle(isNarrow), styles === null || styles === void 0 ? void 0 : styles.horizontalGallery), childWidthRem: isNarrow ? SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM.width : LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM.width, buttonWidthRem: HORIZONTAL_GALLERY_BUTTON_WIDTH, gapWidthRem: HORIZONTAL_GALLERY_GAP }, horizontalGalleryTiles)))));
|
|
4053
4062
|
};
|
|
4054
4063
|
|
|
4055
4064
|
// Copyright (c) Microsoft Corporation.
|
|
@@ -4161,18 +4170,16 @@ const controlButtonStyles = {
|
|
|
4161
4170
|
flexContainer: {
|
|
4162
4171
|
flexFlow: 'column',
|
|
4163
4172
|
display: 'contents'
|
|
4173
|
+
},
|
|
4174
|
+
label: {
|
|
4175
|
+
fontSize: '0.625rem',
|
|
4176
|
+
fontWeight: '400',
|
|
4177
|
+
lineHeight: '1rem',
|
|
4178
|
+
cursor: 'pointer',
|
|
4179
|
+
display: 'block',
|
|
4180
|
+
margin: '0rem 0.25rem'
|
|
4164
4181
|
}
|
|
4165
4182
|
};
|
|
4166
|
-
/**
|
|
4167
|
-
* @private
|
|
4168
|
-
*/
|
|
4169
|
-
const controlButtonLabelStyles = {
|
|
4170
|
-
fontSize: '0.625rem',
|
|
4171
|
-
lineHeight: '1rem',
|
|
4172
|
-
cursor: 'pointer',
|
|
4173
|
-
display: 'block',
|
|
4174
|
-
margin: '0rem 0.25rem'
|
|
4175
|
-
};
|
|
4176
4183
|
/**
|
|
4177
4184
|
* making it Partial as IContextualMenuStyles has all its props non-optional and we only need title to be defined here.
|
|
4178
4185
|
*
|
|
@@ -4242,23 +4249,22 @@ const DefaultRenderIcon = (props) => {
|
|
|
4242
4249
|
* @public
|
|
4243
4250
|
*/
|
|
4244
4251
|
const ControlBarButton = (props) => {
|
|
4245
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
|
4252
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
4246
4253
|
const componentStyles = react.concatStyleSets(controlButtonStyles, (_a = props.styles) !== null && _a !== void 0 ? _a : {});
|
|
4247
|
-
const theme = useTheme();
|
|
4248
4254
|
const labelText = (_d = (_b = props === null || props === void 0 ? void 0 : props.text) !== null && _b !== void 0 ? _b : (_c = props === null || props === void 0 ? void 0 : props.strings) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : ((props === null || props === void 0 ? void 0 : props.checked) ? (_e = props === null || props === void 0 ? void 0 : props.strings) === null || _e === void 0 ? void 0 : _e.onLabel : (_f = props === null || props === void 0 ? void 0 : props.strings) === null || _f === void 0 ? void 0 : _f.offLabel);
|
|
4249
|
-
const
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4255
|
+
const tooltipContent = (_h = (_g = props === null || props === void 0 ? void 0 : props.strings) === null || _g === void 0 ? void 0 : _g.tooltipContent) !== null && _h !== void 0 ? _h : ((props === null || props === void 0 ? void 0 : props.disabled)
|
|
4256
|
+
? (_j = props === null || props === void 0 ? void 0 : props.strings) === null || _j === void 0 ? void 0 : _j.tooltipDisabledContent
|
|
4257
|
+
: (props === null || props === void 0 ? void 0 : props.checked)
|
|
4258
|
+
? (_k = props === null || props === void 0 ? void 0 : props.strings) === null || _k === void 0 ? void 0 : _k.tooltipOnContent
|
|
4259
|
+
: (_l = props === null || props === void 0 ? void 0 : props.strings) === null || _l === void 0 ? void 0 : _l.tooltipOffContent);
|
|
4254
4260
|
const tooltipId = ((_m = props.tooltipId) !== null && _m !== void 0 ? _m : props.labelKey) ? props.labelKey + '-tooltip' : undefined;
|
|
4255
4261
|
return (React__default['default'].createElement(ControlButtonTooltip, { content: tooltipContent, id: tooltipId },
|
|
4256
|
-
React__default['default'].createElement(react.DefaultButton, Object.assign({}, props, { styles: componentStyles, onRenderText: props.showLabel
|
|
4262
|
+
React__default['default'].createElement(react.DefaultButton, Object.assign({}, props, { styles: componentStyles, onRenderText: props.showLabel && props.onRenderText ? props.onRenderText : undefined, onRenderIcon: (_o = props.onRenderIcon) !== null && _o !== void 0 ? _o : DefaultRenderIcon }), props.showLabel ? labelText : React__default['default'].createElement(React__default['default'].Fragment, null))));
|
|
4257
4263
|
};
|
|
4258
4264
|
|
|
4259
4265
|
// Copyright (c) Microsoft Corporation.
|
|
4260
4266
|
// Licensed under the MIT license.
|
|
4261
|
-
var __awaiter$
|
|
4267
|
+
var __awaiter$l = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4262
4268
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4263
4269
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4264
4270
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -4267,7 +4273,7 @@ var __awaiter$h = (window && window.__awaiter) || function (thisArg, _arguments,
|
|
|
4267
4273
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
4268
4274
|
});
|
|
4269
4275
|
};
|
|
4270
|
-
const
|
|
4276
|
+
const defaultLocalVideoViewOptions = {
|
|
4271
4277
|
scalingMode: 'Crop',
|
|
4272
4278
|
isMirrored: true
|
|
4273
4279
|
};
|
|
@@ -4282,22 +4288,22 @@ const onRenderCameraOffIcon = () => React__default['default'].createElement(reac
|
|
|
4282
4288
|
*/
|
|
4283
4289
|
const CameraButton = (props) => {
|
|
4284
4290
|
var _a, _b, _c;
|
|
4285
|
-
const {
|
|
4291
|
+
const { localVideoViewOptions, onToggleCamera } = props;
|
|
4286
4292
|
const [waitForCamera, setWaitForCamera] = React.useState(false);
|
|
4287
4293
|
const localeStrings = useLocale$1().strings.cameraButton;
|
|
4288
4294
|
const strings = Object.assign(Object.assign({}, localeStrings), props.strings);
|
|
4289
|
-
const onToggleClick = React.useCallback(() => __awaiter$
|
|
4295
|
+
const onToggleClick = React.useCallback(() => __awaiter$l(void 0, void 0, void 0, function* () {
|
|
4290
4296
|
// Throttle click on camera, need to await onToggleCamera then allow another click
|
|
4291
4297
|
if (onToggleCamera) {
|
|
4292
4298
|
setWaitForCamera(true);
|
|
4293
4299
|
try {
|
|
4294
|
-
yield onToggleCamera(
|
|
4300
|
+
yield onToggleCamera(localVideoViewOptions !== null && localVideoViewOptions !== void 0 ? localVideoViewOptions : defaultLocalVideoViewOptions);
|
|
4295
4301
|
}
|
|
4296
4302
|
finally {
|
|
4297
4303
|
setWaitForCamera(false);
|
|
4298
4304
|
}
|
|
4299
4305
|
}
|
|
4300
|
-
}), [
|
|
4306
|
+
}), [localVideoViewOptions, onToggleCamera]);
|
|
4301
4307
|
return (React__default['default'].createElement(ControlBarButton, Object.assign({}, props, { disabled: props.disabled || waitForCamera, onClick: onToggleCamera ? onToggleClick : props.onClick, onRenderOnIcon: (_a = props.onRenderOnIcon) !== null && _a !== void 0 ? _a : onRenderCameraOnIcon, onRenderOffIcon: (_b = props.onRenderOffIcon) !== null && _b !== void 0 ? _b : onRenderCameraOffIcon, strings: strings, labelKey: (_c = props.labelKey) !== null && _c !== void 0 ? _c : 'cameraButtonLabel' })));
|
|
4302
4308
|
};
|
|
4303
4309
|
|
|
@@ -4713,8 +4719,24 @@ const ScreenShareButton = (props) => {
|
|
|
4713
4719
|
var _a, _b, _c, _d;
|
|
4714
4720
|
const localeStrings = useLocale$1().strings.screenShareButton;
|
|
4715
4721
|
const strings = Object.assign(Object.assign({}, localeStrings), props.strings);
|
|
4716
|
-
|
|
4722
|
+
const theme = react.useTheme();
|
|
4723
|
+
const styles = screenshareButtonStyles(theme);
|
|
4724
|
+
return (React__default['default'].createElement(ControlBarButton, Object.assign({}, props, { styles: styles, onClick: (_a = props.onToggleScreenShare) !== null && _a !== void 0 ? _a : props.onClick, onRenderOnIcon: (_b = props.onRenderOnIcon) !== null && _b !== void 0 ? _b : onRenderScreenShareOnIcon, onRenderOffIcon: (_c = props.onRenderOffIcon) !== null && _c !== void 0 ? _c : onRenderScreenShareOffIcon, strings: strings, labelKey: (_d = props.labelKey) !== null && _d !== void 0 ? _d : 'screenShareButtonLabel' })));
|
|
4717
4725
|
};
|
|
4726
|
+
const screenshareButtonStyles = (theme) => ({
|
|
4727
|
+
rootChecked: {
|
|
4728
|
+
background: theme.palette.themePrimary,
|
|
4729
|
+
color: react.DefaultPalette.white,
|
|
4730
|
+
':focus::after': { outlineColor: `${react.DefaultPalette.white} !important` } // added !important to avoid override by FluentUI button styles
|
|
4731
|
+
},
|
|
4732
|
+
rootCheckedHovered: {
|
|
4733
|
+
background: theme.palette.themePrimary,
|
|
4734
|
+
color: react.DefaultPalette.white,
|
|
4735
|
+
':focus::after': { outlineColor: `${react.DefaultPalette.white} !important` } // added !important to avoid override by FluentUI button styles
|
|
4736
|
+
},
|
|
4737
|
+
labelHovered: { color: react.DefaultPalette.white },
|
|
4738
|
+
labelChecked: { color: react.DefaultPalette.white }
|
|
4739
|
+
});
|
|
4718
4740
|
|
|
4719
4741
|
// Copyright (c) Microsoft Corporation.
|
|
4720
4742
|
// Licensed under the MIT license.
|
|
@@ -5083,7 +5105,7 @@ const findSelector$1 = (component) => {
|
|
|
5083
5105
|
|
|
5084
5106
|
// Copyright (c) Microsoft Corporation.
|
|
5085
5107
|
// Licensed under the MIT license.
|
|
5086
|
-
var __awaiter$
|
|
5108
|
+
var __awaiter$k = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5087
5109
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5088
5110
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5089
5111
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -5105,38 +5127,38 @@ var __awaiter$g = (window && window.__awaiter) || function (thisArg, _arguments,
|
|
|
5105
5127
|
const createDefaultChatHandlers = memoizeOne__default['default']((chatClient, chatThreadClient) => {
|
|
5106
5128
|
let messageIterator = undefined;
|
|
5107
5129
|
return {
|
|
5108
|
-
onSendMessage: (content) => __awaiter$
|
|
5130
|
+
onSendMessage: (content) => __awaiter$k(void 0, void 0, void 0, function* () {
|
|
5109
5131
|
const sendMessageRequest = {
|
|
5110
5132
|
content,
|
|
5111
5133
|
senderDisplayName: chatClient.getState().displayName
|
|
5112
5134
|
};
|
|
5113
5135
|
yield chatThreadClient.sendMessage(sendMessageRequest);
|
|
5114
5136
|
}),
|
|
5115
|
-
onUpdateMessage: (messageId, content) => __awaiter$
|
|
5137
|
+
onUpdateMessage: (messageId, content) => __awaiter$k(void 0, void 0, void 0, function* () {
|
|
5116
5138
|
yield chatThreadClient.updateMessage(messageId, { content });
|
|
5117
5139
|
}),
|
|
5118
|
-
onDeleteMessage: (messageId) => __awaiter$
|
|
5140
|
+
onDeleteMessage: (messageId) => __awaiter$k(void 0, void 0, void 0, function* () {
|
|
5119
5141
|
yield chatThreadClient.deleteMessage(messageId);
|
|
5120
5142
|
}),
|
|
5121
5143
|
// This handler is designed for chatThread to consume
|
|
5122
|
-
onMessageSeen: (chatMessageId) => __awaiter$
|
|
5144
|
+
onMessageSeen: (chatMessageId) => __awaiter$k(void 0, void 0, void 0, function* () {
|
|
5123
5145
|
yield chatThreadClient.sendReadReceipt({ chatMessageId });
|
|
5124
5146
|
}),
|
|
5125
|
-
onTyping: () => __awaiter$
|
|
5147
|
+
onTyping: () => __awaiter$k(void 0, void 0, void 0, function* () {
|
|
5126
5148
|
yield chatThreadClient.sendTypingNotification();
|
|
5127
5149
|
}),
|
|
5128
|
-
onRemoveParticipant: (userId) => __awaiter$
|
|
5150
|
+
onRemoveParticipant: (userId) => __awaiter$k(void 0, void 0, void 0, function* () {
|
|
5129
5151
|
yield chatThreadClient.removeParticipant(fromFlatCommunicationIdentifier(userId));
|
|
5130
5152
|
}),
|
|
5131
|
-
updateThreadTopicName: (topicName) => __awaiter$
|
|
5153
|
+
updateThreadTopicName: (topicName) => __awaiter$k(void 0, void 0, void 0, function* () {
|
|
5132
5154
|
yield chatThreadClient.updateTopic(topicName);
|
|
5133
5155
|
}),
|
|
5134
|
-
onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$
|
|
5156
|
+
onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$k(void 0, void 0, void 0, function* () {
|
|
5135
5157
|
var _a;
|
|
5136
5158
|
if (messageIterator === undefined) {
|
|
5137
5159
|
// Lazy definition so that errors in the method call are reported correctly.
|
|
5138
5160
|
// Also allows recovery via retries in case of transient errors.
|
|
5139
|
-
messageIterator = chatThreadClient.listMessages();
|
|
5161
|
+
messageIterator = chatThreadClient.listMessages({ maxPageSize: 50 });
|
|
5140
5162
|
}
|
|
5141
5163
|
let remainingMessagesToGet = messagesToLoad;
|
|
5142
5164
|
let isAllChatMessagesLoaded = false;
|
|
@@ -5740,7 +5762,7 @@ const findSelector = (component) => {
|
|
|
5740
5762
|
|
|
5741
5763
|
// Copyright (c) Microsoft Corporation.
|
|
5742
5764
|
// Licensed under the MIT license.
|
|
5743
|
-
var __awaiter$
|
|
5765
|
+
var __awaiter$j = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5744
5766
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5745
5767
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5746
5768
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -5789,10 +5811,10 @@ class ProxyDeviceManager {
|
|
|
5789
5811
|
this.selectCamera = (videoDeviceInfo) => {
|
|
5790
5812
|
this._context.setDeviceManagerSelectedCamera(videoDeviceInfo);
|
|
5791
5813
|
};
|
|
5792
|
-
this.videoDevicesUpdated = () => __awaiter$
|
|
5814
|
+
this.videoDevicesUpdated = () => __awaiter$j(this, void 0, void 0, function* () {
|
|
5793
5815
|
this._context.setDeviceManagerCameras(dedupeById(yield this._deviceManager.getCameras()));
|
|
5794
5816
|
});
|
|
5795
|
-
this.audioDevicesUpdated = () => __awaiter$
|
|
5817
|
+
this.audioDevicesUpdated = () => __awaiter$j(this, void 0, void 0, function* () {
|
|
5796
5818
|
this._context.setDeviceManagerMicrophones(dedupeById(yield this._deviceManager.getMicrophones()));
|
|
5797
5819
|
this._context.setDeviceManagerSpeakers(dedupeById(yield this._deviceManager.getSpeakers()));
|
|
5798
5820
|
});
|
|
@@ -5915,7 +5937,7 @@ class CallError extends Error {
|
|
|
5915
5937
|
|
|
5916
5938
|
// Copyright (c) Microsoft Corporation.
|
|
5917
5939
|
// Licensed under the MIT license.
|
|
5918
|
-
var __awaiter$
|
|
5940
|
+
var __awaiter$i = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5919
5941
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5920
5942
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5921
5943
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -6404,7 +6426,7 @@ class CallContext$1 {
|
|
|
6404
6426
|
* @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.
|
|
6405
6427
|
*/
|
|
6406
6428
|
withAsyncErrorTeedToState(action, target) {
|
|
6407
|
-
return (...args) => __awaiter$
|
|
6429
|
+
return (...args) => __awaiter$i(this, void 0, void 0, function* () {
|
|
6408
6430
|
try {
|
|
6409
6431
|
return yield action(...args);
|
|
6410
6432
|
}
|
|
@@ -6467,7 +6489,7 @@ const findOldestCallEnded = (calls) => {
|
|
|
6467
6489
|
|
|
6468
6490
|
// Copyright (c) Microsoft Corporation.
|
|
6469
6491
|
// Licensed under the MIT license.
|
|
6470
|
-
var __awaiter$
|
|
6492
|
+
var __awaiter$h = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6471
6493
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6472
6494
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6473
6495
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -6487,42 +6509,42 @@ class ProxyCall {
|
|
|
6487
6509
|
switch (prop) {
|
|
6488
6510
|
case 'mute': {
|
|
6489
6511
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
|
6490
|
-
return __awaiter$
|
|
6512
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
6491
6513
|
return yield target.mute(...args);
|
|
6492
6514
|
});
|
|
6493
6515
|
}, 'Call.mute');
|
|
6494
6516
|
}
|
|
6495
6517
|
case 'unmute': {
|
|
6496
6518
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
|
6497
|
-
return __awaiter$
|
|
6519
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
6498
6520
|
return yield target.unmute(...args);
|
|
6499
6521
|
});
|
|
6500
6522
|
}, 'Call.unmute');
|
|
6501
6523
|
}
|
|
6502
6524
|
case 'startVideo': {
|
|
6503
6525
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
|
6504
|
-
return __awaiter$
|
|
6526
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
6505
6527
|
return yield target.startVideo(...args);
|
|
6506
6528
|
});
|
|
6507
6529
|
}, 'Call.startVideo');
|
|
6508
6530
|
}
|
|
6509
6531
|
case 'stopVideo': {
|
|
6510
6532
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
|
6511
|
-
return __awaiter$
|
|
6533
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
6512
6534
|
return yield target.stopVideo(...args);
|
|
6513
6535
|
});
|
|
6514
6536
|
}, 'Call.stopVideo');
|
|
6515
6537
|
}
|
|
6516
6538
|
case 'startScreenSharing': {
|
|
6517
6539
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
|
6518
|
-
return __awaiter$
|
|
6540
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
6519
6541
|
return yield target.startScreenSharing(...args);
|
|
6520
6542
|
});
|
|
6521
6543
|
}, 'Call.startScreenSharing');
|
|
6522
6544
|
}
|
|
6523
6545
|
case 'stopScreenSharing': {
|
|
6524
6546
|
return this._context.withAsyncErrorTeedToState(function (...args) {
|
|
6525
|
-
return __awaiter$
|
|
6547
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
6526
6548
|
return yield target.stopScreenSharing(...args);
|
|
6527
6549
|
});
|
|
6528
6550
|
}, 'Call.stopScreenSharing');
|
|
@@ -6720,7 +6742,7 @@ class RemoteVideoStreamSubscriber {
|
|
|
6720
6742
|
|
|
6721
6743
|
// Copyright (c) Microsoft Corporation.
|
|
6722
6744
|
// Licensed under the MIT license.
|
|
6723
|
-
var __awaiter$
|
|
6745
|
+
var __awaiter$g = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6724
6746
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6725
6747
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6726
6748
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -6730,7 +6752,7 @@ var __awaiter$c = (window && window.__awaiter) || function (thisArg, _arguments,
|
|
|
6730
6752
|
});
|
|
6731
6753
|
};
|
|
6732
6754
|
function createViewRemoteVideo(context, internalContext, callId, participantId, stream, options) {
|
|
6733
|
-
return __awaiter$
|
|
6755
|
+
return __awaiter$g(this, void 0, void 0, function* () {
|
|
6734
6756
|
// Render RemoteVideoStream that is part of a Call
|
|
6735
6757
|
const streamId = stream.id;
|
|
6736
6758
|
let participantKey;
|
|
@@ -6750,7 +6772,8 @@ function createViewRemoteVideo(context, internalContext, callId, participantId,
|
|
|
6750
6772
|
return;
|
|
6751
6773
|
}
|
|
6752
6774
|
if (renderInfo.status === 'Rendering') {
|
|
6753
|
-
console
|
|
6775
|
+
// Do not log to console here as this is a very common situation due to UI rerenders while
|
|
6776
|
+
// the video rendering is in progress.
|
|
6754
6777
|
return;
|
|
6755
6778
|
}
|
|
6756
6779
|
if (renderInfo.status === 'Stopping') {
|
|
@@ -6790,7 +6813,7 @@ function createViewRemoteVideo(context, internalContext, callId, participantId,
|
|
|
6790
6813
|
});
|
|
6791
6814
|
}
|
|
6792
6815
|
function createViewLocalVideo(context, internalContext, callId, options) {
|
|
6793
|
-
return __awaiter$
|
|
6816
|
+
return __awaiter$g(this, void 0, void 0, function* () {
|
|
6794
6817
|
// Render LocalVideoStream that is part of a Call
|
|
6795
6818
|
const renderInfo = internalContext.getLocalRenderInfo(callId);
|
|
6796
6819
|
if (!renderInfo) {
|
|
@@ -6802,7 +6825,8 @@ function createViewLocalVideo(context, internalContext, callId, options) {
|
|
|
6802
6825
|
return;
|
|
6803
6826
|
}
|
|
6804
6827
|
if (renderInfo.status === 'Rendering') {
|
|
6805
|
-
console
|
|
6828
|
+
// Do not log to console here as this is a very common situation due to UI rerenders while
|
|
6829
|
+
// the video rendering is in progress.
|
|
6806
6830
|
return;
|
|
6807
6831
|
}
|
|
6808
6832
|
if (renderInfo.status === 'Stopping') {
|
|
@@ -6844,14 +6868,15 @@ function createViewLocalVideo(context, internalContext, callId, options) {
|
|
|
6844
6868
|
});
|
|
6845
6869
|
}
|
|
6846
6870
|
function createViewUnparentedVideo(context, internalContext, stream, options) {
|
|
6847
|
-
return __awaiter$
|
|
6871
|
+
return __awaiter$g(this, void 0, void 0, function* () {
|
|
6848
6872
|
const renderInfo = internalContext.getUnparentedRenderInfo(stream);
|
|
6849
6873
|
if (renderInfo && renderInfo.status === 'Rendered') {
|
|
6850
6874
|
console.warn('Unparented LocalVideoStream is already rendered');
|
|
6851
6875
|
return;
|
|
6852
6876
|
}
|
|
6853
6877
|
if (renderInfo && renderInfo.status === 'Rendering') {
|
|
6854
|
-
console
|
|
6878
|
+
// Do not log to console here as this is a very common situation due to UI rerenders while
|
|
6879
|
+
// the video rendering is in progress.
|
|
6855
6880
|
return;
|
|
6856
6881
|
}
|
|
6857
6882
|
if (renderInfo && renderInfo.status === 'Stopping') {
|
|
@@ -7665,7 +7690,7 @@ class InternalCallContext {
|
|
|
7665
7690
|
|
|
7666
7691
|
// Copyright (c) Microsoft Corporation.
|
|
7667
7692
|
// Licensed under the MIT license.
|
|
7668
|
-
var __awaiter$
|
|
7693
|
+
var __awaiter$f = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7669
7694
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7670
7695
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7671
7696
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -7687,7 +7712,7 @@ class ProxyCallClient {
|
|
|
7687
7712
|
get(target, prop) {
|
|
7688
7713
|
switch (prop) {
|
|
7689
7714
|
case 'createCallAgent': {
|
|
7690
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
|
7715
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$f(this, void 0, void 0, function* () {
|
|
7691
7716
|
// createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
|
|
7692
7717
|
// callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
|
|
7693
7718
|
// callAgent if the createCallAgent succeeds.
|
|
@@ -7698,7 +7723,7 @@ class ProxyCallClient {
|
|
|
7698
7723
|
}), 'CallClient.createCallAgent');
|
|
7699
7724
|
}
|
|
7700
7725
|
case 'getDeviceManager': {
|
|
7701
|
-
return this._context.withAsyncErrorTeedToState(() => __awaiter$
|
|
7726
|
+
return this._context.withAsyncErrorTeedToState(() => __awaiter$f(this, void 0, void 0, function* () {
|
|
7702
7727
|
// As of writing, the SDK always returns the same instance of DeviceManager so we keep a reference of
|
|
7703
7728
|
// DeviceManager and if it does not change we return the cached DeclarativeDeviceManager. If it does not we'll
|
|
7704
7729
|
// throw an error that indicate we need to fix this issue as our implementation has diverged from the SDK.
|
|
@@ -7813,7 +7838,7 @@ const Constants = {
|
|
|
7813
7838
|
|
|
7814
7839
|
// Copyright (c) Microsoft Corporation.
|
|
7815
7840
|
// Licensed under the MIT license.
|
|
7816
|
-
var __awaiter$
|
|
7841
|
+
var __awaiter$e = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7817
7842
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7818
7843
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7819
7844
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -8090,7 +8115,7 @@ class ChatContext$1 {
|
|
|
8090
8115
|
* @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.
|
|
8091
8116
|
*/
|
|
8092
8117
|
withAsyncErrorTeedToState(f, target) {
|
|
8093
|
-
return (...args) => __awaiter$
|
|
8118
|
+
return (...args) => __awaiter$e(this, void 0, void 0, function* () {
|
|
8094
8119
|
try {
|
|
8095
8120
|
return yield f(...args);
|
|
8096
8121
|
}
|
|
@@ -8193,7 +8218,7 @@ const convertChatMessage = (message, status = 'delivered', clientMessageId) => {
|
|
|
8193
8218
|
|
|
8194
8219
|
// Copyright (c) Microsoft Corporation.
|
|
8195
8220
|
// Licensed under the MIT license.
|
|
8196
|
-
var __awaiter$
|
|
8221
|
+
var __awaiter$d = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8197
8222
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8198
8223
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8199
8224
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -8276,7 +8301,7 @@ class EventSubscriber {
|
|
|
8276
8301
|
this.fetchLastParticipantMessage(event.threadId, 'participantAdded');
|
|
8277
8302
|
};
|
|
8278
8303
|
// This is a hot fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK
|
|
8279
|
-
this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$
|
|
8304
|
+
this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$d(this, void 0, void 0, function* () {
|
|
8280
8305
|
var e_1, _a;
|
|
8281
8306
|
try {
|
|
8282
8307
|
for (var _b = __asyncValues$1(this.chatClient
|
|
@@ -8362,7 +8387,7 @@ class EventSubscriber {
|
|
|
8362
8387
|
|
|
8363
8388
|
// Copyright (c) Microsoft Corporation.
|
|
8364
8389
|
// Licensed under the MIT license.
|
|
8365
|
-
var __awaiter$
|
|
8390
|
+
var __awaiter$c = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8366
8391
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8367
8392
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8368
8393
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -8384,7 +8409,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
|
|
|
8384
8409
|
const threadsIterator = iteratorCreator(...args);
|
|
8385
8410
|
return {
|
|
8386
8411
|
next() {
|
|
8387
|
-
return __awaiter$
|
|
8412
|
+
return __awaiter$c(this, void 0, void 0, function* () {
|
|
8388
8413
|
const result = yield threadsIterator.next();
|
|
8389
8414
|
if (!result.done && result.value) {
|
|
8390
8415
|
decorateFn(result.value, context);
|
|
@@ -8399,7 +8424,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
|
|
|
8399
8424
|
const pages = threadsIterator.byPage(settings);
|
|
8400
8425
|
return {
|
|
8401
8426
|
next() {
|
|
8402
|
-
return __awaiter$
|
|
8427
|
+
return __awaiter$c(this, void 0, void 0, function* () {
|
|
8403
8428
|
const result = yield pages.next();
|
|
8404
8429
|
const page = result.value;
|
|
8405
8430
|
if (!result.done && result.value) {
|
|
@@ -8483,7 +8508,7 @@ const createDecoratedListParticipants = (chatThreadClient, context) => {
|
|
|
8483
8508
|
|
|
8484
8509
|
// Copyright (c) Microsoft Corporation.
|
|
8485
8510
|
// Licensed under the MIT license.
|
|
8486
|
-
var __awaiter$
|
|
8511
|
+
var __awaiter$b = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8487
8512
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8488
8513
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8489
8514
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -8502,14 +8527,14 @@ class ProxyChatThreadClient {
|
|
|
8502
8527
|
return createDecoratedListMessages(chatThreadClient, this._context);
|
|
8503
8528
|
}
|
|
8504
8529
|
case 'getMessage': {
|
|
8505
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
|
8530
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$b(this, void 0, void 0, function* () {
|
|
8506
8531
|
const message = yield chatThreadClient.getMessage(...args);
|
|
8507
8532
|
this._context.setChatMessage(chatThreadClient.threadId, convertChatMessage(message));
|
|
8508
8533
|
return message;
|
|
8509
8534
|
}), 'ChatThreadClient.getMessage');
|
|
8510
8535
|
}
|
|
8511
8536
|
case 'sendMessage': {
|
|
8512
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
|
8537
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$b(this, void 0, void 0, function* () {
|
|
8513
8538
|
// Retry logic?
|
|
8514
8539
|
const { content } = args[0];
|
|
8515
8540
|
const clientMessageId = nanoid.nanoid(); // Generate a local short uuid for message
|
|
@@ -8547,7 +8572,7 @@ class ProxyChatThreadClient {
|
|
|
8547
8572
|
}), 'ChatThreadClient.sendMessage');
|
|
8548
8573
|
}
|
|
8549
8574
|
case 'addParticipants': {
|
|
8550
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
|
8575
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$b(this, void 0, void 0, function* () {
|
|
8551
8576
|
const result = yield chatThreadClient.addParticipants(...args);
|
|
8552
8577
|
const [addRequest] = args;
|
|
8553
8578
|
const participantsToAdd = addRequest.participants;
|
|
@@ -8556,7 +8581,7 @@ class ProxyChatThreadClient {
|
|
|
8556
8581
|
}), 'ChatThreadClient.addParticipants');
|
|
8557
8582
|
}
|
|
8558
8583
|
case 'deleteMessage': {
|
|
8559
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
|
8584
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$b(this, void 0, void 0, function* () {
|
|
8560
8585
|
// DeleteMessage is able to either delete local one(for failed message) or synced message
|
|
8561
8586
|
const [messageId] = args;
|
|
8562
8587
|
if (this._context.deleteLocalMessage(chatThreadClient.threadId, messageId)) {
|
|
@@ -8574,7 +8599,7 @@ class ProxyChatThreadClient {
|
|
|
8574
8599
|
return createDecoratedListReadReceipts(chatThreadClient, this._context);
|
|
8575
8600
|
}
|
|
8576
8601
|
case 'removeParticipant': {
|
|
8577
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
|
8602
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$b(this, void 0, void 0, function* () {
|
|
8578
8603
|
const result = yield chatThreadClient.removeParticipant(...args);
|
|
8579
8604
|
const [removeIdentifier] = args;
|
|
8580
8605
|
this._context.deleteParticipant(chatThreadClient.threadId, communicationCommon.getIdentifierKind(removeIdentifier));
|
|
@@ -8582,7 +8607,7 @@ class ProxyChatThreadClient {
|
|
|
8582
8607
|
}), 'ChatThreadClient.removeParticipant');
|
|
8583
8608
|
}
|
|
8584
8609
|
case 'updateMessage': {
|
|
8585
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
|
8610
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$b(this, void 0, void 0, function* () {
|
|
8586
8611
|
const result = yield chatThreadClient.updateMessage(...args);
|
|
8587
8612
|
const [messageId, updateOption] = args;
|
|
8588
8613
|
this._context.updateChatMessageContent(chatThreadClient.threadId, messageId, updateOption === null || updateOption === void 0 ? void 0 : updateOption.content);
|
|
@@ -8590,7 +8615,7 @@ class ProxyChatThreadClient {
|
|
|
8590
8615
|
}), 'ChatThreadClient.updateMessage');
|
|
8591
8616
|
}
|
|
8592
8617
|
case 'updateTopic': {
|
|
8593
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
|
8618
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$b(this, void 0, void 0, function* () {
|
|
8594
8619
|
const result = yield chatThreadClient.updateTopic(...args);
|
|
8595
8620
|
const [topic] = args;
|
|
8596
8621
|
this._context.updateThreadTopic(chatThreadClient.threadId, topic);
|
|
@@ -8598,7 +8623,7 @@ class ProxyChatThreadClient {
|
|
|
8598
8623
|
}), 'ChatThreadClient.updateTopic');
|
|
8599
8624
|
}
|
|
8600
8625
|
case 'getProperties': {
|
|
8601
|
-
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$
|
|
8626
|
+
return this._context.withAsyncErrorTeedToState((...args) => __awaiter$b(this, void 0, void 0, function* () {
|
|
8602
8627
|
const result = yield chatThreadClient.getProperties(...args);
|
|
8603
8628
|
this._context.updateThread(chatThreadClient.threadId, result);
|
|
8604
8629
|
return result;
|
|
@@ -8635,7 +8660,7 @@ const createDecoratedListThreads = (chatClient, context) => {
|
|
|
8635
8660
|
|
|
8636
8661
|
// Copyright (c) Microsoft Corporation.
|
|
8637
8662
|
// Licensed under the MIT license.
|
|
8638
|
-
var __awaiter$
|
|
8663
|
+
var __awaiter$a = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8639
8664
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8640
8665
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8641
8666
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -8654,7 +8679,7 @@ const proxyChatClient = {
|
|
|
8654
8679
|
switch (prop) {
|
|
8655
8680
|
case 'createChatThread': {
|
|
8656
8681
|
return context.withAsyncErrorTeedToState(function (...args) {
|
|
8657
|
-
return __awaiter$
|
|
8682
|
+
return __awaiter$a(this, void 0, void 0, function* () {
|
|
8658
8683
|
const result = yield chatClient.createChatThread(...args);
|
|
8659
8684
|
const thread = result.chatThread;
|
|
8660
8685
|
if (thread) {
|
|
@@ -8667,7 +8692,7 @@ const proxyChatClient = {
|
|
|
8667
8692
|
}
|
|
8668
8693
|
case 'deleteChatThread': {
|
|
8669
8694
|
return context.withAsyncErrorTeedToState(function (...args) {
|
|
8670
|
-
return __awaiter$
|
|
8695
|
+
return __awaiter$a(this, void 0, void 0, function* () {
|
|
8671
8696
|
const result = yield chatClient.deleteChatThread(...args);
|
|
8672
8697
|
context.deleteThread(args[0]);
|
|
8673
8698
|
return result;
|
|
@@ -8687,7 +8712,7 @@ const proxyChatClient = {
|
|
|
8687
8712
|
}
|
|
8688
8713
|
case 'startRealtimeNotifications': {
|
|
8689
8714
|
return context.withAsyncErrorTeedToState(function (...args) {
|
|
8690
|
-
return __awaiter$
|
|
8715
|
+
return __awaiter$a(this, void 0, void 0, function* () {
|
|
8691
8716
|
const ret = yield chatClient.startRealtimeNotifications(...args);
|
|
8692
8717
|
if (!receiver.eventSubscriber) {
|
|
8693
8718
|
receiver.eventSubscriber = new EventSubscriber(chatClient, context);
|
|
@@ -8698,7 +8723,7 @@ const proxyChatClient = {
|
|
|
8698
8723
|
}
|
|
8699
8724
|
case 'stopRealtimeNotifications': {
|
|
8700
8725
|
return context.withAsyncErrorTeedToState(function (...args) {
|
|
8701
|
-
return __awaiter$
|
|
8726
|
+
return __awaiter$a(this, void 0, void 0, function* () {
|
|
8702
8727
|
const ret = yield chatClient.stopRealtimeNotifications(...args);
|
|
8703
8728
|
if (receiver.eventSubscriber) {
|
|
8704
8729
|
receiver.eventSubscriber.unsubscribe();
|
|
@@ -8762,7 +8787,7 @@ const createStatefulChatClientWithDeps = (chatClient, args, options) => {
|
|
|
8762
8787
|
|
|
8763
8788
|
// Copyright (c) Microsoft Corporation.
|
|
8764
8789
|
// Licensed under the MIT license.
|
|
8765
|
-
var __awaiter$
|
|
8790
|
+
var __awaiter$9 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8766
8791
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8767
8792
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8768
8793
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -8867,7 +8892,7 @@ class AzureCommunicationChatAdapter {
|
|
|
8867
8892
|
}
|
|
8868
8893
|
fetchInitialData() {
|
|
8869
8894
|
var e_1, _a;
|
|
8870
|
-
return __awaiter$
|
|
8895
|
+
return __awaiter$9(this, void 0, void 0, function* () {
|
|
8871
8896
|
try {
|
|
8872
8897
|
yield this.chatThreadClient.getProperties();
|
|
8873
8898
|
}
|
|
@@ -8909,55 +8934,55 @@ class AzureCommunicationChatAdapter {
|
|
|
8909
8934
|
this.context.offStateChange(handler);
|
|
8910
8935
|
}
|
|
8911
8936
|
sendMessage(content) {
|
|
8912
|
-
return __awaiter$
|
|
8913
|
-
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
|
8937
|
+
return __awaiter$9(this, void 0, void 0, function* () {
|
|
8938
|
+
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$9(this, void 0, void 0, function* () {
|
|
8914
8939
|
yield this.handlers.onSendMessage(content);
|
|
8915
8940
|
}));
|
|
8916
8941
|
});
|
|
8917
8942
|
}
|
|
8918
8943
|
sendReadReceipt(chatMessageId) {
|
|
8919
|
-
return __awaiter$
|
|
8920
|
-
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
|
8944
|
+
return __awaiter$9(this, void 0, void 0, function* () {
|
|
8945
|
+
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$9(this, void 0, void 0, function* () {
|
|
8921
8946
|
yield this.handlers.onMessageSeen(chatMessageId);
|
|
8922
8947
|
}));
|
|
8923
8948
|
});
|
|
8924
8949
|
}
|
|
8925
8950
|
sendTypingIndicator() {
|
|
8926
|
-
return __awaiter$
|
|
8951
|
+
return __awaiter$9(this, void 0, void 0, function* () {
|
|
8927
8952
|
yield this.handlers.onTyping();
|
|
8928
8953
|
});
|
|
8929
8954
|
}
|
|
8930
8955
|
removeParticipant(userId) {
|
|
8931
|
-
return __awaiter$
|
|
8932
|
-
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
|
8956
|
+
return __awaiter$9(this, void 0, void 0, function* () {
|
|
8957
|
+
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$9(this, void 0, void 0, function* () {
|
|
8933
8958
|
yield this.handlers.onRemoveParticipant(userId);
|
|
8934
8959
|
}));
|
|
8935
8960
|
});
|
|
8936
8961
|
}
|
|
8937
8962
|
setTopic(topicName) {
|
|
8938
|
-
return __awaiter$
|
|
8939
|
-
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
|
8963
|
+
return __awaiter$9(this, void 0, void 0, function* () {
|
|
8964
|
+
yield this.asyncTeeErrorToEventEmitter(() => __awaiter$9(this, void 0, void 0, function* () {
|
|
8940
8965
|
yield this.handlers.updateThreadTopicName(topicName);
|
|
8941
8966
|
}));
|
|
8942
8967
|
});
|
|
8943
8968
|
}
|
|
8944
8969
|
loadPreviousChatMessages(messagesToLoad) {
|
|
8945
|
-
return __awaiter$
|
|
8946
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
|
8970
|
+
return __awaiter$9(this, void 0, void 0, function* () {
|
|
8971
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$9(this, void 0, void 0, function* () {
|
|
8947
8972
|
return yield this.handlers.onLoadPreviousChatMessages(messagesToLoad);
|
|
8948
8973
|
}));
|
|
8949
8974
|
});
|
|
8950
8975
|
}
|
|
8951
8976
|
updateMessage(messageId, content) {
|
|
8952
|
-
return __awaiter$
|
|
8953
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
|
8977
|
+
return __awaiter$9(this, void 0, void 0, function* () {
|
|
8978
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$9(this, void 0, void 0, function* () {
|
|
8954
8979
|
return yield this.handlers.onUpdateMessage(messageId, content);
|
|
8955
8980
|
}));
|
|
8956
8981
|
});
|
|
8957
8982
|
}
|
|
8958
8983
|
deleteMessage(messageId) {
|
|
8959
|
-
return __awaiter$
|
|
8960
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$
|
|
8984
|
+
return __awaiter$9(this, void 0, void 0, function* () {
|
|
8985
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$9(this, void 0, void 0, function* () {
|
|
8961
8986
|
return yield this.handlers.onDeleteMessage(messageId);
|
|
8962
8987
|
}));
|
|
8963
8988
|
});
|
|
@@ -9010,7 +9035,7 @@ class AzureCommunicationChatAdapter {
|
|
|
9010
9035
|
this.emitter.off(event, listener);
|
|
9011
9036
|
}
|
|
9012
9037
|
asyncTeeErrorToEventEmitter(f) {
|
|
9013
|
-
return __awaiter$
|
|
9038
|
+
return __awaiter$9(this, void 0, void 0, function* () {
|
|
9014
9039
|
try {
|
|
9015
9040
|
return yield f();
|
|
9016
9041
|
}
|
|
@@ -9052,7 +9077,7 @@ const convertEventType = (type) => {
|
|
|
9052
9077
|
*
|
|
9053
9078
|
* @public
|
|
9054
9079
|
*/
|
|
9055
|
-
const createAzureCommunicationChatAdapter = ({ endpoint: endpointUrl, userId, displayName, credential, threadId }) => __awaiter$
|
|
9080
|
+
const createAzureCommunicationChatAdapter = ({ endpoint: endpointUrl, userId, displayName, credential, threadId }) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
9056
9081
|
const chatClient = createStatefulChatClient({
|
|
9057
9082
|
userId,
|
|
9058
9083
|
displayName,
|
|
@@ -9073,7 +9098,7 @@ const createAzureCommunicationChatAdapter = ({ endpoint: endpointUrl, userId, di
|
|
|
9073
9098
|
*
|
|
9074
9099
|
* @public
|
|
9075
9100
|
*/
|
|
9076
|
-
const createAzureCommunicationChatAdapterFromClient = (chatClient, chatThreadClient) => __awaiter$
|
|
9101
|
+
const createAzureCommunicationChatAdapterFromClient = (chatClient, chatThreadClient) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
9077
9102
|
return new AzureCommunicationChatAdapter(chatClient, chatThreadClient);
|
|
9078
9103
|
});
|
|
9079
9104
|
const isChatError = (e) => {
|
|
@@ -9413,7 +9438,7 @@ const topicNameLabelStyle = react.mergeStyles({
|
|
|
9413
9438
|
/**
|
|
9414
9439
|
* @private
|
|
9415
9440
|
*/
|
|
9416
|
-
react.mergeStyles({
|
|
9441
|
+
const participantListWrapper = react.mergeStyles({
|
|
9417
9442
|
boxShadow: '0px 0.3px 0.9px rgba(0, 0, 0, 0.1), 0px 1.6px 3.6px rgba(0, 0, 0, 0.13)',
|
|
9418
9443
|
width: '20rem',
|
|
9419
9444
|
// max width at 50% of view so the People Pane is not squeezing the Message Pane to almost nothing when on small screen or high zoom in
|
|
@@ -9427,20 +9452,20 @@ const participantListContainerPadding = { childrenGap: '0.5rem' };
|
|
|
9427
9452
|
/**
|
|
9428
9453
|
* @private
|
|
9429
9454
|
*/
|
|
9430
|
-
react.mergeStyles({
|
|
9455
|
+
const listHeader = react.mergeStyles({
|
|
9431
9456
|
fontSize: '1rem',
|
|
9432
9457
|
margin: '1rem'
|
|
9433
9458
|
});
|
|
9434
9459
|
/**
|
|
9435
9460
|
* @private
|
|
9436
9461
|
*/
|
|
9437
|
-
react.mergeStyles({
|
|
9462
|
+
const participantListStack = react.mergeStyles({
|
|
9438
9463
|
height: '100%'
|
|
9439
9464
|
});
|
|
9440
9465
|
/**
|
|
9441
9466
|
* @private
|
|
9442
9467
|
*/
|
|
9443
|
-
react.mergeStyles({
|
|
9468
|
+
const participantListStyle = react.mergeStyles({
|
|
9444
9469
|
height: '100%',
|
|
9445
9470
|
overflow: 'auto'
|
|
9446
9471
|
});
|
|
@@ -9463,7 +9488,7 @@ const typingIndicatorChatCompositeStyles = {
|
|
|
9463
9488
|
|
|
9464
9489
|
// Copyright (c) Microsoft Corporation.
|
|
9465
9490
|
// Licensed under the MIT license.
|
|
9466
|
-
var __awaiter$
|
|
9491
|
+
var __awaiter$8 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9467
9492
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9468
9493
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
9469
9494
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -9484,7 +9509,7 @@ const AvatarPersona = (props) => {
|
|
|
9484
9509
|
const { userId, dataProvider } = props;
|
|
9485
9510
|
const [data, setData] = React__default['default'].useState();
|
|
9486
9511
|
React.useEffect(() => {
|
|
9487
|
-
(() => __awaiter$
|
|
9512
|
+
(() => __awaiter$8(void 0, void 0, void 0, function* () {
|
|
9488
9513
|
if (dataProvider && userId) {
|
|
9489
9514
|
const data = yield dataProvider(userId);
|
|
9490
9515
|
setData(data);
|
|
@@ -9622,16 +9647,17 @@ const usePropsFor$2 = (component) => {
|
|
|
9622
9647
|
* @private
|
|
9623
9648
|
*/
|
|
9624
9649
|
const ChatScreen = (props) => {
|
|
9625
|
-
const { onFetchAvatarPersonaData, onRenderMessage, onRenderTypingIndicator,
|
|
9626
|
-
// onFetchParticipantMenuItems, // Removed for GA release
|
|
9627
|
-
options, styles } = props;
|
|
9650
|
+
const { onFetchAvatarPersonaData, onRenderMessage, onRenderTypingIndicator, onFetchParticipantMenuItems, options, styles } = props;
|
|
9628
9651
|
const defaultNumberOfChatMessagesToReload = 5;
|
|
9629
9652
|
const sendBoxParentStyle = react.mergeStyles({ width: '100%' });
|
|
9630
9653
|
const adapter = useAdapter$1();
|
|
9631
9654
|
React.useEffect(() => {
|
|
9632
9655
|
adapter.fetchInitialData();
|
|
9633
9656
|
}, [adapter]);
|
|
9657
|
+
const locale = useLocale();
|
|
9658
|
+
const chatListHeader = locale.strings.chat.chatListHeader;
|
|
9634
9659
|
const messageThreadProps = usePropsFor$2(MessageThread);
|
|
9660
|
+
const participantListProps = usePropsFor$2(ParticipantList);
|
|
9635
9661
|
const sendBoxProps = usePropsFor$2(SendBox);
|
|
9636
9662
|
const typingIndicatorProps = usePropsFor$2(TypingIndicator);
|
|
9637
9663
|
const headerProps = useAdaptedSelector$1(getHeaderProps);
|
|
@@ -9650,7 +9676,12 @@ const ChatScreen = (props) => {
|
|
|
9650
9676
|
React__default['default'].createElement(MessageThread, Object.assign({}, messageThreadProps, { onRenderAvatar: onRenderAvatarCallback, onRenderMessage: onRenderMessage, numberOfChatMessagesToReload: defaultNumberOfChatMessagesToReload, styles: messageThreadStyles })),
|
|
9651
9677
|
React__default['default'].createElement(react.Stack.Item, { align: "center", className: sendBoxParentStyle },
|
|
9652
9678
|
React__default['default'].createElement("div", { style: { paddingLeft: '0.5rem', paddingRight: '0.5rem' } }, onRenderTypingIndicator ? (onRenderTypingIndicator(typingIndicatorProps.typingUsers)) : (React__default['default'].createElement(TypingIndicator, Object.assign({}, typingIndicatorProps, { styles: typingIndicatorStyles })))),
|
|
9653
|
-
React__default['default'].createElement(SendBox, Object.assign({}, sendBoxProps, { styles: sendBoxStyles }))))
|
|
9679
|
+
React__default['default'].createElement(SendBox, Object.assign({}, sendBoxProps, { styles: sendBoxStyles })))),
|
|
9680
|
+
(options === null || options === void 0 ? void 0 : options.participantPane) === true && (React__default['default'].createElement(react.Stack, { className: participantListWrapper },
|
|
9681
|
+
React__default['default'].createElement(react.Stack, { className: participantListStack },
|
|
9682
|
+
React__default['default'].createElement(react.Stack.Item, { className: listHeader }, chatListHeader),
|
|
9683
|
+
React__default['default'].createElement(react.FocusZone, { className: participantListStyle },
|
|
9684
|
+
React__default['default'].createElement(ParticipantList, Object.assign({}, participantListProps, { onRenderAvatar: (userId, options) => (React__default['default'].createElement(AvatarPersona, Object.assign({ "data-ui-id": "chat-composite-participant-custom-avatar", userId: userId }, options, { dataProvider: onFetchAvatarPersonaData }))), onFetchParticipantMenuItems: onFetchParticipantMenuItems })))))))));
|
|
9654
9685
|
};
|
|
9655
9686
|
|
|
9656
9687
|
// Copyright (c) Microsoft Corporation.
|
|
@@ -9875,7 +9906,7 @@ const getCallCompositePage = (call, previousCall) => {
|
|
|
9875
9906
|
|
|
9876
9907
|
// Copyright (c) Microsoft Corporation.
|
|
9877
9908
|
// Licensed under the MIT license.
|
|
9878
|
-
var __awaiter$
|
|
9909
|
+
var __awaiter$7 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9879
9910
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9880
9911
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
9881
9912
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -9894,59 +9925,59 @@ _component) => {
|
|
|
9894
9925
|
return createCompositeHandlers(useAdapter());
|
|
9895
9926
|
};
|
|
9896
9927
|
const createCompositeHandlers = memoizeOne__default['default']((adapter) => ({
|
|
9897
|
-
onCreateLocalStreamView: (options) => __awaiter$
|
|
9928
|
+
onCreateLocalStreamView: (options) => __awaiter$7(void 0, void 0, void 0, function* () {
|
|
9898
9929
|
yield adapter.createStreamView(undefined, options);
|
|
9899
9930
|
}),
|
|
9900
|
-
onCreateRemoteStreamView: (userId, options) => __awaiter$
|
|
9931
|
+
onCreateRemoteStreamView: (userId, options) => __awaiter$7(void 0, void 0, void 0, function* () {
|
|
9901
9932
|
yield adapter.createStreamView(userId, options);
|
|
9902
9933
|
}),
|
|
9903
|
-
onHangUp: () => __awaiter$
|
|
9934
|
+
onHangUp: () => __awaiter$7(void 0, void 0, void 0, function* () {
|
|
9904
9935
|
yield adapter.leaveCall();
|
|
9905
9936
|
}),
|
|
9906
|
-
onRemoveParticipant: (userId) => __awaiter$
|
|
9937
|
+
onRemoveParticipant: (userId) => __awaiter$7(void 0, void 0, void 0, function* () {
|
|
9907
9938
|
yield adapter.removeParticipant(userId);
|
|
9908
9939
|
}),
|
|
9909
|
-
onSelectCamera: (deviceInfo, options) => __awaiter$
|
|
9940
|
+
onSelectCamera: (deviceInfo, options) => __awaiter$7(void 0, void 0, void 0, function* () {
|
|
9910
9941
|
yield adapter.setCamera(deviceInfo, options);
|
|
9911
9942
|
}),
|
|
9912
|
-
onSelectMicrophone: (deviceInfo) => __awaiter$
|
|
9943
|
+
onSelectMicrophone: (deviceInfo) => __awaiter$7(void 0, void 0, void 0, function* () {
|
|
9913
9944
|
yield adapter.setMicrophone(deviceInfo);
|
|
9914
9945
|
}),
|
|
9915
|
-
onSelectSpeaker: (deviceInfo) => __awaiter$
|
|
9946
|
+
onSelectSpeaker: (deviceInfo) => __awaiter$7(void 0, void 0, void 0, function* () {
|
|
9916
9947
|
yield adapter.setSpeaker(deviceInfo);
|
|
9917
9948
|
}),
|
|
9918
9949
|
onStartCall: (participants) => {
|
|
9919
9950
|
const rawIds = participants.map((participant) => toFlatCommunicationIdentifier(participant));
|
|
9920
9951
|
return adapter.startCall(rawIds);
|
|
9921
9952
|
},
|
|
9922
|
-
onStartScreenShare: () => __awaiter$
|
|
9953
|
+
onStartScreenShare: () => __awaiter$7(void 0, void 0, void 0, function* () {
|
|
9923
9954
|
yield adapter.startScreenShare();
|
|
9924
9955
|
}),
|
|
9925
|
-
onStopScreenShare: () => __awaiter$
|
|
9956
|
+
onStopScreenShare: () => __awaiter$7(void 0, void 0, void 0, function* () {
|
|
9926
9957
|
yield adapter.stopScreenShare();
|
|
9927
9958
|
}),
|
|
9928
|
-
onToggleCamera: (options) => __awaiter$
|
|
9959
|
+
onToggleCamera: (options) => __awaiter$7(void 0, void 0, void 0, function* () {
|
|
9929
9960
|
isCameraOn(adapter.getState()) ? yield adapter.stopCamera() : yield adapter.startCamera(options);
|
|
9930
9961
|
}),
|
|
9931
|
-
onToggleMicrophone: () => __awaiter$
|
|
9962
|
+
onToggleMicrophone: () => __awaiter$7(void 0, void 0, void 0, function* () {
|
|
9932
9963
|
var _a;
|
|
9933
9964
|
return ((_a = adapter.getState().call) === null || _a === void 0 ? void 0 : _a.isMuted) ? yield adapter.unmute() : yield adapter.mute();
|
|
9934
9965
|
}),
|
|
9935
|
-
onToggleScreenShare: () => __awaiter$
|
|
9966
|
+
onToggleScreenShare: () => __awaiter$7(void 0, void 0, void 0, function* () {
|
|
9936
9967
|
var _b;
|
|
9937
9968
|
return ((_b = adapter.getState().call) === null || _b === void 0 ? void 0 : _b.isScreenSharingOn)
|
|
9938
9969
|
? yield adapter.stopScreenShare()
|
|
9939
9970
|
: yield adapter.startScreenShare();
|
|
9940
9971
|
}),
|
|
9941
|
-
onStartLocalVideo: () => __awaiter$
|
|
9972
|
+
onStartLocalVideo: () => __awaiter$7(void 0, void 0, void 0, function* () {
|
|
9942
9973
|
if (adapter.getState().call) {
|
|
9943
9974
|
return adapter.startCamera();
|
|
9944
9975
|
}
|
|
9945
9976
|
}),
|
|
9946
|
-
onDisposeLocalStreamView: () => __awaiter$
|
|
9977
|
+
onDisposeLocalStreamView: () => __awaiter$7(void 0, void 0, void 0, function* () {
|
|
9947
9978
|
return adapter.disposeStreamView();
|
|
9948
9979
|
}),
|
|
9949
|
-
onDisposeRemoteStreamView: (userId) => __awaiter$
|
|
9980
|
+
onDisposeRemoteStreamView: (userId) => __awaiter$7(void 0, void 0, void 0, function* () {
|
|
9950
9981
|
return adapter.disposeStreamView(userId);
|
|
9951
9982
|
})
|
|
9952
9983
|
}));
|
|
@@ -10016,6 +10047,7 @@ const getIsRecordingActive = (state) => { var _a; return !!((_a = state.call) ==
|
|
|
10016
10047
|
const getUserFacingDiagnostics = (state) => { var _a; return (_a = state.call) === null || _a === void 0 ? void 0 : _a.diagnostics; };
|
|
10017
10048
|
|
|
10018
10049
|
// Copyright (c) Microsoft Corporation.
|
|
10050
|
+
// Licensed under the MIT license.
|
|
10019
10051
|
const MINIMUM_TOUCH_TARGET_HEIGHT_REM = 3;
|
|
10020
10052
|
/** @private */
|
|
10021
10053
|
const controlBarContainerStyles = {
|
|
@@ -10053,17 +10085,6 @@ const groupCallLeaveButtonCompressedStyle = {
|
|
|
10053
10085
|
flexFlow: 'row'
|
|
10054
10086
|
}
|
|
10055
10087
|
};
|
|
10056
|
-
/**
|
|
10057
|
-
* @private
|
|
10058
|
-
*/
|
|
10059
|
-
const checkedButtonOverrideStyles = (theme, isChecked) => ({
|
|
10060
|
-
rootChecked: {
|
|
10061
|
-
background: theme.palette.themePrimary,
|
|
10062
|
-
color: react.DefaultPalette.white,
|
|
10063
|
-
':focus::after': { outlineColor: `${react.DefaultPalette.white} !important` } // added !important to avoid override by FluentUI button styles
|
|
10064
|
-
},
|
|
10065
|
-
label: isChecked ? { color: react.DefaultPalette.white } : {}
|
|
10066
|
-
});
|
|
10067
10088
|
/**
|
|
10068
10089
|
* Styles that can be applied to ensure flyout items have the minimum touch target size.
|
|
10069
10090
|
*
|
|
@@ -10152,14 +10173,12 @@ const CallControls = (props) => {
|
|
|
10152
10173
|
const participantsButtonProps = usePropsFor$1(ParticipantsButton);
|
|
10153
10174
|
const devicesButtonProps = usePropsFor$1(DevicesButton);
|
|
10154
10175
|
const hangUpButtonProps = usePropsFor$1(EndCallButton);
|
|
10155
|
-
const theme = useTheme();
|
|
10156
|
-
const screenShareButtonStyles = React.useMemo(() => mergeButtonBaseStyles(checkedButtonOverrideStyles(theme, screenShareButtonProps.checked)), [screenShareButtonProps.checked, theme.palette.themePrimary]);
|
|
10157
10176
|
const participantsButtonStyles = React.useMemo(() => mergeButtonBaseStyles(props.increaseFlyoutItemSize ? participantButtonWithIncreasedTouchTargets : {}), [props.increaseFlyoutItemSize]);
|
|
10158
10177
|
const devicesButtonStyles = React.useMemo(() => mergeButtonBaseStyles(props.increaseFlyoutItemSize ? devicesButtonWithIncreasedTouchTargets : {}), [props.increaseFlyoutItemSize]);
|
|
10159
10178
|
const compactMode = (options === null || options === void 0 ? void 0 : options.displayType) === 'compact';
|
|
10160
10179
|
const microphoneButton = (options === null || options === void 0 ? void 0 : options.microphoneButton) !== false && (React__default['default'].createElement(MicrophoneButton, Object.assign({ "data-ui-id": "call-composite-microphone-button" }, microphoneButtonProps, { showLabel: !compactMode, styles: controlButtonBaseStyle }, microphoneButtonStrings)));
|
|
10161
10180
|
const cameraButton = (options === null || options === void 0 ? void 0 : options.cameraButton) !== false && (React__default['default'].createElement(CameraButton, Object.assign({ "data-ui-id": "call-composite-camera-button" }, cameraButtonProps, { showLabel: !compactMode, styles: controlButtonBaseStyle })));
|
|
10162
|
-
const screenShareButton = (options === null || options === void 0 ? void 0 : options.screenShareButton) !== false && (React__default['default'].createElement(ScreenShareButton, Object.assign({ "data-ui-id": "call-composite-screenshare-button" }, screenShareButtonProps, {
|
|
10181
|
+
const screenShareButton = (options === null || options === void 0 ? void 0 : options.screenShareButton) !== false && (React__default['default'].createElement(ScreenShareButton, Object.assign({ "data-ui-id": "call-composite-screenshare-button" }, screenShareButtonProps, { showLabel: !compactMode, disabled: (options === null || options === void 0 ? void 0 : options.screenShareButton) !== true && ((_a = options === null || options === void 0 ? void 0 : options.screenShareButton) === null || _a === void 0 ? void 0 : _a.disabled) })));
|
|
10163
10182
|
const participantButton = (options === null || options === void 0 ? void 0 : options.participantsButton) !== false && (React__default['default'].createElement(ParticipantsButton, Object.assign({ "data-ui-id": "call-composite-participants-button" }, participantsButtonProps, { showLabel: !compactMode, callInvitationURL: callInvitationURL, onFetchParticipantMenuItems: onFetchParticipantMenuItems, disabled: (options === null || options === void 0 ? void 0 : options.participantsButton) !== true && ((_b = options === null || options === void 0 ? void 0 : options.participantsButton) === null || _b === void 0 ? void 0 : _b.disabled), styles: participantsButtonStyles })));
|
|
10164
10183
|
const devicesButton = (options === null || options === void 0 ? void 0 : options.devicesButton) !== false && (React__default['default'].createElement(DevicesButton
|
|
10165
10184
|
/* By setting `persistMenu?` to true, we prevent options menu from getting hidden every time a participant joins or leaves. */
|
|
@@ -10467,11 +10486,11 @@ const VideoGalleryStyles = {
|
|
|
10467
10486
|
minWidth: '6rem'
|
|
10468
10487
|
}
|
|
10469
10488
|
};
|
|
10470
|
-
const
|
|
10489
|
+
const localVideoViewOptions$2 = {
|
|
10471
10490
|
scalingMode: 'Crop',
|
|
10472
10491
|
isMirrored: true
|
|
10473
10492
|
};
|
|
10474
|
-
const
|
|
10493
|
+
const remoteVideoViewOptions = {
|
|
10475
10494
|
scalingMode: 'Crop'
|
|
10476
10495
|
};
|
|
10477
10496
|
/**
|
|
@@ -10481,7 +10500,7 @@ const MediaGallery = (props) => {
|
|
|
10481
10500
|
const videoGalleryProps = usePropsFor$1(VideoGallery);
|
|
10482
10501
|
useLocalVideoStartTrigger(!!props.isVideoStreamOn);
|
|
10483
10502
|
const VideoGalleryMemoized = React.useMemo(() => {
|
|
10484
|
-
return (React__default['default'].createElement(VideoGallery, Object.assign({}, videoGalleryProps, {
|
|
10503
|
+
return (React__default['default'].createElement(VideoGallery, Object.assign({}, videoGalleryProps, { localVideoViewOptions: localVideoViewOptions$2, remoteVideoViewOptions: remoteVideoViewOptions, styles: VideoGalleryStyles, layout: "floatingLocalVideo", onRenderAvatar: (userId, options) => (React__default['default'].createElement(react.Stack, { className: react.mergeStyles({ position: 'absolute', height: '100%', width: '100%' }) },
|
|
10485
10504
|
React__default['default'].createElement(AvatarPersona, Object.assign({ userId: userId }, options, { dataProvider: props.onFetchAvatarPersonaData })))) })));
|
|
10486
10505
|
}, [props.onFetchAvatarPersonaData, videoGalleryProps]);
|
|
10487
10506
|
return VideoGalleryMemoized;
|
|
@@ -10559,7 +10578,7 @@ const videoTileStyles = {
|
|
|
10559
10578
|
|
|
10560
10579
|
// Copyright (c) Microsoft Corporation.
|
|
10561
10580
|
const onRenderEmptyPlaceholder = () => React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
10562
|
-
const
|
|
10581
|
+
const localVideoViewOptions$1 = {
|
|
10563
10582
|
scalingMode: 'Crop',
|
|
10564
10583
|
isMirrored: true
|
|
10565
10584
|
};
|
|
@@ -10575,7 +10594,7 @@ const ExpandedLocalVideoTile = (props) => {
|
|
|
10575
10594
|
React.useEffect(() => {
|
|
10576
10595
|
if (videoStream && isVideoReady) {
|
|
10577
10596
|
props.onCreateLocalStreamView &&
|
|
10578
|
-
props.onCreateLocalStreamView(
|
|
10597
|
+
props.onCreateLocalStreamView(localVideoViewOptions$1).catch((err) => console.log('Can not render video', err));
|
|
10579
10598
|
}
|
|
10580
10599
|
}, [isVideoReady, videoStream, props, renderElement]);
|
|
10581
10600
|
return (React__default['default'].createElement(react.Stack, { horizontalAlign: "center", verticalAlign: "center", styles: containerStyles, grow: true },
|
|
@@ -10847,7 +10866,7 @@ const onRenderTitle = (iconType, props) => {
|
|
|
10847
10866
|
icon,
|
|
10848
10867
|
React__default['default'].createElement("span", null, props[0].text))) : (React__default['default'].createElement(React__default['default'].Fragment, null));
|
|
10849
10868
|
};
|
|
10850
|
-
const
|
|
10869
|
+
const localVideoViewOptions = {
|
|
10851
10870
|
scalingMode: 'Crop',
|
|
10852
10871
|
isMirrored: true
|
|
10853
10872
|
};
|
|
@@ -10874,22 +10893,25 @@ const LocalDeviceSettings = (props) => {
|
|
|
10874
10893
|
? (_a = props.cameras[0]) === null || _a === void 0 ? void 0 : _a.id
|
|
10875
10894
|
: ''
|
|
10876
10895
|
: 'deniedOrUnknown', onChange: (event, option, index) => {
|
|
10877
|
-
props.onSelectCamera(props.cameras[index !== null && index !== void 0 ? index : 0],
|
|
10896
|
+
props.onSelectCamera(props.cameras[index !== null && index !== void 0 ? index : 0], localVideoViewOptions);
|
|
10878
10897
|
}, onRenderTitle: (props) => onRenderTitle('Camera', props) }),
|
|
10879
|
-
React__default['default'].createElement(react.
|
|
10880
|
-
|
|
10881
|
-
|
|
10882
|
-
|
|
10883
|
-
|
|
10884
|
-
|
|
10885
|
-
|
|
10886
|
-
|
|
10887
|
-
|
|
10888
|
-
|
|
10889
|
-
|
|
10890
|
-
|
|
10891
|
-
|
|
10892
|
-
|
|
10898
|
+
React__default['default'].createElement(react.Stack, null,
|
|
10899
|
+
React__default['default'].createElement(react.Label, { id: 'call-composite-local-sound-settings-label', className: react.mergeStyles(dropDownStyles(theme).label), disabled: !props.microphonePermissionGranted }, soundLabel),
|
|
10900
|
+
React__default['default'].createElement(react.Stack, { "data-ui-id": "call-composite-sound-settings", tokens: mainStackTokens },
|
|
10901
|
+
React__default['default'].createElement(react.Dropdown, { "aria-labelledby": 'call-composite-local-sound-settings-label', placeholder: defaultPlaceHolder, styles: dropDownStyles(theme), disabled: !props.microphonePermissionGranted, errorMessage: props.microphonePermissionGranted === undefined || props.microphonePermissionGranted
|
|
10902
|
+
? undefined
|
|
10903
|
+
: locale.strings.call.microphonePermissionDenied, options: props.microphonePermissionGranted
|
|
10904
|
+
? getDropDownList(props.microphones)
|
|
10905
|
+
: [{ key: 'deniedOrUnknown', text: '' }], defaultSelectedKey: props.microphonePermissionGranted
|
|
10906
|
+
? props.selectedMicrophone
|
|
10907
|
+
? props.selectedMicrophone.id
|
|
10908
|
+
: defaultDeviceId(props.microphones)
|
|
10909
|
+
: 'deniedOrUnknown', onChange: (event, option, index) => {
|
|
10910
|
+
props.onSelectMicrophone(props.microphones[index !== null && index !== void 0 ? index : 0]);
|
|
10911
|
+
}, onRenderTitle: (props) => onRenderTitle('Microphone', props) }),
|
|
10912
|
+
React__default['default'].createElement(react.Dropdown, { "aria-labelledby": 'call-composite-local-sound-settings-label', placeholder: defaultPlaceHolder, styles: dropDownStyles(theme), disabled: props.speakers.length === 0, options: getDropDownList(props.speakers), defaultSelectedKey: props.selectedSpeaker ? props.selectedSpeaker.id : defaultDeviceId(props.speakers), onChange: (event, option, index) => {
|
|
10913
|
+
props.onSelectSpeaker(props.speakers[index !== null && index !== void 0 ? index : 0]);
|
|
10914
|
+
}, onRenderTitle: (props) => onRenderTitle('Speaker', props) })))));
|
|
10893
10915
|
};
|
|
10894
10916
|
const defaultDeviceId = (devices) => {
|
|
10895
10917
|
if (devices.length === 0) {
|
|
@@ -10992,7 +11014,7 @@ const localPreviewTileStyle = {
|
|
|
10992
11014
|
|
|
10993
11015
|
// Copyright (c) Microsoft Corporation.
|
|
10994
11016
|
// Licensed under the MIT license.
|
|
10995
|
-
var __awaiter$
|
|
11017
|
+
var __awaiter$6 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
10996
11018
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10997
11019
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10998
11020
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -11012,7 +11034,7 @@ const LocalPreview = (props) => {
|
|
|
11012
11034
|
const { audio: microphonePermissionGranted, video: cameraPermissionGranted } = useSelector$1(devicePermissionSelector);
|
|
11013
11035
|
const isLocalMicrophoneEnabled = useSelector$1(getLocalMicrophoneEnabled);
|
|
11014
11036
|
const adapter = useAdapter();
|
|
11015
|
-
const onToggleMic = React.useCallback(() => __awaiter$
|
|
11037
|
+
const onToggleMic = React.useCallback(() => __awaiter$6(void 0, void 0, void 0, function* () {
|
|
11016
11038
|
isLocalMicrophoneEnabled ? adapter.mute() : adapter.unmute();
|
|
11017
11039
|
}), [adapter, isLocalMicrophoneEnabled]);
|
|
11018
11040
|
const theme = useTheme();
|
|
@@ -11336,7 +11358,7 @@ const mainScreenContainerStyleMobile = react.mergeStyles(Object.assign(Object.as
|
|
|
11336
11358
|
|
|
11337
11359
|
// Copyright (c) Microsoft Corporation.
|
|
11338
11360
|
// Licensed under the MIT license.
|
|
11339
|
-
var __awaiter$
|
|
11361
|
+
var __awaiter$5 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
11340
11362
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
11341
11363
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11342
11364
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -11383,7 +11405,7 @@ const MainScreen = (props) => {
|
|
|
11383
11405
|
const CallComposite = (props) => {
|
|
11384
11406
|
const { adapter, callInvitationUrl, onFetchAvatarPersonaData, onFetchParticipantMenuItems, options, formFactor = 'desktop' } = props;
|
|
11385
11407
|
React.useEffect(() => {
|
|
11386
|
-
(() => __awaiter$
|
|
11408
|
+
(() => __awaiter$5(void 0, void 0, void 0, function* () {
|
|
11387
11409
|
yield adapter.askDevicePermission({ video: true, audio: true });
|
|
11388
11410
|
adapter.queryCameras();
|
|
11389
11411
|
adapter.queryMicrophones();
|
|
@@ -11474,7 +11496,7 @@ class DiagnosticsForwarder {
|
|
|
11474
11496
|
|
|
11475
11497
|
// Copyright (c) Microsoft Corporation.
|
|
11476
11498
|
// Licensed under the MIT license.
|
|
11477
|
-
var __awaiter = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
11499
|
+
var __awaiter$4 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
11478
11500
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
11479
11501
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11480
11502
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -11612,29 +11634,29 @@ class AzureCommunicationCallAdapter {
|
|
|
11612
11634
|
this.callAgent.dispose();
|
|
11613
11635
|
}
|
|
11614
11636
|
queryCameras() {
|
|
11615
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11616
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
|
|
11637
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
11638
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
|
|
11617
11639
|
return this.deviceManager.getCameras();
|
|
11618
11640
|
}));
|
|
11619
11641
|
});
|
|
11620
11642
|
}
|
|
11621
11643
|
queryMicrophones() {
|
|
11622
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11623
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
|
|
11644
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
11645
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
|
|
11624
11646
|
return this.deviceManager.getMicrophones();
|
|
11625
11647
|
}));
|
|
11626
11648
|
});
|
|
11627
11649
|
}
|
|
11628
11650
|
querySpeakers() {
|
|
11629
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11630
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
|
|
11651
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
11652
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
|
|
11631
11653
|
return this.deviceManager.isSpeakerSelectionAvailable ? this.deviceManager.getSpeakers() : [];
|
|
11632
11654
|
}));
|
|
11633
11655
|
});
|
|
11634
11656
|
}
|
|
11635
11657
|
askDevicePermission(constrain) {
|
|
11636
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11637
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
|
|
11658
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
11659
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
|
|
11638
11660
|
yield this.deviceManager.askDevicePermission(constrain);
|
|
11639
11661
|
}));
|
|
11640
11662
|
});
|
|
@@ -11670,7 +11692,7 @@ class AzureCommunicationCallAdapter {
|
|
|
11670
11692
|
}
|
|
11671
11693
|
}
|
|
11672
11694
|
createStreamView(remoteUserId, options) {
|
|
11673
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11695
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
11674
11696
|
if (remoteUserId === undefined) {
|
|
11675
11697
|
yield this.handlers.onCreateLocalStreamView(options);
|
|
11676
11698
|
}
|
|
@@ -11680,7 +11702,7 @@ class AzureCommunicationCallAdapter {
|
|
|
11680
11702
|
});
|
|
11681
11703
|
}
|
|
11682
11704
|
disposeStreamView(remoteUserId) {
|
|
11683
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11705
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
11684
11706
|
if (remoteUserId === undefined) {
|
|
11685
11707
|
yield this.handlers.onDisposeLocalStreamView();
|
|
11686
11708
|
}
|
|
@@ -11691,7 +11713,7 @@ class AzureCommunicationCallAdapter {
|
|
|
11691
11713
|
}
|
|
11692
11714
|
leaveCall() {
|
|
11693
11715
|
var _a;
|
|
11694
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11716
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
11695
11717
|
const callId = (_a = this.call) === null || _a === void 0 ? void 0 : _a.id;
|
|
11696
11718
|
yield this.handlers.onHangUp();
|
|
11697
11719
|
this.unsubscribeCallEvents();
|
|
@@ -11706,29 +11728,29 @@ class AzureCommunicationCallAdapter {
|
|
|
11706
11728
|
});
|
|
11707
11729
|
}
|
|
11708
11730
|
setCamera(device, options) {
|
|
11709
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11710
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
|
|
11731
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
11732
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
|
|
11711
11733
|
yield this.handlers.onSelectCamera(device, options);
|
|
11712
11734
|
}));
|
|
11713
11735
|
});
|
|
11714
11736
|
}
|
|
11715
11737
|
setMicrophone(device) {
|
|
11716
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11717
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
|
|
11738
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
11739
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
|
|
11718
11740
|
yield this.handlers.onSelectMicrophone(device);
|
|
11719
11741
|
}));
|
|
11720
11742
|
});
|
|
11721
11743
|
}
|
|
11722
11744
|
setSpeaker(device) {
|
|
11723
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11724
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
|
|
11745
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
11746
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
|
|
11725
11747
|
yield this.handlers.onSelectSpeaker(device);
|
|
11726
11748
|
}));
|
|
11727
11749
|
});
|
|
11728
11750
|
}
|
|
11729
11751
|
startCamera(options) {
|
|
11730
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11731
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
|
|
11752
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
11753
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
|
|
11732
11754
|
if (!isCameraOn(this.getState())) {
|
|
11733
11755
|
yield this.handlers.onToggleCamera(options);
|
|
11734
11756
|
}
|
|
@@ -11736,8 +11758,8 @@ class AzureCommunicationCallAdapter {
|
|
|
11736
11758
|
});
|
|
11737
11759
|
}
|
|
11738
11760
|
stopCamera() {
|
|
11739
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11740
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
|
|
11761
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
11762
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
|
|
11741
11763
|
if (isCameraOn(this.getState())) {
|
|
11742
11764
|
yield this.handlers.onToggleCamera();
|
|
11743
11765
|
}
|
|
@@ -11745,8 +11767,8 @@ class AzureCommunicationCallAdapter {
|
|
|
11745
11767
|
});
|
|
11746
11768
|
}
|
|
11747
11769
|
mute() {
|
|
11748
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11749
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
|
|
11770
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
11771
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
|
|
11750
11772
|
var _a, _b;
|
|
11751
11773
|
this.context.setIsLocalMicrophoneEnabled(false);
|
|
11752
11774
|
if (_isInCall((_a = this.call) === null || _a === void 0 ? void 0 : _a.state) && !((_b = this.call) === null || _b === void 0 ? void 0 : _b.isMuted)) {
|
|
@@ -11756,8 +11778,8 @@ class AzureCommunicationCallAdapter {
|
|
|
11756
11778
|
});
|
|
11757
11779
|
}
|
|
11758
11780
|
unmute() {
|
|
11759
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11760
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
|
|
11781
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
11782
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
|
|
11761
11783
|
var _a, _b;
|
|
11762
11784
|
this.context.setIsLocalMicrophoneEnabled(true);
|
|
11763
11785
|
if (_isInCall((_a = this.call) === null || _a === void 0 ? void 0 : _a.state) && ((_b = this.call) === null || _b === void 0 ? void 0 : _b.isMuted)) {
|
|
@@ -11767,8 +11789,8 @@ class AzureCommunicationCallAdapter {
|
|
|
11767
11789
|
});
|
|
11768
11790
|
}
|
|
11769
11791
|
startScreenShare() {
|
|
11770
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11771
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
|
|
11792
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
11793
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
|
|
11772
11794
|
var _a;
|
|
11773
11795
|
if (!((_a = this.call) === null || _a === void 0 ? void 0 : _a.isScreenSharingOn)) {
|
|
11774
11796
|
yield this.handlers.onToggleScreenShare();
|
|
@@ -11777,8 +11799,8 @@ class AzureCommunicationCallAdapter {
|
|
|
11777
11799
|
});
|
|
11778
11800
|
}
|
|
11779
11801
|
stopScreenShare() {
|
|
11780
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11781
|
-
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
|
|
11802
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
11803
|
+
return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
|
|
11782
11804
|
var _a;
|
|
11783
11805
|
if ((_a = this.call) === null || _a === void 0 ? void 0 : _a.isScreenSharingOn) {
|
|
11784
11806
|
yield this.handlers.onToggleScreenShare();
|
|
@@ -11797,7 +11819,7 @@ class AzureCommunicationCallAdapter {
|
|
|
11797
11819
|
return this.handlers.onStartCall(idsToAdd);
|
|
11798
11820
|
}
|
|
11799
11821
|
removeParticipant(userId) {
|
|
11800
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11822
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
11801
11823
|
this.handlers.onRemoveParticipant(userId);
|
|
11802
11824
|
});
|
|
11803
11825
|
}
|
|
@@ -11872,7 +11894,7 @@ class AzureCommunicationCallAdapter {
|
|
|
11872
11894
|
this.emitter.off(event, listener);
|
|
11873
11895
|
}
|
|
11874
11896
|
asyncTeeErrorToEventEmitter(f) {
|
|
11875
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11897
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
11876
11898
|
try {
|
|
11877
11899
|
return yield f();
|
|
11878
11900
|
}
|
|
@@ -11892,7 +11914,7 @@ class AzureCommunicationCallAdapter {
|
|
|
11892
11914
|
*
|
|
11893
11915
|
* @public
|
|
11894
11916
|
*/
|
|
11895
|
-
const createAzureCommunicationCallAdapter = ({ userId, displayName, credential, locator }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
11917
|
+
const createAzureCommunicationCallAdapter = ({ userId, displayName, credential, locator }) => __awaiter$4(void 0, void 0, void 0, function* () {
|
|
11896
11918
|
const callClient = createStatefulCallClient({ userId });
|
|
11897
11919
|
const callAgent = yield callClient.createCallAgent(credential, { displayName });
|
|
11898
11920
|
const adapter = createAzureCommunicationCallAdapterFromClient(callClient, callAgent, locator);
|
|
@@ -11906,7 +11928,7 @@ const createAzureCommunicationCallAdapter = ({ userId, displayName, credential,
|
|
|
11906
11928
|
*
|
|
11907
11929
|
* @public
|
|
11908
11930
|
*/
|
|
11909
|
-
const createAzureCommunicationCallAdapterFromClient = (callClient, callAgent, locator) => __awaiter(void 0, void 0, void 0, function* () {
|
|
11931
|
+
const createAzureCommunicationCallAdapterFromClient = (callClient, callAgent, locator) => __awaiter$4(void 0, void 0, void 0, function* () {
|
|
11910
11932
|
const deviceManager = (yield callClient.getDeviceManager());
|
|
11911
11933
|
return new AzureCommunicationCallAdapter(callClient, locator, callAgent, deviceManager);
|
|
11912
11934
|
});
|
|
@@ -11914,6 +11936,1018 @@ const isCallError = (e) => {
|
|
|
11914
11936
|
return e['target'] !== undefined && e['innerError'] !== undefined;
|
|
11915
11937
|
};
|
|
11916
11938
|
|
|
11939
|
+
// Copyright (c) Microsoft Corporation.
|
|
11940
|
+
// Licensed under the MIT license.
|
|
11941
|
+
/**
|
|
11942
|
+
* @private
|
|
11943
|
+
*/
|
|
11944
|
+
const sidePaneContainerStyles = {
|
|
11945
|
+
root: {
|
|
11946
|
+
height: '100%',
|
|
11947
|
+
paddingTop: '0.5rem',
|
|
11948
|
+
paddingBottom: '0.5rem',
|
|
11949
|
+
width: '21.5rem'
|
|
11950
|
+
}
|
|
11951
|
+
};
|
|
11952
|
+
/**
|
|
11953
|
+
* @private
|
|
11954
|
+
*/
|
|
11955
|
+
const sidePaneContainerHiddenStyles = {
|
|
11956
|
+
root: Object.assign(Object.assign({}, sidePaneContainerStyles), { display: 'none' })
|
|
11957
|
+
};
|
|
11958
|
+
/**
|
|
11959
|
+
* @private
|
|
11960
|
+
*/
|
|
11961
|
+
const sidePaneContainerTokens = {
|
|
11962
|
+
childrenGap: '0.5rem'
|
|
11963
|
+
};
|
|
11964
|
+
/**
|
|
11965
|
+
* @private
|
|
11966
|
+
*/
|
|
11967
|
+
const sidePaneHeaderStyles = {
|
|
11968
|
+
root: {
|
|
11969
|
+
fontSize: '0.825rem',
|
|
11970
|
+
lineHeight: '1.25rem',
|
|
11971
|
+
padding: '0.25rem',
|
|
11972
|
+
fontWeight: '600'
|
|
11973
|
+
}
|
|
11974
|
+
};
|
|
11975
|
+
/**
|
|
11976
|
+
* @private
|
|
11977
|
+
*/
|
|
11978
|
+
const paneBodyContainer = { root: { flexDirection: 'column', display: 'flex' } };
|
|
11979
|
+
/**
|
|
11980
|
+
* @private
|
|
11981
|
+
*/
|
|
11982
|
+
const scrollableContainer = { root: { flexBasis: '0', flexGrow: '1', overflowY: 'auto' } };
|
|
11983
|
+
/**
|
|
11984
|
+
* @private
|
|
11985
|
+
*/
|
|
11986
|
+
const scrollableContainerContents = { root: { flexGrow: '1', flexBasis: '0' } };
|
|
11987
|
+
/**
|
|
11988
|
+
* @private
|
|
11989
|
+
*/
|
|
11990
|
+
const peopleSubheadingStyle = {
|
|
11991
|
+
root: {
|
|
11992
|
+
fontSize: '0.75rem'
|
|
11993
|
+
}
|
|
11994
|
+
};
|
|
11995
|
+
/**
|
|
11996
|
+
* @private
|
|
11997
|
+
*/
|
|
11998
|
+
const peoplePaneContainerTokens = {
|
|
11999
|
+
childrenGap: '0.5rem'
|
|
12000
|
+
};
|
|
12001
|
+
|
|
12002
|
+
var __awaiter$3 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12003
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
12004
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
12005
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12006
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12007
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
12008
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12009
|
+
});
|
|
12010
|
+
};
|
|
12011
|
+
const SidePane = (props) => {
|
|
12012
|
+
// We hide the side pane instead of not rendering the entire pane to persist certain elements
|
|
12013
|
+
// between renders. An example of this is composing a chat message - a chat message that has been
|
|
12014
|
+
// typed but not sent should not be lost if the side panel is closed and then reopened.
|
|
12015
|
+
const sidePaneStyles = props.hidden ? sidePaneContainerHiddenStyles : sidePaneContainerStyles;
|
|
12016
|
+
const theme = useTheme();
|
|
12017
|
+
const sidePaneCloseButtonStyles = {
|
|
12018
|
+
icon: { color: theme.palette.neutralSecondary },
|
|
12019
|
+
iconHovered: { color: theme.palette.neutralSecondary },
|
|
12020
|
+
iconPressed: { color: theme.palette.neutralSecondary }
|
|
12021
|
+
};
|
|
12022
|
+
return (React__default['default'].createElement(react.Stack.Item, { disableShrink: true, verticalFill: true, styles: sidePaneStyles, tokens: sidePaneContainerTokens },
|
|
12023
|
+
React__default['default'].createElement(react.Stack, { verticalFill: true, "data-ui-id": props.dataUiId },
|
|
12024
|
+
React__default['default'].createElement(react.Stack, { horizontal: true, horizontalAlign: "space-between", styles: sidePaneHeaderStyles },
|
|
12025
|
+
React__default['default'].createElement(react.Stack.Item, null, props.headingText),
|
|
12026
|
+
React__default['default'].createElement(react.CommandBarButton, { styles: sidePaneCloseButtonStyles, iconProps: { iconName: 'cancel' }, onClick: props.onClose })),
|
|
12027
|
+
React__default['default'].createElement(react.Stack.Item, { verticalFill: true, grow: true, styles: paneBodyContainer },
|
|
12028
|
+
React__default['default'].createElement(react.Stack, { horizontal: true, styles: scrollableContainer },
|
|
12029
|
+
React__default['default'].createElement(react.Stack.Item, { verticalFill: true, styles: scrollableContainerContents }, props.children))))));
|
|
12030
|
+
};
|
|
12031
|
+
/**
|
|
12032
|
+
* In a Meeting when a participant is removed, we must remove them from both
|
|
12033
|
+
* the call and the chat thread.
|
|
12034
|
+
*/
|
|
12035
|
+
const removeParticipantFromMeeting = (callAdapter, chatAdapter, participantId) => __awaiter$3(void 0, void 0, void 0, function* () {
|
|
12036
|
+
yield callAdapter.removeParticipant(participantId);
|
|
12037
|
+
yield chatAdapter.removeParticipant(participantId);
|
|
12038
|
+
});
|
|
12039
|
+
/**
|
|
12040
|
+
* @private
|
|
12041
|
+
*/
|
|
12042
|
+
const EmbeddedPeoplePane = (props) => {
|
|
12043
|
+
const { callAdapter, chatAdapter, inviteLink } = props;
|
|
12044
|
+
const participantListDefaultProps = usePropsFor$1(ParticipantList);
|
|
12045
|
+
const participantListProps = React.useMemo(() => {
|
|
12046
|
+
const onRemoveParticipant = (participantId) => __awaiter$3(void 0, void 0, void 0, function* () { return removeParticipantFromMeeting(callAdapter, chatAdapter, participantId); });
|
|
12047
|
+
return Object.assign(Object.assign({}, participantListDefaultProps), { onRemoveParticipant });
|
|
12048
|
+
}, [participantListDefaultProps, callAdapter, chatAdapter]);
|
|
12049
|
+
const theme = useTheme();
|
|
12050
|
+
const peopleSubheadingStyleThemed = react.concatStyleSets(peopleSubheadingStyle, {
|
|
12051
|
+
root: {
|
|
12052
|
+
color: theme.palette.neutralSecondary
|
|
12053
|
+
}
|
|
12054
|
+
});
|
|
12055
|
+
return (React__default['default'].createElement(SidePane, { hidden: props.hidden, headingText: 'People', onClose: props.onClose, dataUiId: 'meeting-composite-people-pane' },
|
|
12056
|
+
React__default['default'].createElement(react.Stack, { tokens: peoplePaneContainerTokens },
|
|
12057
|
+
inviteLink && (React__default['default'].createElement(react.DefaultButton, { text: "Copy invite link", iconProps: { iconName: 'Link' }, onClick: () => copy__default['default'](inviteLink) })),
|
|
12058
|
+
React__default['default'].createElement(react.Stack.Item, { styles: peopleSubheadingStyleThemed }, "In this call"),
|
|
12059
|
+
React__default['default'].createElement(ParticipantList, Object.assign({}, participantListProps)))));
|
|
12060
|
+
};
|
|
12061
|
+
/**
|
|
12062
|
+
* @private
|
|
12063
|
+
*/
|
|
12064
|
+
const EmbeddedChatPane = (props) => {
|
|
12065
|
+
return (React__default['default'].createElement(SidePane, { hidden: props.hidden, headingText: 'Chat', onClose: props.onClose, dataUiId: 'meeting-composite-chat-pane' },
|
|
12066
|
+
React__default['default'].createElement(ChatComposite, Object.assign({}, props.chatCompositeProps, { adapter: props.chatAdapter, fluentTheme: props.fluentTheme, options: { participantPane: false, topic: false } }))));
|
|
12067
|
+
};
|
|
12068
|
+
|
|
12069
|
+
// Copyright (c) Microsoft Corporation.
|
|
12070
|
+
const onRenderOnIcon$1 = () => React__default['default'].createElement(reactIcons.Chat20Filled, { key: 'chatOnIconKey', primaryFill: "currentColor" });
|
|
12071
|
+
const onRenderOffIcon$1 = () => React__default['default'].createElement(reactIcons.Chat20Regular, { key: 'chatOffIconKey', primaryFill: "currentColor" });
|
|
12072
|
+
/**
|
|
12073
|
+
* @private
|
|
12074
|
+
*/
|
|
12075
|
+
const ChatButton = (props) => {
|
|
12076
|
+
var _a, _b;
|
|
12077
|
+
const strings = Object.assign({ label: 'Chat' }, props.strings);
|
|
12078
|
+
return (React__default['default'].createElement(ControlBarButton, Object.assign({}, props, { labelKey: 'chatButtonLabelKey', strings: strings, onRenderOnIcon: (_a = props.onRenderOnIcon) !== null && _a !== void 0 ? _a : onRenderOnIcon$1, onRenderOffIcon: (_b = props.onRenderOffIcon) !== null && _b !== void 0 ? _b : onRenderOffIcon$1, onClick: props.onClick })));
|
|
12079
|
+
};
|
|
12080
|
+
|
|
12081
|
+
// Copyright (c) Microsoft Corporation.
|
|
12082
|
+
const onRenderOnIcon = () => React__default['default'].createElement(reactIcons.People20Filled, { key: 'peopleOnIconKey', primaryFill: "currentColor" });
|
|
12083
|
+
const onRenderOffIcon = () => React__default['default'].createElement(reactIcons.People20Regular, { key: 'peopleOffIconKey', primaryFill: "currentColor" });
|
|
12084
|
+
/**
|
|
12085
|
+
* @private
|
|
12086
|
+
*/
|
|
12087
|
+
const PeopleButton = (props) => {
|
|
12088
|
+
var _a, _b;
|
|
12089
|
+
const strings = Object.assign({ label: 'People' }, props.strings);
|
|
12090
|
+
return (React__default['default'].createElement(ControlBarButton, Object.assign({}, props, { strings: strings, labelKey: 'peopleButtonLabelKey', onRenderOnIcon: (_a = props.onRenderOnIcon) !== null && _a !== void 0 ? _a : onRenderOnIcon, onRenderOffIcon: (_b = props.onRenderOffIcon) !== null && _b !== void 0 ? _b : onRenderOffIcon, onClick: props.onClick })));
|
|
12091
|
+
};
|
|
12092
|
+
|
|
12093
|
+
// Copyright (c) Microsoft Corporation.
|
|
12094
|
+
/**
|
|
12095
|
+
* @private
|
|
12096
|
+
*/
|
|
12097
|
+
const MeetingCallControlBar = (props) => {
|
|
12098
|
+
// Disable the default participants button as meetings composite has its own participants button.
|
|
12099
|
+
let callControlsOptions = {
|
|
12100
|
+
participantsButton: false,
|
|
12101
|
+
screenShareButton: props.mobileView ? false : { disabled: props.disableButtonsForLobbyPage }
|
|
12102
|
+
};
|
|
12103
|
+
// Reduce the controls shown when mobile view is enabled.
|
|
12104
|
+
if (props.mobileView) {
|
|
12105
|
+
callControlsOptions = reduceCallControlsForMobile(callControlsOptions);
|
|
12106
|
+
}
|
|
12107
|
+
/**
|
|
12108
|
+
* Until mobile meetings is worked on, statically set the width of the
|
|
12109
|
+
* control bar such that all controls can be accessed.
|
|
12110
|
+
*/
|
|
12111
|
+
const temporaryMeetingControlBarStyles = props.mobileView ? { width: '23.5rem' } : undefined;
|
|
12112
|
+
return (React__default['default'].createElement(react.Stack, { horizontal: true, className: react.mergeStyles(temporaryMeetingControlBarStyles, callControlsContainerStyles, controlBarContainerStyles) },
|
|
12113
|
+
React__default['default'].createElement(react.Stack.Item, { grow: true },
|
|
12114
|
+
React__default['default'].createElement(CallAdapterProvider, { adapter: props.callAdapter },
|
|
12115
|
+
React__default['default'].createElement(CallControls, { options: callControlsOptions, increaseFlyoutItemSize: props.mobileView }))),
|
|
12116
|
+
React__default['default'].createElement(react.Stack.Item, null,
|
|
12117
|
+
React__default['default'].createElement(ChatButton, { checked: props.chatButtonChecked, showLabel: true, onClick: props.onChatButtonClicked, "data-ui-id": "meeting-composite-chat-button", disabled: props.disableButtonsForLobbyPage }),
|
|
12118
|
+
React__default['default'].createElement(PeopleButton, { checked: props.peopleButtonChecked, showLabel: true, onClick: props.onPeopleButtonClicked, "data-ui-id": "meeting-composite-people-button", disabled: props.disableButtonsForLobbyPage }))));
|
|
12119
|
+
};
|
|
12120
|
+
|
|
12121
|
+
// Copyright (c) Microsoft Corporation.
|
|
12122
|
+
// Licensed under the MIT license.
|
|
12123
|
+
/**
|
|
12124
|
+
* @private
|
|
12125
|
+
*/
|
|
12126
|
+
const compositeOuterContainerStyles = {
|
|
12127
|
+
root: {
|
|
12128
|
+
width: '100%',
|
|
12129
|
+
// This allows the composite to correctly contain the call composite by calculating a height for the available space.
|
|
12130
|
+
// Items inside the call composite that fill 100% of the height will now fill the height of this container instead
|
|
12131
|
+
// of the height of the child items.
|
|
12132
|
+
// If this css property is to be removed, test the participant pane correctly uses the scroll overflow when there a lot
|
|
12133
|
+
// of participants (i.e. beyond screen height) and where one participant is sharing their screen.
|
|
12134
|
+
flexWrap: 'wrap'
|
|
12135
|
+
}
|
|
12136
|
+
};
|
|
12137
|
+
|
|
12138
|
+
// Copyright (c) Microsoft Corporation.
|
|
12139
|
+
// Licensed under the MIT license.
|
|
12140
|
+
/**
|
|
12141
|
+
* @private
|
|
12142
|
+
*/
|
|
12143
|
+
function callPageToMeetingPage(page) {
|
|
12144
|
+
switch (page) {
|
|
12145
|
+
case 'call':
|
|
12146
|
+
return 'meeting';
|
|
12147
|
+
case 'leftCall':
|
|
12148
|
+
return 'leftMeeting';
|
|
12149
|
+
case 'removedFromCall':
|
|
12150
|
+
return 'removedFromMeeting';
|
|
12151
|
+
case 'joinCallFailedDueToNoNetwork':
|
|
12152
|
+
return 'joinMeetingFailedDueToNoNetwork';
|
|
12153
|
+
default:
|
|
12154
|
+
return page;
|
|
12155
|
+
}
|
|
12156
|
+
}
|
|
12157
|
+
/**
|
|
12158
|
+
* @private
|
|
12159
|
+
*/
|
|
12160
|
+
function meetingPageToCallPage(page) {
|
|
12161
|
+
switch (page) {
|
|
12162
|
+
case 'meeting':
|
|
12163
|
+
return 'call';
|
|
12164
|
+
case 'leftMeeting':
|
|
12165
|
+
return 'leftCall';
|
|
12166
|
+
case 'removedFromMeeting':
|
|
12167
|
+
return 'removedFromCall';
|
|
12168
|
+
case 'joinMeetingFailedDueToNoNetwork':
|
|
12169
|
+
return 'joinCallFailedDueToNoNetwork';
|
|
12170
|
+
default:
|
|
12171
|
+
return page;
|
|
12172
|
+
}
|
|
12173
|
+
}
|
|
12174
|
+
/**
|
|
12175
|
+
* @private
|
|
12176
|
+
*/
|
|
12177
|
+
const hasJoinedCall = (page, callStatus) => page === 'meeting' && callStatus === 'Connected';
|
|
12178
|
+
|
|
12179
|
+
// Copyright (c) Microsoft Corporation.
|
|
12180
|
+
// Licensed under the MIT license.
|
|
12181
|
+
/**
|
|
12182
|
+
* @private
|
|
12183
|
+
*/
|
|
12184
|
+
function meetingParticipantFromCallParticipant(callParticipant) {
|
|
12185
|
+
return {
|
|
12186
|
+
id: callParticipant.identifier,
|
|
12187
|
+
meetingEndReason: callParticipant.callEndReason,
|
|
12188
|
+
displayName: callParticipant.displayName,
|
|
12189
|
+
state: callParticipant.state,
|
|
12190
|
+
videoStreams: callParticipant.videoStreams,
|
|
12191
|
+
isMuted: callParticipant.isMuted,
|
|
12192
|
+
isSpeaking: callParticipant.isSpeaking
|
|
12193
|
+
};
|
|
12194
|
+
}
|
|
12195
|
+
/**
|
|
12196
|
+
* @private
|
|
12197
|
+
*/
|
|
12198
|
+
function callParticipantFromMeetingParticipant(meetingParticipant) {
|
|
12199
|
+
return {
|
|
12200
|
+
identifier: meetingParticipant.id,
|
|
12201
|
+
callEndReason: meetingParticipant.meetingEndReason,
|
|
12202
|
+
displayName: meetingParticipant.displayName,
|
|
12203
|
+
state: meetingParticipant.state,
|
|
12204
|
+
videoStreams: meetingParticipant.videoStreams,
|
|
12205
|
+
isMuted: meetingParticipant.isMuted,
|
|
12206
|
+
isSpeaking: meetingParticipant.isSpeaking
|
|
12207
|
+
};
|
|
12208
|
+
}
|
|
12209
|
+
/**
|
|
12210
|
+
* @private
|
|
12211
|
+
*/
|
|
12212
|
+
function meetingParticipantsFromCallParticipants(callParticipants) {
|
|
12213
|
+
const meetingParticipants = {};
|
|
12214
|
+
for (const [key, value] of Object.entries(callParticipants)) {
|
|
12215
|
+
meetingParticipants[key] = meetingParticipantFromCallParticipant(value);
|
|
12216
|
+
}
|
|
12217
|
+
return meetingParticipants;
|
|
12218
|
+
}
|
|
12219
|
+
/**
|
|
12220
|
+
* @private
|
|
12221
|
+
*/
|
|
12222
|
+
function callParticipantsFromMeetingParticipants(meetingParticipants) {
|
|
12223
|
+
const callParticipants = {};
|
|
12224
|
+
for (const [key, value] of Object.entries(meetingParticipants)) {
|
|
12225
|
+
callParticipants[key] = callParticipantFromMeetingParticipant(value);
|
|
12226
|
+
}
|
|
12227
|
+
return callParticipants;
|
|
12228
|
+
}
|
|
12229
|
+
|
|
12230
|
+
// Copyright (c) Microsoft Corporation.
|
|
12231
|
+
// Licensed under the MIT license.
|
|
12232
|
+
var __awaiter$2 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12233
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
12234
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
12235
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12236
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12237
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
12238
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12239
|
+
});
|
|
12240
|
+
};
|
|
12241
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
12242
|
+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
12243
|
+
function callStateFromMeetingState(meetingState) {
|
|
12244
|
+
return {
|
|
12245
|
+
id: meetingState.id,
|
|
12246
|
+
callerInfo: meetingState.callerInfo,
|
|
12247
|
+
state: meetingState.state,
|
|
12248
|
+
callEndReason: meetingState.meetingEndReason,
|
|
12249
|
+
direction: 'Incoming',
|
|
12250
|
+
isMuted: meetingState.isMuted,
|
|
12251
|
+
isScreenSharingOn: meetingState.isScreenSharingOn,
|
|
12252
|
+
localVideoStreams: meetingState.localVideoStreams,
|
|
12253
|
+
transcription: meetingState.transcription,
|
|
12254
|
+
recording: meetingState.recording,
|
|
12255
|
+
screenShareRemoteParticipant: meetingState.screenShareRemoteParticipant,
|
|
12256
|
+
startTime: meetingState.startTime,
|
|
12257
|
+
endTime: meetingState.endTime,
|
|
12258
|
+
diagnostics: meetingState.diagnostics,
|
|
12259
|
+
remoteParticipants: callParticipantsFromMeetingParticipants(meetingState.participants),
|
|
12260
|
+
remoteParticipantsEnded: callParticipantsFromMeetingParticipants(meetingState.participantsEnded),
|
|
12261
|
+
dominantSpeakers: meetingState.dominantSpeakers
|
|
12262
|
+
};
|
|
12263
|
+
}
|
|
12264
|
+
function callAdapterStateFromMeetingAdapterState(meetingState) {
|
|
12265
|
+
return {
|
|
12266
|
+
isLocalPreviewMicrophoneEnabled: meetingState.isLocalPreviewMicrophoneEnabled,
|
|
12267
|
+
page: meetingPageToCallPage(meetingState.page),
|
|
12268
|
+
userId: meetingState.userId,
|
|
12269
|
+
displayName: meetingState.displayName,
|
|
12270
|
+
call: meetingState.meeting ? callStateFromMeetingState(meetingState.meeting) : undefined,
|
|
12271
|
+
devices: meetingState.devices,
|
|
12272
|
+
isTeamsCall: meetingState.isTeamsCall,
|
|
12273
|
+
latestErrors: {} //@TODO: latest errors not supported in meeting composite yet.
|
|
12274
|
+
};
|
|
12275
|
+
}
|
|
12276
|
+
/**
|
|
12277
|
+
* Facade around the MeetingAdapter to satisfy the call adapter interface.
|
|
12278
|
+
*
|
|
12279
|
+
* @private
|
|
12280
|
+
*/
|
|
12281
|
+
class MeetingBackedCallAdapter {
|
|
12282
|
+
constructor(meetingAdapter) {
|
|
12283
|
+
// For onStateChange we must convert meeting state to chat state. This involves creating a new handler to be passed into the onStateChange.
|
|
12284
|
+
// In order to unsubscribe the handler when offStateChange is called we must have a mapping of the original handler to the newly created handler.
|
|
12285
|
+
this.eventStore = new Map();
|
|
12286
|
+
this.on = (event, listener) => this.meetingAdapter.on(event, listener);
|
|
12287
|
+
this.off = (event, listener) => this.meetingAdapter.off(event, listener);
|
|
12288
|
+
this.onStateChange = (handler) => {
|
|
12289
|
+
const convertedHandler = (state) => {
|
|
12290
|
+
handler(callAdapterStateFromMeetingAdapterState(state));
|
|
12291
|
+
};
|
|
12292
|
+
this.meetingAdapter.onStateChange(convertedHandler);
|
|
12293
|
+
this.eventStore.set(handler, convertedHandler);
|
|
12294
|
+
};
|
|
12295
|
+
this.offStateChange = (handler) => {
|
|
12296
|
+
const convertedHandler = this.eventStore.get(handler);
|
|
12297
|
+
convertedHandler && this.meetingAdapter.offStateChange(convertedHandler);
|
|
12298
|
+
};
|
|
12299
|
+
this.getState = () => callAdapterStateFromMeetingAdapterState(this.meetingAdapter.getState());
|
|
12300
|
+
this.dispose = () => this.meetingAdapter.dispose();
|
|
12301
|
+
this.joinCall = (microphoneOn) => {
|
|
12302
|
+
return this.meetingAdapter.joinMeeting(microphoneOn);
|
|
12303
|
+
};
|
|
12304
|
+
this.leaveCall = () => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.leaveMeeting(); });
|
|
12305
|
+
this.startCall = (participants) => {
|
|
12306
|
+
return this.meetingAdapter.startMeeting(participants);
|
|
12307
|
+
};
|
|
12308
|
+
this.setCamera = (sourceId, options) => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.setCamera(sourceId, options); });
|
|
12309
|
+
this.setMicrophone = (sourceId) => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.setMicrophone(sourceId); });
|
|
12310
|
+
this.setSpeaker = (sourceId) => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.setSpeaker(sourceId); });
|
|
12311
|
+
this.askDevicePermission = (constraints) => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.askDevicePermission(constraints); });
|
|
12312
|
+
this.queryCameras = () => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.queryCameras(); });
|
|
12313
|
+
this.queryMicrophones = () => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.queryMicrophones(); });
|
|
12314
|
+
this.querySpeakers = () => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.querySpeakers(); });
|
|
12315
|
+
this.startCamera = (options) => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.startCamera(options); });
|
|
12316
|
+
this.stopCamera = () => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.stopCamera(); });
|
|
12317
|
+
this.mute = () => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.mute(); });
|
|
12318
|
+
this.unmute = () => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.unmute(); });
|
|
12319
|
+
this.startScreenShare = () => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.startScreenShare(); });
|
|
12320
|
+
this.stopScreenShare = () => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.stopScreenShare(); });
|
|
12321
|
+
this.removeParticipant = (userId) => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.removeParticipant(userId); });
|
|
12322
|
+
this.createStreamView = (remoteUserId, options) => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.createStreamView(remoteUserId, options); });
|
|
12323
|
+
this.disposeStreamView = (remoteUserId, options) => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.disposeStreamView(remoteUserId, options); });
|
|
12324
|
+
this.meetingAdapter = meetingAdapter;
|
|
12325
|
+
}
|
|
12326
|
+
}
|
|
12327
|
+
|
|
12328
|
+
// Copyright (c) Microsoft Corporation.
|
|
12329
|
+
// Licensed under the MIT license.
|
|
12330
|
+
var __awaiter$1 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12331
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
12332
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
12333
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12334
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12335
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
12336
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12337
|
+
});
|
|
12338
|
+
};
|
|
12339
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
12340
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
12341
|
+
function chatThreadStateFromMeetingState(meetingState) {
|
|
12342
|
+
return {
|
|
12343
|
+
chatMessages: meetingState.chatMessages,
|
|
12344
|
+
participants: meetingState.participants,
|
|
12345
|
+
threadId: meetingState.threadId,
|
|
12346
|
+
properties: meetingState.properties,
|
|
12347
|
+
readReceipts: meetingState.readReceipts,
|
|
12348
|
+
typingIndicators: meetingState.typingIndicators,
|
|
12349
|
+
latestReadTime: meetingState.latestReadTime
|
|
12350
|
+
};
|
|
12351
|
+
}
|
|
12352
|
+
function ChatAdapterStateFromMeetingAdapterState(meetingState) {
|
|
12353
|
+
if (!meetingState.meeting) {
|
|
12354
|
+
throw 'Cannot get chat adapter state. Meeting state is undefined.';
|
|
12355
|
+
}
|
|
12356
|
+
return {
|
|
12357
|
+
userId: meetingState.userId,
|
|
12358
|
+
displayName: meetingState.displayName || '',
|
|
12359
|
+
thread: chatThreadStateFromMeetingState(meetingState.meeting),
|
|
12360
|
+
latestErrors: {} //@TODO: latest errors not supported in meeting composite yet.
|
|
12361
|
+
};
|
|
12362
|
+
}
|
|
12363
|
+
/**
|
|
12364
|
+
* Facade around the MeetingAdapter to satisfy the chat adapter interface.
|
|
12365
|
+
*
|
|
12366
|
+
* @private
|
|
12367
|
+
*/
|
|
12368
|
+
class MeetingBackedChatAdapter {
|
|
12369
|
+
constructor(meetingAdapter) {
|
|
12370
|
+
// For onStateChange we must convert meeting state to chat state. This involves creating a new handler to be passed into the onStateChange.
|
|
12371
|
+
// In order to unsubscribe the handler when offStateChange is called we must have a mapping of the original handler to the newly created handler.
|
|
12372
|
+
this.eventStore = new Map();
|
|
12373
|
+
this.fetchInitialData = () => __awaiter$1(this, void 0, void 0, function* () { return yield this.meetingAdapter.fetchInitialData(); });
|
|
12374
|
+
this.sendMessage = (content) => __awaiter$1(this, void 0, void 0, function* () { return yield this.meetingAdapter.sendMessage(content); });
|
|
12375
|
+
this.sendReadReceipt = (chatMessageId) => __awaiter$1(this, void 0, void 0, function* () { return yield this.meetingAdapter.sendReadReceipt(chatMessageId); });
|
|
12376
|
+
this.sendTypingIndicator = () => __awaiter$1(this, void 0, void 0, function* () { return yield this.meetingAdapter.sendTypingIndicator(); });
|
|
12377
|
+
this.removeParticipant = (userId) => __awaiter$1(this, void 0, void 0, function* () { return yield this.meetingAdapter.removeParticipant(userId); });
|
|
12378
|
+
this.loadPreviousChatMessages = (messagesToLoad) => __awaiter$1(this, void 0, void 0, function* () { return yield this.meetingAdapter.loadPreviousChatMessages(messagesToLoad); });
|
|
12379
|
+
this.dispose = () => this.meetingAdapter.dispose();
|
|
12380
|
+
this.onStateChange = (handler) => {
|
|
12381
|
+
const convertedHandler = (state) => {
|
|
12382
|
+
handler(ChatAdapterStateFromMeetingAdapterState(state));
|
|
12383
|
+
};
|
|
12384
|
+
this.meetingAdapter.onStateChange(convertedHandler);
|
|
12385
|
+
this.eventStore.set(handler, convertedHandler);
|
|
12386
|
+
};
|
|
12387
|
+
this.offStateChange = (handler) => {
|
|
12388
|
+
const convertedHandler = this.eventStore.get(handler);
|
|
12389
|
+
convertedHandler && this.meetingAdapter.offStateChange(convertedHandler);
|
|
12390
|
+
};
|
|
12391
|
+
this.getState = () => ChatAdapterStateFromMeetingAdapterState(this.meetingAdapter.getState());
|
|
12392
|
+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
12393
|
+
this.on = (event, listener) => this.meetingAdapter.on(event, listener);
|
|
12394
|
+
this.off = (event, listener) => this.meetingAdapter.off(event, listener);
|
|
12395
|
+
this.updateMessage = (messageId, content) => __awaiter$1(this, void 0, void 0, function* () { return yield this.meetingAdapter.updateMessage(messageId, content); });
|
|
12396
|
+
this.deleteMessage = (messageId) => __awaiter$1(this, void 0, void 0, function* () { return yield this.meetingAdapter.deleteMessage(messageId); });
|
|
12397
|
+
this.clearErrors = (errorTypes) => {
|
|
12398
|
+
throw `Method not supported in meetings.`;
|
|
12399
|
+
};
|
|
12400
|
+
this.setTopic = (topicName) => __awaiter$1(this, void 0, void 0, function* () {
|
|
12401
|
+
throw `Chat Topics are not supported in meetings.`;
|
|
12402
|
+
});
|
|
12403
|
+
this.meetingAdapter = meetingAdapter;
|
|
12404
|
+
}
|
|
12405
|
+
}
|
|
12406
|
+
|
|
12407
|
+
// Copyright (c) Microsoft Corporation.
|
|
12408
|
+
/**
|
|
12409
|
+
* Meeting Composite brings together key components to provide a full meeting experience out of the box.
|
|
12410
|
+
*
|
|
12411
|
+
* @beta
|
|
12412
|
+
*/
|
|
12413
|
+
const MeetingComposite = (props) => {
|
|
12414
|
+
const { meetingAdapter, fluentTheme, formFactor = 'desktop' } = props;
|
|
12415
|
+
if (!meetingAdapter) {
|
|
12416
|
+
throw 'Meeting adapter is undefined';
|
|
12417
|
+
}
|
|
12418
|
+
const callAdapter = React.useMemo(() => new MeetingBackedCallAdapter(meetingAdapter), [meetingAdapter]);
|
|
12419
|
+
const chatAdapter = React.useMemo(() => new MeetingBackedChatAdapter(meetingAdapter), [meetingAdapter]);
|
|
12420
|
+
const [currentMeetingState, setCurrentMeetingState] = React.useState();
|
|
12421
|
+
const [currentPage, setCurrentPage] = React.useState();
|
|
12422
|
+
meetingAdapter.onStateChange((newState) => {
|
|
12423
|
+
var _a;
|
|
12424
|
+
setCurrentPage(newState.page);
|
|
12425
|
+
setCurrentMeetingState((_a = newState.meeting) === null || _a === void 0 ? void 0 : _a.state);
|
|
12426
|
+
});
|
|
12427
|
+
const [showChat, setShowChat] = React.useState(false);
|
|
12428
|
+
const [showPeople, setShowPeople] = React.useState(false);
|
|
12429
|
+
const closePane = React.useCallback(() => {
|
|
12430
|
+
setShowChat(false);
|
|
12431
|
+
setShowPeople(false);
|
|
12432
|
+
}, []);
|
|
12433
|
+
const toggleChat = React.useCallback(() => {
|
|
12434
|
+
setShowPeople(false);
|
|
12435
|
+
setShowChat(!showChat);
|
|
12436
|
+
}, [showChat]);
|
|
12437
|
+
const togglePeople = React.useCallback(() => {
|
|
12438
|
+
setShowChat(false);
|
|
12439
|
+
setShowPeople(!showPeople);
|
|
12440
|
+
}, [showPeople]);
|
|
12441
|
+
const isInLobbyOrConnecting = currentPage === 'lobby';
|
|
12442
|
+
const hasJoinedCall$1 = !!(currentPage && hasJoinedCall(currentPage, currentMeetingState !== null && currentMeetingState !== void 0 ? currentMeetingState : 'None'));
|
|
12443
|
+
return (React__default['default'].createElement(FluentThemeProvider, { fluentTheme: fluentTheme },
|
|
12444
|
+
React__default['default'].createElement(react.Stack, { verticalFill: true, grow: true, styles: compositeOuterContainerStyles },
|
|
12445
|
+
React__default['default'].createElement(react.Stack, { horizontal: true, grow: true },
|
|
12446
|
+
React__default['default'].createElement(react.Stack.Item, { grow: true },
|
|
12447
|
+
React__default['default'].createElement(CallComposite, Object.assign({}, props, { formFactor: formFactor, options: { callControls: false }, adapter: callAdapter, fluentTheme: fluentTheme }))),
|
|
12448
|
+
chatAdapter && hasJoinedCall$1 && (React__default['default'].createElement(EmbeddedChatPane, { chatCompositeProps: props, hidden: !showChat, chatAdapter: chatAdapter, fluentTheme: fluentTheme, onClose: closePane })),
|
|
12449
|
+
callAdapter && chatAdapter && hasJoinedCall$1 && (React__default['default'].createElement(CallAdapterProvider, { adapter: callAdapter },
|
|
12450
|
+
React__default['default'].createElement(EmbeddedPeoplePane, { hidden: !showPeople, inviteLink: props.meetingInvitationURL, onClose: closePane, chatAdapter: chatAdapter, callAdapter: callAdapter })))),
|
|
12451
|
+
(isInLobbyOrConnecting || hasJoinedCall$1) && (React__default['default'].createElement(MeetingCallControlBar, { callAdapter: callAdapter, chatButtonChecked: showChat, onChatButtonClicked: toggleChat, peopleButtonChecked: showPeople, onPeopleButtonClicked: togglePeople, mobileView: props.formFactor === 'mobile', disableButtonsForLobbyPage: isInLobbyOrConnecting })))));
|
|
12452
|
+
};
|
|
12453
|
+
|
|
12454
|
+
// Copyright (c) Microsoft Corporation.
|
|
12455
|
+
/**
|
|
12456
|
+
* Return properties from call state that are used in meeting state.
|
|
12457
|
+
*
|
|
12458
|
+
* @private
|
|
12459
|
+
*/
|
|
12460
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
12461
|
+
const meetingPropsFromCallState = (callState) => ({
|
|
12462
|
+
id: callState.id,
|
|
12463
|
+
callerInfo: callState.callerInfo,
|
|
12464
|
+
state: callState.state,
|
|
12465
|
+
isMuted: callState.isMuted,
|
|
12466
|
+
isScreenSharingOn: callState.isScreenSharingOn,
|
|
12467
|
+
localVideoStreams: callState.localVideoStreams,
|
|
12468
|
+
transcription: callState.transcription,
|
|
12469
|
+
recording: callState.recording,
|
|
12470
|
+
screenShareRemoteParticipant: callState.screenShareRemoteParticipant,
|
|
12471
|
+
startTime: callState.startTime,
|
|
12472
|
+
endTime: callState.endTime,
|
|
12473
|
+
meetingEndReason: callState.callEndReason,
|
|
12474
|
+
diagnostics: callState.diagnostics,
|
|
12475
|
+
dominantSpeakers: callState.dominantSpeakers,
|
|
12476
|
+
// For meetings we only use participants from the call in a meeting
|
|
12477
|
+
participants: meetingParticipantsFromCallParticipants(callState.remoteParticipants),
|
|
12478
|
+
participantsEnded: meetingParticipantsFromCallParticipants(callState.remoteParticipantsEnded)
|
|
12479
|
+
});
|
|
12480
|
+
/**
|
|
12481
|
+
* Return properties from chat state that are used in meeting state.
|
|
12482
|
+
*
|
|
12483
|
+
* @private
|
|
12484
|
+
*/
|
|
12485
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
12486
|
+
const meetingPropsFromChatState = (chatState) => ({
|
|
12487
|
+
chatMessages: chatState.chatMessages,
|
|
12488
|
+
threadId: chatState.threadId,
|
|
12489
|
+
properties: chatState.properties,
|
|
12490
|
+
readReceipts: chatState.readReceipts,
|
|
12491
|
+
typingIndicators: chatState.typingIndicators,
|
|
12492
|
+
latestReadTime: chatState.latestReadTime
|
|
12493
|
+
});
|
|
12494
|
+
/**
|
|
12495
|
+
* Helper function to return meeting state created from call and chat states
|
|
12496
|
+
*
|
|
12497
|
+
* @private
|
|
12498
|
+
*/
|
|
12499
|
+
function meetingStateFromBackingStates(callState, chatState) {
|
|
12500
|
+
return Object.assign(Object.assign({}, meetingPropsFromCallState(callState)), meetingPropsFromChatState(chatState));
|
|
12501
|
+
}
|
|
12502
|
+
/**
|
|
12503
|
+
* Helper function to return an updated meeting state with new chat state applied
|
|
12504
|
+
*
|
|
12505
|
+
* @private
|
|
12506
|
+
*/
|
|
12507
|
+
function mergeChatStateIntoMeetingState(meetingState, chatState) {
|
|
12508
|
+
return Object.assign(Object.assign({}, meetingState), meetingPropsFromChatState(chatState));
|
|
12509
|
+
}
|
|
12510
|
+
/**
|
|
12511
|
+
* Helper function to return an updated meeting state with new call state applied
|
|
12512
|
+
*
|
|
12513
|
+
* @private
|
|
12514
|
+
*/
|
|
12515
|
+
function mergeCallStateIntoMeetingState(meetingState, callState) {
|
|
12516
|
+
// If we have no existing meeting state, populate chat fields with defaults to merge and make a new state.
|
|
12517
|
+
// This is because calls are constructed before chat state is created.
|
|
12518
|
+
if (!meetingState) {
|
|
12519
|
+
return Object.assign({ chatMessages: {}, threadId: '', properties: {}, readReceipts: [], typingIndicators: [], latestReadTime: new Date(0) }, meetingPropsFromCallState(callState));
|
|
12520
|
+
}
|
|
12521
|
+
return Object.assign(Object.assign({}, meetingState), meetingPropsFromCallState(callState));
|
|
12522
|
+
}
|
|
12523
|
+
|
|
12524
|
+
// Copyright (c) Microsoft Corporation.
|
|
12525
|
+
/**
|
|
12526
|
+
* @private
|
|
12527
|
+
*/
|
|
12528
|
+
function meetingAdapterStateFromBackingStates(callAdapter, chatAdapter) {
|
|
12529
|
+
const callAdapterState = callAdapter.getState();
|
|
12530
|
+
const chatAdapterState = chatAdapter.getState();
|
|
12531
|
+
const meeting = callAdapterState.call
|
|
12532
|
+
? meetingStateFromBackingStates(callAdapterState.call, chatAdapterState.thread)
|
|
12533
|
+
: undefined;
|
|
12534
|
+
return {
|
|
12535
|
+
meeting,
|
|
12536
|
+
userId: callAdapterState.userId,
|
|
12537
|
+
page: callPageToMeetingPage(callAdapterState.page),
|
|
12538
|
+
displayName: callAdapterState.displayName,
|
|
12539
|
+
devices: callAdapterState.devices,
|
|
12540
|
+
isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled,
|
|
12541
|
+
isTeamsCall: callAdapterState.isTeamsCall
|
|
12542
|
+
};
|
|
12543
|
+
}
|
|
12544
|
+
/**
|
|
12545
|
+
* @private
|
|
12546
|
+
*/
|
|
12547
|
+
function mergeChatAdapterStateIntoMeetingAdapterState(meetingAdapterState, chatAdapterState) {
|
|
12548
|
+
const newMeetingState = meetingAdapterState.meeting
|
|
12549
|
+
? mergeChatStateIntoMeetingState(meetingAdapterState.meeting, chatAdapterState.thread)
|
|
12550
|
+
: undefined;
|
|
12551
|
+
return Object.assign(Object.assign({}, meetingAdapterState), { meeting: newMeetingState });
|
|
12552
|
+
}
|
|
12553
|
+
/**
|
|
12554
|
+
* @private
|
|
12555
|
+
*/
|
|
12556
|
+
function mergeCallAdapterStateIntoMeetingAdapterState(meetingAdapterState, callAdapterState) {
|
|
12557
|
+
const newMeetingState = callAdapterState.call
|
|
12558
|
+
? mergeCallStateIntoMeetingState(meetingAdapterState.meeting, callAdapterState.call)
|
|
12559
|
+
: undefined;
|
|
12560
|
+
return {
|
|
12561
|
+
userId: callAdapterState.userId,
|
|
12562
|
+
page: callPageToMeetingPage(callAdapterState.page),
|
|
12563
|
+
displayName: callAdapterState.displayName,
|
|
12564
|
+
devices: callAdapterState.devices,
|
|
12565
|
+
meeting: newMeetingState,
|
|
12566
|
+
isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled,
|
|
12567
|
+
isTeamsCall: callAdapterState.isTeamsCall
|
|
12568
|
+
};
|
|
12569
|
+
}
|
|
12570
|
+
|
|
12571
|
+
// Copyright (c) Microsoft Corporation.
|
|
12572
|
+
// Licensed under the MIT license.
|
|
12573
|
+
var __awaiter = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12574
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
12575
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
12576
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12577
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12578
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
12579
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12580
|
+
});
|
|
12581
|
+
};
|
|
12582
|
+
/** Context of meeting, which is a centralized context for all state updates */
|
|
12583
|
+
class MeetingContext {
|
|
12584
|
+
constructor(clientState) {
|
|
12585
|
+
this.emitter = new EventEmitter.EventEmitter();
|
|
12586
|
+
this.state = clientState;
|
|
12587
|
+
}
|
|
12588
|
+
onStateChange(handler) {
|
|
12589
|
+
this.emitter.on('stateChanged', handler);
|
|
12590
|
+
}
|
|
12591
|
+
offStateChange(handler) {
|
|
12592
|
+
this.emitter.off('stateChanged', handler);
|
|
12593
|
+
}
|
|
12594
|
+
setState(state) {
|
|
12595
|
+
this.state = state;
|
|
12596
|
+
this.emitter.emit('stateChanged', this.state);
|
|
12597
|
+
}
|
|
12598
|
+
getState() {
|
|
12599
|
+
return this.state;
|
|
12600
|
+
}
|
|
12601
|
+
updateClientState(clientState) {
|
|
12602
|
+
this.setState(clientState);
|
|
12603
|
+
}
|
|
12604
|
+
updateClientStateWithChatState(chatAdapterState) {
|
|
12605
|
+
this.updateClientState(mergeChatAdapterStateIntoMeetingAdapterState(this.state, chatAdapterState));
|
|
12606
|
+
}
|
|
12607
|
+
updateClientStateWithCallState(callAdapterState) {
|
|
12608
|
+
this.updateClientState(mergeCallAdapterStateIntoMeetingAdapterState(this.state, callAdapterState));
|
|
12609
|
+
}
|
|
12610
|
+
}
|
|
12611
|
+
/**
|
|
12612
|
+
* Meeting adapter backed by Azure Communication Services.
|
|
12613
|
+
* Created for easy use with the Meeting Composite.
|
|
12614
|
+
*/
|
|
12615
|
+
class AzureCommunicationMeetingAdapter {
|
|
12616
|
+
constructor(callAdapter, chatAdapter) {
|
|
12617
|
+
this.bindPublicMethods();
|
|
12618
|
+
this.callAdapter = callAdapter;
|
|
12619
|
+
this.chatAdapter = chatAdapter;
|
|
12620
|
+
this.context = new MeetingContext(meetingAdapterStateFromBackingStates(callAdapter, chatAdapter));
|
|
12621
|
+
const onChatStateChange = (newChatAdapterState) => {
|
|
12622
|
+
this.context.updateClientStateWithChatState(newChatAdapterState);
|
|
12623
|
+
};
|
|
12624
|
+
this.chatAdapter.onStateChange(onChatStateChange);
|
|
12625
|
+
this.onChatStateChange = onChatStateChange;
|
|
12626
|
+
const onCallStateChange = (newCallAdapterState) => {
|
|
12627
|
+
this.context.updateClientStateWithCallState(newCallAdapterState);
|
|
12628
|
+
};
|
|
12629
|
+
this.callAdapter.onStateChange(onCallStateChange);
|
|
12630
|
+
this.onCallStateChange = onCallStateChange;
|
|
12631
|
+
}
|
|
12632
|
+
bindPublicMethods() {
|
|
12633
|
+
this.joinMeeting.bind(this);
|
|
12634
|
+
this.leaveMeeting.bind(this);
|
|
12635
|
+
this.startMeeting.bind(this);
|
|
12636
|
+
this.onStateChange.bind(this);
|
|
12637
|
+
this.offStateChange.bind(this);
|
|
12638
|
+
this.getState.bind(this);
|
|
12639
|
+
this.dispose.bind(this);
|
|
12640
|
+
this.setCamera.bind(this);
|
|
12641
|
+
this.setMicrophone.bind(this);
|
|
12642
|
+
this.setSpeaker.bind(this);
|
|
12643
|
+
this.askDevicePermission.bind(this);
|
|
12644
|
+
this.queryCameras.bind(this);
|
|
12645
|
+
this.queryMicrophones.bind(this);
|
|
12646
|
+
this.querySpeakers.bind(this);
|
|
12647
|
+
this.startCamera.bind(this);
|
|
12648
|
+
this.stopCamera.bind(this);
|
|
12649
|
+
this.mute.bind(this);
|
|
12650
|
+
this.unmute.bind(this);
|
|
12651
|
+
this.startScreenShare.bind(this);
|
|
12652
|
+
this.stopScreenShare.bind(this);
|
|
12653
|
+
this.removeParticipant.bind(this);
|
|
12654
|
+
this.createStreamView.bind(this);
|
|
12655
|
+
this.disposeStreamView.bind(this);
|
|
12656
|
+
this.fetchInitialData.bind(this);
|
|
12657
|
+
this.sendMessage.bind(this);
|
|
12658
|
+
this.sendReadReceipt.bind(this);
|
|
12659
|
+
this.sendTypingIndicator.bind(this);
|
|
12660
|
+
this.loadPreviousChatMessages.bind(this);
|
|
12661
|
+
this.updateMessage.bind(this);
|
|
12662
|
+
this.deleteMessage.bind(this);
|
|
12663
|
+
this.on.bind(this);
|
|
12664
|
+
this.off.bind(this);
|
|
12665
|
+
}
|
|
12666
|
+
/** Join existing Meeting. */
|
|
12667
|
+
joinMeeting(microphoneOn) {
|
|
12668
|
+
return this.callAdapter.joinCall(microphoneOn);
|
|
12669
|
+
}
|
|
12670
|
+
/** Leave current Meeting. */
|
|
12671
|
+
leaveMeeting() {
|
|
12672
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12673
|
+
yield this.chatAdapter.removeParticipant(toFlatCommunicationIdentifier(this.chatAdapter.getState().userId));
|
|
12674
|
+
yield this.callAdapter.leaveCall();
|
|
12675
|
+
});
|
|
12676
|
+
}
|
|
12677
|
+
/** Start a new Meeting. */
|
|
12678
|
+
startMeeting(participants) {
|
|
12679
|
+
return this.callAdapter.startCall(participants);
|
|
12680
|
+
}
|
|
12681
|
+
/**
|
|
12682
|
+
* Subscribe to state change events.
|
|
12683
|
+
* @param handler - handler to be called when the state changes. This is passed the new state.
|
|
12684
|
+
*/
|
|
12685
|
+
onStateChange(handler) {
|
|
12686
|
+
this.context.onStateChange(handler);
|
|
12687
|
+
}
|
|
12688
|
+
/**
|
|
12689
|
+
* Unsubscribe to state change events.
|
|
12690
|
+
* @param handler - handler to be no longer called when state changes.
|
|
12691
|
+
*/
|
|
12692
|
+
offStateChange(handler) {
|
|
12693
|
+
this.context.offStateChange(handler);
|
|
12694
|
+
}
|
|
12695
|
+
/** Get current Meeting state. */
|
|
12696
|
+
getState() {
|
|
12697
|
+
return this.context.getState();
|
|
12698
|
+
}
|
|
12699
|
+
/** Dispose of the current Meeting Adapter. */
|
|
12700
|
+
dispose() {
|
|
12701
|
+
this.chatAdapter.offStateChange(this.onChatStateChange);
|
|
12702
|
+
this.callAdapter.offStateChange(this.onCallStateChange);
|
|
12703
|
+
this.chatAdapter.dispose();
|
|
12704
|
+
this.callAdapter.dispose();
|
|
12705
|
+
}
|
|
12706
|
+
/** Remove a participant from the Meeting. */
|
|
12707
|
+
removeParticipant(userId) {
|
|
12708
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12709
|
+
yield this.chatAdapter.removeParticipant(userId);
|
|
12710
|
+
yield this.callAdapter.removeParticipant(userId);
|
|
12711
|
+
});
|
|
12712
|
+
}
|
|
12713
|
+
setCamera(device, options) {
|
|
12714
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12715
|
+
yield this.callAdapter.setCamera(device, options);
|
|
12716
|
+
});
|
|
12717
|
+
}
|
|
12718
|
+
/** Set the microphone to be used in the meeting. */
|
|
12719
|
+
setMicrophone(device) {
|
|
12720
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12721
|
+
yield this.callAdapter.setMicrophone(device);
|
|
12722
|
+
});
|
|
12723
|
+
}
|
|
12724
|
+
/** Set the speaker to be used in the meeting. */
|
|
12725
|
+
setSpeaker(device) {
|
|
12726
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12727
|
+
yield this.callAdapter.setSpeaker(device);
|
|
12728
|
+
});
|
|
12729
|
+
}
|
|
12730
|
+
askDevicePermission(constraints) {
|
|
12731
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12732
|
+
yield this.callAdapter.askDevicePermission(constraints);
|
|
12733
|
+
});
|
|
12734
|
+
}
|
|
12735
|
+
/** Query for available cameras. */
|
|
12736
|
+
queryCameras() {
|
|
12737
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12738
|
+
return yield this.callAdapter.queryCameras();
|
|
12739
|
+
});
|
|
12740
|
+
}
|
|
12741
|
+
/** Query for available microphones. */
|
|
12742
|
+
queryMicrophones() {
|
|
12743
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12744
|
+
return yield this.callAdapter.queryMicrophones();
|
|
12745
|
+
});
|
|
12746
|
+
}
|
|
12747
|
+
/** Query for available speakers. */
|
|
12748
|
+
querySpeakers() {
|
|
12749
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12750
|
+
return yield this.callAdapter.querySpeakers();
|
|
12751
|
+
});
|
|
12752
|
+
}
|
|
12753
|
+
/** Start the camera for the user in the Meeting. */
|
|
12754
|
+
startCamera(options) {
|
|
12755
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12756
|
+
yield this.callAdapter.startCamera(options);
|
|
12757
|
+
});
|
|
12758
|
+
}
|
|
12759
|
+
/** Stop the camera for the user in the Meeting. */
|
|
12760
|
+
stopCamera() {
|
|
12761
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12762
|
+
yield this.callAdapter.stopCamera();
|
|
12763
|
+
});
|
|
12764
|
+
}
|
|
12765
|
+
/** Mute the user in the Meeting. */
|
|
12766
|
+
mute() {
|
|
12767
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12768
|
+
yield this.callAdapter.mute();
|
|
12769
|
+
});
|
|
12770
|
+
}
|
|
12771
|
+
/** Unmute the user in the Meeting. */
|
|
12772
|
+
unmute() {
|
|
12773
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12774
|
+
yield this.callAdapter.unmute();
|
|
12775
|
+
});
|
|
12776
|
+
}
|
|
12777
|
+
/** Trigger the user to start screen share. */
|
|
12778
|
+
startScreenShare() {
|
|
12779
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12780
|
+
yield this.callAdapter.startScreenShare();
|
|
12781
|
+
});
|
|
12782
|
+
}
|
|
12783
|
+
/** Stop the current active screen share. */
|
|
12784
|
+
stopScreenShare() {
|
|
12785
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12786
|
+
yield this.callAdapter.stopScreenShare();
|
|
12787
|
+
});
|
|
12788
|
+
}
|
|
12789
|
+
/** Create a stream view for a remote participants video feed. */
|
|
12790
|
+
createStreamView(remoteUserId, options) {
|
|
12791
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12792
|
+
yield this.callAdapter.createStreamView(remoteUserId, options);
|
|
12793
|
+
});
|
|
12794
|
+
}
|
|
12795
|
+
/** Dispose of a created stream view of a remote participants video feed. */
|
|
12796
|
+
disposeStreamView(remoteUserId, options) {
|
|
12797
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12798
|
+
yield this.callAdapter.disposeStreamView(remoteUserId, options);
|
|
12799
|
+
});
|
|
12800
|
+
}
|
|
12801
|
+
/** Fetch initial Meeting data such as chat messages. */
|
|
12802
|
+
fetchInitialData() {
|
|
12803
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12804
|
+
yield this.chatAdapter.fetchInitialData();
|
|
12805
|
+
});
|
|
12806
|
+
}
|
|
12807
|
+
/** Send a chat message. */
|
|
12808
|
+
sendMessage(content) {
|
|
12809
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12810
|
+
yield this.chatAdapter.sendMessage(content);
|
|
12811
|
+
});
|
|
12812
|
+
}
|
|
12813
|
+
/** Send a chat read receipt. */
|
|
12814
|
+
sendReadReceipt(chatMessageId) {
|
|
12815
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12816
|
+
yield this.chatAdapter.sendReadReceipt(chatMessageId);
|
|
12817
|
+
});
|
|
12818
|
+
}
|
|
12819
|
+
/** Send an isTyping indicator. */
|
|
12820
|
+
sendTypingIndicator() {
|
|
12821
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12822
|
+
yield this.chatAdapter.sendTypingIndicator();
|
|
12823
|
+
});
|
|
12824
|
+
}
|
|
12825
|
+
/** Load previous Meeting chat messages. */
|
|
12826
|
+
loadPreviousChatMessages(messagesToLoad) {
|
|
12827
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12828
|
+
return yield this.chatAdapter.loadPreviousChatMessages(messagesToLoad);
|
|
12829
|
+
});
|
|
12830
|
+
}
|
|
12831
|
+
/** Update an existing message. */
|
|
12832
|
+
updateMessage(messageId, content) {
|
|
12833
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12834
|
+
return yield this.chatAdapter.updateMessage(messageId, content);
|
|
12835
|
+
});
|
|
12836
|
+
}
|
|
12837
|
+
/** Delete an existing message. */
|
|
12838
|
+
deleteMessage(messageId) {
|
|
12839
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12840
|
+
return yield this.chatAdapter.deleteMessage(messageId);
|
|
12841
|
+
});
|
|
12842
|
+
}
|
|
12843
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12844
|
+
on(event, listener) {
|
|
12845
|
+
switch (event) {
|
|
12846
|
+
case 'participantsJoined':
|
|
12847
|
+
this.callAdapter.on(event, listener);
|
|
12848
|
+
break;
|
|
12849
|
+
case 'participantsLeft':
|
|
12850
|
+
this.callAdapter.on('participantsLeft', listener);
|
|
12851
|
+
break;
|
|
12852
|
+
case 'meetingEnded':
|
|
12853
|
+
this.callAdapter.on('callEnded', listener);
|
|
12854
|
+
break;
|
|
12855
|
+
case 'isMutedChanged':
|
|
12856
|
+
this.callAdapter.on('isMutedChanged', listener);
|
|
12857
|
+
break;
|
|
12858
|
+
case 'callIdChanged':
|
|
12859
|
+
this.callAdapter.on('callIdChanged', listener);
|
|
12860
|
+
break;
|
|
12861
|
+
case 'isLocalScreenSharingActiveChanged':
|
|
12862
|
+
this.callAdapter.on('isLocalScreenSharingActiveChanged', listener);
|
|
12863
|
+
break;
|
|
12864
|
+
case 'displayNameChanged':
|
|
12865
|
+
this.callAdapter.on('displayNameChanged', listener);
|
|
12866
|
+
break;
|
|
12867
|
+
case 'isSpeakingChanged':
|
|
12868
|
+
this.callAdapter.on('isSpeakingChanged', listener);
|
|
12869
|
+
break;
|
|
12870
|
+
case 'messageReceived':
|
|
12871
|
+
this.chatAdapter.on('messageReceived', listener);
|
|
12872
|
+
break;
|
|
12873
|
+
case 'messageSent':
|
|
12874
|
+
this.chatAdapter.on('messageSent', listener);
|
|
12875
|
+
break;
|
|
12876
|
+
case 'messageRead':
|
|
12877
|
+
this.chatAdapter.on('messageRead', listener);
|
|
12878
|
+
break;
|
|
12879
|
+
case 'error':
|
|
12880
|
+
throw 'on(Error) not implemented yet.';
|
|
12881
|
+
default:
|
|
12882
|
+
throw `Unknown MeetingEvent: ${event}`;
|
|
12883
|
+
}
|
|
12884
|
+
}
|
|
12885
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12886
|
+
off(event, listener) {
|
|
12887
|
+
switch (event) {
|
|
12888
|
+
case 'participantsJoined':
|
|
12889
|
+
this.callAdapter.off(event, listener);
|
|
12890
|
+
break;
|
|
12891
|
+
case 'participantsLeft':
|
|
12892
|
+
this.callAdapter.off('participantsLeft', listener);
|
|
12893
|
+
break;
|
|
12894
|
+
case 'meetingEnded':
|
|
12895
|
+
this.callAdapter.off('callEnded', listener);
|
|
12896
|
+
break;
|
|
12897
|
+
case 'isMutedChanged':
|
|
12898
|
+
this.callAdapter.off('isMutedChanged', listener);
|
|
12899
|
+
break;
|
|
12900
|
+
case 'callIdChanged':
|
|
12901
|
+
this.callAdapter.off('callIdChanged', listener);
|
|
12902
|
+
break;
|
|
12903
|
+
case 'isLocalScreenSharingActiveChanged':
|
|
12904
|
+
this.callAdapter.off('isLocalScreenSharingActiveChanged', listener);
|
|
12905
|
+
break;
|
|
12906
|
+
case 'displayNameChanged':
|
|
12907
|
+
this.callAdapter.off('displayNameChanged', listener);
|
|
12908
|
+
break;
|
|
12909
|
+
case 'isSpeakingChanged':
|
|
12910
|
+
this.callAdapter.off('isSpeakingChanged', listener);
|
|
12911
|
+
break;
|
|
12912
|
+
case 'messageReceived':
|
|
12913
|
+
this.chatAdapter.off('messageReceived', listener);
|
|
12914
|
+
break;
|
|
12915
|
+
case 'messageSent':
|
|
12916
|
+
this.chatAdapter.off('messageSent', listener);
|
|
12917
|
+
break;
|
|
12918
|
+
case 'messageRead':
|
|
12919
|
+
this.chatAdapter.off('messageRead', listener);
|
|
12920
|
+
break;
|
|
12921
|
+
case 'error':
|
|
12922
|
+
throw 'on(Error) not implemented yet.';
|
|
12923
|
+
default:
|
|
12924
|
+
throw `Unknown MeetingEvent: ${event}`;
|
|
12925
|
+
}
|
|
12926
|
+
}
|
|
12927
|
+
}
|
|
12928
|
+
/**
|
|
12929
|
+
* Create a meeting adapter backed by Azure Communication services
|
|
12930
|
+
* to plug into the Meeting Composite.
|
|
12931
|
+
*
|
|
12932
|
+
* @beta
|
|
12933
|
+
*/
|
|
12934
|
+
const createAzureCommunicationMeetingAdapter = ({ userId, displayName, credential, endpoint, chatThreadId, callLocator }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
12935
|
+
const callAdapter = yield createAzureCommunicationCallAdapter({
|
|
12936
|
+
userId,
|
|
12937
|
+
displayName,
|
|
12938
|
+
credential,
|
|
12939
|
+
locator: callLocator
|
|
12940
|
+
});
|
|
12941
|
+
const chatAdapter = yield createAzureCommunicationChatAdapter({
|
|
12942
|
+
endpoint,
|
|
12943
|
+
userId,
|
|
12944
|
+
displayName,
|
|
12945
|
+
credential,
|
|
12946
|
+
threadId: chatThreadId
|
|
12947
|
+
});
|
|
12948
|
+
return new AzureCommunicationMeetingAdapter(callAdapter, chatAdapter);
|
|
12949
|
+
});
|
|
12950
|
+
|
|
11917
12951
|
// Copyright (c) Microsoft Corporation.
|
|
11918
12952
|
/**
|
|
11919
12953
|
* Hook to obtain a selector for a specified component.
|
|
@@ -12020,6 +13054,7 @@ exports.ErrorBar = ErrorBar;
|
|
|
12020
13054
|
exports.FluentThemeProvider = FluentThemeProvider;
|
|
12021
13055
|
exports.GridLayout = GridLayout;
|
|
12022
13056
|
exports.LocalizationProvider = LocalizationProvider$1;
|
|
13057
|
+
exports.MeetingComposite = MeetingComposite;
|
|
12023
13058
|
exports.MessageStatusIndicator = MessageStatusIndicator;
|
|
12024
13059
|
exports.MessageThread = MessageThread;
|
|
12025
13060
|
exports.MicrophoneButton = MicrophoneButton;
|
|
@@ -12037,6 +13072,7 @@ exports.createAzureCommunicationCallAdapter = createAzureCommunicationCallAdapte
|
|
|
12037
13072
|
exports.createAzureCommunicationCallAdapterFromClient = createAzureCommunicationCallAdapterFromClient;
|
|
12038
13073
|
exports.createAzureCommunicationChatAdapter = createAzureCommunicationChatAdapter;
|
|
12039
13074
|
exports.createAzureCommunicationChatAdapterFromClient = createAzureCommunicationChatAdapterFromClient;
|
|
13075
|
+
exports.createAzureCommunicationMeetingAdapter = createAzureCommunicationMeetingAdapter;
|
|
12040
13076
|
exports.createDefaultCallingHandlers = createDefaultCallingHandlers;
|
|
12041
13077
|
exports.createDefaultChatHandlers = createDefaultChatHandlers;
|
|
12042
13078
|
exports.createStatefulCallClient = createStatefulCallClient;
|