@azure/communication-react 1.19.0-alpha-202409060015 → 1.19.0-alpha-202409070015

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/communication-react.d.ts +24 -12
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-d2PFi3-l.js → ChatMessageComponentAsRichTextEditBox-DFzIZcdr.js} +2 -2
  3. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-d2PFi3-l.js.map → ChatMessageComponentAsRichTextEditBox-DFzIZcdr.js.map} +1 -1
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DSiJTLwu.js → RichTextSendBoxWrapper-Bcr0yV14.js} +2 -2
  5. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DSiJTLwu.js.map → RichTextSendBoxWrapper-Bcr0yV14.js.map} +1 -1
  6. package/dist/dist-cjs/communication-react/{index-CKU6pfS7.js → index-CczmcjJ7.js} +59 -55
  7. package/dist/dist-cjs/communication-react/index-CczmcjJ7.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  11. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +1 -1
  12. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  13. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.d.ts +1 -1
  14. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js +4 -5
  15. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js.map +1 -1
  16. package/dist/dist-esm/chat-stateful-client/src/ChatContext.js +1 -1
  17. package/dist/dist-esm/chat-stateful-client/src/ChatContext.js.map +1 -1
  18. package/dist/dist-esm/react-components/src/components/MicrophoneButton.d.ts +13 -8
  19. package/dist/dist-esm/react-components/src/components/MicrophoneButton.js +14 -16
  20. package/dist/dist-esm/react-components/src/components/MicrophoneButton.js.map +1 -1
  21. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js +7 -0
  22. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js.map +1 -1
  23. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js +3 -1
  24. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js.map +1 -1
  25. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +3 -4
  26. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +1 -1
  27. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  28. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +1 -1
  29. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  30. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/ParticipantSubcriber.d.ts +1 -1
  31. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/ParticipantSubcriber.js.map +1 -1
  32. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SvgWithWordWrapping.d.ts +1 -0
  33. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SvgWithWordWrapping.js +2 -2
  34. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SvgWithWordWrapping.js.map +1 -1
  35. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +1 -1
  36. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  37. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +10 -3
  38. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  39. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +1 -1
  40. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  41. package/dist/tsdoc-metadata.json +1 -1
  42. package/package.json +2 -1
  43. package/dist/dist-cjs/communication-react/index-CKU6pfS7.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ChatContext.js","sourceRoot":"","sources":["../../../../../chat-stateful-client/src/ChatContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAS,MAAM,OAAO,CAAC;AACpE,OAAO,EAML,SAAS,EACV,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAe,kBAAkB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,gCAAgC;AAC5F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAElF,YAAY,EAAE,CAAC;AACf,qDAAqD;AACrD,aAAa,EAAE,CAAC;AAEhB;;GAEG;AACH,MAAM,OAAO,WAAW;IAatB,YAAY,YAAqB,EAAE,UAAyC,EAAE,QAAiB;QAZvF,WAAM,GAAoB;YAChC,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAA2B;YAC3C,WAAW,EAAE,EAAE;YACf,OAAO,EAAE,EAAE;YACX,YAAY,EAAE,EAAgB;SAC/B,CAAC;QACM,eAAU,GAAG,KAAK,CAAC;QAGnB,4BAAuB,GAAuB,SAAS,CAAC;QACxD,sBAAiB,GAAsC,SAAS,CAAC;QACjE,wBAAmB,GAAsC,SAAS,CAAC;QAEzE,IAAI,CAAC,OAAO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G,IAAI,CAAC;QACvB,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC;QAC/B,IAAI,CAAC;YACH,UAAU,EAAE,CAAC;YACb,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;gBAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;YACzB,IAAI,WAAW,EAAE,KAAK,SAAS,EAAE,CAAC;gBAChC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,sBAAsB,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YAC/E,CAAC;YACD,MAAM,CAAC,CAAC;QACV,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAC1B,CAAC;IACH,CAAC;IAEM,aAAa,CAAC,OAAyC;QAC5D,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAEM,cAAc,CAAC,OAAyC;QAC7D,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;CACF;AAED,MAAM,WAAW,GAAG,CAAC,MAAuB,EAAE,KAAc,EAAa,EAAE;IACzE,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC;AACtD,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport EventEmitter from 'events';\nimport { enableMapSet, enablePatches, produce, Patch } from 'immer';\nimport {\n ChatClientState,\n ChatErrors,\n ChatThreadClientState,\n ChatThreadProperties,\n ChatErrorTarget,\n ChatError\n} from './ChatClientState';\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\nimport { ChatMessageReadReceipt, ChatParticipant } from '@azure/communication-chat';\nimport { CommunicationIdentifierKind, UnknownIdentifierKind } from '@azure/communication-common';\nimport { AzureLogger, createClientLogger, getLogLevel } from '@azure/logger';\nimport { _safeJSONStringify, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { Constants } from './Constants';\nimport { TypingIndicatorReceivedEvent } from '@azure/communication-chat';\nimport { chatStatefulLogger } from './Logger';\nimport type { CommunicationTokenCredential } from '@azure/communication-common';\nimport { ResourceDownloadQueue, fetchImageSource } from './ResourceDownloadQueue';\n\nenableMapSet();\n// Needed to generate state diff for verbose logging.\nenablePatches();\n\n/**\n * @internal\n */\nexport class ChatContext {\n private _state: ChatClientState = {\n userId: { id: '' } as UnknownIdentifierKind,\n displayName: '',\n threads: {},\n latestErrors: {} as ChatErrors\n };\n private _batchMode = false;\n private _logger: AzureLogger;\n private _emitter: EventEmitter;\n private typingIndicatorInterval: number | undefined = undefined;\n private _inlineImageQueue: ResourceDownloadQueue | undefined = undefined;\n private _fullsizeImageQueue: ResourceDownloadQueue | undefined = undefined;\n constructor(maxListeners?: number, credential?: CommunicationTokenCredential, endpoint?: string) {\n this._logger = createClientLogger('communication-react:chat-context');\n this._emitter = new EventEmitter();\n if (credential) {\n this._inlineImageQueue = new ResourceDownloadQueue(this, { credential, endpoint: endpoint ?? '' });\n this._fullsizeImageQueue = new ResourceDownloadQueue(this, { credential, endpoint: endpoint ?? '' });\n }\n if (maxListeners) {\n this._emitter.setMaxListeners(maxListeners);\n }\n }\n\n public getState(): ChatClientState {\n return this._state;\n }\n\n public modifyState(modifier: (draft: ChatClientState) => void): void {\n const priorState = this._state;\n this._state = produce(this._state, modifier, (patches: Patch[]) => {\n if (getLogLevel() === 'verbose') {\n // Log to `info` because AzureLogger.verbose() doesn't show up in console.\n this._logger.info(`State change: ${_safeJSONStringify(patches)}`);\n }\n });\n if (!this._batchMode && this._state !== priorState) {\n this._emitter.emit('stateChanged', this._state);\n }\n }\n\n public dispose(): void {\n this.modifyState((draft: ChatClientState) => {\n this._inlineImageQueue?.cancelAllRequests();\n this._fullsizeImageQueue?.cancelAllRequests();\n Object.keys(draft.threads).forEach((threadId) => {\n const thread = draft.threads[threadId];\n Object.keys(thread.chatMessages).forEach((messageId) => {\n const cache = thread.chatMessages[messageId].resourceCache;\n if (cache) {\n Object.keys(cache).forEach((resourceUrl) => {\n const resource = cache[resourceUrl];\n if (resource.sourceUrl) {\n URL.revokeObjectURL(resource.sourceUrl);\n }\n });\n }\n thread.chatMessages[messageId].resourceCache = undefined;\n });\n });\n });\n // Any item in queue should be removed.\n }\n public async downloadResourceToCache(threadId: string, messageId: string, resourceUrl: string): Promise<void> {\n let message = this.getState().threads[threadId]?.chatMessages[messageId];\n if (message && this._fullsizeImageQueue) {\n if (!message.resourceCache) {\n message = { ...message, resourceCache: {} };\n }\n // Need to discuss retry logic in case of failure\n this._fullsizeImageQueue.addMessage(message);\n await this._fullsizeImageQueue.startQueue(threadId, fetchImageSource, {\n singleUrl: resourceUrl\n });\n }\n }\n public removeResourceFromCache(threadId: string, messageId: string, resourceUrl: string): void {\n this.modifyState((draft: ChatClientState) => {\n const message = draft.threads[threadId]?.chatMessages[messageId];\n if (message && this._fullsizeImageQueue && this._fullsizeImageQueue.containsMessageWithSameAttachments(message)) {\n this._fullsizeImageQueue?.cancelRequest(resourceUrl);\n } else if (\n message &&\n this._inlineImageQueue &&\n this._inlineImageQueue.containsMessageWithSameAttachments(message)\n ) {\n this._inlineImageQueue?.cancelRequest(resourceUrl);\n }\n if (message && message.resourceCache && message.resourceCache[resourceUrl]) {\n const resource = message.resourceCache[resourceUrl];\n if (resource.sourceUrl) {\n URL.revokeObjectURL(resource.sourceUrl);\n }\n\n delete message.resourceCache[resourceUrl];\n }\n });\n }\n\n public setThread(threadId: string, threadState: ChatThreadClientState): void {\n this.modifyState((draft: ChatClientState) => {\n draft.threads[threadId] = threadState;\n });\n }\n\n public createThread(threadId: string, properties?: ChatThreadProperties): void {\n this.modifyState((draft: ChatClientState) => {\n draft.threads[threadId] = {\n chatMessages: {},\n threadId: threadId,\n properties: properties,\n participants: {},\n readReceipts: [],\n typingIndicators: [],\n latestReadTime: new Date(0)\n };\n });\n }\n\n public updateChatConfig(userId: CommunicationIdentifierKind, displayName: string): void {\n this.modifyState((draft: ChatClientState) => {\n draft.displayName = displayName;\n draft.userId = userId;\n });\n }\n\n public createThreadIfNotExist(threadId: string, properties?: ChatThreadProperties): boolean {\n const exists = Object.prototype.hasOwnProperty.call(this.getState().threads, threadId);\n if (!exists) {\n this.createThread(threadId, properties);\n return true;\n }\n return false;\n }\n\n public updateThread(threadId: string, properties?: ChatThreadProperties): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n if (thread) {\n thread.properties = properties;\n }\n });\n }\n\n public updateThreadTopic(threadId: string, topic?: string): void {\n this.modifyState((draft: ChatClientState) => {\n if (topic === undefined) {\n return;\n }\n const thread = draft.threads[threadId];\n if (thread && !thread.properties) {\n thread.properties = { topic: topic };\n } else if (thread && thread.properties) {\n thread.properties.topic = topic;\n }\n });\n }\n\n public deleteThread(threadId: string): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n if (thread) {\n delete draft.threads[threadId];\n }\n });\n }\n\n public setChatMessages(threadId: string, messages: { [key: string]: ChatMessageWithStatus }): void {\n this.modifyState((draft: ChatClientState) => {\n const threadState = draft.threads[threadId];\n if (threadState) {\n threadState.chatMessages = messages;\n }\n\n // remove typing indicator when receive messages\n const thread = draft.threads[threadId];\n if (thread) {\n for (const message of Object.values(messages)) {\n this.filterTypingIndicatorForUser(thread, message.sender);\n }\n }\n });\n }\n\n public updateChatMessageContent(threadId: string, messagesId: string, content: string | undefined): void {\n this.modifyState((draft: ChatClientState) => {\n const chatMessage = draft.threads[threadId]?.chatMessages[messagesId];\n if (chatMessage) {\n if (!chatMessage.content) {\n chatMessage.content = {};\n }\n chatMessage.content.message = content;\n }\n });\n }\n\n public deleteLocalMessage(threadId: string, localId: string): boolean {\n let localMessageDeleted = false;\n this.modifyState((draft: ChatClientState) => {\n const chatMessages = draft.threads[threadId]?.chatMessages;\n const message: ChatMessageWithStatus | undefined = chatMessages ? chatMessages[localId] : undefined;\n if (chatMessages && message && message.clientMessageId) {\n delete chatMessages[message.clientMessageId];\n localMessageDeleted = true;\n }\n });\n return localMessageDeleted;\n }\n\n public deleteMessage(threadId: string, id: string): void {\n this.modifyState((draft: ChatClientState) => {\n const chatMessages = draft.threads[threadId]?.chatMessages;\n if (chatMessages) {\n delete chatMessages[id];\n }\n });\n }\n\n public setParticipant(threadId: string, participant: ChatParticipant): void {\n this.modifyState((draft: ChatClientState) => {\n const participants = draft.threads[threadId]?.participants;\n if (participants) {\n participants[toFlatCommunicationIdentifier(participant.id)] = participant;\n }\n });\n }\n\n public setParticipants(threadId: string, participants: ChatParticipant[]): void {\n this.modifyState((draft: ChatClientState) => {\n const participantsMap = draft.threads[threadId]?.participants;\n if (participantsMap) {\n for (const participant of participants) {\n participantsMap[toFlatCommunicationIdentifier(participant.id)] = participant;\n }\n }\n });\n }\n\n public deleteParticipants(threadId: string, participantIds: CommunicationIdentifierKind[]): void {\n this.modifyState((draft: ChatClientState) => {\n const participants = draft.threads[threadId]?.participants;\n if (participants) {\n participantIds.forEach((id) => {\n delete participants[toFlatCommunicationIdentifier(id)];\n });\n }\n });\n }\n\n public deleteParticipant(threadId: string, participantId: CommunicationIdentifierKind): void {\n this.modifyState((draft: ChatClientState) => {\n const participants = draft.threads[threadId]?.participants;\n if (participants) {\n delete participants[toFlatCommunicationIdentifier(participantId)];\n }\n });\n }\n\n public addReadReceipt(threadId: string, readReceipt: ChatMessageReadReceipt): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n const readReceipts = thread?.readReceipts;\n if (thread && readReceipts) {\n // TODO(prprabhu): Replace `this.getState()` with `draft`?\n if (readReceipt.sender !== this.getState().userId && thread.latestReadTime < readReceipt.readOn) {\n thread.latestReadTime = readReceipt.readOn;\n }\n readReceipts.push(readReceipt);\n }\n });\n }\n\n private startTypingIndicatorCleanUp(): void {\n if (this.typingIndicatorInterval) {\n return;\n }\n this.typingIndicatorInterval = window.setInterval(() => {\n let isTypingActive = false;\n this.modifyState((draft: ChatClientState) => {\n for (const thread of Object.values(draft.threads)) {\n const filteredTypingIndicators = thread.typingIndicators.filter((typingIndicator) => {\n const timeGap = Date.now() - typingIndicator.receivedOn.getTime();\n return timeGap < Constants.TYPING_INDICATOR_MAINTAIN_TIME;\n });\n\n if (thread.typingIndicators.length !== filteredTypingIndicators.length) {\n thread.typingIndicators = filteredTypingIndicators;\n }\n if (thread.typingIndicators.length > 0) {\n isTypingActive = true;\n }\n }\n });\n\n if (!isTypingActive && this.typingIndicatorInterval) {\n window.clearInterval(this.typingIndicatorInterval);\n this.typingIndicatorInterval = undefined;\n }\n }, 1000);\n }\n\n public addTypingIndicator(threadId: string, typingIndicator: TypingIndicatorReceivedEvent): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n if (thread) {\n const typingIndicators = thread.typingIndicators;\n typingIndicators.push(typingIndicator);\n }\n });\n\n // Make sure we only maintain a period of typing indicator for perf purposes\n this.startTypingIndicatorCleanUp();\n }\n\n public setChatMessage(threadId: string, message: ChatMessageWithStatus): void {\n this.parseAttachments(threadId, message);\n const { id: messageId, clientMessageId } = message;\n if (messageId || clientMessageId) {\n this.modifyState((draft: ChatClientState) => {\n const threadMessages = draft.threads[threadId]?.chatMessages;\n const isLocalIdInMap = threadMessages && clientMessageId && threadMessages[clientMessageId];\n const messageKey = !messageId || isLocalIdInMap ? clientMessageId : messageId;\n\n if (threadMessages && messageKey) {\n threadMessages[messageKey] = message;\n }\n\n // remove typing indicator when receive a message from a user\n const thread = draft.threads[threadId];\n if (thread) {\n this.filterTypingIndicatorForUser(thread, message.sender);\n }\n });\n }\n }\n\n private parseAttachments(threadId: string, message: ChatMessageWithStatus): void {\n const attachments = message.content?.attachments;\n if (message.type === 'html' && attachments && attachments.length > 0) {\n if (\n this._inlineImageQueue &&\n !this._inlineImageQueue.containsMessageWithSameAttachments(message) &&\n message.resourceCache === undefined\n ) {\n // Need to discuss retry logic in case of failure\n this._inlineImageQueue.addMessage(message);\n this._inlineImageQueue.startQueue(threadId, fetchImageSource);\n }\n }\n }\n\n /**\n * Tees any errors encountered in an async function to the state.\n *\n * @param f Async function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n public withAsyncErrorTeedToState<Args extends unknown[], R>(\n f: (...args: Args) => Promise<R>,\n target: ChatErrorTarget\n ): (...args: Args) => Promise<R> {\n return async (...args: Args): Promise<R> => {\n try {\n return await f(...args);\n } catch (error) {\n const chatError = toChatError(target, error);\n this.setLatestError(target, chatError);\n throw chatError;\n }\n };\n }\n\n /**\n * Tees any errors encountered in an function to the state.\n *\n * @param f Function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n public withErrorTeedToState<Args extends unknown[], R>(\n f: (...args: Args) => R,\n target: ChatErrorTarget\n ): (...args: Args) => R {\n return (...args: Args): R => {\n try {\n chatStatefulLogger.info(`Chat stateful client target function called: ${target}`);\n return f(...args);\n } catch (error) {\n const chatError = toChatError(target, error);\n this.setLatestError(target, chatError);\n throw chatError;\n }\n };\n }\n\n private setLatestError(target: ChatErrorTarget, error: ChatError): void {\n this.modifyState((draft: ChatClientState) => {\n draft.latestErrors[target] = error;\n });\n }\n\n // This is a mutating function, only use it inside of a produce() function\n private filterTypingIndicatorForUser(thread: ChatThreadClientState, userId?: CommunicationIdentifierKind): void {\n if (!userId) {\n return;\n }\n const typingIndicators = thread.typingIndicators;\n const userIdAsKey = toFlatCommunicationIdentifier(userId);\n const filteredTypingIndicators = typingIndicators.filter(\n (typingIndicator) => toFlatCommunicationIdentifier(typingIndicator.sender) !== userIdAsKey\n );\n if (filteredTypingIndicators.length !== typingIndicators.length) {\n thread.typingIndicators = filteredTypingIndicators;\n }\n }\n\n /**\n * Batch updates to minimize `stateChanged` events across related operations.\n *\n * - A maximum of one `stateChanged` event is emitted, at the end of the operations.\n * - No `stateChanged` event is emitted if the state did not change through the operations.\n * - In case of an exception, state is reset to the prior value and no `stateChanged` event is emitted.\n *\n * All operations finished in this batch should be synchronous.\n * This function is not reentrant -- do not call batch() from within another batch().\n */\n public batch(operations: () => void): void {\n if (this._batchMode) {\n throw new Error('batch() called from within another batch()');\n }\n\n this._batchMode = true;\n const priorState = this._state;\n try {\n operations();\n if (this._state !== priorState) {\n this._emitter.emit('stateChanged', this._state);\n }\n } catch (e) {\n this._state = priorState;\n if (getLogLevel() === 'verbose') {\n this._logger.warning(`State rollback to: ${_safeJSONStringify(priorState)}`);\n }\n throw e;\n } finally {\n this._batchMode = false;\n }\n }\n\n public onStateChange(handler: (state: ChatClientState) => void): void {\n this._emitter.on('stateChanged', handler);\n }\n\n public offStateChange(handler: (state: ChatClientState) => void): void {\n this._emitter.off('stateChanged', handler);\n }\n}\n\nconst toChatError = (target: ChatErrorTarget, error: unknown): ChatError => {\n if (error instanceof Error) {\n return new ChatError(target, error);\n }\n return new ChatError(target, new Error(`${error}`));\n};\n"]}
1
+ {"version":3,"file":"ChatContext.js","sourceRoot":"","sources":["../../../../../chat-stateful-client/src/ChatContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAS,MAAM,OAAO,CAAC;AACpE,OAAO,E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UAAU,CAAC,EAAE,CAAC,CAAC;YAC/E,CAAC;YACD,MAAM,CAAC,CAAC;QACV,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAC1B,CAAC;IACH,CAAC;IAEM,aAAa,CAAC,OAAyC;QAC5D,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAEM,cAAc,CAAC,OAAyC;QAC7D,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;CACF;AAED,MAAM,WAAW,GAAG,CAAC,MAAuB,EAAE,KAAc,EAAa,EAAE;IACzE,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC;AACtD,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { EventEmitter } from 'events';\nimport { enableMapSet, enablePatches, produce, Patch } from 'immer';\nimport {\n ChatClientState,\n ChatErrors,\n ChatThreadClientState,\n ChatThreadProperties,\n ChatErrorTarget,\n ChatError\n} from './ChatClientState';\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\nimport { ChatMessageReadReceipt, ChatParticipant } from '@azure/communication-chat';\nimport { CommunicationIdentifierKind, UnknownIdentifierKind } from '@azure/communication-common';\nimport { AzureLogger, createClientLogger, getLogLevel } from '@azure/logger';\nimport { _safeJSONStringify, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { Constants } from './Constants';\nimport { TypingIndicatorReceivedEvent } from '@azure/communication-chat';\nimport { chatStatefulLogger } from './Logger';\nimport type { CommunicationTokenCredential } from '@azure/communication-common';\nimport { ResourceDownloadQueue, fetchImageSource } from './ResourceDownloadQueue';\n\nenableMapSet();\n// Needed to generate state diff for verbose logging.\nenablePatches();\n\n/**\n * @internal\n */\nexport class ChatContext {\n private _state: ChatClientState = {\n userId: { id: '' } as UnknownIdentifierKind,\n displayName: '',\n threads: {},\n latestErrors: {} as ChatErrors\n };\n private _batchMode = false;\n private _logger: AzureLogger;\n private _emitter: EventEmitter;\n private typingIndicatorInterval: number | undefined = undefined;\n private _inlineImageQueue: ResourceDownloadQueue | undefined = undefined;\n private _fullsizeImageQueue: ResourceDownloadQueue | undefined = undefined;\n constructor(maxListeners?: number, credential?: CommunicationTokenCredential, endpoint?: string) {\n this._logger = createClientLogger('communication-react:chat-context');\n this._emitter = new EventEmitter();\n if (credential) {\n this._inlineImageQueue = new ResourceDownloadQueue(this, { credential, endpoint: endpoint ?? '' });\n this._fullsizeImageQueue = new ResourceDownloadQueue(this, { credential, endpoint: endpoint ?? '' });\n }\n if (maxListeners) {\n this._emitter.setMaxListeners(maxListeners);\n }\n }\n\n public getState(): ChatClientState {\n return this._state;\n }\n\n public modifyState(modifier: (draft: ChatClientState) => void): void {\n const priorState = this._state;\n this._state = produce(this._state, modifier, (patches: Patch[]) => {\n if (getLogLevel() === 'verbose') {\n // Log to `info` because AzureLogger.verbose() doesn't show up in console.\n this._logger.info(`State change: ${_safeJSONStringify(patches)}`);\n }\n });\n if (!this._batchMode && this._state !== priorState) {\n this._emitter.emit('stateChanged', this._state);\n }\n }\n\n public dispose(): void {\n this.modifyState((draft: ChatClientState) => {\n this._inlineImageQueue?.cancelAllRequests();\n this._fullsizeImageQueue?.cancelAllRequests();\n Object.keys(draft.threads).forEach((threadId) => {\n const thread = draft.threads[threadId];\n Object.keys(thread.chatMessages).forEach((messageId) => {\n const cache = thread.chatMessages[messageId].resourceCache;\n if (cache) {\n Object.keys(cache).forEach((resourceUrl) => {\n const resource = cache[resourceUrl];\n if (resource.sourceUrl) {\n URL.revokeObjectURL(resource.sourceUrl);\n }\n });\n }\n thread.chatMessages[messageId].resourceCache = undefined;\n });\n });\n });\n // Any item in queue should be removed.\n }\n public async downloadResourceToCache(threadId: string, messageId: string, resourceUrl: string): Promise<void> {\n let message = this.getState().threads[threadId]?.chatMessages[messageId];\n if (message && this._fullsizeImageQueue) {\n if (!message.resourceCache) {\n message = { ...message, resourceCache: {} };\n }\n // Need to discuss retry logic in case of failure\n this._fullsizeImageQueue.addMessage(message);\n await this._fullsizeImageQueue.startQueue(threadId, fetchImageSource, {\n singleUrl: resourceUrl\n });\n }\n }\n public removeResourceFromCache(threadId: string, messageId: string, resourceUrl: string): void {\n this.modifyState((draft: ChatClientState) => {\n const message = draft.threads[threadId]?.chatMessages[messageId];\n if (message && this._fullsizeImageQueue && this._fullsizeImageQueue.containsMessageWithSameAttachments(message)) {\n this._fullsizeImageQueue?.cancelRequest(resourceUrl);\n } else if (\n message &&\n this._inlineImageQueue &&\n this._inlineImageQueue.containsMessageWithSameAttachments(message)\n ) {\n this._inlineImageQueue?.cancelRequest(resourceUrl);\n }\n if (message && message.resourceCache && message.resourceCache[resourceUrl]) {\n const resource = message.resourceCache[resourceUrl];\n if (resource.sourceUrl) {\n URL.revokeObjectURL(resource.sourceUrl);\n }\n\n delete message.resourceCache[resourceUrl];\n }\n });\n }\n\n public setThread(threadId: string, threadState: ChatThreadClientState): void {\n this.modifyState((draft: ChatClientState) => {\n draft.threads[threadId] = threadState;\n });\n }\n\n public createThread(threadId: string, properties?: ChatThreadProperties): void {\n this.modifyState((draft: ChatClientState) => {\n draft.threads[threadId] = {\n chatMessages: {},\n threadId: threadId,\n properties: properties,\n participants: {},\n readReceipts: [],\n typingIndicators: [],\n latestReadTime: new Date(0)\n };\n });\n }\n\n public updateChatConfig(userId: CommunicationIdentifierKind, displayName: string): void {\n this.modifyState((draft: ChatClientState) => {\n draft.displayName = displayName;\n draft.userId = userId;\n });\n }\n\n public createThreadIfNotExist(threadId: string, properties?: ChatThreadProperties): boolean {\n const exists = Object.prototype.hasOwnProperty.call(this.getState().threads, threadId);\n if (!exists) {\n this.createThread(threadId, properties);\n return true;\n }\n return false;\n }\n\n public updateThread(threadId: string, properties?: ChatThreadProperties): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n if (thread) {\n thread.properties = properties;\n }\n });\n }\n\n public updateThreadTopic(threadId: string, topic?: string): void {\n this.modifyState((draft: ChatClientState) => {\n if (topic === undefined) {\n return;\n }\n const thread = draft.threads[threadId];\n if (thread && !thread.properties) {\n thread.properties = { topic: topic };\n } else if (thread && thread.properties) {\n thread.properties.topic = topic;\n }\n });\n }\n\n public deleteThread(threadId: string): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n if (thread) {\n delete draft.threads[threadId];\n }\n });\n }\n\n public setChatMessages(threadId: string, messages: { [key: string]: ChatMessageWithStatus }): void {\n this.modifyState((draft: ChatClientState) => {\n const threadState = draft.threads[threadId];\n if (threadState) {\n threadState.chatMessages = messages;\n }\n\n // remove typing indicator when receive messages\n const thread = draft.threads[threadId];\n if (thread) {\n for (const message of Object.values(messages)) {\n this.filterTypingIndicatorForUser(thread, message.sender);\n }\n }\n });\n }\n\n public updateChatMessageContent(threadId: string, messagesId: string, content: string | undefined): void {\n this.modifyState((draft: ChatClientState) => {\n const chatMessage = draft.threads[threadId]?.chatMessages[messagesId];\n if (chatMessage) {\n if (!chatMessage.content) {\n chatMessage.content = {};\n }\n chatMessage.content.message = content;\n }\n });\n }\n\n public deleteLocalMessage(threadId: string, localId: string): boolean {\n let localMessageDeleted = false;\n this.modifyState((draft: ChatClientState) => {\n const chatMessages = draft.threads[threadId]?.chatMessages;\n const message: ChatMessageWithStatus | undefined = chatMessages ? chatMessages[localId] : undefined;\n if (chatMessages && message && message.clientMessageId) {\n delete chatMessages[message.clientMessageId];\n localMessageDeleted = true;\n }\n });\n return localMessageDeleted;\n }\n\n public deleteMessage(threadId: string, id: string): void {\n this.modifyState((draft: ChatClientState) => {\n const chatMessages = draft.threads[threadId]?.chatMessages;\n if (chatMessages) {\n delete chatMessages[id];\n }\n });\n }\n\n public setParticipant(threadId: string, participant: ChatParticipant): void {\n this.modifyState((draft: ChatClientState) => {\n const participants = draft.threads[threadId]?.participants;\n if (participants) {\n participants[toFlatCommunicationIdentifier(participant.id)] = participant;\n }\n });\n }\n\n public setParticipants(threadId: string, participants: ChatParticipant[]): void {\n this.modifyState((draft: ChatClientState) => {\n const participantsMap = draft.threads[threadId]?.participants;\n if (participantsMap) {\n for (const participant of participants) {\n participantsMap[toFlatCommunicationIdentifier(participant.id)] = participant;\n }\n }\n });\n }\n\n public deleteParticipants(threadId: string, participantIds: CommunicationIdentifierKind[]): void {\n this.modifyState((draft: ChatClientState) => {\n const participants = draft.threads[threadId]?.participants;\n if (participants) {\n participantIds.forEach((id) => {\n delete participants[toFlatCommunicationIdentifier(id)];\n });\n }\n });\n }\n\n public deleteParticipant(threadId: string, participantId: CommunicationIdentifierKind): void {\n this.modifyState((draft: ChatClientState) => {\n const participants = draft.threads[threadId]?.participants;\n if (participants) {\n delete participants[toFlatCommunicationIdentifier(participantId)];\n }\n });\n }\n\n public addReadReceipt(threadId: string, readReceipt: ChatMessageReadReceipt): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n const readReceipts = thread?.readReceipts;\n if (thread && readReceipts) {\n // TODO(prprabhu): Replace `this.getState()` with `draft`?\n if (readReceipt.sender !== this.getState().userId && thread.latestReadTime < readReceipt.readOn) {\n thread.latestReadTime = readReceipt.readOn;\n }\n readReceipts.push(readReceipt);\n }\n });\n }\n\n private startTypingIndicatorCleanUp(): void {\n if (this.typingIndicatorInterval) {\n return;\n }\n this.typingIndicatorInterval = window.setInterval(() => {\n let isTypingActive = false;\n this.modifyState((draft: ChatClientState) => {\n for (const thread of Object.values(draft.threads)) {\n const filteredTypingIndicators = thread.typingIndicators.filter((typingIndicator) => {\n const timeGap = Date.now() - typingIndicator.receivedOn.getTime();\n return timeGap < Constants.TYPING_INDICATOR_MAINTAIN_TIME;\n });\n\n if (thread.typingIndicators.length !== filteredTypingIndicators.length) {\n thread.typingIndicators = filteredTypingIndicators;\n }\n if (thread.typingIndicators.length > 0) {\n isTypingActive = true;\n }\n }\n });\n\n if (!isTypingActive && this.typingIndicatorInterval) {\n window.clearInterval(this.typingIndicatorInterval);\n this.typingIndicatorInterval = undefined;\n }\n }, 1000);\n }\n\n public addTypingIndicator(threadId: string, typingIndicator: TypingIndicatorReceivedEvent): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n if (thread) {\n const typingIndicators = thread.typingIndicators;\n typingIndicators.push(typingIndicator);\n }\n });\n\n // Make sure we only maintain a period of typing indicator for perf purposes\n this.startTypingIndicatorCleanUp();\n }\n\n public setChatMessage(threadId: string, message: ChatMessageWithStatus): void {\n this.parseAttachments(threadId, message);\n const { id: messageId, clientMessageId } = message;\n if (messageId || clientMessageId) {\n this.modifyState((draft: ChatClientState) => {\n const threadMessages = draft.threads[threadId]?.chatMessages;\n const isLocalIdInMap = threadMessages && clientMessageId && threadMessages[clientMessageId];\n const messageKey = !messageId || isLocalIdInMap ? clientMessageId : messageId;\n\n if (threadMessages && messageKey) {\n threadMessages[messageKey] = message;\n }\n\n // remove typing indicator when receive a message from a user\n const thread = draft.threads[threadId];\n if (thread) {\n this.filterTypingIndicatorForUser(thread, message.sender);\n }\n });\n }\n }\n\n private parseAttachments(threadId: string, message: ChatMessageWithStatus): void {\n const attachments = message.content?.attachments;\n if (message.type === 'html' && attachments && attachments.length > 0) {\n if (\n this._inlineImageQueue &&\n !this._inlineImageQueue.containsMessageWithSameAttachments(message) &&\n message.resourceCache === undefined\n ) {\n // Need to discuss retry logic in case of failure\n this._inlineImageQueue.addMessage(message);\n this._inlineImageQueue.startQueue(threadId, fetchImageSource);\n }\n }\n }\n\n /**\n * Tees any errors encountered in an async function to the state.\n *\n * @param f Async function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n public withAsyncErrorTeedToState<Args extends unknown[], R>(\n f: (...args: Args) => Promise<R>,\n target: ChatErrorTarget\n ): (...args: Args) => Promise<R> {\n return async (...args: Args): Promise<R> => {\n try {\n return await f(...args);\n } catch (error) {\n const chatError = toChatError(target, error);\n this.setLatestError(target, chatError);\n throw chatError;\n }\n };\n }\n\n /**\n * Tees any errors encountered in an function to the state.\n *\n * @param f Function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n public withErrorTeedToState<Args extends unknown[], R>(\n f: (...args: Args) => R,\n target: ChatErrorTarget\n ): (...args: Args) => R {\n return (...args: Args): R => {\n try {\n chatStatefulLogger.info(`Chat stateful client target function called: ${target}`);\n return f(...args);\n } catch (error) {\n const chatError = toChatError(target, error);\n this.setLatestError(target, chatError);\n throw chatError;\n }\n };\n }\n\n private setLatestError(target: ChatErrorTarget, error: ChatError): void {\n this.modifyState((draft: ChatClientState) => {\n draft.latestErrors[target] = error;\n });\n }\n\n // This is a mutating function, only use it inside of a produce() function\n private filterTypingIndicatorForUser(thread: ChatThreadClientState, userId?: CommunicationIdentifierKind): void {\n if (!userId) {\n return;\n }\n const typingIndicators = thread.typingIndicators;\n const userIdAsKey = toFlatCommunicationIdentifier(userId);\n const filteredTypingIndicators = typingIndicators.filter(\n (typingIndicator) => toFlatCommunicationIdentifier(typingIndicator.sender) !== userIdAsKey\n );\n if (filteredTypingIndicators.length !== typingIndicators.length) {\n thread.typingIndicators = filteredTypingIndicators;\n }\n }\n\n /**\n * Batch updates to minimize `stateChanged` events across related operations.\n *\n * - A maximum of one `stateChanged` event is emitted, at the end of the operations.\n * - No `stateChanged` event is emitted if the state did not change through the operations.\n * - In case of an exception, state is reset to the prior value and no `stateChanged` event is emitted.\n *\n * All operations finished in this batch should be synchronous.\n * This function is not reentrant -- do not call batch() from within another batch().\n */\n public batch(operations: () => void): void {\n if (this._batchMode) {\n throw new Error('batch() called from within another batch()');\n }\n\n this._batchMode = true;\n const priorState = this._state;\n try {\n operations();\n if (this._state !== priorState) {\n this._emitter.emit('stateChanged', this._state);\n }\n } catch (e) {\n this._state = priorState;\n if (getLogLevel() === 'verbose') {\n this._logger.warning(`State rollback to: ${_safeJSONStringify(priorState)}`);\n }\n throw e;\n } finally {\n this._batchMode = false;\n }\n }\n\n public onStateChange(handler: (state: ChatClientState) => void): void {\n this._emitter.on('stateChanged', handler);\n }\n\n public offStateChange(handler: (state: ChatClientState) => void): void {\n this._emitter.off('stateChanged', handler);\n }\n}\n\nconst toChatError = (target: ChatErrorTarget, error: unknown): ChatError => {\n if (error instanceof Error) {\n return new ChatError(target, error);\n }\n return new ChatError(target, new Error(`${error}`));\n};\n"]}
@@ -72,21 +72,20 @@ export interface MicrophoneButtonStrings {
72
72
  */
73
73
  microphoneAriaDescription?: string;
74
74
  /**
75
- * Title when deep noise suppression is on
75
+ * Title for deep noise suppression button
76
+ * @beta
76
77
  */
77
- deepNoiseSuppresionOnTitle?: string;
78
- /**
79
- * Title when deep noise suppression is off
80
- */
81
- deepNoiseSuppresionOffTitle?: string;
78
+ deepNoiseSuppressionTitle?: string;
82
79
  /**
83
80
  * Noise Suppression turned on string for announcer
81
+ * @beta
84
82
  */
85
- deepNoiseSuppresionOnAnnouncement?: string;
83
+ deepNoiseSuppressionOnAnnouncement?: string;
86
84
  /**
87
85
  * Noise Suppression turned off string for announcer
86
+ * @beta
88
87
  */
89
- deepNoiseSuppresionOffAnnouncement?: string;
88
+ deepNoiseSuppressionOffAnnouncement?: string;
90
89
  }
91
90
  /**
92
91
  * Styles for {@link MicrophoneButton}
@@ -161,14 +160,20 @@ export interface MicrophoneButtonProps extends ControlBarButtonProps {
161
160
  styles?: Partial<MicrophoneButtonStyles>;
162
161
  /**
163
162
  * Whether the deep noise suppression is on or off
163
+ *
164
+ * @beta
164
165
  */
165
166
  isDeepNoiseSuppressionOn?: boolean;
166
167
  /**
167
168
  * Callback when noise suppression is clicked
169
+ *
170
+ * @beta
168
171
  */
169
172
  onClickNoiseSuppression?: () => void;
170
173
  /**
171
174
  * Show/Hide the deep noise suppression button
175
+ *
176
+ * @beta
172
177
  */
173
178
  showNoiseSuppressionButton?: boolean;
174
179
  }
@@ -73,17 +73,6 @@ export const MicrophoneButton = (props) => {
73
73
  label: { fontWeight: 400 }
74
74
  };
75
75
  const splitButtonMenuItems = [];
76
- splitButtonMenuItems.push({
77
- key: 'microphonePrimaryAction',
78
- text: props.checked ? strings.onSplitButtonMicrophonePrimaryAction : strings.offSplitButtonMicrophonePrimaryAction,
79
- onClick: () => {
80
- onToggleClick();
81
- },
82
- iconProps: {
83
- iconName: props.checked ? 'SplitButtonPrimaryActionMicUnmuted' : 'SplitButtonPrimaryActionMicMuted',
84
- styles: { root: { lineHeight: 0 } }
85
- }
86
- });
87
76
  /* @conditional-compile-remove(DNS) */
88
77
  if (props.showNoiseSuppressionButton) {
89
78
  splitButtonMenuItems.push({
@@ -93,15 +82,24 @@ export const MicrophoneButton = (props) => {
93
82
  var _a;
94
83
  yield ((_a = props.onClickNoiseSuppression) === null || _a === void 0 ? void 0 : _a.call(props));
95
84
  setAnnouncerString(props.isDeepNoiseSuppressionOn
96
- ? strings.deepNoiseSuppresionOnAnnouncement
97
- : strings.deepNoiseSuppresionOffAnnouncement);
85
+ ? strings.deepNoiseSuppressionOnAnnouncement
86
+ : strings.deepNoiseSuppressionOffAnnouncement);
98
87
  }) },
99
- React.createElement(Toggle, { label: props.isDeepNoiseSuppressionOn
100
- ? strings.deepNoiseSuppresionOnTitle
101
- : strings.deepNoiseSuppresionOffTitle, checked: props.isDeepNoiseSuppressionOn, inlineLabel: true, styles: deepNoiseSuppressionToggleStyles })));
88
+ React.createElement(Toggle, { label: strings.deepNoiseSuppressionTitle, checked: props.isDeepNoiseSuppressionOn, inlineLabel: true, styles: deepNoiseSuppressionToggleStyles })));
102
89
  }
103
90
  });
104
91
  }
92
+ splitButtonMenuItems.push({
93
+ key: 'microphonePrimaryAction',
94
+ text: props.checked ? strings.onSplitButtonMicrophonePrimaryAction : strings.offSplitButtonMicrophonePrimaryAction,
95
+ onClick: () => {
96
+ onToggleClick();
97
+ },
98
+ iconProps: {
99
+ iconName: props.checked ? 'SplitButtonPrimaryActionMicUnmuted' : 'SplitButtonPrimaryActionMicMuted',
100
+ styles: { root: { lineHeight: 0 } }
101
+ }
102
+ });
105
103
  /**
106
104
  * We need to also include the primary action of the button to the
107
105
  * split button for mobile devices.
@@ -1 +1 @@
1
- {"version":3,"file":"MicrophoneButton.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/MicrophoneButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAyB,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EACL,sBAAsB,EAIvB,MAAM,iBAAiB,CAAC;AACzB,sCAAsC;AACtC,OAAO,EAAE,MAAM,EAAE,KAAK,EAA4D,MAAM,iBAAiB,CAAC;AAE1G,OAAO,EAAiB,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAsLxC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAA4B,EAAe,EAAE;;IAC5E,MAAM,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC;IACrC,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC;IAC3D,MAAM,OAAO,mCAAQ,aAAa,GAAK,KAAK,CAAC,OAAO,CAAE,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AAI,iBAAiB,EACzD,eAAe,EAAE,MAAA,KAAK,CAAC,eAAe,mCAAI,kBAAkB,EAC5D,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAA,KAAK,CAAC,QAAQ,mCAAI,uBAAuB,EACnD,SAAS,EACP,MAAA,KAAK,CAAC,SAAS,mCACf,CAAC,KAAK,CAAC,yBAAyB;gBAC9B,CAAC,CAAC,8BAA8B,iCACvB,KAAK,KAAE,MAAM,EAAE,MAAA,KAAK,CAAC,MAAM,0CAAE,UAAU,KAC5C,OAAO,EACP,wBAAwB,CACzB;gBACH,CAAC,CAAC,SAAS,CAAC,EAEhB,aAAa,EAAE,CAAA,MAAA,KAAK,CAAC,aAAa,mCAAI,CAAC,KAAK,CAAC,yBAAyB,EAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,EACrG,KAAK,EAAE,MAAA,KAAK,CAAC,KAAK,mCAAI,KAAK,CAAC,yBAAyB,0BAEnD,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAAC,OAAO,CAAC,oCAAoC,CAAC,CAAC,CAAC,SAAS,sBAE1E,OAAO,CAAC,yBAAyB,EACnD,oBAAoB,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,EACzF,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,IAChC,CACD,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useState, useCallback } from 'react';\nimport { useLocale } from '../localization';\nimport { ControlBarButton, ControlBarButtonProps } from './ControlBarButton';\nimport { _HighContrastAwareIcon } from './HighContrastAwareIcon';\n\nimport {\n ContextualMenuItemType,\n IContextualMenuItem,\n IContextualMenuItemStyles,\n IContextualMenuStyles\n} from '@fluentui/react';\n/* @conditional-compile-remove(DNS) */\nimport { Toggle, Stack, IStyleFunctionOrObject, IToggleStyleProps, IToggleStyles } from '@fluentui/react';\nimport { ControlBarButtonStyles } from './ControlBarButton';\nimport { OptionsDevice, generateDefaultDeviceMenuProps } from './DevicesButton';\nimport { Announcer } from './Announcer';\n\n/**\n * Strings of {@link MicrophoneButton} that can be overridden.\n *\n * @public\n */\nexport interface MicrophoneButtonStrings {\n /** Label when button is on. */\n onLabel: string;\n /** Label when button is off. */\n offLabel: string;\n /** * Tooltip content when the button is disabled. */\n tooltipDisabledContent?: string;\n /** Tooltip content when the button is on. */\n tooltipOnContent?: string;\n /** Tooltip content when the button is off. */\n tooltipOffContent?: string;\n /**\n * Title of microphone menu\n */\n microphoneMenuTitle?: string;\n /**\n * Title of speaker menu\n */\n speakerMenuTitle?: string;\n /**\n * Tooltip of microphone menu\n */\n microphoneMenuTooltip?: string;\n /**\n * Tooltip of speaker menu\n */\n speakerMenuTooltip?: string;\n /**\n * Description of microphone button split button role\n */\n microphoneButtonSplitRoleDescription?: string;\n /**\n * Microphone split button aria label when mic is enabled.\n */\n onSplitButtonAriaLabel?: string;\n /**\n * Microphone split button aria label when mic is disabled.\n */\n offSplitButtonAriaLabel?: string;\n /**\n * Microphone action turned on string for announcer\n */\n microphoneActionTurnedOnAnnouncement?: string;\n /**\n * Microphone action turned off string for announcer\n */\n microphoneActionTurnedOffAnnouncement?: string;\n /**\n * Primary action for the microphone when microphone is live.\n */\n onSplitButtonMicrophonePrimaryAction?: string;\n /**\n * Primary action for the microphone when the microphone is muted.\n */\n offSplitButtonMicrophonePrimaryAction?: string;\n /**\n * Title for primary action section of split button\n */\n microphonePrimaryActionSplitButtonTitle?: string;\n /**\n * Aria description for the microphone button\n */\n microphoneAriaDescription?: string;\n /* @conditional-compile-remove(DNS) */\n /**\n * Title when deep noise suppression is on\n */\n deepNoiseSuppresionOnTitle?: string;\n /* @conditional-compile-remove(DNS) */\n /**\n * Title when deep noise suppression is off\n */\n deepNoiseSuppresionOffTitle?: string;\n /* @conditional-compile-remove(DNS) */\n /**\n * Noise Suppression turned on string for announcer\n */\n deepNoiseSuppresionOnAnnouncement?: string;\n /* @conditional-compile-remove(DNS) */\n /**\n * Noise Suppression turned off string for announcer\n */\n deepNoiseSuppresionOffAnnouncement?: string;\n}\n\n/**\n * Styles for {@link MicrophoneButton}\n *\n * @public\n */\nexport interface MicrophoneButtonStyles extends ControlBarButtonStyles {\n /**\n * Styles for the {@link MicrophoneButton} menu.\n */\n menuStyles?: Partial<MicrophoneButtonContextualMenuStyles>;\n}\n\n/**\n * Styles for the {@link MicrophoneButton} menu.\n *\n * @public\n */\nexport interface MicrophoneButtonContextualMenuStyles extends IContextualMenuStyles {\n /**\n * Styles for the items inside the {@link MicrophoneButton} button menu.\n */\n menuItemStyles?: IContextualMenuItemStyles;\n}\n\n/**\n * Props for {@link MicrophoneButton}.\n *\n * @public\n */\nexport interface MicrophoneButtonProps extends ControlBarButtonProps {\n /**\n * Utility property for using this component with `communication react eventHandlers`.\n * Maps directly to the `onClick` property.\n */\n onToggleMicrophone?: () => Promise<void>;\n /**\n * Available microphones for selection\n */\n microphones?: OptionsDevice[];\n /**\n * Available speakers for selection\n */\n speakers?: OptionsDevice[];\n /**\n * Microphone that is shown as currently selected\n */\n selectedMicrophone?: OptionsDevice;\n /**\n * Speaker that is shown as currently selected\n */\n selectedSpeaker?: OptionsDevice;\n /**\n * Callback when a microphone is selected\n */\n onSelectMicrophone?: (device: OptionsDevice) => Promise<void>;\n /**\n * Speaker when a speaker is selected\n */\n onSelectSpeaker?: (device: OptionsDevice) => Promise<void>;\n /**\n * Whether to use a {@link SplitButton} with a {@link IContextualMenu} for device selection.\n *\n * default: false\n */\n enableDeviceSelectionMenu?: boolean;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<MicrophoneButtonStrings>;\n /**\n * Styles for {@link MicrophoneButton} and the device selection flyout.\n */\n styles?: Partial<MicrophoneButtonStyles>;\n /* @conditional-compile-remove(DNS) */\n /**\n * Whether the deep noise suppression is on or off\n */\n isDeepNoiseSuppressionOn?: boolean;\n /* @conditional-compile-remove(DNS) */\n /**\n * Callback when noise suppression is clicked\n */\n onClickNoiseSuppression?: () => void;\n /* @conditional-compile-remove(DNS) */\n /**\n * Show/Hide the deep noise suppression button\n */\n showNoiseSuppressionButton?: boolean;\n}\n\n/**\n * A button to turn microphone on / off.\n *\n * Can be used with {@link ControlBar}.\n *\n * @public\n */\nexport const MicrophoneButton = (props: MicrophoneButtonProps): JSX.Element => {\n const { onToggleMicrophone } = props;\n const localeStrings = useLocale().strings.microphoneButton;\n const strings = { ...localeStrings, ...props.strings };\n const [announcerString, setAnnouncerString] = useState<string | undefined>(undefined);\n\n const isSplit = props.split ?? props.enableDeviceSelectionMenu;\n\n // The button should be disabled when there are no mics. However if the button is a split button, if there are\n // no mics but there are speakers, then only the primary part of the button should be disabled to allow for\n // speaker change.\n const primaryDisabled = props.primaryDisabled || (isSplit && !props.microphones?.length ? true : undefined);\n const disabled =\n props.disabled ||\n (isSplit && !props.microphones?.length && !props.speakers?.length) ||\n (!isSplit && props.microphones && props.microphones?.length === 0);\n\n const onRenderMicOnIcon = (): JSX.Element => {\n return <_HighContrastAwareIcon disabled={disabled} iconName=\"ControlButtonMicOn\" />;\n };\n const onRenderMicOffIcon = (): JSX.Element => {\n return <_HighContrastAwareIcon disabled={disabled} iconName=\"ControlButtonMicOff\" />;\n };\n\n const isMicOn = props.checked;\n\n const splitButtonAriaString = isMicOn ? strings.onSplitButtonAriaLabel : strings.offSplitButtonAriaLabel;\n\n const toggleAnnouncerString = useCallback(\n (isMicOn: boolean) => {\n setAnnouncerString(\n !isMicOn ? strings.microphoneActionTurnedOffAnnouncement : strings.microphoneActionTurnedOnAnnouncement\n );\n },\n [strings.microphoneActionTurnedOffAnnouncement, strings.microphoneActionTurnedOnAnnouncement]\n );\n\n const onToggleClick = useCallback(async () => {\n if (onToggleMicrophone) {\n try {\n await onToggleMicrophone();\n // allows for the setting of narrator strings triggering the announcer when microphone is turned on or off.\n toggleAnnouncerString(!isMicOn);\n // eslint-disable-next-line no-empty\n } finally {\n }\n }\n }, [isMicOn, onToggleMicrophone, toggleAnnouncerString]);\n\n /* @conditional-compile-remove(DNS) */\n const deepNoiseSuppressionToggleStyles: IStyleFunctionOrObject<IToggleStyleProps, IToggleStyles> = {\n root: {\n margin: '4px',\n padding: '0px 12px',\n flexFlow: 'row-reverse',\n justifyContent: 'space-between'\n },\n label: { fontWeight: 400 }\n };\n\n const splitButtonMenuItems: IContextualMenuItem[] = [];\n\n splitButtonMenuItems.push({\n key: 'microphonePrimaryAction',\n text: props.checked ? strings.onSplitButtonMicrophonePrimaryAction : strings.offSplitButtonMicrophonePrimaryAction,\n onClick: () => {\n onToggleClick();\n },\n iconProps: {\n iconName: props.checked ? 'SplitButtonPrimaryActionMicUnmuted' : 'SplitButtonPrimaryActionMicMuted',\n styles: { root: { lineHeight: 0 } }\n }\n });\n\n /* @conditional-compile-remove(DNS) */\n if (props.showNoiseSuppressionButton) {\n splitButtonMenuItems.push({\n key: 'microphoneDNSToggle',\n onRender: () => {\n return (\n <Stack\n onClick={async () => {\n await props.onClickNoiseSuppression?.();\n setAnnouncerString(\n props.isDeepNoiseSuppressionOn\n ? strings.deepNoiseSuppresionOnAnnouncement\n : strings.deepNoiseSuppresionOffAnnouncement\n );\n }}\n >\n <Toggle\n label={\n props.isDeepNoiseSuppressionOn\n ? strings.deepNoiseSuppresionOnTitle\n : strings.deepNoiseSuppresionOffTitle\n }\n checked={props.isDeepNoiseSuppressionOn}\n inlineLabel\n styles={deepNoiseSuppressionToggleStyles}\n />\n </Stack>\n );\n }\n });\n }\n /**\n * We need to also include the primary action of the button to the\n * split button for mobile devices.\n */\n const splitButtonPrimaryAction: IContextualMenuItem = {\n key: 'primaryAction',\n title: 'toggle mic',\n itemType: ContextualMenuItemType.Section,\n sectionProps: {\n topDivider: true,\n items: splitButtonMenuItems\n }\n };\n\n return (\n <>\n <Announcer announcementString={announcerString} ariaLive={'polite'} />\n <ControlBarButton\n {...props}\n onClick={props.onToggleMicrophone ? onToggleClick : props.onClick}\n onRenderOnIcon={props.onRenderOnIcon ?? onRenderMicOnIcon}\n onRenderOffIcon={props.onRenderOffIcon ?? onRenderMicOffIcon}\n strings={strings}\n labelKey={props.labelKey ?? 'microphoneButtonLabel'}\n menuProps={\n props.menuProps ??\n (props.enableDeviceSelectionMenu\n ? generateDefaultDeviceMenuProps(\n { ...props, styles: props.styles?.menuStyles },\n strings,\n splitButtonPrimaryAction\n )\n : undefined)\n }\n menuIconProps={props.menuIconProps ?? !props.enableDeviceSelectionMenu ? { hidden: true } : undefined}\n split={props.split ?? props.enableDeviceSelectionMenu}\n aria-roledescription={\n props.enableDeviceSelectionMenu ? strings.microphoneButtonSplitRoleDescription : undefined\n }\n aria-description={strings.microphoneAriaDescription}\n splitButtonAriaLabel={props.enableDeviceSelectionMenu ? splitButtonAriaString : undefined}\n disabled={disabled}\n primaryDisabled={primaryDisabled}\n />\n </>\n );\n};\n"]}
1
+ {"version":3,"file":"MicrophoneButton.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/MicrophoneButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAyB,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EACL,sBAAsB,EAIvB,MAAM,iBAAiB,CAAC;AACzB,sCAAsC;AACtC,OAAO,EAAE,MAAM,EAAE,KAAK,EAA4D,MAAM,iBAAiB,CAAC;AAE1G,OAAO,EAAiB,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AA0LxC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBA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T,OAAO,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,EACjE,cAAc,EAAE,MAAA,KAAK,CAAC,cAAc,mCAAI,iBAAiB,EACzD,eAAe,EAAE,MAAA,KAAK,CAAC,eAAe,mCAAI,kBAAkB,EAC5D,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAA,KAAK,CAAC,QAAQ,mCAAI,uBAAuB,EACnD,SAAS,EACP,MAAA,KAAK,CAAC,SAAS,mCACf,CAAC,KAAK,CAAC,yBAAyB;gBAC9B,CAAC,CAAC,8BAA8B,iCACvB,KAAK,KAAE,MAAM,EAAE,MAAA,KAAK,CAAC,MAAM,0CAAE,UAAU,KAC5C,OAAO,EACP,wBAAwB,CACzB;gBACH,CAAC,CAAC,SAAS,CAAC,EAEhB,aAAa,EAAE,CAAA,MAAA,KAAK,CAAC,aAAa,mCAAI,CAAC,KAAK,CAAC,yBAAyB,EAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,EACrG,KAAK,EAAE,MAAA,KAAK,CAAC,KAAK,mCAAI,KAAK,CAAC,yBAAyB,0BAEnD,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAAC,OAAO,CAAC,oCAAoC,CAAC,CAAC,CAAC,SAAS,sBAE1E,OAAO,CAAC,yBAAyB,EACnD,oBAAoB,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,EACzF,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,IAChC,CACD,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useState, useCallback } from 'react';\nimport { useLocale } from '../localization';\nimport { ControlBarButton, ControlBarButtonProps } from './ControlBarButton';\nimport { _HighContrastAwareIcon } from './HighContrastAwareIcon';\n\nimport {\n ContextualMenuItemType,\n IContextualMenuItem,\n IContextualMenuItemStyles,\n IContextualMenuStyles\n} from '@fluentui/react';\n/* @conditional-compile-remove(DNS) */\nimport { Toggle, Stack, IStyleFunctionOrObject, IToggleStyleProps, IToggleStyles } from '@fluentui/react';\nimport { ControlBarButtonStyles } from './ControlBarButton';\nimport { OptionsDevice, generateDefaultDeviceMenuProps } from './DevicesButton';\nimport { Announcer } from './Announcer';\n\n/**\n * Strings of {@link MicrophoneButton} that can be overridden.\n *\n * @public\n */\nexport interface MicrophoneButtonStrings {\n /** Label when button is on. */\n onLabel: string;\n /** Label when button is off. */\n offLabel: string;\n /** * Tooltip content when the button is disabled. */\n tooltipDisabledContent?: string;\n /** Tooltip content when the button is on. */\n tooltipOnContent?: string;\n /** Tooltip content when the button is off. */\n tooltipOffContent?: string;\n /**\n * Title of microphone menu\n */\n microphoneMenuTitle?: string;\n /**\n * Title of speaker menu\n */\n speakerMenuTitle?: string;\n /**\n * Tooltip of microphone menu\n */\n microphoneMenuTooltip?: string;\n /**\n * Tooltip of speaker menu\n */\n speakerMenuTooltip?: string;\n /**\n * Description of microphone button split button role\n */\n microphoneButtonSplitRoleDescription?: string;\n /**\n * Microphone split button aria label when mic is enabled.\n */\n onSplitButtonAriaLabel?: string;\n /**\n * Microphone split button aria label when mic is disabled.\n */\n offSplitButtonAriaLabel?: string;\n /**\n * Microphone action turned on string for announcer\n */\n microphoneActionTurnedOnAnnouncement?: string;\n /**\n * Microphone action turned off string for announcer\n */\n microphoneActionTurnedOffAnnouncement?: string;\n /**\n * Primary action for the microphone when microphone is live.\n */\n onSplitButtonMicrophonePrimaryAction?: string;\n /**\n * Primary action for the microphone when the microphone is muted.\n */\n offSplitButtonMicrophonePrimaryAction?: string;\n /**\n * Title for primary action section of split button\n */\n microphonePrimaryActionSplitButtonTitle?: string;\n /**\n * Aria description for the microphone button\n */\n microphoneAriaDescription?: string;\n /* @conditional-compile-remove(DNS) */\n /**\n * Title for deep noise suppression button\n * @beta\n */\n deepNoiseSuppressionTitle?: string;\n /* @conditional-compile-remove(DNS) */\n /**\n * Noise Suppression turned on string for announcer\n * @beta\n */\n deepNoiseSuppressionOnAnnouncement?: string;\n /* @conditional-compile-remove(DNS) */\n /**\n * Noise Suppression turned off string for announcer\n * @beta\n */\n deepNoiseSuppressionOffAnnouncement?: string;\n}\n\n/**\n * Styles for {@link MicrophoneButton}\n *\n * @public\n */\nexport interface MicrophoneButtonStyles extends ControlBarButtonStyles {\n /**\n * Styles for the {@link MicrophoneButton} menu.\n */\n menuStyles?: Partial<MicrophoneButtonContextualMenuStyles>;\n}\n\n/**\n * Styles for the {@link MicrophoneButton} menu.\n *\n * @public\n */\nexport interface MicrophoneButtonContextualMenuStyles extends IContextualMenuStyles {\n /**\n * Styles for the items inside the {@link MicrophoneButton} button menu.\n */\n menuItemStyles?: IContextualMenuItemStyles;\n}\n\n/**\n * Props for {@link MicrophoneButton}.\n *\n * @public\n */\nexport interface MicrophoneButtonProps extends ControlBarButtonProps {\n /**\n * Utility property for using this component with `communication react eventHandlers`.\n * Maps directly to the `onClick` property.\n */\n onToggleMicrophone?: () => Promise<void>;\n /**\n * Available microphones for selection\n */\n microphones?: OptionsDevice[];\n /**\n * Available speakers for selection\n */\n speakers?: OptionsDevice[];\n /**\n * Microphone that is shown as currently selected\n */\n selectedMicrophone?: OptionsDevice;\n /**\n * Speaker that is shown as currently selected\n */\n selectedSpeaker?: OptionsDevice;\n /**\n * Callback when a microphone is selected\n */\n onSelectMicrophone?: (device: OptionsDevice) => Promise<void>;\n /**\n * Speaker when a speaker is selected\n */\n onSelectSpeaker?: (device: OptionsDevice) => Promise<void>;\n /**\n * Whether to use a {@link SplitButton} with a {@link IContextualMenu} for device selection.\n *\n * default: false\n */\n enableDeviceSelectionMenu?: boolean;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<MicrophoneButtonStrings>;\n /**\n * Styles for {@link MicrophoneButton} and the device selection flyout.\n */\n styles?: Partial<MicrophoneButtonStyles>;\n /* @conditional-compile-remove(DNS) */\n /**\n * Whether the deep noise suppression is on or off\n *\n * @beta\n */\n isDeepNoiseSuppressionOn?: boolean;\n /* @conditional-compile-remove(DNS) */\n /**\n * Callback when noise suppression is clicked\n *\n * @beta\n */\n onClickNoiseSuppression?: () => void;\n /* @conditional-compile-remove(DNS) */\n /**\n * Show/Hide the deep noise suppression button\n *\n * @beta\n */\n showNoiseSuppressionButton?: boolean;\n}\n\n/**\n * A button to turn microphone on / off.\n *\n * Can be used with {@link ControlBar}.\n *\n * @public\n */\nexport const MicrophoneButton = (props: MicrophoneButtonProps): JSX.Element => {\n const { onToggleMicrophone } = props;\n const localeStrings = useLocale().strings.microphoneButton;\n const strings = { ...localeStrings, ...props.strings };\n const [announcerString, setAnnouncerString] = useState<string | undefined>(undefined);\n\n const isSplit = props.split ?? props.enableDeviceSelectionMenu;\n\n // The button should be disabled when there are no mics. However if the button is a split button, if there are\n // no mics but there are speakers, then only the primary part of the button should be disabled to allow for\n // speaker change.\n const primaryDisabled = props.primaryDisabled || (isSplit && !props.microphones?.length ? true : undefined);\n const disabled =\n props.disabled ||\n (isSplit && !props.microphones?.length && !props.speakers?.length) ||\n (!isSplit && props.microphones && props.microphones?.length === 0);\n\n const onRenderMicOnIcon = (): JSX.Element => {\n return <_HighContrastAwareIcon disabled={disabled} iconName=\"ControlButtonMicOn\" />;\n };\n const onRenderMicOffIcon = (): JSX.Element => {\n return <_HighContrastAwareIcon disabled={disabled} iconName=\"ControlButtonMicOff\" />;\n };\n\n const isMicOn = props.checked;\n\n const splitButtonAriaString = isMicOn ? strings.onSplitButtonAriaLabel : strings.offSplitButtonAriaLabel;\n\n const toggleAnnouncerString = useCallback(\n (isMicOn: boolean) => {\n setAnnouncerString(\n !isMicOn ? strings.microphoneActionTurnedOffAnnouncement : strings.microphoneActionTurnedOnAnnouncement\n );\n },\n [strings.microphoneActionTurnedOffAnnouncement, strings.microphoneActionTurnedOnAnnouncement]\n );\n\n const onToggleClick = useCallback(async () => {\n if (onToggleMicrophone) {\n try {\n await onToggleMicrophone();\n // allows for the setting of narrator strings triggering the announcer when microphone is turned on or off.\n toggleAnnouncerString(!isMicOn);\n // eslint-disable-next-line no-empty\n } finally {\n }\n }\n }, [isMicOn, onToggleMicrophone, toggleAnnouncerString]);\n\n /* @conditional-compile-remove(DNS) */\n const deepNoiseSuppressionToggleStyles: IStyleFunctionOrObject<IToggleStyleProps, IToggleStyles> = {\n root: {\n margin: '4px',\n padding: '0px 12px',\n flexFlow: 'row-reverse',\n justifyContent: 'space-between'\n },\n label: { fontWeight: 400 }\n };\n\n const splitButtonMenuItems: IContextualMenuItem[] = [];\n\n /* @conditional-compile-remove(DNS) */\n if (props.showNoiseSuppressionButton) {\n splitButtonMenuItems.push({\n key: 'microphoneDNSToggle',\n onRender: () => {\n return (\n <Stack\n onClick={async () => {\n await props.onClickNoiseSuppression?.();\n setAnnouncerString(\n props.isDeepNoiseSuppressionOn\n ? strings.deepNoiseSuppressionOnAnnouncement\n : strings.deepNoiseSuppressionOffAnnouncement\n );\n }}\n >\n <Toggle\n label={strings.deepNoiseSuppressionTitle}\n checked={props.isDeepNoiseSuppressionOn}\n inlineLabel\n styles={deepNoiseSuppressionToggleStyles}\n />\n </Stack>\n );\n }\n });\n }\n\n splitButtonMenuItems.push({\n key: 'microphonePrimaryAction',\n text: props.checked ? strings.onSplitButtonMicrophonePrimaryAction : strings.offSplitButtonMicrophonePrimaryAction,\n onClick: () => {\n onToggleClick();\n },\n iconProps: {\n iconName: props.checked ? 'SplitButtonPrimaryActionMicUnmuted' : 'SplitButtonPrimaryActionMicMuted',\n styles: { root: { lineHeight: 0 } }\n }\n });\n\n /**\n * We need to also include the primary action of the button to the\n * split button for mobile devices.\n */\n const splitButtonPrimaryAction: IContextualMenuItem = {\n key: 'primaryAction',\n title: 'toggle mic',\n itemType: ContextualMenuItemType.Section,\n sectionProps: {\n topDivider: true,\n items: splitButtonMenuItems\n }\n };\n\n return (\n <>\n <Announcer announcementString={announcerString} ariaLive={'polite'} />\n <ControlBarButton\n {...props}\n onClick={props.onToggleMicrophone ? onToggleClick : props.onClick}\n onRenderOnIcon={props.onRenderOnIcon ?? onRenderMicOnIcon}\n onRenderOffIcon={props.onRenderOffIcon ?? onRenderMicOffIcon}\n strings={strings}\n labelKey={props.labelKey ?? 'microphoneButtonLabel'}\n menuProps={\n props.menuProps ??\n (props.enableDeviceSelectionMenu\n ? generateDefaultDeviceMenuProps(\n { ...props, styles: props.styles?.menuStyles },\n strings,\n splitButtonPrimaryAction\n )\n : undefined)\n }\n menuIconProps={props.menuIconProps ?? !props.enableDeviceSelectionMenu ? { hidden: true } : undefined}\n split={props.split ?? props.enableDeviceSelectionMenu}\n aria-roledescription={\n props.enableDeviceSelectionMenu ? strings.microphoneButtonSplitRoleDescription : undefined\n }\n aria-description={strings.microphoneAriaDescription}\n splitButtonAriaLabel={props.enableDeviceSelectionMenu ? splitButtonAriaString : undefined}\n disabled={disabled}\n primaryDisabled={primaryDisabled}\n />\n </>\n );\n};\n"]}
@@ -87,6 +87,13 @@ export const primaryButtonStyles = {
87
87
  paddingBottom: '1.5rem',
88
88
  borderRadius: '0.5rem',
89
89
  marginBottom: _pxToRem(22)
90
+ },
91
+ flexContainer: {
92
+ position: 'absolute',
93
+ left: '1rem',
94
+ right: '1rem',
95
+ top: '0',
96
+ bottom: '0'
90
97
  }
91
98
  };
92
99
  //# sourceMappingURL=SitePermissions.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SitePermissions.styles.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/SitePermissions.styles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,QAAQ,EAAE,sCAAgC;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAiB;IAC/C,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,MAAM;QACpB,QAAQ,EAAE,UAAU;KACrB;CACF,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a,EAAE,QAAQ;QACvB,YAAY,EAAE,QAAQ;QACtB,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;KAC3B;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IButtonStyles, IIconStyles, ILinkStyles, IStackStyles, ITextStyles, Theme } from '@fluentui/react';\nimport { _pxToRem } from '@internal/acs-ui-common';\n\n/**\n * @internal\n */\nexport const iconContainerStyles: IStackStyles = {\n root: {\n marginTop: 'auto',\n marginBottom: 'auto',\n position: 'relative'\n }\n};\n\n/**\n * @internal\n */\nexport const iconBannerContainerStyles: IStackStyles = {\n root: {\n paddingBottom: '1rem'\n }\n};\n\n/**\n * @internal\n */\nexport const textContainerStyles: IStackStyles = {\n root: {\n margin: 'auto',\n textAlign: 'center'\n }\n};\n\n/**\n * @internal\n */\nexport const iconPrimaryStyles: IIconStyles = {\n root: {\n zIndex: 1,\n margin: 'auto'\n }\n};\n\n/**\n * @internal\n */\nexport const sparkleIconBackdropStyles = (theme: Theme): IIconStyles => {\n return {\n root: {\n color: theme.palette.themeLighterAlt\n }\n };\n};\n\n/**\n * @internal\n */\nexport const primaryTextStyles: ITextStyles = {\n root: {\n fontWeight: 600,\n fontSize: _pxToRem(20),\n lineHeight: _pxToRem(28),\n paddingBottom: '1rem'\n }\n};\n\n/**\n * @internal\n */\nexport const secondaryTextStyles: ITextStyles = {\n root: {\n margin: 'auto',\n fontWeight: 400,\n paddingBottom: _pxToRem(22)\n }\n};\n\n/**\n * @internal\n */\nexport const linkTextStyles: ILinkStyles = {\n root: {\n margin: 'auto',\n fontWeight: 600,\n textAlign: 'inherit'\n }\n};\n\n/**\n * @internal\n */\nexport const primaryButtonStyles: IButtonStyles = {\n root: {\n paddingTop: '1.5rem',\n paddingBottom: '1.5rem',\n borderRadius: '0.5rem',\n marginBottom: _pxToRem(22)\n }\n};\n"]}
1
+ {"version":3,"file":"SitePermissions.styles.js","sourceRoot":"","sources":["../../../../../../../react-components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,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgB;IACzC,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,GAAG;QACf,SAAS,EAAE,SAAS;KACrB;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAkB;IAChD,IAAI,EAAE;QACJ,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE,QAAQ;QACvB,YAAY,EAAE,QAAQ;QACtB,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;KAC3B;IACD,aAAa,EAAE;QACb,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,MAAM;QACb,GAAG,EAAE,GAAG;QACR,MAAM,EAAE,GAAG;KACZ;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IButtonStyles, IIconStyles, ILinkStyles, IStackStyles, ITextStyles, Theme } from '@fluentui/react';\nimport { _pxToRem } from '@internal/acs-ui-common';\n\n/**\n * @internal\n */\nexport const iconContainerStyles: IStackStyles = {\n root: {\n marginTop: 'auto',\n marginBottom: 'auto',\n position: 'relative'\n }\n};\n\n/**\n * @internal\n */\nexport const iconBannerContainerStyles: IStackStyles = {\n root: {\n paddingBottom: '1rem'\n }\n};\n\n/**\n * @internal\n */\nexport const textContainerStyles: IStackStyles = {\n root: {\n margin: 'auto',\n textAlign: 'center'\n }\n};\n\n/**\n * @internal\n */\nexport const iconPrimaryStyles: IIconStyles = {\n root: {\n zIndex: 1,\n margin: 'auto'\n }\n};\n\n/**\n * @internal\n */\nexport const sparkleIconBackdropStyles = (theme: Theme): IIconStyles => {\n return {\n root: {\n color: theme.palette.themeLighterAlt\n }\n };\n};\n\n/**\n * @internal\n */\nexport const primaryTextStyles: ITextStyles = {\n root: {\n fontWeight: 600,\n fontSize: _pxToRem(20),\n lineHeight: _pxToRem(28),\n paddingBottom: '1rem'\n }\n};\n\n/**\n * @internal\n */\nexport const secondaryTextStyles: ITextStyles = {\n root: {\n margin: 'auto',\n fontWeight: 400,\n paddingBottom: _pxToRem(22)\n }\n};\n\n/**\n * @internal\n */\nexport const linkTextStyles: ILinkStyles = {\n root: {\n margin: 'auto',\n fontWeight: 600,\n textAlign: 'inherit'\n }\n};\n\n/**\n * @internal\n */\nexport const primaryButtonStyles: IButtonStyles = {\n root: {\n paddingTop: '1.5rem',\n paddingBottom: '1.5rem',\n borderRadius: '0.5rem',\n marginBottom: _pxToRem(22)\n },\n flexContainer: {\n position: 'absolute',\n left: '1rem',\n right: '1rem',\n top: '0',\n bottom: '0'\n }\n};\n"]}
@@ -60,7 +60,9 @@ export const continueAnywayButtonStyles = (theme) => {
60
60
  backgroundColor: '#C4314B',
61
61
  borderColor: theme.palette.neutralLight,
62
62
  color: theme.palette.white,
63
- padding: '1rem'
63
+ padding: '1rem',
64
+ // copy value previously set in FluentUI
65
+ height: '32px'
64
66
  }
65
67
  };
66
68
  };
@@ -1 +1 @@
1
- {"version":3,"file":"UnsupportedEnvironment.styles.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/UnsupportedEnvironment.styles.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,QAAQ,EAAE,sCAAgC;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgB;IACzC,IAAI,EAAE;QACJ,UAAU,EAAE,GAAG;QACf,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC;QACtB,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC;QACxB,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,QAAQ;QACnB,OAAO,EAAE,QAAQ;KAClB;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAgB;IAC9C,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,GAAG;QACf,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAiB;IAC/C,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM;KACf;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgB;IACzC,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,GAAG;QACf,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAiB;IAC3C,IAAI,EAAE;QACJ,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC;QACvB,OAAO,EAAE,MAAM;KAChB;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,KAAY,EAAiB,EAAE;IACxE,OAAO;QACL,IAAI,EAAE;YACJ,eAAe,EAAE,SAAS;YAC1B,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY;YACvC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;YAC1B,OAAO,EAAE,MAAM;SAChB;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IButtonStyles, ILinkStyles, IStackStyles, ITextStyles, Theme } from '@fluentui/react';\nimport { _pxToRem } from '@internal/acs-ui-common';\n\n/**\n * @internal\n */\nexport const mainTextStyles: ITextStyles = {\n root: {\n fontWeight: 600,\n fontSize: _pxToRem(20),\n lineHeight: _pxToRem(28),\n margin: 'auto',\n textAlign: 'center',\n padding: '0.5rem'\n }\n};\n\n/**\n * @internal\n */\nexport const secondaryTextStyles: ITextStyles = {\n root: {\n margin: 'auto',\n fontWeight: 400,\n textAlign: 'center'\n }\n};\n\n/**\n * @internal\n */\nexport const testContainerStyles: IStackStyles = {\n root: {\n margin: 'auto'\n }\n};\n\n/**\n * @internal\n */\nexport const linkTextStyles: ILinkStyles = {\n root: {\n margin: 'auto',\n fontWeight: 600,\n textAlign: 'center'\n }\n};\n\n/**\n * @internal\n */\nexport const containerStyles: IStackStyles = {\n root: {\n maxWidth: _pxToRem(375),\n padding: '2rem'\n }\n};\n\n/**\n * @internal\n */\nexport const continueAnywayButtonStyles = (theme: Theme): IButtonStyles => {\n return {\n root: {\n backgroundColor: '#C4314B',\n borderColor: theme.palette.neutralLight,\n color: theme.palette.white,\n padding: '1rem'\n }\n };\n};\n"]}
1
+ {"version":3,"file":"UnsupportedEnvironment.styles.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/UnsupportedEnvironment.styles.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,QAAQ,EAAE,sCAAgC;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgB;IACzC,IAAI,EAAE;QACJ,UAAU,EAAE,GAAG;QACf,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC;QACtB,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC;QACxB,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,QAAQ;QACnB,OAAO,EAAE,QAAQ;KAClB;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAgB;IAC9C,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,GAAG;QACf,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAiB;IAC/C,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM;KACf;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgB;IACzC,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,GAAG;QACf,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAiB;IAC3C,IAAI,EAAE;QACJ,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC;QACvB,OAAO,EAAE,MAAM;KAChB;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,KAAY,EAAiB,EAAE;IACxE,OAAO;QACL,IAAI,EAAE;YACJ,eAAe,EAAE,SAAS;YAC1B,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY;YACvC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;YAC1B,OAAO,EAAE,MAAM;YACf,wCAAwC;YACxC,MAAM,EAAE,MAAM;SACf;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IButtonStyles, ILinkStyles, IStackStyles, ITextStyles, Theme } from '@fluentui/react';\nimport { _pxToRem } from '@internal/acs-ui-common';\n\n/**\n * @internal\n */\nexport const mainTextStyles: ITextStyles = {\n root: {\n fontWeight: 600,\n fontSize: _pxToRem(20),\n lineHeight: _pxToRem(28),\n margin: 'auto',\n textAlign: 'center',\n padding: '0.5rem'\n }\n};\n\n/**\n * @internal\n */\nexport const secondaryTextStyles: ITextStyles = {\n root: {\n margin: 'auto',\n fontWeight: 400,\n textAlign: 'center'\n }\n};\n\n/**\n * @internal\n */\nexport const testContainerStyles: IStackStyles = {\n root: {\n margin: 'auto'\n }\n};\n\n/**\n * @internal\n */\nexport const linkTextStyles: ILinkStyles = {\n root: {\n margin: 'auto',\n fontWeight: 600,\n textAlign: 'center'\n }\n};\n\n/**\n * @internal\n */\nexport const containerStyles: IStackStyles = {\n root: {\n maxWidth: _pxToRem(375),\n padding: '2rem'\n }\n};\n\n/**\n * @internal\n */\nexport const continueAnywayButtonStyles = (theme: Theme): IButtonStyles => {\n return {\n root: {\n backgroundColor: '#C4314B',\n borderColor: theme.palette.neutralLight,\n color: theme.palette.white,\n padding: '1rem',\n // copy value previously set in FluentUI\n height: '32px'\n }\n };\n};\n"]}
@@ -128,10 +128,9 @@
128
128
  "onSplitButtonMicrophonePrimaryAction": "Mute mic",
129
129
  "microphonePrimaryActionSplitButtonTitle": "Use microphone",
130
130
  "microphoneAriaDescription": "Audio options",
131
- "deepNoiseSuppresionOnTitle": "Noise Suppression On",
132
- "deepNoiseSuppresionOffTitle": "Noise Suppression Off",
133
- "deepNoiseSuppresionOnAnnouncement": "Deep noise suppression has been turned on",
134
- "deepNoiseSuppresionOffAnnouncement": "Deep noise suppression has been turned off"
131
+ "deepNoiseSuppressionTitle": "Noise suppression",
132
+ "deepNoiseSuppressionOnAnnouncement": "Deep noise suppression has been turned on",
133
+ "deepNoiseSuppressionOffAnnouncement": "Deep noise suppression has been turned off"
135
134
  },
136
135
  "devicesButton": {
137
136
  "label": "Devices",
@@ -58,7 +58,7 @@ class CallContext {
58
58
  /* @conditional-compile-remove(DNS) */
59
59
  onResolveDeepNoiseSuppressionDependency: (_d = options === null || options === void 0 ? void 0 : options.deepNoiseSuppressionOptions) === null || _d === void 0 ? void 0 : _d.onResolveDependency,
60
60
  /* @conditional-compile-remove(DNS) */
61
- deepNoiseSuppressionOnByDefault: (_f = (_e = options === null || options === void 0 ? void 0 : options.deepNoiseSuppressionOptions) === null || _e === void 0 ? void 0 : _e.deepNoiseSuppressionOnByDefault) !== null && _f !== void 0 ? _f : false,
61
+ deepNoiseSuppressionOnByDefault: (_f = (_e = options === null || options === void 0 ? void 0 : options.deepNoiseSuppressionOptions) === null || _e === void 0 ? void 0 : _e.deepNoiseSuppressionOnByDefault) !== null && _f !== void 0 ? _f : true,
62
62
  /* @conditional-compile-remove(DNS) */
63
63
  hideNoiseSuppressionButton: (_h = (_g = options === null || options === void 0 ? void 0 : options.deepNoiseSuppressionOptions) === null || _g === void 0 ? void 0 : _g.hideNoiseSuppressionButton) !== null && _h !== void 0 ? _h : false,
64
64
  selectedVideoBackgroundEffect: undefined,