@azure/communication-react 1.7.0-alpha-202307300015 → 1.7.0-alpha-202308020013

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.
Files changed (31) hide show
  1. package/dist/communication-react.d.ts +28 -0
  2. package/dist/dist-cjs/communication-react/index.js +93 -17
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  6. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +5 -0
  7. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +5 -0
  8. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  9. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js +18 -13
  10. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js.map +1 -1
  11. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +25 -0
  12. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js +1 -0
  13. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  14. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +3 -0
  15. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +26 -0
  16. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  17. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +1 -0
  18. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +7 -1
  19. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  20. package/dist/dist-esm/calling-stateful-client/src/Converter.js +5 -1
  21. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  22. package/dist/dist-esm/calling-stateful-client/src/RaiseHandSubscriber.d.ts +17 -0
  23. package/dist/dist-esm/calling-stateful-client/src/RaiseHandSubscriber.js +35 -0
  24. package/dist/dist-esm/calling-stateful-client/src/RaiseHandSubscriber.js.map +1 -0
  25. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.d.ts +2 -0
  26. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
  27. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +1 -0
  28. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  29. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js +3 -2
  30. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js.map +1 -1
  31. package/package.json +8 -8
@@ -82,6 +82,7 @@ import { PersonaSize } from '@fluentui/react';
82
82
  import { PhoneNumberIdentifier } from '@azure/communication-common';
83
83
  import { PhoneNumberKind } from '@azure/communication-common';
84
84
  import { PropertyChangedEvent } from '@azure/communication-calling';
85
+ import { RaisedHand } from '@azure/communication-calling';
85
86
  import { default as React_2 } from 'react';
86
87
  import type { RemoteParticipant } from '@azure/communication-calling';
87
88
  import { RemoteParticipantState as RemoteParticipantState_2 } from '@azure/communication-calling';
@@ -2285,6 +2286,10 @@ export declare interface CallState {
2285
2286
  * Proxy of {@link @azure/communication-calling#RecordingCallFeature}.
2286
2287
  */
2287
2288
  recording: RecordingCallFeature;
2289
+ /**
2290
+ * Proxy of {@link @azure/communication-calling#RaiseHandCallFeature}.
2291
+ */
2292
+ raiseHand: RaiseHandCallFeature;
2288
2293
  /**
2289
2294
  * Stores the currently active screenshare participant's key. If there is no screenshare active, then this will be
2290
2295
  * undefined. You can use this key to access the remoteParticipant data in {@link CallState.remoteParticipants} object.
@@ -8051,6 +8056,23 @@ export declare type Profile = {
8051
8056
  displayName?: string;
8052
8057
  };
8053
8058
 
8059
+ /**
8060
+ * State only version of {@link @azure/communication-calling#RaiseHandCallFeature}. {@link StatefulCallClient} will
8061
+ * automatically listen for raised hands on the call and update the state exposed by {@link StatefulCallClient} accordingly.
8062
+ *
8063
+ * @public
8064
+ */
8065
+ export declare interface RaiseHandCallFeature {
8066
+ /**
8067
+ * Proxy of {@link @azure/communication-calling#RaiseHandCallFeature.raisedHands}.
8068
+ */
8069
+ raisedHands: RaisedHand[];
8070
+ /**
8071
+ * Contains information for local participant from list {@link @azure/communication-calling#RaiseHandCallFeature.raisedHands}.
8072
+ */
8073
+ localParticipantRaisedHand?: RaisedHand;
8074
+ }
8075
+
8054
8076
  /**
8055
8077
  * An array of key value pairs that stores each sender's display name and last read message
8056
8078
  *
@@ -8118,6 +8140,10 @@ export declare interface RemoteParticipantState {
8118
8140
  * Proxy of {@link @azure/communication-calling#RemoteParticipant.role}.
8119
8141
  */
8120
8142
  role?: ParticipantRole;
8143
+ /**
8144
+ * Proxy of {@link @azure/communication-calling#Call.RaisedHand.raisedHands}.
8145
+ */
8146
+ raisedHand?: RaisedHand;
8121
8147
  }
8122
8148
 
8123
8149
  /**
@@ -8462,6 +8488,8 @@ export declare interface SitePermissionsStyles extends BaseCustomStyles {
8462
8488
  * - RemoteVideoStream 'isAvailableChanged'
8463
8489
  * - TranscriptionCallFeature 'isTranscriptionActiveChanged'
8464
8490
  * - RecordingCallFeature 'isRecordingActiveChanged'
8491
+ * - RaiseHandCallFeature 'raisedHandEvent'
8492
+ * - RaiseHandCallFeature 'loweredHandEvent'
8465
8493
  *
8466
8494
  * @public
8467
8495
  */
@@ -178,7 +178,7 @@ const _isValidIdentifier = (identifier) => {
178
178
  // Copyright (c) Microsoft Corporation.
179
179
  // Licensed under the MIT license.
180
180
  // GENERATED FILE. DO NOT EDIT MANUALLY.
181
- var telemetryVersion = '1.7.0-alpha-202307300015';
181
+ var telemetryVersion = '1.7.0-alpha-202308020013';
182
182
 
183
183
  // Copyright (c) Microsoft Corporation.
184
184
  /**
@@ -340,6 +340,11 @@ const getRole = (state, props) => {
340
340
  /* @conditional-compile-remove(rooms) */
341
341
  return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.role;
342
342
  };
343
+ /* @conditional-compile-remove(capabilities) */
344
+ /**
345
+ * @private
346
+ */
347
+ const getCapabilites = (state, props) => { var _a, _b; return (_b = (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.capabilities) === null || _b === void 0 ? void 0 : _b.capabilities; };
343
348
  /**
344
349
  * @private
345
350
  */
@@ -543,10 +548,12 @@ const _isRingingPSTNParticipant = (participant) => {
543
548
  *
544
549
  * @public
545
550
  */
546
- const microphoneButtonSelector = reselect__namespace.createSelector([getCallExists, getIsMuted, getDeviceManager$1, /* @conditional-compile-remove(rooms) */ getRole], (callExists, isMuted, deviceManager, /* @conditional-compile-remove(rooms) */ role) => {
551
+ const microphoneButtonSelector = reselect__namespace.createSelector([getCallExists, getIsMuted, getDeviceManager$1, /* @conditional-compile-remove(capabilities) */ getCapabilites], (callExists, isMuted, deviceManager, /* @conditional-compile-remove(capabilities) */ capabilities) => {
547
552
  const permission = deviceManager.deviceAccess ? deviceManager.deviceAccess.audio : true;
553
+ /* @conditional-compile-remove(capabilities) */
554
+ const incapable = (capabilities === null || capabilities === void 0 ? void 0 : capabilities.muteUnmuteMic.isPresent) === false;
548
555
  return {
549
- disabled: !callExists || !permission || /* @conditional-compile-remove(rooms) */ role === 'Consumer',
556
+ disabled: !callExists || !permission || /* @conditional-compile-remove(capabilities) */ incapable,
550
557
  checked: callExists ? !isMuted : false,
551
558
  microphones: deviceManager.microphones,
552
559
  speakers: deviceManager.speakers,
@@ -559,15 +566,17 @@ const microphoneButtonSelector = reselect__namespace.createSelector([getCallExis
559
566
  *
560
567
  * @public
561
568
  */
562
- const cameraButtonSelector = reselect__namespace.createSelector([getLocalVideoStreams$1, getDeviceManager$1, /* @conditional-compile-remove(rooms) */ getRole], (localVideoStreams, deviceManager, /* @conditional-compile-remove(rooms) */ role) => {
569
+ const cameraButtonSelector = reselect__namespace.createSelector([getLocalVideoStreams$1, getDeviceManager$1, /* @conditional-compile-remove(capabilities) */ getCapabilites], (localVideoStreams, deviceManager, /* @conditional-compile-remove(capabilities) */ capabilities) => {
563
570
  const previewOn = _isPreviewOn(deviceManager);
564
571
  const localVideoFromCall = localVideoStreams === null || localVideoStreams === void 0 ? void 0 : localVideoStreams.find((stream) => stream.mediaStreamType === 'Video');
565
572
  const permission = deviceManager.deviceAccess ? deviceManager.deviceAccess.video : true;
573
+ /* @conditional-compile-remove(capabilities) */
574
+ const incapable = (capabilities === null || capabilities === void 0 ? void 0 : capabilities.turnVideoOnOff.isPresent) === false;
566
575
  return {
567
576
  disabled: !deviceManager.selectedCamera ||
568
577
  !permission ||
569
578
  !deviceManager.cameras.length ||
570
- /* @conditional-compile-remove(rooms) */ role === 'Consumer',
579
+ /* @conditional-compile-remove(capabilities) */ incapable,
571
580
  checked: localVideoStreams !== undefined && localVideoStreams.length > 0 ? !!localVideoFromCall : previewOn,
572
581
  cameras: deviceManager.cameras,
573
582
  selectedCamera: deviceManager.selectedCamera
@@ -581,17 +590,18 @@ const cameraButtonSelector = reselect__namespace.createSelector([getLocalVideoSt
581
590
  const screenShareButtonSelector = reselect__namespace.createSelector([
582
591
  getIsScreenSharingOn,
583
592
  /* @conditional-compile-remove(PSTN-calls) */ getCallState,
584
- /* @conditional-compile-remove(rooms) */ getRole
593
+ /* @conditional-compile-remove(capabilities) */ getCapabilites
585
594
  ], (isScreenSharingOn,
586
595
  /* @conditional-compile-remove(PSTN-calls) */ callState,
587
- /* @conditional-compile-remove(rooms) */ role) => {
588
- var _a;
596
+ /* @conditional-compile-remove(capabilities) */ capabilities) => {
597
+ let disabled = undefined;
598
+ /* @conditional-compile-remove(capabilities) */
599
+ disabled = disabled || (capabilities === null || capabilities === void 0 ? void 0 : capabilities.shareScreen.isPresent) === false;
600
+ /* @conditional-compile-remove(PSTN-calls) */
601
+ disabled = disabled || ['InLobby', 'Connecting'].includes(callState);
589
602
  return {
590
603
  checked: isScreenSharingOn,
591
- /* @conditional-compile-remove(PSTN-calls) */
592
- disabled: (callState === 'InLobby' ? true : (_a = callState === 'Connecting') !== null && _a !== void 0 ? _a : false) ||
593
- /* @conditional-compile-remove(rooms) */ role === 'Consumer' ||
594
- /* @conditional-compile-remove(rooms) */ role === 'Attendee'
604
+ disabled
595
605
  };
596
606
  });
597
607
  /**
@@ -1322,7 +1332,6 @@ const deviceManagerDeclaratify = (deviceManager, context, internalContext) => {
1322
1332
  };
1323
1333
 
1324
1334
  // Copyright (c) Microsoft Corporation.
1325
- // Licensed under the MIT license.
1326
1335
  /**
1327
1336
  * Error thrown from failed stateful API methods.
1328
1337
  *
@@ -1494,7 +1503,9 @@ function convertSdkParticipantToDeclarativeParticipant(participant) {
1494
1503
  callEndReason: participant.callEndReason,
1495
1504
  videoStreams: declarativeVideoStreams,
1496
1505
  isMuted: participant.isMuted,
1497
- isSpeaking: participant.isSpeaking
1506
+ isSpeaking: participant.isSpeaking,
1507
+ /* @conditional-compile-remove(raise-hand) */
1508
+ raisedHand: undefined
1498
1509
  };
1499
1510
  }
1500
1511
  /**
@@ -1530,6 +1541,8 @@ function convertSdkCallToDeclarativeCall(call) {
1530
1541
  remoteParticipants: declarativeRemoteParticipants,
1531
1542
  remoteParticipantsEnded: {},
1532
1543
  recording: { isRecordingActive: false },
1544
+ /* @conditional-compile-remove(raise-hand) */
1545
+ raiseHand: { raisedHands: [] },
1533
1546
  transcription: { isTranscriptionActive: false },
1534
1547
  screenShareRemoteParticipant: undefined,
1535
1548
  startTime: new Date(),
@@ -1709,6 +1722,10 @@ class CallContext$2 {
1709
1722
  /* @conditional-compile-remove(optimal-video-count) */
1710
1723
  existingCall.optimalVideoCount.maxRemoteVideoStreams = call.optimalVideoCount.maxRemoteVideoStreams;
1711
1724
  existingCall.recording.isRecordingActive = call.recording.isRecordingActive;
1725
+ /* @conditional-compile-remove(raise-hand) */
1726
+ existingCall.raiseHand.raisedHands = call.raiseHand.raisedHands;
1727
+ /* @conditional-compile-remove(raise-hand) */
1728
+ existingCall.raiseHand.localParticipantRaisedHand = call.raiseHand.localParticipantRaisedHand;
1712
1729
  /* @conditional-compile-remove(rooms) */
1713
1730
  existingCall.role = call.role;
1714
1731
  /* @conditional-compile-remove(total-participant-count) */
@@ -1868,6 +1885,28 @@ class CallContext$2 {
1868
1885
  }
1869
1886
  });
1870
1887
  }
1888
+ /* @conditional-compile-remove(raise-hand) */
1889
+ setCallRaisedHands(callId, raisedHands) {
1890
+ this.modifyState((draft) => {
1891
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
1892
+ if (call) {
1893
+ call.raiseHand.raisedHands = raisedHands;
1894
+ call.raiseHand.localParticipantRaisedHand = raisedHands.find((raisedHand) => toFlatCommunicationIdentifier(raisedHand.identifier) === toFlatCommunicationIdentifier(this._state.userId));
1895
+ }
1896
+ });
1897
+ }
1898
+ /* @conditional-compile-remove(raise-hand) */
1899
+ setParticipantIsRaisedHand(callId, participantKey, raisedHand) {
1900
+ this.modifyState((draft) => {
1901
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
1902
+ if (call) {
1903
+ const participant = call.remoteParticipants[participantKey];
1904
+ if (participant) {
1905
+ participant.raisedHand = raisedHand;
1906
+ }
1907
+ }
1908
+ });
1909
+ }
1871
1910
  setCallTranscriptionActive(callId, isTranscriptionActive) {
1872
1911
  this.modifyState((draft) => {
1873
1912
  const call = draft.calls[this._callIdHistory.latestCallId(callId)];
@@ -3280,6 +3319,38 @@ const latestFromEvent = (args) => ({
3280
3319
  valueType: args.valueType
3281
3320
  });
3282
3321
 
3322
+ // Copyright (c) Microsoft Corporation.
3323
+ /* @conditional-compile-remove(raise-hand) */
3324
+ /**
3325
+ * @private
3326
+ */
3327
+ class RaiseHandSubscriber {
3328
+ constructor(callIdRef, context, raiseHand) {
3329
+ this.subscribe = () => {
3330
+ this._raiseHand.on('raisedHandEvent', this.raisedHand);
3331
+ this._raiseHand.on('loweredHandEvent', this.loweredHand);
3332
+ };
3333
+ this.unsubscribe = () => {
3334
+ this._raiseHand.off('raisedHandEvent', this.raisedHand);
3335
+ this._raiseHand.off('loweredHandEvent', this.loweredHand);
3336
+ };
3337
+ this.raisedHand = () => {
3338
+ this._context.setCallRaisedHands(this._callIdRef.callId, this._raiseHand.getRaisedHands());
3339
+ for (const raisedHand of this._raiseHand.getRaisedHands()) {
3340
+ this._context.setParticipantIsRaisedHand(this._callIdRef.callId, toFlatCommunicationIdentifier(raisedHand.identifier), raisedHand);
3341
+ }
3342
+ };
3343
+ this.loweredHand = (event) => {
3344
+ this.raisedHand();
3345
+ this._context.setParticipantIsRaisedHand(this._callIdRef.callId, toFlatCommunicationIdentifier(event.identifier), undefined);
3346
+ };
3347
+ this._callIdRef = callIdRef;
3348
+ this._context = context;
3349
+ this._raiseHand = raiseHand;
3350
+ this.subscribe();
3351
+ }
3352
+ }
3353
+
3283
3354
  /* @conditional-compile-remove(optimal-video-count) */
3284
3355
  /**
3285
3356
  * Subscribes to a Optimal Video Count Feature events and updates the call context appropriately.
@@ -3364,7 +3435,7 @@ class CallSubscriber {
3364
3435
  }
3365
3436
  };
3366
3437
  this.unsubscribe = () => {
3367
- var _a;
3438
+ var _a, _b;
3368
3439
  this._call.off('stateChanged', this.stateChanged);
3369
3440
  /* @conditional-compile-remove(close-captions) */
3370
3441
  this._call.off('stateChanged', this.initCaptionSubscriber);
@@ -3394,6 +3465,8 @@ class CallSubscriber {
3394
3465
  this._optimalVideoCountSubscriber.unsubscribe();
3395
3466
  /* @conditional-compile-remove(close-captions) */
3396
3467
  (_a = this._captionsSubscriber) === null || _a === void 0 ? void 0 : _a.unsubscribe();
3468
+ /* @conditional-compile-remove(raise-hand) */
3469
+ (_b = this._raiseHandSubscriber) === null || _b === void 0 ? void 0 : _b.unsubscribe();
3397
3470
  /* @conditional-compile-remove(capabilities) */
3398
3471
  this._capabilitiesSubscriber.unsubscribe();
3399
3472
  };
@@ -3489,6 +3562,8 @@ class CallSubscriber {
3489
3562
  this._participantSubscribers = new Map();
3490
3563
  this._recordingSubscriber = new RecordingSubscriber(this._callIdRef, this._context, this._call.feature(communicationCalling.Features.Recording));
3491
3564
  this._transcriptionSubscriber = new TranscriptionSubscriber(this._callIdRef, this._context, this._call.feature(communicationCalling.Features.Transcription));
3565
+ /* @conditional-compile-remove(raise-hand) */
3566
+ this._raiseHandSubscriber = new RaiseHandSubscriber(this._callIdRef, this._context, this._call.feature(communicationCalling.Features.RaiseHand));
3492
3567
  /* @conditional-compile-remove(optimal-video-count) */
3493
3568
  this._optimalVideoCountSubscriber = new OptimalVideoCountSubscriber({
3494
3569
  callIdRef: this._callIdRef,
@@ -21993,8 +22068,9 @@ const ScreenShare = (props) => {
21993
22068
  /* @conditional-compile-remove(rooms) */
21994
22069
  const isRoomsCall = adapter.getState().isRoomsCall;
21995
22070
  const screenShareButtonDisabled = () => {
21996
- /* @conditional-compile-remove(PSTN-calls) */
21997
- return (screenShareButtonProps === null || screenShareButtonProps === void 0 ? void 0 : screenShareButtonProps.disabled) ? screenShareButtonProps.disabled : isDisabled(props.option);
22071
+ var _a;
22072
+ /* @conditional-compile-remove(capabilities) */ /* @conditional-compile-remove(PSTN-calls) */
22073
+ return (_a = screenShareButtonProps === null || screenShareButtonProps === void 0 ? void 0 : screenShareButtonProps.disabled) !== null && _a !== void 0 ? _a : isDisabled(props.option);
21998
22074
  };
21999
22075
  return (React__default['default'].createElement(ScreenShareButton, Object.assign({ "data-ui-id": "call-composite-screenshare-button" }, screenShareButtonProps, { showLabel: props.displayType !== 'compact', disabled: screenShareButtonDisabled() ||
22000
22076
  props.disabled ||