@azure/communication-react 1.18.0-alpha-202407060013 → 1.18.0-alpha-202407090014

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/communication-react.d.ts +17 -4
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-DMEk2o-G.js → ChatMessageComponentAsRichTextEditBox-RrIa2t97.js} +62 -17
  3. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-RrIa2t97.js.map +1 -0
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-ByJFtf0Z.js → RichTextSendBoxWrapper-Bz_1ebsD.js} +2 -2
  5. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-ByJFtf0Z.js.map → RichTextSendBoxWrapper-Bz_1ebsD.js.map} +1 -1
  6. package/dist/dist-cjs/communication-react/{index-BPO9X27C.js → index-DGXoGo4W.js} +242 -94
  7. package/dist/dist-cjs/communication-react/index-DGXoGo4W.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  11. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js +42 -4
  12. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
  13. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +34 -8
  14. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  15. package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js +3 -0
  16. package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.d.ts +4 -0
  18. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js +7 -1
  19. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js.map +1 -1
  20. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.d.ts +4 -0
  21. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +62 -15
  22. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +1 -1
  23. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js +1 -3
  24. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
  25. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +18 -0
  26. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  27. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +0 -4
  28. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +7 -35
  29. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
  30. package/dist/dist-esm/react-components/src/components/styles/Common.style.d.ts +4 -0
  31. package/dist/dist-esm/react-components/src/components/styles/Common.style.js +4 -0
  32. package/dist/dist-esm/react-components/src/components/styles/Common.style.js.map +1 -1
  33. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +18 -0
  34. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  35. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +17 -1
  36. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +70 -4
  37. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  38. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +2 -1
  39. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +28 -16
  40. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  41. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js +3 -1
  42. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js.map +1 -1
  43. package/package.json +1 -1
  44. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-DMEk2o-G.js.map +0 -1
  45. package/dist/dist-cjs/communication-react/index-BPO9X27C.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MessageThread.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/MessageThread.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,IAAI,EAAU,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EACL,aAAa,EACb,8BAA8B,EAC9B,2BAA2B,EAC3B,kCAAkC,EAClC,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AActC,OAAO,EAAE,YAAY,EAAiB,mCAAgC;AAGtE,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,iCAAiC,MAAM,2CAA2C,CAAC;AAG1F,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,aAAa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D,sBAAsB,IAAI,CACzB,oBAAC,SAAS,IACR,GAAG,EAAE,sBAAsB,EAC3B,kBAAkB,EAAE,uBAAuB,EAC3C,QAAQ,EAAE,QAAQ,GAClB,CACH;oBACA,iBAAiB,CAAC,GAAG,CAAC,CAAC,OAA0B,EAAe,EAAE;;wBACjE,OAAO,CACL,oBAAC,+BAA+B,oBAC1B,OAAO,IACX,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,OAAO,CAAC,GAAG,EAChB,MAAM,EAAE,MAAM,EACd,6BAA6B,EAAE,QAAQ,EACvC,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,qBAAqB,EAAE,qBAAqB,EAC5C,qBAAqB,EAAE,qBAAqB,EAC5C,mBAAmB,EAAE,uBAAuB,EAC5C,SAAS,EAAE,4BAA4B,EACvC,gBAAgB,EAAE,gBAAgB;4BAClC,mDAAmD;4BACnD,oBAAoB,EAAE,MAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,eAAe,0CAAE,oBAAoB,EAC9E,kBAAkB,EAAE,kBAAkB;4BACtC,0DAA0D;4BAC1D,uBAAuB,EAAE,uBAAuB;4BAChD,0CAA0C;4BAC1C,cAAc,EAAE,cAAc;4BAC9B,mDAAmD;4BACnD,2BAA2B,EAAE,2BAA2B;4BACxD,mDAAmD;4BACnD,qBAAqB,EAAE,qBAAqB,IAC5C,CACH,CAAC;oBACJ,CAAC,CAAC,CACG,CACe,CACV,CACZ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,+BAA+B,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,GAAqC,EAAe,EAAE;IACxG,OAAO,oBAAC,2BAA2B,oBAAK,GAAG,EAAI,CAAC;AAClD,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Icon, IStyle, mergeStyles, PrimaryButton } from '@fluentui/react';\nimport { Chat } from '@fluentui-contrib/react-chat';\nimport { mergeClasses } from '@fluentui/react-components';\nimport {\n DownIconStyle,\n newMessageButtonContainerStyle,\n messageThreadContainerStyle,\n messageThreadWrapperContainerStyle,\n useChatStyles,\n buttonWithIconStyles,\n newMessageButtonStyle\n} from './styles/MessageThread.styles';\nimport { delay } from './utils/delay';\nimport {\n BaseCustomStyles,\n ChatMessage,\n CustomMessage,\n SystemMessage,\n OnRenderAvatarCallback,\n Message,\n ReadReceiptsBySenderId,\n ComponentSlotStyle\n} from '../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../types';\nimport { MessageStatusIndicatorProps } from './MessageStatusIndicator';\nimport { memoizeFnAll, MessageStatus } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\nimport { useLocale } from '../localization/LocalizationProvider';\nimport { isNarrowWidth, _useContainerWidth } from './utils/responsive';\nimport getParticipantsWhoHaveReadMessage from './utils/getParticipantsWhoHaveReadMessage';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentOptions } from '../types/Attachment';\nimport { useTheme } from '../theming';\nimport { FluentV9ThemeProvider } from './../theming/FluentV9ThemeProvider';\nimport LiveAnnouncer from './Announcer/LiveAnnouncer';\n/* @conditional-compile-remove(mention) */\nimport { MentionOptions } from './MentionPopover';\nimport { createStyleFromV8Style } from './styles/v8StyleShim';\nimport {\n ChatMessageComponentWrapper,\n ChatMessageComponentWrapperProps\n} from './ChatMessage/ChatMessageComponentWrapper';\nimport { InlineImageOptions } from './ChatMessage/ChatMessageContent';\nimport { MessageStatusIndicatorInternal } from './MessageStatusIndicatorInternal';\nimport { Announcer } from './Announcer';\n/* @conditional-compile-remove(rich-text-editor) */\nimport { RichTextStrings } from './RichTextEditor/RichTextSendBox';\n/* @conditional-compile-remove(rich-text-editor) */\nimport { loadChatMessageComponentAsRichTextEditBox } from './ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker';\n\nconst isMessageSame = (first: ChatMessage, second: ChatMessage): boolean => {\n return (\n first.messageId === second.messageId &&\n first.content === second.content &&\n first.contentType === second.contentType &&\n JSON.stringify(first.createdOn) === JSON.stringify(second.createdOn) &&\n first.senderId === second.senderId &&\n first.senderDisplayName === second.senderDisplayName &&\n JSON.stringify(first.editedOn) === JSON.stringify(second.editedOn)\n );\n};\n\n/**\n * Get the latest message from the message array.\n *\n * @param messages\n */\nconst getLatestChatMessage = (messages: Message[]): ChatMessage | undefined => {\n for (let i = messages.length - 1; i >= 0; i--) {\n const message = messages[i];\n if (message.messageType === 'chat' && !!message.createdOn) {\n return message;\n }\n }\n return undefined;\n};\n\n/**\n * Compare latestMessageFromPreviousMessages & latestMessageFromNewMessages to see if the new message is not from\n * current user.\n */\nconst isThereNewMessageNotFromCurrentUser = (\n userId: string,\n latestMessageFromPreviousMessages?: ChatMessage,\n latestMessageFromNewMessages?: ChatMessage\n): boolean => {\n if (latestMessageFromNewMessages === undefined) {\n return false;\n }\n if (latestMessageFromPreviousMessages === undefined) {\n return latestMessageFromNewMessages.senderId !== userId;\n }\n return (\n !isMessageSame(latestMessageFromNewMessages, latestMessageFromPreviousMessages) &&\n latestMessageFromNewMessages.senderId !== userId\n );\n};\n\n/**\n * Returns true if the current user sent the latest message and false otherwise. It will ignore messages that have no\n * sender, messages that have failed to send, and messages from the current user that is marked as SEEN. This is meant\n * as an indirect way to detect if user is at bottom of the chat when the component updates with new messages. If we\n * updated this component due to current user sending a message we want to then call scrollToBottom.\n */\nconst didUserSendTheLatestMessage = (\n userId: string,\n latestMessageFromPreviousMessages?: ChatMessage,\n latestMessageFromNewMessages?: ChatMessage\n): boolean => {\n if (latestMessageFromNewMessages === undefined) {\n return false;\n }\n if (latestMessageFromPreviousMessages === undefined) {\n return latestMessageFromNewMessages.senderId === userId;\n }\n return (\n !isMessageSame(latestMessageFromNewMessages, latestMessageFromPreviousMessages) &&\n latestMessageFromNewMessages.senderId === userId\n );\n};\n\n/**\n * Fluent styles for {@link MessageThread}.\n *\n * @public\n */\nexport interface MessageThreadStyles extends BaseCustomStyles {\n /** Styles for load previous messages container. */\n loadPreviousMessagesButtonContainer?: IStyle;\n /** Styles for new message container. */\n newMessageButtonContainer?: IStyle;\n /** Styles for chat container. */\n chatContainer?: ComponentSlotStyle;\n /** styles for my chat items. */\n myChatItemMessageContainer?: ComponentSlotStyle;\n /** styles for chat items. */\n chatItemMessageContainer?: ComponentSlotStyle;\n /** Styles for my chat message container. */\n myChatMessageContainer?: ComponentSlotStyle;\n /** Styles for my chat message container in case of failure. */\n failedMyChatMessageContainer?: ComponentSlotStyle;\n /** Styles for chat message container. */\n chatMessageContainer?: ComponentSlotStyle;\n /** Styles for system message container. */\n systemMessageContainer?: ComponentSlotStyle;\n /** Styles for blocked message container. */\n /* @conditional-compile-remove(data-loss-prevention) */\n blockedMessageContainer?: ComponentSlotStyle;\n /** Styles for message status indicator container. */\n messageStatusContainer?: (mine: boolean) => IStyle;\n}\n\n/**\n * Strings of {@link MessageThread} that can be overridden.\n *\n * @public\n */\nexport interface MessageThreadStrings {\n /** String for Sunday */\n sunday: string;\n /** String for Monday */\n monday: string;\n /** String for Tuesday */\n tuesday: string;\n /** String for Wednesday */\n wednesday: string;\n /** String for Thursday */\n thursday: string;\n /** String for Friday */\n friday: string;\n /** String for Saturday */\n saturday: string;\n /** String for Yesterday */\n yesterday: string;\n /** String for participants joined */\n participantJoined: string;\n /** String for participants left */\n participantLeft: string;\n /** Tag shown on a message that has been edited */\n editedTag: string;\n /** String for editing message in floating menu */\n editMessage: string;\n /** String for removing message in floating menu */\n removeMessage: string;\n /** String for resending failed message in floating menu */\n resendMessage?: string;\n /** String for indicating failed to send messages */\n failToSendTag?: string;\n /** String for LiveMessage introduction for the Chat Message */\n liveAuthorIntro: string;\n /** String for aria text of remote user's message content */\n messageContentAriaText: string;\n /** String for aria text of local user's message content */\n messageContentMineAriaText: string;\n /** String for warning on text limit exceeded in EditBox*/\n editBoxTextLimit: string;\n /** String for placeholder text in EditBox when there is no user input*/\n editBoxPlaceholderText: string;\n /** String for new messages indicator*/\n newMessagesIndicator: string;\n /** String for showing message read status in floating menu */\n messageReadCount?: string;\n /** String for replacing display name when there is none*/\n noDisplayNameSub: string;\n /** String for Cancel button in EditBox*/\n editBoxCancelButton: string;\n /** String for Submit in EditBox when there is no user input*/\n editBoxSubmitButton: string;\n /** String for action menu indicating there are more options */\n actionMenuMoreOptions?: string;\n /** Aria label to announce when a message is deleted */\n messageDeletedAnnouncementAriaLabel: string;\n /* @conditional-compile-remove(file-sharing-acs) */\n /** String for download attachment button in attachment card */\n downloadAttachment: string;\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n /** String for open attachment button in attachment card */\n openAttachment: string;\n /* @conditional-compile-remove(data-loss-prevention) */\n /** String for policy violation message removal */\n blockedWarningText: string;\n /* @conditional-compile-remove(data-loss-prevention) */\n /** String for policy violation message removal details link */\n blockedWarningLinkText: string;\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n /** String for aria text in attachment card group*/\n attachmentCardGroupMessage: string;\n}\n\n/**\n * Arguments for {@link MessageThreadProps.onRenderJumpToNewMessageButton}.\n *\n * @public\n */\nexport interface JumpToNewMessageButtonProps {\n /** String for button text */\n text: string;\n /** Callback for when button is clicked */\n onClick: () => void;\n}\n\nconst DefaultJumpToNewMessageButton = (props: JumpToNewMessageButtonProps): JSX.Element => {\n const { text, onClick } = props;\n return (\n <PrimaryButton\n className={newMessageButtonStyle}\n styles={buttonWithIconStyles}\n text={text}\n onClick={onClick}\n onRenderIcon={() => <Icon iconName=\"Down\" className={DownIconStyle} />}\n />\n );\n};\n\n/**\n * A component to render a single message.\n *\n * @public\n */\nexport type MessageRenderer = (props: MessageProps) => JSX.Element;\n\nconst memoizeAllMessages = memoizeFnAll(\n (\n message: Message,\n showMessageDate: boolean,\n showMessageStatus: boolean,\n strings: MessageThreadStrings,\n index: number,\n onUpdateMessage?: UpdateMessageCallback,\n onCancelEditMessage?: CancelEditCallback,\n onDeleteMessage?: (messageId: string) => Promise<void>,\n onSendMessage?: (\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n options?: MessageOptions\n ) => Promise<void>,\n disableEditing?: boolean,\n lastSeenChatMessage?: string,\n lastSendingChatMessage?: string,\n lastDeliveredChatMessage?: string\n ): _ChatMessageProps => {\n let key: string | undefined = message.messageId;\n let statusToRender: MessageStatus | undefined = undefined;\n\n if (\n message.messageType === 'chat' ||\n /* @conditional-compile-remove(data-loss-prevention) */ message.messageType === 'blocked'\n ) {\n if ((!message.messageId || message.messageId === '') && 'clientMessageId' in message) {\n key = message.clientMessageId;\n }\n if (showMessageStatus && message.mine) {\n switch (message.messageId) {\n case lastSeenChatMessage: {\n statusToRender = 'seen';\n break;\n }\n case lastSendingChatMessage: {\n statusToRender = 'sending';\n break;\n }\n case lastDeliveredChatMessage: {\n statusToRender = 'delivered';\n break;\n }\n }\n }\n if (message.mine && message.status === 'failed') {\n statusToRender = 'failed';\n }\n }\n return {\n key: key ?? 'id_' + index,\n statusToRender,\n message,\n strings,\n showDate: showMessageDate,\n onUpdateMessage,\n onCancelEditMessage,\n onDeleteMessage,\n onSendMessage,\n disableEditing,\n showMessageStatus\n };\n }\n);\n\nconst getLastChatMessageIdWithStatus = (messages: Message[], status: MessageStatus): string | undefined => {\n for (let i = messages.length - 1; i >= 0; i--) {\n const message = messages[i];\n if (message.messageType === 'chat' && message.status === status && message.mine) {\n return message.messageId;\n }\n }\n return undefined;\n};\n\nconst getLastChatMessageForCurrentUser = (messages: Message[]): ChatMessage | undefined => {\n for (let i = messages.length - 1; i >= 0; i--) {\n const message = messages[i];\n if (message.messageType === 'chat' && message.mine) {\n return message;\n }\n }\n return undefined;\n};\n\n/**\n * @public\n * Callback function run when a message is updated.\n */\nexport type UpdateMessageCallback = (\n messageId: string,\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n options?: MessageOptions\n) => Promise<void>;\n/**\n * @public\n * Callback function run when a message edit is cancelled.\n */\nexport type CancelEditCallback = (messageId: string) => void;\n\n/**\n * Props for {@link MessageThread}.\n *\n * @public\n */\nexport type MessageThreadProps = {\n /**\n * UserId of the current user.\n */\n userId: string;\n /**\n * Messages to render in message thread. A message can be of type `ChatMessage`, `SystemMessage`, `BlockedMessage` or `CustomMessage`.\n */\n messages: (\n | ChatMessage\n | SystemMessage\n | CustomMessage\n | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage\n )[];\n /**\n * number of participants in the thread\n */\n participantCount?: number;\n /**\n * read receipts for each sender in the chat\n */\n readReceiptsBySenderId?: ReadReceiptsBySenderId;\n /**\n * Allows users to pass an object containing custom CSS styles.\n * @Example\n * ```\n * <MessageThread styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: MessageThreadStyles;\n /**\n * Whether the new message button is disabled or not.\n *\n * @defaultValue `false`\n */\n disableJumpToNewMessageButton?: boolean;\n /**\n * Whether the date of each message is displayed or not.\n * It is ignored when onDisplayDateTimeString is supplied.\n *\n * @defaultValue `false`\n */\n showMessageDate?: boolean;\n /**\n * Whether the status indicator for each message is displayed or not.\n *\n * @defaultValue `false`\n */\n showMessageStatus?: boolean;\n /**\n * Number of chat messages to reload each time onLoadPreviousChatMessages is called.\n *\n * @defaultValue 0\n */\n numberOfChatMessagesToReload?: number;\n /**\n * Optional callback to override actions on message being seen.\n *\n * @param messageId - message Id\n */\n onMessageSeen?: (messageId: string) => Promise<void>;\n /**\n * Optional callback to override render of the message status indicator.\n *\n * @param messageStatusIndicatorProps - props of type MessageStatusIndicatorProps\n */\n onRenderMessageStatus?: (messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null;\n /**\n * Optional callback to override render of the avatar.\n *\n * @param userId - user Id\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n /**\n * Optional callback to override render of the button for jumping to the new message.\n *\n * @param newMessageButtonProps - button props of type JumpToNewMessageButtonProps 0 */\n onRenderJumpToNewMessageButton?: (newMessageButtonProps: JumpToNewMessageButtonProps) => JSX.Element;\n /**\n * Optional callback to override loading of previous messages.\n * It accepts the number of history chat messages that we want to load and return a boolean Promise indicating if we have got all the history messages.\n * If the promise resolves to `true`, we have load all chat messages into the message thread and `loadPreviousMessagesButton` will not be rendered anymore.\n */\n onLoadPreviousChatMessages?: (messagesToLoad: number) => Promise<boolean>;\n /**\n * Optional callback to override render of a message.\n *\n * @param messageProps - props of type {@link communication-react#MessageProps}\n * @param defaultOnRender - default render of type {@link communication-react#MessageRenderer}\n *\n * @remarks\n * `messageRenderer` is not provided for `CustomMessage` and thus only available for `ChatMessage` and `SystemMessage`.\n */\n onRenderMessage?: (messageProps: MessageProps, messageRenderer?: MessageRenderer) => JSX.Element;\n /* @conditional-compile-remove(file-sharing-acs) */\n /**\n * Optional callback to render attachments in the message component.\n * @beta\n */\n onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;\n /**\n * Optional callback to edit a message.\n *\n * @param messageId - message id from chatClient\n * @param content - new content of the message\n *\n */\n onUpdateMessage?: UpdateMessageCallback;\n\n /**\n * Optional callback for when a message edit is cancelled.\n *\n * @param messageId - message id from chatClient\n */\n onCancelEditMessage?: CancelEditCallback;\n /**\n * Optional callback to delete a message.\n *\n * @param messageId - message id from chatClient\n *\n */\n onDeleteMessage?: (messageId: string) => Promise<void>;\n\n /**\n * Optional callback to send a message.\n *\n * @param content - message body to send\n * @param options - message options to be included in the message\n *\n */\n onSendMessage?: (\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n options?: MessageOptions\n ) => Promise<void>;\n\n /**\n /**\n * Disable editing messages.\n *\n * @remarks This removes the action menu on messages.\n *\n * @defaultValue `false`\n */\n disableEditing?: boolean;\n\n /**\n * Optional strings to override in component\n */\n strings?: Partial<MessageThreadStrings>;\n\n /* @conditional-compile-remove(file-sharing-acs) */\n /**\n * @beta\n * Optional attachment options, which defines behvaiour for uploading and downloading attachments.\n * As this moment, the uploadOptions would be ignored and this option is intended for download only.\n */\n attachmentOptions?: AttachmentOptions;\n\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 a mention query and display mentions\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 /* @conditional-compile-remove(rich-text-editor) */\n /**\n * Options to enable rich text editor for the edit box.\n * @beta\n */\n richTextEditorOptions?: RichTextEditorOptions;\n};\n\n/* @conditional-compile-remove(rich-text-editor) */\n/**\n * Options for the rich text editor configuration.\n *\n * @beta\n */\nexport interface RichTextEditorOptions {\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n /**\n * Optional callback to handle paste event.\n */\n onPaste?: (event: { content: DocumentFragment }) => void;\n}\n\n/**\n * Props to render a single message.\n *\n * See {@link MessageRenderer}.\n *\n * @public\n */\nexport type MessageProps = {\n /**\n * Message to render. It can type `ChatMessage` or `SystemMessage`, `BlockedMessage` or `CustomMessage`.\n */\n message: Message;\n /**\n * Strings from parent MessageThread component\n */\n strings: MessageThreadStrings & /* @conditional-compile-remove(rich-text-editor) */ Partial<RichTextStrings>;\n /**\n * Custom CSS styles for chat message container.\n */\n messageContainerStyle?: ComponentSlotStyle;\n /**\n * Whether the date of a message is displayed or not.\n *\n * @defaultValue `false`\n */\n showDate?: boolean;\n /**\n * Disable editing messages.\n *\n * @remarks This removes the action menu on messages.\n *\n * @defaultValue `false`\n */\n disableEditing?: boolean;\n /**\n * Optional callback to edit a message.\n *\n * @param messageId - message id from chatClient\n * @param content - new content of the message\n */\n onUpdateMessage?: UpdateMessageCallback;\n\n /**\n * Optional callback for when a message edit is cancelled.\n *\n * @param messageId - message id from chatClient\n */\n onCancelEditMessage?: CancelEditCallback;\n /**\n * Optional callback to delete a message.\n *\n * @param messageId - message id from chatClient\n *\n */\n onDeleteMessage?: (messageId: string) => Promise<void>;\n\n /**\n * Optional callback to send a message.\n *\n * @param content - message content from chatClient\n * @param options - message options to be included in the message\n *\n */\n onSendMessage?: (\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n options?: MessageOptions\n ) => Promise<void>;\n};\n\n/**\n * @internal\n */\nexport type _ChatMessageProps = MessageProps & {\n key: string;\n statusToRender: MessageStatus | undefined;\n showMessageStatus?: boolean;\n};\n\n/**\n * `MessageThread` allows you to easily create a component for rendering chat messages, handling scrolling behavior of new/old messages and customizing icons & controls inside the chat thread.\n * @param props - of type MessageThreadProps\n *\n * Users will need to provide at least chat messages and userId to render the `MessageThread` component.\n * Users can also customize `MessageThread` by passing in their own Avatar, `MessageStatusIndicator` icon, `JumpToNewMessageButton`, `LoadPreviousMessagesButton` and the behavior of these controls.\n *\n * `MessageThread` internally uses the `Chat` component from `@fluentui-contrib/chat`. You can checkout the details about these components [here](https://microsoft.github.io/fluentui-contrib/react-chat/).\n *\n * @public\n */\nexport const MessageThread = (props: MessageThreadProps): JSX.Element => {\n const theme = useTheme();\n\n const chatBody = useMemo(() => {\n return (\n <FluentV9ThemeProvider v8Theme={theme}>\n {/* Wrapper is required to call \"useClasses\" hook with proper context values */}\n <MessageThreadWrapper {...props} />\n </FluentV9ThemeProvider>\n );\n }, [theme, props]);\n\n return <div className={mergeStyles(messageThreadContainerStyle, props.styles?.root)}>{chatBody}</div>;\n};\n\n/**\n * @private\n */\nexport const MessageThreadWrapper = (props: MessageThreadProps): JSX.Element => {\n const {\n messages: newMessages,\n userId,\n participantCount,\n readReceiptsBySenderId,\n styles,\n disableJumpToNewMessageButton = false,\n showMessageDate = false,\n showMessageStatus = false,\n numberOfChatMessagesToReload = 5,\n onMessageSeen,\n onRenderMessageStatus,\n onRenderAvatar,\n onLoadPreviousChatMessages,\n onRenderJumpToNewMessageButton,\n onRenderMessage,\n onUpdateMessage,\n onCancelEditMessage,\n onDeleteMessage,\n onSendMessage,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString,\n /* @conditional-compile-remove(mention) */\n mentionOptions,\n inlineImageOptions,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentOptions,\n /* @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentDownloads,\n /* @conditional-compile-remove(rich-text-editor) */\n richTextEditorOptions\n } = props;\n // We need this state to wait for one tick and scroll to bottom after messages have been initialized.\n // Otherwise chatScrollDivRef.current.clientHeight is wrong if we scroll to bottom before messages are initialized.\n const [chatMessagesInitialized, setChatMessagesInitialized] = useState<boolean>(false);\n const [isAtBottomOfScroll, setIsAtBottomOfScroll] = useState<boolean>(true);\n const [forceUpdate, setForceUpdate] = useState<number>(0);\n\n // Used to decide if should auto scroll to bottom or show \"new message\" button\n const [latestPreviousChatMessage, setLatestPreviousChatMessage] = useState<ChatMessage | undefined>(undefined);\n const [latestCurrentChatMessage, setLatestCurrentChatMessage] = useState<ChatMessage | undefined>(undefined);\n const [existsNewChatMessage, setExistsNewChatMessage] = useState<boolean>(false);\n\n const [lastSeenChatMessage, setLastSeenChatMessage] = useState<string | undefined>(undefined);\n const [lastDeliveredChatMessage, setLastDeliveredChatMessage] = useState<string | undefined>(undefined);\n const [lastSendingChatMessage, setLastSendingChatMessage] = useState<string | undefined>(undefined);\n\n // readCount and participantCount will only need to be updated on-fly when user hover on an indicator\n const [readCountForHoveredIndicator, setReadCountForHoveredIndicator] = useState<number | undefined>(undefined);\n\n const localeStrings = useLocale().strings.messageThread;\n const strings = useMemo(() => ({ ...localeStrings, ...props.strings }), [localeStrings, props.strings]);\n // it is required to use useState for messages\n // as the scrolling logic requires re - render at a specific point in time\n const [messages, setMessages] = useState<Message[]>([]);\n\n // id for the latest deleted message\n const [latestDeletedMessageId, setLatestDeletedMessageId] = useState<string | undefined>(undefined);\n // this value is used to check if a message is deleted for the previous value of messages array\n const previousMessagesRef = useRef<Message[]>([]);\n // an aria label for Narrator to notify when a message is deleted\n const [deletedMessageAriaLabel, setDeletedMessageAriaLabel] = useState<string | undefined>(undefined);\n /* @conditional-compile-remove(rich-text-editor) */\n useEffect(() => {\n // if rich text editor is enabled, the rich text editor component should be loaded early for good UX\n if (richTextEditorOptions !== undefined) {\n // this line is needed to load the Rooster JS dependencies early in the lifecycle\n // when the rich text editor is enabled\n loadChatMessageComponentAsRichTextEditBox();\n }\n }, [richTextEditorOptions]);\n\n const onDeleteMessageCallback = useCallback(\n async (messageId: string): Promise<void> => {\n if (!onDeleteMessage) {\n return;\n }\n try {\n // reset deleted message label in case if there was a value already (messages are deleted 1 after another)\n setDeletedMessageAriaLabel(undefined);\n setLatestDeletedMessageId(messageId);\n lastChatMessageStatus.current = 'deleted';\n // we should set up latestDeletedMessageId before the onDeleteMessage call\n // as otherwise in very rare cases the messages array can be updated before latestDeletedMessageId\n await onDeleteMessage(messageId);\n } catch (e) {\n console.log('onDeleteMessage failed: messageId', messageId, 'error', e);\n }\n },\n [onDeleteMessage]\n );\n\n const isAllChatMessagesLoadedRef = useRef(false);\n // isAllChatMessagesLoadedRef needs to be updated every time when a new adapter is set in order to display correct data\n // onLoadPreviousChatMessages is updated when a new adapter is set\n useEffect(() => {\n if (onLoadPreviousChatMessages) {\n isAllChatMessagesLoadedRef.current = false;\n }\n }, [onLoadPreviousChatMessages]);\n\n const previousTopRef = useRef<number>(-1);\n const previousHeightRef = useRef<number>(-1);\n\n const messageIdSeenByMeRef = useRef<string>('');\n\n const chatScrollDivRef = useRef<HTMLDivElement>(null);\n const isLoadingChatMessagesRef = useRef(false);\n\n useEffect(() => {\n if (latestDeletedMessageId === undefined) {\n setDeletedMessageAriaLabel(undefined);\n } else {\n if (!previousMessagesRef.current.find((message) => message.messageId === latestDeletedMessageId)) {\n // the message is deleted in previousMessagesRef\n // no need to update deletedMessageAriaLabel\n setDeletedMessageAriaLabel(undefined);\n } else if (!messages.find((message) => message.messageId === latestDeletedMessageId)) {\n // the message is deleted in messages array but still exists in previousMessagesRef\n // update deletedMessageAriaLabel\n setDeletedMessageAriaLabel(strings.messageDeletedAnnouncementAriaLabel);\n } else {\n // the message exists in both arrays\n // no need to update deletedMessageAriaLabel\n setDeletedMessageAriaLabel(undefined);\n }\n }\n previousMessagesRef.current = messages;\n }, [latestDeletedMessageId, messages, strings.messageDeletedAnnouncementAriaLabel]);\n\n const messagesRef = useRef(messages);\n const setMessagesRef = (messagesWithAttachedValue: Message[]): void => {\n messagesRef.current = messagesWithAttachedValue;\n setMessages(messagesWithAttachedValue);\n };\n\n const isAtBottomOfScrollRef = useRef(isAtBottomOfScroll);\n const setIsAtBottomOfScrollRef = (isAtBottomOfScrollValue: boolean): void => {\n isAtBottomOfScrollRef.current = isAtBottomOfScrollValue;\n setIsAtBottomOfScroll(isAtBottomOfScrollValue);\n };\n\n const chatMessagesInitializedRef = useRef(chatMessagesInitialized);\n const setChatMessagesInitializedRef = (chatMessagesInitialized: boolean): void => {\n chatMessagesInitializedRef.current = chatMessagesInitialized;\n setChatMessagesInitialized(chatMessagesInitialized);\n };\n\n const chatThreadRef = useRef<HTMLDivElement>(null);\n\n // When the chat thread is narrow, we perform space optimizations such as overlapping\n // the avatar on top of the chat message and moving the chat accept/reject edit buttons\n // to a new line\n const chatThreadWidth = _useContainerWidth(chatThreadRef);\n const isNarrow = chatThreadWidth ? isNarrowWidth(chatThreadWidth) : false;\n\n /**\n * ClientHeight controls the number of messages to render. However ClientHeight will not be initialized after the\n * first render (not sure but I guess Fluent is updating it in hook which is after render maybe?) so we need to\n * trigger a re-render until ClientHeight is initialized. This force re-render should only happen once.\n */\n const clientHeight = chatThreadRef.current?.clientHeight;\n\n // we try to only send those message status if user is scrolled to the bottom.\n const sendMessageStatusIfAtBottom = useCallback(async (): Promise<void> => {\n if (\n !isAtBottomOfScrollRef.current ||\n !document.hasFocus() ||\n !messagesRef.current ||\n messagesRef.current.length === 0 ||\n !showMessageStatus\n ) {\n return;\n }\n const messagesWithId = messagesRef.current.filter((message) => {\n return message.messageType === 'chat' && !message.mine && !!message.messageId;\n });\n if (messagesWithId.length === 0) {\n return;\n }\n const lastMessage: ChatMessage = messagesWithId[messagesWithId.length - 1] as ChatMessage;\n try {\n if (\n onMessageSeen &&\n lastMessage &&\n lastMessage.messageId &&\n lastMessage.messageId !== messageIdSeenByMeRef.current\n ) {\n await onMessageSeen(lastMessage.messageId);\n messageIdSeenByMeRef.current = lastMessage.messageId;\n }\n } catch (e) {\n console.log('onMessageSeen Error', lastMessage, e);\n }\n }, [showMessageStatus, onMessageSeen]);\n\n const scrollToBottom = useCallback((): void => {\n if (chatScrollDivRef.current) {\n chatScrollDivRef.current.scrollTop = chatScrollDivRef.current.scrollHeight;\n }\n setExistsNewChatMessage(false);\n setIsAtBottomOfScrollRef(true);\n sendMessageStatusIfAtBottom();\n }, [sendMessageStatusIfAtBottom]);\n\n const handleScrollToTheBottom = useCallback((): void => {\n if (!chatScrollDivRef.current) {\n return;\n }\n\n const atBottom =\n Math.ceil(chatScrollDivRef.current.scrollTop) >=\n chatScrollDivRef.current.scrollHeight - chatScrollDivRef.current.clientHeight;\n if (atBottom) {\n sendMessageStatusIfAtBottom();\n if (!isAtBottomOfScrollRef.current) {\n scrollToBottom();\n }\n }\n setIsAtBottomOfScrollRef(atBottom);\n }, [scrollToBottom, sendMessageStatusIfAtBottom]);\n\n // Infinite scrolling + threadInitialize function\n const fetchNewMessageWhenAtTop = useCallback(async () => {\n if (!isLoadingChatMessagesRef.current) {\n if (onLoadPreviousChatMessages) {\n isLoadingChatMessagesRef.current = true;\n try {\n // Fetch message until scrollTop reach the threshold for fetching new message\n while (\n !isAllChatMessagesLoadedRef.current &&\n chatScrollDivRef.current &&\n chatScrollDivRef.current.scrollTop <= 500\n ) {\n isAllChatMessagesLoadedRef.current = await onLoadPreviousChatMessages(numberOfChatMessagesToReload);\n await delay(200);\n }\n } finally {\n // Set isLoadingChatMessagesRef to false after messages are fetched\n isLoadingChatMessagesRef.current = false;\n }\n }\n }\n }, [numberOfChatMessagesToReload, onLoadPreviousChatMessages]);\n\n // The below 2 of useEffects are design for fixing infinite scrolling problem\n // Scrolling element will behave differently when scrollTop = 0(it sticks at the top)\n // we need to get previousTop before it prepend contents\n // Execute order [newMessage useEffect] => get previousTop => dom update => [messages useEffect]\n useEffect(() => {\n if (!chatScrollDivRef.current) {\n return;\n }\n previousTopRef.current = chatScrollDivRef.current.scrollTop;\n previousHeightRef.current = chatScrollDivRef.current.scrollHeight;\n }, [newMessages]);\n\n useEffect(() => {\n if (!chatScrollDivRef.current) {\n return;\n }\n chatScrollDivRef.current.scrollTop =\n chatScrollDivRef.current.scrollHeight - (previousHeightRef.current - previousTopRef.current);\n }, [messages]);\n\n // Fetch more messages to make the scroll bar appear, infinity scroll is then handled in the handleScroll function.\n useEffect(() => {\n fetchNewMessageWhenAtTop();\n }, [fetchNewMessageWhenAtTop]);\n\n /**\n * One time run useEffects. Sets up listeners when component is mounted and tears down listeners when component\n * unmounts unless these function changed\n */\n useEffect(() => {\n window && window.addEventListener('click', sendMessageStatusIfAtBottom);\n window && window.addEventListener('focus', sendMessageStatusIfAtBottom);\n return () => {\n window && window.removeEventListener('click', sendMessageStatusIfAtBottom);\n window && window.removeEventListener('focus', sendMessageStatusIfAtBottom);\n };\n }, [sendMessageStatusIfAtBottom]);\n\n useEffect(() => {\n const chatScrollDiv = chatScrollDivRef.current;\n chatScrollDiv?.addEventListener('scroll', handleScrollToTheBottom);\n chatScrollDiv?.addEventListener('scroll', fetchNewMessageWhenAtTop);\n\n return () => {\n chatScrollDiv?.removeEventListener('scroll', handleScrollToTheBottom);\n chatScrollDiv?.removeEventListener('scroll', fetchNewMessageWhenAtTop);\n };\n }, [fetchNewMessageWhenAtTop, handleScrollToTheBottom]);\n\n useEffect(() => {\n if (clientHeight === undefined) {\n setForceUpdate(forceUpdate + 1);\n return;\n }\n // Only scroll to bottom if isAtBottomOfScrollRef is true\n isAtBottomOfScrollRef.current && scrollToBottom();\n }, [clientHeight, forceUpdate, scrollToBottom, chatMessagesInitialized]);\n useEffect(() => {\n const newStatus = getLastChatMessageForCurrentUser(newMessages)?.status;\n if (newStatus !== undefined) {\n if (lastChatMessageStatus.current === 'deleted' && newStatus === 'sending') {\n // enforce message life cycle\n // message status should always be [ sending -> delivered -> seen (optional) -> deleted ] or [sending -> failed -> deleted]\n // not any other way around\n // therefore, if current message status is deleted, we should only update it if newStatus is sending\n lastChatMessageStatus.current = newStatus;\n } else if (lastChatMessageStatus.current !== 'deleted') {\n lastChatMessageStatus.current = newStatus;\n }\n }\n // The hook should depend on newMessages not on messages as otherwise it will skip the sending status for a first message\n }, [newMessages]);\n\n /**\n * This needs to run to update latestPreviousChatMessage & latestCurrentChatMessage.\n * These two states are used to manipulate scrollbar\n */\n useEffect(() => {\n setLatestPreviousChatMessage(getLatestChatMessage(messagesRef.current));\n setLatestCurrentChatMessage(getLatestChatMessage(newMessages));\n setMessagesRef(newMessages);\n !chatMessagesInitializedRef.current && setChatMessagesInitializedRef(true);\n setLastDeliveredChatMessage(getLastChatMessageIdWithStatus(newMessages, 'delivered'));\n setLastSeenChatMessage(getLastChatMessageIdWithStatus(newMessages, 'seen'));\n setLastSendingChatMessage(getLastChatMessageIdWithStatus(newMessages, 'sending'));\n }, [newMessages]);\n\n /**\n * This needs to run after messages are rendered so we can manipulate the scroll bar.\n */\n useEffect(() => {\n // If user just sent the latest message then we assume we can move user to bottom of scroll.\n if (\n isThereNewMessageNotFromCurrentUser(userId, latestPreviousChatMessage, latestCurrentChatMessage) &&\n !isAtBottomOfScrollRef.current\n ) {\n setExistsNewChatMessage(true);\n } else if (\n didUserSendTheLatestMessage(userId, latestPreviousChatMessage, latestCurrentChatMessage) ||\n isAtBottomOfScrollRef.current\n ) {\n scrollToBottom();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [messages]);\n\n const lastChatMessageStatus = useRef<string | undefined>(undefined);\n const participantCountRef = useRef(participantCount);\n const readReceiptsBySenderIdRef = useRef(readReceiptsBySenderId);\n\n participantCountRef.current = participantCount;\n readReceiptsBySenderIdRef.current = readReceiptsBySenderId;\n\n const onActionButtonClickMemo = useCallback(\n (message: ChatMessage, setMessageReadBy: (readBy: { id: string; displayName: string }[]) => void) => {\n if (participantCountRef.current && participantCountRef.current - 1 > 1 && readReceiptsBySenderIdRef.current) {\n setMessageReadBy(getParticipantsWhoHaveReadMessage(message, readReceiptsBySenderIdRef.current));\n }\n },\n []\n );\n\n const defaultStatusRenderer = useCallback(\n (\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage,\n participantCount: number,\n readCount: number,\n status?: MessageStatus\n ) => {\n // we should only announce label if the message status isn't deleted\n // because after message is deleted, we now need to render statusIndicator for previous messages\n // and their status has been announced already and we should not announce them again\n const shouldAnnounce = lastChatMessageStatus.current !== 'deleted';\n\n const onToggleToolTip = (isToggled: boolean): void => {\n if (isToggled && readReceiptsBySenderIdRef.current) {\n setReadCountForHoveredIndicator(\n getParticipantsWhoHaveReadMessage(message, readReceiptsBySenderIdRef.current).length\n );\n } else {\n setReadCountForHoveredIndicator(undefined);\n }\n };\n return (\n <MessageStatusIndicatorInternal\n status={status}\n readCount={readCount}\n onToggleToolTip={onToggleToolTip}\n // -1 because participant count does not include myself\n remoteParticipantsCount={participantCount ? participantCount - 1 : 0}\n shouldAnnounce={shouldAnnounce}\n />\n );\n },\n []\n );\n\n const theme = useTheme();\n\n const messagesToDisplay = useMemo(() => {\n return memoizeAllMessages((memoizedMessageFn) => {\n return messages.map((message: Message, index: number): _ChatMessageProps => {\n return memoizedMessageFn(\n message,\n showMessageDate,\n showMessageStatus,\n strings,\n index,\n onUpdateMessage,\n onCancelEditMessage,\n onDeleteMessageCallback,\n onSendMessage,\n props.disableEditing,\n lastDeliveredChatMessage,\n lastSeenChatMessage,\n lastSendingChatMessage\n );\n });\n });\n }, [\n lastDeliveredChatMessage,\n lastSeenChatMessage,\n lastSendingChatMessage,\n messages,\n onCancelEditMessage,\n onDeleteMessageCallback,\n onSendMessage,\n onUpdateMessage,\n props.disableEditing,\n showMessageDate,\n showMessageStatus,\n strings\n ]);\n\n const classes = useChatStyles();\n\n return (\n <div className={mergeStyles(messageThreadWrapperContainerStyle)} ref={chatThreadRef}>\n {/* Always ensure New Messages button is above the chat body element in the DOM tree. This is to ensure correct\n tab ordering. Because the New Messages button floats on top of the chat body it is in a higher z-index and\n thus Users should be able to tab navigate to the new messages button _before_ tab focus is taken to the chat body.*/}\n {existsNewChatMessage && !disableJumpToNewMessageButton && (\n <div className={mergeStyles(newMessageButtonContainerStyle, styles?.newMessageButtonContainer)}>\n {onRenderJumpToNewMessageButton ? (\n onRenderJumpToNewMessageButton({ text: strings.newMessagesIndicator, onClick: scrollToBottom })\n ) : (\n <DefaultJumpToNewMessageButton text={strings.newMessagesIndicator} onClick={scrollToBottom} />\n )}\n </div>\n )}\n <LiveAnnouncer>\n <FluentV9ThemeProvider v8Theme={theme}>\n <Chat\n // styles?.chatContainer used in className and style prop as style prop can't handle CSS selectors\n className={mergeClasses(classes.root, mergeStyles(styles?.chatContainer))}\n ref={chatScrollDivRef}\n style={{ ...createStyleFromV8Style(styles?.chatContainer) }}\n >\n {latestDeletedMessageId && (\n <Announcer\n key={latestDeletedMessageId}\n announcementString={deletedMessageAriaLabel}\n ariaLive={'polite'}\n />\n )}\n {messagesToDisplay.map((message: _ChatMessageProps): JSX.Element => {\n return (\n <MemoChatMessageComponentWrapper\n {...message}\n userId={userId}\n key={message.key}\n styles={styles}\n shouldOverlapAvatarAndMessage={isNarrow}\n strings={strings}\n onRenderAvatar={onRenderAvatar}\n onRenderMessage={onRenderMessage}\n onRenderMessageStatus={onRenderMessageStatus}\n defaultStatusRenderer={defaultStatusRenderer}\n onActionButtonClick={onActionButtonClickMemo}\n readCount={readCountForHoveredIndicator}\n participantCount={participantCount}\n /* @conditional-compile-remove(file-sharing-acs) */\n actionsForAttachment={attachmentOptions?.downloadOptions?.actionsForAttachment}\n inlineImageOptions={inlineImageOptions}\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString={onDisplayDateTimeString}\n /* @conditional-compile-remove(mention) */\n mentionOptions={mentionOptions}\n /* @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentDownloads={onRenderAttachmentDownloads}\n /* @conditional-compile-remove(rich-text-editor) */\n richTextEditorOptions={richTextEditorOptions}\n />\n );\n })}\n </Chat>\n </FluentV9ThemeProvider>\n </LiveAnnouncer>\n </div>\n );\n};\n\nconst MemoChatMessageComponentWrapper = React.memo((obj: ChatMessageComponentWrapperProps): JSX.Element => {\n return <ChatMessageComponentWrapper {...obj} />;\n});\n"]}
1
+ {"version":3,"file":"MessageThread.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/MessageThread.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,IAAI,EAAU,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EACL,aAAa,EACb,8BAA8B,EAC9B,2BAA2B,EAC3B,kCAAkC,EAClC,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AActC,OAAO,EAAE,YAAY,EAAiB,mCAAgC;AAKtE,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,iCAAiC,MAAM,2CAA2C,CAAC;AAG1F,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC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licensed under the MIT License.\n\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Icon, IStyle, mergeStyles, PrimaryButton } from '@fluentui/react';\nimport { Chat } from '@fluentui-contrib/react-chat';\nimport { mergeClasses } from '@fluentui/react-components';\nimport {\n DownIconStyle,\n newMessageButtonContainerStyle,\n messageThreadContainerStyle,\n messageThreadWrapperContainerStyle,\n useChatStyles,\n buttonWithIconStyles,\n newMessageButtonStyle\n} from './styles/MessageThread.styles';\nimport { delay } from './utils/delay';\nimport {\n BaseCustomStyles,\n ChatMessage,\n CustomMessage,\n SystemMessage,\n OnRenderAvatarCallback,\n Message,\n ReadReceiptsBySenderId,\n ComponentSlotStyle\n} from '../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../types';\nimport { MessageStatusIndicatorProps } from './MessageStatusIndicator';\nimport { memoizeFnAll, MessageStatus } 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(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\nimport { useLocale } from '../localization/LocalizationProvider';\nimport { isNarrowWidth, _useContainerWidth } from './utils/responsive';\nimport getParticipantsWhoHaveReadMessage from './utils/getParticipantsWhoHaveReadMessage';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentOptions } from '../types/Attachment';\nimport { useTheme } from '../theming';\nimport { FluentV9ThemeProvider } from './../theming/FluentV9ThemeProvider';\nimport LiveAnnouncer from './Announcer/LiveAnnouncer';\n/* @conditional-compile-remove(mention) */\nimport { MentionOptions } from './MentionPopover';\nimport { createStyleFromV8Style } from './styles/v8StyleShim';\nimport {\n ChatMessageComponentWrapper,\n ChatMessageComponentWrapperProps\n} from './ChatMessage/ChatMessageComponentWrapper';\nimport { InlineImageOptions } from './ChatMessage/ChatMessageContent';\nimport { MessageStatusIndicatorInternal } from './MessageStatusIndicatorInternal';\nimport { Announcer } from './Announcer';\n/* @conditional-compile-remove(rich-text-editor) */\nimport { RichTextStrings } from './RichTextEditor/RichTextSendBox';\n/* @conditional-compile-remove(rich-text-editor) */\nimport { loadChatMessageComponentAsRichTextEditBox } from './ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker';\n\nconst isMessageSame = (first: ChatMessage, second: ChatMessage): boolean => {\n return (\n first.messageId === second.messageId &&\n first.content === second.content &&\n first.contentType === second.contentType &&\n JSON.stringify(first.createdOn) === JSON.stringify(second.createdOn) &&\n first.senderId === second.senderId &&\n first.senderDisplayName === second.senderDisplayName &&\n JSON.stringify(first.editedOn) === JSON.stringify(second.editedOn)\n );\n};\n\n/**\n * Get the latest message from the message array.\n *\n * @param messages\n */\nconst getLatestChatMessage = (messages: Message[]): ChatMessage | undefined => {\n for (let i = messages.length - 1; i >= 0; i--) {\n const message = messages[i];\n if (message.messageType === 'chat' && !!message.createdOn) {\n return message;\n }\n }\n return undefined;\n};\n\n/**\n * Compare latestMessageFromPreviousMessages & latestMessageFromNewMessages to see if the new message is not from\n * current user.\n */\nconst isThereNewMessageNotFromCurrentUser = (\n userId: string,\n latestMessageFromPreviousMessages?: ChatMessage,\n latestMessageFromNewMessages?: ChatMessage\n): boolean => {\n if (latestMessageFromNewMessages === undefined) {\n return false;\n }\n if (latestMessageFromPreviousMessages === undefined) {\n return latestMessageFromNewMessages.senderId !== userId;\n }\n return (\n !isMessageSame(latestMessageFromNewMessages, latestMessageFromPreviousMessages) &&\n latestMessageFromNewMessages.senderId !== userId\n );\n};\n\n/**\n * Returns true if the current user sent the latest message and false otherwise. It will ignore messages that have no\n * sender, messages that have failed to send, and messages from the current user that is marked as SEEN. This is meant\n * as an indirect way to detect if user is at bottom of the chat when the component updates with new messages. If we\n * updated this component due to current user sending a message we want to then call scrollToBottom.\n */\nconst didUserSendTheLatestMessage = (\n userId: string,\n latestMessageFromPreviousMessages?: ChatMessage,\n latestMessageFromNewMessages?: ChatMessage\n): boolean => {\n if (latestMessageFromNewMessages === undefined) {\n return false;\n }\n if (latestMessageFromPreviousMessages === undefined) {\n return latestMessageFromNewMessages.senderId === userId;\n }\n return (\n !isMessageSame(latestMessageFromNewMessages, latestMessageFromPreviousMessages) &&\n latestMessageFromNewMessages.senderId === userId\n );\n};\n\n/**\n * Fluent styles for {@link MessageThread}.\n *\n * @public\n */\nexport interface MessageThreadStyles extends BaseCustomStyles {\n /** Styles for load previous messages container. */\n loadPreviousMessagesButtonContainer?: IStyle;\n /** Styles for new message container. */\n newMessageButtonContainer?: IStyle;\n /** Styles for chat container. */\n chatContainer?: ComponentSlotStyle;\n /** styles for my chat items. */\n myChatItemMessageContainer?: ComponentSlotStyle;\n /** styles for chat items. */\n chatItemMessageContainer?: ComponentSlotStyle;\n /** Styles for my chat message container. */\n myChatMessageContainer?: ComponentSlotStyle;\n /** Styles for my chat message container in case of failure. */\n failedMyChatMessageContainer?: ComponentSlotStyle;\n /** Styles for chat message container. */\n chatMessageContainer?: ComponentSlotStyle;\n /** Styles for system message container. */\n systemMessageContainer?: ComponentSlotStyle;\n /** Styles for blocked message container. */\n /* @conditional-compile-remove(data-loss-prevention) */\n blockedMessageContainer?: ComponentSlotStyle;\n /** Styles for message status indicator container. */\n messageStatusContainer?: (mine: boolean) => IStyle;\n}\n\n/**\n * Strings of {@link MessageThread} that can be overridden.\n *\n * @public\n */\nexport interface MessageThreadStrings {\n /** String for Sunday */\n sunday: string;\n /** String for Monday */\n monday: string;\n /** String for Tuesday */\n tuesday: string;\n /** String for Wednesday */\n wednesday: string;\n /** String for Thursday */\n thursday: string;\n /** String for Friday */\n friday: string;\n /** String for Saturday */\n saturday: string;\n /** String for Yesterday */\n yesterday: string;\n /** String for participants joined */\n participantJoined: string;\n /** String for participants left */\n participantLeft: string;\n /** Tag shown on a message that has been edited */\n editedTag: string;\n /** String for editing message in floating menu */\n editMessage: string;\n /** String for removing message in floating menu */\n removeMessage: string;\n /** String for resending failed message in floating menu */\n resendMessage?: string;\n /** String for indicating failed to send messages */\n failToSendTag?: string;\n /** String for LiveMessage introduction for the Chat Message */\n liveAuthorIntro: string;\n /** String for aria text of remote user's message content */\n messageContentAriaText: string;\n /** String for aria text of local user's message content */\n messageContentMineAriaText: string;\n /** String for warning on text limit exceeded in EditBox*/\n editBoxTextLimit: string;\n /** String for placeholder text in EditBox when there is no user input*/\n editBoxPlaceholderText: string;\n /** String for new messages indicator*/\n newMessagesIndicator: string;\n /** String for showing message read status in floating menu */\n messageReadCount?: string;\n /** String for replacing display name when there is none*/\n noDisplayNameSub: string;\n /** String for Cancel button in EditBox*/\n editBoxCancelButton: string;\n /** String for Submit in EditBox when there is no user input*/\n editBoxSubmitButton: string;\n /** String for action menu indicating there are more options */\n actionMenuMoreOptions?: string;\n /** Aria label to announce when a message is deleted */\n messageDeletedAnnouncementAriaLabel: string;\n /* @conditional-compile-remove(file-sharing-acs) */\n /** String for download attachment button in attachment card */\n downloadAttachment: string;\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n /** String for open attachment button in attachment card */\n openAttachment: string;\n /* @conditional-compile-remove(data-loss-prevention) */\n /** String for policy violation message removal */\n blockedWarningText: string;\n /* @conditional-compile-remove(data-loss-prevention) */\n /** String for policy violation message removal details link */\n blockedWarningLinkText: string;\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n /** String for aria text in attachment card group*/\n attachmentCardGroupMessage: string;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n /**\n * Error message indicating that all attachment uploads are not complete.\n */\n attachmentUploadsPendingError: string;\n}\n\n/**\n * Arguments for {@link MessageThreadProps.onRenderJumpToNewMessageButton}.\n *\n * @public\n */\nexport interface JumpToNewMessageButtonProps {\n /** String for button text */\n text: string;\n /** Callback for when button is clicked */\n onClick: () => void;\n}\n\nconst DefaultJumpToNewMessageButton = (props: JumpToNewMessageButtonProps): JSX.Element => {\n const { text, onClick } = props;\n return (\n <PrimaryButton\n className={newMessageButtonStyle}\n styles={buttonWithIconStyles}\n text={text}\n onClick={onClick}\n onRenderIcon={() => <Icon iconName=\"Down\" className={DownIconStyle} />}\n />\n );\n};\n\n/**\n * A component to render a single message.\n *\n * @public\n */\nexport type MessageRenderer = (props: MessageProps) => JSX.Element;\n\nconst memoizeAllMessages = memoizeFnAll(\n (\n message: Message,\n showMessageDate: boolean,\n showMessageStatus: boolean,\n strings: MessageThreadStrings,\n index: number,\n onUpdateMessage?: UpdateMessageCallback,\n onCancelEditMessage?: CancelEditCallback,\n onDeleteMessage?: (messageId: string) => Promise<void>,\n onSendMessage?: (\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n options?: MessageOptions\n ) => Promise<void>,\n disableEditing?: boolean,\n lastSeenChatMessage?: string,\n lastSendingChatMessage?: string,\n lastDeliveredChatMessage?: string\n ): _ChatMessageProps => {\n let key: string | undefined = message.messageId;\n let statusToRender: MessageStatus | undefined = undefined;\n\n if (\n message.messageType === 'chat' ||\n /* @conditional-compile-remove(data-loss-prevention) */ message.messageType === 'blocked'\n ) {\n if ((!message.messageId || message.messageId === '') && 'clientMessageId' in message) {\n key = message.clientMessageId;\n }\n if (showMessageStatus && message.mine) {\n switch (message.messageId) {\n case lastSeenChatMessage: {\n statusToRender = 'seen';\n break;\n }\n case lastSendingChatMessage: {\n statusToRender = 'sending';\n break;\n }\n case lastDeliveredChatMessage: {\n statusToRender = 'delivered';\n break;\n }\n }\n }\n if (message.mine && message.status === 'failed') {\n statusToRender = 'failed';\n }\n }\n return {\n key: key ?? 'id_' + index,\n statusToRender,\n message,\n strings,\n showDate: showMessageDate,\n onUpdateMessage,\n onCancelEditMessage,\n onDeleteMessage,\n onSendMessage,\n disableEditing,\n showMessageStatus\n };\n }\n);\n\nconst getLastChatMessageIdWithStatus = (messages: Message[], status: MessageStatus): string | undefined => {\n for (let i = messages.length - 1; i >= 0; i--) {\n const message = messages[i];\n if (message.messageType === 'chat' && message.status === status && message.mine) {\n return message.messageId;\n }\n }\n return undefined;\n};\n\nconst getLastChatMessageForCurrentUser = (messages: Message[]): ChatMessage | undefined => {\n for (let i = messages.length - 1; i >= 0; i--) {\n const message = messages[i];\n if (message.messageType === 'chat' && message.mine) {\n return message;\n }\n }\n return undefined;\n};\n\n/**\n * @public\n * Callback function run when a message is updated.\n */\nexport type UpdateMessageCallback = (\n messageId: string,\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n options?: MessageOptions\n) => Promise<void>;\n/**\n * @public\n * Callback function run when a message edit is cancelled.\n */\nexport type CancelEditCallback = (messageId: string) => void;\n\n/**\n * Props for {@link MessageThread}.\n *\n * @public\n */\nexport type MessageThreadProps = {\n /**\n * UserId of the current user.\n */\n userId: string;\n /**\n * Messages to render in message thread. A message can be of type `ChatMessage`, `SystemMessage`, `BlockedMessage` or `CustomMessage`.\n */\n messages: (\n | ChatMessage\n | SystemMessage\n | CustomMessage\n | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage\n )[];\n /**\n * number of participants in the thread\n */\n participantCount?: number;\n /**\n * read receipts for each sender in the chat\n */\n readReceiptsBySenderId?: ReadReceiptsBySenderId;\n /**\n * Allows users to pass an object containing custom CSS styles.\n * @Example\n * ```\n * <MessageThread styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: MessageThreadStyles;\n /**\n * Whether the new message button is disabled or not.\n *\n * @defaultValue `false`\n */\n disableJumpToNewMessageButton?: boolean;\n /**\n * Whether the date of each message is displayed or not.\n * It is ignored when onDisplayDateTimeString is supplied.\n *\n * @defaultValue `false`\n */\n showMessageDate?: boolean;\n /**\n * Whether the status indicator for each message is displayed or not.\n *\n * @defaultValue `false`\n */\n showMessageStatus?: boolean;\n /**\n * Number of chat messages to reload each time onLoadPreviousChatMessages is called.\n *\n * @defaultValue 0\n */\n numberOfChatMessagesToReload?: number;\n /**\n * Optional callback to override actions on message being seen.\n *\n * @param messageId - message Id\n */\n onMessageSeen?: (messageId: string) => Promise<void>;\n /**\n * Optional callback to override render of the message status indicator.\n *\n * @param messageStatusIndicatorProps - props of type MessageStatusIndicatorProps\n */\n onRenderMessageStatus?: (messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null;\n /**\n * Optional callback to override render of the avatar.\n *\n * @param userId - user Id\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n /**\n * Optional callback to override render of the button for jumping to the new message.\n *\n * @param newMessageButtonProps - button props of type JumpToNewMessageButtonProps 0 */\n onRenderJumpToNewMessageButton?: (newMessageButtonProps: JumpToNewMessageButtonProps) => JSX.Element;\n /**\n * Optional callback to override loading of previous messages.\n * It accepts the number of history chat messages that we want to load and return a boolean Promise indicating if we have got all the history messages.\n * If the promise resolves to `true`, we have load all chat messages into the message thread and `loadPreviousMessagesButton` will not be rendered anymore.\n */\n onLoadPreviousChatMessages?: (messagesToLoad: number) => Promise<boolean>;\n /**\n * Optional callback to override render of a message.\n *\n * @param messageProps - props of type {@link communication-react#MessageProps}\n * @param defaultOnRender - default render of type {@link communication-react#MessageRenderer}\n *\n * @remarks\n * `messageRenderer` is not provided for `CustomMessage` and thus only available for `ChatMessage` and `SystemMessage`.\n */\n onRenderMessage?: (messageProps: MessageProps, messageRenderer?: MessageRenderer) => JSX.Element;\n /* @conditional-compile-remove(file-sharing-acs) */\n /**\n * Optional callback to render attachments in the message component.\n * @beta\n */\n onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;\n /**\n * Optional callback to edit a message.\n *\n * @param messageId - message id from chatClient\n * @param content - new content of the message\n *\n */\n onUpdateMessage?: UpdateMessageCallback;\n\n /**\n * Optional callback for when a message edit is cancelled.\n *\n * @param messageId - message id from chatClient\n */\n onCancelEditMessage?: CancelEditCallback;\n /**\n * Optional callback to delete a message.\n *\n * @param messageId - message id from chatClient\n *\n */\n onDeleteMessage?: (messageId: string) => Promise<void>;\n\n /**\n * Optional callback to send a message.\n *\n * @param content - message body to send\n * @param options - message options to be included in the message\n *\n */\n onSendMessage?: (\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n options?: MessageOptions\n ) => Promise<void>;\n\n /**\n /**\n * Disable editing messages.\n *\n * @remarks This removes the action menu on messages.\n *\n * @defaultValue `false`\n */\n disableEditing?: boolean;\n\n /**\n * Optional strings to override in component\n */\n strings?: Partial<MessageThreadStrings>;\n\n /* @conditional-compile-remove(file-sharing-acs) */\n /**\n * @beta\n * Optional attachment options, which defines behvaiour for uploading and downloading attachments.\n * As this moment, the uploadOptions would be ignored and this option is intended for download only.\n */\n attachmentOptions?: AttachmentOptions;\n\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 a mention query and display mentions\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 /* @conditional-compile-remove(rich-text-editor) */\n /**\n * Options to enable rich text editor for the edit box.\n * @beta\n */\n richTextEditorOptions?: RichTextEditorOptions;\n};\n\n/* @conditional-compile-remove(rich-text-editor) */\n/**\n * Options for the rich text editor configuration.\n *\n * @beta\n */\nexport interface RichTextEditorOptions {\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n /**\n * Optional callback to handle paste event.\n */\n onPaste?: (event: { content: DocumentFragment }) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n /**\n * Optional callback to upload an inline image in the rich text editor.\n */\n onUploadInlineImage?: (imageUrl: string, imageFileName: string) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n /**\n * Optional callback to remove the attachment upload or delete the image before sending.\n */\n onCancelInlineImageUpload?: (imageId: string) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n /**\n * Optional array of type {@link AttachmentMetadataInProgress}\n * to render inline images being uploaded in the RichTextSendBox.\n */\n imageUploadsInProgress?: AttachmentMetadataInProgress[];\n}\n\n/**\n * Props to render a single message.\n *\n * See {@link MessageRenderer}.\n *\n * @public\n */\nexport type MessageProps = {\n /**\n * Message to render. It can type `ChatMessage` or `SystemMessage`, `BlockedMessage` or `CustomMessage`.\n */\n message: Message;\n /**\n * Strings from parent MessageThread component\n */\n strings: MessageThreadStrings & /* @conditional-compile-remove(rich-text-editor) */ Partial<RichTextStrings>;\n /**\n * Custom CSS styles for chat message container.\n */\n messageContainerStyle?: ComponentSlotStyle;\n /**\n * Whether the date of a message is displayed or not.\n *\n * @defaultValue `false`\n */\n showDate?: boolean;\n /**\n * Disable editing messages.\n *\n * @remarks This removes the action menu on messages.\n *\n * @defaultValue `false`\n */\n disableEditing?: boolean;\n /**\n * Optional callback to edit a message.\n *\n * @param messageId - message id from chatClient\n * @param content - new content of the message\n */\n onUpdateMessage?: UpdateMessageCallback;\n\n /**\n * Optional callback for when a message edit is cancelled.\n *\n * @param messageId - message id from chatClient\n */\n onCancelEditMessage?: CancelEditCallback;\n /**\n * Optional callback to delete a message.\n *\n * @param messageId - message id from chatClient\n *\n */\n onDeleteMessage?: (messageId: string) => Promise<void>;\n\n /**\n * Optional callback to send a message.\n *\n * @param content - message content from chatClient\n * @param options - message options to be included in the message\n *\n */\n onSendMessage?: (\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n options?: MessageOptions\n ) => Promise<void>;\n};\n\n/**\n * @internal\n */\nexport type _ChatMessageProps = MessageProps & {\n key: string;\n statusToRender: MessageStatus | undefined;\n showMessageStatus?: boolean;\n};\n\n/**\n * `MessageThread` allows you to easily create a component for rendering chat messages, handling scrolling behavior of new/old messages and customizing icons & controls inside the chat thread.\n * @param props - of type MessageThreadProps\n *\n * Users will need to provide at least chat messages and userId to render the `MessageThread` component.\n * Users can also customize `MessageThread` by passing in their own Avatar, `MessageStatusIndicator` icon, `JumpToNewMessageButton`, `LoadPreviousMessagesButton` and the behavior of these controls.\n *\n * `MessageThread` internally uses the `Chat` component from `@fluentui-contrib/chat`. You can checkout the details about these components [here](https://microsoft.github.io/fluentui-contrib/react-chat/).\n *\n * @public\n */\nexport const MessageThread = (props: MessageThreadProps): JSX.Element => {\n const theme = useTheme();\n\n const chatBody = useMemo(() => {\n return (\n <FluentV9ThemeProvider v8Theme={theme}>\n {/* Wrapper is required to call \"useClasses\" hook with proper context values */}\n <MessageThreadWrapper {...props} />\n </FluentV9ThemeProvider>\n );\n }, [theme, props]);\n\n return <div className={mergeStyles(messageThreadContainerStyle, props.styles?.root)}>{chatBody}</div>;\n};\n\n/**\n * @private\n */\nexport const MessageThreadWrapper = (props: MessageThreadProps): JSX.Element => {\n const {\n messages: newMessages,\n userId,\n participantCount,\n readReceiptsBySenderId,\n styles,\n disableJumpToNewMessageButton = false,\n showMessageDate = false,\n showMessageStatus = false,\n numberOfChatMessagesToReload = 5,\n onMessageSeen,\n onRenderMessageStatus,\n onRenderAvatar,\n onLoadPreviousChatMessages,\n onRenderJumpToNewMessageButton,\n onRenderMessage,\n onUpdateMessage,\n onCancelEditMessage,\n onDeleteMessage,\n onSendMessage,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString,\n /* @conditional-compile-remove(mention) */\n mentionOptions,\n inlineImageOptions,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentOptions,\n /* @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentDownloads,\n /* @conditional-compile-remove(rich-text-editor) */\n richTextEditorOptions\n } = props;\n // We need this state to wait for one tick and scroll to bottom after messages have been initialized.\n // Otherwise chatScrollDivRef.current.clientHeight is wrong if we scroll to bottom before messages are initialized.\n const [chatMessagesInitialized, setChatMessagesInitialized] = useState<boolean>(false);\n const [isAtBottomOfScroll, setIsAtBottomOfScroll] = useState<boolean>(true);\n const [forceUpdate, setForceUpdate] = useState<number>(0);\n\n // Used to decide if should auto scroll to bottom or show \"new message\" button\n const [latestPreviousChatMessage, setLatestPreviousChatMessage] = useState<ChatMessage | undefined>(undefined);\n const [latestCurrentChatMessage, setLatestCurrentChatMessage] = useState<ChatMessage | undefined>(undefined);\n const [existsNewChatMessage, setExistsNewChatMessage] = useState<boolean>(false);\n\n const [lastSeenChatMessage, setLastSeenChatMessage] = useState<string | undefined>(undefined);\n const [lastDeliveredChatMessage, setLastDeliveredChatMessage] = useState<string | undefined>(undefined);\n const [lastSendingChatMessage, setLastSendingChatMessage] = useState<string | undefined>(undefined);\n\n // readCount and participantCount will only need to be updated on-fly when user hover on an indicator\n const [readCountForHoveredIndicator, setReadCountForHoveredIndicator] = useState<number | undefined>(undefined);\n\n const localeStrings = useLocale().strings.messageThread;\n const strings = useMemo(() => ({ ...localeStrings, ...props.strings }), [localeStrings, props.strings]);\n // it is required to use useState for messages\n // as the scrolling logic requires re - render at a specific point in time\n const [messages, setMessages] = useState<Message[]>([]);\n\n // id for the latest deleted message\n const [latestDeletedMessageId, setLatestDeletedMessageId] = useState<string | undefined>(undefined);\n // this value is used to check if a message is deleted for the previous value of messages array\n const previousMessagesRef = useRef<Message[]>([]);\n // an aria label for Narrator to notify when a message is deleted\n const [deletedMessageAriaLabel, setDeletedMessageAriaLabel] = useState<string | undefined>(undefined);\n /* @conditional-compile-remove(rich-text-editor) */\n useEffect(() => {\n // if rich text editor is enabled, the rich text editor component should be loaded early for good UX\n if (richTextEditorOptions !== undefined) {\n // this line is needed to load the Rooster JS dependencies early in the lifecycle\n // when the rich text editor is enabled\n loadChatMessageComponentAsRichTextEditBox();\n }\n }, [richTextEditorOptions]);\n\n const onDeleteMessageCallback = useCallback(\n async (messageId: string): Promise<void> => {\n if (!onDeleteMessage) {\n return;\n }\n try {\n // reset deleted message label in case if there was a value already (messages are deleted 1 after another)\n setDeletedMessageAriaLabel(undefined);\n setLatestDeletedMessageId(messageId);\n lastChatMessageStatus.current = 'deleted';\n // we should set up latestDeletedMessageId before the onDeleteMessage call\n // as otherwise in very rare cases the messages array can be updated before latestDeletedMessageId\n await onDeleteMessage(messageId);\n } catch (e) {\n console.log('onDeleteMessage failed: messageId', messageId, 'error', e);\n }\n },\n [onDeleteMessage]\n );\n\n const isAllChatMessagesLoadedRef = useRef(false);\n // isAllChatMessagesLoadedRef needs to be updated every time when a new adapter is set in order to display correct data\n // onLoadPreviousChatMessages is updated when a new adapter is set\n useEffect(() => {\n if (onLoadPreviousChatMessages) {\n isAllChatMessagesLoadedRef.current = false;\n }\n }, [onLoadPreviousChatMessages]);\n\n const previousTopRef = useRef<number>(-1);\n const previousHeightRef = useRef<number>(-1);\n\n const messageIdSeenByMeRef = useRef<string>('');\n\n const chatScrollDivRef = useRef<HTMLDivElement>(null);\n const isLoadingChatMessagesRef = useRef(false);\n\n useEffect(() => {\n if (latestDeletedMessageId === undefined) {\n setDeletedMessageAriaLabel(undefined);\n } else {\n if (!previousMessagesRef.current.find((message) => message.messageId === latestDeletedMessageId)) {\n // the message is deleted in previousMessagesRef\n // no need to update deletedMessageAriaLabel\n setDeletedMessageAriaLabel(undefined);\n } else if (!messages.find((message) => message.messageId === latestDeletedMessageId)) {\n // the message is deleted in messages array but still exists in previousMessagesRef\n // update deletedMessageAriaLabel\n setDeletedMessageAriaLabel(strings.messageDeletedAnnouncementAriaLabel);\n } else {\n // the message exists in both arrays\n // no need to update deletedMessageAriaLabel\n setDeletedMessageAriaLabel(undefined);\n }\n }\n previousMessagesRef.current = messages;\n }, [latestDeletedMessageId, messages, strings.messageDeletedAnnouncementAriaLabel]);\n\n const messagesRef = useRef(messages);\n const setMessagesRef = (messagesWithAttachedValue: Message[]): void => {\n messagesRef.current = messagesWithAttachedValue;\n setMessages(messagesWithAttachedValue);\n };\n\n const isAtBottomOfScrollRef = useRef(isAtBottomOfScroll);\n const setIsAtBottomOfScrollRef = (isAtBottomOfScrollValue: boolean): void => {\n isAtBottomOfScrollRef.current = isAtBottomOfScrollValue;\n setIsAtBottomOfScroll(isAtBottomOfScrollValue);\n };\n\n const chatMessagesInitializedRef = useRef(chatMessagesInitialized);\n const setChatMessagesInitializedRef = (chatMessagesInitialized: boolean): void => {\n chatMessagesInitializedRef.current = chatMessagesInitialized;\n setChatMessagesInitialized(chatMessagesInitialized);\n };\n\n const chatThreadRef = useRef<HTMLDivElement>(null);\n\n // When the chat thread is narrow, we perform space optimizations such as overlapping\n // the avatar on top of the chat message and moving the chat accept/reject edit buttons\n // to a new line\n const chatThreadWidth = _useContainerWidth(chatThreadRef);\n const isNarrow = chatThreadWidth ? isNarrowWidth(chatThreadWidth) : false;\n\n /**\n * ClientHeight controls the number of messages to render. However ClientHeight will not be initialized after the\n * first render (not sure but I guess Fluent is updating it in hook which is after render maybe?) so we need to\n * trigger a re-render until ClientHeight is initialized. This force re-render should only happen once.\n */\n const clientHeight = chatThreadRef.current?.clientHeight;\n\n // we try to only send those message status if user is scrolled to the bottom.\n const sendMessageStatusIfAtBottom = useCallback(async (): Promise<void> => {\n if (\n !isAtBottomOfScrollRef.current ||\n !document.hasFocus() ||\n !messagesRef.current ||\n messagesRef.current.length === 0 ||\n !showMessageStatus\n ) {\n return;\n }\n const messagesWithId = messagesRef.current.filter((message) => {\n return message.messageType === 'chat' && !message.mine && !!message.messageId;\n });\n if (messagesWithId.length === 0) {\n return;\n }\n const lastMessage: ChatMessage = messagesWithId[messagesWithId.length - 1] as ChatMessage;\n try {\n if (\n onMessageSeen &&\n lastMessage &&\n lastMessage.messageId &&\n lastMessage.messageId !== messageIdSeenByMeRef.current\n ) {\n await onMessageSeen(lastMessage.messageId);\n messageIdSeenByMeRef.current = lastMessage.messageId;\n }\n } catch (e) {\n console.log('onMessageSeen Error', lastMessage, e);\n }\n }, [showMessageStatus, onMessageSeen]);\n\n const scrollToBottom = useCallback((): void => {\n if (chatScrollDivRef.current) {\n chatScrollDivRef.current.scrollTop = chatScrollDivRef.current.scrollHeight;\n }\n setExistsNewChatMessage(false);\n setIsAtBottomOfScrollRef(true);\n sendMessageStatusIfAtBottom();\n }, [sendMessageStatusIfAtBottom]);\n\n const handleScrollToTheBottom = useCallback((): void => {\n if (!chatScrollDivRef.current) {\n return;\n }\n\n const atBottom =\n Math.ceil(chatScrollDivRef.current.scrollTop) >=\n chatScrollDivRef.current.scrollHeight - chatScrollDivRef.current.clientHeight;\n if (atBottom) {\n sendMessageStatusIfAtBottom();\n if (!isAtBottomOfScrollRef.current) {\n scrollToBottom();\n }\n }\n setIsAtBottomOfScrollRef(atBottom);\n }, [scrollToBottom, sendMessageStatusIfAtBottom]);\n\n // Infinite scrolling + threadInitialize function\n const fetchNewMessageWhenAtTop = useCallback(async () => {\n if (!isLoadingChatMessagesRef.current) {\n if (onLoadPreviousChatMessages) {\n isLoadingChatMessagesRef.current = true;\n try {\n // Fetch message until scrollTop reach the threshold for fetching new message\n while (\n !isAllChatMessagesLoadedRef.current &&\n chatScrollDivRef.current &&\n chatScrollDivRef.current.scrollTop <= 500\n ) {\n isAllChatMessagesLoadedRef.current = await onLoadPreviousChatMessages(numberOfChatMessagesToReload);\n await delay(200);\n }\n } finally {\n // Set isLoadingChatMessagesRef to false after messages are fetched\n isLoadingChatMessagesRef.current = false;\n }\n }\n }\n }, [numberOfChatMessagesToReload, onLoadPreviousChatMessages]);\n\n // The below 2 of useEffects are design for fixing infinite scrolling problem\n // Scrolling element will behave differently when scrollTop = 0(it sticks at the top)\n // we need to get previousTop before it prepend contents\n // Execute order [newMessage useEffect] => get previousTop => dom update => [messages useEffect]\n useEffect(() => {\n if (!chatScrollDivRef.current) {\n return;\n }\n previousTopRef.current = chatScrollDivRef.current.scrollTop;\n previousHeightRef.current = chatScrollDivRef.current.scrollHeight;\n }, [newMessages]);\n\n useEffect(() => {\n if (!chatScrollDivRef.current) {\n return;\n }\n chatScrollDivRef.current.scrollTop =\n chatScrollDivRef.current.scrollHeight - (previousHeightRef.current - previousTopRef.current);\n }, [messages]);\n\n // Fetch more messages to make the scroll bar appear, infinity scroll is then handled in the handleScroll function.\n useEffect(() => {\n fetchNewMessageWhenAtTop();\n }, [fetchNewMessageWhenAtTop]);\n\n /**\n * One time run useEffects. Sets up listeners when component is mounted and tears down listeners when component\n * unmounts unless these function changed\n */\n useEffect(() => {\n window && window.addEventListener('click', sendMessageStatusIfAtBottom);\n window && window.addEventListener('focus', sendMessageStatusIfAtBottom);\n return () => {\n window && window.removeEventListener('click', sendMessageStatusIfAtBottom);\n window && window.removeEventListener('focus', sendMessageStatusIfAtBottom);\n };\n }, [sendMessageStatusIfAtBottom]);\n\n useEffect(() => {\n const chatScrollDiv = chatScrollDivRef.current;\n chatScrollDiv?.addEventListener('scroll', handleScrollToTheBottom);\n chatScrollDiv?.addEventListener('scroll', fetchNewMessageWhenAtTop);\n\n return () => {\n chatScrollDiv?.removeEventListener('scroll', handleScrollToTheBottom);\n chatScrollDiv?.removeEventListener('scroll', fetchNewMessageWhenAtTop);\n };\n }, [fetchNewMessageWhenAtTop, handleScrollToTheBottom]);\n\n useEffect(() => {\n if (clientHeight === undefined) {\n setForceUpdate(forceUpdate + 1);\n return;\n }\n // Only scroll to bottom if isAtBottomOfScrollRef is true\n isAtBottomOfScrollRef.current && scrollToBottom();\n }, [clientHeight, forceUpdate, scrollToBottom, chatMessagesInitialized]);\n useEffect(() => {\n const newStatus = getLastChatMessageForCurrentUser(newMessages)?.status;\n if (newStatus !== undefined) {\n if (lastChatMessageStatus.current === 'deleted' && newStatus === 'sending') {\n // enforce message life cycle\n // message status should always be [ sending -> delivered -> seen (optional) -> deleted ] or [sending -> failed -> deleted]\n // not any other way around\n // therefore, if current message status is deleted, we should only update it if newStatus is sending\n lastChatMessageStatus.current = newStatus;\n } else if (lastChatMessageStatus.current !== 'deleted') {\n lastChatMessageStatus.current = newStatus;\n }\n }\n // The hook should depend on newMessages not on messages as otherwise it will skip the sending status for a first message\n }, [newMessages]);\n\n /**\n * This needs to run to update latestPreviousChatMessage & latestCurrentChatMessage.\n * These two states are used to manipulate scrollbar\n */\n useEffect(() => {\n setLatestPreviousChatMessage(getLatestChatMessage(messagesRef.current));\n setLatestCurrentChatMessage(getLatestChatMessage(newMessages));\n setMessagesRef(newMessages);\n !chatMessagesInitializedRef.current && setChatMessagesInitializedRef(true);\n setLastDeliveredChatMessage(getLastChatMessageIdWithStatus(newMessages, 'delivered'));\n setLastSeenChatMessage(getLastChatMessageIdWithStatus(newMessages, 'seen'));\n setLastSendingChatMessage(getLastChatMessageIdWithStatus(newMessages, 'sending'));\n }, [newMessages]);\n\n /**\n * This needs to run after messages are rendered so we can manipulate the scroll bar.\n */\n useEffect(() => {\n // If user just sent the latest message then we assume we can move user to bottom of scroll.\n if (\n isThereNewMessageNotFromCurrentUser(userId, latestPreviousChatMessage, latestCurrentChatMessage) &&\n !isAtBottomOfScrollRef.current\n ) {\n setExistsNewChatMessage(true);\n } else if (\n didUserSendTheLatestMessage(userId, latestPreviousChatMessage, latestCurrentChatMessage) ||\n isAtBottomOfScrollRef.current\n ) {\n scrollToBottom();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [messages]);\n\n const lastChatMessageStatus = useRef<string | undefined>(undefined);\n const participantCountRef = useRef(participantCount);\n const readReceiptsBySenderIdRef = useRef(readReceiptsBySenderId);\n\n participantCountRef.current = participantCount;\n readReceiptsBySenderIdRef.current = readReceiptsBySenderId;\n\n const onActionButtonClickMemo = useCallback(\n (message: ChatMessage, setMessageReadBy: (readBy: { id: string; displayName: string }[]) => void) => {\n if (participantCountRef.current && participantCountRef.current - 1 > 1 && readReceiptsBySenderIdRef.current) {\n setMessageReadBy(getParticipantsWhoHaveReadMessage(message, readReceiptsBySenderIdRef.current));\n }\n },\n []\n );\n\n const defaultStatusRenderer = useCallback(\n (\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage,\n participantCount: number,\n readCount: number,\n status?: MessageStatus\n ) => {\n // we should only announce label if the message status isn't deleted\n // because after message is deleted, we now need to render statusIndicator for previous messages\n // and their status has been announced already and we should not announce them again\n const shouldAnnounce = lastChatMessageStatus.current !== 'deleted';\n\n const onToggleToolTip = (isToggled: boolean): void => {\n if (isToggled && readReceiptsBySenderIdRef.current) {\n setReadCountForHoveredIndicator(\n getParticipantsWhoHaveReadMessage(message, readReceiptsBySenderIdRef.current).length\n );\n } else {\n setReadCountForHoveredIndicator(undefined);\n }\n };\n return (\n <MessageStatusIndicatorInternal\n status={status}\n readCount={readCount}\n onToggleToolTip={onToggleToolTip}\n // -1 because participant count does not include myself\n remoteParticipantsCount={participantCount ? participantCount - 1 : 0}\n shouldAnnounce={shouldAnnounce}\n />\n );\n },\n []\n );\n\n const theme = useTheme();\n\n const messagesToDisplay = useMemo(() => {\n return memoizeAllMessages((memoizedMessageFn) => {\n return messages.map((message: Message, index: number): _ChatMessageProps => {\n return memoizedMessageFn(\n message,\n showMessageDate,\n showMessageStatus,\n strings,\n index,\n onUpdateMessage,\n onCancelEditMessage,\n onDeleteMessageCallback,\n onSendMessage,\n props.disableEditing,\n lastDeliveredChatMessage,\n lastSeenChatMessage,\n lastSendingChatMessage\n );\n });\n });\n }, [\n lastDeliveredChatMessage,\n lastSeenChatMessage,\n lastSendingChatMessage,\n messages,\n onCancelEditMessage,\n onDeleteMessageCallback,\n onSendMessage,\n onUpdateMessage,\n props.disableEditing,\n showMessageDate,\n showMessageStatus,\n strings\n ]);\n\n const classes = useChatStyles();\n\n return (\n <div className={mergeStyles(messageThreadWrapperContainerStyle)} ref={chatThreadRef}>\n {/* Always ensure New Messages button is above the chat body element in the DOM tree. This is to ensure correct\n tab ordering. Because the New Messages button floats on top of the chat body it is in a higher z-index and\n thus Users should be able to tab navigate to the new messages button _before_ tab focus is taken to the chat body.*/}\n {existsNewChatMessage && !disableJumpToNewMessageButton && (\n <div className={mergeStyles(newMessageButtonContainerStyle, styles?.newMessageButtonContainer)}>\n {onRenderJumpToNewMessageButton ? (\n onRenderJumpToNewMessageButton({ text: strings.newMessagesIndicator, onClick: scrollToBottom })\n ) : (\n <DefaultJumpToNewMessageButton text={strings.newMessagesIndicator} onClick={scrollToBottom} />\n )}\n </div>\n )}\n <LiveAnnouncer>\n <FluentV9ThemeProvider v8Theme={theme}>\n <Chat\n // styles?.chatContainer used in className and style prop as style prop can't handle CSS selectors\n className={mergeClasses(classes.root, mergeStyles(styles?.chatContainer))}\n ref={chatScrollDivRef}\n style={{ ...createStyleFromV8Style(styles?.chatContainer) }}\n >\n {latestDeletedMessageId && (\n <Announcer\n key={latestDeletedMessageId}\n announcementString={deletedMessageAriaLabel}\n ariaLive={'polite'}\n />\n )}\n {messagesToDisplay.map((message: _ChatMessageProps): JSX.Element => {\n return (\n <MemoChatMessageComponentWrapper\n {...message}\n userId={userId}\n key={message.key}\n styles={styles}\n shouldOverlapAvatarAndMessage={isNarrow}\n strings={strings}\n onRenderAvatar={onRenderAvatar}\n onRenderMessage={onRenderMessage}\n onRenderMessageStatus={onRenderMessageStatus}\n defaultStatusRenderer={defaultStatusRenderer}\n onActionButtonClick={onActionButtonClickMemo}\n readCount={readCountForHoveredIndicator}\n participantCount={participantCount}\n /* @conditional-compile-remove(file-sharing-acs) */\n actionsForAttachment={attachmentOptions?.downloadOptions?.actionsForAttachment}\n inlineImageOptions={inlineImageOptions}\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString={onDisplayDateTimeString}\n /* @conditional-compile-remove(mention) */\n mentionOptions={mentionOptions}\n /* @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentDownloads={onRenderAttachmentDownloads}\n /* @conditional-compile-remove(rich-text-editor) */\n richTextEditorOptions={richTextEditorOptions}\n />\n );\n })}\n </Chat>\n </FluentV9ThemeProvider>\n </LiveAnnouncer>\n </div>\n );\n};\n\nconst MemoChatMessageComponentWrapper = React.memo((obj: ChatMessageComponentWrapperProps): JSX.Element => {\n return <ChatMessageComponentWrapper {...obj} />;\n});\n"]}
@@ -134,12 +134,10 @@ export interface RichTextSendBoxProps {
134
134
  /**
135
135
  * Optional callback to remove the attachment upload before sending by clicking on
136
136
  * cancel icon.
137
- * @beta
138
137
  */
139
138
  onCancelAttachmentUpload?: (attachmentId: string) => void;
140
139
  /**
141
140
  * Optional callback to remove the attachment upload or delete the image before sending.
142
- * @beta
143
141
  */
144
142
  onCancelInlineImageUpload?: (imageId: string) => void;
145
143
  /**
@@ -152,13 +150,11 @@ export interface RichTextSendBoxProps {
152
150
  onTyping?: () => Promise<void>;
153
151
  /**
154
152
  * Optional callback to upload an inline image in the rich text editor.
155
- * @beta
156
153
  */
157
154
  onUploadInlineImage?: (imageUrl: string, imageFileName: string) => void;
158
155
  /**
159
156
  * Optional array of type {@link AttachmentMetadataInProgress}
160
157
  * to render inline images being uploaded in the RichTextSendBox.
161
- * @beta
162
158
  */
163
159
  imageUploadsInProgress?: AttachmentMetadataInProgress[];
164
160
  }
@@ -11,7 +11,7 @@ import { InputBoxButton } from '../InputBoxButton';
11
11
  import { RichTextSendBoxErrors } from './RichTextSendBoxErrors';
12
12
  import { isMessageTooLong, isSendBoxButtonAriaDisabled, sanitizeText } from '../utils/SendBoxUtils';
13
13
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
14
- import { addUploadedImagesToMessage } from '../utils/SendBoxUtils';
14
+ import { insertAttachmentsAndImages } from '../utils/SendBoxUtils';
15
15
  import { useTheme } from '../../theming';
16
16
  import { richTextActionButtonsStyle, sendBoxRichTextEditorStyle } from '../styles/RichTextEditor.styles';
17
17
  /* @conditional-compile-remove(file-sharing-acs) */
@@ -78,8 +78,8 @@ export const RichTextSendBox = (props) => {
78
78
  }
79
79
  setContent(newValue);
80
80
  }, [
81
- /* @conditional-compile-remove(rich-text-editor-image-upload) */ onCancelInlineImageUpload,
82
81
  setContent,
82
+ /* @conditional-compile-remove(rich-text-editor-image-upload) */ onCancelInlineImageUpload,
83
83
  /* @conditional-compile-remove(rich-text-editor-image-upload) */ imageUploadsInProgress
84
84
  ]);
85
85
  const hasContent = useMemo(() => {
@@ -89,28 +89,6 @@ export const RichTextSendBox = (props) => {
89
89
  const plainTextContent = (_a = editorComponentRef.current) === null || _a === void 0 ? void 0 : _a.getPlainContent();
90
90
  return sanitizeText(contentValue !== null && contentValue !== void 0 ? contentValue : '').length > 0 && sanitizeText(plainTextContent !== null && plainTextContent !== void 0 ? plainTextContent : '').length > 0;
91
91
  }, [contentValue]);
92
- /* @conditional-compile-remove(file-sharing-acs) */
93
- /* @conditional-compile-remove(rich-text-editor-image-upload) */
94
- const toAttachmentMetadata = useCallback((attachmentsWithProgress,
95
- /* @conditional-compile-remove(rich-text-editor-image-upload) */ attachmentType) => {
96
- return attachmentsWithProgress === null || attachmentsWithProgress === void 0 ? void 0 : attachmentsWithProgress.filter((attachment) => {
97
- var _a;
98
- return !('error' in attachment) && !((_a = attachment.error) === null || _a === void 0 ? void 0 : _a.message);
99
- }).map((attachment) => {
100
- let url = attachment.url || '';
101
- /* @conditional-compile-remove(rich-text-editor-image-upload) */
102
- if (attachmentType === 'image') {
103
- url = '';
104
- }
105
- return {
106
- id: attachment.id,
107
- name: attachment.name,
108
- url,
109
- /* @conditional-compile-remove(rich-text-editor-image-upload) */
110
- attachmentType: attachmentType
111
- };
112
- });
113
- }, []);
114
92
  const sendMessageOnClick = useCallback(() => {
115
93
  var _a, _b;
116
94
  if (disabled || contentValueOverflow) {
@@ -134,15 +112,12 @@ export const RichTextSendBox = (props) => {
134
112
  /* @conditional-compile-remove(file-sharing-acs) */ isAttachmentUploadCompleted(attachments) ||
135
113
  /* @conditional-compile-remove(rich-text-editor-image-upload) */ isAttachmentUploadCompleted(imageUploadsInProgress)) {
136
114
  /* @conditional-compile-remove(file-sharing-acs) */
137
- let attachmentArray = toAttachmentMetadata(attachments);
138
115
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
139
- if (imageUploadsInProgress) {
140
- const imageArray = toAttachmentMetadata(imageUploadsInProgress, 'image');
141
- if (imageArray) {
142
- message = addUploadedImagesToMessage(message, imageUploadsInProgress);
143
- attachmentArray = attachmentArray === null || attachmentArray === void 0 ? void 0 : attachmentArray.concat(imageArray);
144
- }
145
- }
116
+ const { content, attachmentArray } = insertAttachmentsAndImages(contentValue,
117
+ /* @conditional-compile-remove(file-sharing-acs) */ attachments,
118
+ /* @conditional-compile-remove(rich-text-editor-image-upload) */ imageUploadsInProgress);
119
+ /* @conditional-compile-remove(rich-text-editor-image-upload) */
120
+ message = content;
146
121
  onSendMessage(message,
147
122
  /* @conditional-compile-remove(file-sharing-acs) */ /* @conditional-compile-remove(rich-text-editor-composite-support) */
148
123
  {
@@ -168,9 +143,6 @@ export const RichTextSendBox = (props) => {
168
143
  /* @conditional-compile-remove(file-sharing-acs) */
169
144
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
170
145
  strings.attachmentUploadsPendingError,
171
- /* @conditional-compile-remove(file-sharing-acs) */
172
- /* @conditional-compile-remove(rich-text-editor-image-upload) */
173
- toAttachmentMetadata,
174
146
  onSendMessage
175
147
  ]);
176
148
  const hasErrorMessage = useMemo(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextSendBox.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/RichTextEditor/RichTextSendBox.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,mDAAmD;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAA8B,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACpG,gEAAgE;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,QAAQ,EAAE,M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under the MIT License.\n\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { RichTextInputBoxComponent } from './RichTextInputBoxComponent';\nimport { Icon, Stack } from '@fluentui/react';\nimport { useLocale } from '../../localization';\nimport { SendBoxStrings } from '../SendBox';\nimport { sendIconStyle } from '../styles/SendBox.styles';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { useV9CustomStyles } from '../styles/SendBox.styles';\nimport { InputBoxButton } from '../InputBoxButton';\nimport { RichTextSendBoxErrors, RichTextSendBoxErrorsProps } from './RichTextSendBoxErrors';\nimport { isMessageTooLong, isSendBoxButtonAriaDisabled, sanitizeText } from '../utils/SendBoxUtils';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { addUploadedImagesToMessage } from '../utils/SendBoxUtils';\nimport { RichTextEditorComponentRef } from './RichTextEditor';\nimport { useTheme } from '../../theming';\nimport { richTextActionButtonsStyle, sendBoxRichTextEditorStyle } from '../styles/RichTextEditor.styles';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { _AttachmentUploadCards } from '../Attachment/AttachmentUploadCards';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadataInProgress, MessageOptions } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { isAttachmentUploadCompleted, hasIncompleteAttachmentUploads } from '../utils/SendBoxUtils';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { SendBoxErrorBarError } from '../SendBoxErrorBar';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { attachmentUploadCardsStyles } from '../styles/SendBox.styles';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { FluentV9ThemeProvider } from '../../theming/FluentV9ThemeProvider';\n\n/**\n * Strings of {@link RichTextSendBox} that can be overridden.\n *\n * @beta\n */\nexport interface RichTextSendBoxStrings extends RichTextStrings, SendBoxStrings {}\n\n/**\n * Strings of RichText that can be overridden.\n *\n * @beta\n */\nexport interface RichTextStrings {\n /**\n * Tooltip text for the bold button.\n */\n richTextBoldTooltip: string;\n /**\n * Tooltip text for the italic button.\n */\n richTextItalicTooltip: string;\n /**\n * Tooltip text for the underline button.\n */\n richTextUnderlineTooltip: string;\n /**\n * Tooltip text for the bullet list button.\n */\n richTextBulletListTooltip: string;\n /**\n * Tooltip text for the number list button.\n */\n richTextNumberListTooltip: string;\n /**\n * Tooltip text for the increase indent button.\n */\n richTextIncreaseIndentTooltip: string;\n /**\n * Tooltip text for the decrease indent button.\n */\n richTextDecreaseIndentTooltip: string;\n /**\n * Tooltip text insert table button.\n */\n richTextInsertTableTooltip: string;\n /**\n * Tooltip text for the rich text format button button.\n */\n richTextFormatButtonTooltip: string;\n /**\n * Text for the insert menu item.\n */\n richTextInsertRowOrColumnMenu: string;\n /**\n * Title for the insert table menu.\n */\n richTextInsertTableMenuTitle: string;\n /**\n * Text for the insert menu item to insert row above the current selection.\n */\n richTextInsertRowAboveMenu: string;\n /**\n * Text for the insert menu item to insert row below the current selection.\n */\n richTextInsertRowBelowMenu: string;\n /**\n * Text for the insert menu item to insert column to the left from the current selection.\n */\n richTextInsertColumnLeftMenu: string;\n /**\n * Text for the insert menu item to insert column to the right from the current selection.\n */\n richTextInsertColumnRightMenu: string;\n /**\n * Text for the delete row or column menu.\n */\n richTextDeleteRowOrColumnMenu: string;\n /**\n * Text for the delete column menu.\n */\n richTextDeleteColumnMenu: string;\n /**\n * Text for the delete row menu.\n */\n richTextDeleteRowMenu: string;\n /**\n * Text for the delete table menu.\n */\n richTextDeleteTableMenu: string;\n /**\n * Text for the rich text toolbar more button.\n */\n richTextToolbarMoreButtonAriaLabel: string;\n}\n\n/**\n * Props for {@link RichTextSendBox}.\n *\n * @beta\n */\nexport interface RichTextSendBoxProps {\n /**\n * Optional boolean to disable text box\n * @defaultValue false\n */\n disabled?: boolean;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n /**\n * Optional callback to handle paste event.\n */\n onPaste?: (event: { content: DocumentFragment }) => void;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<RichTextSendBoxStrings>;\n /**\n * Optional text for system message above the text box\n */\n systemMessage?: string;\n /* @conditional-compile-remove(file-sharing-acs) */\n /**\n * Optional array of type {@link AttachmentMetadataInProgress}\n * to render attachments being uploaded in the SendBox.\n * @beta\n */\n attachments?: AttachmentMetadataInProgress[];\n /**\n * enumerable to determine if the input box has focus on render or not.\n * When undefined nothing has focus on render\n */\n autoFocus?: 'sendBoxTextField';\n /* @conditional-compile-remove(file-sharing-acs) */\n /**\n * Optional callback to remove the attachment upload before sending by clicking on\n * cancel icon.\n * @beta\n */\n onCancelAttachmentUpload?: (attachmentId: string) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n /**\n * Optional callback to remove the attachment upload or delete the image before sending.\n * @beta\n */\n onCancelInlineImageUpload?: (imageId: string) => void;\n /**\n * Callback function used when the send button is clicked.\n */\n onSendMessage: (\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n options?: MessageOptions\n ) => Promise<void>;\n /**\n * Optional callback called when user is typing\n */\n onTyping?: () => Promise<void>;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n /**\n * Optional callback to upload an inline image in the rich text editor.\n * @beta\n */\n onUploadInlineImage?: (imageUrl: string, imageFileName: string) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n /**\n * Optional array of type {@link AttachmentMetadataInProgress}\n * to render inline images being uploaded in the RichTextSendBox.\n * @beta\n */\n imageUploadsInProgress?: AttachmentMetadataInProgress[];\n}\n\n/**\n * A component to render SendBox with Rich Text Editor support.\n *\n * @beta\n */\nexport const RichTextSendBox = (props: RichTextSendBoxProps): JSX.Element => {\n const {\n disabled = false,\n systemMessage,\n autoFocus,\n onSendMessage,\n onTyping,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachments,\n /* @conditional-compile-remove(file-sharing-acs) */\n onCancelAttachmentUpload,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onUploadInlineImage,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n imageUploadsInProgress,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onCancelInlineImageUpload\n } = props;\n\n const theme = useTheme();\n const locale = useLocale();\n\n const localeStrings = useMemo(() => {\n /* @conditional-compile-remove(rich-text-editor) */\n return locale.strings.richTextSendBox;\n return locale.strings.sendBox;\n }, [/* @conditional-compile-remove(rich-text-editor) */ locale.strings.richTextSendBox, locale.strings.sendBox]);\n\n const strings = useMemo(() => {\n return { ...localeStrings, ...props.strings };\n }, [localeStrings, props.strings]);\n\n const [contentValue, setContentValue] = useState('');\n const [contentValueOverflow, setContentValueOverflow] = useState(false);\n /* @conditional-compile-remove(file-sharing-acs) */\n const [attachmentUploadsPendingError, setAttachmentUploadsPendingError] = useState<SendBoxErrorBarError | undefined>(\n undefined\n );\n const editorComponentRef = useRef<RichTextEditorComponentRef>(null);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const customV9Styles = useV9CustomStyles();\n\n const contentTooLongMessage = useMemo(\n () => (contentValueOverflow ? strings.textTooLong : undefined),\n [contentValueOverflow, strings.textTooLong]\n );\n\n const setContent = useCallback((newValue?: string): void => {\n if (newValue === undefined) {\n return;\n }\n\n setContentValueOverflow(isMessageTooLong(newValue.length));\n setContentValue(newValue);\n }, []);\n\n const onChangeHandler = useCallback(\n (\n newValue?: string,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ imageSrcArray?: Array<string>\n ) => {\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n if (imageSrcArray && imageUploadsInProgress && imageUploadsInProgress?.length > 0) {\n imageUploadsInProgress?.map((uploadImage) => {\n if (uploadImage.url && imageSrcArray && !imageSrcArray?.includes(uploadImage.url)) {\n onCancelInlineImageUpload?.(uploadImage.id);\n }\n });\n }\n\n setContent(newValue);\n },\n [\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ onCancelInlineImageUpload,\n setContent,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ imageUploadsInProgress\n ]\n );\n\n const hasContent = useMemo(() => {\n // get plain text content from the editor to check if the message is empty\n // as the content may contain tags even when the content is empty\n const plainTextContent = editorComponentRef.current?.getPlainContent();\n return sanitizeText(contentValue ?? '').length > 0 && sanitizeText(plainTextContent ?? '').length > 0;\n }, [contentValue]);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n const toAttachmentMetadata = useCallback(\n (\n attachmentsWithProgress: AttachmentMetadataInProgress[] | undefined,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ attachmentType?: 'image'\n ) => {\n return attachmentsWithProgress\n ?.filter((attachment) => {\n return !('error' in attachment) && !attachment.error?.message;\n })\n .map((attachment) => {\n let url = attachment.url || '';\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n if (attachmentType === 'image') {\n url = '';\n }\n return {\n id: attachment.id,\n name: attachment.name,\n url,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n attachmentType: attachmentType\n };\n });\n },\n []\n );\n\n const sendMessageOnClick = useCallback((): void => {\n if (disabled || contentValueOverflow) {\n return;\n }\n // Don't send message until all attachments have been uploaded successfully\n /* @conditional-compile-remove(file-sharing-acs) */\n setAttachmentUploadsPendingError(undefined);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n if (\n /* @conditional-compile-remove(file-sharing-acs) */ hasIncompleteAttachmentUploads(attachments) ||\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ hasIncompleteAttachmentUploads(\n imageUploadsInProgress\n )\n ) {\n setAttachmentUploadsPendingError({ message: strings.attachmentUploadsPendingError, timestamp: Date.now() });\n return;\n }\n\n let message = contentValue;\n\n // we don't want to send empty messages including spaces, newlines, tabs\n // Message can be empty if there is a valid attachment upload\n if (\n hasContent ||\n /* @conditional-compile-remove(file-sharing-acs) */ isAttachmentUploadCompleted(attachments) ||\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ isAttachmentUploadCompleted(\n imageUploadsInProgress\n )\n ) {\n /* @conditional-compile-remove(file-sharing-acs) */\n let attachmentArray = toAttachmentMetadata(attachments);\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n if (imageUploadsInProgress) {\n const imageArray = toAttachmentMetadata(imageUploadsInProgress, 'image');\n if (imageArray) {\n message = addUploadedImagesToMessage(message, imageUploadsInProgress);\n attachmentArray = attachmentArray?.concat(imageArray);\n }\n }\n\n onSendMessage(\n message,\n /* @conditional-compile-remove(file-sharing-acs) */ /* @conditional-compile-remove(rich-text-editor-composite-support) */\n {\n /* @conditional-compile-remove(file-sharing-acs) */\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n attachments: attachmentArray,\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n type: 'html'\n }\n );\n setContentValue('');\n editorComponentRef.current?.setEmptyContent();\n editorComponentRef.current?.focus();\n }\n }, [\n disabled,\n contentValueOverflow,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachments,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n imageUploadsInProgress,\n contentValue,\n hasContent,\n /* @conditional-compile-remove(file-sharing-acs) */\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n strings.attachmentUploadsPendingError,\n /* @conditional-compile-remove(file-sharing-acs) */\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n toAttachmentMetadata,\n onSendMessage\n ]);\n\n const hasErrorMessage = useMemo(() => {\n return (\n !!systemMessage ||\n !!contentTooLongMessage ||\n /* @conditional-compile-remove(file-sharing-acs) */\n !!attachmentUploadsPendingError ||\n /* @conditional-compile-remove(file-sharing-acs) */\n !!attachments?.filter((attachmentUpload) => attachmentUpload.error).pop()?.error ||\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n !!imageUploadsInProgress?.filter((image) => image.error).pop()?.error\n );\n }, [\n /* @conditional-compile-remove(file-sharing-acs) */\n attachments,\n contentTooLongMessage,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentUploadsPendingError,\n systemMessage,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n imageUploadsInProgress\n ]);\n\n const onRenderSendIcon = useCallback(\n (isHover: boolean) => {\n return (\n <Icon\n iconName={isHover && hasContent ? 'SendBoxSendHovered' : 'SendBoxSend'}\n className={sendIconStyle({\n theme,\n hasText: hasContent,\n /* @conditional-compile-remove(file-sharing-acs) */\n hasAttachment: false,\n hasErrorMessage: hasErrorMessage,\n defaultTextColor: theme.palette.neutralSecondary,\n disabled: disabled\n })}\n />\n );\n },\n [disabled, hasContent, hasErrorMessage, theme]\n );\n\n const sendBoxErrorsProps: RichTextSendBoxErrorsProps = useMemo(() => {\n /* @conditional-compile-remove(file-sharing-acs) */\n const uploadErrorMessage = attachments?.filter((attachmentUpload) => attachmentUpload.error).pop()?.error?.message;\n return {\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentUploadsPendingError: attachmentUploadsPendingError,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentProgressError: uploadErrorMessage\n ? {\n message: uploadErrorMessage,\n timestamp: Date.now()\n }\n : undefined,\n systemMessage: systemMessage,\n textTooLongMessage: contentTooLongMessage\n };\n }, [\n /* @conditional-compile-remove(file-sharing-acs) */\n attachments,\n contentTooLongMessage,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentUploadsPendingError,\n systemMessage\n ]);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const onRenderAttachmentUploads = useCallback(() => {\n return (\n <Stack className={attachmentUploadCardsStyles}>\n <FluentV9ThemeProvider v8Theme={theme} className={customV9Styles.clearBackground}>\n <_AttachmentUploadCards\n attachments={attachments}\n onCancelAttachmentUpload={onCancelAttachmentUpload}\n strings={{\n removeAttachment: strings.removeAttachment,\n uploading: strings.uploading,\n uploadCompleted: strings.uploadCompleted,\n attachmentMoreMenu: strings.attachmentMoreMenu\n }}\n disabled={disabled}\n />\n </FluentV9ThemeProvider>\n </Stack>\n );\n }, [\n theme,\n customV9Styles.clearBackground,\n attachments,\n onCancelAttachmentUpload,\n strings.removeAttachment,\n strings.uploading,\n strings.uploadCompleted,\n strings.attachmentMoreMenu,\n disabled\n ]);\n\n const isSendBoxButtonAriaDisabledValue = useMemo(() => {\n return isSendBoxButtonAriaDisabled({\n hasContent,\n /* @conditional-compile-remove(file-sharing-acs) */ hasCompletedAttachmentUploads:\n isAttachmentUploadCompleted(attachments),\n hasError: hasErrorMessage,\n disabled\n });\n }, [/* @conditional-compile-remove(file-sharing-acs) */ attachments, disabled, hasContent, hasErrorMessage]);\n\n const sendButton = useMemo(() => {\n return (\n <InputBoxButton\n onRenderIcon={onRenderSendIcon}\n onClick={(e) => {\n sendMessageOnClick();\n e.stopPropagation(); // Prevents the click from bubbling up and triggering a focus event on the chat.\n }}\n className={richTextActionButtonsStyle}\n ariaLabel={localeStrings.sendButtonAriaLabel}\n tooltipContent={localeStrings.sendButtonAriaLabel}\n ariaDisabled={isSendBoxButtonAriaDisabledValue}\n />\n );\n }, [isSendBoxButtonAriaDisabledValue, localeStrings.sendButtonAriaLabel, onRenderSendIcon, sendMessageOnClick]);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const hasAttachmentUploads = useMemo(() => {\n return isAttachmentUploadCompleted(attachments) || hasIncompleteAttachmentUploads(attachments);\n }, [attachments]);\n\n return (\n <Stack>\n <RichTextSendBoxErrors {...sendBoxErrorsProps} />\n <RichTextInputBoxComponent\n placeholderText={strings.placeholderText}\n autoFocus={autoFocus}\n onChange={onChangeHandler}\n onEnterKeyDown={sendMessageOnClick}\n onTyping={onTyping}\n editorComponentRef={editorComponentRef}\n strings={strings}\n disabled={disabled}\n actionComponents={sendButton}\n richTextEditorStyleProps={sendBoxRichTextEditorStyle}\n /* @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentUploads={onRenderAttachmentUploads}\n /* @conditional-compile-remove(file-sharing-acs) */\n hasAttachments={hasAttachmentUploads}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste={onPaste}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onUploadInlineImage={onUploadInlineImage}\n />\n </Stack>\n );\n};\n"]}
1
+ {"version":3,"file":"RichTextSendBox.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/RichTextEditor/RichTextSendBox.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,mDAAmD;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAA8B,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACpG,gEAAgE;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AACzG,mDAAmD;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAG7E,mDAAmD;AACnD,OAAO,EAAE,2BAA2B,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAGpG,mDAAmD;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,mDAAmD;AACnD,OAAO,E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;gBACb,kBAAkB,EAAE,CAAC;gBACrB,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC,gFAAgF;YACvG,CAAC,EACD,SAAS,EAAE,0BAA0B,EACrC,SAAS,EAAE,aAAa,CAAC,mBAAmB,EAC5C,cAAc,EAAE,aAAa,CAAC,mBAAmB,EACjD,YAAY,EAAE,gCAAgC,GAC9C,CACH,CAAC;IACJ,CAAC,EAAE,CAAC,gCAAgC,EAAE,aAAa,CAAC,mBAAmB,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAEhH,mDAAmD;IACnD,MAAM,oBAAoB,GAAG,OAAO,CAAC,GAAG,EAAE;QACxC,OAAO,2BAA2B,CAAC,WAAW,CAAC,IAAI,8BAA8B,CAAC,WAAW,CAAC,CAAC;IACjG,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,OAAO,CACL,oBAAC,KAAK;QACJ,oBAAC,qBAAqB,oBAAK,kBAAkB,EAAI;QACjD,oBAAC,yBAAyB,IACxB,eAAe,EAAE,OAAO,CAAC,eAAe,EACxC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,eAAe,EACzB,cAAc,EAAE,kBAAkB,EAClC,QAAQ,EAAE,QAAQ,EAClB,kBAAkB,EAAE,kBAAkB,EACtC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,UAAU,EAC5B,wBAAwB,EAAE,0BAA0B;YACpD,mDAAmD;YACnD,yBAAyB,EAAE,yBAAyB;YACpD,mDAAmD;YACnD,cAAc,EAAE,oBAAoB;YACpC,gEAAgE;YAChE,OAAO,EAAE,OAAO;YAChB,gEAAgE;YAChE,mBAAmB,EAAE,mBAAmB,GACxC,CACI,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { RichTextInputBoxComponent } from './RichTextInputBoxComponent';\nimport { Icon, Stack } from '@fluentui/react';\nimport { useLocale } from '../../localization';\nimport { SendBoxStrings } from '../SendBox';\nimport { sendIconStyle } from '../styles/SendBox.styles';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { useV9CustomStyles } from '../styles/SendBox.styles';\nimport { InputBoxButton } from '../InputBoxButton';\nimport { RichTextSendBoxErrors, RichTextSendBoxErrorsProps } from './RichTextSendBoxErrors';\nimport { isMessageTooLong, isSendBoxButtonAriaDisabled, sanitizeText } from '../utils/SendBoxUtils';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { insertAttachmentsAndImages } from '../utils/SendBoxUtils';\nimport { RichTextEditorComponentRef } from './RichTextEditor';\nimport { useTheme } from '../../theming';\nimport { richTextActionButtonsStyle, sendBoxRichTextEditorStyle } from '../styles/RichTextEditor.styles';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { _AttachmentUploadCards } from '../Attachment/AttachmentUploadCards';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadataInProgress, MessageOptions } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { isAttachmentUploadCompleted, hasIncompleteAttachmentUploads } from '../utils/SendBoxUtils';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { SendBoxErrorBarError } from '../SendBoxErrorBar';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { attachmentUploadCardsStyles } from '../styles/SendBox.styles';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { FluentV9ThemeProvider } from '../../theming/FluentV9ThemeProvider';\n\n/**\n * Strings of {@link RichTextSendBox} that can be overridden.\n *\n * @beta\n */\nexport interface RichTextSendBoxStrings extends RichTextStrings, SendBoxStrings {}\n\n/**\n * Strings of RichText that can be overridden.\n *\n * @beta\n */\nexport interface RichTextStrings {\n /**\n * Tooltip text for the bold button.\n */\n richTextBoldTooltip: string;\n /**\n * Tooltip text for the italic button.\n */\n richTextItalicTooltip: string;\n /**\n * Tooltip text for the underline button.\n */\n richTextUnderlineTooltip: string;\n /**\n * Tooltip text for the bullet list button.\n */\n richTextBulletListTooltip: string;\n /**\n * Tooltip text for the number list button.\n */\n richTextNumberListTooltip: string;\n /**\n * Tooltip text for the increase indent button.\n */\n richTextIncreaseIndentTooltip: string;\n /**\n * Tooltip text for the decrease indent button.\n */\n richTextDecreaseIndentTooltip: string;\n /**\n * Tooltip text insert table button.\n */\n richTextInsertTableTooltip: string;\n /**\n * Tooltip text for the rich text format button button.\n */\n richTextFormatButtonTooltip: string;\n /**\n * Text for the insert menu item.\n */\n richTextInsertRowOrColumnMenu: string;\n /**\n * Title for the insert table menu.\n */\n richTextInsertTableMenuTitle: string;\n /**\n * Text for the insert menu item to insert row above the current selection.\n */\n richTextInsertRowAboveMenu: string;\n /**\n * Text for the insert menu item to insert row below the current selection.\n */\n richTextInsertRowBelowMenu: string;\n /**\n * Text for the insert menu item to insert column to the left from the current selection.\n */\n richTextInsertColumnLeftMenu: string;\n /**\n * Text for the insert menu item to insert column to the right from the current selection.\n */\n richTextInsertColumnRightMenu: string;\n /**\n * Text for the delete row or column menu.\n */\n richTextDeleteRowOrColumnMenu: string;\n /**\n * Text for the delete column menu.\n */\n richTextDeleteColumnMenu: string;\n /**\n * Text for the delete row menu.\n */\n richTextDeleteRowMenu: string;\n /**\n * Text for the delete table menu.\n */\n richTextDeleteTableMenu: string;\n /**\n * Text for the rich text toolbar more button.\n */\n richTextToolbarMoreButtonAriaLabel: string;\n}\n\n/**\n * Props for {@link RichTextSendBox}.\n *\n * @beta\n */\nexport interface RichTextSendBoxProps {\n /**\n * Optional boolean to disable text box\n * @defaultValue false\n */\n disabled?: boolean;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n /**\n * Optional callback to handle paste event.\n */\n onPaste?: (event: { content: DocumentFragment }) => void;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<RichTextSendBoxStrings>;\n /**\n * Optional text for system message above the text box\n */\n systemMessage?: string;\n /* @conditional-compile-remove(file-sharing-acs) */\n /**\n * Optional array of type {@link AttachmentMetadataInProgress}\n * to render attachments being uploaded in the SendBox.\n * @beta\n */\n attachments?: AttachmentMetadataInProgress[];\n /**\n * enumerable to determine if the input box has focus on render or not.\n * When undefined nothing has focus on render\n */\n autoFocus?: 'sendBoxTextField';\n /* @conditional-compile-remove(file-sharing-acs) */\n /**\n * Optional callback to remove the attachment upload before sending by clicking on\n * cancel icon.\n */\n onCancelAttachmentUpload?: (attachmentId: string) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n /**\n * Optional callback to remove the attachment upload or delete the image before sending.\n */\n onCancelInlineImageUpload?: (imageId: string) => void;\n /**\n * Callback function used when the send button is clicked.\n */\n onSendMessage: (\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n options?: MessageOptions\n ) => Promise<void>;\n /**\n * Optional callback called when user is typing\n */\n onTyping?: () => Promise<void>;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n /**\n * Optional callback to upload an inline image in the rich text editor.\n */\n onUploadInlineImage?: (imageUrl: string, imageFileName: string) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n /**\n * Optional array of type {@link AttachmentMetadataInProgress}\n * to render inline images being uploaded in the RichTextSendBox.\n */\n imageUploadsInProgress?: AttachmentMetadataInProgress[];\n}\n\n/**\n * A component to render SendBox with Rich Text Editor support.\n *\n * @beta\n */\nexport const RichTextSendBox = (props: RichTextSendBoxProps): JSX.Element => {\n const {\n disabled = false,\n systemMessage,\n autoFocus,\n onSendMessage,\n onTyping,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachments,\n /* @conditional-compile-remove(file-sharing-acs) */\n onCancelAttachmentUpload,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onUploadInlineImage,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n imageUploadsInProgress,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onCancelInlineImageUpload\n } = props;\n\n const theme = useTheme();\n const locale = useLocale();\n\n const localeStrings = useMemo(() => {\n /* @conditional-compile-remove(rich-text-editor) */\n return locale.strings.richTextSendBox;\n return locale.strings.sendBox;\n }, [/* @conditional-compile-remove(rich-text-editor) */ locale.strings.richTextSendBox, locale.strings.sendBox]);\n\n const strings = useMemo(() => {\n return { ...localeStrings, ...props.strings };\n }, [localeStrings, props.strings]);\n\n const [contentValue, setContentValue] = useState('');\n const [contentValueOverflow, setContentValueOverflow] = useState(false);\n /* @conditional-compile-remove(file-sharing-acs) */\n const [attachmentUploadsPendingError, setAttachmentUploadsPendingError] = useState<SendBoxErrorBarError | undefined>(\n undefined\n );\n const editorComponentRef = useRef<RichTextEditorComponentRef>(null);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const customV9Styles = useV9CustomStyles();\n\n const contentTooLongMessage = useMemo(\n () => (contentValueOverflow ? strings.textTooLong : undefined),\n [contentValueOverflow, strings.textTooLong]\n );\n\n const setContent = useCallback((newValue?: string): void => {\n if (newValue === undefined) {\n return;\n }\n\n setContentValueOverflow(isMessageTooLong(newValue.length));\n setContentValue(newValue);\n }, []);\n\n const onChangeHandler = useCallback(\n (\n newValue?: string,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ imageSrcArray?: Array<string>\n ) => {\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n if (imageSrcArray && imageUploadsInProgress && imageUploadsInProgress?.length > 0) {\n imageUploadsInProgress?.map((uploadImage) => {\n if (uploadImage.url && imageSrcArray && !imageSrcArray?.includes(uploadImage.url)) {\n onCancelInlineImageUpload?.(uploadImage.id);\n }\n });\n }\n\n setContent(newValue);\n },\n [\n setContent,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ onCancelInlineImageUpload,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ imageUploadsInProgress\n ]\n );\n\n const hasContent = useMemo(() => {\n // get plain text content from the editor to check if the message is empty\n // as the content may contain tags even when the content is empty\n const plainTextContent = editorComponentRef.current?.getPlainContent();\n return sanitizeText(contentValue ?? '').length > 0 && sanitizeText(plainTextContent ?? '').length > 0;\n }, [contentValue]);\n\n const sendMessageOnClick = useCallback((): void => {\n if (disabled || contentValueOverflow) {\n return;\n }\n // Don't send message until all attachments have been uploaded successfully\n /* @conditional-compile-remove(file-sharing-acs) */\n setAttachmentUploadsPendingError(undefined);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n if (\n /* @conditional-compile-remove(file-sharing-acs) */ hasIncompleteAttachmentUploads(attachments) ||\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ hasIncompleteAttachmentUploads(\n imageUploadsInProgress\n )\n ) {\n setAttachmentUploadsPendingError({ message: strings.attachmentUploadsPendingError, timestamp: Date.now() });\n return;\n }\n\n let message = contentValue;\n // we don't want to send empty messages including spaces, newlines, tabs\n // Message can be empty if there is a valid attachment upload\n if (\n hasContent ||\n /* @conditional-compile-remove(file-sharing-acs) */ isAttachmentUploadCompleted(attachments) ||\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ isAttachmentUploadCompleted(\n imageUploadsInProgress\n )\n ) {\n /* @conditional-compile-remove(file-sharing-acs) */\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n const { content, attachmentArray } = insertAttachmentsAndImages(\n contentValue,\n /* @conditional-compile-remove(file-sharing-acs) */ attachments,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ imageUploadsInProgress\n );\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n message = content;\n\n onSendMessage(\n message,\n /* @conditional-compile-remove(file-sharing-acs) */ /* @conditional-compile-remove(rich-text-editor-composite-support) */\n {\n /* @conditional-compile-remove(file-sharing-acs) */\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n attachments: attachmentArray,\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n type: 'html'\n }\n );\n setContentValue('');\n editorComponentRef.current?.setEmptyContent();\n editorComponentRef.current?.focus();\n }\n }, [\n disabled,\n contentValueOverflow,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachments,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n imageUploadsInProgress,\n contentValue,\n hasContent,\n /* @conditional-compile-remove(file-sharing-acs) */\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n strings.attachmentUploadsPendingError,\n onSendMessage\n ]);\n\n const hasErrorMessage = useMemo(() => {\n return (\n !!systemMessage ||\n !!contentTooLongMessage ||\n /* @conditional-compile-remove(file-sharing-acs) */\n !!attachmentUploadsPendingError ||\n /* @conditional-compile-remove(file-sharing-acs) */\n !!attachments?.filter((attachmentUpload) => attachmentUpload.error).pop()?.error ||\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n !!imageUploadsInProgress?.filter((image) => image.error).pop()?.error\n );\n }, [\n /* @conditional-compile-remove(file-sharing-acs) */\n attachments,\n contentTooLongMessage,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentUploadsPendingError,\n systemMessage,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n imageUploadsInProgress\n ]);\n\n const onRenderSendIcon = useCallback(\n (isHover: boolean) => {\n return (\n <Icon\n iconName={isHover && hasContent ? 'SendBoxSendHovered' : 'SendBoxSend'}\n className={sendIconStyle({\n theme,\n hasText: hasContent,\n /* @conditional-compile-remove(file-sharing-acs) */\n hasAttachment: false,\n hasErrorMessage: hasErrorMessage,\n defaultTextColor: theme.palette.neutralSecondary,\n disabled: disabled\n })}\n />\n );\n },\n [disabled, hasContent, hasErrorMessage, theme]\n );\n\n const sendBoxErrorsProps: RichTextSendBoxErrorsProps = useMemo(() => {\n /* @conditional-compile-remove(file-sharing-acs) */\n const uploadErrorMessage = attachments?.filter((attachmentUpload) => attachmentUpload.error).pop()?.error?.message;\n return {\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentUploadsPendingError: attachmentUploadsPendingError,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentProgressError: uploadErrorMessage\n ? {\n message: uploadErrorMessage,\n timestamp: Date.now()\n }\n : undefined,\n systemMessage: systemMessage,\n textTooLongMessage: contentTooLongMessage\n };\n }, [\n /* @conditional-compile-remove(file-sharing-acs) */\n attachments,\n contentTooLongMessage,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentUploadsPendingError,\n systemMessage\n ]);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const onRenderAttachmentUploads = useCallback(() => {\n return (\n <Stack className={attachmentUploadCardsStyles}>\n <FluentV9ThemeProvider v8Theme={theme} className={customV9Styles.clearBackground}>\n <_AttachmentUploadCards\n attachments={attachments}\n onCancelAttachmentUpload={onCancelAttachmentUpload}\n strings={{\n removeAttachment: strings.removeAttachment,\n uploading: strings.uploading,\n uploadCompleted: strings.uploadCompleted,\n attachmentMoreMenu: strings.attachmentMoreMenu\n }}\n disabled={disabled}\n />\n </FluentV9ThemeProvider>\n </Stack>\n );\n }, [\n theme,\n customV9Styles.clearBackground,\n attachments,\n onCancelAttachmentUpload,\n strings.removeAttachment,\n strings.uploading,\n strings.uploadCompleted,\n strings.attachmentMoreMenu,\n disabled\n ]);\n\n const isSendBoxButtonAriaDisabledValue = useMemo(() => {\n return isSendBoxButtonAriaDisabled({\n hasContent,\n /* @conditional-compile-remove(file-sharing-acs) */ hasCompletedAttachmentUploads:\n isAttachmentUploadCompleted(attachments),\n hasError: hasErrorMessage,\n disabled\n });\n }, [/* @conditional-compile-remove(file-sharing-acs) */ attachments, disabled, hasContent, hasErrorMessage]);\n\n const sendButton = useMemo(() => {\n return (\n <InputBoxButton\n onRenderIcon={onRenderSendIcon}\n onClick={(e) => {\n sendMessageOnClick();\n e.stopPropagation(); // Prevents the click from bubbling up and triggering a focus event on the chat.\n }}\n className={richTextActionButtonsStyle}\n ariaLabel={localeStrings.sendButtonAriaLabel}\n tooltipContent={localeStrings.sendButtonAriaLabel}\n ariaDisabled={isSendBoxButtonAriaDisabledValue}\n />\n );\n }, [isSendBoxButtonAriaDisabledValue, localeStrings.sendButtonAriaLabel, onRenderSendIcon, sendMessageOnClick]);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const hasAttachmentUploads = useMemo(() => {\n return isAttachmentUploadCompleted(attachments) || hasIncompleteAttachmentUploads(attachments);\n }, [attachments]);\n\n return (\n <Stack>\n <RichTextSendBoxErrors {...sendBoxErrorsProps} />\n <RichTextInputBoxComponent\n placeholderText={strings.placeholderText}\n autoFocus={autoFocus}\n onChange={onChangeHandler}\n onEnterKeyDown={sendMessageOnClick}\n onTyping={onTyping}\n editorComponentRef={editorComponentRef}\n strings={strings}\n disabled={disabled}\n actionComponents={sendButton}\n richTextEditorStyleProps={sendBoxRichTextEditorStyle}\n /* @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentUploads={onRenderAttachmentUploads}\n /* @conditional-compile-remove(file-sharing-acs) */\n hasAttachments={hasAttachmentUploads}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste={onPaste}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onUploadInlineImage={onUploadInlineImage}\n />\n </Stack>\n );\n};\n"]}
@@ -11,4 +11,8 @@ export declare const scrollbarStyles: {
11
11
  background: string;
12
12
  };
13
13
  };
14
+ /**
15
+ * @private
16
+ */
17
+ export declare const ERROR_IMAGE_SVG_PATH = "M2.85 2.15a.5.5 0 1 0-.7.7l1.4 1.41A2.99 2.99 0 0 0 3 6v8a3 3 0 0 0 3 3h8c.65 0 1.25-.2 1.74-.55l1.4 1.4a.5.5 0 0 0 .71-.7l-15-15Zm6.56 7.97a1.5 1.5 0 0 0-.46.31l-4.67 4.59A2 2 0 0 1 4 14V6a2 2 0 0 1 .28-1.02l5.13 5.14ZM6 16a2 2 0 0 1-1.01-.27l4.66-4.58c.2-.2.5-.2.7 0l4.66 4.58A2 2 0 0 1 14 16H6ZM16 6v7.88l.9.9A3 3 0 0 0 17 14V6a3 3 0 0 0-3-3H6a3 3 0 0 0-.78.1l.9.9H14a2 2 0 0 1 2 2Zm-2 1.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0Zm-1 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z";
14
18
  //# sourceMappingURL=Common.style.d.ts.map
@@ -13,4 +13,8 @@ export const scrollbarStyles = {
13
13
  background: 'rgba(150, 150, 150)'
14
14
  }
15
15
  };
16
+ /**
17
+ * @private
18
+ */
19
+ export const ERROR_IMAGE_SVG_PATH = 'M2.85 2.15a.5.5 0 1 0-.7.7l1.4 1.41A2.99 2.99 0 0 0 3 6v8a3 3 0 0 0 3 3h8c.65 0 1.25-.2 1.74-.55l1.4 1.4a.5.5 0 0 0 .71-.7l-15-15Zm6.56 7.97a1.5 1.5 0 0 0-.46.31l-4.67 4.59A2 2 0 0 1 4 14V6a2 2 0 0 1 .28-1.02l5.13 5.14ZM6 16a2 2 0 0 1-1.01-.27l4.66-4.58c.2-.2.5-.2.7 0l4.66 4.58A2 2 0 0 1 14 16H6ZM16 6v7.88l.9.9A3 3 0 0 0 17 14V6a3 3 0 0 0-3-3H6a3 3 0 0 0-.78.1l.9.9H14a2 2 0 0 1 2 2Zm-2 1.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0Zm-1 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z';
16
20
  //# sourceMappingURL=Common.style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Common.style.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/Common.style.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,2CAA2C,EAAE;QAC3C,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE,QAAQ;KACjB;IACD,uDAAuD,EAAE;QACvD,YAAY,EAAE,MAAM;QACpB,UAAU,EAAE,qBAAqB;KAClC;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @private\n */\nexport const scrollbarStyles = {\n '::-webkit-scrollbar, *::-webkit-scrollbar': {\n width: '0.3rem',\n height: '0.3rem'\n },\n '::-webkit-scrollbar-thumb, *::-webkit-scrollbar-thumb': {\n borderRadius: '10px',\n background: 'rgba(150, 150, 150)'\n }\n};\n"]}
1
+ {"version":3,"file":"Common.style.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/Common.style.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,2CAA2C,EAAE;QAC3C,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE,QAAQ;KACjB;IACD,uDAAuD,EAAE;QACvD,YAAY,EAAE,MAAM;QACpB,UAAU,EAAE,qBAAqB;KAClC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,mdAAmd,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @private\n */\nexport const scrollbarStyles = {\n '::-webkit-scrollbar, *::-webkit-scrollbar': {\n width: '0.3rem',\n height: '0.3rem'\n },\n '::-webkit-scrollbar-thumb, *::-webkit-scrollbar-thumb': {\n borderRadius: '10px',\n background: 'rgba(150, 150, 150)'\n }\n};\n\n/**\n * @private\n */\nexport const ERROR_IMAGE_SVG_PATH =\n 'M2.85 2.15a.5.5 0 1 0-.7.7l1.4 1.41A2.99 2.99 0 0 0 3 6v8a3 3 0 0 0 3 3h8c.65 0 1.25-.2 1.74-.55l1.4 1.4a.5.5 0 0 0 .71-.7l-15-15Zm6.56 7.97a1.5 1.5 0 0 0-.46.31l-4.67 4.59A2 2 0 0 1 4 14V6a2 2 0 0 1 .28-1.02l5.13 5.14ZM6 16a2 2 0 0 1-1.01-.27l4.66-4.58c.2-.2.5-.2.7 0l4.66 4.58A2 2 0 0 1 14 16H6ZM16 6v7.88l.9.9A3 3 0 0 0 17 14V6a3 3 0 0 0-3-3H6a3 3 0 0 0-.78.1l.9.9H14a2 2 0 0 1 2 2Zm-2 1.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0Zm-1 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z';\n"]}