@azure/communication-react 1.19.0-alpha-202409060015 → 1.19.0-alpha-202409100015
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/communication-react.d.ts +58 -41
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-d2PFi3-l.js → ChatMessageComponentAsRichTextEditBox-eCfb0qTc.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-d2PFi3-l.js.map → ChatMessageComponentAsRichTextEditBox-eCfb0qTc.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DSiJTLwu.js → RichTextSendBoxWrapper-CrqNnQ4h.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DSiJTLwu.js.map → RichTextSendBoxWrapper-CrqNnQ4h.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-CKU6pfS7.js → index-DSX_hUlh.js} +118 -134
- package/dist/dist-cjs/communication-react/index-DSX_hUlh.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/handlers/createHandlers.d.ts +4 -0
- package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js +2 -2
- package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/incomingCallStackSelector.d.ts +2 -2
- package/dist/dist-esm/calling-component-bindings/src/incomingCallStackSelector.js +1 -1
- package/dist/dist-esm/calling-component-bindings/src/incomingCallStackSelector.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.d.ts +2 -2
- package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +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 +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.d.ts +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.d.ts +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.d.ts +1 -1
- package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js +4 -5
- package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/ChatContext.js +1 -1
- package/dist/dist-esm/chat-stateful-client/src/ChatContext.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/HoldButton.d.ts +3 -3
- package/dist/dist-esm/react-components/src/components/HoldButton.js +1 -1
- package/dist/dist-esm/react-components/src/components/HoldButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/IncomingCallNotification.d.ts +4 -4
- package/dist/dist-esm/react-components/src/components/IncomingCallNotification.js +1 -1
- package/dist/dist-esm/react-components/src/components/IncomingCallNotification.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/IncomingCallStack.d.ts +3 -3
- package/dist/dist-esm/react-components/src/components/IncomingCallStack.js +1 -1
- package/dist/dist-esm/react-components/src/components/IncomingCallStack.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MicrophoneButton.d.ts +13 -8
- package/dist/dist-esm/react-components/src/components/MicrophoneButton.js +14 -16
- package/dist/dist-esm/react-components/src/components/MicrophoneButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +2 -14
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +6 -21
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/LargeGalleryLayout.js +2 -14
- package/dist/dist-esm/react-components/src/components/VideoGallery/LargeGalleryLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js +6 -21
- package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.d.ts +8 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +34 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js +7 -0
- package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js +3 -1
- package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +3 -4
- package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.d.ts +1 -1
- package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +3 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +6 -6
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/ParticipantSubcriber.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/ParticipantSubcriber.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SvgWithWordWrapping.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SvgWithWordWrapping.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SvgWithWordWrapping.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +4 -4
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +11 -4
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +2 -1
- package/dist/dist-cjs/communication-react/index-CKU6pfS7.js.map +0 -1
@@ -39,7 +39,7 @@ export interface CallWithChatAdapterManagement {
|
|
39
39
|
/**
|
40
40
|
* Remove a participant from the call.
|
41
41
|
* @param participant - {@link @azure/communication-common#CommunicationIdentifier} of the participant to be removed
|
42
|
-
* @
|
42
|
+
* @public
|
43
43
|
*/
|
44
44
|
removeParticipant(participant: CommunicationIdentifier): Promise<void>;
|
45
45
|
/**
|
@@ -328,19 +328,19 @@ export interface CallWithChatAdapterManagement {
|
|
328
328
|
/**
|
329
329
|
* Puts the Call in a Localhold.
|
330
330
|
*
|
331
|
-
* @
|
331
|
+
* @public
|
332
332
|
*/
|
333
333
|
holdCall: () => Promise<void>;
|
334
334
|
/**
|
335
335
|
* Resumes the call from a LocalHold state.
|
336
336
|
*
|
337
|
-
* @
|
337
|
+
* @public
|
338
338
|
*/
|
339
339
|
resumeCall: () => Promise<void>;
|
340
340
|
/**
|
341
341
|
* Adds a new Participant to the call.
|
342
342
|
*
|
343
|
-
* @
|
343
|
+
* @public
|
344
344
|
*/
|
345
345
|
addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;
|
346
346
|
addParticipant(participant: CommunicationUserIdentifier): Promise<void>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CallWithChatAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/adjacent-overload-signatures */\n\nimport {\n CallIdChangedListener,\n DisplayNameChangedListener,\n IsMutedChangedListener,\n IsLocalScreenSharingActiveChangedListener,\n IsSpeakingChangedListener,\n ParticipantsJoinedListener,\n ParticipantsLeftListener,\n CallEndedListener\n} from '../../CallComposite';\nimport {\n MessageDeletedListener,\n MessageEditedListener,\n MessageReadListener,\n MessageReceivedListener,\n MessageSentListener,\n ParticipantsAddedListener,\n ParticipantsRemovedListener\n} from '../../ChatComposite';\nimport { ResourceDetails } from '../../ChatComposite';\nimport { CallWithChatAdapterState } from '../state/CallWithChatAdapterState';\nimport type { AdapterError, AdapterState, Disposable } from '../../common/adapters';\nimport {\n AudioDeviceInfo,\n Call,\n PermissionConstraints,\n PropertyChangedEvent,\n StartCallOptions,\n VideoDeviceInfo\n} from '@azure/communication-calling';\nimport { Reaction } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { BreakoutRoomsUpdatedListener } from '@azure/communication-calling';\nimport { DtmfTone } from '@azure/communication-calling';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\nimport { SendMessageOptions } from '@azure/communication-chat';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { UploadChatImageResult } from '@internal/acs-ui-common';\nimport {\n JoinCallOptions,\n StartCaptionsAdapterOptions,\n StopCaptionsAdapterOptions\n} from '../../CallComposite/adapter/CallAdapter';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { PhoneNumberIdentifier } from '@azure/communication-common';\nimport { UnknownIdentifier, MicrosoftTeamsAppIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { CommunicationUserIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(teams-adhoc-call) */\nimport { MicrosoftTeamsUserIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { CommunicationIdentifier } from '@azure/communication-common';\nimport {\n CaptionsReceivedListener,\n IsCaptionsActiveChangedListener,\n IsCaptionLanguageChangedListener,\n IsSpokenLanguageChangedListener\n} from '../../CallComposite/adapter/CallAdapter';\n\nimport { CapabilitiesChangedListener } from '../../CallComposite/adapter/CallAdapter';\nimport { SpotlightChangedListener } from '../../CallComposite/adapter/CallAdapter';\n\nimport { VideoBackgroundImage, VideoBackgroundEffect } from '../../CallComposite';\n\nimport { CallSurvey, CallSurveyResponse } from '@azure/communication-calling';\n\n/**\n * Functionality for managing the current call with chat.\n * @public\n */\nexport interface CallWithChatAdapterManagement {\n // CallWithChat-specific Interface methods\n /**\n * Remove a participant from a Call.\n *\n * @param userId - UserId of the participant to remove.\n *\n * @public\n */\n removeParticipant(userId: string): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Remove a participant from the call.\n * @param participant - {@link @azure/communication-common#CommunicationIdentifier} of the participant to be removed\n * @beta\n */\n removeParticipant(participant: CommunicationIdentifier): Promise<void>;\n\n // Call Interface Methods\n /**\n * Join the call with microphone initially on/off.\n * @deprecated Use joinCall(options?:JoinCallOptions) instead.\n * @param microphoneOn - Whether microphone is initially enabled\n *\n * @public\n */\n joinCall(microphoneOn?: boolean): Call | undefined;\n /**\n * Join the call with options bag to set microphone/camera initial state when joining call\n * true = turn on the device when joining call\n * false = turn off the device when joining call\n * 'keep'/undefined = retain devices' precall state\n *\n * @param options - param to set microphone/camera initially on/off/use precall state.\n *\n * @public\n */\n joinCall(options?: JoinCallOptions): Call | undefined;\n /**\n * Leave the call.\n *\n * @param forEveryone - Whether to remove all participants when leaving\n *\n * @public\n */\n leaveCall(forEveryone?: boolean): Promise<void>;\n /**\n * Start the camera.\n *\n * This method will start rendering a local camera view when the call is not active.\n *\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n startCamera(options?: VideoStreamOptions): Promise<void>;\n /**\n * Stop the camera.\n *\n * This method will stop rendering a local camera view when the call is not active.\n *\n * @public\n */\n stopCamera(): Promise<void>;\n /**\n * Mute the current user during the call or disable microphone locally.\n *\n * @public\n */\n mute(): Promise<void>;\n /**\n * Unmute the current user during the call or enable microphone locally.\n *\n * @public\n */\n unmute(): Promise<void>;\n /**\n * Start the call.\n *\n * @param participants - An array of participant ids to join\n *\n * @public\n */\n startCall(participants: string[], options?: StartCallOptions): Call | undefined;\n /**\n * Start the call.\n * @param participants - An array of {@link @azure/communication-common#CommunicationIdentifier} to be called\n * @public\n */\n startCall(\n participants: (\n | MicrosoftTeamsAppIdentifier\n | /* @conditional-compile-remove(PSTN-calls) */ PhoneNumberIdentifier\n | /* @conditional-compile-remove(one-to-n-calling) */ CommunicationUserIdentifier\n | /* @conditional-compile-remove(teams-adhoc-call) */ MicrosoftTeamsUserIdentifier\n | UnknownIdentifier\n )[],\n options?: StartCallOptions\n ): Call | undefined;\n /**\n * Start sharing the screen during a call.\n *\n * @public\n */\n startScreenShare(): Promise<void>;\n /**\n * Stop sharing the screen.\n *\n * @public\n */\n stopScreenShare(): Promise<void>;\n /**\n * Raise hand for local user.\n *\n * @public\n */\n raiseHand(): Promise<void>;\n /**\n * Lower hand for local user.\n *\n * @public\n */\n lowerHand(): Promise<void>;\n /**\n * Send Reaction to ongoing meeting.\n * @param reaction - A value of type {@link @azure/communication-calling#Reaction}\n *\n * @public\n */\n onReactionClick(reaction: Reaction): Promise<void>;\n /**\n * Create the html view for a stream.\n *\n * @remarks\n * This method is implemented for composite.\n *\n * @param remoteUserId - Id of the participant to render, leave it undefined to create the local camera view\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n createStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void | CreateVideoStreamViewResult>;\n /**\n * Dispose the html view for a stream.\n *\n * @remarks\n * This method is implemented for composite.\n *\n * @param remoteUserId - Id of the participant to render, leave it undefined to dispose the local camera view\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n disposeStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void>;\n /**\n * Dispose the html view for a screen share stream\n *\n * @remarks\n * this method is implemented for composite\n *\n * @param remoteUserId - Id of the participant to dispose the screen share stream view for.\n *\n * @public\n */\n disposeScreenShareStreamView(remoteUserId: string): Promise<void>;\n /**\n * Dispose the html view for a remote video stream\n *\n * @param remoteUserId - Id of the participant to dispose\n *\n * @public\n */\n disposeRemoteVideoStreamView(remoteUserId: string): Promise<void>;\n /**\n * Dispose the html view for a local video stream\n *\n * @public\n */\n disposeLocalVideoStreamView(): Promise<void>;\n /**\n * Ask for permissions of devices.\n *\n * @remarks\n * Browser permission window will pop up if permissions are not granted yet.\n *\n * @param constrain - Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }\n *\n * @public\n */\n askDevicePermission(constrain: PermissionConstraints): Promise<void>;\n /**\n * Query for available camera devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of video device information entities {@link @azure/communication-calling#VideoDeviceInfo }\n *\n * @public\n */\n queryCameras(): Promise<VideoDeviceInfo[]>;\n /**\n * Query for available microphone devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of audio device information entities {@link @azure/communication-calling#AudioDeviceInfo }\n *\n * @public\n */\n queryMicrophones(): Promise<AudioDeviceInfo[]>;\n /**\n * Query for available microphone devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of audio device information entities {@link @azure/communication-calling#AudioDeviceInfo }\n *\n * @public\n */\n querySpeakers(): Promise<AudioDeviceInfo[]>;\n /**\n * Set the camera to use in the call.\n *\n * @param sourceInfo - Camera device to choose, pick one returned by {@link CallAdapterDeviceManagement#queryCameras }\n * @param options - Options to control how the camera stream is rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n setCamera(sourceInfo: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void>;\n /**\n * Set the microphone to use in the call.\n *\n * @param sourceInfo - Microphone device to choose, pick one returned by {@link CallAdapterDeviceManagement#queryMicrophones }\n *\n * @public\n */\n setMicrophone(sourceInfo: AudioDeviceInfo): Promise<void>;\n /**\n * Set the speaker to use in the call.\n *\n * @param sourceInfo - Speaker device to choose, pick one returned by {@link CallAdapterDeviceManagement#querySpeakers }\n *\n * @public\n */\n setSpeaker(sourceInfo: AudioDeviceInfo): Promise<void>;\n\n // Chat Interface Methods\n /**\n * Fetch initial state for the Chat adapter.\n *\n * Performs the minimal fetch necessary for ChatComposite and API methods.\n *\n * @public\n */\n fetchInitialData(): Promise<void>;\n /**\n * Send a message in the thread.\n *\n * @public\n */\n sendMessage(\n content: string,\n options?: SendMessageOptions | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions\n ): Promise<void>;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n /**\n * Upload an inline image for a message.\n *\n * @beta\n */\n uploadImage(image: Blob, imageFilename: string): Promise<UploadChatImageResult>;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n /**\n * Delete an inline image for a message.\n *\n * @beta\n */\n deleteImage(imageId: string): Promise<void>;\n /**\n * Send a read receipt for a message.\n *\n * @public\n */\n sendReadReceipt(chatMessageId: string): Promise<void>;\n /**\n * Send typing indicator in the thread.\n *\n * @public\n */\n sendTypingIndicator(): Promise<void>;\n /**\n * Update a message content.\n *\n * @public\n */\n updateMessage(\n messageId: string,\n content: string,\n options?: Record<string, string> | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions\n ): Promise<void>;\n /**\n * Delete a message in the thread.\n *\n * @public\n */\n deleteMessage(messageId: string): Promise<void>;\n /**\n * Load more previous messages in the chat thread history.\n *\n * @remarks\n * This method is usually used to control incremental fetch/infinite scroll.\n *\n * @public\n */\n loadPreviousChatMessages(messagesToLoad: number): Promise<boolean>;\n /** @public */\n downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void>;\n /** @public */\n removeResourceFromCache(resourceDetails: ResourceDetails): void;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Puts the Call in a Localhold.\n *\n * @beta\n */\n holdCall: () => Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Resumes the call from a LocalHold state.\n *\n * @beta\n */\n resumeCall: () => Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Adds a new Participant to the call.\n *\n * @beta\n */\n addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n addParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n /**\n * send dtmf tone to another participant in the call in 1:1 calls\n *\n * @public\n */\n sendDtmfTone: (dtmfTone: DtmfTone) => Promise<void>;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * Continues into a call when the browser version is not supported.\n */\n allowUnsupportedBrowserVersion(): void;\n /**\n * Function to Start captions\n * @param options - options for start captions\n */\n startCaptions(options?: StartCaptionsAdapterOptions): Promise<void>;\n /**\n * Function to set caption language\n * @param language - language set for caption\n */\n setCaptionLanguage(language: string): Promise<void>;\n /**\n * Function to set spoken language\n * @param language - spoken language\n */\n setSpokenLanguage(language: string): Promise<void>;\n /**\n * Funtion to stop captions\n */\n stopCaptions(options?: StopCaptionsAdapterOptions): Promise<void>;\n\n /**\n * Start the video background effect.\n *\n * @public\n */\n startVideoBackgroundEffect(videoBackgroundEffect: VideoBackgroundEffect): Promise<void>;\n\n /**\n * Stop the video background effect.\n *\n * @public\n */\n stopVideoBackgroundEffects(): Promise<void>;\n\n /**\n * Override the background picker images for background replacement effect.\n *\n * @param backgroundImages - Array of custom background images.\n *\n * @public\n */\n updateBackgroundPickerImages(backgroundImages: VideoBackgroundImage[]): void;\n\n /**\n * Update the selected video background effect\n *\n * @public\n */\n updateSelectedVideoBackgroundEffect(selectedVideoBackground: VideoBackgroundEffect): void;\n /* @conditional-compile-remove(DNS) */\n /**\n * Start the noise suppression effect.\n *\n * @beta\n */\n startNoiseSuppressionEffect(): Promise<void>;\n /* @conditional-compile-remove(DNS) */\n /**\n * Start the noise suppression effect.\n *\n * @beta\n */\n stopNoiseSuppressionEffect(): Promise<void>;\n /**\n * Send the end of call survey result\n *\n * @public\n */\n submitSurvey(survey: CallSurvey): Promise<CallSurveyResponse | undefined>;\n /**\n * Start spotlight\n */\n startSpotlight(userIds?: string[]): Promise<void>;\n /**\n * Stop spotlight\n */\n stopSpotlight(userIds?: string[]): Promise<void>;\n /**\n * Stop all spotlights\n */\n stopAllSpotlight(): Promise<void>;\n /* @conditional-compile-remove(soft-mute) */\n /**\n * Mute a participant\n */\n muteParticipant(userId: string): Promise<void>;\n /* @conditional-compile-remove(soft-mute) */\n /**\n * Mute a participant\n */\n muteAllRemoteParticipants(): Promise<void>;\n /* @conditional-compile-remove(breakout-rooms) */\n /**\n * Return to origin call of breakout room\n */\n returnFromBreakoutRoom(): Promise<void>;\n}\n\n/**\n * Call and Chat events that can be subscribed to in the {@link CallWithChatAdapter}.\n * @public\n */\nexport interface CallWithChatAdapterSubscriptions {\n // Call subscriptions\n on(event: 'callEnded', listener: CallEndedListener): void;\n on(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n on(event: 'callIdChanged', listener: CallIdChangedListener): void;\n on(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n on(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n on(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n on(event: 'callParticipantsJoined', listener: ParticipantsJoinedListener): void;\n on(event: 'callParticipantsLeft', listener: ParticipantsLeftListener): void;\n on(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n on(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n on(event: 'callError', listener: (e: AdapterError) => void): void;\n on(event: 'captionsReceived', listener: CaptionsReceivedListener): void;\n on(event: 'isCaptionsActiveChanged', listener: IsCaptionsActiveChangedListener): void;\n on(event: 'isCaptionLanguageChanged', listener: IsCaptionLanguageChangedListener): void;\n on(event: 'isSpokenLanguageChanged', listener: IsSpokenLanguageChangedListener): void;\n on(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;\n on(event: 'spotlightChanged', listener: SpotlightChangedListener): void;\n /* @conditional-compile-remove(breakout-rooms) */\n on(event: 'breakoutRoomsUpdated', listener: BreakoutRoomsUpdatedListener): void;\n off(event: 'callEnded', listener: CallEndedListener): void;\n off(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n off(event: 'callIdChanged', listener: CallIdChangedListener): void;\n off(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n off(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n off(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n off(event: 'callParticipantsJoined', listener: ParticipantsJoinedListener): void;\n off(event: 'callParticipantsLeft', listener: ParticipantsLeftListener): void;\n off(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n off(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n off(event: 'callError', listener: (e: AdapterError) => void): void;\n off(event: 'captionsReceived', listener: CaptionsReceivedListener): void;\n off(event: 'isCaptionsActiveChanged', listener: IsCaptionsActiveChangedListener): void;\n off(event: 'isCaptionLanguageChanged', listener: IsCaptionLanguageChangedListener): void;\n off(event: 'isSpokenLanguageChanged', listener: IsSpokenLanguageChangedListener): void;\n off(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;\n off(event: 'spotlightChanged', listener: SpotlightChangedListener): void;\n /* @conditional-compile-remove(breakout-rooms) */\n off(event: 'breakoutRoomsUpdated', listener: BreakoutRoomsUpdatedListener): void;\n\n // Chat subscriptions\n on(event: 'messageReceived', listener: MessageReceivedListener): void;\n on(event: 'messageEdited', listener: MessageEditedListener): void;\n on(event: 'messageDeleted', listener: MessageDeletedListener): void;\n on(event: 'messageSent', listener: MessageSentListener): void;\n on(event: 'messageRead', listener: MessageReadListener): void;\n on(event: 'chatParticipantsAdded', listener: ParticipantsAddedListener): void;\n on(event: 'chatParticipantsRemoved', listener: ParticipantsRemovedListener): void;\n on(event: 'chatError', listener: (e: AdapterError) => void): void;\n\n off(event: 'messageReceived', listener: MessageReceivedListener): void;\n off(event: 'messageEdited', listener: MessageEditedListener): void;\n off(event: 'messageDeleted', listener: MessageDeletedListener): void;\n off(event: 'messageSent', listener: MessageSentListener): void;\n off(event: 'messageRead', listener: MessageReadListener): void;\n off(event: 'chatParticipantsAdded', listener: ParticipantsAddedListener): void;\n off(event: 'chatParticipantsRemoved', listener: ParticipantsRemovedListener): void;\n off(event: 'chatError', listener: (e: AdapterError) => void): void;\n\n // CallWithChat subscriptions\n on(event: 'chatInitialized', listener: ChatInitializedListener): void;\n off(event: 'chatInitialized', listener: ChatInitializedListener): void;\n}\n\n/**\n * Callback for {@link CallWithChatAdapterSubscribers} 'chatInitialized' event.\n *\n * @public\n */\nexport type ChatInitializedListener = (event: { adapter: CallWithChatAdapter }) => void;\n\n/**\n * {@link CallWithChatComposite} Adapter interface.\n *\n * @public\n */\nexport interface CallWithChatAdapter\n extends CallWithChatAdapterManagement,\n AdapterState<CallWithChatAdapterState>,\n Disposable,\n CallWithChatAdapterSubscriptions {}\n\n/**\n * Events fired off by the {@link CallWithChatAdapter}.\n *\n * @public\n */\nexport type CallWithChatEvent =\n | 'callError'\n | 'chatError'\n | 'callEnded'\n | 'isMutedChanged'\n | 'callIdChanged'\n | 'isLocalScreenSharingActiveChanged'\n | 'displayNameChanged'\n | 'isSpeakingChanged'\n | 'callParticipantsJoined'\n | 'callParticipantsLeft'\n | 'selectedMicrophoneChanged'\n | 'selectedSpeakerChanged'\n | 'isCaptionsActiveChanged'\n | 'captionsReceived'\n | 'isCaptionLanguageChanged'\n | 'isSpokenLanguageChanged'\n | 'capabilitiesChanged'\n | 'spotlightChanged'\n | /* @conditional-compile-remove(breakout-rooms) */ 'breakoutRoomsUpdated'\n | 'messageReceived'\n | 'messageEdited'\n | 'messageDeleted'\n | 'messageSent'\n | 'messageRead'\n | 'chatParticipantsAdded'\n | 'chatParticipantsRemoved'\n | 'chatInitialized';\n"]}
|
1
|
+
{"version":3,"file":"CallWithChatAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/adjacent-overload-signatures */\n\nimport {\n CallIdChangedListener,\n DisplayNameChangedListener,\n IsMutedChangedListener,\n IsLocalScreenSharingActiveChangedListener,\n IsSpeakingChangedListener,\n ParticipantsJoinedListener,\n ParticipantsLeftListener,\n CallEndedListener\n} from '../../CallComposite';\nimport {\n MessageDeletedListener,\n MessageEditedListener,\n MessageReadListener,\n MessageReceivedListener,\n MessageSentListener,\n ParticipantsAddedListener,\n ParticipantsRemovedListener\n} from '../../ChatComposite';\nimport { ResourceDetails } from '../../ChatComposite';\nimport { CallWithChatAdapterState } from '../state/CallWithChatAdapterState';\nimport type { AdapterError, AdapterState, Disposable } from '../../common/adapters';\nimport {\n AudioDeviceInfo,\n Call,\n PermissionConstraints,\n PropertyChangedEvent,\n StartCallOptions,\n VideoDeviceInfo\n} from '@azure/communication-calling';\nimport { Reaction } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { BreakoutRoomsUpdatedListener } from '@azure/communication-calling';\nimport { DtmfTone } from '@azure/communication-calling';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\nimport { SendMessageOptions } from '@azure/communication-chat';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { UploadChatImageResult } from '@internal/acs-ui-common';\nimport {\n JoinCallOptions,\n StartCaptionsAdapterOptions,\n StopCaptionsAdapterOptions\n} from '../../CallComposite/adapter/CallAdapter';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { PhoneNumberIdentifier } from '@azure/communication-common';\nimport { UnknownIdentifier, MicrosoftTeamsAppIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { CommunicationUserIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(teams-adhoc-call) */\nimport { MicrosoftTeamsUserIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { CommunicationIdentifier } from '@azure/communication-common';\nimport {\n CaptionsReceivedListener,\n IsCaptionsActiveChangedListener,\n IsCaptionLanguageChangedListener,\n IsSpokenLanguageChangedListener\n} from '../../CallComposite/adapter/CallAdapter';\n\nimport { CapabilitiesChangedListener } from '../../CallComposite/adapter/CallAdapter';\nimport { SpotlightChangedListener } from '../../CallComposite/adapter/CallAdapter';\n\nimport { VideoBackgroundImage, VideoBackgroundEffect } from '../../CallComposite';\n\nimport { CallSurvey, CallSurveyResponse } from '@azure/communication-calling';\n\n/**\n * Functionality for managing the current call with chat.\n * @public\n */\nexport interface CallWithChatAdapterManagement {\n // CallWithChat-specific Interface methods\n /**\n * Remove a participant from a Call.\n *\n * @param userId - UserId of the participant to remove.\n *\n * @public\n */\n removeParticipant(userId: string): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Remove a participant from the call.\n * @param participant - {@link @azure/communication-common#CommunicationIdentifier} of the participant to be removed\n * @public\n */\n removeParticipant(participant: CommunicationIdentifier): Promise<void>;\n\n // Call Interface Methods\n /**\n * Join the call with microphone initially on/off.\n * @deprecated Use joinCall(options?:JoinCallOptions) instead.\n * @param microphoneOn - Whether microphone is initially enabled\n *\n * @public\n */\n joinCall(microphoneOn?: boolean): Call | undefined;\n /**\n * Join the call with options bag to set microphone/camera initial state when joining call\n * true = turn on the device when joining call\n * false = turn off the device when joining call\n * 'keep'/undefined = retain devices' precall state\n *\n * @param options - param to set microphone/camera initially on/off/use precall state.\n *\n * @public\n */\n joinCall(options?: JoinCallOptions): Call | undefined;\n /**\n * Leave the call.\n *\n * @param forEveryone - Whether to remove all participants when leaving\n *\n * @public\n */\n leaveCall(forEveryone?: boolean): Promise<void>;\n /**\n * Start the camera.\n *\n * This method will start rendering a local camera view when the call is not active.\n *\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n startCamera(options?: VideoStreamOptions): Promise<void>;\n /**\n * Stop the camera.\n *\n * This method will stop rendering a local camera view when the call is not active.\n *\n * @public\n */\n stopCamera(): Promise<void>;\n /**\n * Mute the current user during the call or disable microphone locally.\n *\n * @public\n */\n mute(): Promise<void>;\n /**\n * Unmute the current user during the call or enable microphone locally.\n *\n * @public\n */\n unmute(): Promise<void>;\n /**\n * Start the call.\n *\n * @param participants - An array of participant ids to join\n *\n * @public\n */\n startCall(participants: string[], options?: StartCallOptions): Call | undefined;\n /**\n * Start the call.\n * @param participants - An array of {@link @azure/communication-common#CommunicationIdentifier} to be called\n * @public\n */\n startCall(\n participants: (\n | MicrosoftTeamsAppIdentifier\n | /* @conditional-compile-remove(PSTN-calls) */ PhoneNumberIdentifier\n | /* @conditional-compile-remove(one-to-n-calling) */ CommunicationUserIdentifier\n | /* @conditional-compile-remove(teams-adhoc-call) */ MicrosoftTeamsUserIdentifier\n | UnknownIdentifier\n )[],\n options?: StartCallOptions\n ): Call | undefined;\n /**\n * Start sharing the screen during a call.\n *\n * @public\n */\n startScreenShare(): Promise<void>;\n /**\n * Stop sharing the screen.\n *\n * @public\n */\n stopScreenShare(): Promise<void>;\n /**\n * Raise hand for local user.\n *\n * @public\n */\n raiseHand(): Promise<void>;\n /**\n * Lower hand for local user.\n *\n * @public\n */\n lowerHand(): Promise<void>;\n /**\n * Send Reaction to ongoing meeting.\n * @param reaction - A value of type {@link @azure/communication-calling#Reaction}\n *\n * @public\n */\n onReactionClick(reaction: Reaction): Promise<void>;\n /**\n * Create the html view for a stream.\n *\n * @remarks\n * This method is implemented for composite.\n *\n * @param remoteUserId - Id of the participant to render, leave it undefined to create the local camera view\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n createStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void | CreateVideoStreamViewResult>;\n /**\n * Dispose the html view for a stream.\n *\n * @remarks\n * This method is implemented for composite.\n *\n * @param remoteUserId - Id of the participant to render, leave it undefined to dispose the local camera view\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n disposeStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void>;\n /**\n * Dispose the html view for a screen share stream\n *\n * @remarks\n * this method is implemented for composite\n *\n * @param remoteUserId - Id of the participant to dispose the screen share stream view for.\n *\n * @public\n */\n disposeScreenShareStreamView(remoteUserId: string): Promise<void>;\n /**\n * Dispose the html view for a remote video stream\n *\n * @param remoteUserId - Id of the participant to dispose\n *\n * @public\n */\n disposeRemoteVideoStreamView(remoteUserId: string): Promise<void>;\n /**\n * Dispose the html view for a local video stream\n *\n * @public\n */\n disposeLocalVideoStreamView(): Promise<void>;\n /**\n * Ask for permissions of devices.\n *\n * @remarks\n * Browser permission window will pop up if permissions are not granted yet.\n *\n * @param constrain - Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }\n *\n * @public\n */\n askDevicePermission(constrain: PermissionConstraints): Promise<void>;\n /**\n * Query for available camera devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of video device information entities {@link @azure/communication-calling#VideoDeviceInfo }\n *\n * @public\n */\n queryCameras(): Promise<VideoDeviceInfo[]>;\n /**\n * Query for available microphone devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of audio device information entities {@link @azure/communication-calling#AudioDeviceInfo }\n *\n * @public\n */\n queryMicrophones(): Promise<AudioDeviceInfo[]>;\n /**\n * Query for available microphone devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of audio device information entities {@link @azure/communication-calling#AudioDeviceInfo }\n *\n * @public\n */\n querySpeakers(): Promise<AudioDeviceInfo[]>;\n /**\n * Set the camera to use in the call.\n *\n * @param sourceInfo - Camera device to choose, pick one returned by {@link CallAdapterDeviceManagement#queryCameras }\n * @param options - Options to control how the camera stream is rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n setCamera(sourceInfo: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void>;\n /**\n * Set the microphone to use in the call.\n *\n * @param sourceInfo - Microphone device to choose, pick one returned by {@link CallAdapterDeviceManagement#queryMicrophones }\n *\n * @public\n */\n setMicrophone(sourceInfo: AudioDeviceInfo): Promise<void>;\n /**\n * Set the speaker to use in the call.\n *\n * @param sourceInfo - Speaker device to choose, pick one returned by {@link CallAdapterDeviceManagement#querySpeakers }\n *\n * @public\n */\n setSpeaker(sourceInfo: AudioDeviceInfo): Promise<void>;\n\n // Chat Interface Methods\n /**\n * Fetch initial state for the Chat adapter.\n *\n * Performs the minimal fetch necessary for ChatComposite and API methods.\n *\n * @public\n */\n fetchInitialData(): Promise<void>;\n /**\n * Send a message in the thread.\n *\n * @public\n */\n sendMessage(\n content: string,\n options?: SendMessageOptions | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions\n ): Promise<void>;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n /**\n * Upload an inline image for a message.\n *\n * @beta\n */\n uploadImage(image: Blob, imageFilename: string): Promise<UploadChatImageResult>;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n /**\n * Delete an inline image for a message.\n *\n * @beta\n */\n deleteImage(imageId: string): Promise<void>;\n /**\n * Send a read receipt for a message.\n *\n * @public\n */\n sendReadReceipt(chatMessageId: string): Promise<void>;\n /**\n * Send typing indicator in the thread.\n *\n * @public\n */\n sendTypingIndicator(): Promise<void>;\n /**\n * Update a message content.\n *\n * @public\n */\n updateMessage(\n messageId: string,\n content: string,\n options?: Record<string, string> | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions\n ): Promise<void>;\n /**\n * Delete a message in the thread.\n *\n * @public\n */\n deleteMessage(messageId: string): Promise<void>;\n /**\n * Load more previous messages in the chat thread history.\n *\n * @remarks\n * This method is usually used to control incremental fetch/infinite scroll.\n *\n * @public\n */\n loadPreviousChatMessages(messagesToLoad: number): Promise<boolean>;\n /** @public */\n downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void>;\n /** @public */\n removeResourceFromCache(resourceDetails: ResourceDetails): void;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Puts the Call in a Localhold.\n *\n * @public\n */\n holdCall: () => Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Resumes the call from a LocalHold state.\n *\n * @public\n */\n resumeCall: () => Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Adds a new Participant to the call.\n *\n * @public\n */\n addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n addParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n /**\n * send dtmf tone to another participant in the call in 1:1 calls\n *\n * @public\n */\n sendDtmfTone: (dtmfTone: DtmfTone) => Promise<void>;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * Continues into a call when the browser version is not supported.\n */\n allowUnsupportedBrowserVersion(): void;\n /**\n * Function to Start captions\n * @param options - options for start captions\n */\n startCaptions(options?: StartCaptionsAdapterOptions): Promise<void>;\n /**\n * Function to set caption language\n * @param language - language set for caption\n */\n setCaptionLanguage(language: string): Promise<void>;\n /**\n * Function to set spoken language\n * @param language - spoken language\n */\n setSpokenLanguage(language: string): Promise<void>;\n /**\n * Funtion to stop captions\n */\n stopCaptions(options?: StopCaptionsAdapterOptions): Promise<void>;\n\n /**\n * Start the video background effect.\n *\n * @public\n */\n startVideoBackgroundEffect(videoBackgroundEffect: VideoBackgroundEffect): Promise<void>;\n\n /**\n * Stop the video background effect.\n *\n * @public\n */\n stopVideoBackgroundEffects(): Promise<void>;\n\n /**\n * Override the background picker images for background replacement effect.\n *\n * @param backgroundImages - Array of custom background images.\n *\n * @public\n */\n updateBackgroundPickerImages(backgroundImages: VideoBackgroundImage[]): void;\n\n /**\n * Update the selected video background effect\n *\n * @public\n */\n updateSelectedVideoBackgroundEffect(selectedVideoBackground: VideoBackgroundEffect): void;\n /* @conditional-compile-remove(DNS) */\n /**\n * Start the noise suppression effect.\n *\n * @beta\n */\n startNoiseSuppressionEffect(): Promise<void>;\n /* @conditional-compile-remove(DNS) */\n /**\n * Start the noise suppression effect.\n *\n * @beta\n */\n stopNoiseSuppressionEffect(): Promise<void>;\n /**\n * Send the end of call survey result\n *\n * @public\n */\n submitSurvey(survey: CallSurvey): Promise<CallSurveyResponse | undefined>;\n /**\n * Start spotlight\n */\n startSpotlight(userIds?: string[]): Promise<void>;\n /**\n * Stop spotlight\n */\n stopSpotlight(userIds?: string[]): Promise<void>;\n /**\n * Stop all spotlights\n */\n stopAllSpotlight(): Promise<void>;\n /* @conditional-compile-remove(soft-mute) */\n /**\n * Mute a participant\n */\n muteParticipant(userId: string): Promise<void>;\n /* @conditional-compile-remove(soft-mute) */\n /**\n * Mute a participant\n */\n muteAllRemoteParticipants(): Promise<void>;\n /* @conditional-compile-remove(breakout-rooms) */\n /**\n * Return to origin call of breakout room\n */\n returnFromBreakoutRoom(): Promise<void>;\n}\n\n/**\n * Call and Chat events that can be subscribed to in the {@link CallWithChatAdapter}.\n * @public\n */\nexport interface CallWithChatAdapterSubscriptions {\n // Call subscriptions\n on(event: 'callEnded', listener: CallEndedListener): void;\n on(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n on(event: 'callIdChanged', listener: CallIdChangedListener): void;\n on(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n on(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n on(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n on(event: 'callParticipantsJoined', listener: ParticipantsJoinedListener): void;\n on(event: 'callParticipantsLeft', listener: ParticipantsLeftListener): void;\n on(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n on(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n on(event: 'callError', listener: (e: AdapterError) => void): void;\n on(event: 'captionsReceived', listener: CaptionsReceivedListener): void;\n on(event: 'isCaptionsActiveChanged', listener: IsCaptionsActiveChangedListener): void;\n on(event: 'isCaptionLanguageChanged', listener: IsCaptionLanguageChangedListener): void;\n on(event: 'isSpokenLanguageChanged', listener: IsSpokenLanguageChangedListener): void;\n on(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;\n on(event: 'spotlightChanged', listener: SpotlightChangedListener): void;\n /* @conditional-compile-remove(breakout-rooms) */\n on(event: 'breakoutRoomsUpdated', listener: BreakoutRoomsUpdatedListener): void;\n off(event: 'callEnded', listener: CallEndedListener): void;\n off(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n off(event: 'callIdChanged', listener: CallIdChangedListener): void;\n off(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n off(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n off(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n off(event: 'callParticipantsJoined', listener: ParticipantsJoinedListener): void;\n off(event: 'callParticipantsLeft', listener: ParticipantsLeftListener): void;\n off(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n off(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n off(event: 'callError', listener: (e: AdapterError) => void): void;\n off(event: 'captionsReceived', listener: CaptionsReceivedListener): void;\n off(event: 'isCaptionsActiveChanged', listener: IsCaptionsActiveChangedListener): void;\n off(event: 'isCaptionLanguageChanged', listener: IsCaptionLanguageChangedListener): void;\n off(event: 'isSpokenLanguageChanged', listener: IsSpokenLanguageChangedListener): void;\n off(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;\n off(event: 'spotlightChanged', listener: SpotlightChangedListener): void;\n /* @conditional-compile-remove(breakout-rooms) */\n off(event: 'breakoutRoomsUpdated', listener: BreakoutRoomsUpdatedListener): void;\n\n // Chat subscriptions\n on(event: 'messageReceived', listener: MessageReceivedListener): void;\n on(event: 'messageEdited', listener: MessageEditedListener): void;\n on(event: 'messageDeleted', listener: MessageDeletedListener): void;\n on(event: 'messageSent', listener: MessageSentListener): void;\n on(event: 'messageRead', listener: MessageReadListener): void;\n on(event: 'chatParticipantsAdded', listener: ParticipantsAddedListener): void;\n on(event: 'chatParticipantsRemoved', listener: ParticipantsRemovedListener): void;\n on(event: 'chatError', listener: (e: AdapterError) => void): void;\n\n off(event: 'messageReceived', listener: MessageReceivedListener): void;\n off(event: 'messageEdited', listener: MessageEditedListener): void;\n off(event: 'messageDeleted', listener: MessageDeletedListener): void;\n off(event: 'messageSent', listener: MessageSentListener): void;\n off(event: 'messageRead', listener: MessageReadListener): void;\n off(event: 'chatParticipantsAdded', listener: ParticipantsAddedListener): void;\n off(event: 'chatParticipantsRemoved', listener: ParticipantsRemovedListener): void;\n off(event: 'chatError', listener: (e: AdapterError) => void): void;\n\n // CallWithChat subscriptions\n on(event: 'chatInitialized', listener: ChatInitializedListener): void;\n off(event: 'chatInitialized', listener: ChatInitializedListener): void;\n}\n\n/**\n * Callback for {@link CallWithChatAdapterSubscribers} 'chatInitialized' event.\n *\n * @public\n */\nexport type ChatInitializedListener = (event: { adapter: CallWithChatAdapter }) => void;\n\n/**\n * {@link CallWithChatComposite} Adapter interface.\n *\n * @public\n */\nexport interface CallWithChatAdapter\n extends CallWithChatAdapterManagement,\n AdapterState<CallWithChatAdapterState>,\n Disposable,\n CallWithChatAdapterSubscriptions {}\n\n/**\n * Events fired off by the {@link CallWithChatAdapter}.\n *\n * @public\n */\nexport type CallWithChatEvent =\n | 'callError'\n | 'chatError'\n | 'callEnded'\n | 'isMutedChanged'\n | 'callIdChanged'\n | 'isLocalScreenSharingActiveChanged'\n | 'displayNameChanged'\n | 'isSpeakingChanged'\n | 'callParticipantsJoined'\n | 'callParticipantsLeft'\n | 'selectedMicrophoneChanged'\n | 'selectedSpeakerChanged'\n | 'isCaptionsActiveChanged'\n | 'captionsReceived'\n | 'isCaptionLanguageChanged'\n | 'isSpokenLanguageChanged'\n | 'capabilitiesChanged'\n | 'spotlightChanged'\n | /* @conditional-compile-remove(breakout-rooms) */ 'breakoutRoomsUpdated'\n | 'messageReceived'\n | 'messageEdited'\n | 'messageDeleted'\n | 'messageSent'\n | 'messageRead'\n | 'chatParticipantsAdded'\n | 'chatParticipantsRemoved'\n | 'chatInitialized';\n"]}
|
@@ -71,12 +71,19 @@ export interface CallWithChatClientState {
|
|
71
71
|
videoBackgroundImages?: VideoBackgroundImage[];
|
72
72
|
/** Dependency to be injected for video background effects */
|
73
73
|
onResolveVideoEffectDependency?: () => Promise<VideoBackgroundEffectsDependency>;
|
74
|
-
/**
|
74
|
+
/**
|
75
|
+
* Dependency to be injected for deep noise suppression effect.
|
76
|
+
* @beta
|
77
|
+
*/
|
75
78
|
onResolveDeepNoiseSuppressionDependency?: () => Promise<DeepNoiseSuppressionEffectDependency>;
|
76
|
-
/** State to track whether the noise suppression should be on by default.
|
79
|
+
/** State to track whether the noise suppression should be on by default.
|
80
|
+
* @beta
|
81
|
+
*/
|
77
82
|
deepNoiseSuppressionOnByDefault?: boolean;
|
78
|
-
/** State to track whether to hide the noise suppression button.
|
79
|
-
|
83
|
+
/** State to track whether to hide the noise suppression button.
|
84
|
+
* @beta
|
85
|
+
*/
|
86
|
+
hideDeepNoiseSuppressionButton?: boolean;
|
80
87
|
/** State to track the selected video background effect */
|
81
88
|
selectedVideoBackgroundEffect?: VideoBackgroundEffect;
|
82
89
|
/** Hide attendee names in teams meeting */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CallWithChatAdapterState.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
1
|
+
{"version":3,"file":"CallWithChatAdapterState.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA4HlC;;GAEG;AACH,MAAM,UAAU,yCAAyC,CAAC,WAAwB;IAChF,MAAM,gBAAgB,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;IAEhD,OAAO;QACL,IAAI,EAAE,gBAAgB,CAAC,IAAI;QAC3B,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,gBAAgB,CAAC,MAAM;QAC/B,IAAI,EAAE,gBAAgB,CAAC,IAAI;QAC3B,WAAW,EAAE,gBAAgB,CAAC,WAAW;QACzC,OAAO,EAAE,gBAAgB,CAAC,OAAO;QACjC,+BAA+B,EAAE,gBAAgB,CAAC,+BAA+B;QACjF,WAAW,EAAE,gBAAgB,CAAC,WAAW;QACzC,cAAc,EAAE,gBAAgB,CAA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D,uBAAuB,EAAE,gBAAgB,CAAC,mBAAmB,EAE7D,qBAAqB,EAAE,gBAAgB,CAAC,qBAAqB,EAE7D,8BAA8B,EAAE,gBAAgB,CAAC,8BAA8B;QAC/E,sCAAsC;QACtC,uCAAuC,EAAE,gBAAgB,CAAC,uCAAuC,EAEjG,6BAA6B,EAAE,gBAAgB,CAAC,6BAA6B,IAC7E;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CommunicationIdentifierKind } from '@azure/communication-common';\nimport { CallState, DeviceManagerState } from '@internal/calling-stateful-client';\nimport { ChatThreadClientState } from '@internal/chat-stateful-client';\nimport { CallAdapter, CallAdapterState, CallCompositePage } from '../../CallComposite';\n\nimport { VideoBackgroundImage, VideoBackgroundEffect } from '../../CallComposite';\n\nimport { VideoBackgroundEffectsDependency } from '@internal/calling-component-bindings';\nimport { ChatAdapterState } from '../../ChatComposite';\nimport { AdapterErrors } from '../../common/adapters';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { AdapterNotifications } from '../../common/adapters';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\nimport { ReactionResources } from '@internal/react-components';\n/* @conditional-compile-remove(DNS) */\nimport { DeepNoiseSuppressionEffectDependency } from '@internal/calling-component-bindings';\n\n/**\n * UI state pertaining to the {@link CallWithChatComposite}.\n *\n * @public\n */\nexport interface CallWithChatAdapterUiState {\n /**\n * Microphone state before a call has joined.\n *\n * @public\n */\n isLocalPreviewMicrophoneEnabled: boolean;\n /**\n * Current page of the Composite.\n *\n * @public\n */\n page: CallCompositePage;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * State to track whether the end user has opted in to using a\n * out of date version of a supported browser. Allows the user\n * to start a call in this state.\n *\n * @beta\n */\n unsupportedBrowserVersionsAllowed?: boolean;\n}\n\n/**\n * State from the backend services that drives {@link CallWithChatComposite}.\n *\n * @public\n */\nexport interface CallWithChatClientState {\n /** ID of the call participant using this CallWithChatAdapter. */\n userId: CommunicationIdentifierKind;\n /** Display name of the participant using this CallWithChatAdapter. */\n displayName: string | undefined;\n /** State of the current call. */\n call?: CallState;\n /** State of the current chat. */\n chat?: ChatThreadClientState;\n /** Latest call error encountered for each operation performed via the adapter. */\n latestCallErrors: AdapterErrors;\n /* @conditional-compile-remove(breakout-rooms) */\n /** Latest call notifications encountered in the call client state via the adapter. */\n latestCallNotifications: AdapterNotifications;\n /** Latest chat error encountered for each operation performed via the adapter. */\n latestChatErrors: AdapterErrors;\n /** State of available and currently selected devices */\n devices: DeviceManagerState;\n /** State of whether the active call is a Teams interop call */\n isTeamsCall: boolean;\n /** State of whether the active call is a Teams interop meeting */\n isTeamsMeeting: boolean;\n /* @conditional-compile-remove(PSTN-calls) */\n /** alternateCallerId for PSTN call */\n alternateCallerId?: string | undefined;\n /* @conditional-compile-remove(unsupported-browser) */\n /** Environment information for system adapter is made on */\n environmentInfo?: EnvironmentInfo;\n\n /** Default set of background images for background replacement effect */\n videoBackgroundImages?: VideoBackgroundImage[];\n\n /** Dependency to be injected for video background effects */\n onResolveVideoEffectDependency?: () => Promise<VideoBackgroundEffectsDependency>;\n /* @conditional-compile-remove(DNS) */\n /**\n * Dependency to be injected for deep noise suppression effect.\n * @beta\n */\n onResolveDeepNoiseSuppressionDependency?: () => Promise<DeepNoiseSuppressionEffectDependency>;\n /* @conditional-compile-remove(DNS) */\n /** State to track whether the noise suppression should be on by default.\n * @beta\n */\n deepNoiseSuppressionOnByDefault?: boolean;\n /* @conditional-compile-remove(DNS) */\n /** State to track whether to hide the noise suppression button.\n * @beta\n */\n hideDeepNoiseSuppressionButton?: boolean;\n\n /** State to track the selected video background effect */\n selectedVideoBackgroundEffect?: VideoBackgroundEffect;\n /* @conditional-compile-remove(hide-attendee-name) */\n /** Hide attendee names in teams meeting */\n hideAttendeeNames?: boolean;\n /**\n * Reaction resources to render in meetings\n * */\n reactions?: ReactionResources;\n}\n\n/**\n * CallWithChat State is a combination of Stateful Chat and Stateful Calling clients with some\n * state specific to the CallWithChat Composite only.\n *\n * @public\n */\nexport interface CallWithChatAdapterState extends CallWithChatAdapterUiState, CallWithChatClientState {}\n\n/**\n * @private\n */\nexport function callWithChatAdapterStateFromBackingStates(callAdapter: CallAdapter): CallWithChatAdapterState {\n const callAdapterState = callAdapter.getState();\n\n return {\n call: callAdapterState.call,\n chat: undefined,\n userId: callAdapterState.userId,\n page: callAdapterState.page,\n displayName: callAdapterState.displayName,\n devices: callAdapterState.devices,\n isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled,\n isTeamsCall: callAdapterState.isTeamsCall,\n isTeamsMeeting: callAdapterState.isTeamsMeeting,\n latestCallErrors: callAdapterState.latestErrors,\n /* @conditional-compile-remove(breakout-rooms) */\n latestCallNotifications: callAdapterState.latestNotifications,\n latestChatErrors: {},\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId: callAdapterState.alternateCallerId,\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo: callAdapterState.environmentInfo,\n videoBackgroundImages: callAdapterState.videoBackgroundImages,\n onResolveVideoEffectDependency: callAdapterState.onResolveVideoEffectDependency,\n /* @conditional-compile-remove(DNS) */\n onResolveDeepNoiseSuppressionDependency: callAdapterState.onResolveDeepNoiseSuppressionDependency,\n selectedVideoBackgroundEffect: callAdapterState.selectedVideoBackgroundEffect,\n /* @conditional-compile-remove(hide-attendee-name) */\n /** Hide attendee names in teams meeting */\n hideAttendeeNames: callAdapterState.hideAttendeeNames,\n reactions: callAdapterState.reactions\n };\n}\n\n/**\n * @private\n */\nexport function mergeChatAdapterStateIntoCallWithChatAdapterState(\n existingCallWithChatAdapterState: CallWithChatAdapterState,\n chatAdapterState: ChatAdapterState\n): CallWithChatAdapterState {\n return {\n ...existingCallWithChatAdapterState,\n chat: chatAdapterState.thread,\n latestChatErrors: chatAdapterState.latestErrors\n };\n}\n\n/**\n * @private\n */\nexport function mergeCallAdapterStateIntoCallWithChatAdapterState(\n existingCallWithChatAdapterState: CallWithChatAdapterState,\n callAdapterState: CallAdapterState\n): CallWithChatAdapterState {\n return {\n ...existingCallWithChatAdapterState,\n userId: callAdapterState.userId,\n page: callAdapterState.page,\n displayName: callAdapterState.displayName,\n devices: callAdapterState.devices,\n call: callAdapterState.call,\n isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled,\n isTeamsCall: callAdapterState.isTeamsCall,\n isTeamsMeeting: callAdapterState.isTeamsMeeting,\n latestCallErrors: callAdapterState.latestErrors,\n /* @conditional-compile-remove(breakout-rooms) */\n latestCallNotifications: callAdapterState.latestNotifications,\n\n videoBackgroundImages: callAdapterState.videoBackgroundImages,\n\n onResolveVideoEffectDependency: callAdapterState.onResolveVideoEffectDependency,\n /* @conditional-compile-remove(DNS) */\n onResolveDeepNoiseSuppressionDependency: callAdapterState.onResolveDeepNoiseSuppressionDependency,\n\n selectedVideoBackgroundEffect: callAdapterState.selectedVideoBackgroundEffect\n };\n}\n"]}
|
@@ -19,7 +19,7 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
19
19
|
import { _createStatefulChatClientInner } from "../../../../../chat-stateful-client/src";
|
20
20
|
import { createDefaultChatHandlers } from "../../../../../chat-component-bindings/src";
|
21
21
|
import { toFlatCommunicationIdentifier } from "../../../../../acs-ui-common/src";
|
22
|
-
import EventEmitter from 'events';
|
22
|
+
import { EventEmitter } from 'events';
|
23
23
|
import { useEffect, useRef, useState } from 'react';
|
24
24
|
import { _isValidIdentifier } from "../../../../../acs-ui-common/src";
|
25
25
|
import { TEAMS_LIMITATION_LEARN_MORE, UNSUPPORTED_CHAT_THREAD_TYPE } from '../../common/constants';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AzureCommunicationChatAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;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AS,CAAC;gBACjC,CAAC;YACH,CAAC,CAAA,CAAC,EAAE,CAAC;QACP,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAgB,6CAA6C,CACjE,UAA8B,EAC9B,gBAAkC;;QAElC,OAAO,IAAI,6BAA6B,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;IACzE,CAAC;CAAA;AAED,MAAM,WAAW,GAAG,CAAC,CAAQ,EAAkB,EAAE;IAC/C,OAAO,QAAQ,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,SAAS,IAAI,YAAY,IAAI,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,KAAK,SAAS,CAAC;AAC1G,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n _createStatefulChatClientInner,\n ChatClientState,\n ChatError,\n StatefulChatClient\n} from '@internal/chat-stateful-client';\nimport { ChatHandlers, createDefaultChatHandlers } from '@internal/chat-component-bindings';\nimport { ChatMessage, ChatMessageType, ChatThreadClient, SendMessageOptions } from '@azure/communication-chat';\nimport { CommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';\nimport type {\n ChatMessageDeletedEvent,\n ChatMessageEditedEvent,\n ChatMessageReceivedEvent,\n ChatThreadPropertiesUpdatedEvent,\n ParticipantsAddedEvent,\n ParticipantsRemovedEvent,\n ReadReceiptReceivedEvent\n} from '@azure/communication-chat';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport type { UploadChatImageResult } from '@internal/acs-ui-common';\nimport { toFlatCommunicationIdentifier, _TelemetryImplementationHint } from '@internal/acs-ui-common';\nimport EventEmitter from 'events';\nimport {\n ChatAdapter,\n ChatAdapterState,\n MessageDeletedListener,\n MessageEditedListener,\n MessageReadListener,\n MessageReceivedListener,\n ParticipantsAddedListener,\n ParticipantsRemovedListener,\n TopicChangedListener\n} from './ChatAdapter';\nimport { ResourceDetails } from './ChatAdapter';\nimport { AdapterError } from '../../common/adapters';\nimport { useEffect, useRef, useState } from 'react';\nimport { _isValidIdentifier } from '@internal/acs-ui-common';\nimport { TEAMS_LIMITATION_LEARN_MORE, UNSUPPORTED_CHAT_THREAD_TYPE } from '../../common/constants';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\n\n/**\n * Context of Chat, which is a centralized context for all state updates\n * @private\n */\nexport class ChatContext {\n private emitter: EventEmitter = new EventEmitter();\n private state: ChatAdapterState;\n private threadId: string;\n\n constructor(clientState: ChatClientState, threadId: string) {\n const thread = clientState.threads[threadId];\n this.threadId = threadId;\n if (!thread) {\n throw 'Cannot find threadId, please initialize thread before use!';\n }\n this.state = {\n userId: clientState.userId,\n displayName: clientState.displayName,\n thread,\n latestErrors: clientState.latestErrors\n };\n }\n\n public onStateChange(handler: (_uiState: ChatAdapterState) => void): void {\n this.emitter.on('stateChanged', handler);\n }\n\n public offStateChange(handler: (_uiState: ChatAdapterState) => void): void {\n this.emitter.off('stateChanged', handler);\n }\n\n public setState(state: ChatAdapterState): void {\n this.state = state;\n this.emitter.emit('stateChanged', this.state);\n }\n\n public getState(): ChatAdapterState {\n return this.state;\n }\n\n public setError(error: Error): void {\n this.setState({ ...this.state, error });\n }\n\n public updateClientState(clientState: ChatClientState): void {\n const thread = clientState.threads[this.threadId];\n if (!thread) {\n throw 'Cannot find threadId, please make sure thread state is still in Stateful ChatClient.';\n }\n\n let updatedState: ChatAdapterState = {\n userId: clientState.userId,\n displayName: clientState.displayName,\n thread,\n latestErrors: clientState.latestErrors\n };\n\n /* @conditional-compile-remove(file-sharing-acs) */\n updatedState = { ...updatedState };\n\n this.setState(updatedState);\n }\n}\n\n/**\n * @private\n */\nexport class AzureCommunicationChatAdapter implements ChatAdapter {\n private chatClient: StatefulChatClient;\n private chatThreadClient: ChatThreadClient;\n private context: ChatContext;\n private handlers: ChatHandlers;\n private emitter: EventEmitter = new EventEmitter();\n\n constructor(chatClient: StatefulChatClient, chatThreadClient: ChatThreadClient) {\n this.bindAllPublicMethods();\n this.chatClient = chatClient;\n this.chatThreadClient = chatThreadClient;\n this.context = new ChatContext(chatClient.getState(), chatThreadClient.threadId);\n\n const onStateChange = (clientState: ChatClientState): void => {\n // unsubscribe when the instance gets disposed\n if (!this) {\n chatClient.offStateChange(onStateChange);\n return;\n }\n this.context.updateClientState(clientState);\n };\n\n this.handlers = createDefaultChatHandlers(chatClient, chatThreadClient);\n\n this.chatClient.onStateChange(onStateChange);\n this.subscribeAllEvents();\n }\n\n private bindAllPublicMethods(): void {\n this.onStateChange = this.onStateChange.bind(this);\n this.offStateChange = this.offStateChange.bind(this);\n this.getState = this.getState.bind(this);\n this.dispose = this.dispose.bind(this);\n this.fetchInitialData = this.fetchInitialData.bind(this);\n this.sendMessage = this.sendMessage.bind(this);\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n this.uploadImage = this.uploadImage.bind(this);\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n this.deleteImage = this.deleteImage.bind(this);\n this.sendReadReceipt = this.sendReadReceipt.bind(this);\n this.sendTypingIndicator = this.sendTypingIndicator.bind(this);\n this.updateMessage = this.updateMessage.bind(this);\n this.deleteMessage = this.deleteMessage.bind(this);\n this.removeParticipant = this.removeParticipant.bind(this);\n this.setTopic = this.setTopic.bind(this);\n this.loadPreviousChatMessages = this.loadPreviousChatMessages.bind(this);\n this.on = this.on.bind(this);\n this.off = this.off.bind(this);\n this.downloadResourceToCache = this.downloadResourceToCache.bind(this);\n this.removeResourceFromCache = this.removeResourceFromCache.bind(this);\n }\n\n dispose(): void {\n this.unsubscribeAllEvents();\n this.chatClient.dispose();\n }\n\n async fetchInitialData(): Promise<void> {\n // If get properties fails we dont want to try to get the participants after.\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.chatThreadClient.getProperties();\n // Fetch all participants who joined before the local user.\n for await (const _page of this.chatThreadClient.listParticipants().byPage({\n // Fetch 100 participants per page by default.\n maxPageSize: 100\n // eslint-disable-next-line curly\n }));\n });\n }\n\n getState(): ChatAdapterState {\n return this.context.getState();\n }\n\n onStateChange(handler: (state: ChatAdapterState) => void): void {\n this.context.onStateChange(handler);\n }\n\n offStateChange(handler: (state: ChatAdapterState) => void): void {\n this.context.offStateChange(handler);\n }\n\n async sendMessage(\n content: string,\n options?: SendMessageOptions | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions\n ): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n return await this.handlers.onSendMessage(content, options);\n });\n }\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n async uploadImage(image: Blob, imageFilename: string): Promise<UploadChatImageResult> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return await this.handlers.onUploadImage(image, imageFilename);\n });\n }\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n async deleteImage(imageId: string): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return await this.handlers.onDeleteImage(imageId);\n });\n }\n\n async sendReadReceipt(chatMessageId: string): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onMessageSeen(chatMessageId);\n });\n }\n\n async sendTypingIndicator(): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onTyping();\n });\n }\n\n async removeParticipant(userId: string): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onRemoveParticipant(userId);\n });\n }\n\n async setTopic(topicName: string): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.updateThreadTopicName(topicName);\n });\n }\n\n async loadPreviousChatMessages(messagesToLoad: number): Promise<boolean> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return await this.handlers.onLoadPreviousChatMessages(messagesToLoad);\n });\n }\n\n async updateMessage(\n messageId: string,\n content: string,\n options?: Record<string, string> | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions\n ): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n /* @conditional-compile-remove(file-sharing-acs) */\n const messageOptions: MessageOptions = {};\n /* @conditional-compile-remove(file-sharing-acs) */\n if (\n options &&\n // if options.attachments is an array or undefined (for removal all attachments),\n // then given options is a MessageOptions\n (Array.isArray(options.attachments) || options.attachments === undefined)\n ) {\n messageOptions.attachments = options.attachments ?? [];\n }\n /* @conditional-compile-remove(file-sharing-acs) */\n if (\n options &&\n // if options.metadata is provided, we need to add it in MessageOptions\n options.metadata &&\n typeof options.metadata === 'object'\n ) {\n messageOptions.metadata = options.metadata;\n }\n /* @conditional-compile-remove(file-sharing-acs) */\n if (options && !('attachments' in options) && !('metadata' in options)) {\n // if options don't have attachments or metadata,\n // then it is a Record<string, string>\n /* @conditional-compile-remove(file-sharing-acs) */\n return await this.handlers.onUpdateMessage(messageId, content, options);\n }\n /* @conditional-compile-remove(file-sharing-acs) */\n return await this.handlers.onUpdateMessage(messageId, content, messageOptions);\n // metadata is never used in the current stable\n return await this.handlers.onUpdateMessage(messageId, content);\n });\n }\n\n async deleteMessage(messageId: string): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return await this.handlers.onDeleteMessage(messageId);\n });\n }\n\n async downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void> {\n this.chatClient.downloadResourceToCache(\n resourceDetails.threadId,\n resourceDetails.messageId,\n resourceDetails.resourceUrl\n );\n }\n\n removeResourceFromCache(resourceDetails: ResourceDetails): void {\n this.chatClient.removeResourceFromCache(\n resourceDetails.threadId,\n resourceDetails.messageId,\n resourceDetails.resourceUrl\n );\n }\n\n private messageReceivedListener(event: ChatMessageReceivedEvent): void {\n const isCurrentChatAdapterThread = event.threadId === this.chatThreadClient.threadId;\n\n if (!isCurrentChatAdapterThread) {\n return;\n }\n\n const message = convertEventToChatMessage(event);\n this.emitter.emit('messageReceived', { message });\n\n const currentUserId = toFlatCommunicationIdentifier(this.chatClient.getState().userId);\n if (message?.sender && toFlatCommunicationIdentifier(message.sender) === currentUserId) {\n this.emitter.emit('messageSent', { message });\n }\n }\n\n private messageEditedListener(event: ChatMessageEditedEvent): void {\n const isCurrentChatAdapterThread = event.threadId === this.chatThreadClient.threadId;\n if (!isCurrentChatAdapterThread) {\n return;\n }\n\n const message = convertEventToChatMessage(event);\n this.emitter.emit('messageEdited', { message });\n }\n\n private messageDeletedListener(event: ChatMessageDeletedEvent): void {\n const isCurrentChatAdapterThread = event.threadId === this.chatThreadClient.threadId;\n if (!isCurrentChatAdapterThread) {\n return;\n }\n\n const message = convertEventToChatMessage(event);\n this.emitter.emit('messageDeleted', { message });\n }\n\n private messageReadListener({ chatMessageId, recipient }: ReadReceiptReceivedEvent): void {\n const message = this.getState().thread.chatMessages[chatMessageId];\n if (message) {\n this.emitter.emit('messageRead', { message, readBy: recipient });\n }\n }\n\n private participantsAddedListener({ addedBy, participantsAdded }: ParticipantsAddedEvent): void {\n this.emitter.emit('participantsAdded', { addedBy, participantsAdded });\n }\n\n private participantsRemovedListener({ removedBy, participantsRemoved }: ParticipantsRemovedEvent): void {\n this.emitter.emit('participantsRemoved', { removedBy, participantsRemoved });\n }\n\n private chatThreadPropertiesUpdatedListener(event: ChatThreadPropertiesUpdatedEvent): void {\n this.emitter.emit('topicChanged', { topic: event.properties.topic });\n }\n\n private subscribeAllEvents(): void {\n this.chatClient.on('chatThreadPropertiesUpdated', this.chatThreadPropertiesUpdatedListener.bind(this));\n this.chatClient.on('participantsAdded', this.participantsAddedListener.bind(this));\n this.chatClient.on('participantsRemoved', this.participantsRemovedListener.bind(this));\n this.chatClient.on('chatMessageReceived', this.messageReceivedListener.bind(this));\n this.chatClient.on('chatMessageEdited', this.messageEditedListener.bind(this));\n this.chatClient.on('chatMessageDeleted', this.messageDeletedListener.bind(this));\n this.chatClient.on('readReceiptReceived', this.messageReadListener.bind(this));\n this.chatClient.on('participantsRemoved', this.participantsRemovedListener.bind(this));\n }\n\n private unsubscribeAllEvents(): void {\n this.chatClient.off('chatThreadPropertiesUpdated', this.chatThreadPropertiesUpdatedListener.bind(this));\n this.chatClient.off('participantsAdded', this.participantsAddedListener.bind(this));\n this.chatClient.off('participantsRemoved', this.participantsRemovedListener.bind(this));\n this.chatClient.off('chatMessageReceived', this.messageReceivedListener.bind(this));\n this.chatClient.off('chatMessageEdited', this.messageEditedListener.bind(this));\n this.chatClient.off('chatMessageDeleted', this.messageDeletedListener.bind(this));\n this.chatClient.off('readReceiptReceived', this.messageReadListener.bind(this));\n this.chatClient.off('participantsRemoved', this.participantsRemovedListener.bind(this));\n }\n\n on(event: 'messageReceived', listener: MessageReceivedListener): void;\n on(event: 'messageEdited', listener: MessageEditedListener): void;\n on(event: 'messageDeleted', listener: MessageDeletedListener): void;\n on(event: 'messageSent', listener: MessageReceivedListener): void;\n on(event: 'messageRead', listener: MessageReadListener): void;\n on(event: 'participantsAdded', listener: ParticipantsAddedListener): void;\n on(event: 'participantsRemoved', listener: ParticipantsRemovedListener): void;\n on(event: 'topicChanged', listener: TopicChangedListener): void;\n on(event: 'error', listener: (e: AdapterError) => void): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n on(event: string, listener: (e: any) => void): void {\n this.emitter.on(event, listener);\n }\n\n off(event: 'messageReceived', listener: MessageReceivedListener): void;\n off(event: 'messageEdited', listener: MessageEditedListener): void;\n off(event: 'messageDeleted', listener: MessageDeletedListener): void;\n off(event: 'messageSent', listener: MessageReceivedListener): void;\n off(event: 'messageRead', listener: MessageReadListener): void;\n off(event: 'participantsAdded', listener: ParticipantsAddedListener): void;\n off(event: 'participantsRemoved', listener: ParticipantsRemovedListener): void;\n off(event: 'topicChanged', listener: TopicChangedListener): void;\n off(event: 'error', listener: (e: AdapterError) => void): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n off(event: string, listener: (e: any) => void): void {\n this.emitter.off(event, listener);\n }\n\n private async asyncTeeErrorToEventEmitter<T>(f: () => Promise<T>): Promise<T> {\n try {\n return await f();\n } catch (error) {\n if (isChatError(error as Error)) {\n this.emitter.emit('error', error as AdapterError);\n }\n throw error;\n }\n }\n}\n\nconst convertEventToChatMessage = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent | ChatMessageDeletedEvent\n): ChatMessage => {\n return {\n id: event.id,\n version: event.version,\n content: isChatMessageDeletedEvent(event) ? undefined : { message: event.message },\n type: convertEventType(event.type),\n sender: event.sender,\n senderDisplayName: event.senderDisplayName,\n sequenceId: '',\n createdOn: new Date(event.createdOn),\n editedOn: isChatMessageEditedEvent(event) ? event.editedOn : undefined,\n deletedOn: isChatMessageDeletedEvent(event) ? event.deletedOn : undefined\n };\n};\n\nconst isChatMessageEditedEvent = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent | ChatMessageDeletedEvent\n): event is ChatMessageEditedEvent => {\n return 'editedOn' in event;\n};\n\nconst isChatMessageDeletedEvent = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent | ChatMessageDeletedEvent\n): event is ChatMessageDeletedEvent => {\n return 'deletedOn' in event;\n};\n\n// only text/html message type will be received from event\nconst convertEventType = (type: string): ChatMessageType => {\n const lowerCaseType = type.toLowerCase();\n if (lowerCaseType === 'richtext/html' || lowerCaseType === 'html') {\n return 'html';\n } else {\n return 'text';\n }\n};\n\n/**\n * Arguments for creating the Azure Communication Services implementation of {@link ChatAdapter}.\n *\n * @public\n */\nexport type AzureCommunicationChatAdapterArgs = {\n endpoint: string;\n userId: CommunicationUserIdentifier;\n displayName: string;\n credential: CommunicationTokenCredential;\n threadId: string;\n};\n\n/**\n * Create a {@link ChatAdapter} backed by Azure Communication Services.\n *\n * This is the default implementation of {@link ChatAdapter} provided by this library.\n *\n * @public\n */\nexport const createAzureCommunicationChatAdapter = async ({\n endpoint: endpointUrl,\n userId,\n displayName,\n credential,\n threadId\n}: AzureCommunicationChatAdapterArgs): Promise<ChatAdapter> => {\n return _createAzureCommunicationChatAdapterInner(endpointUrl, userId, displayName, credential, threadId);\n};\n\n/**\n * This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.\n *\n * @internal\n */\nexport const _createAzureCommunicationChatAdapterInner = async (\n endpoint: string,\n userId: CommunicationUserIdentifier,\n displayName: string,\n credential: CommunicationTokenCredential,\n threadId: string,\n telemetryImplementationHint: _TelemetryImplementationHint = 'Chat'\n): Promise<ChatAdapter> => {\n if (!_isValidIdentifier(userId)) {\n throw new Error('Provided userId is invalid. Please provide valid identifier object.');\n }\n\n const chatClient = _createStatefulChatClientInner(\n {\n userId,\n displayName,\n endpoint,\n credential\n },\n undefined,\n telemetryImplementationHint\n );\n const chatThreadClient = await chatClient.getChatThreadClient(threadId);\n await chatClient.startRealtimeNotifications();\n\n const adapter = await createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient);\n\n return adapter;\n};\n\n/**\n * This inner function to create ChatAdapterPromise in case when threadID is not avaialble.\n * ThreadId is a promise to allow for lazy initialization of the adapter.\n * @internal\n */\nexport const _createLazyAzureCommunicationChatAdapterInner = async (\n endpoint: string,\n userId: CommunicationUserIdentifier,\n displayName: string,\n credential: CommunicationTokenCredential,\n threadId: Promise<string>,\n telemetryImplementationHint: _TelemetryImplementationHint = 'Chat'\n): Promise<ChatAdapter> => {\n if (!_isValidIdentifier(userId)) {\n throw new Error('Provided userId is invalid. Please provide valid identifier object.');\n }\n\n const chatClient = _createStatefulChatClientInner(\n {\n userId,\n displayName,\n endpoint,\n credential\n },\n undefined,\n telemetryImplementationHint\n );\n return threadId.then(async (threadId) => {\n if (UNSUPPORTED_CHAT_THREAD_TYPE.some((t) => threadId.includes(t))) {\n console.error(\n `Invalid Chat ThreadId: ${threadId}. Please note with Teams Channel Meetings, only Calling is supported and Chat is not currently supported. Read more: ${TEAMS_LIMITATION_LEARN_MORE}.`\n );\n }\n\n const chatThreadClient = await chatClient.getChatThreadClient(threadId);\n await chatClient.startRealtimeNotifications();\n\n const adapter = await createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient);\n\n return adapter;\n });\n};\n\n/**\n * A custom React hook to simplify the creation of {@link ChatAdapter}.\n *\n * Similar to {@link createAzureCommunicationChatAdapter}, but takes care of asynchronous\n * creation of the adapter internally.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n *\n * Note that you must memoize the arguments to avoid recreating adapter on each render.\n * See storybook for typical usage examples.\n *\n * @public\n */\nexport const useAzureCommunicationChatAdapter = (\n /**\n * Arguments to be passed to {@link createAzureCommunicationChatAdapter}.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n */\n args: Partial<AzureCommunicationChatAdapterArgs>,\n /**\n * Optional callback to modify the adapter once it is created.\n *\n * If set, must return the modified adapter.\n */\n afterCreate?: (adapter: ChatAdapter) => Promise<ChatAdapter>,\n /**\n * Optional callback called before the adapter is disposed.\n *\n * This is useful for clean up tasks, e.g., leaving any ongoing calls.\n */\n beforeDispose?: (adapter: ChatAdapter) => Promise<void>\n): ChatAdapter | undefined => {\n const { credential, displayName, endpoint, threadId, userId } = args;\n\n // State update needed to rerender the parent component when a new adapter is created.\n const [adapter, setAdapter] = useState<ChatAdapter | undefined>(undefined);\n // Ref needed for cleanup to access the old adapter created asynchronously.\n const adapterRef = useRef<ChatAdapter | undefined>(undefined);\n\n const afterCreateRef = useRef<((adapter: ChatAdapter) => Promise<ChatAdapter>) | undefined>(undefined);\n const beforeDisposeRef = useRef<((adapter: ChatAdapter) => Promise<void>) | undefined>(undefined);\n // These refs are updated on *each* render, so that the latest values\n // are used in the `useEffect` closures below.\n // Using a Ref ensures that new values for the callbacks do not trigger the\n // useEffect blocks, and a new adapter creation / distruction is not triggered.\n afterCreateRef.current = afterCreate;\n beforeDisposeRef.current = beforeDispose;\n\n useEffect(\n () => {\n if (!credential || !displayName || !endpoint || !threadId || !userId) {\n return;\n }\n (async () => {\n if (adapterRef.current) {\n // Dispose the old adapter when a new one is created.\n //\n // This clean up function uses `adapterRef` because `adapter` can not be added to the dependency array of\n // this `useEffect` -- we do not want to trigger a new adapter creation because of the first adapter\n // creation.\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n\n let newAdapter = await createAzureCommunicationChatAdapter({\n credential,\n displayName,\n endpoint,\n threadId,\n userId\n });\n if (afterCreateRef.current) {\n newAdapter = await afterCreateRef.current(newAdapter);\n }\n adapterRef.current = newAdapter;\n setAdapter(newAdapter);\n })();\n },\n // Explicitly list all arguments so that caller doesn't have to memoize the `args` object.\n [adapterRef, afterCreateRef, beforeDisposeRef, credential, displayName, endpoint, threadId, userId]\n );\n\n // Dispose any existing adapter when the component unmounts.\n useEffect(() => {\n return () => {\n (async () => {\n if (adapterRef.current) {\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n })();\n };\n }, []);\n\n return adapter;\n};\n\n/**\n * Create a {@link ChatAdapter} using the provided {@link StatefulChatClient}.\n *\n * Useful if you want to keep a reference to {@link StatefulChatClient}.\n * Consider using {@link createAzureCommunicationChatAdapter} for a simpler API.\n *\n * @public\n */\nexport async function createAzureCommunicationChatAdapterFromClient(\n chatClient: StatefulChatClient,\n chatThreadClient: ChatThreadClient\n): Promise<ChatAdapter> {\n return new AzureCommunicationChatAdapter(chatClient, chatThreadClient);\n}\n\nconst isChatError = (e: Error): e is ChatError => {\n return 'target' in e && e['target'] !== undefined && 'innerError' in e && e['innerError'] !== undefined;\n};\n"]}
|
1
|
+
{"version":3,"file":"AzureCommunicationChatAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;;;;;;;;AAElC,OAAO,EACL,8BAA8B,EAI/B,gDAAuC;AACxC,OAA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QACP,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAgB,6CAA6C,CACjE,UAA8B,EAC9B,gBAAkC;;QAElC,OAAO,IAAI,6BAA6B,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;IACzE,CAAC;CAAA;AAED,MAAM,WAAW,GAAG,CAAC,CAAQ,EAAkB,EAAE;IAC/C,OAAO,QAAQ,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,SAAS,IAAI,YAAY,IAAI,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,KAAK,SAAS,CAAC;AAC1G,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n _createStatefulChatClientInner,\n ChatClientState,\n ChatError,\n StatefulChatClient\n} from '@internal/chat-stateful-client';\nimport { ChatHandlers, createDefaultChatHandlers } from '@internal/chat-component-bindings';\nimport { ChatMessage, ChatMessageType, ChatThreadClient, SendMessageOptions } from '@azure/communication-chat';\nimport { CommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';\nimport type {\n ChatMessageDeletedEvent,\n ChatMessageEditedEvent,\n ChatMessageReceivedEvent,\n ChatThreadPropertiesUpdatedEvent,\n ParticipantsAddedEvent,\n ParticipantsRemovedEvent,\n ReadReceiptReceivedEvent\n} from '@azure/communication-chat';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport type { UploadChatImageResult } from '@internal/acs-ui-common';\nimport { toFlatCommunicationIdentifier, _TelemetryImplementationHint } from '@internal/acs-ui-common';\nimport { EventEmitter } from 'events';\nimport {\n ChatAdapter,\n ChatAdapterState,\n MessageDeletedListener,\n MessageEditedListener,\n MessageReadListener,\n MessageReceivedListener,\n ParticipantsAddedListener,\n ParticipantsRemovedListener,\n TopicChangedListener\n} from './ChatAdapter';\nimport { ResourceDetails } from './ChatAdapter';\nimport { AdapterError } from '../../common/adapters';\nimport { useEffect, useRef, useState } from 'react';\nimport { _isValidIdentifier } from '@internal/acs-ui-common';\nimport { TEAMS_LIMITATION_LEARN_MORE, UNSUPPORTED_CHAT_THREAD_TYPE } from '../../common/constants';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\n\n/**\n * Context of Chat, which is a centralized context for all state updates\n * @private\n */\nexport class ChatContext {\n private emitter: EventEmitter = new EventEmitter();\n private state: ChatAdapterState;\n private threadId: string;\n\n constructor(clientState: ChatClientState, threadId: string) {\n const thread = clientState.threads[threadId];\n this.threadId = threadId;\n if (!thread) {\n throw 'Cannot find threadId, please initialize thread before use!';\n }\n this.state = {\n userId: clientState.userId,\n displayName: clientState.displayName,\n thread,\n latestErrors: clientState.latestErrors\n };\n }\n\n public onStateChange(handler: (_uiState: ChatAdapterState) => void): void {\n this.emitter.on('stateChanged', handler);\n }\n\n public offStateChange(handler: (_uiState: ChatAdapterState) => void): void {\n this.emitter.off('stateChanged', handler);\n }\n\n public setState(state: ChatAdapterState): void {\n this.state = state;\n this.emitter.emit('stateChanged', this.state);\n }\n\n public getState(): ChatAdapterState {\n return this.state;\n }\n\n public setError(error: Error): void {\n this.setState({ ...this.state, error });\n }\n\n public updateClientState(clientState: ChatClientState): void {\n const thread = clientState.threads[this.threadId];\n if (!thread) {\n throw 'Cannot find threadId, please make sure thread state is still in Stateful ChatClient.';\n }\n\n let updatedState: ChatAdapterState = {\n userId: clientState.userId,\n displayName: clientState.displayName,\n thread,\n latestErrors: clientState.latestErrors\n };\n\n /* @conditional-compile-remove(file-sharing-acs) */\n updatedState = { ...updatedState };\n\n this.setState(updatedState);\n }\n}\n\n/**\n * @private\n */\nexport class AzureCommunicationChatAdapter implements ChatAdapter {\n private chatClient: StatefulChatClient;\n private chatThreadClient: ChatThreadClient;\n private context: ChatContext;\n private handlers: ChatHandlers;\n private emitter: EventEmitter = new EventEmitter();\n\n constructor(chatClient: StatefulChatClient, chatThreadClient: ChatThreadClient) {\n this.bindAllPublicMethods();\n this.chatClient = chatClient;\n this.chatThreadClient = chatThreadClient;\n this.context = new ChatContext(chatClient.getState(), chatThreadClient.threadId);\n\n const onStateChange = (clientState: ChatClientState): void => {\n // unsubscribe when the instance gets disposed\n if (!this) {\n chatClient.offStateChange(onStateChange);\n return;\n }\n this.context.updateClientState(clientState);\n };\n\n this.handlers = createDefaultChatHandlers(chatClient, chatThreadClient);\n\n this.chatClient.onStateChange(onStateChange);\n this.subscribeAllEvents();\n }\n\n private bindAllPublicMethods(): void {\n this.onStateChange = this.onStateChange.bind(this);\n this.offStateChange = this.offStateChange.bind(this);\n this.getState = this.getState.bind(this);\n this.dispose = this.dispose.bind(this);\n this.fetchInitialData = this.fetchInitialData.bind(this);\n this.sendMessage = this.sendMessage.bind(this);\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n this.uploadImage = this.uploadImage.bind(this);\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n this.deleteImage = this.deleteImage.bind(this);\n this.sendReadReceipt = this.sendReadReceipt.bind(this);\n this.sendTypingIndicator = this.sendTypingIndicator.bind(this);\n this.updateMessage = this.updateMessage.bind(this);\n this.deleteMessage = this.deleteMessage.bind(this);\n this.removeParticipant = this.removeParticipant.bind(this);\n this.setTopic = this.setTopic.bind(this);\n this.loadPreviousChatMessages = this.loadPreviousChatMessages.bind(this);\n this.on = this.on.bind(this);\n this.off = this.off.bind(this);\n this.downloadResourceToCache = this.downloadResourceToCache.bind(this);\n this.removeResourceFromCache = this.removeResourceFromCache.bind(this);\n }\n\n dispose(): void {\n this.unsubscribeAllEvents();\n this.chatClient.dispose();\n }\n\n async fetchInitialData(): Promise<void> {\n // If get properties fails we dont want to try to get the participants after.\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.chatThreadClient.getProperties();\n // Fetch all participants who joined before the local user.\n for await (const _page of this.chatThreadClient.listParticipants().byPage({\n // Fetch 100 participants per page by default.\n maxPageSize: 100\n // eslint-disable-next-line curly\n }));\n });\n }\n\n getState(): ChatAdapterState {\n return this.context.getState();\n }\n\n onStateChange(handler: (state: ChatAdapterState) => void): void {\n this.context.onStateChange(handler);\n }\n\n offStateChange(handler: (state: ChatAdapterState) => void): void {\n this.context.offStateChange(handler);\n }\n\n async sendMessage(\n content: string,\n options?: SendMessageOptions | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions\n ): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n return await this.handlers.onSendMessage(content, options);\n });\n }\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n async uploadImage(image: Blob, imageFilename: string): Promise<UploadChatImageResult> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return await this.handlers.onUploadImage(image, imageFilename);\n });\n }\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n async deleteImage(imageId: string): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return await this.handlers.onDeleteImage(imageId);\n });\n }\n\n async sendReadReceipt(chatMessageId: string): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onMessageSeen(chatMessageId);\n });\n }\n\n async sendTypingIndicator(): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onTyping();\n });\n }\n\n async removeParticipant(userId: string): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onRemoveParticipant(userId);\n });\n }\n\n async setTopic(topicName: string): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.updateThreadTopicName(topicName);\n });\n }\n\n async loadPreviousChatMessages(messagesToLoad: number): Promise<boolean> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return await this.handlers.onLoadPreviousChatMessages(messagesToLoad);\n });\n }\n\n async updateMessage(\n messageId: string,\n content: string,\n options?: Record<string, string> | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions\n ): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n /* @conditional-compile-remove(file-sharing-acs) */\n const messageOptions: MessageOptions = {};\n /* @conditional-compile-remove(file-sharing-acs) */\n if (\n options &&\n // if options.attachments is an array or undefined (for removal all attachments),\n // then given options is a MessageOptions\n (Array.isArray(options.attachments) || options.attachments === undefined)\n ) {\n messageOptions.attachments = options.attachments ?? [];\n }\n /* @conditional-compile-remove(file-sharing-acs) */\n if (\n options &&\n // if options.metadata is provided, we need to add it in MessageOptions\n options.metadata &&\n typeof options.metadata === 'object'\n ) {\n messageOptions.metadata = options.metadata;\n }\n /* @conditional-compile-remove(file-sharing-acs) */\n if (options && !('attachments' in options) && !('metadata' in options)) {\n // if options don't have attachments or metadata,\n // then it is a Record<string, string>\n /* @conditional-compile-remove(file-sharing-acs) */\n return await this.handlers.onUpdateMessage(messageId, content, options);\n }\n /* @conditional-compile-remove(file-sharing-acs) */\n return await this.handlers.onUpdateMessage(messageId, content, messageOptions);\n // metadata is never used in the current stable\n return await this.handlers.onUpdateMessage(messageId, content);\n });\n }\n\n async deleteMessage(messageId: string): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return await this.handlers.onDeleteMessage(messageId);\n });\n }\n\n async downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void> {\n this.chatClient.downloadResourceToCache(\n resourceDetails.threadId,\n resourceDetails.messageId,\n resourceDetails.resourceUrl\n );\n }\n\n removeResourceFromCache(resourceDetails: ResourceDetails): void {\n this.chatClient.removeResourceFromCache(\n resourceDetails.threadId,\n resourceDetails.messageId,\n resourceDetails.resourceUrl\n );\n }\n\n private messageReceivedListener(event: ChatMessageReceivedEvent): void {\n const isCurrentChatAdapterThread = event.threadId === this.chatThreadClient.threadId;\n\n if (!isCurrentChatAdapterThread) {\n return;\n }\n\n const message = convertEventToChatMessage(event);\n this.emitter.emit('messageReceived', { message });\n\n const currentUserId = toFlatCommunicationIdentifier(this.chatClient.getState().userId);\n if (message?.sender && toFlatCommunicationIdentifier(message.sender) === currentUserId) {\n this.emitter.emit('messageSent', { message });\n }\n }\n\n private messageEditedListener(event: ChatMessageEditedEvent): void {\n const isCurrentChatAdapterThread = event.threadId === this.chatThreadClient.threadId;\n if (!isCurrentChatAdapterThread) {\n return;\n }\n\n const message = convertEventToChatMessage(event);\n this.emitter.emit('messageEdited', { message });\n }\n\n private messageDeletedListener(event: ChatMessageDeletedEvent): void {\n const isCurrentChatAdapterThread = event.threadId === this.chatThreadClient.threadId;\n if (!isCurrentChatAdapterThread) {\n return;\n }\n\n const message = convertEventToChatMessage(event);\n this.emitter.emit('messageDeleted', { message });\n }\n\n private messageReadListener({ chatMessageId, recipient }: ReadReceiptReceivedEvent): void {\n const message = this.getState().thread.chatMessages[chatMessageId];\n if (message) {\n this.emitter.emit('messageRead', { message, readBy: recipient });\n }\n }\n\n private participantsAddedListener({ addedBy, participantsAdded }: ParticipantsAddedEvent): void {\n this.emitter.emit('participantsAdded', { addedBy, participantsAdded });\n }\n\n private participantsRemovedListener({ removedBy, participantsRemoved }: ParticipantsRemovedEvent): void {\n this.emitter.emit('participantsRemoved', { removedBy, participantsRemoved });\n }\n\n private chatThreadPropertiesUpdatedListener(event: ChatThreadPropertiesUpdatedEvent): void {\n this.emitter.emit('topicChanged', { topic: event.properties.topic });\n }\n\n private subscribeAllEvents(): void {\n this.chatClient.on('chatThreadPropertiesUpdated', this.chatThreadPropertiesUpdatedListener.bind(this));\n this.chatClient.on('participantsAdded', this.participantsAddedListener.bind(this));\n this.chatClient.on('participantsRemoved', this.participantsRemovedListener.bind(this));\n this.chatClient.on('chatMessageReceived', this.messageReceivedListener.bind(this));\n this.chatClient.on('chatMessageEdited', this.messageEditedListener.bind(this));\n this.chatClient.on('chatMessageDeleted', this.messageDeletedListener.bind(this));\n this.chatClient.on('readReceiptReceived', this.messageReadListener.bind(this));\n this.chatClient.on('participantsRemoved', this.participantsRemovedListener.bind(this));\n }\n\n private unsubscribeAllEvents(): void {\n this.chatClient.off('chatThreadPropertiesUpdated', this.chatThreadPropertiesUpdatedListener.bind(this));\n this.chatClient.off('participantsAdded', this.participantsAddedListener.bind(this));\n this.chatClient.off('participantsRemoved', this.participantsRemovedListener.bind(this));\n this.chatClient.off('chatMessageReceived', this.messageReceivedListener.bind(this));\n this.chatClient.off('chatMessageEdited', this.messageEditedListener.bind(this));\n this.chatClient.off('chatMessageDeleted', this.messageDeletedListener.bind(this));\n this.chatClient.off('readReceiptReceived', this.messageReadListener.bind(this));\n this.chatClient.off('participantsRemoved', this.participantsRemovedListener.bind(this));\n }\n\n on(event: 'messageReceived', listener: MessageReceivedListener): void;\n on(event: 'messageEdited', listener: MessageEditedListener): void;\n on(event: 'messageDeleted', listener: MessageDeletedListener): void;\n on(event: 'messageSent', listener: MessageReceivedListener): void;\n on(event: 'messageRead', listener: MessageReadListener): void;\n on(event: 'participantsAdded', listener: ParticipantsAddedListener): void;\n on(event: 'participantsRemoved', listener: ParticipantsRemovedListener): void;\n on(event: 'topicChanged', listener: TopicChangedListener): void;\n on(event: 'error', listener: (e: AdapterError) => void): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n on(event: string, listener: (e: any) => void): void {\n this.emitter.on(event, listener);\n }\n\n off(event: 'messageReceived', listener: MessageReceivedListener): void;\n off(event: 'messageEdited', listener: MessageEditedListener): void;\n off(event: 'messageDeleted', listener: MessageDeletedListener): void;\n off(event: 'messageSent', listener: MessageReceivedListener): void;\n off(event: 'messageRead', listener: MessageReadListener): void;\n off(event: 'participantsAdded', listener: ParticipantsAddedListener): void;\n off(event: 'participantsRemoved', listener: ParticipantsRemovedListener): void;\n off(event: 'topicChanged', listener: TopicChangedListener): void;\n off(event: 'error', listener: (e: AdapterError) => void): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n off(event: string, listener: (e: any) => void): void {\n this.emitter.off(event, listener);\n }\n\n private async asyncTeeErrorToEventEmitter<T>(f: () => Promise<T>): Promise<T> {\n try {\n return await f();\n } catch (error) {\n if (isChatError(error as Error)) {\n this.emitter.emit('error', error as AdapterError);\n }\n throw error;\n }\n }\n}\n\nconst convertEventToChatMessage = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent | ChatMessageDeletedEvent\n): ChatMessage => {\n return {\n id: event.id,\n version: event.version,\n content: isChatMessageDeletedEvent(event) ? undefined : { message: event.message },\n type: convertEventType(event.type),\n sender: event.sender,\n senderDisplayName: event.senderDisplayName,\n sequenceId: '',\n createdOn: new Date(event.createdOn),\n editedOn: isChatMessageEditedEvent(event) ? event.editedOn : undefined,\n deletedOn: isChatMessageDeletedEvent(event) ? event.deletedOn : undefined\n };\n};\n\nconst isChatMessageEditedEvent = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent | ChatMessageDeletedEvent\n): event is ChatMessageEditedEvent => {\n return 'editedOn' in event;\n};\n\nconst isChatMessageDeletedEvent = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent | ChatMessageDeletedEvent\n): event is ChatMessageDeletedEvent => {\n return 'deletedOn' in event;\n};\n\n// only text/html message type will be received from event\nconst convertEventType = (type: string): ChatMessageType => {\n const lowerCaseType = type.toLowerCase();\n if (lowerCaseType === 'richtext/html' || lowerCaseType === 'html') {\n return 'html';\n } else {\n return 'text';\n }\n};\n\n/**\n * Arguments for creating the Azure Communication Services implementation of {@link ChatAdapter}.\n *\n * @public\n */\nexport type AzureCommunicationChatAdapterArgs = {\n endpoint: string;\n userId: CommunicationUserIdentifier;\n displayName: string;\n credential: CommunicationTokenCredential;\n threadId: string;\n};\n\n/**\n * Create a {@link ChatAdapter} backed by Azure Communication Services.\n *\n * This is the default implementation of {@link ChatAdapter} provided by this library.\n *\n * @public\n */\nexport const createAzureCommunicationChatAdapter = async ({\n endpoint: endpointUrl,\n userId,\n displayName,\n credential,\n threadId\n}: AzureCommunicationChatAdapterArgs): Promise<ChatAdapter> => {\n return _createAzureCommunicationChatAdapterInner(endpointUrl, userId, displayName, credential, threadId);\n};\n\n/**\n * This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.\n *\n * @internal\n */\nexport const _createAzureCommunicationChatAdapterInner = async (\n endpoint: string,\n userId: CommunicationUserIdentifier,\n displayName: string,\n credential: CommunicationTokenCredential,\n threadId: string,\n telemetryImplementationHint: _TelemetryImplementationHint = 'Chat'\n): Promise<ChatAdapter> => {\n if (!_isValidIdentifier(userId)) {\n throw new Error('Provided userId is invalid. Please provide valid identifier object.');\n }\n\n const chatClient = _createStatefulChatClientInner(\n {\n userId,\n displayName,\n endpoint,\n credential\n },\n undefined,\n telemetryImplementationHint\n );\n const chatThreadClient = await chatClient.getChatThreadClient(threadId);\n await chatClient.startRealtimeNotifications();\n\n const adapter = await createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient);\n\n return adapter;\n};\n\n/**\n * This inner function to create ChatAdapterPromise in case when threadID is not avaialble.\n * ThreadId is a promise to allow for lazy initialization of the adapter.\n * @internal\n */\nexport const _createLazyAzureCommunicationChatAdapterInner = async (\n endpoint: string,\n userId: CommunicationUserIdentifier,\n displayName: string,\n credential: CommunicationTokenCredential,\n threadId: Promise<string>,\n telemetryImplementationHint: _TelemetryImplementationHint = 'Chat'\n): Promise<ChatAdapter> => {\n if (!_isValidIdentifier(userId)) {\n throw new Error('Provided userId is invalid. Please provide valid identifier object.');\n }\n\n const chatClient = _createStatefulChatClientInner(\n {\n userId,\n displayName,\n endpoint,\n credential\n },\n undefined,\n telemetryImplementationHint\n );\n return threadId.then(async (threadId) => {\n if (UNSUPPORTED_CHAT_THREAD_TYPE.some((t) => threadId.includes(t))) {\n console.error(\n `Invalid Chat ThreadId: ${threadId}. Please note with Teams Channel Meetings, only Calling is supported and Chat is not currently supported. Read more: ${TEAMS_LIMITATION_LEARN_MORE}.`\n );\n }\n\n const chatThreadClient = await chatClient.getChatThreadClient(threadId);\n await chatClient.startRealtimeNotifications();\n\n const adapter = await createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient);\n\n return adapter;\n });\n};\n\n/**\n * A custom React hook to simplify the creation of {@link ChatAdapter}.\n *\n * Similar to {@link createAzureCommunicationChatAdapter}, but takes care of asynchronous\n * creation of the adapter internally.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n *\n * Note that you must memoize the arguments to avoid recreating adapter on each render.\n * See storybook for typical usage examples.\n *\n * @public\n */\nexport const useAzureCommunicationChatAdapter = (\n /**\n * Arguments to be passed to {@link createAzureCommunicationChatAdapter}.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n */\n args: Partial<AzureCommunicationChatAdapterArgs>,\n /**\n * Optional callback to modify the adapter once it is created.\n *\n * If set, must return the modified adapter.\n */\n afterCreate?: (adapter: ChatAdapter) => Promise<ChatAdapter>,\n /**\n * Optional callback called before the adapter is disposed.\n *\n * This is useful for clean up tasks, e.g., leaving any ongoing calls.\n */\n beforeDispose?: (adapter: ChatAdapter) => Promise<void>\n): ChatAdapter | undefined => {\n const { credential, displayName, endpoint, threadId, userId } = args;\n\n // State update needed to rerender the parent component when a new adapter is created.\n const [adapter, setAdapter] = useState<ChatAdapter | undefined>(undefined);\n // Ref needed for cleanup to access the old adapter created asynchronously.\n const adapterRef = useRef<ChatAdapter | undefined>(undefined);\n\n const afterCreateRef = useRef<((adapter: ChatAdapter) => Promise<ChatAdapter>) | undefined>(undefined);\n const beforeDisposeRef = useRef<((adapter: ChatAdapter) => Promise<void>) | undefined>(undefined);\n // These refs are updated on *each* render, so that the latest values\n // are used in the `useEffect` closures below.\n // Using a Ref ensures that new values for the callbacks do not trigger the\n // useEffect blocks, and a new adapter creation / distruction is not triggered.\n afterCreateRef.current = afterCreate;\n beforeDisposeRef.current = beforeDispose;\n\n useEffect(\n () => {\n if (!credential || !displayName || !endpoint || !threadId || !userId) {\n return;\n }\n (async () => {\n if (adapterRef.current) {\n // Dispose the old adapter when a new one is created.\n //\n // This clean up function uses `adapterRef` because `adapter` can not be added to the dependency array of\n // this `useEffect` -- we do not want to trigger a new adapter creation because of the first adapter\n // creation.\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n\n let newAdapter = await createAzureCommunicationChatAdapter({\n credential,\n displayName,\n endpoint,\n threadId,\n userId\n });\n if (afterCreateRef.current) {\n newAdapter = await afterCreateRef.current(newAdapter);\n }\n adapterRef.current = newAdapter;\n setAdapter(newAdapter);\n })();\n },\n // Explicitly list all arguments so that caller doesn't have to memoize the `args` object.\n [adapterRef, afterCreateRef, beforeDisposeRef, credential, displayName, endpoint, threadId, userId]\n );\n\n // Dispose any existing adapter when the component unmounts.\n useEffect(() => {\n return () => {\n (async () => {\n if (adapterRef.current) {\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n })();\n };\n }, []);\n\n return adapter;\n};\n\n/**\n * Create a {@link ChatAdapter} using the provided {@link StatefulChatClient}.\n *\n * Useful if you want to keep a reference to {@link StatefulChatClient}.\n * Consider using {@link createAzureCommunicationChatAdapter} for a simpler API.\n *\n * @public\n */\nexport async function createAzureCommunicationChatAdapterFromClient(\n chatClient: StatefulChatClient,\n chatThreadClient: ChatThreadClient\n): Promise<ChatAdapter> {\n return new AzureCommunicationChatAdapter(chatClient, chatThreadClient);\n}\n\nconst isChatError = (e: Error): e is ChatError => {\n return 'target' in e && e['target'] !== undefined && 'innerError' in e && e['innerError'] !== undefined;\n};\n"]}
|
package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js
CHANGED
@@ -152,7 +152,7 @@ export const CommonCallControlBar = (props) => {
|
|
152
152
|
}, [props.callAdapter, startDeepNoiseSuppression]);
|
153
153
|
/* @conditional-compile-remove(DNS) */
|
154
154
|
const showNoiseSuppressionButton = props.callAdapter.getState().onResolveDeepNoiseSuppressionDependency &&
|
155
|
-
!props.callAdapter.getState().
|
155
|
+
!props.callAdapter.getState().hideDeepNoiseSuppressionButton
|
156
156
|
? true
|
157
157
|
: false;
|
158
158
|
/* @conditional-compile-remove(DNS) */
|