@azure/communication-react 1.23.0-alpha-202412270016 → 1.23.0-alpha-202501010018
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/communication-react.d.ts +161 -76
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CCXnpoKF.js → ChatMessageComponentAsRichTextEditBox-C-il3-6g.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CCXnpoKF.js.map → ChatMessageComponentAsRichTextEditBox-C-il3-6g.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-6PxjjqPz.js → RichTextSendBoxWrapper-C9huyOrM.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-6PxjjqPz.js.map → RichTextSendBoxWrapper-C9huyOrM.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-CusJUNf0.js → index-CoXZD7Ml.js} +299 -211
- package/dist/dist-cjs/communication-react/index-CoXZD7Ml.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +3 -3
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.d.ts +4 -4
- package/dist/dist-esm/communication-react/src/index.js +3 -3
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/CameraButton.js +3 -2
- package/dist/dist-esm/react-components/src/components/CameraButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.d.ts +40 -0
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +52 -4
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MicrophoneButton.js +3 -2
- package/dist/dist-esm/react-components/src/components/MicrophoneButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RTTDisclosureBanner.d.ts +7 -7
- package/dist/dist-esm/react-components/src/components/RTTDisclosureBanner.js +12 -11
- package/dist/dist-esm/react-components/src/components/RTTDisclosureBanner.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RealTimeText.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/RealTimeText.js +1 -1
- package/dist/dist-esm/react-components/src/components/RealTimeText.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RealTimeTextModal.d.ts +39 -0
- package/dist/dist-esm/react-components/src/components/{RTTModal.js → RealTimeTextModal.js} +15 -15
- package/dist/dist-esm/react-components/src/components/RealTimeTextModal.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/StartRealTimeTextButton.d.ts +47 -0
- package/dist/dist-esm/react-components/src/components/StartRealTimeTextButton.js +30 -0
- package/dist/dist-esm/react-components/src/components/StartRealTimeTextButton.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/index.d.ts +2 -1
- package/dist/dist-esm/react-components/src/components/index.js +3 -1
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/RTTDisclosureBanner.styles.d.ts +5 -1
- package/dist/dist-esm/react-components/src/components/styles/RTTDisclosureBanner.styles.js +10 -0
- package/dist/dist-esm/react-components/src/components/styles/RTTDisclosureBanner.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +7 -7
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +17 -14
- package/dist/dist-esm/react-components/src/theming/icons.d.ts +1 -1
- package/dist/dist-esm/react-components/src/theming/icons.js +3 -3
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +24 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingCaptionsBanner.js +9 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingCaptionsBanner.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +6 -0
- package/package.json +1 -1
- package/dist/dist-cjs/communication-react/index-CusJUNf0.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RTTModal.d.ts +0 -39
- package/dist/dist-esm/react-components/src/components/RTTModal.js.map +0 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var index = require('./index-
|
3
|
+
var index = require('./index-CoXZD7Ml.js');
|
4
4
|
require('react');
|
5
5
|
require('@fluentui/react');
|
6
6
|
require('@fluentui/react-components');
|
@@ -121,15 +121,15 @@ exports.NotificationStack = index.NotificationStack;
|
|
121
121
|
exports.ParticipantItem = index.ParticipantItem;
|
122
122
|
exports.ParticipantList = index.ParticipantList;
|
123
123
|
exports.ParticipantsButton = index.ParticipantsButton;
|
124
|
-
exports.RTTDisclosureBanner = index.RTTDisclosureBanner;
|
125
|
-
exports.RTTModal = index.RTTModal;
|
126
124
|
exports.RaiseHandButton = index.RaiseHandButton;
|
127
125
|
exports.ReactionButton = index.ReactionButton;
|
128
126
|
exports.RealTimeText = index.RealTimeText;
|
127
|
+
exports.RealTimeTextModal = index.RealTimeTextModal;
|
129
128
|
exports.RichTextSendBox = index.RichTextSendBox;
|
130
129
|
exports.ScreenShareButton = index.ScreenShareButton;
|
131
130
|
exports.SendBox = index.SendBox;
|
132
131
|
exports.StartCaptionsButton = index.StartCaptionsButton;
|
132
|
+
exports.StartRealTimeTextButton = index.StartRealTimeTextButton;
|
133
133
|
exports.StreamMedia = index.StreamMedia;
|
134
134
|
exports.TypingIndicator = index.TypingIndicator;
|
135
135
|
exports.UnsupportedBrowser = index.UnsupportedBrowser;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.23.0-alpha-
|
1
|
+
{"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.23.0-alpha-202501010018';\n"]}
|
@@ -95,12 +95,12 @@ export type { CallSurveyImprovementSuggestions } from '../../react-components/sr
|
|
95
95
|
export { NotificationStack, Notification } from '../../react-components/src';
|
96
96
|
export type { NotificationStackProps, NotificationProps, NotificationStrings, NotificationStackStrings, NotificationType, ActiveNotification, NotificationStyles } from '../../react-components/src';
|
97
97
|
export type { MeetingConferencePhoneInfoModalStrings } from '../../react-components/src';
|
98
|
-
export type {
|
99
|
-
export {
|
100
|
-
export type { RTTDisclosureBannerProps, RTTDisclosureBannerStrings } from '../../react-components/src';
|
101
|
-
export { RTTDisclosureBanner } from '../../react-components/src';
|
98
|
+
export type { RealTimeTextModalStrings, RealTimeTextModalProps } from '../../react-components/src';
|
99
|
+
export { RealTimeTextModal } from '../../react-components/src';
|
102
100
|
export type { RealTimeTextProps, RealTimeTextStrings } from '../../react-components/src/components/RealTimeText';
|
103
101
|
export { RealTimeText } from '../../react-components/src/components/RealTimeText';
|
102
|
+
export { StartRealTimeTextButton } from '../../react-components/src/components/StartRealTimeTextButton';
|
103
|
+
export type { StartRealTimeTextButtonProps, StartRealTimeTextButtonStrings } from '../../react-components/src/components/StartRealTimeTextButton';
|
104
104
|
export type { MediaAccess } from '../../react-components/src';
|
105
105
|
export type { CaptionsSettingsModalStrings, CaptionsSettingsModalProps } from '../../react-components/src';
|
106
106
|
export { CaptionsSettingsModal } from '../../react-components/src';
|
@@ -47,11 +47,11 @@ export { UnsupportedBrowserVersion } from '../../react-components/src';
|
|
47
47
|
export { UnsupportedOperatingSystem } from '../../react-components/src';
|
48
48
|
export { NotificationStack, Notification } from '../../react-components/src';
|
49
49
|
/* @conditional-compile-remove(rtt) */
|
50
|
-
export {
|
51
|
-
/* @conditional-compile-remove(rtt) */
|
52
|
-
export { RTTDisclosureBanner } from '../../react-components/src';
|
50
|
+
export { RealTimeTextModal } from '../../react-components/src';
|
53
51
|
/* @conditional-compile-remove(rtt) */
|
54
52
|
export { RealTimeText } from '../../react-components/src/components/RealTimeText';
|
53
|
+
/* @conditional-compile-remove(rtt) */
|
54
|
+
export { StartRealTimeTextButton } from '../../react-components/src/components/StartRealTimeTextButton';
|
55
55
|
export { CaptionsSettingsModal } from '../../react-components/src';
|
56
56
|
export { CaptionsBanner } from '../../react-components/src/components/CaptionsBanner';
|
57
57
|
export { StartCaptionsButton } from '../../react-components/src/components/StartCaptionsButton';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAwCzG,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,iCAAiC,EAClC,MAAM,sCAAsC,CAAC;AA0B9C,OAAO,EACL,kBAAkB,EAClB,wB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2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAiBzE,cAAc,iDAAiD,CAAC;AAChE,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAE/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAiB1E,cAAc,yCAAyC,CAAC;AACxD,cAAc,eAAe,CAAC;AAE9B,sDAAsD;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGhE,sDAAsD;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAGvE,sDAAsD;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAiBxE,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAc7E,sCAAsC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAItD,sCAAsC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGjE,sCAAsC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAC;AAIlF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAOnE,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,2DAA2D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * `@azure/communication-react` is an npm package that exports the functionality of the Azure Communication Services - UI Library.\n *\n * This package makes it easy for you to build modern communications user experiences using Azure Communication Services. It gives you a library of production-ready UI components that you can drop into your applications:\n * - Composites: These components are turn-key solutions that implement common communication scenarios. You can quickly add video calling or chat experiences to your applications. Composites are open-source higher order components built using UI components.\n * - UI Components - These components are open-source building blocks that let you build custom communications experience. Components are offered for both calling and chat capabilities that can be combined to build experiences.\n *\n * These UI client libraries all use Microsoft's Fluent design language and assets. Fluent UI provides a foundational layer for the UI Library and is actively used across Microsoft products.\n *\n * In conjunction with the UI components, the UI Library exposes a stateful client library for calling and chat. This client is agnostic to any specific state management framework and can be integrated with common state managers like Redux or React Context.\n * This stateful client library can be used with the UI Components to pass props and methods for the UI Components to render data. For more information, see Stateful Client Overview.\n *\n * For more information visit: https://aka.ms/acsstorybook\n *\n * @packageDocumentation\n */\n\nexport { fromFlatCommunicationIdentifier, toFlatCommunicationIdentifier } from '../../acs-ui-common/src';\nexport type {\n AreEqual,\n CommonProperties,\n MessageStatus,\n Common,\n AreTypeEqual,\n AreParamEqual\n} from '../../acs-ui-common/src';\n\n// Not to export chat/calling specific hook from binding package\nexport type {\n CallClientProviderProps,\n CallAgentProviderProps,\n CallProviderProps,\n GetCallingSelector,\n CallingHandlers,\n CallingBaseSelectorProps,\n CommonCallingHandlers\n} from '../../calling-component-bindings/src';\n\nexport type {\n DeepNoiseSuppressionEffectDependency,\n VideoBackgroundEffectsDependency,\n CallingHandlersOptions\n} from '../../calling-component-bindings/src';\n\nexport type {\n ChatClientProviderProps,\n ChatThreadClientProviderProps,\n GetChatSelector,\n ChatHandlers,\n ChatBaseSelectorProps\n} from '../../chat-component-bindings/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { MessageOptions, ChatMessageType } from '../../acs-ui-common/src';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nexport type { UploadChatImageResult } from '../../acs-ui-common/src';\n\nexport {\n CallClientProvider,\n CallAgentProvider,\n CallProvider,\n useCallClient,\n useCallAgent,\n useCall,\n useDeviceManager,\n getCallingSelector,\n createDefaultCallingHandlers\n} from '../../calling-component-bindings/src';\n\nexport {\n useTeamsCallAgent,\n useTeamsCall,\n createDefaultTeamsCallingHandlers\n} from '../../calling-component-bindings/src';\n\nexport type { TeamsCallingHandlers } from '../../calling-component-bindings/src';\n\nexport type {\n ScreenShareButtonSelector,\n CameraButtonSelector,\n VideoGallerySelector,\n DevicesButtonSelector,\n EmptySelector,\n ErrorBarSelector as CallErrorBarSelector,\n ParticipantListSelector,\n MicrophoneButtonSelector,\n ParticipantsButtonSelector,\n CreateDefaultCallingHandlers,\n CaptionSettingsSelector,\n CaptionsBannerSelector,\n StartCaptionsButtonSelector\n} from '../../calling-component-bindings/src';\nexport type { HoldButtonSelector } from '../../calling-component-bindings/src';\n\nexport type { RaiseHandButtonSelector } from '../../calling-component-bindings/src';\n\nexport type { NotificationStackSelector } from '../../calling-component-bindings/src';\nexport type { IncomingCallStackSelector } from '../../calling-component-bindings/src';\n\nexport {\n ChatClientProvider,\n ChatThreadClientProvider,\n useChatClient,\n useChatThreadClient,\n getChatSelector,\n createDefaultChatHandlers\n} from '../../chat-component-bindings/src';\n\nexport type {\n MessageThreadSelector,\n TypingIndicatorSelector,\n ChatParticipantListSelector,\n SendBoxSelector,\n ErrorBarSelector as ChatErrorBarSelector\n} from '../../chat-component-bindings/src';\n\nexport {\n _IdentifierProvider,\n CameraButton,\n ControlBar,\n ControlBarButton,\n DevicesButton,\n EndCallButton,\n ErrorBar,\n GridLayout,\n LocalizationProvider,\n MessageStatusIndicator,\n MessageThread,\n MicrophoneButton,\n ParticipantItem,\n ParticipantList,\n ParticipantsButton,\n ScreenShareButton,\n SendBox,\n StreamMedia,\n TypingIndicator,\n VideoGallery,\n VideoTile,\n COMPONENT_LOCALE_EN_GB,\n COMPONENT_LOCALE_AR_SA,\n COMPONENT_LOCALE_CS_CZ,\n COMPONENT_LOCALE_CY_GB,\n COMPONENT_LOCALE_DE_DE,\n COMPONENT_LOCALE_ES_ES,\n COMPONENT_LOCALE_ES_MX,\n COMPONENT_LOCALE_FI_FI,\n COMPONENT_LOCALE_FR_FR,\n COMPONENT_LOCALE_FR_CA,\n COMPONENT_LOCALE_HE_IL,\n COMPONENT_LOCALE_IT_IT,\n COMPONENT_LOCALE_JA_JP,\n COMPONENT_LOCALE_KO_KR,\n COMPONENT_LOCALE_NB_NO,\n COMPONENT_LOCALE_NL_NL,\n COMPONENT_LOCALE_PL_PL,\n COMPONENT_LOCALE_PT_BR,\n COMPONENT_LOCALE_RU_RU,\n COMPONENT_LOCALE_SV_SE,\n COMPONENT_LOCALE_TR_TR,\n COMPONENT_LOCALE_ZH_CN,\n COMPONENT_LOCALE_ZH_TW\n} from '../../react-components/src';\nexport { ImageOverlay } from '../../react-components/src';\nexport { HoldButton } from '../../react-components/src';\n\nexport { RaiseHandButton } from '../../react-components/src';\n\nexport { Dialpad } from '../../react-components/src';\n\nexport { IncomingCallNotification, IncomingCallStack } from '../../react-components/src';\nexport type {\n IncomingCallNotificationProps,\n IncomingCallNotificationStrings,\n IncomingCallNotificationStyles,\n IncomingCallStackProps,\n IncomingCallStackCall\n} from '../../react-components/src';\n\n/* @conditional-compile-remove(call-readiness) */\nexport {\n CameraAndMicrophoneSitePermissions,\n MicrophoneSitePermissions,\n CameraSitePermissions\n} from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n CameraAndMicrophoneSitePermissionsStrings,\n CameraAndMicrophoneSitePermissionsProps,\n CameraSitePermissionsStrings,\n CameraSitePermissionsProps,\n CommonSitePermissionsProps,\n SitePermissionsStrings,\n SitePermissionsStyles,\n MicrophoneSitePermissionsStrings,\n MicrophoneSitePermissionsProps\n} from '../../react-components/src';\n\n/* @conditional-compile-remove(total-participant-count) */\nexport type { ParticipantListStrings } from '../../react-components/src';\n\n/* @conditional-compile-remove(mention) */\nexport type {\n MentionOptions,\n MentionDisplayOptions,\n MentionLookupOptions,\n Mention,\n MentionPopoverStrings\n} from '../../react-components/src';\n\nexport type {\n _IdentifierProviderProps,\n _Identifiers,\n ActiveErrorMessage,\n BaseCustomStyles,\n CallParticipantListParticipant,\n CameraButtonContextualMenuStyles,\n CameraButtonProps,\n CameraButtonStrings,\n CameraButtonStyles,\n ChatMessage,\n CommunicationParticipant,\n ComponentLocale,\n ComponentSlotStyle,\n ComponentStrings,\n ContentSystemMessage,\n ControlBarButtonProps,\n ControlBarButtonStrings,\n ControlBarButtonStyles,\n ControlBarLayout,\n ControlBarProps,\n CreateVideoStreamViewResult,\n CustomAvatarOptions,\n CustomMessage,\n DevicesButtonContextualMenuStyles,\n DevicesButtonProps,\n DevicesButtonStrings,\n DevicesButtonStyles,\n EndCallButtonProps,\n EndCallButtonStrings,\n ErrorBarProps,\n ErrorBarStrings,\n ErrorType,\n GridLayoutProps,\n GridLayoutStyles,\n HorizontalGalleryStyles,\n JumpToNewMessageButtonProps,\n LocalizationProviderProps,\n LocalVideoCameraCycleButtonProps,\n LoadingState,\n Message,\n MessageAttachedStatus,\n MessageCommon,\n MessageContentType,\n MessageProps,\n MessageRenderer,\n MessageStatusIndicatorProps,\n MessageStatusIndicatorStrings,\n MessageThreadProps,\n MessageThreadStrings,\n MessageThreadStyles,\n MicrophoneButtonContextualMenuStyles,\n MicrophoneButtonProps,\n MicrophoneButtonStrings,\n MicrophoneButtonStyles,\n OnRenderAvatarCallback,\n OptionsDevice,\n ParticipantAddedSystemMessage,\n ParticipantItemProps,\n ParticipantItemStrings,\n ParticipantItemStyles,\n ParticipantListItemStyles,\n ParticipantListParticipant,\n ParticipantListProps,\n ParticipantListStyles,\n ParticipantMenuItemsCallback,\n ParticipantRemovedSystemMessage,\n ParticipantState,\n ParticipantsButtonContextualMenuStyles,\n ParticipantsButtonProps,\n ParticipantsButtonStrings,\n ParticipantsButtonStyles,\n ReadReceiptsBySenderId,\n ScreenShareButtonProps,\n ScreenShareButtonStrings,\n SendBoxProps,\n SendBoxStrings,\n SendBoxStylesProps,\n StreamMediaProps,\n SystemMessage,\n SystemMessageCommon,\n TopicUpdatedSystemMessage,\n TypingIndicatorProps,\n TypingIndicatorStrings,\n TypingIndicatorStylesProps,\n UpdateMessageCallback,\n CancelEditCallback,\n VideoGalleryLayout,\n VideoGalleryLocalParticipant,\n VideoGalleryParticipant,\n VideoGalleryProps,\n VideoGalleryRemoteParticipant,\n VideoGalleryStream,\n VideoGalleryStrings,\n VideoGalleryStyles,\n VideoStreamOptions,\n VideoTileProps,\n VideoTileStylesProps,\n ViewScalingMode,\n VideoTileContextualMenuProps,\n VideoTileDrawerMenuProps,\n VideoTilesOptions\n} from '../../react-components/src';\n\n/* @conditional-compile-remove(together-mode) */\nexport type {\n TogetherModeStreamViewResult,\n VideoGalleryTogetherModeStreams,\n VideoGalleryTogetherModeParticipantPosition,\n VideoGalleryTogetherModeSeatingInfo,\n TogetherModeStreamOptions\n} from '../../react-components/src';\n\nexport type { RaiseHandButtonProps, RaiseHandButtonStrings, RaisedHand } from '../../react-components/src';\nexport type {\n ReactionButtonStrings,\n Reaction,\n ReactionButtonProps,\n ReactionResources,\n ReactionSprite,\n ReactionButtonReaction\n} from '../../react-components/src';\n\nexport { ReactionButton } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport { RichTextSendBox } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport type { RichTextSendBoxProps, RichTextSendBoxStrings, RichTextStrings } from '../../react-components/src';\nexport type { Spotlight } from '../../react-components/src';\nexport type { ImageOverlayProps, ImageOverlayStrings } from '../../react-components/src';\n/* @conditional-compile-remove(data-loss-prevention) */\nexport type { BlockedMessage } from '../../react-components/src';\nexport type {\n DialpadMode,\n DialpadProps,\n DialpadStrings,\n DialpadStyles,\n DtmfTone,\n LongPressTrigger\n} from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentOptions } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { SendBoxErrorBarError } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nexport type { SendBoxErrorBarType } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentActionHandler } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type {\n AttachmentSelectionHandler,\n AttachmentRemovalHandler,\n AttachmentUploadOptions,\n AttachmentUploadTask\n} from '../../react-components/src';\nexport type { AttachmentMetadata } from '../../acs-ui-common/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentMetadataInProgress, AttachmentProgressError } from '../../acs-ui-common/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentMenuAction, AttachmentDownloadOptions } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport { defaultAttachmentMenuAction } from '../../react-components/src';\nexport type { ChatAttachmentType } from '../../react-components/src';\nexport type { InlineImageOptions, InlineImage } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport type { RichTextEditorOptions, RichTextEditBoxOptions } from '../../react-components/src';\nexport type { HoldButtonProps, HoldButtonStrings } from '../../react-components/src';\nexport type { VideoTileStrings } from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type { BrowserPermissionDeniedStrings, BrowserPermissionDeniedProps } from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n BrowserPermissionDeniedIOSStrings,\n BrowserPermissionDeniedStyles,\n BrowserPermissionDeniedIOSProps\n} from '../../react-components/src';\nexport type { OverflowGalleryPosition } from '../../react-components/src';\nexport type { LocalVideoTileSize } from '../../react-components/src';\nexport * from '../../react-components/src/localization/locales';\nexport * from '../../react-components/src/theming';\nexport * from '../../calling-stateful-client/src/index-public';\nexport type { DeclarativeCallAgent } from '../../calling-stateful-client/src';\nexport { createStatefulChatClient } from '../../chat-stateful-client/src';\nexport type {\n StatefulChatClient,\n StatefulChatClientArgs,\n StatefulChatClientOptions,\n ChatMessageWithStatus,\n ChatClientState,\n ChatError,\n ChatErrors,\n ChatThreadClientState,\n ChatThreadProperties,\n ChatErrorTarget\n} from '../../chat-stateful-client/src';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nexport type { MessagingPolicy } from '../../chat-stateful-client/src';\n\nexport type { ResourceFetchResult } from '../../chat-stateful-client/src';\nexport * from '../../react-composites/src/index-public';\nexport * from './mergedHooks';\n\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedBrowser } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedBrowserStrings, UnsupportedBrowserProps } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedBrowserVersion } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedBrowserVersionStrings, UnsupportedBrowserVersionProps } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedOperatingSystem } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedOperatingSystemStrings, UnsupportedOperatingSystemProps } from '../../react-components/src';\nexport type {\n VerticalGalleryStyles,\n VerticalGalleryStrings,\n VerticalGalleryControlBarStyles\n} from '../../react-components/src';\n\nexport type { SpokenLanguageStrings, CaptionLanguageStrings } from '../../react-components/src';\n\nexport type { SurveyIssues } from '../../react-components/src';\n\nexport type { SurveyIssuesHeadingStrings } from '../../react-components/src';\n\nexport type { CallSurveyImprovementSuggestions } from '../../react-components/src';\n\nexport { NotificationStack, Notification } from '../../react-components/src';\n\nexport type {\n NotificationStackProps,\n NotificationProps,\n NotificationStrings,\n NotificationStackStrings,\n NotificationType,\n ActiveNotification,\n NotificationStyles\n} from '../../react-components/src';\nexport type { MeetingConferencePhoneInfoModalStrings } from '../../react-components/src';\n/* @conditional-compile-remove(rtt) */\nexport type { RTTModalStrings, RTTModalProps } from '../../react-components/src';\n/* @conditional-compile-remove(rtt) */\nexport { RTTModal } from '../../react-components/src';\n\n/* @conditional-compile-remove(rtt) */\nexport type { RTTDisclosureBannerProps, RTTDisclosureBannerStrings } from '../../react-components/src';\n/* @conditional-compile-remove(rtt) */\nexport { RTTDisclosureBanner } from '../../react-components/src';\n/* @conditional-compile-remove(rtt) */\nexport type { RealTimeTextProps, RealTimeTextStrings } from '../../react-components/src/components/RealTimeText';\n/* @conditional-compile-remove(rtt) */\nexport { RealTimeText } from '../../react-components/src/components/RealTimeText';\n/* @conditional-compile-remove(media-access) */\nexport type { MediaAccess } from '../../react-components/src';\nexport type { CaptionsSettingsModalStrings, CaptionsSettingsModalProps } from '../../react-components/src';\nexport { CaptionsSettingsModal } from '../../react-components/src';\nexport type { SupportedCaptionLanguage, SupportedSpokenLanguage, CaptionsOptions } from '../../react-components/src';\nexport type {\n CaptionsBannerProps,\n CaptionsInformation,\n CaptionsBannerStrings\n} from '../../react-components/src/components/CaptionsBanner';\nexport { CaptionsBanner } from '../../react-components/src/components/CaptionsBanner';\nexport { StartCaptionsButton } from '../../react-components/src/components/StartCaptionsButton';\nexport type {\n StartCaptionsButtonProps,\n StartCaptionsButtonStrings\n} from '../../react-components/src/components/StartCaptionsButton';\n"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAwCzG,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,iCAAiC,EAClC,MAAM,sCAAsC,CAAC;AA2B9C,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EAC1B,MAAM,mCAAmC,CAAC;AAU3C,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,QAAQ,EACR,UAAU,EACV,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,OAAO,EACP,WAAW,EACX,eAAe,EACf,YAAY,EACZ,SAA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4B,CAAC;AAGvE,sDAAsD;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAiBxE,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAc7E,sCAAsC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D,sCAAsC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAC;AAClF,sCAAsC;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAC;AASxG,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAOnE,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,2DAA2D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * `@azure/communication-react` is an npm package that exports the functionality of the Azure Communication Services - UI Library.\n *\n * This package makes it easy for you to build modern communications user experiences using Azure Communication Services. It gives you a library of production-ready UI components that you can drop into your applications:\n * - Composites: These components are turn-key solutions that implement common communication scenarios. You can quickly add video calling or chat experiences to your applications. Composites are open-source higher order components built using UI components.\n * - UI Components - These components are open-source building blocks that let you build custom communications experience. Components are offered for both calling and chat capabilities that can be combined to build experiences.\n *\n * These UI client libraries all use Microsoft's Fluent design language and assets. Fluent UI provides a foundational layer for the UI Library and is actively used across Microsoft products.\n *\n * In conjunction with the UI components, the UI Library exposes a stateful client library for calling and chat. This client is agnostic to any specific state management framework and can be integrated with common state managers like Redux or React Context.\n * This stateful client library can be used with the UI Components to pass props and methods for the UI Components to render data. For more information, see Stateful Client Overview.\n *\n * For more information visit: https://aka.ms/acsstorybook\n *\n * @packageDocumentation\n */\n\nexport { fromFlatCommunicationIdentifier, toFlatCommunicationIdentifier } from '../../acs-ui-common/src';\nexport type {\n AreEqual,\n CommonProperties,\n MessageStatus,\n Common,\n AreTypeEqual,\n AreParamEqual\n} from '../../acs-ui-common/src';\n\n// Not to export chat/calling specific hook from binding package\nexport type {\n CallClientProviderProps,\n CallAgentProviderProps,\n CallProviderProps,\n GetCallingSelector,\n CallingHandlers,\n CallingBaseSelectorProps,\n CommonCallingHandlers\n} from '../../calling-component-bindings/src';\n\nexport type {\n DeepNoiseSuppressionEffectDependency,\n VideoBackgroundEffectsDependency,\n CallingHandlersOptions\n} from '../../calling-component-bindings/src';\n\nexport type {\n ChatClientProviderProps,\n ChatThreadClientProviderProps,\n GetChatSelector,\n ChatHandlers,\n ChatBaseSelectorProps\n} from '../../chat-component-bindings/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { MessageOptions, ChatMessageType } from '../../acs-ui-common/src';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nexport type { UploadChatImageResult } from '../../acs-ui-common/src';\n\nexport {\n CallClientProvider,\n CallAgentProvider,\n CallProvider,\n useCallClient,\n useCallAgent,\n useCall,\n useDeviceManager,\n getCallingSelector,\n createDefaultCallingHandlers\n} from '../../calling-component-bindings/src';\n\nexport {\n useTeamsCallAgent,\n useTeamsCall,\n createDefaultTeamsCallingHandlers\n} from '../../calling-component-bindings/src';\n\nexport type { TeamsCallingHandlers } from '../../calling-component-bindings/src';\n\nexport type {\n ScreenShareButtonSelector,\n CameraButtonSelector,\n VideoGallerySelector,\n DevicesButtonSelector,\n EmptySelector,\n ErrorBarSelector as CallErrorBarSelector,\n ParticipantListSelector,\n MicrophoneButtonSelector,\n ParticipantsButtonSelector,\n CreateDefaultCallingHandlers,\n CaptionSettingsSelector,\n CaptionsBannerSelector,\n StartCaptionsButtonSelector\n} from '../../calling-component-bindings/src';\n\nexport type { HoldButtonSelector } from '../../calling-component-bindings/src';\n\nexport type { RaiseHandButtonSelector } from '../../calling-component-bindings/src';\n\nexport type { NotificationStackSelector } from '../../calling-component-bindings/src';\nexport type { IncomingCallStackSelector } from '../../calling-component-bindings/src';\n\nexport {\n ChatClientProvider,\n ChatThreadClientProvider,\n useChatClient,\n useChatThreadClient,\n getChatSelector,\n createDefaultChatHandlers\n} from '../../chat-component-bindings/src';\n\nexport type {\n MessageThreadSelector,\n TypingIndicatorSelector,\n ChatParticipantListSelector,\n SendBoxSelector,\n ErrorBarSelector as ChatErrorBarSelector\n} from '../../chat-component-bindings/src';\n\nexport {\n _IdentifierProvider,\n CameraButton,\n ControlBar,\n ControlBarButton,\n DevicesButton,\n EndCallButton,\n ErrorBar,\n GridLayout,\n LocalizationProvider,\n MessageStatusIndicator,\n MessageThread,\n MicrophoneButton,\n ParticipantItem,\n ParticipantList,\n ParticipantsButton,\n ScreenShareButton,\n SendBox,\n StreamMedia,\n TypingIndicator,\n VideoGallery,\n VideoTile,\n COMPONENT_LOCALE_EN_GB,\n COMPONENT_LOCALE_AR_SA,\n COMPONENT_LOCALE_CS_CZ,\n COMPONENT_LOCALE_CY_GB,\n COMPONENT_LOCALE_DE_DE,\n COMPONENT_LOCALE_ES_ES,\n COMPONENT_LOCALE_ES_MX,\n COMPONENT_LOCALE_FI_FI,\n COMPONENT_LOCALE_FR_FR,\n COMPONENT_LOCALE_FR_CA,\n COMPONENT_LOCALE_HE_IL,\n COMPONENT_LOCALE_IT_IT,\n COMPONENT_LOCALE_JA_JP,\n COMPONENT_LOCALE_KO_KR,\n COMPONENT_LOCALE_NB_NO,\n COMPONENT_LOCALE_NL_NL,\n COMPONENT_LOCALE_PL_PL,\n COMPONENT_LOCALE_PT_BR,\n COMPONENT_LOCALE_RU_RU,\n COMPONENT_LOCALE_SV_SE,\n COMPONENT_LOCALE_TR_TR,\n COMPONENT_LOCALE_ZH_CN,\n COMPONENT_LOCALE_ZH_TW\n} from '../../react-components/src';\nexport { ImageOverlay } from '../../react-components/src';\nexport { HoldButton } from '../../react-components/src';\n\nexport { RaiseHandButton } from '../../react-components/src';\n\nexport { Dialpad } from '../../react-components/src';\n\nexport { IncomingCallNotification, IncomingCallStack } from '../../react-components/src';\nexport type {\n IncomingCallNotificationProps,\n IncomingCallNotificationStrings,\n IncomingCallNotificationStyles,\n IncomingCallStackProps,\n IncomingCallStackCall\n} from '../../react-components/src';\n\n/* @conditional-compile-remove(call-readiness) */\nexport {\n CameraAndMicrophoneSitePermissions,\n MicrophoneSitePermissions,\n CameraSitePermissions\n} from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n CameraAndMicrophoneSitePermissionsStrings,\n CameraAndMicrophoneSitePermissionsProps,\n CameraSitePermissionsStrings,\n CameraSitePermissionsProps,\n CommonSitePermissionsProps,\n SitePermissionsStrings,\n SitePermissionsStyles,\n MicrophoneSitePermissionsStrings,\n MicrophoneSitePermissionsProps\n} from '../../react-components/src';\n\n/* @conditional-compile-remove(total-participant-count) */\nexport type { ParticipantListStrings } from '../../react-components/src';\n\n/* @conditional-compile-remove(mention) */\nexport type {\n MentionOptions,\n MentionDisplayOptions,\n MentionLookupOptions,\n Mention,\n MentionPopoverStrings\n} from '../../react-components/src';\n\nexport type {\n _IdentifierProviderProps,\n _Identifiers,\n ActiveErrorMessage,\n BaseCustomStyles,\n CallParticipantListParticipant,\n CameraButtonContextualMenuStyles,\n CameraButtonProps,\n CameraButtonStrings,\n CameraButtonStyles,\n ChatMessage,\n CommunicationParticipant,\n ComponentLocale,\n ComponentSlotStyle,\n ComponentStrings,\n ContentSystemMessage,\n ControlBarButtonProps,\n ControlBarButtonStrings,\n ControlBarButtonStyles,\n ControlBarLayout,\n ControlBarProps,\n CreateVideoStreamViewResult,\n CustomAvatarOptions,\n CustomMessage,\n DevicesButtonContextualMenuStyles,\n DevicesButtonProps,\n DevicesButtonStrings,\n DevicesButtonStyles,\n EndCallButtonProps,\n EndCallButtonStrings,\n ErrorBarProps,\n ErrorBarStrings,\n ErrorType,\n GridLayoutProps,\n GridLayoutStyles,\n HorizontalGalleryStyles,\n JumpToNewMessageButtonProps,\n LocalizationProviderProps,\n LocalVideoCameraCycleButtonProps,\n LoadingState,\n Message,\n MessageAttachedStatus,\n MessageCommon,\n MessageContentType,\n MessageProps,\n MessageRenderer,\n MessageStatusIndicatorProps,\n MessageStatusIndicatorStrings,\n MessageThreadProps,\n MessageThreadStrings,\n MessageThreadStyles,\n MicrophoneButtonContextualMenuStyles,\n MicrophoneButtonProps,\n MicrophoneButtonStrings,\n MicrophoneButtonStyles,\n OnRenderAvatarCallback,\n OptionsDevice,\n ParticipantAddedSystemMessage,\n ParticipantItemProps,\n ParticipantItemStrings,\n ParticipantItemStyles,\n ParticipantListItemStyles,\n ParticipantListParticipant,\n ParticipantListProps,\n ParticipantListStyles,\n ParticipantMenuItemsCallback,\n ParticipantRemovedSystemMessage,\n ParticipantState,\n ParticipantsButtonContextualMenuStyles,\n ParticipantsButtonProps,\n ParticipantsButtonStrings,\n ParticipantsButtonStyles,\n ReadReceiptsBySenderId,\n ScreenShareButtonProps,\n ScreenShareButtonStrings,\n SendBoxProps,\n SendBoxStrings,\n SendBoxStylesProps,\n StreamMediaProps,\n SystemMessage,\n SystemMessageCommon,\n TopicUpdatedSystemMessage,\n TypingIndicatorProps,\n TypingIndicatorStrings,\n TypingIndicatorStylesProps,\n UpdateMessageCallback,\n CancelEditCallback,\n VideoGalleryLayout,\n VideoGalleryLocalParticipant,\n VideoGalleryParticipant,\n VideoGalleryProps,\n VideoGalleryRemoteParticipant,\n VideoGalleryStream,\n VideoGalleryStrings,\n VideoGalleryStyles,\n VideoStreamOptions,\n VideoTileProps,\n VideoTileStylesProps,\n ViewScalingMode,\n VideoTileContextualMenuProps,\n VideoTileDrawerMenuProps,\n VideoTilesOptions\n} from '../../react-components/src';\n\n/* @conditional-compile-remove(together-mode) */\nexport type {\n TogetherModeStreamViewResult,\n VideoGalleryTogetherModeStreams,\n VideoGalleryTogetherModeParticipantPosition,\n VideoGalleryTogetherModeSeatingInfo,\n TogetherModeStreamOptions\n} from '../../react-components/src';\n\nexport type { RaiseHandButtonProps, RaiseHandButtonStrings, RaisedHand } from '../../react-components/src';\nexport type {\n ReactionButtonStrings,\n Reaction,\n ReactionButtonProps,\n ReactionResources,\n ReactionSprite,\n ReactionButtonReaction\n} from '../../react-components/src';\n\nexport { ReactionButton } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport { RichTextSendBox } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport type { RichTextSendBoxProps, RichTextSendBoxStrings, RichTextStrings } from '../../react-components/src';\nexport type { Spotlight } from '../../react-components/src';\nexport type { ImageOverlayProps, ImageOverlayStrings } from '../../react-components/src';\n/* @conditional-compile-remove(data-loss-prevention) */\nexport type { BlockedMessage } from '../../react-components/src';\nexport type {\n DialpadMode,\n DialpadProps,\n DialpadStrings,\n DialpadStyles,\n DtmfTone,\n LongPressTrigger\n} from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentOptions } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { SendBoxErrorBarError } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nexport type { SendBoxErrorBarType } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentActionHandler } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type {\n AttachmentSelectionHandler,\n AttachmentRemovalHandler,\n AttachmentUploadOptions,\n AttachmentUploadTask\n} from '../../react-components/src';\nexport type { AttachmentMetadata } from '../../acs-ui-common/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentMetadataInProgress, AttachmentProgressError } from '../../acs-ui-common/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentMenuAction, AttachmentDownloadOptions } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport { defaultAttachmentMenuAction } from '../../react-components/src';\nexport type { ChatAttachmentType } from '../../react-components/src';\nexport type { InlineImageOptions, InlineImage } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport type { RichTextEditorOptions, RichTextEditBoxOptions } from '../../react-components/src';\nexport type { HoldButtonProps, HoldButtonStrings } from '../../react-components/src';\nexport type { VideoTileStrings } from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type { BrowserPermissionDeniedStrings, BrowserPermissionDeniedProps } from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n BrowserPermissionDeniedIOSStrings,\n BrowserPermissionDeniedStyles,\n BrowserPermissionDeniedIOSProps\n} from '../../react-components/src';\nexport type { OverflowGalleryPosition } from '../../react-components/src';\nexport type { LocalVideoTileSize } from '../../react-components/src';\nexport * from '../../react-components/src/localization/locales';\nexport * from '../../react-components/src/theming';\nexport * from '../../calling-stateful-client/src/index-public';\nexport type { DeclarativeCallAgent } from '../../calling-stateful-client/src';\nexport { createStatefulChatClient } from '../../chat-stateful-client/src';\nexport type {\n StatefulChatClient,\n StatefulChatClientArgs,\n StatefulChatClientOptions,\n ChatMessageWithStatus,\n ChatClientState,\n ChatError,\n ChatErrors,\n ChatThreadClientState,\n ChatThreadProperties,\n ChatErrorTarget\n} from '../../chat-stateful-client/src';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nexport type { MessagingPolicy } from '../../chat-stateful-client/src';\n\nexport type { ResourceFetchResult } from '../../chat-stateful-client/src';\nexport * from '../../react-composites/src/index-public';\nexport * from './mergedHooks';\n\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedBrowser } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedBrowserStrings, UnsupportedBrowserProps } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedBrowserVersion } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedBrowserVersionStrings, UnsupportedBrowserVersionProps } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedOperatingSystem } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedOperatingSystemStrings, UnsupportedOperatingSystemProps } from '../../react-components/src';\nexport type {\n VerticalGalleryStyles,\n VerticalGalleryStrings,\n VerticalGalleryControlBarStyles\n} from '../../react-components/src';\n\nexport type { SpokenLanguageStrings, CaptionLanguageStrings } from '../../react-components/src';\n\nexport type { SurveyIssues } from '../../react-components/src';\n\nexport type { SurveyIssuesHeadingStrings } from '../../react-components/src';\n\nexport type { CallSurveyImprovementSuggestions } from '../../react-components/src';\n\nexport { NotificationStack, Notification } from '../../react-components/src';\n\nexport type {\n NotificationStackProps,\n NotificationProps,\n NotificationStrings,\n NotificationStackStrings,\n NotificationType,\n ActiveNotification,\n NotificationStyles\n} from '../../react-components/src';\nexport type { MeetingConferencePhoneInfoModalStrings } from '../../react-components/src';\n/* @conditional-compile-remove(rtt) */\nexport type { RealTimeTextModalStrings, RealTimeTextModalProps } from '../../react-components/src';\n/* @conditional-compile-remove(rtt) */\nexport { RealTimeTextModal } from '../../react-components/src';\n/* @conditional-compile-remove(rtt) */\nexport type { RealTimeTextProps, RealTimeTextStrings } from '../../react-components/src/components/RealTimeText';\n/* @conditional-compile-remove(rtt) */\nexport { RealTimeText } from '../../react-components/src/components/RealTimeText';\n/* @conditional-compile-remove(rtt) */\nexport { StartRealTimeTextButton } from '../../react-components/src/components/StartRealTimeTextButton';\n/* @conditional-compile-remove(rtt) */\nexport type {\n StartRealTimeTextButtonProps,\n StartRealTimeTextButtonStrings\n} from '../../react-components/src/components/StartRealTimeTextButton';\n/* @conditional-compile-remove(media-access) */\nexport type { MediaAccess } from '../../react-components/src';\nexport type { CaptionsSettingsModalStrings, CaptionsSettingsModalProps } from '../../react-components/src';\nexport { CaptionsSettingsModal } from '../../react-components/src';\nexport type { SupportedCaptionLanguage, SupportedSpokenLanguage, CaptionsOptions } from '../../react-components/src';\nexport type {\n CaptionsBannerProps,\n CaptionsInformation,\n CaptionsBannerStrings\n} from '../../react-components/src/components/CaptionsBanner';\nexport { CaptionsBanner } from '../../react-components/src/components/CaptionsBanner';\nexport { StartCaptionsButton } from '../../react-components/src/components/StartCaptionsButton';\nexport type {\n StartCaptionsButtonProps,\n StartCaptionsButtonStrings\n} from '../../react-components/src/components/StartCaptionsButton';\n"]}
|
@@ -34,6 +34,7 @@ export const CameraButton = (props) => {
|
|
34
34
|
const localeStrings = useLocale().strings.cameraButton;
|
35
35
|
const strings = Object.assign(Object.assign({}, localeStrings), props.strings);
|
36
36
|
const [announcerString, setAnnouncerString] = useState(undefined);
|
37
|
+
const [announcerPresent, setAnnouncerPresent] = useState(false);
|
37
38
|
const disabled = props.disabled || waitForCamera;
|
38
39
|
const onRenderCameraOnIcon = () => (React.createElement(_HighContrastAwareIcon, { disabled: disabled, iconName: "ControlButtonCameraOn" }));
|
39
40
|
const onRenderCameraOffIcon = () => (React.createElement(_HighContrastAwareIcon, { disabled: disabled, iconName: "ControlButtonCameraOff" }));
|
@@ -123,9 +124,9 @@ export const CameraButton = (props) => {
|
|
123
124
|
};
|
124
125
|
const splitButtonMenuProps = useMemo(() => (Object.assign(Object.assign({}, props.splitButtonMenuProps), { className: 'camera-split-button' })), [props.splitButtonMenuProps]);
|
125
126
|
return (React.createElement(React.Fragment, null,
|
126
|
-
React.createElement(Announcer, { announcementString: announcerString, ariaLive: 'polite' }),
|
127
|
+
announcerPresent && React.createElement(Announcer, { announcementString: announcerString, ariaLive: 'polite' }),
|
127
128
|
React.createElement(ControlBarButton, Object.assign({}, props, { disabled: disabled, onClick: onToggleCamera ? onToggleClickCallback : props.onClick, onRenderOnIcon: (_b = props.onRenderOnIcon) !== null && _b !== void 0 ? _b : onRenderCameraOnIcon, onRenderOffIcon: (_c = props.onRenderOffIcon) !== null && _c !== void 0 ? _c : onRenderCameraOffIcon, strings: strings, labelKey: (_d = props.labelKey) !== null && _d !== void 0 ? _d : 'cameraButtonLabel', menuProps: (_e = props.menuProps) !== null && _e !== void 0 ? _e : (props.enableDeviceSelectionMenu
|
128
129
|
? generateDefaultDeviceMenuProps(Object.assign(Object.assign({}, props), { onSelectCamera: onChangeCameraClick, styles: (_f = props.styles) === null || _f === void 0 ? void 0 : _f.menuStyles }), strings, splitButtonPrimaryAction)
|
129
|
-
: undefined), menuIconProps: ((_g = props.menuIconProps) !== null && _g !== void 0 ? _g : !props.enableDeviceSelectionMenu) ? { hidden: true } : undefined, split: (_h = props.split) !== null && _h !== void 0 ? _h : props.enableDeviceSelectionMenu, "aria-description": strings.cameraButtonAriaDescription, "aria-roledescription": props.enableDeviceSelectionMenu ? strings.cameraButtonSplitRoleDescription : undefined, ariaLabel: ariaLabel, splitButtonAriaLabel: props.enableDeviceSelectionMenu ? splitButtonAriaString : undefined, splitButtonMenuProps: splitButtonMenuProps }))));
|
130
|
+
: undefined), menuIconProps: ((_g = props.menuIconProps) !== null && _g !== void 0 ? _g : !props.enableDeviceSelectionMenu) ? { hidden: true } : undefined, split: (_h = props.split) !== null && _h !== void 0 ? _h : props.enableDeviceSelectionMenu, "aria-description": strings.cameraButtonAriaDescription, "aria-roledescription": props.enableDeviceSelectionMenu ? strings.cameraButtonSplitRoleDescription : undefined, ariaLabel: ariaLabel, splitButtonAriaLabel: props.enableDeviceSelectionMenu ? splitButtonAriaString : undefined, splitButtonMenuProps: splitButtonMenuProps, onFocus: () => setAnnouncerPresent(true), onBlur: () => setAnnouncerPresent(false) }))));
|
130
131
|
};
|
131
132
|
//# sourceMappingURL=CameraButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CameraButton.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/CameraButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAyB,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAy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K,CAAC,SAAS,mCACf,CAAC,KAAK,CAAC,yBAAyB;gBAC9B,CAAC,CAAC,8BAA8B,iCACvB,KAAK,KAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAA,KAAK,CAAC,MAAM,0CAAE,UAAU,KACjF,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,sBACnC,OAAO,CAAC,2BAA2B,0BAC/B,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC,CAAC,SAAS,EAC5G,SAAS,EAAE,SAAS,EACpB,oBAAoB,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,EACzF,oBAAoB,EAAE,oBAAoB,IAC1C,CACD,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useCallback, useState, useMemo } from 'react';\nimport { useLocale } from '../localization';\nimport { VideoStreamOptions } from '../types';\nimport { ControlBarButton, ControlBarButtonProps } from './ControlBarButton';\nimport { _HighContrastAwareIcon } from './HighContrastAwareIcon';\n\nimport {\n ContextualMenuItemType,\n IButtonProps,\n IContextualMenuItem,\n IContextualMenuItemStyles,\n IContextualMenuStyles\n} from '@fluentui/react';\nimport { ControlBarButtonStyles } from './ControlBarButton';\nimport { OptionsDevice, generateDefaultDeviceMenuProps } from './DevicesButton';\nimport { Announcer } from './Announcer';\n\nconst defaultLocalVideoViewOptions = {\n scalingMode: 'Crop',\n isMirrored: true\n} as VideoStreamOptions;\n\n/**\n * Strings of CameraButton that can be overridden.\n *\n * @public\n */\nexport interface CameraButtonStrings {\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 /** Tooltip content when the button is disabled due to video loading. */\n tooltipVideoLoadingContent?: string;\n /**\n * Title of camera menu\n */\n cameraMenuTitle: string;\n /**\n * Tooltip of camera menu\n */\n cameraMenuTooltip: string;\n /**\n * description of camera button split button role\n */\n cameraButtonSplitRoleDescription?: string;\n /**\n * Camera split button aria label for when button is enabled.\n */\n onSplitButtonAriaLabel?: string;\n /**\n * Camera split button aria label for when button is disabled.\n */\n offSplitButtonAriaLabel?: string;\n /**\n * Camera action turned on string for announcer\n */\n cameraActionTurnedOnAnnouncement?: string;\n /**\n * Camera action turned off string for announcer\n */\n cameraActionTurnedOffAnnouncement?: string;\n /**\n * Primary action for when the camera is turned off\n */\n offSplitButtonPrimaryActionCamera?: string;\n /**\n * Primary action for when the camera is on\n */\n onSplitButtonPrimaryActionCamera?: string;\n /**\n * Title for primary action section of split button\n */\n cameraPrimaryActionSplitButtonTitle?: string;\n /**\n * Title for video effects menu item\n */\n videoEffectsMenuItemTitle?: string;\n /**\n * Aria description for camera button\n */\n cameraButtonAriaDescription?: string;\n}\n\n/**\n * Styles for {@link CameraButton}\n *\n * @public\n */\nexport interface CameraButtonStyles extends ControlBarButtonStyles {\n /**\n * Styles for the {@link CameraButton} menu.\n */\n menuStyles?: Partial<CameraButtonContextualMenuStyles>;\n}\n\n/**\n * Styles for the {@link CameraButton} menu.\n *\n * @public\n */\nexport interface CameraButtonContextualMenuStyles extends IContextualMenuStyles {\n /**\n * Styles for the items inside the {@link CameraButton} button menu.\n */\n menuItemStyles?: IContextualMenuItemStyles;\n}\n/**\n * Props for {@link CameraButton} component.\n *\n * @public\n */\nexport interface CameraButtonProps extends ControlBarButtonProps {\n /**\n * Utility property for using this component with `communication react eventHandlers`.\n * Maps directly to the `onClick` property.\n */\n onToggleCamera?: (options?: VideoStreamOptions) => Promise<void>;\n\n /**\n * Options for rendering local video view.\n */\n localVideoViewOptions?: VideoStreamOptions;\n /**\n * Available cameras for selection\n */\n cameras?: OptionsDevice[];\n /**\n * Camera that is shown as currently selected\n */\n selectedCamera?: OptionsDevice;\n /**\n * Callback when a camera is selected\n */\n onSelectCamera?: (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<CameraButtonStrings>;\n /**\n * Styles for {@link CameraButton} and the device selection flyout.\n */\n styles?: Partial<CameraButtonStyles>;\n\n /**\n * Callback when a effects is clicked\n */\n onClickVideoEffects?: (showVideoEffects: boolean) => void;\n}\n\n/**\n * A button to turn camera on / off.\n *\n * Can be used with {@link ControlBar}.\n *\n * @public\n */\nexport const CameraButton = (props: CameraButtonProps): JSX.Element => {\n const { localVideoViewOptions, onToggleCamera, onSelectCamera } = props;\n const [waitForCamera, setWaitForCamera] = useState(false);\n const localeStrings = useLocale().strings.cameraButton;\n const strings = { ...localeStrings, ...props.strings };\n const [announcerString, setAnnouncerString] = useState<string | undefined>(undefined);\n\n const disabled = props.disabled || waitForCamera;\n\n const onRenderCameraOnIcon = (): JSX.Element => (\n <_HighContrastAwareIcon disabled={disabled} iconName=\"ControlButtonCameraOn\" />\n );\n const onRenderCameraOffIcon = (): JSX.Element => (\n <_HighContrastAwareIcon disabled={disabled} iconName=\"ControlButtonCameraOff\" />\n );\n if (waitForCamera && strings.tooltipVideoLoadingContent) {\n strings.tooltipDisabledContent = strings.tooltipVideoLoadingContent;\n }\n\n const cameraOn = props.checked;\n const cameraTurningOn = waitForCamera && !cameraOn;\n // Ensure Aria-label by default reflects the loading state of the camera\n const ariaLabel = props.ariaLabel ?? cameraTurningOn ? strings.tooltipVideoLoadingContent : undefined;\n\n const splitButtonAriaString = cameraTurningOn\n ? strings.tooltipVideoLoadingContent\n : cameraOn\n ? strings.onSplitButtonAriaLabel\n : strings.offSplitButtonAriaLabel;\n\n const toggleAnnouncerString = useCallback(\n (isCameraOn: boolean) => {\n setAnnouncerString(\n !isCameraOn ? strings.cameraActionTurnedOffAnnouncement : strings.cameraActionTurnedOnAnnouncement\n );\n },\n [strings.cameraActionTurnedOffAnnouncement, strings.cameraActionTurnedOnAnnouncement]\n );\n\n const onVideoIsLoadingAnnouncementCallback = useCallback(() => {\n if (!cameraOn) {\n setAnnouncerString(strings.tooltipVideoLoadingContent);\n }\n }, [setAnnouncerString, cameraOn, strings.tooltipVideoLoadingContent]);\n\n const onToggleClick = useCallback(async () => {\n // Throttle click on camera, need to await onToggleCamera then allow another click\n if (onToggleCamera) {\n setWaitForCamera(true);\n try {\n await onToggleCamera(localVideoViewOptions ?? defaultLocalVideoViewOptions);\n // allows for the setting of narrator strings triggering the announcer when camera is turned on or off.\n toggleAnnouncerString(!cameraOn);\n } finally {\n setWaitForCamera(false);\n }\n }\n }, [cameraOn, localVideoViewOptions, onToggleCamera, toggleAnnouncerString]);\n\n const onToggleClickCallback = useCallback(() => {\n onVideoIsLoadingAnnouncementCallback();\n onToggleClick();\n }, [onVideoIsLoadingAnnouncementCallback, onToggleClick]);\n\n const onChangeCameraClick = useCallback(\n async (device: OptionsDevice) => {\n // Throttle changing camera to prevent too many callbacks\n if (onSelectCamera) {\n setWaitForCamera(true);\n try {\n await onSelectCamera(device);\n } finally {\n setWaitForCamera(false);\n }\n }\n },\n [onSelectCamera]\n );\n\n const splitButtonMenuItems: IContextualMenuItem[] = [];\n\n if (props.onClickVideoEffects) {\n splitButtonMenuItems.push({\n key: 'effects',\n 'data-ui-id': 'camera-split-button-video-effects',\n text: strings.videoEffectsMenuItemTitle,\n iconProps: { iconName: 'ControlButtonVideoEffectsOption', styles: { root: { lineHeight: 0 } } },\n onClick: () => {\n if (props.onClickVideoEffects) {\n props.onClickVideoEffects(true);\n }\n }\n });\n }\n\n splitButtonMenuItems.push({\n key: 'cameraPrimaryAction',\n text: props.checked ? strings.onSplitButtonPrimaryActionCamera : strings.offSplitButtonPrimaryActionCamera,\n onClick: () => {\n onToggleClick();\n },\n iconProps: {\n iconName: props.checked ? 'SplitButtonPrimaryActionCameraOn' : 'SplitButtonPrimaryActionCameraOff',\n styles: { root: { lineHeight: 0 } }\n }\n });\n\n const splitButtonPrimaryAction: IContextualMenuItem = {\n key: 'primaryAction',\n title: 'toggle camera',\n itemType: ContextualMenuItemType.Section,\n sectionProps: {\n topDivider: true,\n items: splitButtonMenuItems\n }\n };\n\n const splitButtonMenuProps: IButtonProps = useMemo(\n () => ({\n ...props.splitButtonMenuProps,\n className: 'camera-split-button'\n }),\n [props.splitButtonMenuProps]\n );\n\n return (\n <>\n <Announcer announcementString={announcerString} ariaLive={'polite'} />\n <ControlBarButton\n {...props}\n disabled={disabled}\n onClick={onToggleCamera ? onToggleClickCallback : props.onClick}\n onRenderOnIcon={props.onRenderOnIcon ?? onRenderCameraOnIcon}\n onRenderOffIcon={props.onRenderOffIcon ?? onRenderCameraOffIcon}\n strings={strings}\n labelKey={props.labelKey ?? 'cameraButtonLabel'}\n menuProps={\n props.menuProps ??\n (props.enableDeviceSelectionMenu\n ? generateDefaultDeviceMenuProps(\n { ...props, onSelectCamera: onChangeCameraClick, 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-description={strings.cameraButtonAriaDescription}\n aria-roledescription={props.enableDeviceSelectionMenu ? strings.cameraButtonSplitRoleDescription : undefined}\n ariaLabel={ariaLabel}\n splitButtonAriaLabel={props.enableDeviceSelectionMenu ? splitButtonAriaString : undefined}\n splitButtonMenuProps={splitButtonMenuProps}\n />\n </>\n );\n};\n"]}
|
1
|
+
{"version":3,"file":"CameraButton.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/CameraButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAyB,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EACL,sBAAsB,EAKvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAiB,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,4BAA4B,GAAG;IACnC,WAAW,EAAE,MAAM;IACnB,UAAU,EAAE,IAAI;CACK,CAAC;AA8IxB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAe,EAAE;;IACpE,MAAM,EAAE,qBAAqB,EAAE,cAAc,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IACxE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1D,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC;IACvD,MAAM,OAAO,mCAAQ,aAAa,GAAK,KAAK,CAAC,OAAO,CAAE,CAAC;IACvD,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAqB,SAAS,CAAC,CAAC;IACtF,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IAEzE,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ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AE,GAAG,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,EACxC,MAAM,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAAC,IACxC,CACD,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useCallback, useState, useMemo } from 'react';\nimport { useLocale } from '../localization';\nimport { VideoStreamOptions } from '../types';\nimport { ControlBarButton, ControlBarButtonProps } from './ControlBarButton';\nimport { _HighContrastAwareIcon } from './HighContrastAwareIcon';\n\nimport {\n ContextualMenuItemType,\n IButtonProps,\n IContextualMenuItem,\n IContextualMenuItemStyles,\n IContextualMenuStyles\n} from '@fluentui/react';\nimport { ControlBarButtonStyles } from './ControlBarButton';\nimport { OptionsDevice, generateDefaultDeviceMenuProps } from './DevicesButton';\nimport { Announcer } from './Announcer';\n\nconst defaultLocalVideoViewOptions = {\n scalingMode: 'Crop',\n isMirrored: true\n} as VideoStreamOptions;\n\n/**\n * Strings of CameraButton that can be overridden.\n *\n * @public\n */\nexport interface CameraButtonStrings {\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 /** Tooltip content when the button is disabled due to video loading. */\n tooltipVideoLoadingContent?: string;\n /**\n * Title of camera menu\n */\n cameraMenuTitle: string;\n /**\n * Tooltip of camera menu\n */\n cameraMenuTooltip: string;\n /**\n * description of camera button split button role\n */\n cameraButtonSplitRoleDescription?: string;\n /**\n * Camera split button aria label for when button is enabled.\n */\n onSplitButtonAriaLabel?: string;\n /**\n * Camera split button aria label for when button is disabled.\n */\n offSplitButtonAriaLabel?: string;\n /**\n * Camera action turned on string for announcer\n */\n cameraActionTurnedOnAnnouncement?: string;\n /**\n * Camera action turned off string for announcer\n */\n cameraActionTurnedOffAnnouncement?: string;\n /**\n * Primary action for when the camera is turned off\n */\n offSplitButtonPrimaryActionCamera?: string;\n /**\n * Primary action for when the camera is on\n */\n onSplitButtonPrimaryActionCamera?: string;\n /**\n * Title for primary action section of split button\n */\n cameraPrimaryActionSplitButtonTitle?: string;\n /**\n * Title for video effects menu item\n */\n videoEffectsMenuItemTitle?: string;\n /**\n * Aria description for camera button\n */\n cameraButtonAriaDescription?: string;\n}\n\n/**\n * Styles for {@link CameraButton}\n *\n * @public\n */\nexport interface CameraButtonStyles extends ControlBarButtonStyles {\n /**\n * Styles for the {@link CameraButton} menu.\n */\n menuStyles?: Partial<CameraButtonContextualMenuStyles>;\n}\n\n/**\n * Styles for the {@link CameraButton} menu.\n *\n * @public\n */\nexport interface CameraButtonContextualMenuStyles extends IContextualMenuStyles {\n /**\n * Styles for the items inside the {@link CameraButton} button menu.\n */\n menuItemStyles?: IContextualMenuItemStyles;\n}\n/**\n * Props for {@link CameraButton} component.\n *\n * @public\n */\nexport interface CameraButtonProps extends ControlBarButtonProps {\n /**\n * Utility property for using this component with `communication react eventHandlers`.\n * Maps directly to the `onClick` property.\n */\n onToggleCamera?: (options?: VideoStreamOptions) => Promise<void>;\n\n /**\n * Options for rendering local video view.\n */\n localVideoViewOptions?: VideoStreamOptions;\n /**\n * Available cameras for selection\n */\n cameras?: OptionsDevice[];\n /**\n * Camera that is shown as currently selected\n */\n selectedCamera?: OptionsDevice;\n /**\n * Callback when a camera is selected\n */\n onSelectCamera?: (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<CameraButtonStrings>;\n /**\n * Styles for {@link CameraButton} and the device selection flyout.\n */\n styles?: Partial<CameraButtonStyles>;\n\n /**\n * Callback when a effects is clicked\n */\n onClickVideoEffects?: (showVideoEffects: boolean) => void;\n}\n\n/**\n * A button to turn camera on / off.\n *\n * Can be used with {@link ControlBar}.\n *\n * @public\n */\nexport const CameraButton = (props: CameraButtonProps): JSX.Element => {\n const { localVideoViewOptions, onToggleCamera, onSelectCamera } = props;\n const [waitForCamera, setWaitForCamera] = useState(false);\n const localeStrings = useLocale().strings.cameraButton;\n const strings = { ...localeStrings, ...props.strings };\n const [announcerString, setAnnouncerString] = useState<string | undefined>(undefined);\n const [announcerPresent, setAnnouncerPresent] = useState<boolean>(false);\n\n const disabled = props.disabled || waitForCamera;\n\n const onRenderCameraOnIcon = (): JSX.Element => (\n <_HighContrastAwareIcon disabled={disabled} iconName=\"ControlButtonCameraOn\" />\n );\n const onRenderCameraOffIcon = (): JSX.Element => (\n <_HighContrastAwareIcon disabled={disabled} iconName=\"ControlButtonCameraOff\" />\n );\n if (waitForCamera && strings.tooltipVideoLoadingContent) {\n strings.tooltipDisabledContent = strings.tooltipVideoLoadingContent;\n }\n\n const cameraOn = props.checked;\n const cameraTurningOn = waitForCamera && !cameraOn;\n // Ensure Aria-label by default reflects the loading state of the camera\n const ariaLabel = props.ariaLabel ?? cameraTurningOn ? strings.tooltipVideoLoadingContent : undefined;\n\n const splitButtonAriaString = cameraTurningOn\n ? strings.tooltipVideoLoadingContent\n : cameraOn\n ? strings.onSplitButtonAriaLabel\n : strings.offSplitButtonAriaLabel;\n\n const toggleAnnouncerString = useCallback(\n (isCameraOn: boolean) => {\n setAnnouncerString(\n !isCameraOn ? strings.cameraActionTurnedOffAnnouncement : strings.cameraActionTurnedOnAnnouncement\n );\n },\n [strings.cameraActionTurnedOffAnnouncement, strings.cameraActionTurnedOnAnnouncement]\n );\n\n const onVideoIsLoadingAnnouncementCallback = useCallback(() => {\n if (!cameraOn) {\n setAnnouncerString(strings.tooltipVideoLoadingContent);\n }\n }, [setAnnouncerString, cameraOn, strings.tooltipVideoLoadingContent]);\n\n const onToggleClick = useCallback(async () => {\n // Throttle click on camera, need to await onToggleCamera then allow another click\n if (onToggleCamera) {\n setWaitForCamera(true);\n try {\n await onToggleCamera(localVideoViewOptions ?? defaultLocalVideoViewOptions);\n // allows for the setting of narrator strings triggering the announcer when camera is turned on or off.\n toggleAnnouncerString(!cameraOn);\n } finally {\n setWaitForCamera(false);\n }\n }\n }, [cameraOn, localVideoViewOptions, onToggleCamera, toggleAnnouncerString]);\n\n const onToggleClickCallback = useCallback(() => {\n onVideoIsLoadingAnnouncementCallback();\n onToggleClick();\n }, [onVideoIsLoadingAnnouncementCallback, onToggleClick]);\n\n const onChangeCameraClick = useCallback(\n async (device: OptionsDevice) => {\n // Throttle changing camera to prevent too many callbacks\n if (onSelectCamera) {\n setWaitForCamera(true);\n try {\n await onSelectCamera(device);\n } finally {\n setWaitForCamera(false);\n }\n }\n },\n [onSelectCamera]\n );\n\n const splitButtonMenuItems: IContextualMenuItem[] = [];\n\n if (props.onClickVideoEffects) {\n splitButtonMenuItems.push({\n key: 'effects',\n 'data-ui-id': 'camera-split-button-video-effects',\n text: strings.videoEffectsMenuItemTitle,\n iconProps: { iconName: 'ControlButtonVideoEffectsOption', styles: { root: { lineHeight: 0 } } },\n onClick: () => {\n if (props.onClickVideoEffects) {\n props.onClickVideoEffects(true);\n }\n }\n });\n }\n\n splitButtonMenuItems.push({\n key: 'cameraPrimaryAction',\n text: props.checked ? strings.onSplitButtonPrimaryActionCamera : strings.offSplitButtonPrimaryActionCamera,\n onClick: () => {\n onToggleClick();\n },\n iconProps: {\n iconName: props.checked ? 'SplitButtonPrimaryActionCameraOn' : 'SplitButtonPrimaryActionCameraOff',\n styles: { root: { lineHeight: 0 } }\n }\n });\n\n const splitButtonPrimaryAction: IContextualMenuItem = {\n key: 'primaryAction',\n title: 'toggle camera',\n itemType: ContextualMenuItemType.Section,\n sectionProps: {\n topDivider: true,\n items: splitButtonMenuItems\n }\n };\n\n const splitButtonMenuProps: IButtonProps = useMemo(\n () => ({\n ...props.splitButtonMenuProps,\n className: 'camera-split-button'\n }),\n [props.splitButtonMenuProps]\n );\n\n return (\n <>\n {announcerPresent && <Announcer announcementString={announcerString} ariaLive={'polite'} />}\n <ControlBarButton\n {...props}\n disabled={disabled}\n onClick={onToggleCamera ? onToggleClickCallback : props.onClick}\n onRenderOnIcon={props.onRenderOnIcon ?? onRenderCameraOnIcon}\n onRenderOffIcon={props.onRenderOffIcon ?? onRenderCameraOffIcon}\n strings={strings}\n labelKey={props.labelKey ?? 'cameraButtonLabel'}\n menuProps={\n props.menuProps ??\n (props.enableDeviceSelectionMenu\n ? generateDefaultDeviceMenuProps(\n { ...props, onSelectCamera: onChangeCameraClick, 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-description={strings.cameraButtonAriaDescription}\n aria-roledescription={props.enableDeviceSelectionMenu ? strings.cameraButtonSplitRoleDescription : undefined}\n ariaLabel={ariaLabel}\n splitButtonAriaLabel={props.enableDeviceSelectionMenu ? splitButtonAriaString : undefined}\n splitButtonMenuProps={splitButtonMenuProps}\n onFocus={() => setAnnouncerPresent(true)}\n onBlur={() => setAnnouncerPresent(false)}\n />\n </>\n );\n};\n"]}
|
@@ -21,6 +21,18 @@ export type CaptionsInformation = {
|
|
21
21
|
* id of the speaker
|
22
22
|
*/
|
23
23
|
userId?: string;
|
24
|
+
/**
|
25
|
+
* if the caption received is real time text
|
26
|
+
*/
|
27
|
+
isRealTimeText?: boolean;
|
28
|
+
/**
|
29
|
+
* if the caption received is a non finalized caption
|
30
|
+
*/
|
31
|
+
isPartial?: boolean;
|
32
|
+
/**
|
33
|
+
* if the caption received is from the local user
|
34
|
+
*/
|
35
|
+
isLocalUser?: boolean;
|
24
36
|
};
|
25
37
|
/**
|
26
38
|
* @public
|
@@ -31,6 +43,22 @@ export interface CaptionsBannerStrings {
|
|
31
43
|
* Spinner text for captions banner
|
32
44
|
*/
|
33
45
|
captionsBannerSpinnerText?: string;
|
46
|
+
/**
|
47
|
+
* Default text for RTT input text box
|
48
|
+
*/
|
49
|
+
realTimeTextInputBoxDefaultText?: string;
|
50
|
+
/**
|
51
|
+
* Real time text disclosure banner title
|
52
|
+
*/
|
53
|
+
realTimeTextBannerTitle?: string;
|
54
|
+
/**
|
55
|
+
* Real time text disclosure banner content
|
56
|
+
*/
|
57
|
+
realTimeTextBannerContent?: string;
|
58
|
+
/**
|
59
|
+
* Real time text disclosure banner link label
|
60
|
+
*/
|
61
|
+
realTimeTextBannerLinkLabel?: string;
|
34
62
|
}
|
35
63
|
/**
|
36
64
|
* @public
|
@@ -45,6 +73,10 @@ export interface CaptionsBannerProps {
|
|
45
73
|
* Flag to indicate if captions are on
|
46
74
|
*/
|
47
75
|
isCaptionsOn?: boolean;
|
76
|
+
/**
|
77
|
+
* Flag to indicate if real time text is on
|
78
|
+
*/
|
79
|
+
isRealTimeTextOn?: boolean;
|
48
80
|
/**
|
49
81
|
* Flag to indicate if captions are being started
|
50
82
|
* This is used to show spinner while captions are being started
|
@@ -71,6 +103,14 @@ export interface CaptionsBannerProps {
|
|
71
103
|
captionsOptions?: {
|
72
104
|
height: 'full' | 'default';
|
73
105
|
};
|
106
|
+
/**
|
107
|
+
* Optional callback to send real time text.
|
108
|
+
*/
|
109
|
+
onSendRealTimeText?: (text: string, finalized?: boolean) => Promise<void>;
|
110
|
+
/**
|
111
|
+
* Latest local real time text
|
112
|
+
*/
|
113
|
+
latestLocalRealTimeText?: CaptionsInformation;
|
74
114
|
}
|
75
115
|
/**
|
76
116
|
* @public
|
@@ -1,17 +1,30 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT License.
|
3
3
|
import { Stack, FocusZone, Spinner, useTheme } from '@fluentui/react';
|
4
|
+
/* @conditional-compile-remove(rtt) */
|
5
|
+
import { TextField } from '@fluentui/react';
|
4
6
|
import React, { useEffect, useRef, useState, useCallback } from 'react';
|
5
7
|
import { _Caption } from './Caption';
|
6
8
|
import { captionContainerClassName, captionsBannerClassName, captionsBannerFullHeightClassName, captionsContainerClassName, loadingBannerFullHeightStyles, loadingBannerStyles } from './styles/Captions.style';
|
7
9
|
import { useLocale } from '../localization';
|
10
|
+
/* @conditional-compile-remove(rtt) */
|
11
|
+
import { RealTimeText } from './RealTimeText';
|
12
|
+
/* @conditional-compile-remove(rtt) */
|
13
|
+
import { _RTTDisclosureBanner } from './RTTDisclosureBanner';
|
8
14
|
const SCROLL_OFFSET_ALLOWANCE = 20;
|
9
15
|
/**
|
10
16
|
* @public
|
11
17
|
* A component for displaying a CaptionsBanner with user icon, displayName and captions text.
|
12
18
|
*/
|
13
19
|
export const CaptionsBanner = (props) => {
|
14
|
-
|
20
|
+
var _a, _b, _c;
|
21
|
+
const { captions, isCaptionsOn, startCaptionsInProgress, onRenderAvatar, formFactor = 'default', captionsOptions,
|
22
|
+
/* @conditional-compile-remove(rtt) */
|
23
|
+
isRealTimeTextOn,
|
24
|
+
/* @conditional-compile-remove(rtt) */
|
25
|
+
onSendRealTimeText,
|
26
|
+
/* @conditional-compile-remove(rtt) */
|
27
|
+
latestLocalRealTimeText } = props;
|
15
28
|
const localeStrings = useLocale().strings.captionsBanner;
|
16
29
|
const strings = Object.assign(Object.assign({}, localeStrings), props.strings);
|
17
30
|
const captionsScrollDivRef = useRef(null);
|
@@ -43,14 +56,49 @@ export const CaptionsBanner = (props) => {
|
|
43
56
|
scrollToBottom();
|
44
57
|
}
|
45
58
|
}, [captions, isAtBottomOfScroll]);
|
46
|
-
|
47
|
-
|
59
|
+
/* @conditional-compile-remove(rtt) */
|
60
|
+
const [textFieldValue, setTextFieldValue] = useState('');
|
61
|
+
/* @conditional-compile-remove(rtt) */
|
62
|
+
useEffect(() => {
|
63
|
+
// if the latest real time text sent by myself is final, clear the text field
|
64
|
+
if (latestLocalRealTimeText && !latestLocalRealTimeText.isPartial) {
|
65
|
+
setTextFieldValue('');
|
66
|
+
}
|
67
|
+
}, [latestLocalRealTimeText]);
|
68
|
+
/* @conditional-compile-remove(rtt) */
|
69
|
+
const handleKeyDown = (event) => {
|
70
|
+
if (event.key === 'Enter') {
|
71
|
+
event.preventDefault();
|
72
|
+
if (textFieldValue && onSendRealTimeText) {
|
73
|
+
onSendRealTimeText(textFieldValue, true);
|
74
|
+
setTextFieldValue('');
|
75
|
+
}
|
76
|
+
}
|
77
|
+
};
|
78
|
+
/* @conditional-compile-remove(rtt) */
|
79
|
+
const realTimeTextDisclosureBannerStrings = {
|
80
|
+
bannerTitle: (_a = strings.realTimeTextBannerTitle) !== null && _a !== void 0 ? _a : '',
|
81
|
+
bannerContent: (_b = strings.realTimeTextBannerContent) !== null && _b !== void 0 ? _b : '',
|
82
|
+
bannerLinkLabel: (_c = strings.realTimeTextBannerLinkLabel) !== null && _c !== void 0 ? _c : ''
|
83
|
+
};
|
84
|
+
return (React.createElement(React.Fragment, null, (startCaptionsInProgress || /* @conditional-compile-remove(rtt) */ isRealTimeTextOn) && (React.createElement(FocusZone, { shouldFocusOnMount: true, className: captionsContainerClassName, "data-ui-id": "captions-banner" },
|
85
|
+
/* @conditional-compile-remove(rtt) */ isRealTimeTextOn && (React.createElement(_RTTDisclosureBanner, { strings: realTimeTextDisclosureBannerStrings })),
|
86
|
+
(isCaptionsOn || /* @conditional-compile-remove(rtt) */ isRealTimeTextOn) && (React.createElement("ul", { ref: captionsScrollDivRef, className: (captionsOptions === null || captionsOptions === void 0 ? void 0 : captionsOptions.height) === 'full'
|
48
87
|
? captionsBannerFullHeightClassName(theme)
|
49
88
|
: captionsBannerClassName(formFactor), "data-ui-id": "captions-banner-inner" }, captions.map((caption) => {
|
89
|
+
/* @conditional-compile-remove(rtt) */
|
90
|
+
if (caption.isRealTimeText) {
|
91
|
+
return (React.createElement("li", { key: caption.id, className: captionContainerClassName, "data-is-focusable": true },
|
92
|
+
React.createElement(RealTimeText, Object.assign({}, caption, { isTyping: caption.isPartial, onRenderAvatar: onRenderAvatar }))));
|
93
|
+
}
|
50
94
|
return (React.createElement("li", { key: caption.id, className: captionContainerClassName, "data-is-focusable": true },
|
51
95
|
React.createElement(_Caption, Object.assign({}, caption, { onRenderAvatar: onRenderAvatar }))));
|
52
96
|
}))),
|
53
|
-
|
97
|
+
/* @conditional-compile-remove(rtt) */ isRealTimeTextOn && onSendRealTimeText && (React.createElement(TextField, { label: strings.realTimeTextInputBoxDefaultText, value: textFieldValue, onKeyDown: handleKeyDown, onChange: (_, newValue) => {
|
98
|
+
setTextFieldValue(newValue || '');
|
99
|
+
onSendRealTimeText(newValue || '');
|
100
|
+
} })),
|
101
|
+
!isCaptionsOn && /* @conditional-compile-remove(rtt) */ !isRealTimeTextOn && (React.createElement(Stack, { verticalAlign: "center", styles: (captionsOptions === null || captionsOptions === void 0 ? void 0 : captionsOptions.height) === 'full'
|
54
102
|
? loadingBannerFullHeightStyles(theme)
|
55
103
|
: loadingBannerStyles(formFactor), "data-is-focusable": true },
|
56
104
|
React.createElement(Spinner, { label: strings === null || strings === void 0 ? void 0 : strings.captionsBannerSpinnerText, ariaLive: "assertive", labelPosition: "right" })))))));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CaptionsBanner.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/CaptionsBanner.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,iCAAiC,EACjC,0BAA0B,EAC1B,6BAA6B,EAC7B,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AA6E5C,MAAM,uBAAu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6BAA6B,CAAC,KAAK,CAAC;gBACtC,CAAC,CAAC,mBAAmB,CAAC,UAAU,CAAC,uBAElB,IAAI;YAEvB,oBAAC,OAAO,IAAC,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,yBAAyB,EAAE,QAAQ,EAAC,WAAW,EAAC,aAAa,EAAC,OAAO,GAAG,CAC3F,CACT,CACS,CACb,CACA,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { Stack, FocusZone, Spinner, useTheme } from '@fluentui/react';\nimport React, { useEffect, useRef, useState, useCallback } from 'react';\nimport { _Caption } from './Caption';\nimport {\n captionContainerClassName,\n captionsBannerClassName,\n captionsBannerFullHeightClassName,\n captionsContainerClassName,\n loadingBannerFullHeightStyles,\n loadingBannerStyles\n} from './styles/Captions.style';\nimport { OnRenderAvatarCallback } from '../types';\nimport { useLocale } from '../localization';\n\n/**\n * @public\n * information required for each line of caption\n */\nexport type CaptionsInformation = {\n /**\n * unique id for each caption\n */\n id: string;\n /**\n * speaker's display name\n */\n displayName: string;\n /**\n * content of the caption\n */\n captionText: string;\n /**\n * id of the speaker\n */\n userId?: string;\n};\n\n/**\n * @public\n * strings for captions banner\n */\nexport interface CaptionsBannerStrings {\n /**\n * Spinner text for captions banner\n */\n captionsBannerSpinnerText?: string;\n}\n\n/**\n * @public\n * CaptionsBanner Component Props.\n */\nexport interface CaptionsBannerProps {\n /**\n * Array of captions to be displayed\n */\n captions: CaptionsInformation[];\n /**\n * Flag to indicate if captions are on\n */\n isCaptionsOn?: boolean;\n /**\n * Flag to indicate if captions are being started\n * This is used to show spinner while captions are being started\n */\n startCaptionsInProgress?: boolean;\n /**\n * Optional callback to override render of the avatar.\n *\n * @param userId - user Id\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n /**\n * Optional strings for the component\n */\n strings?: CaptionsBannerStrings;\n /**\n * Optional form factor for the component.\n * @defaultValue 'default'\n */\n formFactor?: 'default' | 'compact';\n /**\n * Optional options for the component.\n */\n captionsOptions?: {\n height: 'full' | 'default';\n };\n}\n\nconst SCROLL_OFFSET_ALLOWANCE = 20;\n\n/**\n * @public\n * A component for displaying a CaptionsBanner with user icon, displayName and captions text.\n */\nexport const CaptionsBanner = (props: CaptionsBannerProps): JSX.Element => {\n const {\n captions,\n isCaptionsOn,\n startCaptionsInProgress,\n onRenderAvatar,\n formFactor = 'default',\n captionsOptions\n } = props;\n const localeStrings = useLocale().strings.captionsBanner;\n const strings = { ...localeStrings, ...props.strings };\n const captionsScrollDivRef = useRef<HTMLUListElement>(null);\n const [isAtBottomOfScroll, setIsAtBottomOfScroll] = useState<boolean>(true);\n const theme = useTheme();\n\n const scrollToBottom = (): void => {\n if (captionsScrollDivRef.current) {\n captionsScrollDivRef.current.scrollTop = captionsScrollDivRef.current.scrollHeight;\n }\n };\n\n const handleScrollToTheBottom = useCallback((): void => {\n if (!captionsScrollDivRef.current) {\n return;\n }\n const atBottom =\n Math.ceil(captionsScrollDivRef.current.scrollTop) >=\n captionsScrollDivRef.current.scrollHeight - captionsScrollDivRef.current.clientHeight - SCROLL_OFFSET_ALLOWANCE;\n\n setIsAtBottomOfScroll(atBottom);\n }, []);\n\n useEffect(() => {\n const captionsScrollDiv = captionsScrollDivRef.current;\n captionsScrollDiv?.addEventListener('scroll', handleScrollToTheBottom);\n\n return () => {\n captionsScrollDiv?.removeEventListener('scroll', handleScrollToTheBottom);\n };\n }, [handleScrollToTheBottom, isCaptionsOn]);\n\n useEffect(() => {\n // only auto scroll to bottom is already is at bottom of scroll before new caption comes in\n if (isAtBottomOfScroll) {\n scrollToBottom();\n }\n }, [captions, isAtBottomOfScroll]);\n\n return (\n <>\n {startCaptionsInProgress && (\n <FocusZone shouldFocusOnMount className={captionsContainerClassName} data-ui-id=\"captions-banner\">\n {isCaptionsOn && (\n <ul\n ref={captionsScrollDivRef}\n className={\n captionsOptions?.height === 'full'\n ? captionsBannerFullHeightClassName(theme)\n : captionsBannerClassName(formFactor)\n }\n data-ui-id=\"captions-banner-inner\"\n >\n {captions.map((caption) => {\n return (\n <li key={caption.id} className={captionContainerClassName} data-is-focusable={true}>\n <_Caption {...caption} onRenderAvatar={onRenderAvatar} />\n </li>\n );\n })}\n </ul>\n )}\n {!isCaptionsOn && (\n <Stack\n verticalAlign=\"center\"\n styles={\n captionsOptions?.height === 'full'\n ? loadingBannerFullHeightStyles(theme)\n : loadingBannerStyles(formFactor)\n }\n data-is-focusable={true}\n >\n <Spinner label={strings?.captionsBannerSpinnerText} ariaLive=\"assertive\" labelPosition=\"right\" />\n </Stack>\n )}\n </FocusZone>\n )}\n </>\n );\n};\n"]}
|
1
|
+
{"version":3,"file":"CaptionsBanner.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/CaptionsBanner.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtE,sCAAsC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,iCAAiC,EACjC,0BAA0B,EAC1B,6BAA6B,EAC7B,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,sCAAsC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,sCAAsC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AA+H7D,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAEnC;;;GAGG;AACH,MAAM,C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C,gBAAgB,IAAI,kBAAkB,IAAI,CAC/E,oBAAC,SAAS,IACR,KAAK,EAAE,OAAO,CAAC,+BAA+B,EAC9C,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,aAAa,EACxB,QAAQ,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE;gBACxB,iBAAiB,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;gBAClC,kBAAkB,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;YACrC,CAAC,GACD,CACH;QAEF,CAAC,YAAY,IAAI,sCAAsC,CAAC,CAAC,gBAAgB,IAAI,CAC5E,oBAAC,KAAK,IACJ,aAAa,EAAC,QAAQ,EACtB,MAAM,EACJ,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,MAAK,MAAM;gBAChC,CAAC,CAAC,6BAA6B,CAAC,KAAK,CAAC;gBACtC,CAAC,CAAC,mBAAmB,CAAC,UAAU,CAAC,uBAElB,IAAI;YAEvB,oBAAC,OAAO,IAAC,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,yBAAyB,EAAE,QAAQ,EAAC,WAAW,EAAC,aAAa,EAAC,OAAO,GAAG,CAC3F,CACT,CACS,CACb,CACA,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { Stack, FocusZone, Spinner, useTheme } from '@fluentui/react';\n/* @conditional-compile-remove(rtt) */\nimport { TextField } from '@fluentui/react';\nimport React, { useEffect, useRef, useState, useCallback } from 'react';\nimport { _Caption } from './Caption';\nimport {\n captionContainerClassName,\n captionsBannerClassName,\n captionsBannerFullHeightClassName,\n captionsContainerClassName,\n loadingBannerFullHeightStyles,\n loadingBannerStyles\n} from './styles/Captions.style';\nimport { OnRenderAvatarCallback } from '../types';\nimport { useLocale } from '../localization';\n/* @conditional-compile-remove(rtt) */\nimport { RealTimeText } from './RealTimeText';\n/* @conditional-compile-remove(rtt) */\nimport { _RTTDisclosureBanner } from './RTTDisclosureBanner';\n\n/**\n * @public\n * information required for each line of caption\n */\nexport type CaptionsInformation = {\n /**\n * unique id for each caption\n */\n id: string;\n /**\n * speaker's display name\n */\n displayName: string;\n /**\n * content of the caption\n */\n captionText: string;\n /**\n * id of the speaker\n */\n userId?: string;\n /* @conditional-compile-remove(rtt) */\n /**\n * if the caption received is real time text\n */\n isRealTimeText?: boolean;\n /* @conditional-compile-remove(rtt) */\n /**\n * if the caption received is a non finalized caption\n */\n isPartial?: boolean;\n /* @conditional-compile-remove(rtt) */\n /**\n * if the caption received is from the local user\n */\n isLocalUser?: boolean;\n};\n\n/**\n * @public\n * strings for captions banner\n */\nexport interface CaptionsBannerStrings {\n /**\n * Spinner text for captions banner\n */\n captionsBannerSpinnerText?: string;\n /* @conditional-compile-remove(rtt) */\n /**\n * Default text for RTT input text box\n */\n realTimeTextInputBoxDefaultText?: string;\n /* @conditional-compile-remove(rtt) */\n /**\n * Real time text disclosure banner title\n */\n realTimeTextBannerTitle?: string;\n /* @conditional-compile-remove(rtt) */\n /**\n * Real time text disclosure banner content\n */\n realTimeTextBannerContent?: string;\n /* @conditional-compile-remove(rtt) */\n /**\n * Real time text disclosure banner link label\n */\n realTimeTextBannerLinkLabel?: string;\n}\n\n/**\n * @public\n * CaptionsBanner Component Props.\n */\nexport interface CaptionsBannerProps {\n /**\n * Array of captions to be displayed\n */\n captions: CaptionsInformation[];\n /**\n * Flag to indicate if captions are on\n */\n isCaptionsOn?: boolean;\n /* @conditional-compile-remove(rtt) */\n /**\n * Flag to indicate if real time text is on\n */\n isRealTimeTextOn?: boolean;\n /**\n * Flag to indicate if captions are being started\n * This is used to show spinner while captions are being started\n */\n startCaptionsInProgress?: boolean;\n /**\n * Optional callback to override render of the avatar.\n *\n * @param userId - user Id\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n /**\n * Optional strings for the component\n */\n strings?: CaptionsBannerStrings;\n /**\n * Optional form factor for the component.\n * @defaultValue 'default'\n */\n formFactor?: 'default' | 'compact';\n /**\n * Optional options for the component.\n */\n captionsOptions?: {\n height: 'full' | 'default';\n };\n /* @conditional-compile-remove(rtt) */\n /**\n * Optional callback to send real time text.\n */\n onSendRealTimeText?: (text: string, finalized?: boolean) => Promise<void>;\n /* @conditional-compile-remove(rtt) */\n /**\n * Latest local real time text\n */\n latestLocalRealTimeText?: CaptionsInformation;\n}\n\nconst SCROLL_OFFSET_ALLOWANCE = 20;\n\n/**\n * @public\n * A component for displaying a CaptionsBanner with user icon, displayName and captions text.\n */\nexport const CaptionsBanner = (props: CaptionsBannerProps): JSX.Element => {\n const {\n captions,\n isCaptionsOn,\n startCaptionsInProgress,\n onRenderAvatar,\n formFactor = 'default',\n captionsOptions,\n /* @conditional-compile-remove(rtt) */\n isRealTimeTextOn,\n /* @conditional-compile-remove(rtt) */\n onSendRealTimeText,\n /* @conditional-compile-remove(rtt) */\n latestLocalRealTimeText\n } = props;\n const localeStrings = useLocale().strings.captionsBanner;\n const strings = { ...localeStrings, ...props.strings };\n const captionsScrollDivRef = useRef<HTMLUListElement>(null);\n const [isAtBottomOfScroll, setIsAtBottomOfScroll] = useState<boolean>(true);\n const theme = useTheme();\n\n const scrollToBottom = (): void => {\n if (captionsScrollDivRef.current) {\n captionsScrollDivRef.current.scrollTop = captionsScrollDivRef.current.scrollHeight;\n }\n };\n\n const handleScrollToTheBottom = useCallback((): void => {\n if (!captionsScrollDivRef.current) {\n return;\n }\n const atBottom =\n Math.ceil(captionsScrollDivRef.current.scrollTop) >=\n captionsScrollDivRef.current.scrollHeight - captionsScrollDivRef.current.clientHeight - SCROLL_OFFSET_ALLOWANCE;\n\n setIsAtBottomOfScroll(atBottom);\n }, []);\n\n useEffect(() => {\n const captionsScrollDiv = captionsScrollDivRef.current;\n captionsScrollDiv?.addEventListener('scroll', handleScrollToTheBottom);\n\n return () => {\n captionsScrollDiv?.removeEventListener('scroll', handleScrollToTheBottom);\n };\n }, [handleScrollToTheBottom, isCaptionsOn]);\n\n useEffect(() => {\n // only auto scroll to bottom is already is at bottom of scroll before new caption comes in\n if (isAtBottomOfScroll) {\n scrollToBottom();\n }\n }, [captions, isAtBottomOfScroll]);\n /* @conditional-compile-remove(rtt) */\n const [textFieldValue, setTextFieldValue] = useState<string>('');\n /* @conditional-compile-remove(rtt) */\n useEffect(() => {\n // if the latest real time text sent by myself is final, clear the text field\n if (latestLocalRealTimeText && !latestLocalRealTimeText.isPartial) {\n setTextFieldValue('');\n }\n }, [latestLocalRealTimeText]);\n\n /* @conditional-compile-remove(rtt) */\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>): void => {\n if (event.key === 'Enter') {\n event.preventDefault();\n if (textFieldValue && onSendRealTimeText) {\n onSendRealTimeText(textFieldValue, true);\n setTextFieldValue('');\n }\n }\n };\n\n /* @conditional-compile-remove(rtt) */\n const realTimeTextDisclosureBannerStrings = {\n bannerTitle: strings.realTimeTextBannerTitle ?? '',\n bannerContent: strings.realTimeTextBannerContent ?? '',\n bannerLinkLabel: strings.realTimeTextBannerLinkLabel ?? ''\n };\n\n return (\n <>\n {(startCaptionsInProgress || /* @conditional-compile-remove(rtt) */ isRealTimeTextOn) && (\n <FocusZone shouldFocusOnMount className={captionsContainerClassName} data-ui-id=\"captions-banner\">\n {\n /* @conditional-compile-remove(rtt) */ isRealTimeTextOn && (\n <_RTTDisclosureBanner strings={realTimeTextDisclosureBannerStrings} />\n )\n }\n {(isCaptionsOn || /* @conditional-compile-remove(rtt) */ isRealTimeTextOn) && (\n <ul\n ref={captionsScrollDivRef}\n className={\n captionsOptions?.height === 'full'\n ? captionsBannerFullHeightClassName(theme)\n : captionsBannerClassName(formFactor)\n }\n data-ui-id=\"captions-banner-inner\"\n >\n {captions.map((caption) => {\n /* @conditional-compile-remove(rtt) */\n if (caption.isRealTimeText) {\n return (\n <li key={caption.id} className={captionContainerClassName} data-is-focusable={true}>\n <RealTimeText {...caption} isTyping={caption.isPartial} onRenderAvatar={onRenderAvatar} />\n </li>\n );\n }\n return (\n <li key={caption.id} className={captionContainerClassName} data-is-focusable={true}>\n <_Caption {...caption} onRenderAvatar={onRenderAvatar} />\n </li>\n );\n })}\n </ul>\n )}\n {\n /* @conditional-compile-remove(rtt) */ isRealTimeTextOn && onSendRealTimeText && (\n <TextField\n label={strings.realTimeTextInputBoxDefaultText}\n value={textFieldValue}\n onKeyDown={handleKeyDown}\n onChange={(_, newValue) => {\n setTextFieldValue(newValue || '');\n onSendRealTimeText(newValue || '');\n }}\n />\n )\n }\n {!isCaptionsOn && /* @conditional-compile-remove(rtt) */ !isRealTimeTextOn && (\n <Stack\n verticalAlign=\"center\"\n styles={\n captionsOptions?.height === 'full'\n ? loadingBannerFullHeightStyles(theme)\n : loadingBannerStyles(formFactor)\n }\n data-is-focusable={true}\n >\n <Spinner label={strings?.captionsBannerSpinnerText} ariaLive=\"assertive\" labelPosition=\"right\" />\n </Stack>\n )}\n </FocusZone>\n )}\n </>\n );\n};\n"]}
|
@@ -29,6 +29,7 @@ export const MicrophoneButton = (props) => {
|
|
29
29
|
const localeStrings = useLocale().strings.microphoneButton;
|
30
30
|
const strings = Object.assign(Object.assign({}, localeStrings), props.strings);
|
31
31
|
const [announcerString, setAnnouncerString] = useState(undefined);
|
32
|
+
const [announcerPresent, setAnnouncerPresent] = useState(false);
|
32
33
|
const isSplit = (_a = props.split) !== null && _a !== void 0 ? _a : props.enableDeviceSelectionMenu;
|
33
34
|
// The button should be disabled when there are no mics. However if the button is a split button, if there are
|
34
35
|
// no mics but there are speakers, then only the primary part of the button should be disabled to allow for
|
@@ -110,9 +111,9 @@ export const MicrophoneButton = (props) => {
|
|
110
111
|
}
|
111
112
|
};
|
112
113
|
return (React.createElement(React.Fragment, null,
|
113
|
-
React.createElement(Announcer, { announcementString: announcerString, ariaLive: 'polite' }),
|
114
|
+
announcerPresent && React.createElement(Announcer, { announcementString: announcerString, ariaLive: 'polite' }),
|
114
115
|
React.createElement(ControlBarButton, Object.assign({}, props, { onClick: props.onToggleMicrophone ? onToggleClick : props.onClick, onRenderOnIcon: (_f = props.onRenderOnIcon) !== null && _f !== void 0 ? _f : onRenderMicOnIcon, onRenderOffIcon: (_g = props.onRenderOffIcon) !== null && _g !== void 0 ? _g : onRenderMicOffIcon, strings: strings, labelKey: (_h = props.labelKey) !== null && _h !== void 0 ? _h : 'microphoneButtonLabel', menuProps: (_j = props.menuProps) !== null && _j !== void 0 ? _j : (props.enableDeviceSelectionMenu
|
115
116
|
? generateDefaultDeviceMenuProps(Object.assign(Object.assign({}, props), { styles: (_k = props.styles) === null || _k === void 0 ? void 0 : _k.menuStyles }), strings, splitButtonPrimaryAction)
|
116
|
-
: undefined), menuIconProps: ((_l = props.menuIconProps) !== null && _l !== void 0 ? _l : !props.enableDeviceSelectionMenu) ? { hidden: true } : undefined, split: (_m = props.split) !== null && _m !== void 0 ? _m : props.enableDeviceSelectionMenu, "aria-roledescription": props.enableDeviceSelectionMenu ? strings.microphoneButtonSplitRoleDescription : undefined, "aria-description": strings.microphoneAriaDescription, splitButtonAriaLabel: props.enableDeviceSelectionMenu ? splitButtonAriaString : undefined, disabled: disabled, primaryDisabled: primaryDisabled }))));
|
117
|
+
: undefined), menuIconProps: ((_l = props.menuIconProps) !== null && _l !== void 0 ? _l : !props.enableDeviceSelectionMenu) ? { hidden: true } : undefined, split: (_m = props.split) !== null && _m !== void 0 ? _m : props.enableDeviceSelectionMenu, "aria-roledescription": props.enableDeviceSelectionMenu ? strings.microphoneButtonSplitRoleDescription : undefined, "aria-description": strings.microphoneAriaDescription, splitButtonAriaLabel: props.enableDeviceSelectionMenu ? splitButtonAriaString : undefined, disabled: disabled, primaryDisabled: primaryDisabled, onFocus: () => setAnnouncerPresent(true), onBlur: () => setAnnouncerPresent(false) }))));
|
117
118
|
};
|
118
119
|
//# sourceMappingURL=MicrophoneButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MicrophoneButton.js","sourceRoot":"","sources":["../../../../../../react-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K,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 Toggle,\n Stack,\n IStyleFunctionOrObject,\n IToggleStyleProps,\n IToggleStyles\n} 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 /**\n * Title for deep noise suppression button\n */\n deepNoiseSuppressionTitle?: string;\n /**\n * Noise Suppression turned on string for announcer\n */\n deepNoiseSuppressionOnAnnouncement?: string;\n /**\n * Noise Suppression turned off string for announcer\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 /**\n * Whether the deep noise suppression is on or off\n */\n isDeepNoiseSuppressionOn?: boolean;\n /**\n * Callback when noise suppression is clicked\n */\n onClickNoiseSuppression?: () => void;\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 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 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"]}
|
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,yBAA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C,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,EACzF,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,EACxC,MAAM,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAAC,IACxC,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 Toggle,\n Stack,\n IStyleFunctionOrObject,\n IToggleStyleProps,\n IToggleStyles\n} 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 /**\n * Title for deep noise suppression button\n */\n deepNoiseSuppressionTitle?: string;\n /**\n * Noise Suppression turned on string for announcer\n */\n deepNoiseSuppressionOnAnnouncement?: string;\n /**\n * Noise Suppression turned off string for announcer\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 /**\n * Whether the deep noise suppression is on or off\n */\n isDeepNoiseSuppressionOn?: boolean;\n /**\n * Callback when noise suppression is clicked\n */\n onClickNoiseSuppression?: () => void;\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 const [announcerPresent, setAnnouncerPresent] = useState<boolean>(false);\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 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 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 {announcerPresent && <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 onFocus={() => setAnnouncerPresent(true)}\n onBlur={() => setAnnouncerPresent(false)}\n />\n </>\n );\n};\n"]}
|