@azure/communication-react 1.20.0-alpha-202409180015 → 1.20.0-alpha-202409200015
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/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-BNTuqeiU.js → ChatMessageComponentAsRichTextEditBox-Bi4D1IU3.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-BNTuqeiU.js.map → ChatMessageComponentAsRichTextEditBox-Bi4D1IU3.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CSJWlyJL.js → RichTextSendBoxWrapper-C__3v7Bo.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CSJWlyJL.js.map → RichTextSendBoxWrapper-C__3v7Bo.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-DOldSEkK.js → index-DHcnNHhY.js} +50 -59
- package/dist/dist-cjs/communication-react/index-DHcnNHhY.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +0 -2
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +3 -10
- package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +2 -6
- package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +2 -10
- package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js +0 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +4 -0
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +31 -9
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.js +0 -1
- package/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/Converter.js +0 -4
- package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantList.js +2 -5
- package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +4 -9
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
- package/package.json +1 -1
- package/dist/dist-cjs/communication-react/index-DOldSEkK.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CallSubscriber.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/CallSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,QAAQ,EAAuC,MAAM,8BAA8B,CAAC;AAC7F,OAAO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AA6B,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC7E,MAAM,qBAAqB,GAAG,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC/E,IAAI,qBAAqB,EAAE,CAAC;YAC1B,qBAAqB,CAAC,WAAW,EAAE,CAAC;YACpC,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;CA0JF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Features, LocalVideoStream, RemoteParticipant } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { CallCommon } from './BetaToStableTypes';\nimport { CallContext } from './CallContext';\nimport { CallIdRef } from './CallIdRef';\nimport { CaptionsFeatureSubscriber } from './CaptionsSubscriber';\nimport {\n convertSdkLocalStreamToDeclarativeLocalStream,\n convertSdkParticipantToDeclarativeParticipant\n} from './Converter';\nimport { InternalCallContext } from './InternalCallContext';\n\nimport { LocalVideoStreamVideoEffectsSubscriber } from './LocalVideoStreamVideoEffectsSubscriber';\nimport { ParticipantSubscriber } from './ParticipantSubscriber';\nimport { RecordingSubscriber } from './RecordingSubscriber';\nimport { PPTLiveSubscriber } from './PPTLiveSubscriber';\nimport { disposeView } from './StreamUtils';\nimport { TranscriptionSubscriber } from './TranscriptionSubscriber';\nimport { UserFacingDiagnosticsSubscriber } from './UserFacingDiagnosticsSubscriber';\nimport { RaiseHandSubscriber } from './RaiseHandSubscriber';\nimport { OptimalVideoCountSubscriber } from './OptimalVideoCountSubscriber';\n\nimport { CapabilitiesSubscriber } from './CapabilitiesSubscriber';\nimport { ReactionSubscriber } from './ReactionSubscriber';\nimport { SpotlightSubscriber } from './SpotlightSubscriber';\n/* @conditional-compile-remove(local-recording-notification) */\nimport { LocalRecordingSubscriber } from './LocalRecordingSubscriber';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { BreakoutRoomsSubscriber } from './BreakoutRoomsSubscriber';\n\n/**\n * Keeps track of the listeners assigned to a particular call because when we get an event from SDK, it doesn't tell us\n * which call it is for. If we keep track of this then we know which call in the state that needs an update and also\n * which property of that call. Also we can use this when unregistering to a call.\n */\nexport class CallSubscriber {\n private _call: CallCommon;\n private _callIdRef: CallIdRef;\n private _context: CallContext;\n private _internalContext: InternalCallContext;\n\n private _diagnosticsSubscriber: UserFacingDiagnosticsSubscriber;\n private _participantSubscribers: Map<string, ParticipantSubscriber>;\n private _recordingSubscriber: RecordingSubscriber;\n private _transcriptionSubscriber: TranscriptionSubscriber;\n /* @conditional-compile-remove(local-recording-notification) */\n private _localRecordingSubscriber?: LocalRecordingSubscriber;\n private _pptLiveSubscriber: PPTLiveSubscriber;\n private _optimalVideoCountSubscriber: OptimalVideoCountSubscriber;\n private _CaptionsFeatureSubscriber?: CaptionsFeatureSubscriber;\n private _raiseHandSubscriber?: RaiseHandSubscriber;\n private _reactionSubscriber?: ReactionSubscriber;\n\n private _localVideoStreamVideoEffectsSubscribers: Map<string, LocalVideoStreamVideoEffectsSubscriber>;\n\n private _capabilitiesSubscriber: CapabilitiesSubscriber;\n private _spotlightSubscriber: SpotlightSubscriber;\n /* @conditional-compile-remove(breakout-rooms) */\n private _breakoutRoomsSubscriber: BreakoutRoomsSubscriber;\n\n constructor(call: CallCommon, context: CallContext, internalContext: InternalCallContext) {\n this._call = call;\n this._callIdRef = { callId: call.id };\n this._context = context;\n this._internalContext = internalContext;\n\n this._diagnosticsSubscriber = new UserFacingDiagnosticsSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.UserFacingDiagnostics)\n );\n this._participantSubscribers = new Map<string, ParticipantSubscriber>();\n this._recordingSubscriber = new RecordingSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Recording)\n );\n this._pptLiveSubscriber = new PPTLiveSubscriber(this._callIdRef, this._context, this._call);\n this._transcriptionSubscriber = new TranscriptionSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Transcription)\n );\n this._raiseHandSubscriber = new RaiseHandSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.RaiseHand)\n );\n this._reactionSubscriber = new ReactionSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Reaction)\n );\n this._optimalVideoCountSubscriber = new OptimalVideoCountSubscriber({\n callIdRef: this._callIdRef,\n context: this._context,\n localOptimalVideoCountFeature: this._call.feature(Features.OptimalVideoCount)\n });\n\n this._localVideoStreamVideoEffectsSubscribers = new Map();\n\n this._capabilitiesSubscriber = new CapabilitiesSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Capabilities)\n );\n\n this._spotlightSubscriber = new SpotlightSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Spotlight)\n );\n /* @conditional-compile-remove(breakout-rooms) */\n this._breakoutRoomsSubscriber = new BreakoutRoomsSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.BreakoutRooms)\n );\n\n this.subscribe();\n }\n\n private subscribe = (): void => {\n this._call.on('stateChanged', this.stateChanged);\n this._call.on('stateChanged', this.initCaptionSubscriber);\n this._call.on('stateChanged', this.initTeamsMeetingConference);\n /* @conditional-compile-remove(local-recording-notification) */\n this._call.on('stateChanged', this.initLocalRecordingNotificationSubscriber);\n this._call.on('idChanged', this.idChanged);\n this._call.on('isScreenSharingOnChanged', this.isScreenSharingOnChanged);\n this._call.on('remoteParticipantsUpdated', this.remoteParticipantsUpdated);\n this._call.on('localVideoStreamsUpdated', this.localVideoStreamsUpdated);\n this._call.on('isMutedChanged', this.isMuteChanged);\n this._call.on('roleChanged', this.callRoleChangedHandler);\n this._call.feature(Features.DominantSpeakers).on('dominantSpeakersChanged', this.dominantSpeakersChanged);\n /* @conditional-compile-remove(total-participant-count) */\n this._call.on('totalParticipantCountChanged', this.totalParticipantCountChangedHandler);\n /* @conditional-compile-remove(soft-mute) */\n this._call.on('mutedByOthers', this.mutedByOthersHandler);\n\n for (const localVideoStream of this._call.localVideoStreams) {\n this._internalContext.setLocalRenderInfo(\n this._callIdRef.callId,\n localVideoStream.mediaStreamType,\n localVideoStream,\n 'NotRendered',\n undefined\n );\n }\n\n if (this._call.remoteParticipants.length > 0) {\n this._call.remoteParticipants.forEach((participant: RemoteParticipant) => {\n this.addParticipantListener(participant);\n });\n\n this._context.setCallRemoteParticipants(\n this._callIdRef.callId,\n this._call.remoteParticipants.map(convertSdkParticipantToDeclarativeParticipant),\n []\n );\n }\n };\n\n public unsubscribe = (): void => {\n this._call.off('stateChanged', this.stateChanged);\n this._call.off('stateChanged', this.initCaptionSubscriber);\n /* @conditional-compile-remove(local-recording-notification) */\n this._call.off('stateChanged', this.initLocalRecordingNotificationSubscriber);\n\n this._call.off('stateChanged', this.initTeamsMeetingConference);\n this._call.off('idChanged', this.idChanged);\n this._call.off('isScreenSharingOnChanged', this.isScreenSharingOnChanged);\n this._call.off('remoteParticipantsUpdated', this.remoteParticipantsUpdated);\n this._call.off('localVideoStreamsUpdated', this.localVideoStreamsUpdated);\n this._call.off('isMutedChanged', this.isMuteChanged);\n this._call.off('roleChanged', this.callRoleChangedHandler);\n /* @conditional-compile-remove(total-participant-count) */\n this._call.off('totalParticipantCountChanged', this.totalParticipantCountChangedHandler);\n /* @conditional-compile-remove(soft-mute) */\n this._call.off('mutedByOthers', this.mutedByOthersHandler);\n\n this._participantSubscribers.forEach((participantSubscriber: ParticipantSubscriber) => {\n participantSubscriber.unsubscribe();\n });\n this._participantSubscribers.clear();\n\n // If we are unsubscribing that means we no longer want to display any video for this call (callEnded or callAgent\n // disposed) and we should not be updating it any more. So if video is rendering we stop rendering.\n for (const localVideoStream of this._call.localVideoStreams) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n disposeView(\n this._context,\n this._internalContext,\n this._callIdRef.callId,\n undefined,\n convertSdkLocalStreamToDeclarativeLocalStream(localVideoStream)\n );\n this._internalContext.deleteLocalRenderInfo(this._callIdRef.callId, mediaStreamType);\n }\n\n this._diagnosticsSubscriber.unsubscribe();\n this._recordingSubscriber.unsubscribe();\n this._transcriptionSubscriber.unsubscribe();\n /* @conditional-compile-remove(local-recording-notification) */\n this._localRecordingSubscriber?.unsubscribe();\n this._optimalVideoCountSubscriber.unsubscribe();\n this._pptLiveSubscriber.unsubscribe();\n this._CaptionsFeatureSubscriber?.unsubscribe();\n this._raiseHandSubscriber?.unsubscribe();\n\n this._capabilitiesSubscriber.unsubscribe();\n this._reactionSubscriber?.unsubscribe();\n this._spotlightSubscriber.unsubscribe();\n /* @conditional-compile-remove(breakout-rooms) */\n this._breakoutRoomsSubscriber.unsubscribe();\n };\n\n private addParticipantListener(participant: RemoteParticipant): void {\n const participantKey = toFlatCommunicationIdentifier(participant.identifier);\n this._participantSubscribers.get(participantKey)?.unsubscribe();\n this._participantSubscribers.set(\n participantKey,\n new ParticipantSubscriber(this._callIdRef, participant, this._context, this._internalContext)\n );\n }\n\n private removeParticipantListener(participant: RemoteParticipant): void {\n const participantKey = toFlatCommunicationIdentifier(participant.identifier);\n const participantSubscriber = this._participantSubscribers.get(participantKey);\n if (participantSubscriber) {\n participantSubscriber.unsubscribe();\n this._participantSubscribers.delete(participantKey);\n }\n }\n\n private stateChanged = (): void => {\n this._context.setCallState(this._callIdRef.callId, this._call.state);\n };\n\n private initCaptionSubscriber = (): void => {\n // subscribe to captions here so that we don't call captions when call is not initialized\n if (this._call.state === 'Connected' && !this._CaptionsFeatureSubscriber) {\n this._CaptionsFeatureSubscriber = new CaptionsFeatureSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Captions)\n );\n this._call.off('stateChanged', this.initCaptionSubscriber);\n }\n };\n\n private initTeamsMeetingConference = (): void => {\n if (this._call.state === 'Connected') {\n this._call\n .feature(Features.TeamsMeetingAudioConferencing)\n .getTeamsMeetingAudioConferencingDetails()\n .then((teamsMeetingConferenceDetails) => {\n this._context.setTeamsMeetingConference(this._callIdRef.callId, teamsMeetingConferenceDetails);\n });\n this._call.off('stateChanged', this.initTeamsMeetingConference);\n }\n };\n\n /* @conditional-compile-remove(local-recording-notification) */\n private initLocalRecordingNotificationSubscriber = (): void => {\n // Subscribe to LocalRecordingFeature as it is only available in interop scenarios\n // Will throw an error if not in interop scenarios\n if (this._call.state === 'Connected' && this._call.kind === 'TeamsCall' && !this._localRecordingSubscriber) {\n this._localRecordingSubscriber = new LocalRecordingSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.LocalRecording)\n );\n this._call.off('stateChanged', this.initLocalRecordingNotificationSubscriber);\n }\n };\n\n private idChanged = (): void => {\n this._internalContext.setCallId(this._call.id, this._callIdRef.callId);\n this._context.setCallId(this._call.id, this._callIdRef.callId);\n this._callIdRef.callId = this._call.id;\n };\n\n private isScreenSharingOnChanged = (): void => {\n this._context.setCallIsScreenSharingOn(this._callIdRef.callId, this._call.isScreenSharingOn);\n };\n\n private isMuteChanged = (): void => {\n this._context.setCallIsMicrophoneMuted(this._callIdRef.callId, this._call.isMuted);\n };\n\n private callRoleChangedHandler = (): void => {\n this._context.setRole(this._callIdRef.callId, this._call.role);\n };\n\n /* @conditional-compile-remove(total-participant-count) */\n private totalParticipantCountChangedHandler = (): void => {\n this._context.setTotalParticipantCount(this._callIdRef.callId, this._call.totalParticipantCount);\n };\n\n // TODO: Tee to notification state once available\n /* @conditional-compile-remove(soft-mute) */\n private mutedByOthersHandler = (): void => {\n this._context.teeErrorToState(\n { name: 'mutedByOthers', message: 'Muted by another participant' },\n 'Call.mutedByOthers'\n );\n };\n\n private remoteParticipantsUpdated = (event: { added: RemoteParticipant[]; removed: RemoteParticipant[] }): void => {\n event.added.forEach((participant: RemoteParticipant) => {\n this.addParticipantListener(participant);\n });\n event.removed.forEach((participant: RemoteParticipant) => {\n this.removeParticipantListener(participant);\n });\n\n // Remove any added participants from remoteParticipantsEnded if they are there and add any removed participants to\n // remoteParticipantsEnded.\n this._context.setCallRemoteParticipantsEnded(\n this._callIdRef.callId,\n event.removed.map(convertSdkParticipantToDeclarativeParticipant),\n event.added.map((participant: RemoteParticipant) => {\n return toFlatCommunicationIdentifier(participant.identifier);\n })\n );\n\n // Add added participants to remoteParticipants and remove removed participants from remoteParticipants.\n this._context.setCallRemoteParticipants(\n this._callIdRef.callId,\n event.added.map(convertSdkParticipantToDeclarativeParticipant),\n event.removed.map((participant: RemoteParticipant) => {\n return toFlatCommunicationIdentifier(participant.identifier);\n })\n );\n };\n\n private localVideoStreamsUpdated = (event: { added: LocalVideoStream[]; removed: LocalVideoStream[] }): void => {\n for (const localVideoStream of event.added) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n // IMPORTANT: The internalContext should be set before context. This is done to ensure that the internal context\n // has the required data when component re-renders due to external state changes.\n this._internalContext.setLocalRenderInfo(\n this._callIdRef.callId,\n mediaStreamType,\n localVideoStream,\n 'NotRendered',\n undefined\n );\n\n // Subscribe to video effect changes\n this._localVideoStreamVideoEffectsSubscribers.get(mediaStreamType)?.unsubscribe();\n this._localVideoStreamVideoEffectsSubscribers.set(\n mediaStreamType,\n new LocalVideoStreamVideoEffectsSubscriber({\n parent: this._callIdRef,\n context: this._context,\n localVideoStream: localVideoStream,\n localVideoStreamEffectsAPI: localVideoStream.feature(Features.VideoEffects)\n })\n );\n }\n for (const localVideoStream of event.removed) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n this._localVideoStreamVideoEffectsSubscribers.get(mediaStreamType)?.unsubscribe();\n disposeView(\n this._context,\n this._internalContext,\n this._callIdRef.callId,\n undefined,\n convertSdkLocalStreamToDeclarativeLocalStream(localVideoStream)\n );\n\n this._internalContext.deleteLocalRenderInfo(this._callIdRef.callId, mediaStreamType);\n }\n\n this._context.setCallLocalVideoStream(\n this._callIdRef.callId,\n event.added.map(convertSdkLocalStreamToDeclarativeLocalStream),\n event.removed.map(convertSdkLocalStreamToDeclarativeLocalStream)\n );\n };\n\n private dominantSpeakersChanged = (): void => {\n const dominantSpeakers = this._call.feature(Features.DominantSpeakers).dominantSpeakers;\n this._context.setCallDominantSpeakers(this._callIdRef.callId, dominant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QAAQ,EACb,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAC3C,CAAC;QAEF,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IA6GD,2GAA2G;IAC3G,yGAAyG;IACzG,wGAAwG;IACxG,yGAAyG;IACjG,cAAc,CAAC,UAAsB;QAC3C,IAAI,CAAC;YACH,UAAU,EAAE,CAAC;QACf,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAU,EAAE,SAAS,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;IAEO,sBAAsB,CAAC,WAA8B;;QAC3D,MAAM,cAAc,GAAG,6BAA6B,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC7E,MAAA,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,0CAAE,WAAW,EAAE,CAAC;QAChE,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAC9B,cAAc,EACd,IAAI,qBAAqB,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAC9F,CAAC;IACJ,CAAC;IAEO,yBAAyB,CAAC,WAA8B;QAC9D,MAAM,cAAc,GAAG,6BAA6B,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC7E,MAAM,qBAAqB,GAAG,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC/E,IAAI,qBAAqB,EAAE,CAAC;YAC1B,qBAAqB,CAAC,WAAW,EAAE,CAAC;YACpC,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;CA0JF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Features, LocalVideoStream, RemoteParticipant } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { CallCommon } from './BetaToStableTypes';\nimport { CallContext } from './CallContext';\nimport { CallIdRef } from './CallIdRef';\nimport { CaptionsFeatureSubscriber } from './CaptionsSubscriber';\nimport {\n convertSdkLocalStreamToDeclarativeLocalStream,\n convertSdkParticipantToDeclarativeParticipant\n} from './Converter';\nimport { InternalCallContext } from './InternalCallContext';\n\nimport { LocalVideoStreamVideoEffectsSubscriber } from './LocalVideoStreamVideoEffectsSubscriber';\nimport { ParticipantSubscriber } from './ParticipantSubscriber';\nimport { RecordingSubscriber } from './RecordingSubscriber';\nimport { PPTLiveSubscriber } from './PPTLiveSubscriber';\nimport { disposeView } from './StreamUtils';\nimport { TranscriptionSubscriber } from './TranscriptionSubscriber';\nimport { UserFacingDiagnosticsSubscriber } from './UserFacingDiagnosticsSubscriber';\nimport { RaiseHandSubscriber } from './RaiseHandSubscriber';\nimport { OptimalVideoCountSubscriber } from './OptimalVideoCountSubscriber';\n\nimport { CapabilitiesSubscriber } from './CapabilitiesSubscriber';\nimport { ReactionSubscriber } from './ReactionSubscriber';\nimport { SpotlightSubscriber } from './SpotlightSubscriber';\n/* @conditional-compile-remove(local-recording-notification) */\nimport { LocalRecordingSubscriber } from './LocalRecordingSubscriber';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { BreakoutRoomsSubscriber } from './BreakoutRoomsSubscriber';\n\n/**\n * Keeps track of the listeners assigned to a particular call because when we get an event from SDK, it doesn't tell us\n * which call it is for. If we keep track of this then we know which call in the state that needs an update and also\n * which property of that call. Also we can use this when unregistering to a call.\n */\nexport class CallSubscriber {\n private _call: CallCommon;\n private _callIdRef: CallIdRef;\n private _context: CallContext;\n private _internalContext: InternalCallContext;\n\n private _diagnosticsSubscriber: UserFacingDiagnosticsSubscriber;\n private _participantSubscribers: Map<string, ParticipantSubscriber>;\n private _recordingSubscriber: RecordingSubscriber;\n private _transcriptionSubscriber: TranscriptionSubscriber;\n /* @conditional-compile-remove(local-recording-notification) */\n private _localRecordingSubscriber?: LocalRecordingSubscriber;\n private _pptLiveSubscriber: PPTLiveSubscriber;\n private _optimalVideoCountSubscriber: OptimalVideoCountSubscriber;\n private _CaptionsFeatureSubscriber?: CaptionsFeatureSubscriber;\n private _raiseHandSubscriber?: RaiseHandSubscriber;\n private _reactionSubscriber?: ReactionSubscriber;\n\n private _localVideoStreamVideoEffectsSubscribers: Map<string, LocalVideoStreamVideoEffectsSubscriber>;\n\n private _capabilitiesSubscriber: CapabilitiesSubscriber;\n private _spotlightSubscriber: SpotlightSubscriber;\n /* @conditional-compile-remove(breakout-rooms) */\n private _breakoutRoomsSubscriber: BreakoutRoomsSubscriber;\n\n constructor(call: CallCommon, context: CallContext, internalContext: InternalCallContext) {\n this._call = call;\n this._callIdRef = { callId: call.id };\n this._context = context;\n this._internalContext = internalContext;\n\n this._diagnosticsSubscriber = new UserFacingDiagnosticsSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.UserFacingDiagnostics)\n );\n this._participantSubscribers = new Map<string, ParticipantSubscriber>();\n this._recordingSubscriber = new RecordingSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Recording)\n );\n this._pptLiveSubscriber = new PPTLiveSubscriber(this._callIdRef, this._context, this._call);\n this._transcriptionSubscriber = new TranscriptionSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Transcription)\n );\n this._raiseHandSubscriber = new RaiseHandSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.RaiseHand)\n );\n this._reactionSubscriber = new ReactionSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Reaction)\n );\n this._optimalVideoCountSubscriber = new OptimalVideoCountSubscriber({\n callIdRef: this._callIdRef,\n context: this._context,\n localOptimalVideoCountFeature: this._call.feature(Features.OptimalVideoCount)\n });\n\n this._localVideoStreamVideoEffectsSubscribers = new Map();\n\n this._capabilitiesSubscriber = new CapabilitiesSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Capabilities)\n );\n\n this._spotlightSubscriber = new SpotlightSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Spotlight)\n );\n /* @conditional-compile-remove(breakout-rooms) */\n this._breakoutRoomsSubscriber = new BreakoutRoomsSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.BreakoutRooms)\n );\n\n this.subscribe();\n }\n\n private _safeSubscribeInitCaptionSubscriber = (): void => {\n this._safeSubscribe(this.initCaptionSubscriber);\n };\n\n private _safeSubscribeInitTeamsMeetingConference = (): void => {\n this._safeSubscribe(this.initTeamsMeetingConference);\n };\n\n /* @conditional-compile-remove(local-recording-notification) */\n private _safeSubscribeInitLocalRecordingNotificationSubscriber = (): void => {\n this._safeSubscribe(this.initLocalRecordingNotificationSubscriber);\n };\n\n private subscribe = (): void => {\n this._call.on('stateChanged', this.stateChanged);\n this._call.on('stateChanged', this._safeSubscribeInitCaptionSubscriber);\n this._call.on('stateChanged', this._safeSubscribeInitTeamsMeetingConference);\n /* @conditional-compile-remove(local-recording-notification) */\n this._call.on('stateChanged', this._safeSubscribeInitLocalRecordingNotificationSubscriber);\n this._call.on('idChanged', this.idChanged);\n this._call.on('isScreenSharingOnChanged', this.isScreenSharingOnChanged);\n this._call.on('remoteParticipantsUpdated', this.remoteParticipantsUpdated);\n this._call.on('localVideoStreamsUpdated', this.localVideoStreamsUpdated);\n this._call.on('isMutedChanged', this.isMuteChanged);\n this._call.on('roleChanged', this.callRoleChangedHandler);\n this._call.feature(Features.DominantSpeakers).on('dominantSpeakersChanged', this.dominantSpeakersChanged);\n /* @conditional-compile-remove(total-participant-count) */\n this._call.on('totalParticipantCountChanged', this.totalParticipantCountChangedHandler);\n /* @conditional-compile-remove(soft-mute) */\n this._call.on('mutedByOthers', this.mutedByOthersHandler);\n\n for (const localVideoStream of this._call.localVideoStreams) {\n this._internalContext.setLocalRenderInfo(\n this._callIdRef.callId,\n localVideoStream.mediaStreamType,\n localVideoStream,\n 'NotRendered',\n undefined\n );\n }\n\n if (this._call.remoteParticipants.length > 0) {\n this._call.remoteParticipants.forEach((participant: RemoteParticipant) => {\n this.addParticipantListener(participant);\n });\n\n this._context.setCallRemoteParticipants(\n this._callIdRef.callId,\n this._call.remoteParticipants.map(convertSdkParticipantToDeclarativeParticipant),\n []\n );\n }\n };\n\n public unsubscribe = (): void => {\n this._call.off('stateChanged', this.stateChanged);\n this._call.off('stateChanged', this._safeSubscribeInitCaptionSubscriber);\n this._call.off('stateChanged', this._safeSubscribeInitTeamsMeetingConference);\n /* @conditional-compile-remove(local-recording-notification) */\n this._call.off('stateChanged', this._safeSubscribeInitLocalRecordingNotificationSubscriber);\n this._call.off('idChanged', this.idChanged);\n this._call.off('isScreenSharingOnChanged', this.isScreenSharingOnChanged);\n this._call.off('remoteParticipantsUpdated', this.remoteParticipantsUpdated);\n this._call.off('localVideoStreamsUpdated', this.localVideoStreamsUpdated);\n this._call.off('isMutedChanged', this.isMuteChanged);\n this._call.off('roleChanged', this.callRoleChangedHandler);\n /* @conditional-compile-remove(total-participant-count) */\n this._call.off('totalParticipantCountChanged', this.totalParticipantCountChangedHandler);\n /* @conditional-compile-remove(soft-mute) */\n this._call.off('mutedByOthers', this.mutedByOthersHandler);\n\n this._participantSubscribers.forEach((participantSubscriber: ParticipantSubscriber) => {\n participantSubscriber.unsubscribe();\n });\n this._participantSubscribers.clear();\n\n // If we are unsubscribing that means we no longer want to display any video for this call (callEnded or callAgent\n // disposed) and we should not be updating it any more. So if video is rendering we stop rendering.\n for (const localVideoStream of this._call.localVideoStreams) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n disposeView(\n this._context,\n this._internalContext,\n this._callIdRef.callId,\n undefined,\n convertSdkLocalStreamToDeclarativeLocalStream(localVideoStream)\n );\n this._internalContext.deleteLocalRenderInfo(this._callIdRef.callId, mediaStreamType);\n }\n\n this._diagnosticsSubscriber.unsubscribe();\n this._recordingSubscriber.unsubscribe();\n this._transcriptionSubscriber.unsubscribe();\n /* @conditional-compile-remove(local-recording-notification) */\n this._localRecordingSubscriber?.unsubscribe();\n this._optimalVideoCountSubscriber.unsubscribe();\n this._pptLiveSubscriber.unsubscribe();\n this._CaptionsFeatureSubscriber?.unsubscribe();\n this._raiseHandSubscriber?.unsubscribe();\n\n this._capabilitiesSubscriber.unsubscribe();\n this._reactionSubscriber?.unsubscribe();\n this._spotlightSubscriber.unsubscribe();\n /* @conditional-compile-remove(breakout-rooms) */\n this._breakoutRoomsSubscriber.unsubscribe();\n };\n\n // This is a helper function to safely call subscriber functions. This is needed in order to prevent events\n // with the same event type from failing to fire due to a subscriber throwing an error upon subscription.\n // Wrap your listeners with this helper function if your listener can fail due to initialization or fail\n // during a function call. This will prevent other events using the same event type from failing to fire.\n private _safeSubscribe(subscriber: () => void): void {\n try {\n subscriber();\n } catch (e) {\n this._context.teeErrorToState(e as Error, 'Call.on');\n }\n }\n\n private addParticipantListener(participant: RemoteParticipant): void {\n const participantKey = toFlatCommunicationIdentifier(participant.identifier);\n this._participantSubscribers.get(participantKey)?.unsubscribe();\n this._participantSubscribers.set(\n participantKey,\n new ParticipantSubscriber(this._callIdRef, participant, this._context, this._internalContext)\n );\n }\n\n private removeParticipantListener(participant: RemoteParticipant): void {\n const participantKey = toFlatCommunicationIdentifier(participant.identifier);\n const participantSubscriber = this._participantSubscribers.get(participantKey);\n if (participantSubscriber) {\n participantSubscriber.unsubscribe();\n this._participantSubscribers.delete(participantKey);\n }\n }\n\n private stateChanged = (): void => {\n this._context.setCallState(this._callIdRef.callId, this._call.state);\n };\n\n private initCaptionSubscriber = (): void => {\n // subscribe to captions here so that we don't call captions when call is not initialized\n if (this._call.state === 'Connected' && !this._CaptionsFeatureSubscriber) {\n this._CaptionsFeatureSubscriber = new CaptionsFeatureSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Captions)\n );\n this._call.off('stateChanged', this._safeSubscribeInitCaptionSubscriber);\n }\n };\n\n private initTeamsMeetingConference = (): void => {\n if (this._call.state === 'Connected') {\n this._call\n .feature(Features.TeamsMeetingAudioConferencing)\n .getTeamsMeetingAudioConferencingDetails()\n .then((teamsMeetingConferenceDetails) => {\n this._context.setTeamsMeetingConference(this._callIdRef.callId, teamsMeetingConferenceDetails);\n });\n this._call.off('stateChanged', this._safeSubscribeInitTeamsMeetingConference);\n }\n };\n\n /* @conditional-compile-remove(local-recording-notification) */\n private initLocalRecordingNotificationSubscriber = (): void => {\n // Subscribe to LocalRecordingFeature as it is only available in interop scenarios\n // Will throw an error if not in interop scenarios\n if (this._call.state === 'Connected' && this._call.kind === 'TeamsCall' && !this._localRecordingSubscriber) {\n this._localRecordingSubscriber = new LocalRecordingSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.LocalRecording)\n );\n this._call.off('stateChanged', this._safeSubscribeInitLocalRecordingNotificationSubscriber);\n }\n };\n\n private idChanged = (): void => {\n this._internalContext.setCallId(this._call.id, this._callIdRef.callId);\n this._context.setCallId(this._call.id, this._callIdRef.callId);\n this._callIdRef.callId = this._call.id;\n };\n\n private isScreenSharingOnChanged = (): void => {\n this._context.setCallIsScreenSharingOn(this._callIdRef.callId, this._call.isScreenSharingOn);\n };\n\n private isMuteChanged = (): void => {\n this._context.setCallIsMicrophoneMuted(this._callIdRef.callId, this._call.isMuted);\n };\n\n private callRoleChangedHandler = (): void => {\n this._context.setRole(this._callIdRef.callId, this._call.role);\n };\n\n /* @conditional-compile-remove(total-participant-count) */\n private totalParticipantCountChangedHandler = (): void => {\n this._context.setTotalParticipantCount(this._callIdRef.callId, this._call.totalParticipantCount);\n };\n\n // TODO: Tee to notification state once available\n /* @conditional-compile-remove(soft-mute) */\n private mutedByOthersHandler = (): void => {\n this._context.teeErrorToState(\n { name: 'mutedByOthers', message: 'Muted by another participant' },\n 'Call.mutedByOthers'\n );\n };\n\n private remoteParticipantsUpdated = (event: { added: RemoteParticipant[]; removed: RemoteParticipant[] }): void => {\n event.added.forEach((participant: RemoteParticipant) => {\n this.addParticipantListener(participant);\n });\n event.removed.forEach((participant: RemoteParticipant) => {\n this.removeParticipantListener(participant);\n });\n\n // Remove any added participants from remoteParticipantsEnded if they are there and add any removed participants to\n // remoteParticipantsEnded.\n this._context.setCallRemoteParticipantsEnded(\n this._callIdRef.callId,\n event.removed.map(convertSdkParticipantToDeclarativeParticipant),\n event.added.map((participant: RemoteParticipant) => {\n return toFlatCommunicationIdentifier(participant.identifier);\n })\n );\n\n // Add added participants to remoteParticipants and remove removed participants from remoteParticipants.\n this._context.setCallRemoteParticipants(\n this._callIdRef.callId,\n event.added.map(convertSdkParticipantToDeclarativeParticipant),\n event.removed.map((participant: RemoteParticipant) => {\n return toFlatCommunicationIdentifier(participant.identifier);\n })\n );\n };\n\n private localVideoStreamsUpdated = (event: { added: LocalVideoStream[]; removed: LocalVideoStream[] }): void => {\n for (const localVideoStream of event.added) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n // IMPORTANT: The internalContext should be set before context. This is done to ensure that the internal context\n // has the required data when component re-renders due to external state changes.\n this._internalContext.setLocalRenderInfo(\n this._callIdRef.callId,\n mediaStreamType,\n localVideoStream,\n 'NotRendered',\n undefined\n );\n\n // Subscribe to video effect changes\n this._localVideoStreamVideoEffectsSubscribers.get(mediaStreamType)?.unsubscribe();\n this._localVideoStreamVideoEffectsSubscribers.set(\n mediaStreamType,\n new LocalVideoStreamVideoEffectsSubscriber({\n parent: this._callIdRef,\n context: this._context,\n localVideoStream: localVideoStream,\n localVideoStreamEffectsAPI: localVideoStream.feature(Features.VideoEffects)\n })\n );\n }\n for (const localVideoStream of event.removed) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n this._localVideoStreamVideoEffectsSubscribers.get(mediaStreamType)?.unsubscribe();\n disposeView(\n this._context,\n this._internalContext,\n this._callIdRef.callId,\n undefined,\n convertSdkLocalStreamToDeclarativeLocalStream(localVideoStream)\n );\n\n this._internalContext.deleteLocalRenderInfo(this._callIdRef.callId, mediaStreamType);\n }\n\n this._context.setCallLocalVideoStream(\n this._callIdRef.callId,\n event.added.map(convertSdkLocalStreamToDeclarativeLocalStream),\n event.removed.map(convertSdkLocalStreamToDeclarativeLocalStream)\n );\n };\n\n private dominantSpeakersChanged = (): void => {\n const dominantSpeakers = this._call.feature(Features.DominantSpeakers).dominantSpeakers;\n this._context.setCallDominantSpeakers(this._callIdRef.callId, dominantSpeakers);\n };\n}\n"]}
|
@@ -13,7 +13,6 @@ export class CapabilitiesSubscriber {
|
|
13
13
|
};
|
14
14
|
this.capabilitiesChanged = (data) => {
|
15
15
|
this._context.setCapabilities(this._callIdRef.callId, this._capabilitiesFeature.capabilities, data);
|
16
|
-
/* @conditional-compile-remove(hide-attendee-name) */
|
17
16
|
if (data.oldValue.viewAttendeeNames !== data.newValue.viewAttendeeNames) {
|
18
17
|
this._context.setHideAttendeeNames(this._callIdRef.callId, data);
|
19
18
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CapabilitiesSubscriber.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/CapabilitiesSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC;;GAEG;AACH,MAAM,OAAO,sBAAsB;IAKjC,YAAY,SAAoB,EAAE,OAAoB,EAAE,YAAiC;QAQjF,cAAS,GAAG,GAAS,EAAE;YAC7B,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC,qBAAqB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAChF,CAAC,CAAC;QAEK,gBAAW,GAAG,GAAS,EAAE;YAC9B,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACjF,CAAC,CAAC;QAEM,wBAAmB,GAAG,CAAC,IAA4B,EAAQ,EAAE;YACnE,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,oBAAoB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;YACpG,
|
1
|
+
{"version":3,"file":"CapabilitiesSubscriber.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/CapabilitiesSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC;;GAEG;AACH,MAAM,OAAO,sBAAsB;IAKjC,YAAY,SAAoB,EAAE,OAAoB,EAAE,YAAiC;QAQjF,cAAS,GAAG,GAAS,EAAE;YAC7B,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC,qBAAqB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAChF,CAAC,CAAC;QAEK,gBAAW,GAAG,GAAS,EAAE;YAC9B,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACjF,CAAC,CAAC;QAEM,wBAAmB,GAAG,CAAC,IAA4B,EAAQ,EAAE;YACnE,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,oBAAoB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;YACpG,IAAI,IAAI,CAAC,QAAQ,CAAC,iBAAiB,KAAK,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC;gBACxE,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YACnE,CAAC;QACH,CAAC,CAAC;QApBA,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,oBAAoB,GAAG,YAAY,CAAC;QAEzC,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;CAgBF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CapabilitiesChangeInfo, CapabilitiesFeature } from '@azure/communication-calling';\n\nimport { CallContext } from './CallContext';\n\nimport { CallIdRef } from './CallIdRef';\n\n/**\n * @private\n */\nexport class CapabilitiesSubscriber {\n private _callIdRef: CallIdRef;\n private _context: CallContext;\n private _capabilitiesFeature: CapabilitiesFeature;\n\n constructor(callIdRef: CallIdRef, context: CallContext, capabilities: CapabilitiesFeature) {\n this._callIdRef = callIdRef;\n this._context = context;\n this._capabilitiesFeature = capabilities;\n\n this.subscribe();\n }\n\n private subscribe = (): void => {\n this._capabilitiesFeature.on('capabilitiesChanged', this.capabilitiesChanged);\n };\n\n public unsubscribe = (): void => {\n this._capabilitiesFeature.off('capabilitiesChanged', this.capabilitiesChanged);\n };\n\n private capabilitiesChanged = (data: CapabilitiesChangeInfo): void => {\n this._context.setCapabilities(this._callIdRef.callId, this._capabilitiesFeature.capabilities, data);\n if (data.oldValue.viewAttendeeNames !== data.newValue.viewAttendeeNames) {\n this._context.setHideAttendeeNames(this._callIdRef.callId, data);\n }\n };\n}\n"]}
|
@@ -49,7 +49,6 @@ export function convertSdkParticipantToDeclarativeParticipant(participant) {
|
|
49
49
|
isMuted: participant.isMuted,
|
50
50
|
isSpeaking: participant.isSpeaking,
|
51
51
|
raisedHand: undefined,
|
52
|
-
/* @conditional-compile-remove(hide-attendee-name) */
|
53
52
|
role: participant.role,
|
54
53
|
spotlight: undefined
|
55
54
|
};
|
@@ -65,9 +64,7 @@ export function convertSdkCallToDeclarativeCall(call) {
|
|
65
64
|
declarativeRemoteParticipants[toFlatCommunicationIdentifier(participant.identifier)] =
|
66
65
|
convertSdkParticipantToDeclarativeParticipant(participant);
|
67
66
|
});
|
68
|
-
/* @conditional-compile-remove(hide-attendee-name) */
|
69
67
|
let hideAttendeeNames = false;
|
70
|
-
/* @conditional-compile-remove(hide-attendee-name) */
|
71
68
|
if (call.feature(Features.Capabilities).capabilities &&
|
72
69
|
call.feature(Features.Capabilities).capabilities.viewAttendeeNames) {
|
73
70
|
const viewAttendeeNames = call.feature(Features.Capabilities).capabilities.viewAttendeeNames;
|
@@ -128,7 +125,6 @@ export function convertSdkCallToDeclarativeCall(call) {
|
|
128
125
|
optimalVideoCount: {
|
129
126
|
maxRemoteVideoStreams: call.feature(Features.OptimalVideoCount).optimalVideoCount
|
130
127
|
},
|
131
|
-
/* @conditional-compile-remove(hide-attendee-name) */
|
132
128
|
hideAttendeeNames,
|
133
129
|
info: callInfo,
|
134
130
|
meetingConference: { conferencePhones: [] }
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Converter.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/Converter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAoBlC,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAaxE,mDAAmD;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,qDAAqD;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAUxD;;GAEG;AACH,MAAM,UAAU,6CAA6C,CAC3D,MAA2B;IAE3B,MAAM,0BAA0B,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAEzE,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,IAAI,EAAE,SAAS;QAEf,YAAY,EAAE,kDAAkD,CAAC,0BAA0B,CAAC,aAAa,CAAC;KAC3G,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,+CAA+C,CAC7D,MAA4B;IAE5B,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,IAAI,EAAE,SAAS;QACf,UAAU,EAAE,MAAM,CAAC,IAAI;K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,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,0BAA0B,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;;QACrE,MAAM,MAAM,GAAG;YACb,YAAY,EAAE,0BAA0B,CAAC,iBAAiB;YAC1D,OAAO,EAAE,WAAW,CAAC,WAAW;YAChC,IAAI,EAAE,WAAW,CAAC,QAAQ;YAC1B,WAAW,EAAE,EAAE;YACf,UAAU,EAAE,KAAK;SAClB,CAAC;QACF,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACvC,IAAI,CAAC,WAAW,GAAG,MAAA,MAAA,WAAW,CAAC,eAAe,0CAAE,WAAW,mCAAI,EAAE,CAAC;QAClE,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAExB,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAC3C,QAAQ,CAAC,WAAW,GAAG,MAAA,MAAA,WAAW,CAAC,mBAAmB,0CAAE,WAAW,mCAAI,EAAE,CAAC;QAC1E,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC;QAE3B,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n RemoteParticipant as SdkRemoteParticipant,\n RemoteVideoStream as SdkRemoteVideoStream,\n LocalVideoStream as SdkLocalVideoStream,\n VideoStreamRendererView,\n IncomingCall,\n IncomingCallCommon\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { TeamsIncomingCall } from '@azure/communication-calling';\nimport { TeamsCaptionsInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { CaptionsInfo as AcsCaptionsInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { CallKind } from '@azure/communication-calling';\nimport { TeamsCallInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(calling-beta-sdk) */\nimport { CallInfo } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport {\n CallState,\n RemoteParticipantState as DeclarativeRemoteParticipant,\n RemoteVideoStreamState as DeclarativeRemoteVideoStream,\n LocalVideoStreamState as DeclarativeLocalVideoStream,\n IncomingCallState as DeclarativeIncomingCall,\n VideoStreamRendererViewState as DeclarativeVideoStreamRendererView,\n CallInfoState\n} from './CallClientState';\nimport { CaptionsInfo } from './CallClientState';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { TeamsIncomingCallState as DeclarativeTeamsIncomingCall } from './CallClientState';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { _isTeamsIncomingCall } from './TypeGuards';\nimport { _isACSCall } from './TypeGuards';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { _isTeamsCall } from './TypeGuards';\nimport { CallCommon } from './BetaToStableTypes';\n\nimport { Features } from '@azure/communication-calling';\n\nimport { VideoEffectName } from '@azure/communication-calling';\n\nimport { LocalVideoStreamVideoEffectsState } from './CallClientState';\nimport { RaisedHand } from '@azure/communication-calling';\nimport { RaisedHandState } from './CallClientState';\nimport { TeamsMeetingAudioConferencingDetails } from '@azure/communication-calling';\nimport { ConferencePhoneInfo } from './CallClientState';\n\n/**\n * @private\n */\nexport function convertSdkLocalStreamToDeclarativeLocalStream(\n stream: SdkLocalVideoStream\n): DeclarativeLocalVideoStream {\n const localVideoStreamEffectsAPI = stream.feature(Features.VideoEffects);\n\n return {\n source: stream.source,\n mediaStreamType: stream.mediaStreamType,\n view: undefined,\n\n videoEffects: convertFromSDKToDeclarativeVideoStreamVideoEffects(localVideoStreamEffectsAPI.activeEffects)\n };\n}\n\n/**\n * @private\n */\nexport function convertSdkRemoteStreamToDeclarativeRemoteStream(\n stream: SdkRemoteVideoStream\n): DeclarativeRemoteVideoStream {\n return {\n id: stream.id,\n mediaStreamType: stream.mediaStreamType,\n isAvailable: stream.isAvailable,\n isReceiving: stream.isReceiving,\n view: undefined,\n streamSize: stream.size\n };\n}\n\n/**\n * @private\n */\nexport function convertSdkParticipantToDeclarativeParticipant(\n participant: SdkRemoteParticipant\n): DeclarativeRemoteParticipant {\n const declarativeVideoStreams: { [key: number]: DeclarativeRemoteVideoStream } = {};\n for (const videoStream of participant.videoStreams) {\n declarativeVideoStreams[videoStream.id] = convertSdkRemoteStreamToDeclarativeRemoteStream(videoStream);\n }\n return {\n identifier: participant.identifier,\n displayName: participant.displayName,\n state: participant.state,\n callEndReason: participant.callEndReason,\n videoStreams: declarativeVideoStreams,\n isMuted: participant.isMuted,\n isSpeaking: participant.isSpeaking,\n raisedHand: undefined,\n /* @conditional-compile-remove(hide-attendee-name) */\n role: participant.role,\n spotlight: undefined\n };\n}\n\n/**\n * @private\n *\n * Note at the time of writing only one LocalVideoStream is supported by the SDK.\n */\nexport function convertSdkCallToDeclarativeCall(call: CallCommon): CallState {\n const declarativeRemoteParticipants: { [key: string]: DeclarativeRemoteParticipant } = {};\n call.remoteParticipants.forEach((participant: SdkRemoteParticipant) => {\n declarativeRemoteParticipants[toFlatCommunicationIdentifier(participant.identifier)] =\n convertSdkParticipantToDeclarativeParticipant(participant);\n });\n /* @conditional-compile-remove(hide-attendee-name) */\n let hideAttendeeNames = false;\n /* @conditional-compile-remove(hide-attendee-name) */\n if (\n call.feature(Features.Capabilities).capabilities &&\n call.feature(Features.Capabilities).capabilities.viewAttendeeNames\n ) {\n const viewAttendeeNames = call.feature(Features.Capabilities).capabilities.viewAttendeeNames;\n if (!viewAttendeeNames.isPresent && viewAttendeeNames.reason === 'MeetingRestricted') {\n hideAttendeeNames = true;\n }\n }\n\n let callInfo: TeamsCallInfo | undefined | /* @conditional-compile-remove(calling-beta-sdk) */ CallInfo;\n if ('info' in call) {\n callInfo = call.info as TeamsCallInfo | undefined | /* @conditional-compile-remove(calling-beta-sdk) */ CallInfo;\n }\n\n return {\n id: call.id,\n /* @conditional-compile-remove(teams-identity-support) */\n kind: _isACSCall(call) ? ('Call' as CallKind) : ('TeamsCall' as CallKind),\n callerInfo: call.callerInfo,\n state: call.state,\n callEndReason: call.callEndReason,\n diagnostics: {\n network: {\n latest: {}\n },\n media: {\n latest: {}\n }\n },\n direction: call.direction,\n isMuted: call.isMuted,\n isScreenSharingOn: call.isScreenSharingOn,\n localVideoStreams: call.localVideoStreams.map(convertSdkLocalStreamToDeclarativeLocalStream),\n remoteParticipants: declarativeRemoteParticipants,\n remoteParticipantsEnded: {},\n recording: { isRecordingActive: false },\n /* @conditional-compile-remove(local-recording-notification) */\n localRecording: { isLocalRecordingActive: false },\n pptLive: { isActive: false },\n raiseHand: { raisedHands: [] },\n localParticipantReaction: undefined,\n transcription: { isTranscriptionActive: false },\n screenShareRemoteParticipant: undefined,\n startTime: new Date(),\n endTime: undefined,\n role: call.role,\n captionsFeature: {\n captions: [],\n supportedSpokenLanguages: [],\n supportedCaptionLanguages: [],\n currentCaptionLanguage: '',\n currentSpokenLanguage: '',\n isCaptionsFeatureActive: false,\n startCaptionsInProgress: false,\n /* @conditional-compile-remove(acs-close-captions) */\n captionsKind: _isTeamsCall(call) ? 'TeamsCaptions' : 'Captions'\n },\n transfer: {\n acceptedTransfers: {}\n },\n optimalVideoCount: {\n maxRemoteVideoStreams: call.feature(Features.OptimalVideoCount).optimalVideoCount\n },\n /* @conditional-compile-remove(hide-attendee-name) */\n hideAttendeeNames,\n info: callInfo,\n meetingConference: { conferencePhones: [] }\n };\n}\n\n/**\n * @private\n */\nexport function convertSdkIncomingCallToDeclarativeIncomingCall(\n call: IncomingCallCommon\n): DeclarativeIncomingCall | /* @conditional-compile-remove(one-to-n-calling) */ DeclarativeTeamsIncomingCall {\n /* @conditional-compile-remove(one-to-n-calling) */\n if (_isTeamsIncomingCall(call)) {\n const newInfo: CallInfoState = { ...(call as TeamsIncomingCall).info, kind: call.kind };\n return {\n id: call.id,\n info: newInfo,\n callerInfo: call.callerInfo,\n startTime: new Date(),\n endTime: undefined\n };\n } else {\n const newInfo: CallInfoState = { ...(call as IncomingCall).info, kind: call.kind };\n return {\n id: call.id,\n info: newInfo,\n callerInfo: call.callerInfo,\n startTime: new Date(),\n endTime: undefined\n };\n }\n const newInfo: CallInfoState = { ...(call as IncomingCall).info, kind: call.kind };\n return {\n id: call.id,\n info: newInfo,\n callerInfo: call.callerInfo,\n startTime: new Date(),\n endTime: undefined\n };\n}\n\n/**\n * @private\n */\nexport function convertFromSDKToDeclarativeVideoStreamRendererView(\n view: VideoStreamRendererView\n): DeclarativeVideoStreamRendererView {\n return {\n scalingMode: view.scalingMode,\n isMirrored: view.isMirrored,\n target: view.target\n };\n}\n\n/**\n * @private\n */\nexport function convertFromTeamsSDKToCaptionInfoState(caption: TeamsCaptionsInfo): CaptionsInfo {\n return {\n ...caption\n };\n}\n\n/* @conditional-compile-remove(acs-close-captions) */\n/**\n * @private\n */\nexport function convertFromSDKToCaptionInfoState(caption: AcsCaptionsInfo): CaptionsInfo {\n return {\n captionText: caption.spokenText,\n ...caption\n };\n}\n\n/** @private */\nexport function convertFromSDKToDeclarativeVideoStreamVideoEffects(\n videoEffects: VideoEffectName[]\n): LocalVideoStreamVideoEffectsState {\n return {\n activeEffects: videoEffects\n };\n}\n\n/**\n * @private\n */\nexport function convertFromSDKToRaisedHandState(raisedHand: RaisedHand): RaisedHandState {\n return {\n raisedHandOrderPosition: raisedHand.order\n };\n}\n\n/** @private */\nexport function convertConferencePhoneInfo(\n meetingConferencePhoneInfo?: TeamsMeetingAudioConferencingDetails\n): ConferencePhoneInfo[] {\n if (!meetingConferencePhoneInfo) {\n return [];\n }\n\n return meetingConferencePhoneInfo.phoneNumbers.flatMap((phoneNumber) => {\n const common = {\n conferenceId: meetingConferencePhoneInfo.phoneConferenceId,\n country: phoneNumber.countryName,\n city: phoneNumber.cityName,\n phoneNumber: '',\n isTollFree: false\n };\n const toll = Object.assign({}, common);\n toll.phoneNumber = phoneNumber.tollPhoneNumber?.phoneNumber ?? '';\n toll.isTollFree = false;\n\n const tollFree = Object.assign({}, common);\n tollFree.phoneNumber = phoneNumber.tollFreePhoneNumber?.phoneNumber ?? '';\n tollFree.isTollFree = true;\n\n return [toll, tollFree].filter((phoneInfo) => phoneInfo.phoneNumber);\n });\n}\n"]}
|
1
|
+
{"version":3,"file":"Converter.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/Converter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAoBlC,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAaxE,mDAAmD;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,qDAAqD;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAUxD;;GAEG;AACH,MAAM,UAAU,6CAA6C,CAC3D,MAA2B;IAE3B,MAAM,0BAA0B,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAEzE,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,IAAI,EAAE,SAAS;QAEf,YAAY,EAAE,kDAAkD,CAAC,0BAA0B,CAAC,aAAa,CAAC;KAC3G,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,+CAA+C,CAC7D,MAA4B;IAE5B,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,IAAI,EAAE,SAAS;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Z,CAAC;IAED,OAAO,0BAA0B,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;;QACrE,MAAM,MAAM,GAAG;YACb,YAAY,EAAE,0BAA0B,CAAC,iBAAiB;YAC1D,OAAO,EAAE,WAAW,CAAC,WAAW;YAChC,IAAI,EAAE,WAAW,CAAC,QAAQ;YAC1B,WAAW,EAAE,EAAE;YACf,UAAU,EAAE,KAAK;SAClB,CAAC;QACF,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACvC,IAAI,CAAC,WAAW,GAAG,MAAA,MAAA,WAAW,CAAC,eAAe,0CAAE,WAAW,mCAAI,EAAE,CAAC;QAClE,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAExB,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAC3C,QAAQ,CAAC,WAAW,GAAG,MAAA,MAAA,WAAW,CAAC,mBAAmB,0CAAE,WAAW,mCAAI,EAAE,CAAC;QAC1E,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC;QAE3B,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n RemoteParticipant as SdkRemoteParticipant,\n RemoteVideoStream as SdkRemoteVideoStream,\n LocalVideoStream as SdkLocalVideoStream,\n VideoStreamRendererView,\n IncomingCall,\n IncomingCallCommon\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { TeamsIncomingCall } from '@azure/communication-calling';\nimport { TeamsCaptionsInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { CaptionsInfo as AcsCaptionsInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { CallKind } from '@azure/communication-calling';\nimport { TeamsCallInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(calling-beta-sdk) */\nimport { CallInfo } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport {\n CallState,\n RemoteParticipantState as DeclarativeRemoteParticipant,\n RemoteVideoStreamState as DeclarativeRemoteVideoStream,\n LocalVideoStreamState as DeclarativeLocalVideoStream,\n IncomingCallState as DeclarativeIncomingCall,\n VideoStreamRendererViewState as DeclarativeVideoStreamRendererView,\n CallInfoState\n} from './CallClientState';\nimport { CaptionsInfo } from './CallClientState';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { TeamsIncomingCallState as DeclarativeTeamsIncomingCall } from './CallClientState';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { _isTeamsIncomingCall } from './TypeGuards';\nimport { _isACSCall } from './TypeGuards';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { _isTeamsCall } from './TypeGuards';\nimport { CallCommon } from './BetaToStableTypes';\n\nimport { Features } from '@azure/communication-calling';\n\nimport { VideoEffectName } from '@azure/communication-calling';\n\nimport { LocalVideoStreamVideoEffectsState } from './CallClientState';\nimport { RaisedHand } from '@azure/communication-calling';\nimport { RaisedHandState } from './CallClientState';\nimport { TeamsMeetingAudioConferencingDetails } from '@azure/communication-calling';\nimport { ConferencePhoneInfo } from './CallClientState';\n\n/**\n * @private\n */\nexport function convertSdkLocalStreamToDeclarativeLocalStream(\n stream: SdkLocalVideoStream\n): DeclarativeLocalVideoStream {\n const localVideoStreamEffectsAPI = stream.feature(Features.VideoEffects);\n\n return {\n source: stream.source,\n mediaStreamType: stream.mediaStreamType,\n view: undefined,\n\n videoEffects: convertFromSDKToDeclarativeVideoStreamVideoEffects(localVideoStreamEffectsAPI.activeEffects)\n };\n}\n\n/**\n * @private\n */\nexport function convertSdkRemoteStreamToDeclarativeRemoteStream(\n stream: SdkRemoteVideoStream\n): DeclarativeRemoteVideoStream {\n return {\n id: stream.id,\n mediaStreamType: stream.mediaStreamType,\n isAvailable: stream.isAvailable,\n isReceiving: stream.isReceiving,\n view: undefined,\n streamSize: stream.size\n };\n}\n\n/**\n * @private\n */\nexport function convertSdkParticipantToDeclarativeParticipant(\n participant: SdkRemoteParticipant\n): DeclarativeRemoteParticipant {\n const declarativeVideoStreams: { [key: number]: DeclarativeRemoteVideoStream } = {};\n for (const videoStream of participant.videoStreams) {\n declarativeVideoStreams[videoStream.id] = convertSdkRemoteStreamToDeclarativeRemoteStream(videoStream);\n }\n return {\n identifier: participant.identifier,\n displayName: participant.displayName,\n state: participant.state,\n callEndReason: participant.callEndReason,\n videoStreams: declarativeVideoStreams,\n isMuted: participant.isMuted,\n isSpeaking: participant.isSpeaking,\n raisedHand: undefined,\n role: participant.role,\n spotlight: undefined\n };\n}\n\n/**\n * @private\n *\n * Note at the time of writing only one LocalVideoStream is supported by the SDK.\n */\nexport function convertSdkCallToDeclarativeCall(call: CallCommon): CallState {\n const declarativeRemoteParticipants: { [key: string]: DeclarativeRemoteParticipant } = {};\n call.remoteParticipants.forEach((participant: SdkRemoteParticipant) => {\n declarativeRemoteParticipants[toFlatCommunicationIdentifier(participant.identifier)] =\n convertSdkParticipantToDeclarativeParticipant(participant);\n });\n let hideAttendeeNames = false;\n if (\n call.feature(Features.Capabilities).capabilities &&\n call.feature(Features.Capabilities).capabilities.viewAttendeeNames\n ) {\n const viewAttendeeNames = call.feature(Features.Capabilities).capabilities.viewAttendeeNames;\n if (!viewAttendeeNames.isPresent && viewAttendeeNames.reason === 'MeetingRestricted') {\n hideAttendeeNames = true;\n }\n }\n\n let callInfo: TeamsCallInfo | undefined | /* @conditional-compile-remove(calling-beta-sdk) */ CallInfo;\n if ('info' in call) {\n callInfo = call.info as TeamsCallInfo | undefined | /* @conditional-compile-remove(calling-beta-sdk) */ CallInfo;\n }\n\n return {\n id: call.id,\n /* @conditional-compile-remove(teams-identity-support) */\n kind: _isACSCall(call) ? ('Call' as CallKind) : ('TeamsCall' as CallKind),\n callerInfo: call.callerInfo,\n state: call.state,\n callEndReason: call.callEndReason,\n diagnostics: {\n network: {\n latest: {}\n },\n media: {\n latest: {}\n }\n },\n direction: call.direction,\n isMuted: call.isMuted,\n isScreenSharingOn: call.isScreenSharingOn,\n localVideoStreams: call.localVideoStreams.map(convertSdkLocalStreamToDeclarativeLocalStream),\n remoteParticipants: declarativeRemoteParticipants,\n remoteParticipantsEnded: {},\n recording: { isRecordingActive: false },\n /* @conditional-compile-remove(local-recording-notification) */\n localRecording: { isLocalRecordingActive: false },\n pptLive: { isActive: false },\n raiseHand: { raisedHands: [] },\n localParticipantReaction: undefined,\n transcription: { isTranscriptionActive: false },\n screenShareRemoteParticipant: undefined,\n startTime: new Date(),\n endTime: undefined,\n role: call.role,\n captionsFeature: {\n captions: [],\n supportedSpokenLanguages: [],\n supportedCaptionLanguages: [],\n currentCaptionLanguage: '',\n currentSpokenLanguage: '',\n isCaptionsFeatureActive: false,\n startCaptionsInProgress: false,\n /* @conditional-compile-remove(acs-close-captions) */\n captionsKind: _isTeamsCall(call) ? 'TeamsCaptions' : 'Captions'\n },\n transfer: {\n acceptedTransfers: {}\n },\n optimalVideoCount: {\n maxRemoteVideoStreams: call.feature(Features.OptimalVideoCount).optimalVideoCount\n },\n hideAttendeeNames,\n info: callInfo,\n meetingConference: { conferencePhones: [] }\n };\n}\n\n/**\n * @private\n */\nexport function convertSdkIncomingCallToDeclarativeIncomingCall(\n call: IncomingCallCommon\n): DeclarativeIncomingCall | /* @conditional-compile-remove(one-to-n-calling) */ DeclarativeTeamsIncomingCall {\n /* @conditional-compile-remove(one-to-n-calling) */\n if (_isTeamsIncomingCall(call)) {\n const newInfo: CallInfoState = { ...(call as TeamsIncomingCall).info, kind: call.kind };\n return {\n id: call.id,\n info: newInfo,\n callerInfo: call.callerInfo,\n startTime: new Date(),\n endTime: undefined\n };\n } else {\n const newInfo: CallInfoState = { ...(call as IncomingCall).info, kind: call.kind };\n return {\n id: call.id,\n info: newInfo,\n callerInfo: call.callerInfo,\n startTime: new Date(),\n endTime: undefined\n };\n }\n const newInfo: CallInfoState = { ...(call as IncomingCall).info, kind: call.kind };\n return {\n id: call.id,\n info: newInfo,\n callerInfo: call.callerInfo,\n startTime: new Date(),\n endTime: undefined\n };\n}\n\n/**\n * @private\n */\nexport function convertFromSDKToDeclarativeVideoStreamRendererView(\n view: VideoStreamRendererView\n): DeclarativeVideoStreamRendererView {\n return {\n scalingMode: view.scalingMode,\n isMirrored: view.isMirrored,\n target: view.target\n };\n}\n\n/**\n * @private\n */\nexport function convertFromTeamsSDKToCaptionInfoState(caption: TeamsCaptionsInfo): CaptionsInfo {\n return {\n ...caption\n };\n}\n\n/* @conditional-compile-remove(acs-close-captions) */\n/**\n * @private\n */\nexport function convertFromSDKToCaptionInfoState(caption: AcsCaptionsInfo): CaptionsInfo {\n return {\n captionText: caption.spokenText,\n ...caption\n };\n}\n\n/** @private */\nexport function convertFromSDKToDeclarativeVideoStreamVideoEffects(\n videoEffects: VideoEffectName[]\n): LocalVideoStreamVideoEffectsState {\n return {\n activeEffects: videoEffects\n };\n}\n\n/**\n * @private\n */\nexport function convertFromSDKToRaisedHandState(raisedHand: RaisedHand): RaisedHandState {\n return {\n raisedHandOrderPosition: raisedHand.order\n };\n}\n\n/** @private */\nexport function convertConferencePhoneInfo(\n meetingConferencePhoneInfo?: TeamsMeetingAudioConferencingDetails\n): ConferencePhoneInfo[] {\n if (!meetingConferencePhoneInfo) {\n return [];\n }\n\n return meetingConferencePhoneInfo.phoneNumbers.flatMap((phoneNumber) => {\n const common = {\n conferenceId: meetingConferencePhoneInfo.phoneConferenceId,\n country: phoneNumber.countryName,\n city: phoneNumber.cityName,\n phoneNumber: '',\n isTollFree: false\n };\n const toll = Object.assign({}, common);\n toll.phoneNumber = phoneNumber.tollPhoneNumber?.phoneNumber ?? '';\n toll.isTollFree = false;\n\n const tollFree = Object.assign({}, common);\n tollFree.phoneNumber = phoneNumber.tollFreePhoneNumber?.phoneNumber ?? '';\n tollFree.isTollFree = true;\n\n return [toll, tollFree].filter((phoneInfo) => phoneInfo.phoneNumber);\n });\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ParticipantItem.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/ParticipantItem.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,cAAc,EACd,eAAe,EACf,IAAI,EAGJ,WAAW,EACX,OAAO,EAEP,WAAW,EACX,KAAK,EACL,IAAI,EACL,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,wBAAwB,EACxB,6BAA6B,EAC7B,4BAA4B,EAC7B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,sBAAsB,IAAI,qBAAqB,EAAE,mCAAgC;AAI1F,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAwG9C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAe,EAAE;IAC1E,MAAM,EACJ,MAAM,EACN,WAAW,EACX,cAAc,EACd,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,EAAE,EACF,OAAO,EACP,8BAA8B,EAC/B,GAAG,KAAK,CAAC;IACV,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IAC/D,MAAM,CAAC,UAAU,EAAE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BAAmB,EAC9B,YAAY,EAAE;4BACZ,qBAAqB;yBACtB,GACD,CACD,CACJ,CACA,CACJ,CACK,CACF,CACJ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,gCAAgC,GAAG,CACvC,KAA2B,EAC3B,OAA+B,EACX,EAAE;IACtB,mDAAmD;IACnD,6CAA6C;IAC7C,OAAO,KAAK,CAAC,gBAAgB,KAAK,YAAY,IAAI,KAAK,CAAC,gBAAgB,KAAK,SAAS;QACpF,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,uBAAuB;QAClC,CAAC,CAAC,KAAK,CAAC,gBAAgB,KAAK,MAAM;YACjC,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,oBAAoB;YAC/B,CAAC,CAAC,SAAS,CAAC;IAEhB,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n ContextualMenu,\n DirectionalHint,\n Icon,\n IContextualMenuItem,\n IStyle,\n mergeStyles,\n Persona,\n PersonaPresence,\n PersonaSize,\n Stack,\n Text\n} from '@fluentui/react';\nimport React, { useMemo, useRef, useState } from 'react';\nimport { useIdentifiers } from '../identifiers';\nimport { useLocale } from '../localization';\nimport { useTheme } from '../theming';\nimport { BaseCustomStyles, OnRenderAvatarCallback } from '../types';\nimport {\n displayNoneStyle,\n iconContainerStyle,\n iconStyles,\n meContainerStyle,\n menuButtonContainerStyle,\n participantItemContainerStyle,\n participantStateStringStyles\n} from './styles/ParticipantItem.styles';\nimport { _preventDismissOnEvent as preventDismissOnEvent } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(one-to-n-calling) */\n/* @conditional-compile-remove(PSTN-calls) */\nimport { ParticipantState } from '../types';\nimport { useId } from '@fluentui/react-hooks';\n\n/**\n * Fluent styles for {@link ParticipantItem}.\n *\n * @public\n */\nexport interface ParticipantItemStyles extends BaseCustomStyles {\n /** Styles for the avatar. */\n avatar?: IStyle;\n /** Styles for the (You) string. */\n me?: IStyle;\n /** Styles for the container of the icon. */\n iconContainer?: IStyle;\n /** Styles for the menu. */\n menu?: IStyle;\n}\n\n/**\n * Strings of {@link ParticipantItem} that can be overridden.\n *\n * @public\n */\nexport interface ParticipantItemStrings {\n /** String shown when participant is me */\n isMeText: string;\n /** String shown when hovering over menu button */\n menuTitle: string;\n /** Label for the remove button in participant menu */\n removeButtonLabel: string;\n /** Label for the sharing icon in participant state stack */\n sharingIconLabel: string;\n /** Label for the muted icon in participant state stack */\n mutedIconLabel: string;\n /** placeholder text for participants who does not have a display name*/\n displayNamePlaceholder?: string;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /** String shown when `participantState` is `Ringing` */\n participantStateRinging?: string;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /** String shown when `participantState` is `Hold` */\n participantStateHold?: string;\n /* @conditional-compile-remove(hide-attendee-name) */\n /** String for the attendee role */\n attendeeRole: string;\n}\n\n/**\n * Props for {@link ParticipantItem}.\n *\n * @public\n */\nexport interface ParticipantItemProps {\n /** Unique User ID of the participant. This `userId` is available in the `onRenderAvatar` callback function */\n userId?: string;\n /** Name of participant. */\n displayName?: string;\n /** Optional indicator to show participant is the user. */\n me?: boolean;\n /** Optional callback returning a JSX element to override avatar. */\n onRenderAvatar?: OnRenderAvatarCallback;\n /** Optional array of IContextualMenuItem for contextual menu. */\n menuItems?: IContextualMenuItem[];\n /** Optional callback returning a JSX element rendered on the right portion of the ParticipantItem. Intended for adding icons. */\n onRenderIcon?: (props?: ParticipantItemProps) => JSX.Element | null;\n /** Optional PersonaPresence to show participant presence. This will not have an effect if property avatar is assigned. */\n presence?: PersonaPresence;\n /**\n * Allows users to pass in an object contains custom CSS styles.\n * @Example\n * ```\n * <ParticipantItem styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: ParticipantItemStyles;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<ParticipantItemStrings>;\n /**\n * Optional callback when component is clicked\n */\n onClick?: (props?: ParticipantItemProps) => void;\n /** Optional value to determine if the tooltip should be shown for participants or not */\n showParticipantOverflowTooltip?: boolean;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Optional value to determine and display a participants connection status.\n * For example, `Connecting`, `Ringing` etc.\n * The actual text that is displayed is determined by the localized string\n * corresponding to the provided participant state.\n * For example, `strings.participantStateConnecting` will be used if `participantState` is `Connecting`.\n */\n participantState?: ParticipantState;\n /**\n * Optional aria property that prefixes the ParticipantItems aria content\n * Takes in a unique id value of the element you would like to be read before the ParticipantItem.\n */\n ariaLabelledBy?: string;\n}\n\n/**\n * Component to render a calling or chat participant.\n *\n * Displays the participant's avatar, displayName and status as well as optional icons and context menu.\n *\n * @public\n */\nexport const ParticipantItem = (props: ParticipantItemProps): JSX.Element => {\n const {\n userId,\n displayName,\n onRenderAvatar,\n menuItems,\n onRenderIcon,\n presence,\n styles,\n me,\n onClick,\n showParticipantOverflowTooltip\n } = props;\n const [itemHovered, setItemHovered] = useState<boolean>(false);\n const [menuHidden, setMenuHidden] = useState<boolean>(true);\n const containerRef = useRef<HTMLDivElement>(null);\n const theme = useTheme();\n const localeStrings = useLocale().strings.participantItem;\n const ids = useIdentifiers();\n const uniqueId = useId();\n\n const strings = { ...localeStrings, ...props.strings };\n const participantStateString = participantStateStringTrampoline(props, strings);\n const showMenuIcon = !participantStateString && (itemHovered || !menuHidden) && menuItems && menuItems?.length > 0;\n\n // For 'me' show empty name so avatar will get 'Person' icon, when there is no name\n const meAvatarText = displayName?.trim() || '';\n\n const avatarOptions = {\n text: me ? meAvatarText : displayName?.trim() || strings.displayNamePlaceholder,\n size: PersonaSize.size32,\n presence: presence,\n initialsTextColor: 'white',\n showOverflowTooltip: showParticipantOverflowTooltip,\n showUnknownPersonaCoin: !me && (!displayName?.trim() || displayName === strings.displayNamePlaceholder)\n };\n\n const avatar = onRenderAvatar ? (\n onRenderAvatar(userId ?? '', avatarOptions)\n ) : (\n <Persona\n className={mergeStyles(\n {\n // Prevents persona text from being vertically truncated if a global line height is less than 1.15.\n lineHeight: '1.15rem'\n },\n styles?.avatar\n )}\n {...avatarOptions}\n />\n );\n\n const meTextStyle = useMemo(\n () => mergeStyles(meContainerStyle, { color: theme.palette.neutralSecondary }, styles?.me),\n [theme.palette.neutralSecondary, styles?.me]\n );\n const contextualMenuStyle = useMemo(\n () => mergeStyles({ background: theme.palette.neutralLighterAlt }, styles?.menu),\n [theme.palette.neutralLighterAlt, styles?.menu]\n );\n const infoContainerStyle = useMemo(\n () =>\n mergeStyles(\n iconContainerStyle,\n { color: theme.palette.neutralSecondary, marginLeft: 'auto' },\n styles?.iconContainer\n ),\n [theme.palette.neutralSecondary, styles?.iconContainer]\n );\n\n const onDismissMenu = (): void => {\n setItemHovered(false);\n setMenuHidden(true);\n };\n\n const menuButton = useMemo(\n () => (\n <Stack\n horizontal={true}\n horizontalAlign=\"end\"\n className={mergeStyles(menuButtonContainerStyle, { color: theme.palette.neutralPrimary })}\n title={strings.menuTitle}\n data-ui-id={ids.participantItemMenuButton}\n >\n <Icon\n iconName=\"ParticipantItemOptionsHovered\"\n className={mergeStyles(iconStyles, !showMenuIcon ? displayNoneStyle : {})}\n />\n </Stack>\n ),\n [theme.palette.neutralPrimary, strings.menuTitle, ids.participantItemMenuButton, showMenuIcon]\n );\n\n return (\n <div\n ref={containerRef}\n role={'menuitem'}\n aria-disabled={(menuItems && menuItems.length > 0) || props.onClick ? false : true}\n data-is-focusable={true}\n data-ui-id=\"participant-item\"\n className={mergeStyles(\n participantItemContainerStyle({ clickable: !!menuItems && menuItems.length > 0 }, theme),\n styles?.root\n )}\n onMouseEnter={() => setItemHovered(true)}\n onMouseLeave={() => setItemHovered(false)}\n onClick={() => {\n if (!participantStateString) {\n setItemHovered(true);\n setMenuHidden(false);\n onClick?.(props);\n }\n if (!menuHidden) {\n onDismissMenu();\n }\n }}\n tabIndex={0}\n >\n <Stack\n horizontal\n className={mergeStyles({\n flexGrow: 1,\n maxWidth: '100%',\n alignItems: 'center'\n })}\n id={uniqueId}\n aria-labelledby={`${props.ariaLabelledBy} ${uniqueId}`}\n >\n {avatar}\n {me && <Text className={meTextStyle}>{strings.isMeText}</Text>}\n <Stack horizontal className={mergeStyles(infoContainerStyle)}>\n {!showMenuIcon && onRenderIcon && onRenderIcon(props)}\n {/* When the participantStateString has a value, we don't show the menu */}\n {!me && participantStateString ? (\n <Text data-ui-id=\"participant-item-state-string\" className={mergeStyles(participantStateStringStyles)}>\n {participantStateString}\n </Text>\n ) : (\n <>\n {menuItems && menuItems.length > 0 && (\n <>\n {menuButton}\n <ContextualMenu\n items={menuItems}\n hidden={menuHidden}\n target={containerRef}\n onItemClick={onDismissMenu}\n onDismiss={onDismissMenu}\n directionalHint={DirectionalHint.bottomRightEdge}\n className={contextualMenuStyle}\n calloutProps={{\n preventDismissOnEvent\n }}\n />\n </>\n )}\n </>\n )}\n </Stack>\n </Stack>\n </div>\n );\n};\n\nconst participantStateStringTrampoline = (\n props: ParticipantItemProps,\n strings: ParticipantItemStrings\n): string | undefined => {\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n return props.participantState === 'EarlyMedia' || props.participantState === 'Ringing'\n ? strings?.participantStateRinging\n : props.participantState === 'Hold'\n ? strings?.participantStateHold\n : undefined;\n\n return undefined;\n};\n"]}
|
1
|
+
{"version":3,"file":"ParticipantItem.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/ParticipantItem.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,cAAc,EACd,eAAe,EACf,IAAI,EAGJ,WAAW,EACX,OAAO,EAEP,WAAW,EACX,KAAK,EACL,IAAI,EACL,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAA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E,oBAAoB;YAC/B,CAAC,CAAC,SAAS,CAAC;IAEhB,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n ContextualMenu,\n DirectionalHint,\n Icon,\n IContextualMenuItem,\n IStyle,\n mergeStyles,\n Persona,\n PersonaPresence,\n PersonaSize,\n Stack,\n Text\n} from '@fluentui/react';\nimport React, { useMemo, useRef, useState } from 'react';\nimport { useIdentifiers } from '../identifiers';\nimport { useLocale } from '../localization';\nimport { useTheme } from '../theming';\nimport { BaseCustomStyles, OnRenderAvatarCallback } from '../types';\nimport {\n displayNoneStyle,\n iconContainerStyle,\n iconStyles,\n meContainerStyle,\n menuButtonContainerStyle,\n participantItemContainerStyle,\n participantStateStringStyles\n} from './styles/ParticipantItem.styles';\nimport { _preventDismissOnEvent as preventDismissOnEvent } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(one-to-n-calling) */\n/* @conditional-compile-remove(PSTN-calls) */\nimport { ParticipantState } from '../types';\nimport { useId } from '@fluentui/react-hooks';\n\n/**\n * Fluent styles for {@link ParticipantItem}.\n *\n * @public\n */\nexport interface ParticipantItemStyles extends BaseCustomStyles {\n /** Styles for the avatar. */\n avatar?: IStyle;\n /** Styles for the (You) string. */\n me?: IStyle;\n /** Styles for the container of the icon. */\n iconContainer?: IStyle;\n /** Styles for the menu. */\n menu?: IStyle;\n}\n\n/**\n * Strings of {@link ParticipantItem} that can be overridden.\n *\n * @public\n */\nexport interface ParticipantItemStrings {\n /** String shown when participant is me */\n isMeText: string;\n /** String shown when hovering over menu button */\n menuTitle: string;\n /** Label for the remove button in participant menu */\n removeButtonLabel: string;\n /** Label for the sharing icon in participant state stack */\n sharingIconLabel: string;\n /** Label for the muted icon in participant state stack */\n mutedIconLabel: string;\n /** placeholder text for participants who does not have a display name*/\n displayNamePlaceholder?: string;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /** String shown when `participantState` is `Ringing` */\n participantStateRinging?: string;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /** String shown when `participantState` is `Hold` */\n participantStateHold?: string;\n /** String for the attendee role */\n attendeeRole: string;\n}\n\n/**\n * Props for {@link ParticipantItem}.\n *\n * @public\n */\nexport interface ParticipantItemProps {\n /** Unique User ID of the participant. This `userId` is available in the `onRenderAvatar` callback function */\n userId?: string;\n /** Name of participant. */\n displayName?: string;\n /** Optional indicator to show participant is the user. */\n me?: boolean;\n /** Optional callback returning a JSX element to override avatar. */\n onRenderAvatar?: OnRenderAvatarCallback;\n /** Optional array of IContextualMenuItem for contextual menu. */\n menuItems?: IContextualMenuItem[];\n /** Optional callback returning a JSX element rendered on the right portion of the ParticipantItem. Intended for adding icons. */\n onRenderIcon?: (props?: ParticipantItemProps) => JSX.Element | null;\n /** Optional PersonaPresence to show participant presence. This will not have an effect if property avatar is assigned. */\n presence?: PersonaPresence;\n /**\n * Allows users to pass in an object contains custom CSS styles.\n * @Example\n * ```\n * <ParticipantItem styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: ParticipantItemStyles;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<ParticipantItemStrings>;\n /**\n * Optional callback when component is clicked\n */\n onClick?: (props?: ParticipantItemProps) => void;\n /** Optional value to determine if the tooltip should be shown for participants or not */\n showParticipantOverflowTooltip?: boolean;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Optional value to determine and display a participants connection status.\n * For example, `Connecting`, `Ringing` etc.\n * The actual text that is displayed is determined by the localized string\n * corresponding to the provided participant state.\n * For example, `strings.participantStateConnecting` will be used if `participantState` is `Connecting`.\n */\n participantState?: ParticipantState;\n /**\n * Optional aria property that prefixes the ParticipantItems aria content\n * Takes in a unique id value of the element you would like to be read before the ParticipantItem.\n */\n ariaLabelledBy?: string;\n}\n\n/**\n * Component to render a calling or chat participant.\n *\n * Displays the participant's avatar, displayName and status as well as optional icons and context menu.\n *\n * @public\n */\nexport const ParticipantItem = (props: ParticipantItemProps): JSX.Element => {\n const {\n userId,\n displayName,\n onRenderAvatar,\n menuItems,\n onRenderIcon,\n presence,\n styles,\n me,\n onClick,\n showParticipantOverflowTooltip\n } = props;\n const [itemHovered, setItemHovered] = useState<boolean>(false);\n const [menuHidden, setMenuHidden] = useState<boolean>(true);\n const containerRef = useRef<HTMLDivElement>(null);\n const theme = useTheme();\n const localeStrings = useLocale().strings.participantItem;\n const ids = useIdentifiers();\n const uniqueId = useId();\n\n const strings = { ...localeStrings, ...props.strings };\n const participantStateString = participantStateStringTrampoline(props, strings);\n const showMenuIcon = !participantStateString && (itemHovered || !menuHidden) && menuItems && menuItems?.length > 0;\n\n // For 'me' show empty name so avatar will get 'Person' icon, when there is no name\n const meAvatarText = displayName?.trim() || '';\n\n const avatarOptions = {\n text: me ? meAvatarText : displayName?.trim() || strings.displayNamePlaceholder,\n size: PersonaSize.size32,\n presence: presence,\n initialsTextColor: 'white',\n showOverflowTooltip: showParticipantOverflowTooltip,\n showUnknownPersonaCoin: !me && (!displayName?.trim() || displayName === strings.displayNamePlaceholder)\n };\n\n const avatar = onRenderAvatar ? (\n onRenderAvatar(userId ?? '', avatarOptions)\n ) : (\n <Persona\n className={mergeStyles(\n {\n // Prevents persona text from being vertically truncated if a global line height is less than 1.15.\n lineHeight: '1.15rem'\n },\n styles?.avatar\n )}\n {...avatarOptions}\n />\n );\n\n const meTextStyle = useMemo(\n () => mergeStyles(meContainerStyle, { color: theme.palette.neutralSecondary }, styles?.me),\n [theme.palette.neutralSecondary, styles?.me]\n );\n const contextualMenuStyle = useMemo(\n () => mergeStyles({ background: theme.palette.neutralLighterAlt }, styles?.menu),\n [theme.palette.neutralLighterAlt, styles?.menu]\n );\n const infoContainerStyle = useMemo(\n () =>\n mergeStyles(\n iconContainerStyle,\n { color: theme.palette.neutralSecondary, marginLeft: 'auto' },\n styles?.iconContainer\n ),\n [theme.palette.neutralSecondary, styles?.iconContainer]\n );\n\n const onDismissMenu = (): void => {\n setItemHovered(false);\n setMenuHidden(true);\n };\n\n const menuButton = useMemo(\n () => (\n <Stack\n horizontal={true}\n horizontalAlign=\"end\"\n className={mergeStyles(menuButtonContainerStyle, { color: theme.palette.neutralPrimary })}\n title={strings.menuTitle}\n data-ui-id={ids.participantItemMenuButton}\n >\n <Icon\n iconName=\"ParticipantItemOptionsHovered\"\n className={mergeStyles(iconStyles, !showMenuIcon ? displayNoneStyle : {})}\n />\n </Stack>\n ),\n [theme.palette.neutralPrimary, strings.menuTitle, ids.participantItemMenuButton, showMenuIcon]\n );\n\n return (\n <div\n ref={containerRef}\n role={'menuitem'}\n aria-disabled={(menuItems && menuItems.length > 0) || props.onClick ? false : true}\n data-is-focusable={true}\n data-ui-id=\"participant-item\"\n className={mergeStyles(\n participantItemContainerStyle({ clickable: !!menuItems && menuItems.length > 0 }, theme),\n styles?.root\n )}\n onMouseEnter={() => setItemHovered(true)}\n onMouseLeave={() => setItemHovered(false)}\n onClick={() => {\n if (!participantStateString) {\n setItemHovered(true);\n setMenuHidden(false);\n onClick?.(props);\n }\n if (!menuHidden) {\n onDismissMenu();\n }\n }}\n tabIndex={0}\n >\n <Stack\n horizontal\n className={mergeStyles({\n flexGrow: 1,\n maxWidth: '100%',\n alignItems: 'center'\n })}\n id={uniqueId}\n aria-labelledby={`${props.ariaLabelledBy} ${uniqueId}`}\n >\n {avatar}\n {me && <Text className={meTextStyle}>{strings.isMeText}</Text>}\n <Stack horizontal className={mergeStyles(infoContainerStyle)}>\n {!showMenuIcon && onRenderIcon && onRenderIcon(props)}\n {/* When the participantStateString has a value, we don't show the menu */}\n {!me && participantStateString ? (\n <Text data-ui-id=\"participant-item-state-string\" className={mergeStyles(participantStateStringStyles)}>\n {participantStateString}\n </Text>\n ) : (\n <>\n {menuItems && menuItems.length > 0 && (\n <>\n {menuButton}\n <ContextualMenu\n items={menuItems}\n hidden={menuHidden}\n target={containerRef}\n onItemClick={onDismissMenu}\n onDismiss={onDismissMenu}\n directionalHint={DirectionalHint.bottomRightEdge}\n className={contextualMenuStyle}\n calloutProps={{\n preventDismissOnEvent\n }}\n />\n </>\n )}\n </>\n )}\n </Stack>\n </Stack>\n </div>\n );\n};\n\nconst participantStateStringTrampoline = (\n props: ParticipantItemProps,\n strings: ParticipantItemStrings\n): string | undefined => {\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n return props.participantState === 'EarlyMedia' || props.participantState === 'Ringing'\n ? strings?.participantStateRinging\n : props.participantState === 'Hold'\n ? strings?.participantStateHold\n : undefined;\n\n return undefined;\n};\n"]}
|
@@ -17,16 +17,13 @@ const onRenderParticipantDefault = (participant, strings, myUserId, onRenderAvat
|
|
17
17
|
presence = PersonaPresence.none;
|
18
18
|
}
|
19
19
|
const menuItems = createParticipantMenuItems && createParticipantMenuItems(participant);
|
20
|
-
|
21
|
-
/* @conditional-compile-remove(hide-attendee-name) */
|
22
|
-
const formatDisplayName = () => {
|
20
|
+
const formatDisplayName = (displayName) => {
|
23
21
|
if (displayName && strings.attendeeRole) {
|
24
22
|
return _formatString(displayName, { AttendeeRole: strings.attendeeRole });
|
25
23
|
}
|
26
24
|
return displayName;
|
27
25
|
};
|
28
|
-
|
29
|
-
displayName = formatDisplayName();
|
26
|
+
const displayName = formatDisplayName(participant.displayName);
|
30
27
|
const callingPalette = theme.callingPalette;
|
31
28
|
const isPinned = pinnedParticipants && (pinnedParticipants === null || pinnedParticipants === void 0 ? void 0 : pinnedParticipants.includes(participant.userId));
|
32
29
|
const onRenderIcon = (callingParticipant === null || callingParticipant === void 0 ? void 0 : callingParticipant.isScreenSharing) || (callingParticipant === null || callingParticipant === void 0 ? void 0 : callingParticipant.isMuted) || (callingParticipant === null || callingParticipant === void 0 ? void 0 : callingParticipant.raisedHand) || isPinned
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ParticipantList.js","sourceRoot":"","sources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EAAE;SACzE,CAAC,CACG,CACR,CAEC,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n Icon,\n IContextualMenuItem,\n IContextualMenuItemStyles,\n merge,\n mergeStyles,\n PersonaPresence,\n Stack,\n Theme\n} from '@fluentui/react';\nimport { Text } from '@fluentui/react';\nimport { useTheme, CallingTheme } from '../theming';\nimport { RaisedHandIcon } from './assets/RaisedHandIcon';\nimport React, { useCallback, useMemo } from 'react';\nimport { useIdentifiers } from '../identifiers';\nimport { useLocale } from '../localization';\nimport {\n BaseCustomStyles,\n CallParticipantListParticipant,\n OnRenderAvatarCallback,\n ParticipantListParticipant\n} from '../types';\nimport { CustomAvatarOptions } from '../types';\nimport { ParticipantItem, ParticipantItemStrings, ParticipantItemStyles } from './ParticipantItem';\nimport { iconStyles, participantListItemStyle, participantListStyle } from './styles/ParticipantList.styles';\nimport { _formatString } from '@internal/acs-ui-common';\n\n/**\n * Styles for the {@link ParticipantList} {@link ParticipantItem}.\n *\n * @public\n */\nexport interface ParticipantListItemStyles extends ParticipantItemStyles {\n /** Styles applied to the sub-menu of the {@link ParticipantList} {@link ParticipantItem}. */\n participantSubMenuItemsStyles?: IContextualMenuItemStyles;\n}\n\n/**\n * Styles for the {@link ParticipantList}.\n *\n * @public\n */\nexport interface ParticipantListStyles extends BaseCustomStyles {\n /** Styles for the {@link ParticipantList} {@link ParticipantItem}. */\n participantItemStyles?: ParticipantListItemStyles;\n}\n\n/* @conditional-compile-remove(total-participant-count) */\n/**\n * Strings for the {@link ParticipantList}.\n *\n * @beta\n */\nexport interface ParticipantListStrings {\n /**\n * String for rendering the count of participants not contained in the displayed participant list\n */\n overflowParticipantCount?: string;\n}\n\n/**\n * A callback for providing custom menu items for each participant in {@link ParticipantList}.\n *\n * @public\n */\nexport type ParticipantMenuItemsCallback = (\n participantUserId: string,\n userId?: string,\n defaultMenuItems?: IContextualMenuItem[]\n) => IContextualMenuItem[];\n\n/**\n * Props for {@link ParticipantList}.\n *\n * @public\n */\nexport type ParticipantListProps = {\n /** Participants in user call or chat */\n participants: ParticipantListParticipant[];\n /** User ID of user */\n myUserId?: string;\n /**\n * If set to `true`, excludes the local participant from the participant list with use of `myUserId` props (required in this case).\n *\n * @defaultValue `false`\n */\n excludeMe?: boolean;\n /** Optional callback to render each participant. If no callback is provided, each participant will be rendered with `ParticipantItem` */\n onRenderParticipant?: (participant: ParticipantListParticipant) => JSX.Element | null;\n /** Optional callback to render the avatar for each participant. This property will have no effect if `onRenderParticipant` is assigned. */\n onRenderAvatar?: OnRenderAvatarCallback;\n /** Optional callback to render the context menu for each participant */\n onRemoveParticipant?: (userId: string) => void;\n /** Optional callback to render custom menu items for each participant. */\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n /** Optional callback when rendered ParticipantItem is clicked */\n onParticipantClick?: (participant?: ParticipantListParticipant) => void;\n /* @conditional-compile-remove(soft-mute) */\n /** Optional callback to render a context menu to mute a participant */\n onMuteParticipant?: (userId: string) => Promise<void>;\n styles?: ParticipantListStyles;\n /** Optional value to determine if the tooltip should be shown for participants or not */\n showParticipantOverflowTooltip?: boolean;\n /* @conditional-compile-remove(total-participant-count) */\n /** Total number of people in the call. This number can be larger than the remote participant count. */\n totalParticipantCount?: number;\n /* @conditional-compile-remove(total-participant-count) */\n /** Strings for the participant list */\n strings?: ParticipantListStrings;\n /** Optional aria-labelledby prop that prefixes each ParticipantItem aria-label */\n participantAriaLabelledBy?: string;\n /** List of pinned participants */\n pinnedParticipants?: string[];\n};\n\nconst onRenderParticipantDefault = (\n participant: ParticipantListParticipant,\n strings: ParticipantItemStrings,\n myUserId?: string,\n onRenderAvatar?: OnRenderAvatarCallback,\n createParticipantMenuItems?: (participant: ParticipantListParticipant) => IContextualMenuItem[],\n styles?: ParticipantListItemStyles,\n onParticipantClick?: (participant?: ParticipantListParticipant) => void,\n showParticipantOverflowTooltip?: boolean,\n participantAriaLabelledBy?: string,\n theme?: Theme,\n pinnedParticipants?: string[]\n): JSX.Element | null => {\n const callingParticipant = participant as CallParticipantListParticipant;\n\n let presence: PersonaPresence | undefined = undefined;\n if (callingParticipant) {\n presence = PersonaPresence.none;\n }\n\n const menuItems = createParticipantMenuItems && createParticipantMenuItems(participant);\n\n let displayName = participant.displayName;\n\n /* @conditional-compile-remove(hide-attendee-name) */\n const formatDisplayName = (): string | undefined => {\n if (displayName && strings.attendeeRole) {\n return _formatString(displayName, { AttendeeRole: strings.attendeeRole });\n }\n return displayName;\n };\n /* @conditional-compile-remove(hide-attendee-name) */\n displayName = formatDisplayName();\n\n const callingPalette = (theme as unknown as CallingTheme).callingPalette;\n\n const isPinned = pinnedParticipants && pinnedParticipants?.includes(participant.userId);\n\n const onRenderIcon =\n callingParticipant?.isScreenSharing || callingParticipant?.isMuted || callingParticipant?.raisedHand || isPinned\n ? () => (\n <Stack horizontal={true} tokens={{ childrenGap: '0.5rem' }}>\n {callingParticipant.raisedHand && (\n <Stack\n horizontal={true}\n tokens={{ childrenGap: '0.2rem' }}\n style={{\n alignItems: 'center',\n padding: '0.1rem 0.2rem',\n backgroundColor: theme?.palette.neutralLighter,\n borderRadius: '0.3rem'\n }}\n >\n {callingParticipant.raisedHand.raisedHandOrderPosition && (\n <Stack.Item>\n <Text>{callingParticipant.raisedHand?.raisedHandOrderPosition}</Text>\n </Stack.Item>\n )}\n <Stack.Item>\n <RaisedHandIcon />\n </Stack.Item>\n </Stack>\n )}\n {callingParticipant.isScreenSharing && (\n <Icon\n iconName=\"ParticipantItemScreenShareStart\"\n className={iconStyles}\n ariaLabel={strings.sharingIconLabel}\n />\n )}\n {callingParticipant.isMuted && (\n <Icon iconName=\"ParticipantItemMicOff\" className={iconStyles} ariaLabel={strings.mutedIconLabel} />\n )}\n {callingParticipant.spotlight && <Icon iconName=\"ParticipantItemSpotlighted\" className={iconStyles} />}\n\n {isPinned && <Icon iconName=\"ParticipantItemPinned\" className={iconStyles} />}\n </Stack>\n )\n : () => null;\n\n const onRenderAvatarWithRaiseHand =\n callingParticipant?.raisedHand && onRenderAvatar\n ? (\n userId?: string,\n options?: CustomAvatarOptions,\n defaultOnRender?: (props: CustomAvatarOptions) => JSX.Element\n ) =>\n onRenderAvatar(\n userId,\n { ...options, styles: { root: { border: callingPalette.raiseHandGold } } },\n defaultOnRender\n )\n : onRenderAvatar;\n\n return (\n <ParticipantItem\n styles={styles}\n key={participant.userId}\n userId={participant.userId}\n displayName={displayName}\n me={myUserId ? participant.userId === myUserId : false}\n menuItems={menuItems}\n presence={presence}\n onRenderIcon={onRenderIcon}\n onRenderAvatar={onRenderAvatarWithRaiseHand}\n onClick={onParticipantClick ? () => onParticipantClick?.(participant) : undefined}\n showParticipantOverflowTooltip={showParticipantOverflowTooltip}\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n participantState={callingParticipant.state}\n ariaLabelledBy={participantAriaLabelledBy}\n />\n );\n};\n\n/**\n * Sort participants by raised hand order position\n */\nconst sortParticipants = (participants: ParticipantListParticipant[]): ParticipantListParticipant[] => {\n const isParticipantListCallParticipant = function (participant: ParticipantListParticipant): boolean {\n return 'raisedHand' in participant;\n };\n\n participants.sort((a, b) => {\n if (!isParticipantListCallParticipant(a) || !isParticipantListCallParticipant(b)) {\n return 0;\n }\n const callA = a as CallParticipantListParticipant;\n const callB = b as CallParticipantListParticipant;\n if (callA.raisedHand && callB.raisedHand) {\n return callA.raisedHand.raisedHandOrderPosition - callB.raisedHand.raisedHandOrderPosition;\n } else if (callA.raisedHand) {\n return -1;\n } else if (callB.raisedHand) {\n return 1;\n }\n return 0;\n });\n return participants;\n};\n\nconst getParticipantsForDefaultRender = (\n participants: ParticipantListParticipant[],\n excludeMe: boolean,\n myUserId: string | undefined\n): ParticipantListParticipant[] => {\n if (!excludeMe || !myUserId) {\n return [...participants];\n }\n\n const userIndex = participants.map((p) => p.userId).indexOf(myUserId);\n\n if (userIndex === -1) {\n return [...participants];\n }\n\n const remoteParticipants = [...participants];\n remoteParticipants.splice(userIndex, 1);\n\n return remoteParticipants;\n};\n\n/**\n * Component to render all calling or chat participants.\n *\n * By default, each participant is rendered with {@link ParticipantItem}. See {@link ParticipantListProps.onRenderParticipant} to override.\n *\n * @public\n */\nexport const ParticipantList = (props: ParticipantListProps): JSX.Element => {\n const {\n excludeMe = false,\n myUserId,\n participants,\n onRemoveParticipant,\n onRenderAvatar,\n onRenderParticipant,\n onFetchParticipantMenuItems,\n showParticipantOverflowTooltip,\n /* @conditional-compile-remove(total-participant-count) */\n totalParticipantCount,\n /* @conditional-compile-remove(total-participant-count) */\n strings,\n participantAriaLabelledBy,\n pinnedParticipants\n } = props;\n\n const theme = useTheme();\n const ids = useIdentifiers();\n const participantItemStrings = useLocale().strings.participantItem;\n /* @conditional-compile-remove(total-participant-count) */\n const participantListStrings = useLocale().strings.ParticipantList;\n\n const displayedParticipants: ParticipantListParticipant[] = useMemo(() => {\n return onRenderParticipant ? participants : getParticipantsForDefaultRender(participants, excludeMe, myUserId);\n }, [participants, excludeMe, myUserId, onRenderParticipant]);\n\n sortParticipants(displayedParticipants);\n\n const createParticipantMenuItems = useCallback(\n (participant: ParticipantListParticipant): IContextualMenuItem[] => {\n let menuItems: IContextualMenuItem[] = [];\n\n const participantIsRemovable = participant.isRemovable;\n if (participant.userId !== myUserId && onRemoveParticipant && participantIsRemovable) {\n menuItems.push({\n key: 'remove',\n text: participantItemStrings.removeButtonLabel,\n onClick: () => onRemoveParticipant(participant.userId),\n itemProps: {\n styles: props.styles?.participantItemStyles?.participantSubMenuItemsStyles\n },\n iconProps: {\n iconName: 'ContextMenuRemoveParticipant',\n styles: { root: { lineHeight: 0 } }\n },\n 'data-ui-id': ids.participantListRemoveParticipantButton\n });\n }\n\n if (onFetchParticipantMenuItems) {\n menuItems = onFetchParticipantMenuItems(participant.userId, myUserId, menuItems);\n }\n\n return menuItems;\n },\n [\n ids.participantListRemoveParticipantButton,\n myUserId,\n onFetchParticipantMenuItems,\n onRemoveParticipant,\n props.styles?.participantItemStyles?.participantSubMenuItemsStyles,\n participantItemStrings.removeButtonLabel\n ]\n );\n\n const participantItemStyles = useMemo(\n () => merge(participantListItemStyle, props.styles?.participantItemStyles),\n [props.styles?.participantItemStyles]\n );\n\n /* @conditional-compile-remove(total-participant-count) */\n const overflowParticipantCountString =\n strings?.overflowParticipantCount ?? participantListStrings?.overflowParticipantCount;\n\n return (\n <Stack\n data-ui-id={ids.participantList}\n className={mergeStyles(participantListStyle, props.styles?.root)}\n role={'menu'}\n >\n {displayedParticipants.map((participant: ParticipantListParticipant) =>\n onRenderParticipant\n ? onRenderParticipant(participant)\n : onRenderParticipantDefault(\n participant,\n participantItemStrings,\n myUserId,\n onRenderAvatar,\n createParticipantMenuItems,\n participantItemStyles,\n props.onParticipantClick,\n showParticipantOverflowTooltip,\n participantAriaLabelledBy,\n theme,\n pinnedParticipants\n )\n )}\n {\n /* @conditional-compile-remove(total-participant-count) */ overflowParticipantCountString &&\n totalParticipantCount &&\n totalParticipantCount > displayedParticipants.length && (\n <Text style={{ fontWeight: 400, margin: '0.5rem' }}>\n {_formatString(overflowParticipantCountString, {\n overflowCount: `${totalParticipantCount - displayedParticipants.length}`\n })}\n </Text>\n )\n }\n </Stack>\n );\n};\n"]}
|
1
|
+
{"version":3,"file":"ParticipantList.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/ParticipantList.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,IAAI,EAGJ,KAAK,EACL,WAAW,EACX,eAAe,EACf,KAAK,EAEN,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAgB,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACpD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B,uBAAtB,sBAAsB,CAAE,wBAAwB,CAAC;IAExF,OAAO,CACL,oBAAC,KAAK,kBACQ,GAAG,CAAC,eAAe,EAC/B,SAAS,EAAE,WAAW,CAAC,oBAAoB,EAAE,MAAA,KAAK,CAAC,MAAM,0CAAE,IAAI,CAAC,EAChE,IAAI,EAAE,MAAM;QAEX,qBAAqB,CAAC,GAAG,CAAC,CAAC,WAAuC,EAAE,EAAE,CACrE,mBAAmB;YACjB,CAAC,CAAC,mBAAmB,CAAC,WAAW,CAAC;YAClC,CAAC,CAAC,0BAA0B,CACxB,WAAW,EACX,sBAAsB,EACtB,QAAQ,EACR,cAAc,EACd,0BAA0B,EAC1B,qBAAqB,EACrB,KAAK,CAAC,kBAAkB,EACxB,8BAA8B,EAC9B,yBAAyB,EACzB,KAAK,EACL,kBAAkB,CACnB,CACN;QAEC,0DAA0D,CAAC,8BAA8B;YACvF,qBAAqB;YACrB,qBAAqB,GAAG,qBAAqB,CAAC,MAAM,IAAI,CACtD,oBAAC,IAAI,IAAC,KAAK,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,IAC/C,aAAa,CAAC,8BAA8B,EAAE;YAC7C,aAAa,EAAE,GAAG,qBAAqB,GAAG,qBAAqB,CAAC,MAAM,EAAE;SACzE,CAAC,CACG,CACR,CAEC,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n Icon,\n IContextualMenuItem,\n IContextualMenuItemStyles,\n merge,\n mergeStyles,\n PersonaPresence,\n Stack,\n Theme\n} from '@fluentui/react';\nimport { Text } from '@fluentui/react';\nimport { useTheme, CallingTheme } from '../theming';\nimport { RaisedHandIcon } from './assets/RaisedHandIcon';\nimport React, { useCallback, useMemo } from 'react';\nimport { useIdentifiers } from '../identifiers';\nimport { useLocale } from '../localization';\nimport {\n BaseCustomStyles,\n CallParticipantListParticipant,\n OnRenderAvatarCallback,\n ParticipantListParticipant\n} from '../types';\nimport { CustomAvatarOptions } from '../types';\nimport { ParticipantItem, ParticipantItemStrings, ParticipantItemStyles } from './ParticipantItem';\nimport { iconStyles, participantListItemStyle, participantListStyle } from './styles/ParticipantList.styles';\nimport { _formatString } from '@internal/acs-ui-common';\n\n/**\n * Styles for the {@link ParticipantList} {@link ParticipantItem}.\n *\n * @public\n */\nexport interface ParticipantListItemStyles extends ParticipantItemStyles {\n /** Styles applied to the sub-menu of the {@link ParticipantList} {@link ParticipantItem}. */\n participantSubMenuItemsStyles?: IContextualMenuItemStyles;\n}\n\n/**\n * Styles for the {@link ParticipantList}.\n *\n * @public\n */\nexport interface ParticipantListStyles extends BaseCustomStyles {\n /** Styles for the {@link ParticipantList} {@link ParticipantItem}. */\n participantItemStyles?: ParticipantListItemStyles;\n}\n\n/* @conditional-compile-remove(total-participant-count) */\n/**\n * Strings for the {@link ParticipantList}.\n *\n * @beta\n */\nexport interface ParticipantListStrings {\n /**\n * String for rendering the count of participants not contained in the displayed participant list\n */\n overflowParticipantCount?: string;\n}\n\n/**\n * A callback for providing custom menu items for each participant in {@link ParticipantList}.\n *\n * @public\n */\nexport type ParticipantMenuItemsCallback = (\n participantUserId: string,\n userId?: string,\n defaultMenuItems?: IContextualMenuItem[]\n) => IContextualMenuItem[];\n\n/**\n * Props for {@link ParticipantList}.\n *\n * @public\n */\nexport type ParticipantListProps = {\n /** Participants in user call or chat */\n participants: ParticipantListParticipant[];\n /** User ID of user */\n myUserId?: string;\n /**\n * If set to `true`, excludes the local participant from the participant list with use of `myUserId` props (required in this case).\n *\n * @defaultValue `false`\n */\n excludeMe?: boolean;\n /** Optional callback to render each participant. If no callback is provided, each participant will be rendered with `ParticipantItem` */\n onRenderParticipant?: (participant: ParticipantListParticipant) => JSX.Element | null;\n /** Optional callback to render the avatar for each participant. This property will have no effect if `onRenderParticipant` is assigned. */\n onRenderAvatar?: OnRenderAvatarCallback;\n /** Optional callback to render the context menu for each participant */\n onRemoveParticipant?: (userId: string) => void;\n /** Optional callback to render custom menu items for each participant. */\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n /** Optional callback when rendered ParticipantItem is clicked */\n onParticipantClick?: (participant?: ParticipantListParticipant) => void;\n /* @conditional-compile-remove(soft-mute) */\n /** Optional callback to render a context menu to mute a participant */\n onMuteParticipant?: (userId: string) => Promise<void>;\n styles?: ParticipantListStyles;\n /** Optional value to determine if the tooltip should be shown for participants or not */\n showParticipantOverflowTooltip?: boolean;\n /* @conditional-compile-remove(total-participant-count) */\n /** Total number of people in the call. This number can be larger than the remote participant count. */\n totalParticipantCount?: number;\n /* @conditional-compile-remove(total-participant-count) */\n /** Strings for the participant list */\n strings?: ParticipantListStrings;\n /** Optional aria-labelledby prop that prefixes each ParticipantItem aria-label */\n participantAriaLabelledBy?: string;\n /** List of pinned participants */\n pinnedParticipants?: string[];\n};\n\nconst onRenderParticipantDefault = (\n participant: ParticipantListParticipant,\n strings: ParticipantItemStrings,\n myUserId?: string,\n onRenderAvatar?: OnRenderAvatarCallback,\n createParticipantMenuItems?: (participant: ParticipantListParticipant) => IContextualMenuItem[],\n styles?: ParticipantListItemStyles,\n onParticipantClick?: (participant?: ParticipantListParticipant) => void,\n showParticipantOverflowTooltip?: boolean,\n participantAriaLabelledBy?: string,\n theme?: Theme,\n pinnedParticipants?: string[]\n): JSX.Element | null => {\n const callingParticipant = participant as CallParticipantListParticipant;\n\n let presence: PersonaPresence | undefined = undefined;\n if (callingParticipant) {\n presence = PersonaPresence.none;\n }\n\n const menuItems = createParticipantMenuItems && createParticipantMenuItems(participant);\n\n const formatDisplayName = (displayName?: string): string | undefined => {\n if (displayName && strings.attendeeRole) {\n return _formatString(displayName, { AttendeeRole: strings.attendeeRole });\n }\n return displayName;\n };\n const displayName = formatDisplayName(participant.displayName);\n\n const callingPalette = (theme as unknown as CallingTheme).callingPalette;\n\n const isPinned = pinnedParticipants && pinnedParticipants?.includes(participant.userId);\n\n const onRenderIcon =\n callingParticipant?.isScreenSharing || callingParticipant?.isMuted || callingParticipant?.raisedHand || isPinned\n ? () => (\n <Stack horizontal={true} tokens={{ childrenGap: '0.5rem' }}>\n {callingParticipant.raisedHand && (\n <Stack\n horizontal={true}\n tokens={{ childrenGap: '0.2rem' }}\n style={{\n alignItems: 'center',\n padding: '0.1rem 0.2rem',\n backgroundColor: theme?.palette.neutralLighter,\n borderRadius: '0.3rem'\n }}\n >\n {callingParticipant.raisedHand.raisedHandOrderPosition && (\n <Stack.Item>\n <Text>{callingParticipant.raisedHand?.raisedHandOrderPosition}</Text>\n </Stack.Item>\n )}\n <Stack.Item>\n <RaisedHandIcon />\n </Stack.Item>\n </Stack>\n )}\n {callingParticipant.isScreenSharing && (\n <Icon\n iconName=\"ParticipantItemScreenShareStart\"\n className={iconStyles}\n ariaLabel={strings.sharingIconLabel}\n />\n )}\n {callingParticipant.isMuted && (\n <Icon iconName=\"ParticipantItemMicOff\" className={iconStyles} ariaLabel={strings.mutedIconLabel} />\n )}\n {callingParticipant.spotlight && <Icon iconName=\"ParticipantItemSpotlighted\" className={iconStyles} />}\n\n {isPinned && <Icon iconName=\"ParticipantItemPinned\" className={iconStyles} />}\n </Stack>\n )\n : () => null;\n\n const onRenderAvatarWithRaiseHand =\n callingParticipant?.raisedHand && onRenderAvatar\n ? (\n userId?: string,\n options?: CustomAvatarOptions,\n defaultOnRender?: (props: CustomAvatarOptions) => JSX.Element\n ) =>\n onRenderAvatar(\n userId,\n { ...options, styles: { root: { border: callingPalette.raiseHandGold } } },\n defaultOnRender\n )\n : onRenderAvatar;\n\n return (\n <ParticipantItem\n styles={styles}\n key={participant.userId}\n userId={participant.userId}\n displayName={displayName}\n me={myUserId ? participant.userId === myUserId : false}\n menuItems={menuItems}\n presence={presence}\n onRenderIcon={onRenderIcon}\n onRenderAvatar={onRenderAvatarWithRaiseHand}\n onClick={onParticipantClick ? () => onParticipantClick?.(participant) : undefined}\n showParticipantOverflowTooltip={showParticipantOverflowTooltip}\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n participantState={callingParticipant.state}\n ariaLabelledBy={participantAriaLabelledBy}\n />\n );\n};\n\n/**\n * Sort participants by raised hand order position\n */\nconst sortParticipants = (participants: ParticipantListParticipant[]): ParticipantListParticipant[] => {\n const isParticipantListCallParticipant = function (participant: ParticipantListParticipant): boolean {\n return 'raisedHand' in participant;\n };\n\n participants.sort((a, b) => {\n if (!isParticipantListCallParticipant(a) || !isParticipantListCallParticipant(b)) {\n return 0;\n }\n const callA = a as CallParticipantListParticipant;\n const callB = b as CallParticipantListParticipant;\n if (callA.raisedHand && callB.raisedHand) {\n return callA.raisedHand.raisedHandOrderPosition - callB.raisedHand.raisedHandOrderPosition;\n } else if (callA.raisedHand) {\n return -1;\n } else if (callB.raisedHand) {\n return 1;\n }\n return 0;\n });\n return participants;\n};\n\nconst getParticipantsForDefaultRender = (\n participants: ParticipantListParticipant[],\n excludeMe: boolean,\n myUserId: string | undefined\n): ParticipantListParticipant[] => {\n if (!excludeMe || !myUserId) {\n return [...participants];\n }\n\n const userIndex = participants.map((p) => p.userId).indexOf(myUserId);\n\n if (userIndex === -1) {\n return [...participants];\n }\n\n const remoteParticipants = [...participants];\n remoteParticipants.splice(userIndex, 1);\n\n return remoteParticipants;\n};\n\n/**\n * Component to render all calling or chat participants.\n *\n * By default, each participant is rendered with {@link ParticipantItem}. See {@link ParticipantListProps.onRenderParticipant} to override.\n *\n * @public\n */\nexport const ParticipantList = (props: ParticipantListProps): JSX.Element => {\n const {\n excludeMe = false,\n myUserId,\n participants,\n onRemoveParticipant,\n onRenderAvatar,\n onRenderParticipant,\n onFetchParticipantMenuItems,\n showParticipantOverflowTooltip,\n /* @conditional-compile-remove(total-participant-count) */\n totalParticipantCount,\n /* @conditional-compile-remove(total-participant-count) */\n strings,\n participantAriaLabelledBy,\n pinnedParticipants\n } = props;\n\n const theme = useTheme();\n const ids = useIdentifiers();\n const participantItemStrings = useLocale().strings.participantItem;\n /* @conditional-compile-remove(total-participant-count) */\n const participantListStrings = useLocale().strings.ParticipantList;\n\n const displayedParticipants: ParticipantListParticipant[] = useMemo(() => {\n return onRenderParticipant ? participants : getParticipantsForDefaultRender(participants, excludeMe, myUserId);\n }, [participants, excludeMe, myUserId, onRenderParticipant]);\n\n sortParticipants(displayedParticipants);\n\n const createParticipantMenuItems = useCallback(\n (participant: ParticipantListParticipant): IContextualMenuItem[] => {\n let menuItems: IContextualMenuItem[] = [];\n\n const participantIsRemovable = participant.isRemovable;\n if (participant.userId !== myUserId && onRemoveParticipant && participantIsRemovable) {\n menuItems.push({\n key: 'remove',\n text: participantItemStrings.removeButtonLabel,\n onClick: () => onRemoveParticipant(participant.userId),\n itemProps: {\n styles: props.styles?.participantItemStyles?.participantSubMenuItemsStyles\n },\n iconProps: {\n iconName: 'ContextMenuRemoveParticipant',\n styles: { root: { lineHeight: 0 } }\n },\n 'data-ui-id': ids.participantListRemoveParticipantButton\n });\n }\n\n if (onFetchParticipantMenuItems) {\n menuItems = onFetchParticipantMenuItems(participant.userId, myUserId, menuItems);\n }\n\n return menuItems;\n },\n [\n ids.participantListRemoveParticipantButton,\n myUserId,\n onFetchParticipantMenuItems,\n onRemoveParticipant,\n props.styles?.participantItemStyles?.participantSubMenuItemsStyles,\n participantItemStrings.removeButtonLabel\n ]\n );\n\n const participantItemStyles = useMemo(\n () => merge(participantListItemStyle, props.styles?.participantItemStyles),\n [props.styles?.participantItemStyles]\n );\n\n /* @conditional-compile-remove(total-participant-count) */\n const overflowParticipantCountString =\n strings?.overflowParticipantCount ?? participantListStrings?.overflowParticipantCount;\n\n return (\n <Stack\n data-ui-id={ids.participantList}\n className={mergeStyles(participantListStyle, props.styles?.root)}\n role={'menu'}\n >\n {displayedParticipants.map((participant: ParticipantListParticipant) =>\n onRenderParticipant\n ? onRenderParticipant(participant)\n : onRenderParticipantDefault(\n participant,\n participantItemStrings,\n myUserId,\n onRenderAvatar,\n createParticipantMenuItems,\n participantItemStyles,\n props.onParticipantClick,\n showParticipantOverflowTooltip,\n participantAriaLabelledBy,\n theme,\n pinnedParticipants\n )\n )}\n {\n /* @conditional-compile-remove(total-participant-count) */ overflowParticipantCountString &&\n totalParticipantCount &&\n totalParticipantCount > displayedParticipants.length && (\n <Text style={{ fontWeight: 400, margin: '0.5rem' }}>\n {_formatString(overflowParticipantCountString, {\n overflowCount: `${totalParticipantCount - displayedParticipants.length}`\n })}\n </Text>\n )\n }\n </Stack>\n );\n};\n"]}
|
@@ -9,7 +9,6 @@ import { drawerMenuWrapperStyles, remoteVideoTileWrapperStyle } from './VideoGal
|
|
9
9
|
import { useRemoteVideoStreamLifecycleMaintainer } from './VideoGallery/useVideoStreamLifecycleMaintainer';
|
10
10
|
import { useVideoTileContextualMenuProps } from './VideoGallery/useVideoTileContextualMenuProps';
|
11
11
|
import { VideoTile } from './VideoTile';
|
12
|
-
/* @conditional-compile-remove(hide-attendee-name) */
|
13
12
|
import { _formatString } from "../../../acs-ui-common/src";
|
14
13
|
import { MeetingReactionOverlay } from './MeetingReactionOverlay';
|
15
14
|
/**
|
@@ -90,16 +89,14 @@ export const _RemoteVideoTile = React.memo((props) => {
|
|
90
89
|
setDrawerMenuItemProps(convertContextualMenuItemsToDrawerMenuItemProps(contextualMenuProps, () => setDrawerMenuItemProps([])));
|
91
90
|
}
|
92
91
|
}, [setDrawerMenuItemProps, contextualMenuProps]);
|
93
|
-
let displayName = remoteParticipant.displayName || strings.displayNamePlaceholder;
|
94
|
-
/* @conditional-compile-remove(hide-attendee-name) */
|
95
92
|
const attendeeRoleString = (_a = props.strings) === null || _a === void 0 ? void 0 : _a.attendeeRole;
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
return _formatString(displayName, { AttendeeRole: attendeeRoleString });
|
93
|
+
const formatDisplayName = (displayName, role) => {
|
94
|
+
if (displayName && role) {
|
95
|
+
return _formatString(displayName, { AttendeeRole: role });
|
100
96
|
}
|
101
97
|
return displayName;
|
102
98
|
};
|
99
|
+
const displayName = formatDisplayName(remoteParticipant.displayName ? remoteParticipant.displayName : strings.displayNamePlaceholder, attendeeRoleString);
|
103
100
|
const formatInitialsName = () => {
|
104
101
|
if (remoteParticipant.displayName && attendeeRoleString) {
|
105
102
|
return _formatString(remoteParticipant.displayName, { AttendeeRole: attendeeRoleString });
|
@@ -107,8 +104,6 @@ export const _RemoteVideoTile = React.memo((props) => {
|
|
107
104
|
return remoteParticipant.displayName;
|
108
105
|
};
|
109
106
|
const reactionOverlay = reactionResources && (React.createElement(MeetingReactionOverlay, { overlayMode: "grid-tiles", reaction: remoteParticipant.reaction, reactionResources: reactionResources }));
|
110
|
-
/* @conditional-compile-remove(hide-attendee-name) */
|
111
|
-
displayName = formatDisplayName();
|
112
107
|
return (React.createElement(Stack, { tabIndex: menuKind === 'drawer' ? 0 : undefined, onKeyDown: menuKind === 'drawer' ? onKeyDown : undefined, style: remoteVideoTileWrapperStyle },
|
113
108
|
React.createElement(VideoTile, Object.assign({ key: userId, userId: userId, initialsName: (_b = formatInitialsName()) !== null && _b !== void 0 ? _b : '', renderElement: renderVideoStreamElement, displayName: displayName, onRenderPlaceholder: onRenderAvatar, isMuted: remoteParticipant.isMuted, raisedHand: remoteParticipant.raisedHand, isSpeaking: remoteParticipant.isSpeaking, showMuteIndicator: showMuteIndicator, personaMinSize: props.personaMinSize, showLabel: props.showLabel, alwaysShowLabelBackground: props.alwaysShowLabelBackground,
|
114
109
|
/* @conditional-compile-remove(one-to-n-calling) */
|