@azure/communication-react 1.5.1-alpha-202306130014 → 1.5.1-alpha-202306150014

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 (51) hide show
  1. package/dist/communication-react.d.ts +75 -11
  2. package/dist/dist-cjs/communication-react/index.js +161 -29
  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/handlers/createCommonHandlers.d.ts +5 -0
  7. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +36 -0
  8. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  9. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js +1 -1
  10. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -1
  11. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +1 -1
  12. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
  13. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +8 -2
  14. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +1 -1
  15. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +9 -1
  16. package/dist/dist-esm/react-components/src/components/VideoGallery.js +4 -4
  17. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  18. package/dist/dist-esm/react-components/src/components/VideoTile.js +7 -3
  19. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  20. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js +2 -3
  21. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js.map +1 -1
  22. package/dist/dist-esm/react-composites/src/Logger.d.ts +5 -0
  23. package/dist/dist-esm/react-composites/src/Logger.js +8 -0
  24. package/dist/dist-esm/react-composites/src/Logger.js.map +1 -0
  25. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +0 -3
  26. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  27. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +11 -9
  28. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +52 -4
  29. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  30. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +28 -1
  31. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  32. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/OnFetchProfileCallback.js +1 -1
  33. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/OnFetchProfileCallback.js.map +1 -1
  34. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +7 -1
  35. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  36. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +1 -1
  37. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  38. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js +7 -8
  39. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js.map +1 -1
  40. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/TransferPage.styles.d.ts +4 -0
  41. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/TransferPage.styles.js +4 -0
  42. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/TransferPage.styles.js.map +1 -1
  43. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +6 -0
  44. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +19 -0
  45. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  46. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +25 -0
  47. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  48. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +3 -0
  49. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +9 -0
  50. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  51. package/package.json +8 -8
@@ -733,12 +733,39 @@ export declare interface CallAdapterCallOperations {
733
733
  * @remarks
734
734
  * This method is implemented for composite
735
735
  *
736
+ * @deprecated Use {@link disposeRemoteVideoStreamView}, {@link disposeLocalVideoStreamView} and {@link disposeRemoteVideoStreamView} instead.
737
+ *
736
738
  * @param remoteUserId - Id of the participant to render, leave it undefined to dispose the local camera view
737
739
  * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }
738
740
  *
739
741
  * @public
740
742
  */
741
743
  disposeStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void>;
744
+ /**
745
+ * Dispose the html view for a screen share stream
746
+ *
747
+ * @remarks
748
+ * this method is implemented for composite
749
+ *
750
+ * @param remoteUserId - Id of the participant to dispose the screen share stream view for.
751
+ *
752
+ * @public
753
+ */
754
+ disposeScreenShareStreamView(remoteUserId: string): Promise<void>;
755
+ /**
756
+ * Dispose the html view for a remote video stream
757
+ *
758
+ * @param remoteUserId - Id of the participant to dispose
759
+ *
760
+ * @public
761
+ */
762
+ disposeRemoteVideoStreamView(remoteUserId: string): Promise<void>;
763
+ /**
764
+ * Dispose the html view for a local video stream
765
+ *
766
+ * @public
767
+ */
768
+ disposeLocalVideoStreamView(): Promise<void>;
742
769
  /**
743
770
  * Holds the call.
744
771
  *
@@ -2338,6 +2365,31 @@ export declare interface CallWithChatAdapterManagement {
2338
2365
  * @public
2339
2366
  */
2340
2367
  disposeStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void>;
2368
+ /**
2369
+ * Dispose the html view for a screen share stream
2370
+ *
2371
+ * @remarks
2372
+ * this method is implemented for composite
2373
+ *
2374
+ * @param remoteUserId - Id of the participant to dispose the screen share stream view for.
2375
+ *
2376
+ * @public
2377
+ */
2378
+ disposeScreenShareStreamView(remoteUserId: string): Promise<void>;
2379
+ /**
2380
+ * Dispose the html view for a remote video stream
2381
+ *
2382
+ * @param remoteUserId - Id of the participant to dispose
2383
+ *
2384
+ * @public
2385
+ */
2386
+ disposeRemoteVideoStreamView(remoteUserId: string): Promise<void>;
2387
+ /**
2388
+ * Dispose the html view for a local video stream
2389
+ *
2390
+ * @public
2391
+ */
2392
+ disposeLocalVideoStreamView(): Promise<void>;
2341
2393
  /**
2342
2394
  * Ask for permissions of devices.
2343
2395
  *
@@ -3980,6 +4032,12 @@ export declare type CommonCallAdapterOptions = {
3980
4032
  * Default set of background images for background image picker.
3981
4033
  */
3982
4034
  videoBackgroundImages?: VideoBackgroundImage[];
4035
+ /**
4036
+ * Use this to fetch profile information which will override data in {@link CallAdapterState} like display name
4037
+ * The onFetchProfile is fetch-and-forget one time action for each user, once a user profile is updated, the value will be cached
4038
+ * and would not be updated again within the lifecycle of adapter.
4039
+ */
4040
+ onFetchProfile?: OnFetchProfileCallback;
3983
4041
  };
3984
4042
 
3985
4043
  /**
@@ -4085,8 +4143,13 @@ export declare interface CommonCallingHandlers {
4085
4143
  onAddParticipant(participant: PhoneNumberIdentifier, options: AddPhoneNumberOptions): Promise<void>;
4086
4144
  onCreateLocalStreamView: (options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult>;
4087
4145
  onCreateRemoteStreamView: (userId: string, options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult>;
4146
+ /**
4147
+ * @deprecated use {@link onDisposeRemoteVideoStreamView} and {@link onDisposeRemoteScreenShareStreamView} instead.
4148
+ */
4088
4149
  onDisposeRemoteStreamView: (userId: string) => Promise<void>;
4089
4150
  onDisposeLocalStreamView: () => Promise<void>;
4151
+ onDisposeRemoteVideoStreamView: (userId: string) => Promise<void>;
4152
+ onDisposeRemoteScreenShareStreamView: (userId: string) => Promise<void>;
4090
4153
  onSendDtmfTone: (dtmfTone: DtmfTone_2) => Promise<void>;
4091
4154
  onRemoveParticipant(userId: string): Promise<void>;
4092
4155
  onRemoveParticipant(participant: CommunicationIdentifier): Promise<void>;
@@ -4882,7 +4945,7 @@ export declare const createTeamsCallAdapter: ({ userId, credential, locator, opt
4882
4945
  *
4883
4946
  * @beta
4884
4947
  */
4885
- export declare const createTeamsCallAdapterFromClient: (callClient: StatefulCallClient, callAgent: TeamsCallAgent, locator: CallAdapterLocator, options?: TeamsAdapterOptions | undefined) => Promise<TeamsCallAdapter>;
4948
+ export declare const createTeamsCallAdapterFromClient: (callClient: StatefulCallClient, callAgent: TeamsCallAgent, locator: CallAdapterLocator, options?: CommonCallAdapterOptions | undefined) => Promise<TeamsCallAdapter>;
4886
4949
 
4887
4950
  /**
4888
4951
  * Object returned after creating a local or remote VideoStream.
@@ -8462,14 +8525,7 @@ export declare interface SystemMessageCommon extends MessageCommon {
8462
8525
  *
8463
8526
  * @beta
8464
8527
  */
8465
- export declare type TeamsAdapterOptions = {
8466
- /**
8467
- * Use this to fetch profile information which will override data in {@link CallAdapterState} like display name
8468
- * The onFetchProfile is fetch-and-forget one time action for each user, once a user profile is updated, the value will be cached
8469
- * and would not be updated again within the lifecycle of adapter.
8470
- */
8471
- onFetchProfile?: OnFetchProfileCallback;
8472
- } & CommonCallAdapterOptions;
8528
+ export declare type TeamsAdapterOptions = CommonCallAdapterOptions;
8473
8529
 
8474
8530
  /**
8475
8531
  * An Adapter interface specific for Teams identity which extends {@link CommonCallAdapter}.
@@ -8588,7 +8644,7 @@ export declare interface TransferFeature {
8588
8644
  }
8589
8645
 
8590
8646
  /**
8591
- * Callback for {@link CallAdapterSubscribers} 'isCaptionsActiveChanged' event.
8647
+ * Callback for {@link CallAdapterSubscribers} 'transferRequested' event.
8592
8648
  *
8593
8649
  * @beta
8594
8650
  */
@@ -9217,8 +9273,16 @@ export declare interface VideoGalleryProps {
9217
9273
  onCreateRemoteStreamView?: (userId: string, options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult>;
9218
9274
  /** Callback to render a remote video tile */
9219
9275
  onRenderRemoteVideoTile?: (remoteParticipant: VideoGalleryRemoteParticipant) => JSX.Element;
9220
- /** Callback to dispose a remote video stream view */
9276
+ /**
9277
+ * @deprecated use {@link onDisposeRemoteVideoStreamView} and {@link onDisposeRemoteScreenShareStreamView} instead
9278
+ *
9279
+ * Callback to dispose a remote video stream view
9280
+ */
9221
9281
  onDisposeRemoteStreamView?: (userId: string) => Promise<void>;
9282
+ /** Callback to dispose a remote video stream view */
9283
+ onDisposeRemoteVideoStreamView?: (userId: string) => Promise<void>;
9284
+ /** Callback to dispose a remote screen share stream view */
9285
+ onDisposeRemoteScreenShareStreamView?: (userId: string) => Promise<void>;
9222
9286
  /** Callback to render a particpant avatar */
9223
9287
  onRenderAvatar?: OnRenderAvatarCallback;
9224
9288
  /**
@@ -167,7 +167,7 @@ const _toCommunicationIdentifier = (id) => {
167
167
  // Copyright (c) Microsoft Corporation.
168
168
  // Licensed under the MIT license.
169
169
  // GENERATED FILE. DO NOT EDIT MANUALLY.
170
- var telemetryVersion = '1.5.1-alpha-202306130014';
170
+ var telemetryVersion = '1.5.1-alpha-202306150014';
171
171
 
172
172
  // Copyright (c) Microsoft Corporation.
173
173
  /**
@@ -797,6 +797,40 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
797
797
  callClient.disposeView(call.id, participant.identifier, screenShareStream);
798
798
  }
799
799
  });
800
+ const onDisposeRemoteVideoStreamView = (userId) => __awaiter$I(void 0, void 0, void 0, function* () {
801
+ if (!call) {
802
+ return;
803
+ }
804
+ const callState = callClient.getState().calls[call.id];
805
+ if (!callState) {
806
+ throw new Error(`Call Not Found: ${call.id}`);
807
+ }
808
+ const participant = Object.values(callState.remoteParticipants).find((participant) => toFlatCommunicationIdentifier(participant.identifier) === userId);
809
+ if (!participant || !participant.videoStreams) {
810
+ return;
811
+ }
812
+ const remoteVideoStream = Object.values(participant.videoStreams).find((i) => i.mediaStreamType === 'Video');
813
+ if (remoteVideoStream && remoteVideoStream.view) {
814
+ callClient.disposeView(call.id, participant.identifier, remoteVideoStream);
815
+ }
816
+ });
817
+ const onDisposeRemoteScreenShareStreamView = (userId) => __awaiter$I(void 0, void 0, void 0, function* () {
818
+ if (!call) {
819
+ return;
820
+ }
821
+ const callState = callClient.getState().calls[call.id];
822
+ if (!callState) {
823
+ throw new Error(`Call Not Found: ${call.id}`);
824
+ }
825
+ const participant = Object.values(callState.remoteParticipants).find((participant) => toFlatCommunicationIdentifier(participant.identifier) === userId);
826
+ if (!participant || !participant.videoStreams) {
827
+ return;
828
+ }
829
+ const screenShareStream = Object.values(participant.videoStreams).find((i) => i.mediaStreamType === 'ScreenSharing');
830
+ if (screenShareStream && screenShareStream.view) {
831
+ callClient.disposeView(call.id, participant.identifier, screenShareStream);
832
+ }
833
+ });
800
834
  const onDisposeLocalStreamView = () => __awaiter$I(void 0, void 0, void 0, function* () {
801
835
  // If the user is currently in a call, dispose of the local stream view attached to that call.
802
836
  const callState = call && callClient.getState().calls[call.id];
@@ -879,6 +913,8 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
879
913
  onStartLocalVideo,
880
914
  onDisposeRemoteStreamView,
881
915
  onDisposeLocalStreamView,
916
+ onDisposeRemoteScreenShareStreamView,
917
+ onDisposeRemoteVideoStreamView,
882
918
  /* @conditional-compile-remove(PSTN-calls) */
883
919
  onAddParticipant: notImplemented,
884
920
  onRemoveParticipant: notImplemented,
@@ -5424,9 +5460,8 @@ const sendBoxWrapperStyles = react.mergeStyles({
5424
5460
  * @private
5425
5461
  */
5426
5462
  const sendButtonStyle = react.mergeStyles({
5427
- height: '1.25rem',
5428
- width: '1.25rem',
5429
- marginRight: '0.313rem' // 5px
5463
+ height: '2.25rem',
5464
+ width: '2.25rem'
5430
5465
  });
5431
5466
  /**
5432
5467
  * @private
@@ -7245,11 +7280,17 @@ const TextFieldWithMention = (props) => {
7245
7280
  else {
7246
7281
  event.currentTarget.setSelectionRange(mentionTag.plainTextBeginIndex, mentionEndIndex, event.currentTarget.selectionDirection);
7247
7282
  }
7283
+ setSelectionStartValue(mentionTag.plainTextBeginIndex);
7284
+ setSelectionEndValue(mentionEndIndex);
7285
+ }
7286
+ else {
7287
+ // bounds of the mention were selected
7288
+ setSelectionStartValue(event.currentTarget.selectionStart);
7289
+ setSelectionEndValue(event.currentTarget.selectionEnd);
7248
7290
  }
7249
- setSelectionStartValue(mentionTag.plainTextBeginIndex);
7250
- setSelectionEndValue(mentionEndIndex);
7251
7291
  }
7252
7292
  else {
7293
+ // not a mention tag
7253
7294
  setSelectionStartValue(event.currentTarget.selectionStart);
7254
7295
  setSelectionEndValue(nullToUndefined(event.currentTarget.selectionEnd));
7255
7296
  }
@@ -7495,7 +7536,7 @@ const InputBoxComponent = (props) => {
7495
7536
  errorMessage: styles === null || styles === void 0 ? void 0 : styles.systemMessage,
7496
7537
  suffix: {
7497
7538
  backgroundColor: 'transparent',
7498
- padding: props.inlineChildren ? '0 0.25rem' : '0 0'
7539
+ padding: '0 0'
7499
7540
  }
7500
7541
  });
7501
7542
  const mergedChildrenStyle = react.mergeStyles(props.inlineChildren ? {} : newLineButtonsContainerStyle);
@@ -11155,15 +11196,19 @@ const VideoTile = (props) => {
11155
11196
  const [isHovered, setIsHovered] = React.useState(false);
11156
11197
  /* @conditional-compile-remove(pinned-participants) */
11157
11198
  const [isFocused, setIsFocused] = React.useState(false);
11158
- const [personaSize, setPersonaSize] = React.useState();
11199
+ // need to set a default otherwise the resizeObserver will get stuck in an infinite loop.
11200
+ const [personaSize, setPersonaSize] = React.useState(1);
11159
11201
  const videoTileRef = React.useRef(null);
11160
11202
  const locale = useLocale$1();
11161
11203
  const theme = useTheme();
11162
11204
  const isVideoRendered = !!renderElement;
11163
11205
  const observer = React.useRef(new ResizeObserver((entries) => {
11164
11206
  const { width, height } = entries[0].contentRect;
11165
- const personaSize = Math.min(width, height) / 3;
11166
- setPersonaSize(Math.max(Math.min(personaSize, personaMaxSize), personaMinSize));
11207
+ const personaCalcSize = Math.min(width, height) / 3;
11208
+ // we only want to set the persona size if it has changed
11209
+ if (personaCalcSize !== personaSize) {
11210
+ setPersonaSize(Math.max(Math.min(personaCalcSize, personaMaxSize), personaMinSize));
11211
+ }
11167
11212
  }));
11168
11213
  React.useLayoutEffect(() => {
11169
11214
  if (videoTileRef.current) {
@@ -13515,7 +13560,7 @@ const MAX_PINNED_REMOTE_VIDEO_TILES = 4;
13515
13560
  */
13516
13561
  const VideoGallery = (props) => {
13517
13562
  var _a, _b, _c;
13518
- const { localParticipant, remoteParticipants = [], localVideoViewOptions, remoteVideoViewOptions, dominantSpeakers, onRenderLocalVideoTile, onRenderRemoteVideoTile, onCreateLocalStreamView, onDisposeLocalStreamView, onCreateRemoteStreamView, onDisposeRemoteStreamView, styles, layout, onRenderAvatar, showMuteIndicator, maxRemoteVideoStreams = DEFAULT_MAX_REMOTE_VIDEO_STREAMS, showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps,
13563
+ const { localParticipant, remoteParticipants = [], localVideoViewOptions, remoteVideoViewOptions, dominantSpeakers, onRenderLocalVideoTile, onRenderRemoteVideoTile, onCreateLocalStreamView, onDisposeLocalStreamView, onCreateRemoteStreamView, onDisposeRemoteScreenShareStreamView, onDisposeRemoteVideoStreamView, styles, layout, onRenderAvatar, showMuteIndicator, maxRemoteVideoStreams = DEFAULT_MAX_REMOTE_VIDEO_STREAMS, showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps,
13519
13564
  /* @conditional-compile-remove(pinned-participants) */
13520
13565
  onPinParticipant: onPinParticipantHandler,
13521
13566
  /* @conditional-compile-remove(pinned-participants) */
@@ -13633,7 +13678,7 @@ const VideoGallery = (props) => {
13633
13678
  const remoteVideoStream = participant.videoStream;
13634
13679
  /* @conditional-compile-remove(pinned-participants) */
13635
13680
  const isPinned = pinnedParticipants === null || pinnedParticipants === void 0 ? void 0 : pinnedParticipants.includes(participant.userId);
13636
- return (React__default['default'].createElement(_RemoteVideoTile, { key: participant.userId, userId: participant.userId, remoteParticipant: participant, onCreateRemoteStreamView: isVideoParticipant ? onCreateRemoteStreamView : undefined, onDisposeRemoteStreamView: isVideoParticipant ? onDisposeRemoteStreamView : undefined, isAvailable: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.isAvailable : false, isReceiving: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.isReceiving : false, renderElement: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.renderElement : undefined, remoteVideoViewOptions: isVideoParticipant ? remoteVideoViewOptions : undefined, onRenderAvatar: onRenderAvatar, showMuteIndicator: showMuteIndicator, strings: strings,
13681
+ return (React__default['default'].createElement(_RemoteVideoTile, { key: participant.userId, userId: participant.userId, remoteParticipant: participant, onCreateRemoteStreamView: isVideoParticipant ? onCreateRemoteStreamView : undefined, onDisposeRemoteStreamView: isVideoParticipant ? onDisposeRemoteVideoStreamView : undefined, isAvailable: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.isAvailable : false, isReceiving: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.isReceiving : false, renderElement: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.renderElement : undefined, remoteVideoViewOptions: isVideoParticipant ? remoteVideoViewOptions : undefined, onRenderAvatar: onRenderAvatar, showMuteIndicator: showMuteIndicator, strings: strings,
13637
13682
  /* @conditional-compile-remove(PSTN-calls) */
13638
13683
  participantState: participant.state,
13639
13684
  /* @conditional-compile-remove(pinned-participants) */
@@ -13656,7 +13701,7 @@ const VideoGallery = (props) => {
13656
13701
  toggleAnnouncerString: toggleAnnouncerString }));
13657
13702
  }, [
13658
13703
  onCreateRemoteStreamView,
13659
- onDisposeRemoteStreamView,
13704
+ onDisposeRemoteVideoStreamView,
13660
13705
  remoteVideoViewOptions,
13661
13706
  onRenderAvatar,
13662
13707
  showMuteIndicator,
@@ -13670,7 +13715,7 @@ const VideoGallery = (props) => {
13670
13715
  ]);
13671
13716
  const screenShareParticipant = remoteParticipants.find((participant) => { var _a; return (_a = participant.screenShareStream) === null || _a === void 0 ? void 0 : _a.isAvailable; });
13672
13717
  const localScreenShareStreamComponent = React__default['default'].createElement(LocalScreenShare, { localParticipant: localParticipant });
13673
- const remoteScreenShareComponent = screenShareParticipant && (React__default['default'].createElement(RemoteScreenShare, Object.assign({}, screenShareParticipant, { renderElement: (_b = screenShareParticipant.screenShareStream) === null || _b === void 0 ? void 0 : _b.renderElement, onCreateRemoteStreamView: onCreateRemoteStreamView, onDisposeRemoteStreamView: onDisposeRemoteStreamView, isReceiving: (_c = screenShareParticipant.screenShareStream) === null || _c === void 0 ? void 0 : _c.isReceiving })));
13718
+ const remoteScreenShareComponent = screenShareParticipant && (React__default['default'].createElement(RemoteScreenShare, Object.assign({}, screenShareParticipant, { renderElement: (_b = screenShareParticipant.screenShareStream) === null || _b === void 0 ? void 0 : _b.renderElement, onCreateRemoteStreamView: onCreateRemoteStreamView, onDisposeRemoteStreamView: onDisposeRemoteScreenShareStreamView, isReceiving: (_c = screenShareParticipant.screenShareStream) === null || _c === void 0 ? void 0 : _c.isReceiving })));
13674
13719
  const screenShareComponent = remoteScreenShareComponent
13675
13720
  ? remoteScreenShareComponent
13676
13721
  : localParticipant.isScreenSharingOn
@@ -20977,11 +21022,17 @@ const createCompositeHandlers = memoizeOne__default['default']((adapter) => ({
20977
21022
  }
20978
21023
  }),
20979
21024
  onDisposeLocalStreamView: () => __awaiter$e(void 0, void 0, void 0, function* () {
20980
- return adapter.disposeStreamView();
21025
+ return adapter.disposeLocalVideoStreamView();
20981
21026
  }),
20982
21027
  onDisposeRemoteStreamView: (userId) => __awaiter$e(void 0, void 0, void 0, function* () {
20983
21028
  return adapter.disposeStreamView(userId);
20984
21029
  }),
21030
+ onDisposeRemoteScreenShareStreamView: (userId) => __awaiter$e(void 0, void 0, void 0, function* () {
21031
+ return adapter.disposeScreenShareStreamView(userId);
21032
+ }),
21033
+ onDisposeRemoteVideoStreamView: (userId) => __awaiter$e(void 0, void 0, void 0, function* () {
21034
+ return adapter.disposeRemoteVideoStreamView(userId);
21035
+ }),
20985
21036
  /* @conditional-compile-remove(call-readiness) */
20986
21037
  askDevicePermission: (constrain) => __awaiter$e(void 0, void 0, void 0, function* () {
20987
21038
  return adapter.askDevicePermission(constrain);
@@ -24743,7 +24794,7 @@ const CallPage = (props) => {
24743
24794
  increaseFlyoutItemSize: mobileView
24744
24795
  },
24745
24796
  /* @conditional-compile-remove(one-to-n-calling) */
24746
- onFetchAvatarPersonaData: onFetchAvatarPersonaData, mobileView: mobileView, modalLayerHostId: drawerMenuHostId, onRenderGalleryContent: () => _isInCall(callStatus) ? (isNetworkHealthy(networkReconnectTileProps.networkReconnectValue) ? (React__default['default'].createElement(MediaGallery, Object.assign({ isMobile: mobileView }, mediaGalleryProps, mediaGalleryHandlers, { onRenderAvatar: onRenderAvatar, onFetchAvatarPersonaData: onFetchAvatarPersonaData,
24797
+ onFetchAvatarPersonaData: onFetchAvatarPersonaData, mobileView: mobileView, modalLayerHostId: props.modalLayerHostId, onRenderGalleryContent: () => _isInCall(callStatus) ? (isNetworkHealthy(networkReconnectTileProps.networkReconnectValue) ? (React__default['default'].createElement(MediaGallery, Object.assign({ isMobile: mobileView }, mediaGalleryProps, mediaGalleryHandlers, { onRenderAvatar: onRenderAvatar, onFetchAvatarPersonaData: onFetchAvatarPersonaData,
24747
24798
  /* @conditional-compile-remove(pinned-participants) */
24748
24799
  remoteVideoTileMenuOptions: options === null || options === void 0 ? void 0 : options.remoteVideoTileMenu, drawerMenuHostId: drawerMenuHostId,
24749
24800
  /* @conditional-compile-remove(click-to-call) */
@@ -25913,6 +25964,10 @@ const outboundCallStringsTrampoline = (strings) => {
25913
25964
 
25914
25965
  // Copyright (c) Microsoft Corporation.
25915
25966
  // Licensed under the MIT license.
25967
+ /**
25968
+ * @private
25969
+ */
25970
+ const avatarStyles = { opacity: 0.4 };
25916
25971
  /**
25917
25972
  * @private
25918
25973
  */
@@ -25973,17 +26028,16 @@ const TransferPage = (props) => {
25973
26028
  const callControlOptions = props.mobileView
25974
26029
  ? reduceCallControlsForMobile((_a = props.options) === null || _a === void 0 ? void 0 : _a.callControls)
25975
26030
  : (_b = props.options) === null || _b === void 0 ? void 0 : _b.callControls;
26031
+ const transferor = React.useMemo(() => { var _a; return (remoteParticipants ? (_a = Object.values(remoteParticipants)) === null || _a === void 0 ? void 0 : _a[0] : undefined); }, [remoteParticipants]);
26032
+ /* @conditional-compile-remove(call-transfer) */
26033
+ const transferTarget = React.useMemo(() => { var _a; return ((transferCall === null || transferCall === void 0 ? void 0 : transferCall.remoteParticipants) ? (_a = Object.values(transferCall.remoteParticipants)) === null || _a === void 0 ? void 0 : _a[0] : undefined); }, [transferCall]);
25976
26034
  /* @conditional-compile-remove(call-transfer) */
25977
- // page subject is which should be participant shown in the transfer page depending on the transfer call state
25978
26035
  const pageSubject = React.useMemo(() => {
25979
- if (transferCall && ['Ringing', 'Connected'].includes(transferCall.state)) {
26036
+ if (transferCall && (transferTarget === null || transferTarget === void 0 ? void 0 : transferTarget.displayName)) {
25980
26037
  return 'transferTarget';
25981
26038
  }
25982
26039
  return 'transferor';
25983
- }, [transferCall]);
25984
- const transferor = React.useMemo(() => { var _a; return (remoteParticipants ? (_a = Object.values(remoteParticipants)) === null || _a === void 0 ? void 0 : _a[0] : undefined); }, [remoteParticipants]);
25985
- /* @conditional-compile-remove(call-transfer) */
25986
- const transferTarget = React.useMemo(() => { var _a; return ((transferCall === null || transferCall === void 0 ? void 0 : transferCall.remoteParticipants) ? (_a = Object.values(transferCall.remoteParticipants)) === null || _a === void 0 ? void 0 : _a[0] : undefined); }, [transferCall]);
26040
+ }, [transferCall, transferTarget === null || transferTarget === void 0 ? void 0 : transferTarget.displayName]);
25987
26041
  let transferTileParticipant = transferor;
25988
26042
  /* @conditional-compile-remove(call-transfer) */
25989
26043
  if (pageSubject === 'transferTarget') {
@@ -26031,7 +26085,7 @@ const TransferTile = (props) => {
26031
26085
  hidePersonaDetails: true
26032
26086
  }), [userId, initialsName, displayName, personaSize]);
26033
26087
  const defaultOnRenderAvatar = React.useCallback(() => {
26034
- return personaSize ? React__default['default'].createElement(AvatarPersona, Object.assign({}, placeholderOptions, { dataProvider: onFetchAvatarPersonaData })) : React__default['default'].createElement(React__default['default'].Fragment, null);
26088
+ return personaSize ? (React__default['default'].createElement(AvatarPersona, Object.assign({}, placeholderOptions, { dataProvider: onFetchAvatarPersonaData, className: react.mergeStyles(avatarStyles) }))) : (React__default['default'].createElement(React__default['default'].Fragment, null));
26035
26089
  }, [placeholderOptions, onFetchAvatarPersonaData, personaSize]);
26036
26090
  const defaultAvatar = React.useMemo(() => defaultOnRenderAvatar(), [defaultOnRenderAvatar]);
26037
26091
  return (React__default['default'].createElement("div", { ref: tileRef, className: react.mergeStyles(tileContainerStyles), "data-is-focusable": true },
@@ -26430,7 +26484,6 @@ const CallCompositeInner = (props) => {
26430
26484
  // Warning: this is fragile and works because the call arrangement page is only rendered after the call has connected and thus this
26431
26485
  // LayerHost will be guaranteed to have rendered (and subsequently mounted in the DOM). This ensures the DOM element will be available
26432
26486
  // before the call to `document.getElementById(modalLayerHostId)` is made.
26433
- /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) @conditional-compile-remove(call-readiness) */
26434
26487
  React__default['default'].createElement(react.LayerHost, { id: modalLayerHostId, className: react.mergeStyles(modalLayerHostStyle) })))));
26435
26488
  };
26436
26489
  const getQueryOptions = (options) => {
@@ -26444,6 +26497,12 @@ const getQueryOptions = (options) => {
26444
26497
  return { video: true, audio: true };
26445
26498
  };
26446
26499
 
26500
+ // Copyright (c) Microsoft Corporation.
26501
+ /**
26502
+ * @private
26503
+ */
26504
+ const compositeLogger = logger.createClientLogger('communication-react:composite');
26505
+
26447
26506
  /**
26448
26507
  * @private
26449
26508
  */
@@ -26562,8 +26621,8 @@ const createProfileStateModifier = (onFetchProfile, notifyUpdate) => {
26562
26621
  const profile = yield onFetchProfile(key, { displayName: originalParticipants[key].displayName });
26563
26622
  if ((profile === null || profile === void 0 ? void 0 : profile.displayName) && originalParticipants[key].displayName !== (profile === null || profile === void 0 ? void 0 : profile.displayName)) {
26564
26623
  cachedDisplayName[key] = profile === null || profile === void 0 ? void 0 : profile.displayName;
26624
+ shouldNotifyUpdates = true;
26565
26625
  }
26566
- shouldNotifyUpdates = true;
26567
26626
  }
26568
26627
  // notify update only when there is a change, which most likely will trigger modifier and setState again
26569
26628
  shouldNotifyUpdates && notifyUpdate();
@@ -26859,6 +26918,9 @@ class AzureCommunicationCallAdapter {
26859
26918
  this.removeParticipant.bind(this);
26860
26919
  this.createStreamView.bind(this);
26861
26920
  this.disposeStreamView.bind(this);
26921
+ this.disposeScreenShareStreamView.bind(this);
26922
+ this.disposeRemoteVideoStreamView.bind(this);
26923
+ this.disposeLocalVideoStreamView.bind(this);
26862
26924
  this.on.bind(this);
26863
26925
  this.off.bind(this);
26864
26926
  this.processNewCall.bind(this);
@@ -26893,29 +26955,44 @@ class AzureCommunicationCallAdapter {
26893
26955
  }
26894
26956
  queryCameras() {
26895
26957
  return __awaiter$3(this, void 0, void 0, function* () {
26958
+ const startTime = new Date().getTime();
26896
26959
  return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$3(this, void 0, void 0, function* () {
26897
- return this.deviceManager.getCameras();
26960
+ const cameras = yield this.deviceManager.getCameras();
26961
+ const endTime = new Date().getTime();
26962
+ compositeLogger.info('time to query cameras', endTime - startTime, 'ms');
26963
+ return cameras;
26898
26964
  }));
26899
26965
  });
26900
26966
  }
26901
26967
  queryMicrophones() {
26902
26968
  return __awaiter$3(this, void 0, void 0, function* () {
26969
+ const startTime = new Date().getTime();
26903
26970
  return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$3(this, void 0, void 0, function* () {
26904
- return this.deviceManager.getMicrophones();
26971
+ const microphones = yield this.deviceManager.getMicrophones();
26972
+ const endTime = new Date().getTime();
26973
+ compositeLogger.info('time to query microphones', endTime - startTime, 'ms');
26974
+ return microphones;
26905
26975
  }));
26906
26976
  });
26907
26977
  }
26908
26978
  querySpeakers() {
26909
26979
  return __awaiter$3(this, void 0, void 0, function* () {
26980
+ const startTime = new Date().getTime();
26910
26981
  return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$3(this, void 0, void 0, function* () {
26911
- return this.deviceManager.isSpeakerSelectionAvailable ? this.deviceManager.getSpeakers() : [];
26982
+ const speakers = (yield this.deviceManager.isSpeakerSelectionAvailable) ? this.deviceManager.getSpeakers() : [];
26983
+ const endTime = new Date().getTime();
26984
+ compositeLogger.info('time to query speakers', endTime - startTime, 'ms');
26985
+ return speakers;
26912
26986
  }));
26913
26987
  });
26914
26988
  }
26915
26989
  askDevicePermission(constrain) {
26916
26990
  return __awaiter$3(this, void 0, void 0, function* () {
26991
+ const startTime = new Date().getTime();
26917
26992
  return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$3(this, void 0, void 0, function* () {
26918
26993
  yield this.deviceManager.askDevicePermission(constrain);
26994
+ const endTime = new Date().getTime();
26995
+ compositeLogger.info('time to query askDevicePermissions', endTime - startTime, 'ms');
26919
26996
  }));
26920
26997
  });
26921
26998
  }
@@ -26995,6 +27072,21 @@ class AzureCommunicationCallAdapter {
26995
27072
  }
26996
27073
  });
26997
27074
  }
27075
+ disposeScreenShareStreamView(remoteUserId) {
27076
+ return __awaiter$3(this, void 0, void 0, function* () {
27077
+ yield this.handlers.onDisposeRemoteScreenShareStreamView(remoteUserId);
27078
+ });
27079
+ }
27080
+ disposeRemoteVideoStreamView(remoteUserId) {
27081
+ return __awaiter$3(this, void 0, void 0, function* () {
27082
+ yield this.handlers.onDisposeRemoteVideoStreamView(remoteUserId);
27083
+ });
27084
+ }
27085
+ disposeLocalVideoStreamView() {
27086
+ return __awaiter$3(this, void 0, void 0, function* () {
27087
+ yield this.handlers.onDisposeLocalStreamView();
27088
+ });
27089
+ }
26998
27090
  leaveCall(forEveryone) {
26999
27091
  return __awaiter$3(this, void 0, void 0, function* () {
27000
27092
  yield this.handlers.onHangUp(forEveryone);
@@ -27330,7 +27422,19 @@ class AzureCommunicationCallAdapter {
27330
27422
  }
27331
27423
  /* @conditional-compile-remove(call-transfer) */
27332
27424
  transferRequested(args) {
27333
- this.emitter.emit('transferRequested', args);
27425
+ const newArgs = Object.assign(Object.assign({}, args), { accept: (options) => {
27426
+ var _a, _b, _c, _d, _e, _f;
27427
+ const videoSource = (_c = (_b = (_a = this.context.getState().call) === null || _a === void 0 ? void 0 : _a.localVideoStreams) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.source;
27428
+ args.accept({
27429
+ audioOptions: (_d = options === null || options === void 0 ? void 0 : options.audioOptions) !== null && _d !== void 0 ? _d : {
27430
+ muted: !!((_e = this.context.getState().call) === null || _e === void 0 ? void 0 : _e.isMuted)
27431
+ },
27432
+ videoOptions: (_f = options === null || options === void 0 ? void 0 : options.videoOptions) !== null && _f !== void 0 ? _f :
27433
+ /* maintain video state if options.videoOptions is not defined */
27434
+ (videoSource ? { localVideoStreams: [new communicationCalling.LocalVideoStream(videoSource)] } : undefined)
27435
+ });
27436
+ } });
27437
+ this.emitter.emit('transferRequested', newArgs);
27334
27438
  }
27335
27439
  callIdChanged() {
27336
27440
  var _a;
@@ -27780,6 +27884,15 @@ class CallWithChatBackedCallAdapter {
27780
27884
  });
27781
27885
  this.callWithChatAdapter = callWithChatAdapter;
27782
27886
  }
27887
+ disposeScreenShareStreamView(remoteUserId) {
27888
+ return this.callWithChatAdapter.disposeScreenShareStreamView(remoteUserId);
27889
+ }
27890
+ disposeRemoteVideoStreamView(remoteUserId) {
27891
+ return this.callWithChatAdapter.disposeRemoteVideoStreamView(remoteUserId);
27892
+ }
27893
+ disposeLocalVideoStreamView() {
27894
+ return this.callWithChatAdapter.disposeLocalVideoStreamView();
27895
+ }
27783
27896
  /* @conditional-compile-remove(PSTN-calls) */
27784
27897
  addParticipant(participant, options) {
27785
27898
  return __awaiter$2(this, void 0, void 0, function* () {
@@ -28507,6 +28620,7 @@ class AzureCommunicationCallWithChatAdapter {
28507
28620
  this.removeParticipant.bind(this);
28508
28621
  this.createStreamView.bind(this);
28509
28622
  this.disposeStreamView.bind(this);
28623
+ this.disposeScreenShareStreamView.bind(this);
28510
28624
  this.fetchInitialData.bind(this);
28511
28625
  this.sendMessage.bind(this);
28512
28626
  this.sendReadReceipt.bind(this);
@@ -28695,6 +28809,24 @@ class AzureCommunicationCallWithChatAdapter {
28695
28809
  yield this.callAdapter.disposeStreamView(remoteUserId, options);
28696
28810
  });
28697
28811
  }
28812
+ /** Dispose of a remote screen share */
28813
+ disposeScreenShareStreamView(remoteUserId) {
28814
+ return __awaiter(this, void 0, void 0, function* () {
28815
+ yield this.callAdapter.disposeScreenShareStreamView(remoteUserId);
28816
+ });
28817
+ }
28818
+ /** Dispose of a remote video stream */
28819
+ disposeRemoteVideoStreamView(remoteUserId) {
28820
+ return __awaiter(this, void 0, void 0, function* () {
28821
+ yield this.callAdapter.disposeRemoteVideoStreamView(remoteUserId);
28822
+ });
28823
+ }
28824
+ /** Dispose of the local video stream */
28825
+ disposeLocalVideoStreamView() {
28826
+ return __awaiter(this, void 0, void 0, function* () {
28827
+ yield this.callAdapter.disposeLocalVideoStreamView();
28828
+ });
28829
+ }
28698
28830
  /** Fetch initial Call and Chat data such as chat messages. */
28699
28831
  fetchInitialData() {
28700
28832
  return __awaiter(this, void 0, void 0, function* () {