@azure/communication-react 1.23.0-alpha-202412280016 → 1.23.0-alpha-202501070017
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 +67 -74
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-DNw9lPCm.js → ChatMessageComponentAsRichTextEditBox-C3UeovlP.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-DNw9lPCm.js.map → ChatMessageComponentAsRichTextEditBox-C3UeovlP.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-B7thp1Ka.js → RichTextSendBoxWrapper-ygrhY_Ha.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-B7thp1Ka.js.map → RichTextSendBoxWrapper-ygrhY_Ha.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-DsEydAmC.js → index-DwKZbMg3.js} +70 -50
- package/dist/dist-cjs/communication-react/index-DwKZbMg3.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +2 -3
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.d.ts +2 -4
- package/dist/dist-esm/communication-react/src/index.js +1 -3
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.d.ts +12 -0
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +10 -3
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +1 -0
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js +12 -11
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +11 -4
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.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 +7 -9
- package/dist/dist-esm/react-components/src/components/RTTDisclosureBanner.js.map +1 -1
- 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/index.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/index.js +1 -1
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +4 -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 +12 -14
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +12 -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 +7 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingCaptionsBanner.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +3 -0
- package/package.json +1 -1
- package/dist/dist-cjs/communication-react/index-DsEydAmC.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-DwKZbMg3.js');
|
4
4
|
require('react');
|
5
5
|
require('@fluentui/react');
|
6
6
|
require('@fluentui/react-components');
|
@@ -121,11 +121,10 @@ 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;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -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-202501070017';\n"]}
|
@@ -95,10 +95,8 @@ 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';
|
104
102
|
export { StartRealTimeTextButton } from '../../react-components/src/components/StartRealTimeTextButton';
|
@@ -47,9 +47,7 @@ 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';
|
55
53
|
/* @conditional-compile-remove(rtt) */
|
@@ -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;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,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACt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AAsC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGjE,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 { 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(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"]}
|
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,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,s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,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"]}
|
@@ -47,6 +47,18 @@ export interface CaptionsBannerStrings {
|
|
47
47
|
* Default text for RTT input text box
|
48
48
|
*/
|
49
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;
|
50
62
|
}
|
51
63
|
/**
|
52
64
|
* @public
|
@@ -10,13 +10,14 @@ import { useLocale } from '../localization';
|
|
10
10
|
/* @conditional-compile-remove(rtt) */
|
11
11
|
import { RealTimeText } from './RealTimeText';
|
12
12
|
/* @conditional-compile-remove(rtt) */
|
13
|
-
import {
|
13
|
+
import { _RTTDisclosureBanner } from './RTTDisclosureBanner';
|
14
14
|
const SCROLL_OFFSET_ALLOWANCE = 20;
|
15
15
|
/**
|
16
16
|
* @public
|
17
17
|
* A component for displaying a CaptionsBanner with user icon, displayName and captions text.
|
18
18
|
*/
|
19
19
|
export const CaptionsBanner = (props) => {
|
20
|
+
var _a, _b, _c;
|
20
21
|
const { captions, isCaptionsOn, startCaptionsInProgress, onRenderAvatar, formFactor = 'default', captionsOptions,
|
21
22
|
/* @conditional-compile-remove(rtt) */
|
22
23
|
isRealTimeTextOn,
|
@@ -74,8 +75,14 @@ export const CaptionsBanner = (props) => {
|
|
74
75
|
}
|
75
76
|
}
|
76
77
|
};
|
77
|
-
|
78
|
-
|
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 })),
|
79
86
|
(isCaptionsOn || /* @conditional-compile-remove(rtt) */ isRealTimeTextOn) && (React.createElement("ul", { ref: captionsScrollDivRef, className: (captionsOptions === null || captionsOptions === void 0 ? void 0 : captionsOptions.height) === 'full'
|
80
87
|
? captionsBannerFullHeightClassName(theme)
|
81
88
|
: captionsBannerClassName(formFactor), "data-ui-id": "captions-banner-inner" }, captions.map((caption) => {
|
@@ -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,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,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAgH5D,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAEnC;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAA0B,EAAe,EAAE;IACxE,MAAM,E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AAC,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}\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 return (\n <>\n {(startCaptionsInProgress || /* @conditional-compile-remove(rtt) */ isRealTimeTextOn) && (\n <FocusZone shouldFocusOnMount className={captionsContainerClassName} data-ui-id=\"captions-banner\">\n {/* @conditional-compile-remove(rtt) */ isRealTimeTextOn && <RTTDisclosureBanner />}\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"]}
|
1
|
+
{"version":3,"file":"CaptionsBanner.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/CaptionsBanner.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,O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C,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"]}
|
@@ -86,6 +86,7 @@ export type ChatMyMessageComponentProps = {
|
|
86
86
|
onRemoveInlineImage?: (imageAttributes: Record<string, string>, messageId: string) => void;
|
87
87
|
onInsertInlineImage?: (imageAttributes: Record<string, string>, messageId: string) => void;
|
88
88
|
inlineImagesWithProgress?: AttachmentMetadataInProgress[];
|
89
|
+
onEditComplete?: () => void;
|
89
90
|
};
|
90
91
|
/**
|
91
92
|
* @private
|
@@ -19,7 +19,7 @@ import { removeBrokenImageContentAndClearImageSizeStyles } from '../../utils/Sen
|
|
19
19
|
*/
|
20
20
|
export const ChatMyMessageComponent = (props) => {
|
21
21
|
var _a, _b;
|
22
|
-
const { onDeleteMessage, onSendMessage, message } = props;
|
22
|
+
const { onDeleteMessage, onSendMessage, message, onEditComplete, onCancelEditMessage, onUpdateMessage } = props;
|
23
23
|
const [isEditing, setIsEditing] = useState(false);
|
24
24
|
const onEditClick = useCallback(() => setIsEditing(true), [setIsEditing]);
|
25
25
|
const clientMessageId = 'clientMessageId' in message ? message.clientMessageId : undefined;
|
@@ -66,19 +66,20 @@ export const ChatMyMessageComponent = (props) => {
|
|
66
66
|
if (`attachments` in message && attachments) {
|
67
67
|
message.attachments = attachments;
|
68
68
|
}
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
/* @conditional-compile-remove(file-sharing-acs) */
|
73
|
-
{ attachments: attachments }));
|
69
|
+
yield (onUpdateMessage === null || onUpdateMessage === void 0 ? void 0 : onUpdateMessage(message.messageId, text,
|
70
|
+
/* @conditional-compile-remove(file-sharing-acs) */
|
71
|
+
{ attachments: attachments }));
|
74
72
|
setIsEditing(false);
|
73
|
+
onEditComplete === null || onEditComplete === void 0 ? void 0 : onEditComplete();
|
75
74
|
});
|
76
|
-
}, [message,
|
75
|
+
}, [message, onEditComplete, onUpdateMessage]);
|
76
|
+
const onCancelHandler = useCallback((messageId) => {
|
77
|
+
onCancelEditMessage === null || onCancelEditMessage === void 0 ? void 0 : onCancelEditMessage(messageId);
|
78
|
+
setIsEditing(false);
|
79
|
+
onEditComplete === null || onEditComplete === void 0 ? void 0 : onEditComplete();
|
80
|
+
}, [onEditComplete, onCancelEditMessage]);
|
77
81
|
if (isEditing && message.messageType === 'chat') {
|
78
|
-
return (React.createElement(ChatMessageComponentAsEditBoxPicker, { message: message, strings: props.strings, onSubmit: onSubmitHandler, onCancel:
|
79
|
-
props.onCancelEditMessage && props.onCancelEditMessage(messageId);
|
80
|
-
setIsEditing(false);
|
81
|
-
},
|
82
|
+
return (React.createElement(ChatMessageComponentAsEditBoxPicker, { message: message, strings: props.strings, onSubmit: onSubmitHandler, onCancel: onCancelHandler,
|
82
83
|
/* @conditional-compile-remove(mention) */
|
83
84
|
mentionLookupOptions: (_a = props.mentionOptions) === null || _a === void 0 ? void 0 : _a.lookupOptions,
|
84
85
|
/* @conditional-compile-remove(rich-text-editor) */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChatMyMessageComponent.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAGlC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAcrD,OAAO,EAAE,qCAAqC,EAAE,MAAM,yCAAyC,CAAC;AAChG,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,gEAAgE;AAChE,OAAO,EAAE,+CAA+C,EAAE,MAAM,0BAA0B,CAAC;AA2F3F;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAkC,EAAe,EAAE;;IACxF,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC1D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ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,gEAAgE;YAChE,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,gEAAgE;YAChE,mBAAmB,EAAE,KAAK,CAAC,mBAAmB;YAC9C,gEAAgE;YAChE,wBAAwB,EAAE,KAAK,CAAC,wBAAwB;YACxD,gEAAgE;YAChE,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,GAC9C,CACH,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CACL,oBAAC,qCAAqC,oBAChC,KAAK,IACT,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,0DAA0D;YAC1D,uBAAuB,EAAE,KAAK,CAAC,uBAAuB,EACtD,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;YAC5C,0CAA0C;YAC1C,qBAAqB,EAAE,MAAA,KAAK,CAAC,cAAc,0CAAE,cAAc,IAC3D,CACH,CAAC;IACJ,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { _formatString } from '@internal/acs-ui-common';\nimport React, { useCallback, useState } from 'react';\nimport { MessageThreadStrings, UpdateMessageCallback } from '../../MessageThread';\nimport { ChatMessage, ComponentSlotStyle, OnRenderAvatarCallback } from '../../../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../../types';\nimport { AttachmentMenuAction } from '../../../types/Attachment';\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { AttachmentMetadataInProgress } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(mention) */\nimport { MentionOptions } from '../../MentionPopover';\nimport { InlineImageOptions } from '../ChatMessageContent';\nimport { ChatMyMessageComponentAsMessageBubble } from './ChatMyMessageComponentAsMessageBubble';\nimport { ChatMessageComponentAsEditBoxPicker } from './ChatMessageComponentAsEditBoxPicker';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { removeBrokenImageContentAndClearImageSizeStyles } from '../../utils/SendBoxUtils';\n\n/**\n * Props for the ChatMyMessageComponent component.\n */\nexport type ChatMyMessageComponentProps = {\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;\n userId: string;\n messageContainerStyle?: ComponentSlotStyle;\n showDate?: boolean;\n disableEditing?: boolean;\n onUpdateMessage?: UpdateMessageCallback;\n onCancelEditMessage?: (messageId: string) => void;\n /**\n * Callback to delete a message. Also called before resending a message that failed to send.\n * @param messageId ID of the message to delete\n */\n onDeleteMessage?: (messageId: string) => Promise<void>;\n /**\n * Callback to send a message\n * @param content The message content to send\n */\n onSendMessage?: (\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n options?: MessageOptions\n ) => Promise<void>;\n strings: MessageThreadStrings;\n messageStatus?: string;\n /**\n * Optional text to display when the message status is 'failed'.\n */\n failureReason?: string;\n /**\n * Whether the status indicator for each message is displayed or not.\n */\n showMessageStatus?: boolean;\n /**\n * Whether to overlap avatar and message when the view is width constrained.\n */\n shouldOverlapAvatarAndMessage: boolean;\n remoteParticipantsCount?: number;\n onActionButtonClick: (\n message: ChatMessage,\n setMessageReadBy: (readBy: { id: string; displayName: string }[]) => void\n ) => void;\n /**\n * Optional callback to override render of the avatar.\n *\n * @param userId - user Id\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n /* @conditional-compile-remove(date-time-customization) */\n /**\n * Optional function to provide customized date format.\n * @beta\n */\n onDisplayDateTimeString?: (messageDate: Date) => string;\n /* @conditional-compile-remove(mention) */\n /**\n * Optional props needed to lookup suggestions and display mentions in the mention scenario.\n * @beta\n */\n mentionOptions?: MentionOptions;\n /**\n * Optional callback called when an inline image is clicked.\n * @beta\n */\n inlineImageOptions?: InlineImageOptions;\n /**\n * Optional callback to render message attachments in the message component.\n * @beta\n */\n onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;\n /**\n * Optional callback to define custom actions for attachments.\n * @beta\n */\n actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled?: boolean;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste?: (event: { content: DocumentFragment }) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage?: (imageAttributes: Record<string, string>, messageId: string) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage?: (imageAttributes: Record<string, string>, messageId: string) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress?: AttachmentMetadataInProgress[];\n};\n\n/**\n * @private\n */\nexport const ChatMyMessageComponent = (props: ChatMyMessageComponentProps): JSX.Element => {\n const { onDeleteMessage, onSendMessage, message } = props;\n const [isEditing, setIsEditing] = useState(false);\n\n const onEditClick = useCallback(() => setIsEditing(true), [setIsEditing]);\n\n const clientMessageId = 'clientMessageId' in message ? message.clientMessageId : undefined;\n const content = 'content' in message ? message.content : undefined;\n const onRemoveClick = useCallback(() => {\n if (onDeleteMessage && message.messageId) {\n onDeleteMessage(message.messageId);\n }\n // when fail to send, message does not have message id, delete message using clientMessageId\n else if (onDeleteMessage && message.messageType === 'chat' && clientMessageId) {\n onDeleteMessage(clientMessageId);\n }\n }, [onDeleteMessage, message.messageId, message.messageType, clientMessageId]);\n\n const onResendClick = useCallback(() => {\n onDeleteMessage && clientMessageId && onDeleteMessage(clientMessageId);\n let newContent = content ?? '';\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n newContent = removeBrokenImageContentAndClearImageSizeStyles(newContent);\n onSendMessage &&\n onSendMessage(\n newContent,\n /* @conditional-compile-remove(file-sharing-acs) */\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n {\n /* @conditional-compile-remove(file-sharing-acs) */ attachments:\n `attachments` in message ? message.attachments : undefined,\n /* @conditional-compile-remove(rich-text-editor) */\n type: props.isRichTextEditorEnabled ? 'html' : 'text'\n }\n );\n }, [\n message,\n onDeleteMessage,\n clientMessageId,\n onSendMessage,\n content,\n /* @conditional-compile-remove(rich-text-editor) */ props.isRichTextEditorEnabled\n ]);\n\n const onSubmitHandler = useCallback(\n // due to a bug in babel, we can't use arrow function here\n // affecting conditional-compile-remove(attachment-upload)\n async function (\n text: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachments?: AttachmentMetadata[] | undefined\n ) {\n /* @conditional-compile-remove(file-sharing-acs) */\n if (`attachments` in message && attachments) {\n message.attachments = attachments;\n }\n props.onUpdateMessage &&\n message.messageId &&\n (await props.onUpdateMessage(\n message.messageId,\n text,\n /* @conditional-compile-remove(file-sharing-acs) */\n { attachments: attachments }\n ));\n setIsEditing(false);\n },\n [message, props]\n );\n if (isEditing && message.messageType === 'chat') {\n return (\n <ChatMessageComponentAsEditBoxPicker\n message={message}\n strings={props.strings}\n onSubmit={onSubmitHandler}\n onCancel={(messageId) => {\n props.onCancelEditMessage && props.onCancelEditMessage(messageId);\n setIsEditing(false);\n }}\n /* @conditional-compile-remove(mention) */\n mentionLookupOptions={props.mentionOptions?.lookupOptions}\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled={props.isRichTextEditorEnabled}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste={props.onPaste}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage={props.onInsertInlineImage}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress={props.inlineImagesWithProgress}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage={props.onRemoveInlineImage}\n />\n );\n } else {\n return (\n <ChatMyMessageComponentAsMessageBubble\n {...props}\n onRemoveClick={onRemoveClick}\n onEditClick={onEditClick}\n onResendClick={onResendClick}\n onRenderAvatar={props.onRenderAvatar}\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString={props.onDisplayDateTimeString}\n strings={props.strings}\n inlineImageOptions={props.inlineImageOptions}\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions={props.mentionOptions?.displayOptions}\n />\n );\n }\n};\n"]}
|
1
|
+
{"version":3,"file":"ChatMyMessageComponent.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAGlC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAcrD,OAAO,EAAE,qCAAqC,EAAE,MAAM,yCAAyC,CAAC;AAChG,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,gEAAgE;AAChE,OAAO,EAAE,+CAA+C,EAAE,MAAM,0BAA0B,CAAC;AA6F3F;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAkC,EAAe,EAAE;;IACxF,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAChH,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAE1E,MAAM,eAAe,GAAG,iBAAiB,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3F,MAAM,OAAO,GAAG,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IACn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AmB,GAC9C,CACH,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CACL,oBAAC,qCAAqC,oBAChC,KAAK,IACT,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,0DAA0D;YAC1D,uBAAuB,EAAE,KAAK,CAAC,uBAAuB,EACtD,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;YAC5C,0CAA0C;YAC1C,qBAAqB,EAAE,MAAA,KAAK,CAAC,cAAc,0CAAE,cAAc,IAC3D,CACH,CAAC;IACJ,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { _formatString } from '@internal/acs-ui-common';\nimport React, { useCallback, useState } from 'react';\nimport { MessageThreadStrings, UpdateMessageCallback } from '../../MessageThread';\nimport { ChatMessage, ComponentSlotStyle, OnRenderAvatarCallback } from '../../../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../../types';\nimport { AttachmentMenuAction } from '../../../types/Attachment';\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { AttachmentMetadataInProgress } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(mention) */\nimport { MentionOptions } from '../../MentionPopover';\nimport { InlineImageOptions } from '../ChatMessageContent';\nimport { ChatMyMessageComponentAsMessageBubble } from './ChatMyMessageComponentAsMessageBubble';\nimport { ChatMessageComponentAsEditBoxPicker } from './ChatMessageComponentAsEditBoxPicker';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { removeBrokenImageContentAndClearImageSizeStyles } from '../../utils/SendBoxUtils';\n\n/**\n * Props for the ChatMyMessageComponent component.\n */\nexport type ChatMyMessageComponentProps = {\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;\n userId: string;\n messageContainerStyle?: ComponentSlotStyle;\n showDate?: boolean;\n disableEditing?: boolean;\n onUpdateMessage?: UpdateMessageCallback;\n onCancelEditMessage?: (messageId: string) => void;\n /**\n * Callback to delete a message. Also called before resending a message that failed to send.\n * @param messageId ID of the message to delete\n */\n onDeleteMessage?: (messageId: string) => Promise<void>;\n /**\n * Callback to send a message\n * @param content The message content to send\n */\n onSendMessage?: (\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n options?: MessageOptions\n ) => Promise<void>;\n strings: MessageThreadStrings;\n messageStatus?: string;\n /**\n * Optional text to display when the message status is 'failed'.\n */\n failureReason?: string;\n /**\n * Whether the status indicator for each message is displayed or not.\n */\n showMessageStatus?: boolean;\n /**\n * Whether to overlap avatar and message when the view is width constrained.\n */\n shouldOverlapAvatarAndMessage: boolean;\n remoteParticipantsCount?: number;\n onActionButtonClick: (\n message: ChatMessage,\n setMessageReadBy: (readBy: { id: string; displayName: string }[]) => void\n ) => void;\n /**\n * Optional callback to override render of the avatar.\n *\n * @param userId - user Id\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n /* @conditional-compile-remove(date-time-customization) */\n /**\n * Optional function to provide customized date format.\n * @beta\n */\n onDisplayDateTimeString?: (messageDate: Date) => string;\n /* @conditional-compile-remove(mention) */\n /**\n * Optional props needed to lookup suggestions and display mentions in the mention scenario.\n * @beta\n */\n mentionOptions?: MentionOptions;\n /**\n * Optional callback called when an inline image is clicked.\n * @beta\n */\n inlineImageOptions?: InlineImageOptions;\n /**\n * Optional callback to render message attachments in the message component.\n * @beta\n */\n onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;\n /**\n * Optional callback to define custom actions for attachments.\n * @beta\n */\n actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled?: boolean;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste?: (event: { content: DocumentFragment }) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage?: (imageAttributes: Record<string, string>, messageId: string) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage?: (imageAttributes: Record<string, string>, messageId: string) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress?: AttachmentMetadataInProgress[];\n // Optional callback called when editing is complete (submitted or cancelled).\n onEditComplete?: () => void;\n};\n\n/**\n * @private\n */\nexport const ChatMyMessageComponent = (props: ChatMyMessageComponentProps): JSX.Element => {\n const { onDeleteMessage, onSendMessage, message, onEditComplete, onCancelEditMessage, onUpdateMessage } = props;\n const [isEditing, setIsEditing] = useState(false);\n\n const onEditClick = useCallback(() => setIsEditing(true), [setIsEditing]);\n\n const clientMessageId = 'clientMessageId' in message ? message.clientMessageId : undefined;\n const content = 'content' in message ? message.content : undefined;\n const onRemoveClick = useCallback(() => {\n if (onDeleteMessage && message.messageId) {\n onDeleteMessage(message.messageId);\n }\n // when fail to send, message does not have message id, delete message using clientMessageId\n else if (onDeleteMessage && message.messageType === 'chat' && clientMessageId) {\n onDeleteMessage(clientMessageId);\n }\n }, [onDeleteMessage, message.messageId, message.messageType, clientMessageId]);\n\n const onResendClick = useCallback(() => {\n onDeleteMessage && clientMessageId && onDeleteMessage(clientMessageId);\n let newContent = content ?? '';\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n newContent = removeBrokenImageContentAndClearImageSizeStyles(newContent);\n onSendMessage &&\n onSendMessage(\n newContent,\n /* @conditional-compile-remove(file-sharing-acs) */\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n {\n /* @conditional-compile-remove(file-sharing-acs) */ attachments:\n `attachments` in message ? message.attachments : undefined,\n /* @conditional-compile-remove(rich-text-editor) */\n type: props.isRichTextEditorEnabled ? 'html' : 'text'\n }\n );\n }, [\n message,\n onDeleteMessage,\n clientMessageId,\n onSendMessage,\n content,\n /* @conditional-compile-remove(rich-text-editor) */ props.isRichTextEditorEnabled\n ]);\n\n const onSubmitHandler = useCallback(\n // due to a bug in babel, we can't use arrow function here\n // affecting conditional-compile-remove(attachment-upload)\n async function (\n text: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachments?: AttachmentMetadata[] | undefined\n ) {\n /* @conditional-compile-remove(file-sharing-acs) */\n if (`attachments` in message && attachments) {\n message.attachments = attachments;\n }\n await onUpdateMessage?.(\n message.messageId,\n text,\n /* @conditional-compile-remove(file-sharing-acs) */\n { attachments: attachments }\n );\n setIsEditing(false);\n onEditComplete?.();\n },\n [message, onEditComplete, onUpdateMessage]\n );\n\n const onCancelHandler = useCallback(\n (messageId: string) => {\n onCancelEditMessage?.(messageId);\n setIsEditing(false);\n onEditComplete?.();\n },\n [onEditComplete, onCancelEditMessage]\n );\n\n if (isEditing && message.messageType === 'chat') {\n return (\n <ChatMessageComponentAsEditBoxPicker\n message={message}\n strings={props.strings}\n onSubmit={onSubmitHandler}\n onCancel={onCancelHandler}\n /* @conditional-compile-remove(mention) */\n mentionLookupOptions={props.mentionOptions?.lookupOptions}\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled={props.isRichTextEditorEnabled}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste={props.onPaste}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage={props.onInsertInlineImage}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress={props.inlineImagesWithProgress}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage={props.onRemoveInlineImage}\n />\n );\n } else {\n return (\n <ChatMyMessageComponentAsMessageBubble\n {...props}\n onRemoveClick={onRemoveClick}\n onEditClick={onEditClick}\n onResendClick={onResendClick}\n onRenderAvatar={props.onRenderAvatar}\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString={props.onDisplayDateTimeString}\n strings={props.strings}\n inlineImageOptions={props.inlineImageOptions}\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions={props.mentionOptions?.displayOptions}\n />\n );\n }\n};\n"]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT License.
|
3
|
-
import React, { useCallback, useMemo } from 'react';
|
3
|
+
import React, { useCallback, useMemo, useRef } from 'react';
|
4
4
|
import { noMessageStatusStyle, useChatMessageRenderStyles } from '../../styles/MessageThread.styles';
|
5
5
|
import { mergeStyles } from '@fluentui/react';
|
6
6
|
import { mergeClasses } from '@fluentui/react-components';
|
@@ -33,12 +33,17 @@ export const FluentChatMyMessageComponent = (props) => {
|
|
33
33
|
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
34
34
|
onInsertInlineImage } = props;
|
35
35
|
const chatMessageRenderStyles = useChatMessageRenderStyles();
|
36
|
+
const fluentMessageBodyRef = useRef(null);
|
37
|
+
const onEditComplete = useCallback(() => {
|
38
|
+
var _a;
|
39
|
+
(_a = fluentMessageBodyRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
40
|
+
}, []);
|
36
41
|
// To rerender the defaultChatMessageRenderer if app running across days(every new day chat time stamp
|
37
42
|
// needs to be regenerated), the dependency on "new Date().toDateString()"" is added.
|
38
43
|
const defaultChatMessageRenderer = useCallback((messageProps) => {
|
39
44
|
if (messageProps.message.messageType === 'chat' ||
|
40
45
|
/* @conditional-compile-remove(data-loss-prevention) */ messageProps.message.messageType === 'blocked') {
|
41
|
-
return (React.createElement(ChatMyMessageComponent, Object.assign({}, messageProps, { onRenderAttachmentDownloads: onRenderAttachmentDownloads, strings: messageProps.strings, message: messageProps.message, userId: userId, remoteParticipantsCount: participantCount ? participantCount - 1 : 0, shouldOverlapAvatarAndMessage: shouldOverlapAvatarAndMessage, onRenderAvatar: onRenderAvatar, showMessageStatus: showMessageStatus, messageStatus: messageProps.message.status, onActionButtonClick: onActionButtonClick,
|
46
|
+
return (React.createElement(ChatMyMessageComponent, Object.assign({}, messageProps, { onEditComplete: onEditComplete, onRenderAttachmentDownloads: onRenderAttachmentDownloads, strings: messageProps.strings, message: messageProps.message, userId: userId, remoteParticipantsCount: participantCount ? participantCount - 1 : 0, shouldOverlapAvatarAndMessage: shouldOverlapAvatarAndMessage, onRenderAvatar: onRenderAvatar, showMessageStatus: showMessageStatus, messageStatus: messageProps.message.status, onActionButtonClick: onActionButtonClick,
|
42
47
|
/* @conditional-compile-remove(date-time-customization) */
|
43
48
|
onDisplayDateTimeString: onDisplayDateTimeString, inlineImageOptions: inlineImageOptions,
|
44
49
|
/* @conditional-compile-remove(mention) */
|
@@ -80,7 +85,8 @@ export const FluentChatMyMessageComponent = (props) => {
|
|
80
85
|
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
81
86
|
onInsertInlineImage,
|
82
87
|
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
83
|
-
inlineImagesWithProgress
|
88
|
+
inlineImagesWithProgress,
|
89
|
+
onEditComplete
|
84
90
|
]);
|
85
91
|
const messageRenderer = useCallback((messageProps) => {
|
86
92
|
return onRenderMessage === undefined
|
@@ -105,7 +111,8 @@ export const FluentChatMyMessageComponent = (props) => {
|
|
105
111
|
}, [chatMessageRenderStyles.rootCommon, chatMessageRenderStyles.rootMyMessage, styles === null || styles === void 0 ? void 0 : styles.myChatItemMessageContainer]);
|
106
112
|
const myMessageBodyProps = useMemo(() => {
|
107
113
|
return {
|
108
|
-
className: mergeClasses(chatMessageRenderStyles.bodyCommon, chatMessageRenderStyles.bodyMyMessage)
|
114
|
+
className: mergeClasses(chatMessageRenderStyles.bodyCommon, chatMessageRenderStyles.bodyMyMessage),
|
115
|
+
ref: fluentMessageBodyRef
|
109
116
|
};
|
110
117
|
}, [chatMessageRenderStyles.bodyCommon, chatMessageRenderStyles.bodyMyMessage]);
|
111
118
|
const myMessageStatusIcon = useMemo(() => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FluentChatMyMessageComponent.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAKpD,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AACrG,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,aAAa,IAAI,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAGjF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAA6C,EAAe,EAAE;IACzG,MAAM,EACJ,OAAO,EACP,MAAM,EACN,6BAA6B,EAC7B,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,SAAS,EACT,mBAAmB;IACnB,0DAA0D;IAC1D,uBAAuB,EACvB,kBAAkB;IAClB,0CAA0C;IAC1C,cAAc,EACd,MAAM,EACN,qBAAqB,EACrB,cAAc,EACd,oBAAoB,EACpB,2BAA2B;IAC3B,mDAAmD;IACnD,uBAAuB;IACvB,gEAAgE;IAChE,OAAO;IACP,gEAAgE;IAChE,wBAAwB;IACxB,gEAAgE;IAChE,mBAAmB;IACnB,gEAAgE;IAChE,mBAAmB,EACpB,GAAG,KAAK,CAAC;IACV,MAAM,uBAAuB,GAAG,0BAA0B,EAAE,CAAC;IAE7D,sGAAsG;IACtG,qFAAq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,qBAAqB,CACnB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,CACV;YACH,CAAC,CAAC,SAAS,CACT,CACP,CAAC;IACJ,CAAC,EAAE;QACD,qBAAqB;QACrB,OAAO,CAAC,IAAI;QACZ,OAAO,CAAC,MAAM;QACd,qBAAqB;QACrB,qBAAqB;QACrB,gBAAgB;QAChB,SAAS;QACT,iBAAiB;QACjB,MAAM;KACP,CAAC,CAAC;IAEH,8EAA8E;IAC9E,uFAAuF;IACvF,iFAAiF;IACjF,2EAA2E;IAC3E,OAAO,CACL,oBAAC,mBAAmB,IAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,kBAAkB,EACxB,IAAI,EAAE,kBAAkB,EACxB,UAAU,EAAE,mBAAmB,IAE9B,eAAe,mBAAM,KAAK,EAAG,CACV,CACvB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { MessageStatus, _formatString } from '@internal/acs-ui-common';\nimport React, { useCallback, useMemo } from 'react';\nimport { MessageProps, _ChatMessageProps } from '../../MessageThread';\nimport { ChatMessage } from '../../../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../../types';\nimport { noMessageStatusStyle, useChatMessageRenderStyles } from '../../styles/MessageThread.styles';\nimport { mergeStyles } from '@fluentui/react';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { createStyleFromV8Style } from '../../styles/v8StyleShim';\nimport { MessageStatusIndicatorProps } from '../../MessageStatusIndicator';\nimport { ChatMyMessageComponent } from './ChatMyMessageComponent';\nimport { ChatMyMessage as FluentChatMyMessage } from '@fluentui-contrib/react-chat';\nimport { getFluentUIAttachedValue } from '../../utils/ChatMessageComponentUtils';\nimport type { FluentChatMessageComponentWrapperProps } from '../MessageComponents/FluentChatMessageComponent';\n\n/**\n * The component for rendering a chat message using Fluent UI components\n * and handling default and custom renderers.\n * This component handles rendering for chat message body, avatar and message status.\n * The chat message body, avatar and message status should be shown for both default and custom renderers.\n *\n * @private\n */\nexport const FluentChatMyMessageComponent = (props: FluentChatMessageComponentWrapperProps): JSX.Element => {\n const {\n message,\n styles,\n shouldOverlapAvatarAndMessage,\n onRenderMessage,\n onRenderAvatar,\n showMessageStatus,\n onRenderMessageStatus,\n participantCount,\n readCount,\n onActionButtonClick,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */\n mentionOptions,\n userId,\n defaultStatusRenderer,\n statusToRender,\n actionsForAttachment,\n onRenderAttachmentDownloads,\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage\n } = props;\n const chatMessageRenderStyles = useChatMessageRenderStyles();\n\n // To rerender the defaultChatMessageRenderer if app running across days(every new day chat time stamp\n // needs to be regenerated), the dependency on \"new Date().toDateString()\"\" is added.\n const defaultChatMessageRenderer = useCallback(\n (messageProps: MessageProps) => {\n if (\n messageProps.message.messageType === 'chat' ||\n /* @conditional-compile-remove(data-loss-prevention) */ messageProps.message.messageType === 'blocked'\n ) {\n return (\n <ChatMyMessageComponent\n {...messageProps}\n onRenderAttachmentDownloads={onRenderAttachmentDownloads}\n strings={messageProps.strings}\n message={messageProps.message}\n userId={userId}\n remoteParticipantsCount={participantCount ? participantCount - 1 : 0}\n shouldOverlapAvatarAndMessage={shouldOverlapAvatarAndMessage}\n onRenderAvatar={onRenderAvatar}\n showMessageStatus={showMessageStatus}\n messageStatus={messageProps.message.status}\n onActionButtonClick={onActionButtonClick}\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString={onDisplayDateTimeString}\n inlineImageOptions={inlineImageOptions}\n /* @conditional-compile-remove(mention) */\n mentionOptions={mentionOptions}\n actionsForAttachment={actionsForAttachment}\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled={isRichTextEditorEnabled}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste={onPaste}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage={onRemoveInlineImage}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage={onInsertInlineImage}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress={inlineImagesWithProgress}\n />\n );\n }\n return <></>;\n },\n [\n onActionButtonClick,\n onRenderAvatar,\n participantCount,\n shouldOverlapAvatarAndMessage,\n showMessageStatus,\n userId,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */\n mentionOptions,\n onRenderAttachmentDownloads,\n actionsForAttachment,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n new Date().toDateString(),\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress\n ]\n );\n\n const messageRenderer = useCallback(\n (messageProps: MessageProps) => {\n return onRenderMessage === undefined\n ? defaultChatMessageRenderer({ ...messageProps })\n : onRenderMessage(messageProps, defaultChatMessageRenderer);\n },\n [defaultChatMessageRenderer, onRenderMessage]\n );\n\n const messageStatusRenderer = useCallback(\n (\n onRenderMessageStatus:\n | ((messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null)\n | undefined,\n defaultStatusRenderer: (\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage,\n participantCount: number,\n readCount: number,\n status?: MessageStatus\n ) => JSX.Element,\n showMessageStatus?: boolean,\n participantCount?: number,\n readCount?: number\n ) => {\n return showMessageStatus && statusToRender ? (\n onRenderMessageStatus ? (\n onRenderMessageStatus({ status: message.status })\n ) : (\n defaultStatusRenderer(message, participantCount ?? 0, readCount ?? 0, message.status)\n )\n ) : (\n <div className={mergeStyles(noMessageStatusStyle)} />\n );\n },\n [message, statusToRender]\n );\n\n const attached = useMemo(() => {\n return getFluentUIAttachedValue(message.attached);\n }, [message.attached]);\n\n const myMessageRootProps = useMemo(() => {\n return {\n // myChatItemMessageContainer used in className and style prop as style prop can't handle CSS selectors\n className: mergeClasses(\n chatMessageRenderStyles.rootMyMessage,\n chatMessageRenderStyles.rootCommon,\n mergeStyles(styles?.myChatItemMessageContainer)\n ),\n style:\n styles?.myChatItemMessageContainer !== undefined\n ? createStyleFromV8Style(styles?.myChatItemMessageContainer)\n : {},\n role: 'none'\n };\n }, [chatMessageRenderStyles.rootCommon, chatMessageRenderStyles.rootMyMessage, styles?.myChatItemMessageContainer]);\n\n const myMessageBodyProps = useMemo(() => {\n return {\n className: mergeClasses(chatMessageRenderStyles.bodyCommon, chatMessageRenderStyles.bodyMyMessage)\n };\n }, [chatMessageRenderStyles.bodyCommon, chatMessageRenderStyles.bodyMyMessage]);\n\n const myMessageStatusIcon = useMemo(() => {\n return (\n <div\n className={mergeStyles(\n { paddingLeft: '0.25rem' },\n styles?.messageStatusContainer ? styles.messageStatusContainer(message.mine ?? false) : ''\n )}\n >\n {message.status\n ? messageStatusRenderer(\n onRenderMessageStatus,\n defaultStatusRenderer,\n showMessageStatus,\n participantCount,\n readCount\n )\n : undefined}\n </div>\n );\n }, [\n defaultStatusRenderer,\n message.mine,\n message.status,\n messageStatusRenderer,\n onRenderMessageStatus,\n participantCount,\n readCount,\n showMessageStatus,\n styles\n ]);\n\n // Fluent UI message components are used here as for default message renderer,\n // timestamp and author name should be shown but they aren't shown for custom renderer.\n // More investigations are needed to check if this can be simplified with states.\n // Status and avatar should be shown for both custom and default renderers.\n return (\n <FluentChatMyMessage\n attached={attached}\n root={myMessageRootProps}\n body={myMessageBodyProps}\n statusIcon={myMessageStatusIcon}\n >\n {messageRenderer({ ...props })}\n </FluentChatMyMessage>\n );\n};\n"]}
|
1
|
+
{"version":3,"file":"FluentChatMyMessageComponent.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAK5D,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AACrG,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,aAAa,IAAI,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAGjF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAA6C,EAAe,EAAE;IACzG,MAAM,EACJ,OAAO,EACP,MAAM,EACN,6BAA6B,EAC7B,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,SAAS,EACT,mBAAmB;IACnB,0DAA0D;IAC1D,uBAAuB,EACvB,kBAAkB;IAClB,0CAA0C;IAC1C,cAAc,EACd,MAAM,EACN,qBAAqB,EACrB,cAAc,EACd,oBAAoB,EACpB,2BAA2B;IAC3B,mDAAmD;IACnD,uBAAuB;IACvB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GAAG,EAAE,oBAAoB;SAC1B,CAAC;IACJ,CAAC,EAAE,CAAC,uBAAuB,CAAC,UAAU,EAAE,uBAAuB,CAAC,aAAa,CAAC,CAAC,CAAC;IAEhF,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,EAAE;;QACvC,OAAO,CACL,6BACE,SAAS,EAAE,WAAW,CACpB,EAAE,WAAW,EAAE,SAAS,EAAE,EAC1B,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,sBAAsB,EAAC,CAAC,CAAC,MAAM,CAAC,sBAAsB,CAAC,MAAA,OAAO,CAAC,IAAI,mCAAI,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAC3F,IAEA,OAAO,CAAC,MAAM;YACb,CAAC,CAAC,qBAAqB,CACnB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,CACV;YACH,CAAC,CAAC,SAAS,CACT,CACP,CAAC;IACJ,CAAC,EAAE;QACD,qBAAqB;QACrB,OAAO,CAAC,IAAI;QACZ,OAAO,CAAC,MAAM;QACd,qBAAqB;QACrB,qBAAqB;QACrB,gBAAgB;QAChB,SAAS;QACT,iBAAiB;QACjB,MAAM;KACP,CAAC,CAAC;IAEH,8EAA8E;IAC9E,uFAAuF;IACvF,iFAAiF;IACjF,2EAA2E;IAC3E,OAAO,CACL,oBAAC,mBAAmB,IAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,kBAAkB,EACxB,IAAI,EAAE,kBAAkB,EACxB,UAAU,EAAE,mBAAmB,IAE9B,eAAe,mBAAM,KAAK,EAAG,CACV,CACvB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { MessageStatus, _formatString } from '@internal/acs-ui-common';\nimport React, { useCallback, useMemo, useRef } from 'react';\nimport { MessageProps, _ChatMessageProps } from '../../MessageThread';\nimport { ChatMessage } from '../../../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../../types';\nimport { noMessageStatusStyle, useChatMessageRenderStyles } from '../../styles/MessageThread.styles';\nimport { mergeStyles } from '@fluentui/react';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { createStyleFromV8Style } from '../../styles/v8StyleShim';\nimport { MessageStatusIndicatorProps } from '../../MessageStatusIndicator';\nimport { ChatMyMessageComponent } from './ChatMyMessageComponent';\nimport { ChatMyMessage as FluentChatMyMessage } from '@fluentui-contrib/react-chat';\nimport { getFluentUIAttachedValue } from '../../utils/ChatMessageComponentUtils';\nimport type { FluentChatMessageComponentWrapperProps } from '../MessageComponents/FluentChatMessageComponent';\n\n/**\n * The component for rendering a chat message using Fluent UI components\n * and handling default and custom renderers.\n * This component handles rendering for chat message body, avatar and message status.\n * The chat message body, avatar and message status should be shown for both default and custom renderers.\n *\n * @private\n */\nexport const FluentChatMyMessageComponent = (props: FluentChatMessageComponentWrapperProps): JSX.Element => {\n const {\n message,\n styles,\n shouldOverlapAvatarAndMessage,\n onRenderMessage,\n onRenderAvatar,\n showMessageStatus,\n onRenderMessageStatus,\n participantCount,\n readCount,\n onActionButtonClick,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */\n mentionOptions,\n userId,\n defaultStatusRenderer,\n statusToRender,\n actionsForAttachment,\n onRenderAttachmentDownloads,\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage\n } = props;\n const chatMessageRenderStyles = useChatMessageRenderStyles();\n const fluentMessageBodyRef = useRef<HTMLDivElement>(null);\n\n const onEditComplete = useCallback(() => {\n fluentMessageBodyRef.current?.focus();\n }, []);\n\n // To rerender the defaultChatMessageRenderer if app running across days(every new day chat time stamp\n // needs to be regenerated), the dependency on \"new Date().toDateString()\"\" is added.\n const defaultChatMessageRenderer = useCallback(\n (messageProps: MessageProps) => {\n if (\n messageProps.message.messageType === 'chat' ||\n /* @conditional-compile-remove(data-loss-prevention) */ messageProps.message.messageType === 'blocked'\n ) {\n return (\n <ChatMyMessageComponent\n {...messageProps}\n onEditComplete={onEditComplete}\n onRenderAttachmentDownloads={onRenderAttachmentDownloads}\n strings={messageProps.strings}\n message={messageProps.message}\n userId={userId}\n remoteParticipantsCount={participantCount ? participantCount - 1 : 0}\n shouldOverlapAvatarAndMessage={shouldOverlapAvatarAndMessage}\n onRenderAvatar={onRenderAvatar}\n showMessageStatus={showMessageStatus}\n messageStatus={messageProps.message.status}\n onActionButtonClick={onActionButtonClick}\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString={onDisplayDateTimeString}\n inlineImageOptions={inlineImageOptions}\n /* @conditional-compile-remove(mention) */\n mentionOptions={mentionOptions}\n actionsForAttachment={actionsForAttachment}\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled={isRichTextEditorEnabled}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste={onPaste}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage={onRemoveInlineImage}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage={onInsertInlineImage}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress={inlineImagesWithProgress}\n />\n );\n }\n return <></>;\n },\n [\n onActionButtonClick,\n onRenderAvatar,\n participantCount,\n shouldOverlapAvatarAndMessage,\n showMessageStatus,\n userId,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */\n mentionOptions,\n onRenderAttachmentDownloads,\n actionsForAttachment,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n new Date().toDateString(),\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress,\n onEditComplete\n ]\n );\n\n const messageRenderer = useCallback(\n (messageProps: MessageProps) => {\n return onRenderMessage === undefined\n ? defaultChatMessageRenderer({ ...messageProps })\n : onRenderMessage(messageProps, defaultChatMessageRenderer);\n },\n [defaultChatMessageRenderer, onRenderMessage]\n );\n\n const messageStatusRenderer = useCallback(\n (\n onRenderMessageStatus:\n | ((messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null)\n | undefined,\n defaultStatusRenderer: (\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage,\n participantCount: number,\n readCount: number,\n status?: MessageStatus\n ) => JSX.Element,\n showMessageStatus?: boolean,\n participantCount?: number,\n readCount?: number\n ) => {\n return showMessageStatus && statusToRender ? (\n onRenderMessageStatus ? (\n onRenderMessageStatus({ status: message.status })\n ) : (\n defaultStatusRenderer(message, participantCount ?? 0, readCount ?? 0, message.status)\n )\n ) : (\n <div className={mergeStyles(noMessageStatusStyle)} />\n );\n },\n [message, statusToRender]\n );\n\n const attached = useMemo(() => {\n return getFluentUIAttachedValue(message.attached);\n }, [message.attached]);\n\n const myMessageRootProps = useMemo(() => {\n return {\n // myChatItemMessageContainer used in className and style prop as style prop can't handle CSS selectors\n className: mergeClasses(\n chatMessageRenderStyles.rootMyMessage,\n chatMessageRenderStyles.rootCommon,\n mergeStyles(styles?.myChatItemMessageContainer)\n ),\n style:\n styles?.myChatItemMessageContainer !== undefined\n ? createStyleFromV8Style(styles?.myChatItemMessageContainer)\n : {},\n role: 'none'\n };\n }, [chatMessageRenderStyles.rootCommon, chatMessageRenderStyles.rootMyMessage, styles?.myChatItemMessageContainer]);\n\n const myMessageBodyProps = useMemo(() => {\n return {\n className: mergeClasses(chatMessageRenderStyles.bodyCommon, chatMessageRenderStyles.bodyMyMessage),\n ref: fluentMessageBodyRef\n };\n }, [chatMessageRenderStyles.bodyCommon, chatMessageRenderStyles.bodyMyMessage]);\n\n const myMessageStatusIcon = useMemo(() => {\n return (\n <div\n className={mergeStyles(\n { paddingLeft: '0.25rem' },\n styles?.messageStatusContainer ? styles.messageStatusContainer(message.mine ?? false) : ''\n )}\n >\n {message.status\n ? messageStatusRenderer(\n onRenderMessageStatus,\n defaultStatusRenderer,\n showMessageStatus,\n participantCount,\n readCount\n )\n : undefined}\n </div>\n );\n }, [\n defaultStatusRenderer,\n message.mine,\n message.status,\n messageStatusRenderer,\n onRenderMessageStatus,\n participantCount,\n readCount,\n showMessageStatus,\n styles\n ]);\n\n // Fluent UI message components are used here as for default message renderer,\n // timestamp and author name should be shown but they aren't shown for custom renderer.\n // More investigations are needed to check if this can be simplified with states.\n // Status and avatar should be shown for both custom and default renderers.\n return (\n <FluentChatMyMessage\n attached={attached}\n root={myMessageRootProps}\n body={myMessageBodyProps}\n statusIcon={myMessageStatusIcon}\n >\n {messageRenderer({ ...props })}\n </FluentChatMyMessage>\n );\n};\n"]}
|
@@ -1,28 +1,28 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
/**
|
3
|
-
* @
|
3
|
+
* @private
|
4
4
|
* strings for rtt modal
|
5
5
|
*/
|
6
|
-
export interface
|
6
|
+
export interface _RTTDisclosureBannerStrings {
|
7
7
|
bannerTitle: string;
|
8
8
|
bannerContent: string;
|
9
9
|
bannerLinkLabel?: string;
|
10
10
|
}
|
11
11
|
/**
|
12
|
-
* @
|
12
|
+
* @private
|
13
13
|
* Props for RTT Banner
|
14
14
|
*/
|
15
|
-
export interface
|
15
|
+
export interface _RTTDisclosureBannerProps {
|
16
16
|
/**
|
17
17
|
* Optional callback to supply users with further troubleshooting steps or more information for the Real Time Text feature.
|
18
18
|
*/
|
19
19
|
onClickLink?: () => void;
|
20
20
|
/** RTT Banner strings */
|
21
|
-
strings?:
|
21
|
+
strings?: _RTTDisclosureBannerStrings;
|
22
22
|
}
|
23
23
|
/**
|
24
|
-
* @
|
24
|
+
* @private
|
25
25
|
* Banner to disclose that RTT is enabled for all participants for the entire duration of the meeting.
|
26
26
|
*/
|
27
|
-
export declare const
|
27
|
+
export declare const _RTTDisclosureBanner: (props: _RTTDisclosureBannerProps) => JSX.Element;
|
28
28
|
//# sourceMappingURL=RTTDisclosureBanner.d.ts.map
|