diff --git a/packages/calling-component-bindings/src/handlers/createCommonHandlers.ts b/packages/calling-component-bindings/src/handlers/createCommonHandlers.ts index caf6343e814..05473cf69a8 100644 --- a/packages/calling-component-bindings/src/handlers/createCommonHandlers.ts +++ b/packages/calling-component-bindings/src/handlers/createCommonHandlers.ts @@ -102,7 +102,7 @@ export interface CommonCallingHandlers { onStartCaptions: (options?: CaptionsOptions) => Promise; onStopCaptions: () => Promise; /* @conditional-compile-remove(rtt) */ - onSendRealTimeText: (text: string, finalized: boolean) => Promise; + onSendRealTimeText: (text: string, isFinalized: boolean) => Promise; onSetSpokenLanguage: (language: string) => Promise; onSetCaptionLanguage: (language: string) => Promise; onSubmitSurvey(survey: CallSurvey): Promise; @@ -738,9 +738,9 @@ export const createDefaultCommonCallingHandlers = memoizeOne( await captionsFeature.setCaptionLanguage(language); }; /* @conditional-compile-remove(rtt) */ - const onSendRealTimeText = async (text: string, finalized: boolean): Promise => { + const onSendRealTimeText = async (text: string, isFinalized: boolean): Promise => { const realTimeTextFeature = call?.feature(Features.RealTimeText); - await realTimeTextFeature?.sendRealTimeText(text, finalized); + await realTimeTextFeature?.sendRealTimeText(text, isFinalized); }; const onSubmitSurvey = async (survey: CallSurvey): Promise => await call?.feature(Features.CallSurvey).submitSurvey(survey); diff --git a/packages/calling-stateful-client/src/CallClientState.ts b/packages/calling-stateful-client/src/CallClientState.ts index 6798ed8a5d1..c8a23d29a90 100644 --- a/packages/calling-stateful-client/src/CallClientState.ts +++ b/packages/calling-stateful-client/src/CallClientState.ts @@ -129,8 +129,9 @@ export interface RealTimeTextInfo { updatedTimestamp?: Date; /** * If message originated from the local participant + * default is false */ - isMe: boolean; + isMe?: boolean; } /** diff --git a/packages/communication-react/review/beta/communication-react.api.md b/packages/communication-react/review/beta/communication-react.api.md index 2eddb73265a..b49377d36ec 100644 --- a/packages/communication-react/review/beta/communication-react.api.md +++ b/packages/communication-react/review/beta/communication-react.api.md @@ -477,7 +477,7 @@ export interface CallAdapterCallOperations { resumeCall(): Promise; returnFromBreakoutRoom(): Promise; sendDtmfTone(dtmfTone: DtmfTone_2): Promise; - sendRealTimeText: (text: string, finalized: boolean) => Promise; + sendRealTimeText: (text: string, isFinalized: boolean) => Promise; setCaptionLanguage(language: string): Promise; setSpokenLanguage(language: string): Promise; // @beta @@ -1318,7 +1318,7 @@ export interface CallWithChatAdapterManagement { sendDtmfTone: (dtmfTone: DtmfTone_2) => Promise; sendMessage(content: string, options?: SendMessageOptions | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions): Promise; sendReadReceipt(chatMessageId: string): Promise; - sendRealTimeText: (text: string, finalized: boolean) => Promise; + sendRealTimeText: (text: string, isFinalized: boolean) => Promise; sendTypingIndicator(): Promise; setCamera(sourceInfo: VideoDeviceInfo, options?: VideoStreamOptions): Promise; setCaptionLanguage(language: string): Promise; @@ -1898,7 +1898,7 @@ export interface CaptionsBannerProps { isRealTimeTextOn?: boolean; latestLocalRealTimeText?: RealTimeTextInformation; onRenderAvatar?: OnRenderAvatarCallback; - onSendRealTimeText?: (text: string, finalized: boolean) => Promise; + onSendRealTimeText?: (text: string, isFinalized: boolean) => Promise; realTimeTexts?: { completedMessages?: RealTimeTextInformation[]; currentInProgress?: RealTimeTextInformation[]; @@ -2427,7 +2427,7 @@ export interface CommonCallingHandlers { // (undocumented) onSendDtmfTone: (dtmfTone: DtmfTone_2) => Promise; // (undocumented) - onSendRealTimeText: (text: string, finalized: boolean) => Promise; + onSendRealTimeText: (text: string, isFinalized: boolean) => Promise; // (undocumented) onSetCaptionLanguage: (language: string) => Promise; // (undocumented) @@ -4615,7 +4615,7 @@ export interface RealTimeTextCallFeatureState { // @beta (undocumented) export interface RealTimeTextInfo { id: number; - isMe: boolean; + isMe?: boolean; message: string; receivedTimestamp?: Date; resultType: RealTimeTextResultType; @@ -4630,19 +4630,8 @@ export type RealTimeTextInformation = { userId?: string; message: string; isTyping: boolean; - isMe: boolean; - finalizedTimeStamp: Date; -}; - -// @beta -export type RealTimeTextInformation = { - id: number; - displayName: string; - userId?: string; - message: string; - isTyping: boolean; - isMe: boolean; finalizedTimeStamp: Date; + isMe?: boolean; }; // @beta diff --git a/packages/react-components/src/components/CaptionsBanner.tsx b/packages/react-components/src/components/CaptionsBanner.tsx index 13445d6d94f..754d47cc630 100644 --- a/packages/react-components/src/components/CaptionsBanner.tsx +++ b/packages/react-components/src/components/CaptionsBanner.tsx @@ -80,14 +80,15 @@ export type RealTimeTextInformation = { * if the real time text received is partial */ isTyping: boolean; - /** - * If message originated from the local participant - */ - isMe: boolean; /** * timestamp when the real time text was finalized */ finalizedTimeStamp: Date; + /** + * If message originated from the local participant + * default value is false + */ + isMe?: boolean; }; /** * @public @@ -177,7 +178,7 @@ export interface CaptionsBannerProps { /** * Optional callback to send real time text. */ - onSendRealTimeText?: (text: string, finalized: boolean) => Promise; + onSendRealTimeText?: (text: string, isFinalized: boolean) => Promise; /* @conditional-compile-remove(rtt) */ /** * Latest local real time text diff --git a/packages/react-composites/src/composites/CallComposite/MockCallAdapter.ts b/packages/react-composites/src/composites/CallComposite/MockCallAdapter.ts index f6945b32a5e..7571c35f318 100644 --- a/packages/react-composites/src/composites/CallComposite/MockCallAdapter.ts +++ b/packages/react-composites/src/composites/CallComposite/MockCallAdapter.ts @@ -190,7 +190,7 @@ export class _MockCallAdapter implements CallAdapter { throw Error('stopCaptions not implemented'); } /* @conditional-compile-remove(rtt) */ - sendRealTimeText(text: string, finalized: boolean): Promise { + sendRealTimeText(text: string, isFinalized: boolean): Promise { throw Error('sendRealTimeText not implemented'); } diff --git a/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts b/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts index f21367fe8b4..c0f80e64a9a 100644 --- a/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts +++ b/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts @@ -1157,8 +1157,8 @@ export class AzureCommunicationCallAdapter { - this.handlers.onSendRealTimeText(text, finalized); + public async sendRealTimeText(text: string, isFinalized: boolean): Promise { + this.handlers.onSendRealTimeText(text, isFinalized); } public async submitSurvey(survey: CallSurvey): Promise { return this.handlers.onSubmitSurvey(survey); diff --git a/packages/react-composites/src/composites/CallComposite/adapter/CallAdapter.ts b/packages/react-composites/src/composites/CallComposite/adapter/CallAdapter.ts index 7cbe83455eb..9825a9b6d72 100644 --- a/packages/react-composites/src/composites/CallComposite/adapter/CallAdapter.ts +++ b/packages/react-composites/src/composites/CallComposite/adapter/CallAdapter.ts @@ -862,7 +862,7 @@ export interface CallAdapterCallOperations { * @param text - real time text content * @param finalized - Boolean to indicate if the real time text is final */ - sendRealTimeText: (text: string, finalized: boolean) => Promise; + sendRealTimeText: (text: string, isFinalized: boolean) => Promise; } /** diff --git a/packages/react-composites/src/composites/CallComposite/hooks/useHandlers.ts b/packages/react-composites/src/composites/CallComposite/hooks/useHandlers.ts index 9104490be23..d5bdef7f540 100644 --- a/packages/react-composites/src/composites/CallComposite/hooks/useHandlers.ts +++ b/packages/react-composites/src/composites/CallComposite/hooks/useHandlers.ts @@ -294,8 +294,8 @@ const createCompositeHandlers = memoizeOne( return await adapter.disposeTogetherModeStreamView(); }, /* @conditional-compile-remove(rtt) */ - onSendRealTimeText: async (text: string, finalized: boolean) => { - return await adapter.sendRealTimeText(text, finalized); + onSendRealTimeText: async (text: string, isFinalized: boolean) => { + return await adapter.sendRealTimeText(text, isFinalized); } }; } diff --git a/packages/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.ts b/packages/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.ts index a97aabeb54b..86048758c13 100644 --- a/packages/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.ts +++ b/packages/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.ts @@ -659,8 +659,8 @@ export class AzureCommunicationCallWithChatAdapter implements CallWithChatAdapte await this.callAdapter.setSpokenLanguage(language); } /* @conditional-compile-remove(rtt) */ - public async sendRealTimeText(text: string, finalized: boolean): Promise { - await this.callAdapter.sendRealTimeText(text, finalized); + public async sendRealTimeText(text: string, isFinalized: boolean): Promise { + await this.callAdapter.sendRealTimeText(text, isFinalized); } public async startVideoBackgroundEffect(videoBackgroundEffect: VideoBackgroundEffect): Promise { diff --git a/packages/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.ts b/packages/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.ts index bbcd683cd2c..da1540d0c1c 100644 --- a/packages/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.ts +++ b/packages/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.ts @@ -590,7 +590,7 @@ export interface CallWithChatAdapterManagement { * @param text - real time text content * @param finalized - Boolean to indicate if the real time text is final */ - sendRealTimeText: (text: string, finalized: boolean) => Promise; + sendRealTimeText: (text: string, isFinalized: boolean) => Promise; } /** diff --git a/packages/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.ts b/packages/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.ts index 5afab1979a7..d335f2ed8b4 100644 --- a/packages/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.ts +++ b/packages/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.ts @@ -205,8 +205,8 @@ export class CallWithChatBackedCallAdapter implements CallAdapter { await this.callWithChatAdapter.setSpokenLanguage(language); } /* @conditional-compile-remove(rtt) */ - public async sendRealTimeText(text: string, finalized: boolean): Promise { - await this.callWithChatAdapter.sendRealTimeText(text, finalized); + public async sendRealTimeText(text: string, isFinalized: boolean): Promise { + await this.callWithChatAdapter.sendRealTimeText(text, isFinalized); } public async startVideoBackgroundEffect(videoBackgroundEffect: VideoBackgroundEffect): Promise {