@azure/communication-react 1.28.0-alpha-202506070019 → 1.28.0-alpha-202506120019
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/README.md +2 -2
- package/dist/communication-react.d.ts +3 -1
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-BLQjFCiz.js → ChatMessageComponentAsRichTextEditBox-ngP-K5bA.js} +8 -9
- package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-ngP-K5bA.js.map +1 -0
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DKX9Hw77.js → RichTextSendBoxWrapper-CsGkX3is.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DKX9Hw77.js.map → RichTextSendBoxWrapper-CsGkX3is.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-B1nXGt3n.js → index-rf3tf-XH.js} +185 -93
- package/dist/dist-cjs/communication-react/index-rf3tf-XH.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-stateful-client/src/DeviceManagerDeclarative.js +5 -2
- package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js +9 -6
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +7 -9
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +3 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js +6 -6
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js +12 -0
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +4 -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/components/ExpandedLocalVideoTile.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ExpandedLocalVideoTile.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.js +6 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +13 -13
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js +3 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +6 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +12 -9
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +30 -9
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +6 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +6 -2
- 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/CallWithChatBackedCallAdapter.js +3 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +6 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js +3 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/CaptionsBannerMoreButton.js +9 -5
- package/dist/dist-esm/react-composites/src/composites/common/CaptionsBannerMoreButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +31 -17
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +8 -4
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
- package/package.json +4 -4
- package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-BLQjFCiz.js.map +0 -1
- package/dist/dist-cjs/communication-react/index-B1nXGt3n.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CallWithChatBackedCallAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAqBlC,OAAO,EAA2B,uBAAuB,EAAyB,MAAM,6BAA6B,CAAC;AAEtH,OAAO,EAAE,0BAA0B,EAAE,yCAAgC;AASrE,uDAAuD;AACvD,sEAAsE;AAEtE;;;;GAIG;AACH,MAAM,OAAO,6BAA6B;IAOxC,YAAY,mBAAwC;QAJpD,gJAAgJ;QAChJ,iJAAiJ;QACzI,eAAU,GAAsF,IAAI,GAAG,EAAE,CAAC;QAM3G,OAAE,GAAG,CAAC,KAAU,EAAE,QAAa,EAAQ,EAAE;YAC9C,QAAQ,KAAK,EAAE,CAAC;gBACd,KAAK,OAAO;oBACV,OAAO,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;gBAC5D,KAAK,oBAAoB;oBACvB,OAAO,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,wBAAwB,EAAE,QAAQ,CAAC,CAAC;gBACz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AwB,CAAC,8BAA8B;QACvF,uCAAuC,EAAE,wBAAwB,CAAC,uCAAuC;QACzG,+BAA+B,EAAE,wBAAwB,CAAC,+BAA+B;QACzF,8BAA8B,EAAE,wBAAwB,CAAC,8BAA8B;QACvF,6BAA6B,EAAE,wBAAwB,CAAC,6BAA6B;QACrF,SAAS,EAAE,wBAAwB,CAAC,SAAS;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CallWithChatAdapter } from './CallWithChatAdapter';\nimport { CallAdapter, CallAdapterState } from '../../CallComposite';\n\nimport { VideoBackgroundImage, VideoBackgroundEffect } from '../../CallComposite';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\n\nimport { TogetherModeStreamViewResult, TogetherModeStreamOptions } from '@internal/react-components';\nimport {\n AudioDeviceInfo,\n VideoDeviceInfo,\n Call,\n PermissionConstraints,\n StartCallOptions,\n DeviceAccess\n} from '@azure/communication-calling';\nimport { Reaction } from '@azure/communication-calling';\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { DtmfTone } from '@azure/communication-calling';\nimport { CallWithChatAdapterState } from '../state/CallWithChatAdapterState';\nimport { CommunicationIdentifier, isPhoneNumberIdentifier, PhoneNumberIdentifier } from '@azure/communication-common';\nimport { CommunicationUserIdentifier } from '@azure/communication-common';\nimport { _toCommunicationIdentifier } from '@internal/acs-ui-common';\nimport {\n JoinCallOptions,\n StartCallIdentifier,\n StartCaptionsAdapterOptions,\n StopCaptionsAdapterOptions\n} from '../../CallComposite/adapter/CallAdapter';\nimport { CallSurvey, CallSurveyResponse } from '@azure/communication-calling';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\n/**\n * Facade around the CallWithChatAdapter to satisfy the call adapter interface.\n *\n * @private\n */\nexport class CallWithChatBackedCallAdapter implements CallAdapter {\n private callWithChatAdapter: CallWithChatAdapter;\n\n // For onStateChange we must convert CallWithChat state to chat state. This involves creating a new handler to be passed into the onStateChange.\n // In order to unsubscribe the handler when offStateChange is called we must have a mapping of the original handler to the newly created handler.\n private eventStore: Map<(state: CallAdapterState) => void, (state: CallWithChatAdapterState) => void> = new Map();\n\n constructor(callWithChatAdapter: CallWithChatAdapter) {\n this.callWithChatAdapter = callWithChatAdapter;\n }\n\n public on = (event: any, listener: any): void => {\n switch (event) {\n case 'error':\n return this.callWithChatAdapter.on('callError', listener);\n case 'participantsJoined':\n return this.callWithChatAdapter.on('callParticipantsJoined', listener);\n case 'participantsLeft':\n return this.callWithChatAdapter.on('callParticipantsLeft', listener);\n default:\n return this.callWithChatAdapter.on(event, listener);\n }\n };\n public off = (event: any, listener: any): void => {\n switch (event) {\n case 'error':\n return this.callWithChatAdapter.off('callError', listener);\n case 'participantsJoined':\n return this.callWithChatAdapter.off('callParticipantsJoined', listener);\n case 'participantsLeft':\n return this.callWithChatAdapter.off('callParticipantsLeft', listener);\n default:\n return this.callWithChatAdapter.off(event, listener);\n }\n };\n public onStateChange = (handler: (state: CallAdapterState) => void): void => {\n const convertedHandler = (state: CallWithChatAdapterState): void => {\n handler(callAdapterStateFromCallWithChatAdapterState(state));\n };\n this.callWithChatAdapter.onStateChange(convertedHandler);\n this.eventStore.set(handler, convertedHandler);\n };\n public offStateChange = (handler: (state: CallAdapterState) => void): void => {\n const convertedHandler = this.eventStore.get(handler);\n convertedHandler && this.callWithChatAdapter.offStateChange(convertedHandler);\n };\n public getState = (): CallAdapterState =>\n callAdapterStateFromCallWithChatAdapterState(this.callWithChatAdapter.getState());\n public dispose = (): void => this.callWithChatAdapter.dispose();\n public joinCall = (options?: boolean | JoinCallOptions): Call | undefined => {\n if (typeof options === 'boolean') {\n return this.callWithChatAdapter.joinCall(options);\n } else {\n return this.callWithChatAdapter.joinCall(options);\n }\n };\n public leaveCall = async (forEveryone?: boolean): Promise<void> =>\n await this.callWithChatAdapter.leaveCall(forEveryone);\n\n public startCall = (participants: (string | StartCallIdentifier)[], options: StartCallOptions): Call | undefined => {\n if (participants.every((participant: string | StartCallIdentifier) => typeof participant === 'string')) {\n return this.callWithChatAdapter.startCall(participants as string[], options);\n } else {\n return this.callWithChatAdapter.startCall(participants as StartCallIdentifier[], options);\n }\n };\n public setCamera = async (sourceId: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void> =>\n await this.callWithChatAdapter.setCamera(sourceId, options);\n public setMicrophone = async (sourceId: AudioDeviceInfo): Promise<void> =>\n await this.callWithChatAdapter.setMicrophone(sourceId);\n public setSpeaker = async (sourceId: AudioDeviceInfo): Promise<void> =>\n await this.callWithChatAdapter.setSpeaker(sourceId);\n public askDevicePermission = async (constraints: PermissionConstraints): Promise<DeviceAccess> =>\n await this.callWithChatAdapter.askDevicePermission(constraints);\n public queryCameras = async (): Promise<VideoDeviceInfo[]> => await this.callWithChatAdapter.queryCameras();\n public queryMicrophones = async (): Promise<AudioDeviceInfo[]> => await this.callWithChatAdapter.queryMicrophones();\n public querySpeakers = async (): Promise<AudioDeviceInfo[]> => await this.callWithChatAdapter.querySpeakers();\n public startCamera = async (options?: VideoStreamOptions): Promise<void> =>\n await this.callWithChatAdapter.startCamera(options);\n public stopCamera = async (): Promise<void> => await this.callWithChatAdapter.stopCamera();\n public mute = async (): Promise<void> => await this.callWithChatAdapter.mute();\n public unmute = async (): Promise<void> => await this.callWithChatAdapter.unmute();\n public startScreenShare = async (): Promise<void> => await this.callWithChatAdapter.startScreenShare();\n public stopScreenShare = async (): Promise<void> => await this.callWithChatAdapter.stopScreenShare();\n public raiseHand = async (): Promise<void> => await this.callWithChatAdapter.raiseHand();\n public lowerHand = async (): Promise<void> => await this.callWithChatAdapter.lowerHand();\n public onReactionClick = async (reaction: Reaction): Promise<void> =>\n await this.callWithChatAdapter.onReactionClick(reaction);\n public removeParticipant = async (userId: string | CommunicationIdentifier): Promise<void> => {\n let participant = userId;\n participant = _toCommunicationIdentifier(userId);\n await this.callWithChatAdapter.removeParticipant(participant);\n };\n public createStreamView = async (\n remoteUserId?: string,\n options?: VideoStreamOptions\n ): Promise<void | CreateVideoStreamViewResult> =>\n await this.callWithChatAdapter.createStreamView(remoteUserId, options);\n\n public createTogetherModeStreamView = async (\n options?: TogetherModeStreamOptions\n ): Promise<void | TogetherModeStreamViewResult> =>\n await this.callWithChatAdapter.createTogetherModeStreamView(options);\n public startTogetherMode = async (): Promise<void> => await this.callWithChatAdapter.startTogetherMode();\n public setTogetherModeSceneSize = (width: number, height: number): void =>\n this.callWithChatAdapter.setTogetherModeSceneSize(width, height);\n public disposeStreamView = async (remoteUserId?: string, options?: VideoStreamOptions): Promise<void> =>\n await this.callWithChatAdapter.disposeStreamView(remoteUserId, options);\n public disposeScreenShareStreamView(remoteUserId: string): Promise<void> {\n return this.callWithChatAdapter.disposeScreenShareStreamView(remoteUserId);\n }\n public disposeRemoteVideoStreamView(remoteUserId: string): Promise<void> {\n return this.callWithChatAdapter.disposeRemoteVideoStreamView(remoteUserId);\n }\n public disposeLocalVideoStreamView(): Promise<void> {\n return this.callWithChatAdapter.disposeLocalVideoStreamView();\n }\n public disposeTogetherModeStreamView = async (): Promise<void> =>\n await this.callWithChatAdapter.disposeTogetherModeStreamView();\n public holdCall = async (): Promise<void> => {\n await this.callWithChatAdapter.holdCall();\n };\n public resumeCall = async (): Promise<void> => {\n await this.callWithChatAdapter.resumeCall();\n };\n public async addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;\n public async addParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n public async addParticipant(\n participant: PhoneNumberIdentifier | CommunicationUserIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> {\n if (isPhoneNumberIdentifier(participant) && options) {\n return this.callWithChatAdapter.addParticipant(participant as PhoneNumberIdentifier, options);\n } else {\n return this.callWithChatAdapter.addParticipant(participant as CommunicationUserIdentifier);\n }\n }\n\n /* @conditional-compile-remove(unsupported-browser) */\n public allowUnsupportedBrowserVersion(): void {\n return this.callWithChatAdapter.allowUnsupportedBrowserVersion();\n }\n\n public sendDtmfTone = async (dtmfTone: DtmfTone): Promise<void> => {\n await this.callWithChatAdapter.sendDtmfTone(dtmfTone);\n };\n\n public async startCaptions(options?: StartCaptionsAdapterOptions): Promise<void> {\n await this.callWithChatAdapter.startCaptions(options);\n }\n\n public async stopCaptions(options?: StopCaptionsAdapterOptions): Promise<void> {\n await this.callWithChatAdapter.stopCaptions(options);\n }\n\n public async setCaptionLanguage(language: string): Promise<void> {\n await this.callWithChatAdapter.setCaptionLanguage(language);\n }\n\n public async setSpokenLanguage(language: string): Promise<void> {\n await this.callWithChatAdapter.setSpokenLanguage(language);\n }\n\n public async sendRealTimeText(text: string, isFinalized: boolean): Promise<void> {\n await this.callWithChatAdapter.sendRealTimeText(text, isFinalized);\n }\n\n public async startVideoBackgroundEffect(videoBackgroundEffect: VideoBackgroundEffect): Promise<void> {\n await this.callWithChatAdapter.startVideoBackgroundEffect(videoBackgroundEffect);\n }\n\n public async stopVideoBackgroundEffects(): Promise<void> {\n await this.callWithChatAdapter.stopVideoBackgroundEffects();\n }\n\n public updateBackgroundPickerImages(backgroundImages: VideoBackgroundImage[]): void {\n return this.callWithChatAdapter.updateBackgroundPickerImages(backgroundImages);\n }\n\n public updateSelectedVideoBackgroundEffect(selectedVideoBackground: VideoBackgroundEffect): void {\n return this.callWithChatAdapter.updateSelectedVideoBackgroundEffect(selectedVideoBackground);\n }\n\n public async startNoiseSuppressionEffect(): Promise<void> {\n return this.callWithChatAdapter.startNoiseSuppressionEffect();\n }\n\n public async stopNoiseSuppressionEffect(): Promise<void> {\n return this.callWithChatAdapter.stopNoiseSuppressionEffect();\n }\n\n public async submitSurvey(survey: CallSurvey): Promise<CallSurveyResponse | undefined> {\n return this.callWithChatAdapter.submitSurvey(survey);\n }\n\n public async startSpotlight(userIds?: string[]): Promise<void> {\n return this.callWithChatAdapter.startSpotlight(userIds);\n }\n\n public async stopSpotlight(userIds?: string[]): Promise<void> {\n return this.callWithChatAdapter.stopSpotlight(userIds);\n }\n\n public async stopAllSpotlight(): Promise<void> {\n return this.callWithChatAdapter.stopAllSpotlight();\n }\n\n public async muteParticipant(userId: string): Promise<void> {\n return this.callWithChatAdapter.muteParticipant(userId);\n }\n\n public async muteAllRemoteParticipants(): Promise<void> {\n return this.callWithChatAdapter.muteAllRemoteParticipants();\n }\n\n public async returnFromBreakoutRoom(): Promise<void> {\n return this.callWithChatAdapter.returnFromBreakoutRoom();\n }\n\n public async forbidAudio(userIds: string[]): Promise<void> {\n return this.callWithChatAdapter.forbidAudio(userIds);\n }\n\n public async permitAudio(userIds: string[]): Promise<void> {\n return this.callWithChatAdapter.permitAudio(userIds);\n }\n\n public async forbidOthersAudio(): Promise<void> {\n return this.callWithChatAdapter.forbidOthersAudio();\n }\n\n public async permitOthersAudio(): Promise<void> {\n return this.callWithChatAdapter.permitOthersAudio();\n }\n\n public async forbidVideo(userIds: string[]): Promise<void> {\n return this.callWithChatAdapter.forbidAudio(userIds);\n }\n\n public async permitVideo(userIds: string[]): Promise<void> {\n return this.callWithChatAdapter.permitAudio(userIds);\n }\n\n public async forbidOthersVideo(): Promise<void> {\n return this.callWithChatAdapter.forbidOthersAudio();\n }\n\n public async permitOthersVideo(): Promise<void> {\n return this.callWithChatAdapter.permitOthersAudio();\n }\n}\n\nfunction callAdapterStateFromCallWithChatAdapterState(\n callWithChatAdapterState: CallWithChatAdapterState\n): CallAdapterState {\n return {\n isLocalPreviewMicrophoneEnabled: callWithChatAdapterState.isLocalPreviewMicrophoneEnabled,\n page: callWithChatAdapterState.page,\n userId: callWithChatAdapterState.userId,\n displayName: callWithChatAdapterState.displayName,\n call: callWithChatAdapterState.call,\n devices: callWithChatAdapterState.devices,\n isTeamsCall: callWithChatAdapterState.isTeamsCall,\n isTeamsMeeting: callWithChatAdapterState.isTeamsMeeting,\n isRoomsCall: false,\n latestErrors: callWithChatAdapterState.latestCallErrors,\n latestNotifications: callWithChatAdapterState.latestCallNotifications,\n alternateCallerId: callWithChatAdapterState.alternateCallerId,\n environmentInfo: callWithChatAdapterState.environmentInfo,\n\n videoBackgroundImages: callWithChatAdapterState.videoBackgroundImages,\n\n onResolveVideoEffectDependency: callWithChatAdapterState.onResolveVideoEffectDependency,\n onResolveDeepNoiseSuppressionDependency: callWithChatAdapterState.onResolveDeepNoiseSuppressionDependency,\n deepNoiseSuppressionOnByDefault: callWithChatAdapterState.deepNoiseSuppressionOnByDefault,\n hideDeepNoiseSuppressionButton: callWithChatAdapterState.hideDeepNoiseSuppressionButton,\n selectedVideoBackgroundEffect: callWithChatAdapterState.selectedVideoBackgroundEffect,\n reactions: callWithChatAdapterState.reactions\n };\n}\n"]}
|
1
|
+
{"version":3,"file":"CallWithChatBackedCallAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAqBlC,OAAO,EAA2B,uBAAuB,EAAyB,MAAM,6BAA6B,CAAC;AAEtH,OAAO,EAAE,0BAA0B,EAAE,yCAAgC;AASrE,uDAAuD;AACvD,sEAAsE;AAEtE;;;;GAIG;AACH,MAAM,OAAO,6BAA6B;IAOxC,YAAY,mBAAwC;QAJpD,gJAAgJ;QAChJ,iJAAiJ;QACzI,eAAU,GAAsF,IAAI,GAAG,EAAE,CAAC;QAM3G,OAAE,GAAG,CAAC,KAAU,EAAE,QAAa,EAAQ,EAAE;YAC9C,QAAQ,KAAK,EAAE,CAAC;gBACd,KAAK,OAAO;oBACV,OAAO,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;gBAC5D,KAAK,oBAAoB;oBACvB,OAAO,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,wBAAwB,EAAE,QAAQ,CAAC,CAAC;gBACzE,KAAK,kBAAkB;oBACrB,OAAO,IAAI,CAAC,mBAAmB,CAAC,EAAE,C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,EAAE,wBAAwB,CAAC,uCAAuC;QACzG,+BAA+B,EAAE,wBAAwB,CAAC,+BAA+B;QACzF,8BAA8B,EAAE,wBAAwB,CAAC,8BAA8B;QACvF,6BAA6B,EAAE,wBAAwB,CAAC,6BAA6B;QACrF,SAAS,EAAE,wBAAwB,CAAC,SAAS;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CallWithChatAdapter } from './CallWithChatAdapter';\nimport { CallAdapter, CallAdapterState } from '../../CallComposite';\n\nimport { VideoBackgroundImage, VideoBackgroundEffect } from '../../CallComposite';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\n\nimport { TogetherModeStreamViewResult, TogetherModeStreamOptions } from '@internal/react-components';\nimport {\n AudioDeviceInfo,\n VideoDeviceInfo,\n Call,\n PermissionConstraints,\n StartCallOptions,\n DeviceAccess\n} from '@azure/communication-calling';\nimport { Reaction } from '@azure/communication-calling';\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { DtmfTone } from '@azure/communication-calling';\nimport { CallWithChatAdapterState } from '../state/CallWithChatAdapterState';\nimport { CommunicationIdentifier, isPhoneNumberIdentifier, PhoneNumberIdentifier } from '@azure/communication-common';\nimport { CommunicationUserIdentifier } from '@azure/communication-common';\nimport { _toCommunicationIdentifier } from '@internal/acs-ui-common';\nimport {\n JoinCallOptions,\n StartCallIdentifier,\n StartCaptionsAdapterOptions,\n StopCaptionsAdapterOptions\n} from '../../CallComposite/adapter/CallAdapter';\nimport { CallSurvey, CallSurveyResponse } from '@azure/communication-calling';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\n/**\n * Facade around the CallWithChatAdapter to satisfy the call adapter interface.\n *\n * @private\n */\nexport class CallWithChatBackedCallAdapter implements CallAdapter {\n private callWithChatAdapter: CallWithChatAdapter;\n\n // For onStateChange we must convert CallWithChat state to chat state. This involves creating a new handler to be passed into the onStateChange.\n // In order to unsubscribe the handler when offStateChange is called we must have a mapping of the original handler to the newly created handler.\n private eventStore: Map<(state: CallAdapterState) => void, (state: CallWithChatAdapterState) => void> = new Map();\n\n constructor(callWithChatAdapter: CallWithChatAdapter) {\n this.callWithChatAdapter = callWithChatAdapter;\n }\n\n public on = (event: any, listener: any): void => {\n switch (event) {\n case 'error':\n return this.callWithChatAdapter.on('callError', listener);\n case 'participantsJoined':\n return this.callWithChatAdapter.on('callParticipantsJoined', listener);\n case 'participantsLeft':\n return this.callWithChatAdapter.on('callParticipantsLeft', listener);\n default:\n return this.callWithChatAdapter.on(event, listener);\n }\n };\n public off = (event: any, listener: any): void => {\n switch (event) {\n case 'error':\n return this.callWithChatAdapter.off('callError', listener);\n case 'participantsJoined':\n return this.callWithChatAdapter.off('callParticipantsJoined', listener);\n case 'participantsLeft':\n return this.callWithChatAdapter.off('callParticipantsLeft', listener);\n default:\n return this.callWithChatAdapter.off(event, listener);\n }\n };\n public onStateChange = (handler: (state: CallAdapterState) => void): void => {\n const convertedHandler = (state: CallWithChatAdapterState): void => {\n handler(callAdapterStateFromCallWithChatAdapterState(state));\n };\n this.callWithChatAdapter.onStateChange(convertedHandler);\n this.eventStore.set(handler, convertedHandler);\n };\n public offStateChange = (handler: (state: CallAdapterState) => void): void => {\n const convertedHandler = this.eventStore.get(handler);\n if (convertedHandler) {\n this.callWithChatAdapter.offStateChange(convertedHandler);\n }\n };\n public getState = (): CallAdapterState =>\n callAdapterStateFromCallWithChatAdapterState(this.callWithChatAdapter.getState());\n public dispose = (): void => this.callWithChatAdapter.dispose();\n public joinCall = (options?: boolean | JoinCallOptions): Call | undefined => {\n if (typeof options === 'boolean') {\n return this.callWithChatAdapter.joinCall(options);\n } else {\n return this.callWithChatAdapter.joinCall(options);\n }\n };\n public leaveCall = async (forEveryone?: boolean): Promise<void> =>\n await this.callWithChatAdapter.leaveCall(forEveryone);\n\n public startCall = (participants: (string | StartCallIdentifier)[], options: StartCallOptions): Call | undefined => {\n if (participants.every((participant: string | StartCallIdentifier) => typeof participant === 'string')) {\n return this.callWithChatAdapter.startCall(participants as string[], options);\n } else {\n return this.callWithChatAdapter.startCall(participants as StartCallIdentifier[], options);\n }\n };\n public setCamera = async (sourceId: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void> =>\n await this.callWithChatAdapter.setCamera(sourceId, options);\n public setMicrophone = async (sourceId: AudioDeviceInfo): Promise<void> =>\n await this.callWithChatAdapter.setMicrophone(sourceId);\n public setSpeaker = async (sourceId: AudioDeviceInfo): Promise<void> =>\n await this.callWithChatAdapter.setSpeaker(sourceId);\n public askDevicePermission = async (constraints: PermissionConstraints): Promise<DeviceAccess> =>\n await this.callWithChatAdapter.askDevicePermission(constraints);\n public queryCameras = async (): Promise<VideoDeviceInfo[]> => await this.callWithChatAdapter.queryCameras();\n public queryMicrophones = async (): Promise<AudioDeviceInfo[]> => await this.callWithChatAdapter.queryMicrophones();\n public querySpeakers = async (): Promise<AudioDeviceInfo[]> => await this.callWithChatAdapter.querySpeakers();\n public startCamera = async (options?: VideoStreamOptions): Promise<void> =>\n await this.callWithChatAdapter.startCamera(options);\n public stopCamera = async (): Promise<void> => await this.callWithChatAdapter.stopCamera();\n public mute = async (): Promise<void> => await this.callWithChatAdapter.mute();\n public unmute = async (): Promise<void> => await this.callWithChatAdapter.unmute();\n public startScreenShare = async (): Promise<void> => await this.callWithChatAdapter.startScreenShare();\n public stopScreenShare = async (): Promise<void> => await this.callWithChatAdapter.stopScreenShare();\n public raiseHand = async (): Promise<void> => await this.callWithChatAdapter.raiseHand();\n public lowerHand = async (): Promise<void> => await this.callWithChatAdapter.lowerHand();\n public onReactionClick = async (reaction: Reaction): Promise<void> =>\n await this.callWithChatAdapter.onReactionClick(reaction);\n public removeParticipant = async (userId: string | CommunicationIdentifier): Promise<void> => {\n let participant = userId;\n participant = _toCommunicationIdentifier(userId);\n await this.callWithChatAdapter.removeParticipant(participant);\n };\n public createStreamView = async (\n remoteUserId?: string,\n options?: VideoStreamOptions\n ): Promise<void | CreateVideoStreamViewResult> =>\n await this.callWithChatAdapter.createStreamView(remoteUserId, options);\n\n public createTogetherModeStreamView = async (\n options?: TogetherModeStreamOptions\n ): Promise<void | TogetherModeStreamViewResult> =>\n await this.callWithChatAdapter.createTogetherModeStreamView(options);\n public startTogetherMode = async (): Promise<void> => await this.callWithChatAdapter.startTogetherMode();\n public setTogetherModeSceneSize = (width: number, height: number): void =>\n this.callWithChatAdapter.setTogetherModeSceneSize(width, height);\n public disposeStreamView = async (remoteUserId?: string, options?: VideoStreamOptions): Promise<void> =>\n await this.callWithChatAdapter.disposeStreamView(remoteUserId, options);\n public disposeScreenShareStreamView(remoteUserId: string): Promise<void> {\n return this.callWithChatAdapter.disposeScreenShareStreamView(remoteUserId);\n }\n public disposeRemoteVideoStreamView(remoteUserId: string): Promise<void> {\n return this.callWithChatAdapter.disposeRemoteVideoStreamView(remoteUserId);\n }\n public disposeLocalVideoStreamView(): Promise<void> {\n return this.callWithChatAdapter.disposeLocalVideoStreamView();\n }\n public disposeTogetherModeStreamView = async (): Promise<void> =>\n await this.callWithChatAdapter.disposeTogetherModeStreamView();\n public holdCall = async (): Promise<void> => {\n await this.callWithChatAdapter.holdCall();\n };\n public resumeCall = async (): Promise<void> => {\n await this.callWithChatAdapter.resumeCall();\n };\n public async addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;\n public async addParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n public async addParticipant(\n participant: PhoneNumberIdentifier | CommunicationUserIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> {\n if (isPhoneNumberIdentifier(participant) && options) {\n return this.callWithChatAdapter.addParticipant(participant as PhoneNumberIdentifier, options);\n } else {\n return this.callWithChatAdapter.addParticipant(participant as CommunicationUserIdentifier);\n }\n }\n\n /* @conditional-compile-remove(unsupported-browser) */\n public allowUnsupportedBrowserVersion(): void {\n return this.callWithChatAdapter.allowUnsupportedBrowserVersion();\n }\n\n public sendDtmfTone = async (dtmfTone: DtmfTone): Promise<void> => {\n await this.callWithChatAdapter.sendDtmfTone(dtmfTone);\n };\n\n public async startCaptions(options?: StartCaptionsAdapterOptions): Promise<void> {\n await this.callWithChatAdapter.startCaptions(options);\n }\n\n public async stopCaptions(options?: StopCaptionsAdapterOptions): Promise<void> {\n await this.callWithChatAdapter.stopCaptions(options);\n }\n\n public async setCaptionLanguage(language: string): Promise<void> {\n await this.callWithChatAdapter.setCaptionLanguage(language);\n }\n\n public async setSpokenLanguage(language: string): Promise<void> {\n await this.callWithChatAdapter.setSpokenLanguage(language);\n }\n\n public async sendRealTimeText(text: string, isFinalized: boolean): Promise<void> {\n await this.callWithChatAdapter.sendRealTimeText(text, isFinalized);\n }\n\n public async startVideoBackgroundEffect(videoBackgroundEffect: VideoBackgroundEffect): Promise<void> {\n await this.callWithChatAdapter.startVideoBackgroundEffect(videoBackgroundEffect);\n }\n\n public async stopVideoBackgroundEffects(): Promise<void> {\n await this.callWithChatAdapter.stopVideoBackgroundEffects();\n }\n\n public updateBackgroundPickerImages(backgroundImages: VideoBackgroundImage[]): void {\n return this.callWithChatAdapter.updateBackgroundPickerImages(backgroundImages);\n }\n\n public updateSelectedVideoBackgroundEffect(selectedVideoBackground: VideoBackgroundEffect): void {\n return this.callWithChatAdapter.updateSelectedVideoBackgroundEffect(selectedVideoBackground);\n }\n\n public async startNoiseSuppressionEffect(): Promise<void> {\n return this.callWithChatAdapter.startNoiseSuppressionEffect();\n }\n\n public async stopNoiseSuppressionEffect(): Promise<void> {\n return this.callWithChatAdapter.stopNoiseSuppressionEffect();\n }\n\n public async submitSurvey(survey: CallSurvey): Promise<CallSurveyResponse | undefined> {\n return this.callWithChatAdapter.submitSurvey(survey);\n }\n\n public async startSpotlight(userIds?: string[]): Promise<void> {\n return this.callWithChatAdapter.startSpotlight(userIds);\n }\n\n public async stopSpotlight(userIds?: string[]): Promise<void> {\n return this.callWithChatAdapter.stopSpotlight(userIds);\n }\n\n public async stopAllSpotlight(): Promise<void> {\n return this.callWithChatAdapter.stopAllSpotlight();\n }\n\n public async muteParticipant(userId: string): Promise<void> {\n return this.callWithChatAdapter.muteParticipant(userId);\n }\n\n public async muteAllRemoteParticipants(): Promise<void> {\n return this.callWithChatAdapter.muteAllRemoteParticipants();\n }\n\n public async returnFromBreakoutRoom(): Promise<void> {\n return this.callWithChatAdapter.returnFromBreakoutRoom();\n }\n\n public async forbidAudio(userIds: string[]): Promise<void> {\n return this.callWithChatAdapter.forbidAudio(userIds);\n }\n\n public async permitAudio(userIds: string[]): Promise<void> {\n return this.callWithChatAdapter.permitAudio(userIds);\n }\n\n public async forbidOthersAudio(): Promise<void> {\n return this.callWithChatAdapter.forbidOthersAudio();\n }\n\n public async permitOthersAudio(): Promise<void> {\n return this.callWithChatAdapter.permitOthersAudio();\n }\n\n public async forbidVideo(userIds: string[]): Promise<void> {\n return this.callWithChatAdapter.forbidAudio(userIds);\n }\n\n public async permitVideo(userIds: string[]): Promise<void> {\n return this.callWithChatAdapter.permitAudio(userIds);\n }\n\n public async forbidOthersVideo(): Promise<void> {\n return this.callWithChatAdapter.forbidOthersAudio();\n }\n\n public async permitOthersVideo(): Promise<void> {\n return this.callWithChatAdapter.permitOthersAudio();\n }\n}\n\nfunction callAdapterStateFromCallWithChatAdapterState(\n callWithChatAdapterState: CallWithChatAdapterState\n): CallAdapterState {\n return {\n isLocalPreviewMicrophoneEnabled: callWithChatAdapterState.isLocalPreviewMicrophoneEnabled,\n page: callWithChatAdapterState.page,\n userId: callWithChatAdapterState.userId,\n displayName: callWithChatAdapterState.displayName,\n call: callWithChatAdapterState.call,\n devices: callWithChatAdapterState.devices,\n isTeamsCall: callWithChatAdapterState.isTeamsCall,\n isTeamsMeeting: callWithChatAdapterState.isTeamsMeeting,\n isRoomsCall: false,\n latestErrors: callWithChatAdapterState.latestCallErrors,\n latestNotifications: callWithChatAdapterState.latestCallNotifications,\n alternateCallerId: callWithChatAdapterState.alternateCallerId,\n environmentInfo: callWithChatAdapterState.environmentInfo,\n\n videoBackgroundImages: callWithChatAdapterState.videoBackgroundImages,\n\n onResolveVideoEffectDependency: callWithChatAdapterState.onResolveVideoEffectDependency,\n onResolveDeepNoiseSuppressionDependency: callWithChatAdapterState.onResolveDeepNoiseSuppressionDependency,\n deepNoiseSuppressionOnByDefault: callWithChatAdapterState.deepNoiseSuppressionOnByDefault,\n hideDeepNoiseSuppressionButton: callWithChatAdapterState.hideDeepNoiseSuppressionButton,\n selectedVideoBackgroundEffect: callWithChatAdapterState.selectedVideoBackgroundEffect,\n reactions: callWithChatAdapterState.reactions\n };\n}\n"]}
|
@@ -57,14 +57,18 @@ export class CallWithChatBackedChatAdapter {
|
|
57
57
|
this.dispose = () => this.callWithChatAdapter.dispose();
|
58
58
|
this.onStateChange = (handler) => {
|
59
59
|
const convertedHandler = (state) => {
|
60
|
-
|
60
|
+
if (state.chat) {
|
61
|
+
handler(chatAdapterStateFromCallWithChatAdapterState(state));
|
62
|
+
}
|
61
63
|
};
|
62
64
|
this.callWithChatAdapter.onStateChange(convertedHandler);
|
63
65
|
this.eventStore.set(handler, convertedHandler);
|
64
66
|
};
|
65
67
|
this.offStateChange = (handler) => {
|
66
68
|
const convertedHandler = this.eventStore.get(handler);
|
67
|
-
|
69
|
+
if (convertedHandler) {
|
70
|
+
this.callWithChatAdapter.offStateChange(convertedHandler);
|
71
|
+
}
|
68
72
|
};
|
69
73
|
this.getState = () => chatAdapterStateFromCallWithChatAdapterState(this.callWithChatAdapter.getState());
|
70
74
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CallWithChatBackedChatAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AASlC,OAAO,EAAE,6BAA6B,EAAE,yCAAgC;AAI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C,gBAAgB;SACxD,CAAC;IACJ,CAAC;IAED,OAAO;QACL,MAAM,EAAE,wBAAwB,CAAC,MAAM;QACvC,WAAW,EAAE,wBAAwB,CAAC,WAAW,IAAI,EAAE;QACvD,MAAM,EAAE,wBAAwB,CAAC,IAAI;QACrC,YAAY,EAAE,wBAAwB,CAAC,gBAAgB;KACxD,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CallWithChatAdapter } from './CallWithChatAdapter';\nimport { ChatAdapter, ChatAdapterState } from '../../ChatComposite';\nimport { ResourceDetails } from '../../ChatComposite';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\nimport { ErrorBarStrings } from '@internal/react-components';\nimport { CallWithChatAdapterState } from '../state/CallWithChatAdapterState';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { UploadChatImageResult } from '@internal/acs-ui-common';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/**\n * Facade around the CallWithChatAdapter to satisfy the chat adapter interface.\n *\n * @private\n */\nexport class CallWithChatBackedChatAdapter implements ChatAdapter {\n private callWithChatAdapter: CallWithChatAdapter;\n\n // For onStateChange we must convert CallWithChat state to chat state. This involves creating a new handler to be passed into the onStateChange.\n // In order to unsubscribe the handler when offStateChange is called we must have a mapping of the original handler to the newly created handler.\n private eventStore: Map<(state: ChatAdapterState) => void, (state: CallWithChatAdapterState) => void> = new Map();\n\n constructor(callWithChatAdapter: CallWithChatAdapter) {\n this.callWithChatAdapter = callWithChatAdapter;\n }\n\n public fetchInitialData = async (): Promise<void> => await this.callWithChatAdapter.fetchInitialData();\n // due to a bug in babel, we can't use arrow function here\n // affecting conditional-compile-remove(attachment-upload)\n // have to bind this since the scope of 'this' is lost when the function is passed as a callback\n sendMessageHandler = async function (\n this: CallWithChatBackedChatAdapter,\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n options?: MessageOptions\n ): Promise<void> {\n await this.callWithChatAdapter.sendMessage(content, /* @conditional-compile-remove(file-sharing-acs) */ options);\n };\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n uploadImageHandler = async function (\n this: CallWithChatBackedChatAdapter,\n image: Blob,\n fileName: string\n ): Promise<UploadChatImageResult> {\n return await this.callWithChatAdapter.uploadImage(image, fileName);\n };\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n deleteImageHandler = async function (this: CallWithChatBackedChatAdapter, imageId: string): Promise<void> {\n return await this.callWithChatAdapter.deleteImage(imageId);\n };\n public sendMessage = this.sendMessageHandler.bind(this);\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n public uploadImage = this.uploadImageHandler.bind(this);\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n public deleteImage = this.deleteImageHandler.bind(this);\n public sendReadReceipt = async (chatMessageId: string): Promise<void> =>\n await this.callWithChatAdapter.sendReadReceipt(chatMessageId);\n public sendTypingIndicator = async (): Promise<void> => await this.callWithChatAdapter.sendTypingIndicator();\n public removeParticipant = async (userId: string): Promise<void> =>\n await this.callWithChatAdapter.removeParticipant(userId);\n public loadPreviousChatMessages = async (messagesToLoad: number): Promise<boolean> =>\n await this.callWithChatAdapter.loadPreviousChatMessages(messagesToLoad);\n public dispose = (): void => this.callWithChatAdapter.dispose();\n\n public onStateChange = (handler: (state: ChatAdapterState) => void): void => {\n const convertedHandler = (state: CallWithChatAdapterState): void => {\n !!state.chat && handler(chatAdapterStateFromCallWithChatAdapterState(state));\n };\n this.callWithChatAdapter.onStateChange(convertedHandler);\n this.eventStore.set(handler, convertedHandler);\n };\n public offStateChange = (handler: (state: ChatAdapterState) => void): void => {\n const convertedHandler = this.eventStore.get(handler);\n convertedHandler && this.callWithChatAdapter.offStateChange(convertedHandler);\n };\n public getState = (): ChatAdapterState =>\n chatAdapterStateFromCallWithChatAdapterState(this.callWithChatAdapter.getState());\n\n /* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n public on = (event: any, listener: any): void => {\n switch (event) {\n case 'error':\n return this.callWithChatAdapter.on('chatError', listener);\n case 'participantsAdded':\n return this.callWithChatAdapter.on('chatParticipantsAdded', listener);\n case 'participantsRemoved':\n return this.callWithChatAdapter.on('chatParticipantsRemoved', listener);\n default:\n return this.callWithChatAdapter.on(event, listener);\n }\n };\n public off = (event: any, listener: any): void => {\n switch (event) {\n case 'error':\n return this.callWithChatAdapter.off('chatError', listener);\n case 'participantsAdded':\n return this.callWithChatAdapter.off('chatParticipantsAdded', listener);\n case 'participantsRemoved':\n return this.callWithChatAdapter.off('chatParticipantsRemoved', listener);\n default:\n return this.callWithChatAdapter.off(event, listener);\n }\n };\n\n // due to a bug in babel, we can't use arrow function here\n // affecting conditional-compile-remove(attachment-upload)\n // have to bind this since the scope of 'this' is lost when the function is passed as a callback\n updateMessageHandler = async function (\n this: CallWithChatBackedChatAdapter,\n messageId: string,\n content: string,\n options?: Record<string, string> | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions\n ): Promise<void> {\n await this.callWithChatAdapter.updateMessage(messageId, content, options);\n };\n\n public updateMessage = this.updateMessageHandler.bind(this);\n public deleteMessage = async (messageId: string): Promise<void> =>\n await this.callWithChatAdapter.deleteMessage(messageId);\n\n public clearErrors = (errorTypes: (keyof ErrorBarStrings)[]): void => {\n throw new Error(`Method not supported in CallWithChatComposite.`);\n };\n\n public setTopic = async (topicName: string): Promise<void> => {\n throw new Error(`Chat Topics are not supported in CallWithChatComposite.`);\n };\n\n public async downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void> {\n this.callWithChatAdapter.downloadResourceToCache(resourceDetails);\n }\n public removeResourceFromCache(resourceDetails: ResourceDetails): void {\n this.callWithChatAdapter.removeResourceFromCache(resourceDetails);\n }\n}\n\nfunction chatAdapterStateFromCallWithChatAdapterState(\n callWithChatAdapterState: CallWithChatAdapterState\n): ChatAdapterState {\n if (!callWithChatAdapterState.chat) {\n // Return some empty state if chat is not initialized yet\n return {\n userId: callWithChatAdapterState.userId,\n displayName: callWithChatAdapterState.displayName || '',\n thread: {\n chatMessages: {},\n participants: {\n [toFlatCommunicationIdentifier(callWithChatAdapterState.userId)]: {\n id: callWithChatAdapterState.userId\n }\n },\n threadId: '',\n readReceipts: [],\n typingIndicators: [],\n latestReadTime: new Date()\n },\n latestErrors: callWithChatAdapterState.latestChatErrors\n };\n }\n\n return {\n userId: callWithChatAdapterState.userId,\n displayName: callWithChatAdapterState.displayName || '',\n thread: callWithChatAdapterState.chat,\n latestErrors: callWithChatAdapterState.latestChatErrors\n };\n}\n"]}
|
1
|
+
{"version":3,"file":"CallWithChatBackedChatAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AASlC,OAAO,EAAE,6BAA6B,EAAE,yCAAgC;AAIxE,uDAAuD;AACvD,sDAAsD;AAEtD;;;;GAIG;AACH,MAAM,OAAO,6BAA6B;IAOxC,YAAY,mBAAwC;QAJpD,gJAAgJ;QAChJ,iJAAiJ;QACzI,eAAU,GAAsF,IAAI,GAAG,EAAE,CAAC;QAM3G,qBAAgB,GAAG,GAAwB,EAAE,gDAAC,OAAA,MAAM,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,EAAE,CAAA,GAAA,CAAC;QACvG,0DAA0D;QAC1D,0DAA0D;QAC1D,gGAAgG;QAChG,uBAAkB,GAAG,UAEnB,OAAe;QACf,mDAAmD;QACnD,OAAwB;;gBAExB,MAAM,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,OAAO,EAAE,mDAAmD,CAAC,OAAO,CAAC,CAAC;YACnH,CAAC;SAAA,CAAC;QACF,gEAAgE;QAChE,uBAAkB,GAAG,UAEnB,KAAW,EACX,QAAgB;;gBAEhB,OAAO,MAAM,IAAI,CAAC,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AAC,eAAe,CAAC,CAAC;QACpE,CAAC;KAAA;IACM,uBAAuB,CAAC,eAAgC;QAC7D,IAAI,CAAC,mBAAmB,CAAC,uBAAuB,CAAC,eAAe,CAAC,CAAC;IACpE,CAAC;CACF;AAED,SAAS,4CAA4C,CACnD,wBAAkD;IAElD,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,CAAC;QACnC,yDAAyD;QACzD,OAAO;YACL,MAAM,EAAE,wBAAwB,CAAC,MAAM;YACvC,WAAW,EAAE,wBAAwB,CAAC,WAAW,IAAI,EAAE;YACvD,MAAM,EAAE;gBACN,YAAY,EAAE,EAAE;gBAChB,YAAY,EAAE;oBACZ,CAAC,6BAA6B,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,EAAE;wBAChE,EAAE,EAAE,wBAAwB,CAAC,MAAM;qBACpC;iBACF;gBACD,QAAQ,EAAE,EAAE;gBACZ,YAAY,EAAE,EAAE;gBAChB,gBAAgB,EAAE,EAAE;gBACpB,cAAc,EAAE,IAAI,IAAI,EAAE;aAC3B;YACD,YAAY,EAAE,wBAAwB,CAAC,gBAAgB;SACxD,CAAC;IACJ,CAAC;IAED,OAAO;QACL,MAAM,EAAE,wBAAwB,CAAC,MAAM;QACvC,WAAW,EAAE,wBAAwB,CAAC,WAAW,IAAI,EAAE;QACvD,MAAM,EAAE,wBAAwB,CAAC,IAAI;QACrC,YAAY,EAAE,wBAAwB,CAAC,gBAAgB;KACxD,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CallWithChatAdapter } from './CallWithChatAdapter';\nimport { ChatAdapter, ChatAdapterState } from '../../ChatComposite';\nimport { ResourceDetails } from '../../ChatComposite';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\nimport { ErrorBarStrings } from '@internal/react-components';\nimport { CallWithChatAdapterState } from '../state/CallWithChatAdapterState';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { UploadChatImageResult } from '@internal/acs-ui-common';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/**\n * Facade around the CallWithChatAdapter to satisfy the chat adapter interface.\n *\n * @private\n */\nexport class CallWithChatBackedChatAdapter implements ChatAdapter {\n private callWithChatAdapter: CallWithChatAdapter;\n\n // For onStateChange we must convert CallWithChat state to chat state. This involves creating a new handler to be passed into the onStateChange.\n // In order to unsubscribe the handler when offStateChange is called we must have a mapping of the original handler to the newly created handler.\n private eventStore: Map<(state: ChatAdapterState) => void, (state: CallWithChatAdapterState) => void> = new Map();\n\n constructor(callWithChatAdapter: CallWithChatAdapter) {\n this.callWithChatAdapter = callWithChatAdapter;\n }\n\n public fetchInitialData = async (): Promise<void> => await this.callWithChatAdapter.fetchInitialData();\n // due to a bug in babel, we can't use arrow function here\n // affecting conditional-compile-remove(attachment-upload)\n // have to bind this since the scope of 'this' is lost when the function is passed as a callback\n sendMessageHandler = async function (\n this: CallWithChatBackedChatAdapter,\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n options?: MessageOptions\n ): Promise<void> {\n await this.callWithChatAdapter.sendMessage(content, /* @conditional-compile-remove(file-sharing-acs) */ options);\n };\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n uploadImageHandler = async function (\n this: CallWithChatBackedChatAdapter,\n image: Blob,\n fileName: string\n ): Promise<UploadChatImageResult> {\n return await this.callWithChatAdapter.uploadImage(image, fileName);\n };\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n deleteImageHandler = async function (this: CallWithChatBackedChatAdapter, imageId: string): Promise<void> {\n return await this.callWithChatAdapter.deleteImage(imageId);\n };\n public sendMessage = this.sendMessageHandler.bind(this);\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n public uploadImage = this.uploadImageHandler.bind(this);\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n public deleteImage = this.deleteImageHandler.bind(this);\n public sendReadReceipt = async (chatMessageId: string): Promise<void> =>\n await this.callWithChatAdapter.sendReadReceipt(chatMessageId);\n public sendTypingIndicator = async (): Promise<void> => await this.callWithChatAdapter.sendTypingIndicator();\n public removeParticipant = async (userId: string): Promise<void> =>\n await this.callWithChatAdapter.removeParticipant(userId);\n public loadPreviousChatMessages = async (messagesToLoad: number): Promise<boolean> =>\n await this.callWithChatAdapter.loadPreviousChatMessages(messagesToLoad);\n public dispose = (): void => this.callWithChatAdapter.dispose();\n\n public onStateChange = (handler: (state: ChatAdapterState) => void): void => {\n const convertedHandler = (state: CallWithChatAdapterState): void => {\n if (state.chat) {\n handler(chatAdapterStateFromCallWithChatAdapterState(state));\n }\n };\n this.callWithChatAdapter.onStateChange(convertedHandler);\n this.eventStore.set(handler, convertedHandler);\n };\n public offStateChange = (handler: (state: ChatAdapterState) => void): void => {\n const convertedHandler = this.eventStore.get(handler);\n if (convertedHandler) {\n this.callWithChatAdapter.offStateChange(convertedHandler);\n }\n };\n public getState = (): ChatAdapterState =>\n chatAdapterStateFromCallWithChatAdapterState(this.callWithChatAdapter.getState());\n\n /* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n public on = (event: any, listener: any): void => {\n switch (event) {\n case 'error':\n return this.callWithChatAdapter.on('chatError', listener);\n case 'participantsAdded':\n return this.callWithChatAdapter.on('chatParticipantsAdded', listener);\n case 'participantsRemoved':\n return this.callWithChatAdapter.on('chatParticipantsRemoved', listener);\n default:\n return this.callWithChatAdapter.on(event, listener);\n }\n };\n public off = (event: any, listener: any): void => {\n switch (event) {\n case 'error':\n return this.callWithChatAdapter.off('chatError', listener);\n case 'participantsAdded':\n return this.callWithChatAdapter.off('chatParticipantsAdded', listener);\n case 'participantsRemoved':\n return this.callWithChatAdapter.off('chatParticipantsRemoved', listener);\n default:\n return this.callWithChatAdapter.off(event, listener);\n }\n };\n\n // due to a bug in babel, we can't use arrow function here\n // affecting conditional-compile-remove(attachment-upload)\n // have to bind this since the scope of 'this' is lost when the function is passed as a callback\n updateMessageHandler = async function (\n this: CallWithChatBackedChatAdapter,\n messageId: string,\n content: string,\n options?: Record<string, string> | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions\n ): Promise<void> {\n await this.callWithChatAdapter.updateMessage(messageId, content, options);\n };\n\n public updateMessage = this.updateMessageHandler.bind(this);\n public deleteMessage = async (messageId: string): Promise<void> =>\n await this.callWithChatAdapter.deleteMessage(messageId);\n\n public clearErrors = (errorTypes: (keyof ErrorBarStrings)[]): void => {\n throw new Error(`Method not supported in CallWithChatComposite.`);\n };\n\n public setTopic = async (topicName: string): Promise<void> => {\n throw new Error(`Chat Topics are not supported in CallWithChatComposite.`);\n };\n\n public async downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void> {\n this.callWithChatAdapter.downloadResourceToCache(resourceDetails);\n }\n public removeResourceFromCache(resourceDetails: ResourceDetails): void {\n this.callWithChatAdapter.removeResourceFromCache(resourceDetails);\n }\n}\n\nfunction chatAdapterStateFromCallWithChatAdapterState(\n callWithChatAdapterState: CallWithChatAdapterState\n): ChatAdapterState {\n if (!callWithChatAdapterState.chat) {\n // Return some empty state if chat is not initialized yet\n return {\n userId: callWithChatAdapterState.userId,\n displayName: callWithChatAdapterState.displayName || '',\n thread: {\n chatMessages: {},\n participants: {\n [toFlatCommunicationIdentifier(callWithChatAdapterState.userId)]: {\n id: callWithChatAdapterState.userId\n }\n },\n threadId: '',\n readReceipts: [],\n typingIndicators: [],\n latestReadTime: new Date()\n },\n latestErrors: callWithChatAdapterState.latestChatErrors\n };\n }\n\n return {\n userId: callWithChatAdapterState.userId,\n displayName: callWithChatAdapterState.displayName || '',\n thread: callWithChatAdapterState.chat,\n latestErrors: callWithChatAdapterState.latestChatErrors\n };\n}\n"]}
|
package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js
CHANGED
@@ -235,7 +235,9 @@ const deleteInlineImageFromServer = (imageId, adapter) => {
|
|
235
235
|
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
236
236
|
// This function is used to delete the inline image that existed before editing starts
|
237
237
|
const deleteExistingInlineImageForEditBox = (imageId, messageId, adapter) => {
|
238
|
-
messageId !== SEND_BOX_UPLOADS_KEY_VALUE
|
238
|
+
if (messageId !== SEND_BOX_UPLOADS_KEY_VALUE) {
|
239
|
+
deleteInlineImageFromServer(imageId, adapter);
|
240
|
+
}
|
239
241
|
};
|
240
242
|
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
241
243
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ImageUploadUtils.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,gEAAgE;AAChE,OAAO,EAAgC,2CAA2C,EAAE,yCAAgC;AACpH,gEAAgE;AAChE,OAAO,EAAoB,0BAA0B,EAAwB,MAAM,kCAAkC,CAAC;AACtH,gEAAgE;AAChE,OAAO,EAAE,+BAA+B,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAOrG,gEAAgE;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,gEAAgE;AAChE,MAAM,+BAA+B,GAAG,EAAE,CAAC;AAE3C,gEAAgE;AAChE,MAAM,aAAa,GAAG,CACpB,QAAgC,EAChC,OAAkF,EAC/D,EAAE;IACrB,gCAAgC;IAChC,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAErD,MAAM,EAAE,GAAG,UAAU,CAAC,GAAG,EAAE;QACzB,eAAe,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC,EAAE,OAAO,CAAC,CAAC;IAEZ,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,QAAQ,kCAChC,OAAO,KACV,MAAM,EAAE,eAAe,CAAC,MAAM,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AC,MAAM,8BAA8B,GAAG,CAAC,eAAuC,EAAU,EAAE;IAChG,MAAM,QAAQ,GAAG,eAAe,CAAC,2CAA2C,CAAC,CAAC;IAC9E,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,EAAE,IAAI,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QACpF,OAAO,+BAA+B,CAAC;IACzC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { AttachmentMetadataInProgress, _IMAGE_ATTRIBUTE_INLINE_IMAGE_FILE_NAME_KEY } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { AttachmentUpload, AttachmentUploadActionType, AttachmentUploadTask } from '../file-sharing/AttachmentUpload';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { _DEFAULT_INLINE_IMAGE_FILE_NAME, SEND_BOX_UPLOADS_KEY_VALUE } from '../../common/constants';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { ChatAdapter } from '../adapter/ChatAdapter';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { Dispatch } from 'react';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { ImageActions } from './ImageUploadReducer';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { nanoid } from 'nanoid';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { ChatCompositeStrings } from '../Strings';\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nconst MAX_INLINE_IMAGE_UPLOAD_SIZE_MB = 20;\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nconst fetchBlobData = async (\n resource: string | URL | Request,\n options: { timeout?: number; headers?: Headers; abortController: AbortController }\n): Promise<Response> => {\n // default timeout is 30 seconds\n const { timeout = 30000, abortController } = options;\n\n const id = setTimeout(() => {\n abortController.abort();\n }, timeout);\n\n const response = await fetch(resource, {\n ...options,\n signal: abortController.signal\n });\n clearTimeout(id);\n return response;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @private\n */\nexport const getInlineImageData = async (image: string): Promise<Blob | undefined> => {\n if (image.startsWith('blob') || image.startsWith('http')) {\n try {\n const res = await fetchBlobData(image, { abortController: new AbortController() });\n const blobImage = await res.blob();\n return blobImage;\n } catch (error) {\n console.error('Error fetching image data', error);\n return;\n }\n }\n return;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getEditBoxMessagesInlineImages = (\n editBoxInlineImageUploads: Record<string, AttachmentUpload[]> | undefined\n): Record<string, AttachmentMetadataInProgress[]> | undefined => {\n if (!editBoxInlineImageUploads) {\n return;\n }\n\n const messagesInlineImagesWithProgress: Record<string, AttachmentMetadataInProgress[]> = {};\n Object.entries(editBoxInlineImageUploads || {}).map(([messageId, attachmentUploads]) => {\n const messageUploads = attachmentUploads.map((upload) => {\n return upload.metadata;\n });\n messagesInlineImagesWithProgress[messageId] = messageUploads;\n });\n return messagesInlineImagesWithProgress;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getSendBoxInlineImages = (\n sendBoxInlineImageUploads: Record<string, AttachmentUpload[]> | undefined\n): AttachmentMetadataInProgress[] | undefined => {\n if (!sendBoxInlineImageUploads) {\n return;\n }\n return sendBoxInlineImageUploads[SEND_BOX_UPLOADS_KEY_VALUE]?.map((upload) => upload.metadata);\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nconst inlineImageUploadHandler = async (\n uploadTasks: AttachmentUpload[],\n adapter: ChatAdapter,\n strings: ChatCompositeStrings\n): Promise<void> => {\n for (const task of uploadTasks) {\n const uploadTask = task as AttachmentUploadTask;\n const image: Blob | undefined = uploadTask.image;\n if (!image) {\n uploadTask.notifyUploadFailed(strings.uploadImageDataNotProvided);\n continue;\n }\n if (image && image.size > MAX_INLINE_IMAGE_UPLOAD_SIZE_MB * 1024 * 1024) {\n uploadTask.notifyUploadFailed(\n strings.uploadImageIsTooLarge.replace('{maxImageSize}', `${MAX_INLINE_IMAGE_UPLOAD_SIZE_MB}`)\n );\n continue;\n }\n\n const SUPPORTED_FILES: Array<string> = ['jpg', 'jpeg', 'png', 'gif', 'heic', 'webp'];\n const imageExtension = task.metadata?.name.split('.').pop() ?? '';\n if (!SUPPORTED_FILES.includes(imageExtension)) {\n uploadTask.notifyUploadFailed(\n strings.uploadImageExtensionIsNotAllowed.replace('{imageExtension}', imageExtension)\n );\n continue;\n }\n\n try {\n const response = await adapter.uploadImage(image, task.metadata?.name);\n // Use response id as the image src because we need to keep the original image id as a reference to find the image.\n // Also the html content we send to ChatSDK does not need image src,\n // it only need the response id to match the uploaded image, url is not needed.\n uploadTask.notifyUploadCompleted(task.metadata.id, response.id);\n } catch (error) {\n console.error(error);\n uploadTask.notifyUploadFailed(strings.uploadImageFailed);\n }\n }\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nconst generateUploadTask = async (\n imageAttributes: Record<string, string>,\n fileName: string,\n messageId: string,\n inlineImageUploadActionHandler: Dispatch<ImageActions>\n): Promise<AttachmentUpload | undefined> => {\n if (!imageAttributes.src) {\n console.error('Cannot upload image - Image src is not provided');\n return;\n }\n if (!imageAttributes.id) {\n console.error('Cannot upload image - Image id is not provided');\n return;\n }\n const imageData = await getInlineImageData(imageAttributes.src);\n if (!imageData) {\n return;\n }\n const taskId = nanoid();\n const uploadTask: AttachmentUpload = {\n image: imageData,\n taskId,\n metadata: {\n id: imageAttributes.id,\n name: fileName,\n url: imageAttributes.src,\n progress: 0\n },\n notifyUploadProgressChanged: (value: number) => {\n inlineImageUploadActionHandler({\n type: AttachmentUploadActionType.Progress,\n taskId,\n progress: value,\n messageId\n });\n },\n notifyUploadCompleted: (id: string, url: string) => {\n inlineImageUploadActionHandler({\n type: AttachmentUploadActionType.Completed,\n taskId,\n id,\n url,\n messageId\n });\n },\n notifyUploadFailed: (message: string) => {\n inlineImageUploadActionHandler({ type: AttachmentUploadActionType.Failed, taskId, message, messageId });\n // remove the failed upload task when error banner is auto dismissed after 10 seconds\n // so the banner won't be shown again on UI re-rendering.\n setTimeout(() => {\n inlineImageUploadActionHandler({ type: AttachmentUploadActionType.Remove, id: taskId, messageId });\n }, 10 * 1000);\n }\n };\n return uploadTask;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const onInsertInlineImageForEditBox = async (\n imageAttributes: Record<string, string>,\n fileName: string,\n messageId: string,\n adapter: ChatAdapter,\n handleEditBoxInlineImageUploadAction: Dispatch<ImageActions>,\n chatCompositeStrings: ChatCompositeStrings\n): Promise<void> => {\n const uploadTask: AttachmentUpload | undefined = await generateUploadTask(\n imageAttributes,\n fileName,\n messageId,\n handleEditBoxInlineImageUploadAction\n );\n if (!uploadTask) {\n return;\n }\n\n handleEditBoxInlineImageUploadAction({\n type: AttachmentUploadActionType.Set,\n newUploads: [uploadTask],\n messageId\n });\n inlineImageUploadHandler([uploadTask], adapter, chatCompositeStrings);\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const onInsertInlineImageForSendBox = async (\n imageAttributes: Record<string, string>,\n fileName: string,\n adapter: ChatAdapter,\n handleSendBoxInlineImageUploadAction: Dispatch<ImageActions>,\n chatCompositeStrings: ChatCompositeStrings\n): Promise<void> => {\n const uploadTask: AttachmentUpload | undefined = await generateUploadTask(\n imageAttributes,\n fileName,\n SEND_BOX_UPLOADS_KEY_VALUE,\n handleSendBoxInlineImageUploadAction\n );\n\n if (!uploadTask) {\n return;\n }\n\n handleSendBoxInlineImageUploadAction({\n type: AttachmentUploadActionType.Set,\n newUploads: [uploadTask],\n messageId: SEND_BOX_UPLOADS_KEY_VALUE\n });\n inlineImageUploadHandler([uploadTask], adapter, chatCompositeStrings);\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const cancelInlineImageUpload = (\n imageAttributes: Record<string, string>,\n imageUploads: Record<string, AttachmentUpload[]> | undefined,\n messageId: string,\n inlineImageUploadActionHandler: Dispatch<ImageActions>,\n adapter: ChatAdapter\n): void => {\n if (!imageAttributes.id) {\n console.error('Cannot cancel image upload - Image id is not provided');\n return;\n }\n\n if (!imageUploads || !imageUploads[messageId]) {\n deleteExistingInlineImageForEditBox(imageAttributes.id, messageId, adapter);\n return;\n }\n const imageUpload = imageUploads[messageId]?.find((upload) => upload.metadata.id === imageAttributes.id);\n\n if (!imageUpload || !imageUpload?.metadata.id) {\n deleteExistingInlineImageForEditBox(imageAttributes.id, messageId, adapter);\n return;\n }\n\n inlineImageUploadActionHandler({\n type: AttachmentUploadActionType.Remove,\n id: imageUpload?.metadata.id,\n messageId\n });\n\n if (imageUpload?.metadata.progress === 1 && imageUpload?.metadata.url) {\n // The image id that we got back from the ChatSDK response is stored in the image src attribute,\n // while the metadata id is the internal image id that we assigned to the image when it was pasted in.\n deleteInlineImageFromServer(imageUpload?.metadata.url, adapter);\n }\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nconst deleteInlineImageFromServer = (imageId: string, adapter: ChatAdapter): void => {\n try {\n adapter.deleteImage(imageId);\n } catch (error) {\n console.error(error);\n }\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n// This function is used to delete the inline image that existed before editing starts\nconst deleteExistingInlineImageForEditBox = (imageId: string, messageId: string, adapter: ChatAdapter): void => {\n messageId !== SEND_BOX_UPLOADS_KEY_VALUE && deleteInlineImageFromServer(imageId, adapter);\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const updateContentStringWithUploadedInlineImages = (\n content: string,\n imageUploads: Record<string, AttachmentUpload[]> | undefined,\n messageId: string = SEND_BOX_UPLOADS_KEY_VALUE\n): string => {\n if (!imageUploads || !imageUploads[messageId]) {\n return content;\n }\n const messageUploads = imageUploads[messageId];\n const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n document.querySelectorAll('img').forEach((img) => {\n const uploadInlineImage = messageUploads?.find(\n (upload) => !upload.metadata.error && upload.metadata.progress === 1 && upload.metadata.id === img.id\n );\n\n if (uploadInlineImage) {\n // ChatSDK uses the respond id provided by the upload response. We store the response id in the image src attribute previously.\n img.id = uploadInlineImage.metadata.url ?? img.id;\n img.src = '';\n }\n });\n content = document.body.innerHTML;\n\n return content;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getImageFileNameFromAttributes = (imageAttributes: Record<string, string>): string => {\n const fileName = imageAttributes[_IMAGE_ATTRIBUTE_INLINE_IMAGE_FILE_NAME_KEY];\n if (!fileName || fileName === '' || fileName === 'undefined' || fileName === 'null') {\n return _DEFAULT_INLINE_IMAGE_FILE_NAME;\n }\n return fileName;\n};\n"]}
|
1
|
+
{"version":3,"file":"ImageUploadUtils.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,gEAAgE;AAChE,OAAO,EAAgC,2CAA2C,EAAE,yCAAgC;AACpH,gEAAgE;AAChE,OAAO,EAAoB,0BAA0B,EAAwB,MAAM,kCAAkC,CAAC;AACtH,gEAAgE;AAChE,OAAO,EAAE,+BAA+B,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAOrG,gEAAgE;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,gEAAgE;AAChE,MAAM,+BAA+B,GAAG,EAAE,CAAC;AAE3C,gEAAgE;AAChE,MAAM,aAAa,GAAG,CACpB,QAAgC,EAChC,OAAkF,EAC/D,EAAE;IACrB,gCAAgC;IAChC,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,eAAe,EAAE,GAAG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QAAQ,CAAC,GAAG,mCAAI,GAAG,CAAC,EAAE,CAAC;YAClD,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC;QACf,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;IAElC,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,gEAAgE;AAChE;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,eAAuC,EAAU,EAAE;IAChG,MAAM,QAAQ,GAAG,eAAe,CAAC,2CAA2C,CAAC,CAAC;IAC9E,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,EAAE,IAAI,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QACpF,OAAO,+BAA+B,CAAC;IACzC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { AttachmentMetadataInProgress, _IMAGE_ATTRIBUTE_INLINE_IMAGE_FILE_NAME_KEY } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { AttachmentUpload, AttachmentUploadActionType, AttachmentUploadTask } from '../file-sharing/AttachmentUpload';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { _DEFAULT_INLINE_IMAGE_FILE_NAME, SEND_BOX_UPLOADS_KEY_VALUE } from '../../common/constants';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { ChatAdapter } from '../adapter/ChatAdapter';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { Dispatch } from 'react';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { ImageActions } from './ImageUploadReducer';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { nanoid } from 'nanoid';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { ChatCompositeStrings } from '../Strings';\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nconst MAX_INLINE_IMAGE_UPLOAD_SIZE_MB = 20;\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nconst fetchBlobData = async (\n resource: string | URL | Request,\n options: { timeout?: number; headers?: Headers; abortController: AbortController }\n): Promise<Response> => {\n // default timeout is 30 seconds\n const { timeout = 30000, abortController } = options;\n\n const id = setTimeout(() => {\n abortController.abort();\n }, timeout);\n\n const response = await fetch(resource, {\n ...options,\n signal: abortController.signal\n });\n clearTimeout(id);\n return response;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @private\n */\nexport const getInlineImageData = async (image: string): Promise<Blob | undefined> => {\n if (image.startsWith('blob') || image.startsWith('http')) {\n try {\n const res = await fetchBlobData(image, { abortController: new AbortController() });\n const blobImage = await res.blob();\n return blobImage;\n } catch (error) {\n console.error('Error fetching image data', error);\n return;\n }\n }\n return;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getEditBoxMessagesInlineImages = (\n editBoxInlineImageUploads: Record<string, AttachmentUpload[]> | undefined\n): Record<string, AttachmentMetadataInProgress[]> | undefined => {\n if (!editBoxInlineImageUploads) {\n return;\n }\n\n const messagesInlineImagesWithProgress: Record<string, AttachmentMetadataInProgress[]> = {};\n Object.entries(editBoxInlineImageUploads || {}).map(([messageId, attachmentUploads]) => {\n const messageUploads = attachmentUploads.map((upload) => {\n return upload.metadata;\n });\n messagesInlineImagesWithProgress[messageId] = messageUploads;\n });\n return messagesInlineImagesWithProgress;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getSendBoxInlineImages = (\n sendBoxInlineImageUploads: Record<string, AttachmentUpload[]> | undefined\n): AttachmentMetadataInProgress[] | undefined => {\n if (!sendBoxInlineImageUploads) {\n return;\n }\n return sendBoxInlineImageUploads[SEND_BOX_UPLOADS_KEY_VALUE]?.map((upload) => upload.metadata);\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nconst inlineImageUploadHandler = async (\n uploadTasks: AttachmentUpload[],\n adapter: ChatAdapter,\n strings: ChatCompositeStrings\n): Promise<void> => {\n for (const task of uploadTasks) {\n const uploadTask = task as AttachmentUploadTask;\n const image: Blob | undefined = uploadTask.image;\n if (!image) {\n uploadTask.notifyUploadFailed(strings.uploadImageDataNotProvided);\n continue;\n }\n if (image && image.size > MAX_INLINE_IMAGE_UPLOAD_SIZE_MB * 1024 * 1024) {\n uploadTask.notifyUploadFailed(\n strings.uploadImageIsTooLarge.replace('{maxImageSize}', `${MAX_INLINE_IMAGE_UPLOAD_SIZE_MB}`)\n );\n continue;\n }\n\n const SUPPORTED_FILES: Array<string> = ['jpg', 'jpeg', 'png', 'gif', 'heic', 'webp'];\n const imageExtension = task.metadata?.name.split('.').pop() ?? '';\n if (!SUPPORTED_FILES.includes(imageExtension)) {\n uploadTask.notifyUploadFailed(\n strings.uploadImageExtensionIsNotAllowed.replace('{imageExtension}', imageExtension)\n );\n continue;\n }\n\n try {\n const response = await adapter.uploadImage(image, task.metadata?.name);\n // Use response id as the image src because we need to keep the original image id as a reference to find the image.\n // Also the html content we send to ChatSDK does not need image src,\n // it only need the response id to match the uploaded image, url is not needed.\n uploadTask.notifyUploadCompleted(task.metadata.id, response.id);\n } catch (error) {\n console.error(error);\n uploadTask.notifyUploadFailed(strings.uploadImageFailed);\n }\n }\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nconst generateUploadTask = async (\n imageAttributes: Record<string, string>,\n fileName: string,\n messageId: string,\n inlineImageUploadActionHandler: Dispatch<ImageActions>\n): Promise<AttachmentUpload | undefined> => {\n if (!imageAttributes.src) {\n console.error('Cannot upload image - Image src is not provided');\n return;\n }\n if (!imageAttributes.id) {\n console.error('Cannot upload image - Image id is not provided');\n return;\n }\n const imageData = await getInlineImageData(imageAttributes.src);\n if (!imageData) {\n return;\n }\n const taskId = nanoid();\n const uploadTask: AttachmentUpload = {\n image: imageData,\n taskId,\n metadata: {\n id: imageAttributes.id,\n name: fileName,\n url: imageAttributes.src,\n progress: 0\n },\n notifyUploadProgressChanged: (value: number) => {\n inlineImageUploadActionHandler({\n type: AttachmentUploadActionType.Progress,\n taskId,\n progress: value,\n messageId\n });\n },\n notifyUploadCompleted: (id: string, url: string) => {\n inlineImageUploadActionHandler({\n type: AttachmentUploadActionType.Completed,\n taskId,\n id,\n url,\n messageId\n });\n },\n notifyUploadFailed: (message: string) => {\n inlineImageUploadActionHandler({ type: AttachmentUploadActionType.Failed, taskId, message, messageId });\n // remove the failed upload task when error banner is auto dismissed after 10 seconds\n // so the banner won't be shown again on UI re-rendering.\n setTimeout(() => {\n inlineImageUploadActionHandler({ type: AttachmentUploadActionType.Remove, id: taskId, messageId });\n }, 10 * 1000);\n }\n };\n return uploadTask;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const onInsertInlineImageForEditBox = async (\n imageAttributes: Record<string, string>,\n fileName: string,\n messageId: string,\n adapter: ChatAdapter,\n handleEditBoxInlineImageUploadAction: Dispatch<ImageActions>,\n chatCompositeStrings: ChatCompositeStrings\n): Promise<void> => {\n const uploadTask: AttachmentUpload | undefined = await generateUploadTask(\n imageAttributes,\n fileName,\n messageId,\n handleEditBoxInlineImageUploadAction\n );\n if (!uploadTask) {\n return;\n }\n\n handleEditBoxInlineImageUploadAction({\n type: AttachmentUploadActionType.Set,\n newUploads: [uploadTask],\n messageId\n });\n inlineImageUploadHandler([uploadTask], adapter, chatCompositeStrings);\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const onInsertInlineImageForSendBox = async (\n imageAttributes: Record<string, string>,\n fileName: string,\n adapter: ChatAdapter,\n handleSendBoxInlineImageUploadAction: Dispatch<ImageActions>,\n chatCompositeStrings: ChatCompositeStrings\n): Promise<void> => {\n const uploadTask: AttachmentUpload | undefined = await generateUploadTask(\n imageAttributes,\n fileName,\n SEND_BOX_UPLOADS_KEY_VALUE,\n handleSendBoxInlineImageUploadAction\n );\n\n if (!uploadTask) {\n return;\n }\n\n handleSendBoxInlineImageUploadAction({\n type: AttachmentUploadActionType.Set,\n newUploads: [uploadTask],\n messageId: SEND_BOX_UPLOADS_KEY_VALUE\n });\n inlineImageUploadHandler([uploadTask], adapter, chatCompositeStrings);\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const cancelInlineImageUpload = (\n imageAttributes: Record<string, string>,\n imageUploads: Record<string, AttachmentUpload[]> | undefined,\n messageId: string,\n inlineImageUploadActionHandler: Dispatch<ImageActions>,\n adapter: ChatAdapter\n): void => {\n if (!imageAttributes.id) {\n console.error('Cannot cancel image upload - Image id is not provided');\n return;\n }\n\n if (!imageUploads || !imageUploads[messageId]) {\n deleteExistingInlineImageForEditBox(imageAttributes.id, messageId, adapter);\n return;\n }\n const imageUpload = imageUploads[messageId]?.find((upload) => upload.metadata.id === imageAttributes.id);\n\n if (!imageUpload || !imageUpload?.metadata.id) {\n deleteExistingInlineImageForEditBox(imageAttributes.id, messageId, adapter);\n return;\n }\n\n inlineImageUploadActionHandler({\n type: AttachmentUploadActionType.Remove,\n id: imageUpload?.metadata.id,\n messageId\n });\n\n if (imageUpload?.metadata.progress === 1 && imageUpload?.metadata.url) {\n // The image id that we got back from the ChatSDK response is stored in the image src attribute,\n // while the metadata id is the internal image id that we assigned to the image when it was pasted in.\n deleteInlineImageFromServer(imageUpload?.metadata.url, adapter);\n }\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nconst deleteInlineImageFromServer = (imageId: string, adapter: ChatAdapter): void => {\n try {\n adapter.deleteImage(imageId);\n } catch (error) {\n console.error(error);\n }\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n// This function is used to delete the inline image that existed before editing starts\nconst deleteExistingInlineImageForEditBox = (imageId: string, messageId: string, adapter: ChatAdapter): void => {\n if (messageId !== SEND_BOX_UPLOADS_KEY_VALUE) {\n deleteInlineImageFromServer(imageId, adapter);\n }\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const updateContentStringWithUploadedInlineImages = (\n content: string,\n imageUploads: Record<string, AttachmentUpload[]> | undefined,\n messageId: string = SEND_BOX_UPLOADS_KEY_VALUE\n): string => {\n if (!imageUploads || !imageUploads[messageId]) {\n return content;\n }\n const messageUploads = imageUploads[messageId];\n const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n document.querySelectorAll('img').forEach((img) => {\n const uploadInlineImage = messageUploads?.find(\n (upload) => !upload.metadata.error && upload.metadata.progress === 1 && upload.metadata.id === img.id\n );\n\n if (uploadInlineImage) {\n // ChatSDK uses the respond id provided by the upload response. We store the response id in the image src attribute previously.\n img.id = uploadInlineImage.metadata.url ?? img.id;\n img.src = '';\n }\n });\n content = document.body.innerHTML;\n\n return content;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getImageFileNameFromAttributes = (imageAttributes: Record<string, string>): string => {\n const fileName = imageAttributes[_IMAGE_ATTRIBUTE_INLINE_IMAGE_FILE_NAME_KEY];\n if (!fileName || fileName === '' || fileName === 'undefined' || fileName === 'null') {\n return _DEFAULT_INLINE_IMAGE_FILE_NAME;\n }\n return fileName;\n};\n"]}
|
@@ -48,7 +48,7 @@ export const AttachmentUploadButton = (props) => {
|
|
48
48
|
// To ensure that `onChange` is fired even if the same file is picked again.
|
49
49
|
e.currentTarget.value = '';
|
50
50
|
}, onChange: (e) => {
|
51
|
-
onChange
|
51
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e.currentTarget.files);
|
52
52
|
} })));
|
53
53
|
};
|
54
54
|
/* @conditional-compile-remove(file-sharing-acs) */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AttachmentUploadButton.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/ChatCompos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xB,SAAS,EAAE,+BAA+B,EAC1C,OAAO,EAAE,GAAG,EAAE;;gBACZ,MAAA,QAAQ,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAC;YAC5B,CAAC;YAED,oBAAC,WAAW,IAAC,OAAO,EAAE,sCAAsC,EAAE,gBAAa,gCAAgC;gBACzG,oBAAC,UAAU,IACT,SAAS,EAAE,mBAAmB,EAC9B,SAAS,EAAE,sCAAsC,EAAE,EACnD,SAAS,EAAE,KAAK;oBAEhB,oBAAC,+BAA+B,OAAG,CACxB,CACD,CACR;QACR,8CACc,0BAA0B,EACtC,GAAG,EAAE,QAAQ,EACb,SAAS,EAAE,KAAK,EAChB,MAAM,QACN,QAAQ,EAAE,CAAC,sBAAsB,EACjC,MAAM,EAAE,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,EACrC,IAAI,EAAC,MAAM,EACX,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gBACb,4EAA4E;gBAC5E,CAAC,CAAC,aAAa,CAAC,KAAK,GAAG,EAAE,CAAC;YAC7B,CAAC,EACD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;gBACd,QAAQ,
|
1
|
+
{"version":3,"file":"AttachmentUploadButton.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,mDAAmD;AACnD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACxF,mDAAmD;AACnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,mDAAmD;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,mDAAmD;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AA8B/C,mDAAmD;AACnD;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAA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EAAE,CAAC,sBAAsB,EACjC,MAAM,EAAE,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,EACrC,IAAI,EAAC,MAAM,EACX,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gBACb,4EAA4E;gBAC5E,CAAC,CAAC,aAAa,CAAC,KAAK,GAAG,EAAE,CAAC;YAC7B,CAAC,EACD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;gBACd,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YACpC,CAAC,GACD,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,mDAAmD;AACnD,MAAM,+BAA+B,GAAG,GAAgB,EAAE;IACxD,mDAAmD;IACnD,OAAO,oBAAC,iBAAiB,IAAC,QAAQ,EAAC,mBAAmB,GAAG,CAAC;IAC1D,+DAA+D;IAC/D,OAAO,oBAAC,iBAAiB,IAAC,QAAQ,EAAC,eAAe,GAAG,CAAC;AACxD,CAAC,CAAC;AAEF,mDAAmD;AACnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG;AAC3C,oDAAoD;AAEpD,KAAuG,EAC1F,EAAE;IACf,OAAO,CACL;IAEI,mDAAmD;IACnD,oBAAC,sBAAsB,oBAAK,KAAK,EAAI,CAEtC,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,mDAAmD;AACnD,MAAM,sCAAsC,GAAG,GAAW,EAAE;IAC1D,mDAAmD;IACnD,OAAO,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC;IACjD,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { IconButton, mergeStyles, Stack, TooltipHost, useTheme } from '@fluentui/react';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport React from 'react';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { ChatCompositeIcon } from '../../common/icons';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { useLocale } from '../../localization';\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * Props for {@link AttachmentUploadButton} component.\n * @internal\n */\nexport interface AttachmentUploadButtonProps {\n /**\n * A list of strings containing the comma separated list of supported media (aka. mime) types.\n * i.e. ['image/*', 'video/*', 'audio/*']\n * Default value is `['*']`, meaning all media types are supported.\n * Similar to the `accept` attribute of the `<input type=\"file\" />` element.\n */\n supportedMediaTypes?: string[];\n /**\n * Disable multiple files to be selected if set to `true`.\n * Default value is `false`, meaning multiple files can be selected.\n * Similar to the `multiple` attribute of the `<input type=\"file\" />` element.\n */\n disableMultipleUploads?: boolean;\n /**\n * onChange handler for the attachment upload button.\n * Similar to the `onChange` attribute of the `<input type=\"file\" />` element.\n * Called every time files are selected through the attachment upload button with a {@link FileList}\n * of selected files.\n */\n onChange?: (files: FileList | null) => void;\n}\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * @internal\n */\nexport const AttachmentUploadButton = (props: AttachmentUploadButtonProps): JSX.Element => {\n const inputRef = React.useRef<HTMLInputElement>(null);\n const theme = useTheme();\n // default supportedMediaTypes is ['*'], meaning all media types are supported.\n // default disableMultipleUploads is false, meaning multiple files can be selected.\n const { supportedMediaTypes = ['*'], disableMultipleUploads = false, onChange } = props;\n\n const attachmentUploadButtonClassName = mergeStyles({\n width: '1.5rem',\n height: '1.5rem',\n cursor: 'pointer',\n padding: '0.15rem',\n ':hover': {\n backgroundColor: theme.palette.neutralLighter\n }\n });\n\n const iconButtonClassName = mergeStyles({\n color: 'unset',\n width: '1.5rem',\n height: '1.5rem',\n ':hover': {\n color: 'unset',\n background: 'transparent'\n }\n });\n\n return (\n <>\n <Stack\n verticalAlign=\"center\"\n horizontalAlign=\"center\"\n className={attachmentUploadButtonClassName}\n onClick={() => {\n inputRef.current?.click();\n }}\n >\n <TooltipHost content={uploadAttachmentButtonStringTrampoline()} data-ui-id=\"chat-composite-message-tooltip\">\n <IconButton\n className={iconButtonClassName}\n ariaLabel={uploadAttachmentButtonStringTrampoline()}\n autoFocus={false}\n >\n <SendBoxAttachFileIconTrampoline />\n </IconButton>\n </TooltipHost>\n </Stack>\n <input\n data-testid=\"attachment-upload-button\"\n ref={inputRef}\n autoFocus={false}\n hidden\n multiple={!disableMultipleUploads}\n accept={supportedMediaTypes.join(',')}\n type=\"file\"\n onClick={(e) => {\n // To ensure that `onChange` is fired even if the same file is picked again.\n e.currentTarget.value = '';\n }}\n onChange={(e) => {\n onChange?.(e.currentTarget.files);\n }}\n />\n </>\n );\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\nconst SendBoxAttachFileIconTrampoline = (): JSX.Element => {\n /* @conditional-compile-remove(file-sharing-acs) */\n return <ChatCompositeIcon iconName=\"SendBoxAttachFile\" />;\n // Return _some_ available icon, as the real icon is beta-only.\n return <ChatCompositeIcon iconName=\"EditBoxCancel\" />;\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * A wrapper to return {@link AttachmentUploadButton} component conditionally.\n * It will return `<></>` for stable builds.\n * @internal\n */\nexport const AttachmentUploadButtonWrapper = (\n // To make conditional compilation not throw errors.\n\n props: Pick<AttachmentUploadButtonProps, 'supportedMediaTypes' | 'disableMultipleUploads' | 'onChange'>\n): JSX.Element => {\n return (\n <>\n {\n /* @conditional-compile-remove(file-sharing-acs) */\n <AttachmentUploadButton {...props} />\n }\n </>\n );\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\nconst uploadAttachmentButtonStringTrampoline = (): string => {\n /* @conditional-compile-remove(file-sharing-acs) */\n return useLocale().strings.chat.uploadAttachment;\n return '';\n};\n"]}
|
@@ -44,11 +44,15 @@ export const CaptionsBannerMoreButton = (props) => {
|
|
44
44
|
? localeStrings.strings.call.startCaptionsButtonTooltipOnContent
|
45
45
|
: localeStrings.strings.call.startCaptionsButtonTooltipOffContent,
|
46
46
|
onClick: () => {
|
47
|
-
startCaptionsButtonProps.checked
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
47
|
+
if (startCaptionsButtonProps.checked) {
|
48
|
+
stopCaptions();
|
49
|
+
}
|
50
|
+
else if (startCaptionsButtonProps.currentSpokenLanguage !== '') {
|
51
|
+
startCaptions();
|
52
|
+
}
|
53
|
+
else if (props.onCaptionsSettingsClick) {
|
54
|
+
props.onCaptionsSettingsClick();
|
55
|
+
}
|
52
56
|
},
|
53
57
|
iconProps: {
|
54
58
|
iconName: startCaptionsButtonProps.checked ? 'CaptionsOffIcon' : 'CaptionsIcon',
|
package/dist/dist-esm/react-composites/src/composites/common/CaptionsBannerMoreButton.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CaptionsBannerMoreButton.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/common/CaptionsBannerMoreButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,mBAAmB,EAAE,yCAAmC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AACzF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,sCAAgC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAOjE;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAAoC,EAAe,EAAE;IAC5F,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC;IAClC,MAAM,wBAAwB,GAAG,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAClE,MAAM,iBAAiB,GAAG,OAAO,CAC/B,GAAG,EAAE,CAAC,CAAC;QACL,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,oCAAoC;QACtE,iBAAiB,EAAE,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,+BAA+B;KAC9E,CAAC,EACF,CAAC,aAAa,CAAC,CAChB,CAAC;IAEF,MAAM,6BAA6B,GAA0B,EAAE,CAAC;IAEhE,MAAM,aAAa,GAAG,WAAW,CAAC,GAAS,EAAE;QAC3C,MAAM,wBAAwB,CAAC,eAAe,CAAC;YAC7C,cAAc,EAAE,wBAAwB,CAAC,qBAAqB;SAC/D,CAAC,CAAC;IACL,CAAC,CAAA,EAAE,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAE/B,MAAM,YAAY,GAAG,WAAW,CAAC,GAAS,EAAE;QAC1C,MAAM,wBAAwB,CAAC,cAAc,EAAE,CAAC;IAClD,CAAC,CAAA,EAAE,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAE/B,6BAA6B,CAAC,IAAI,CAAC;QACjC,GAAG,EAAE,mBAAmB;QACxB,IAAI,EAAE,wBAAwB,CAAC,OAAO;YACpC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,mCAAmC;YAChE,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,oCAAoC;QACnE,OAAO,EAAE,GAAG,EAAE;YACZ,wBAAwB,CAAC,OAAO
|
1
|
+
{"version":3,"file":"CaptionsBannerMoreButton.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/common/CaptionsBannerMoreButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,mBAAmB,EAAE,yCAAmC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,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B,SAAS,EAAE;YACT,KAAK,EAAE,6BAA6B;YACpC,YAAY,EAAE;gBACZ,qBAAqB,EAAE,sBAAsB;aAC9C;SACF,IACD,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { ControlBarButtonProps } from '@internal/react-components';\nimport { useCallback } from 'react';\nimport { IContextualMenuItem } from '@fluentui/react';\nimport { StartCaptionsButton } from '@internal/react-components';\nimport { useMemo } from 'react';\nimport { buttonFlyoutIncreasedSizeStyles } from '../CallComposite/styles/Buttons.styles';\nimport { useLocale } from '../localization';\nimport { MoreButton } from './MoreButton';\nimport { _preventDismissOnEvent } from '@internal/acs-ui-common';\nimport { usePropsFor } from '../CallComposite/hooks/usePropsFor';\n\n/** @private */\nexport interface CaptionsBannerMoreButtonProps extends ControlBarButtonProps {\n onCaptionsSettingsClick?: () => void;\n}\n\n/**\n *\n * @private\n */\nexport const CaptionsBannerMoreButton = (props: CaptionsBannerMoreButtonProps): JSX.Element => {\n const localeStrings = useLocale();\n const startCaptionsButtonProps = usePropsFor(StartCaptionsButton);\n const moreButtonStrings = useMemo(\n () => ({\n label: localeStrings.strings.call.captionsBannerMoreButtonCallingLabel,\n tooltipOffContent: localeStrings.strings.call.captionsBannerMoreButtonTooltip\n }),\n [localeStrings]\n );\n\n const moreButtonContextualMenuItems: IContextualMenuItem[] = [];\n\n const startCaptions = useCallback(async () => {\n await startCaptionsButtonProps.onStartCaptions({\n spokenLanguage: startCaptionsButtonProps.currentSpokenLanguage\n });\n }, [startCaptionsButtonProps]);\n\n const stopCaptions = useCallback(async () => {\n await startCaptionsButtonProps.onStopCaptions();\n }, [startCaptionsButtonProps]);\n\n moreButtonContextualMenuItems.push({\n key: 'ToggleCaptionsKey',\n text: startCaptionsButtonProps.checked\n ? localeStrings.strings.call.startCaptionsButtonTooltipOnContent\n : localeStrings.strings.call.startCaptionsButtonTooltipOffContent,\n onClick: () => {\n if (startCaptionsButtonProps.checked) {\n stopCaptions();\n } else if (startCaptionsButtonProps.currentSpokenLanguage !== '') {\n startCaptions();\n } else if (props.onCaptionsSettingsClick) {\n props.onCaptionsSettingsClick();\n }\n },\n iconProps: {\n iconName: startCaptionsButtonProps.checked ? 'CaptionsOffIcon' : 'CaptionsIcon',\n styles: { root: { lineHeight: 0 } }\n },\n itemProps: {\n styles: buttonFlyoutIncreasedSizeStyles\n }\n });\n\n if (props.onCaptionsSettingsClick) {\n moreButtonContextualMenuItems.push({\n key: 'openCaptionsSettingsKey',\n id: 'common-call-composite-captions-settings-button',\n text: localeStrings.strings.call.captionsSettingsLabel,\n onClick: props.onCaptionsSettingsClick,\n iconProps: {\n iconName: 'CaptionsSettingsIcon',\n styles: { root: { lineHeight: 0 } }\n },\n itemProps: {\n styles: buttonFlyoutIncreasedSizeStyles\n },\n disabled: !startCaptionsButtonProps.checked\n });\n }\n\n return (\n <MoreButton\n {...props}\n data-ui-id=\"captions-banner-more-button\"\n strings={moreButtonStrings}\n menuIconProps={{ hidden: true }}\n menuProps={{\n items: moreButtonContextualMenuItems,\n calloutProps: {\n preventDismissOnEvent: _preventDismissOnEvent\n }\n }}\n />\n );\n};\n"]}
|
package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js
CHANGED
@@ -111,11 +111,17 @@ export const DesktopMoreButton = (props) => {
|
|
111
111
|
? localeStrings.strings.call.startCaptionsButtonTooltipOnContent
|
112
112
|
: localeStrings.strings.call.startCaptionsButtonTooltipOffContent,
|
113
113
|
onClick: () => {
|
114
|
-
startCaptionsButtonProps.checked
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
114
|
+
if (startCaptionsButtonProps.checked) {
|
115
|
+
startCaptionsButtonProps.onStopCaptions();
|
116
|
+
}
|
117
|
+
else {
|
118
|
+
if (startCaptionsButtonProps.currentSpokenLanguage !== '') {
|
119
|
+
startCaptions();
|
120
|
+
}
|
121
|
+
else if (props.onCaptionsSettingsClick) {
|
122
|
+
props.onCaptionsSettingsClick();
|
123
|
+
}
|
124
|
+
}
|
119
125
|
},
|
120
126
|
iconProps: {
|
121
127
|
iconName: startCaptionsButtonProps.checked ? 'CaptionsOffIcon' : 'CaptionsIcon',
|
@@ -195,7 +201,8 @@ export const DesktopMoreButton = (props) => {
|
|
195
201
|
? localeStrings.strings.call.dtmfDialerMoreButtonLabelOn
|
196
202
|
: localeStrings.strings.call.dtmfDialerMoreButtonLabelOff,
|
197
203
|
onClick: () => {
|
198
|
-
|
204
|
+
var _a;
|
205
|
+
(_a = props.onSetDialpadPage) === null || _a === void 0 ? void 0 : _a.call(props);
|
199
206
|
setDtmfDialerChecked(!dtmfDialerChecked);
|
200
207
|
},
|
201
208
|
iconProps: {
|
@@ -218,7 +225,8 @@ export const DesktopMoreButton = (props) => {
|
|
218
225
|
},
|
219
226
|
text: localeStrings.strings.call.phoneCallMoreButtonLabel,
|
220
227
|
onClick: () => {
|
221
|
-
|
228
|
+
var _a;
|
229
|
+
(_a = props.onMeetingPhoneInfoClick) === null || _a === void 0 ? void 0 : _a.call(props);
|
222
230
|
},
|
223
231
|
iconProps: {
|
224
232
|
iconName: 'PhoneNumberButton',
|
@@ -257,7 +265,8 @@ export const DesktopMoreButton = (props) => {
|
|
257
265
|
},
|
258
266
|
isChecked: props.userSetGalleryLayout === 'floatingLocalVideo',
|
259
267
|
onClick: () => {
|
260
|
-
|
268
|
+
var _a;
|
269
|
+
(_a = props.onUserSetGalleryLayout) === null || _a === void 0 ? void 0 : _a.call(props, 'floatingLocalVideo');
|
261
270
|
setFocusedContentOn(false);
|
262
271
|
},
|
263
272
|
iconProps: {
|
@@ -274,7 +283,8 @@ export const DesktopMoreButton = (props) => {
|
|
274
283
|
},
|
275
284
|
isChecked: props.userSetGalleryLayout === 'speaker',
|
276
285
|
onClick: () => {
|
277
|
-
|
286
|
+
var _a;
|
287
|
+
(_a = props.onUserSetGalleryLayout) === null || _a === void 0 ? void 0 : _a.call(props, 'speaker');
|
278
288
|
setFocusedContentOn(false);
|
279
289
|
},
|
280
290
|
iconProps: {
|
@@ -291,14 +301,14 @@ export const DesktopMoreButton = (props) => {
|
|
291
301
|
},
|
292
302
|
isChecked: focusedContentOn,
|
293
303
|
onClick: () => {
|
294
|
-
var _a;
|
304
|
+
var _a, _b, _c;
|
295
305
|
if (focusedContentOn === false) {
|
296
306
|
setPreviousLayout((_a = props.userSetGalleryLayout) !== null && _a !== void 0 ? _a : 'floatingLocalVideo');
|
297
|
-
props.onUserSetGalleryLayout
|
307
|
+
(_b = props.onUserSetGalleryLayout) === null || _b === void 0 ? void 0 : _b.call(props, 'focusedContent');
|
298
308
|
setFocusedContentOn(true);
|
299
309
|
}
|
300
310
|
else {
|
301
|
-
props.onUserSetGalleryLayout
|
311
|
+
(_c = props.onUserSetGalleryLayout) === null || _c === void 0 ? void 0 : _c.call(props, previousLayout);
|
302
312
|
setFocusedContentOn(false);
|
303
313
|
}
|
304
314
|
},
|
@@ -323,7 +333,8 @@ export const DesktopMoreButton = (props) => {
|
|
323
333
|
},
|
324
334
|
isChecked: props.userSetGalleryLayout === 'default',
|
325
335
|
onClick: () => {
|
326
|
-
|
336
|
+
var _a;
|
337
|
+
(_a = props.onUserSetGalleryLayout) === null || _a === void 0 ? void 0 : _a.call(props, 'default');
|
327
338
|
setFocusedContentOn(false);
|
328
339
|
},
|
329
340
|
iconProps: {
|
@@ -341,7 +352,8 @@ export const DesktopMoreButton = (props) => {
|
|
341
352
|
},
|
342
353
|
isChecked: props.userSetGalleryLayout === 'largeGallery',
|
343
354
|
onClick: () => {
|
344
|
-
|
355
|
+
var _a;
|
356
|
+
(_a = props.onUserSetGalleryLayout) === null || _a === void 0 ? void 0 : _a.call(props, 'largeGallery');
|
345
357
|
setFocusedContentOn(false);
|
346
358
|
},
|
347
359
|
iconProps: {
|
@@ -358,7 +370,8 @@ export const DesktopMoreButton = (props) => {
|
|
358
370
|
},
|
359
371
|
isChecked: props.userSetGalleryLayout === 'togetherMode',
|
360
372
|
onClick: () => {
|
361
|
-
|
373
|
+
var _a;
|
374
|
+
(_a = props.onUserSetGalleryLayout) === null || _a === void 0 ? void 0 : _a.call(props, 'togetherMode');
|
362
375
|
setFocusedContentOn(false);
|
363
376
|
},
|
364
377
|
disabled: !(((participantId === null || participantId === void 0 ? void 0 : participantId.kind) === 'microsoftTeamsUser' && ((_e = participantCapability === null || participantCapability === void 0 ? void 0 : participantCapability.startTogetherMode) === null || _e === void 0 ? void 0 : _e.isPresent)) ||
|
@@ -383,12 +396,13 @@ export const DesktopMoreButton = (props) => {
|
|
383
396
|
},
|
384
397
|
isChecked: galleryPositionTop,
|
385
398
|
onClick: () => {
|
399
|
+
var _a, _b;
|
386
400
|
if (galleryPositionTop === false) {
|
387
|
-
props.onUserSetOverflowGalleryPositionChange
|
401
|
+
(_a = props.onUserSetOverflowGalleryPositionChange) === null || _a === void 0 ? void 0 : _a.call(props, 'horizontalTop');
|
388
402
|
setGalleryPositionTop(true);
|
389
403
|
}
|
390
404
|
else {
|
391
|
-
props.onUserSetOverflowGalleryPositionChange
|
405
|
+
(_b = props.onUserSetOverflowGalleryPositionChange) === null || _b === void 0 ? void 0 : _b.call(props, 'Responsive');
|
392
406
|
setGalleryPositionTop(false);
|
393
407
|
}
|
394
408
|
}
|