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

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 (24) hide show
  1. package/dist/communication-react.d.ts +28 -0
  2. package/dist/dist-cjs/communication-react/index.js +69 -4
  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-stateful-client/src/CallClientState.d.ts +25 -0
  7. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js +1 -0
  8. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  9. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +3 -0
  10. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +26 -0
  11. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  12. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +1 -0
  13. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +7 -1
  14. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  15. package/dist/dist-esm/calling-stateful-client/src/Converter.js +5 -1
  16. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  17. package/dist/dist-esm/calling-stateful-client/src/RaiseHandSubscriber.d.ts +17 -0
  18. package/dist/dist-esm/calling-stateful-client/src/RaiseHandSubscriber.js +35 -0
  19. package/dist/dist-esm/calling-stateful-client/src/RaiseHandSubscriber.js.map +1 -0
  20. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.d.ts +2 -0
  21. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
  22. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +1 -0
  23. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  24. 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-202308010015';
182
182
 
183
183
  // Copyright (c) Microsoft Corporation.
184
184
  /**
@@ -1322,7 +1322,6 @@ const deviceManagerDeclaratify = (deviceManager, context, internalContext) => {
1322
1322
  };
1323
1323
 
1324
1324
  // Copyright (c) Microsoft Corporation.
1325
- // Licensed under the MIT license.
1326
1325
  /**
1327
1326
  * Error thrown from failed stateful API methods.
1328
1327
  *
@@ -1494,7 +1493,9 @@ function convertSdkParticipantToDeclarativeParticipant(participant) {
1494
1493
  callEndReason: participant.callEndReason,
1495
1494
  videoStreams: declarativeVideoStreams,
1496
1495
  isMuted: participant.isMuted,
1497
- isSpeaking: participant.isSpeaking
1496
+ isSpeaking: participant.isSpeaking,
1497
+ /* @conditional-compile-remove(raise-hand) */
1498
+ raisedHand: undefined
1498
1499
  };
1499
1500
  }
1500
1501
  /**
@@ -1530,6 +1531,8 @@ function convertSdkCallToDeclarativeCall(call) {
1530
1531
  remoteParticipants: declarativeRemoteParticipants,
1531
1532
  remoteParticipantsEnded: {},
1532
1533
  recording: { isRecordingActive: false },
1534
+ /* @conditional-compile-remove(raise-hand) */
1535
+ raiseHand: { raisedHands: [] },
1533
1536
  transcription: { isTranscriptionActive: false },
1534
1537
  screenShareRemoteParticipant: undefined,
1535
1538
  startTime: new Date(),
@@ -1709,6 +1712,10 @@ class CallContext$2 {
1709
1712
  /* @conditional-compile-remove(optimal-video-count) */
1710
1713
  existingCall.optimalVideoCount.maxRemoteVideoStreams = call.optimalVideoCount.maxRemoteVideoStreams;
1711
1714
  existingCall.recording.isRecordingActive = call.recording.isRecordingActive;
1715
+ /* @conditional-compile-remove(raise-hand) */
1716
+ existingCall.raiseHand.raisedHands = call.raiseHand.raisedHands;
1717
+ /* @conditional-compile-remove(raise-hand) */
1718
+ existingCall.raiseHand.localParticipantRaisedHand = call.raiseHand.localParticipantRaisedHand;
1712
1719
  /* @conditional-compile-remove(rooms) */
1713
1720
  existingCall.role = call.role;
1714
1721
  /* @conditional-compile-remove(total-participant-count) */
@@ -1868,6 +1875,28 @@ class CallContext$2 {
1868
1875
  }
1869
1876
  });
1870
1877
  }
1878
+ /* @conditional-compile-remove(raise-hand) */
1879
+ setCallRaisedHands(callId, raisedHands) {
1880
+ this.modifyState((draft) => {
1881
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
1882
+ if (call) {
1883
+ call.raiseHand.raisedHands = raisedHands;
1884
+ call.raiseHand.localParticipantRaisedHand = raisedHands.find((raisedHand) => toFlatCommunicationIdentifier(raisedHand.identifier) === toFlatCommunicationIdentifier(this._state.userId));
1885
+ }
1886
+ });
1887
+ }
1888
+ /* @conditional-compile-remove(raise-hand) */
1889
+ setParticipantIsRaisedHand(callId, participantKey, raisedHand) {
1890
+ this.modifyState((draft) => {
1891
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
1892
+ if (call) {
1893
+ const participant = call.remoteParticipants[participantKey];
1894
+ if (participant) {
1895
+ participant.raisedHand = raisedHand;
1896
+ }
1897
+ }
1898
+ });
1899
+ }
1871
1900
  setCallTranscriptionActive(callId, isTranscriptionActive) {
1872
1901
  this.modifyState((draft) => {
1873
1902
  const call = draft.calls[this._callIdHistory.latestCallId(callId)];
@@ -3280,6 +3309,38 @@ const latestFromEvent = (args) => ({
3280
3309
  valueType: args.valueType
3281
3310
  });
3282
3311
 
3312
+ // Copyright (c) Microsoft Corporation.
3313
+ /* @conditional-compile-remove(raise-hand) */
3314
+ /**
3315
+ * @private
3316
+ */
3317
+ class RaiseHandSubscriber {
3318
+ constructor(callIdRef, context, raiseHand) {
3319
+ this.subscribe = () => {
3320
+ this._raiseHand.on('raisedHandEvent', this.raisedHand);
3321
+ this._raiseHand.on('loweredHandEvent', this.loweredHand);
3322
+ };
3323
+ this.unsubscribe = () => {
3324
+ this._raiseHand.off('raisedHandEvent', this.raisedHand);
3325
+ this._raiseHand.off('loweredHandEvent', this.loweredHand);
3326
+ };
3327
+ this.raisedHand = () => {
3328
+ this._context.setCallRaisedHands(this._callIdRef.callId, this._raiseHand.getRaisedHands());
3329
+ for (const raisedHand of this._raiseHand.getRaisedHands()) {
3330
+ this._context.setParticipantIsRaisedHand(this._callIdRef.callId, toFlatCommunicationIdentifier(raisedHand.identifier), raisedHand);
3331
+ }
3332
+ };
3333
+ this.loweredHand = (event) => {
3334
+ this.raisedHand();
3335
+ this._context.setParticipantIsRaisedHand(this._callIdRef.callId, toFlatCommunicationIdentifier(event.identifier), undefined);
3336
+ };
3337
+ this._callIdRef = callIdRef;
3338
+ this._context = context;
3339
+ this._raiseHand = raiseHand;
3340
+ this.subscribe();
3341
+ }
3342
+ }
3343
+
3283
3344
  /* @conditional-compile-remove(optimal-video-count) */
3284
3345
  /**
3285
3346
  * Subscribes to a Optimal Video Count Feature events and updates the call context appropriately.
@@ -3364,7 +3425,7 @@ class CallSubscriber {
3364
3425
  }
3365
3426
  };
3366
3427
  this.unsubscribe = () => {
3367
- var _a;
3428
+ var _a, _b;
3368
3429
  this._call.off('stateChanged', this.stateChanged);
3369
3430
  /* @conditional-compile-remove(close-captions) */
3370
3431
  this._call.off('stateChanged', this.initCaptionSubscriber);
@@ -3394,6 +3455,8 @@ class CallSubscriber {
3394
3455
  this._optimalVideoCountSubscriber.unsubscribe();
3395
3456
  /* @conditional-compile-remove(close-captions) */
3396
3457
  (_a = this._captionsSubscriber) === null || _a === void 0 ? void 0 : _a.unsubscribe();
3458
+ /* @conditional-compile-remove(raise-hand) */
3459
+ (_b = this._raiseHandSubscriber) === null || _b === void 0 ? void 0 : _b.unsubscribe();
3397
3460
  /* @conditional-compile-remove(capabilities) */
3398
3461
  this._capabilitiesSubscriber.unsubscribe();
3399
3462
  };
@@ -3489,6 +3552,8 @@ class CallSubscriber {
3489
3552
  this._participantSubscribers = new Map();
3490
3553
  this._recordingSubscriber = new RecordingSubscriber(this._callIdRef, this._context, this._call.feature(communicationCalling.Features.Recording));
3491
3554
  this._transcriptionSubscriber = new TranscriptionSubscriber(this._callIdRef, this._context, this._call.feature(communicationCalling.Features.Transcription));
3555
+ /* @conditional-compile-remove(raise-hand) */
3556
+ this._raiseHandSubscriber = new RaiseHandSubscriber(this._callIdRef, this._context, this._call.feature(communicationCalling.Features.RaiseHand));
3492
3557
  /* @conditional-compile-remove(optimal-video-count) */
3493
3558
  this._optimalVideoCountSubscriber = new OptimalVideoCountSubscriber({
3494
3559
  callIdRef: this._callIdRef,