@azure/communication-react 1.18.0-alpha-202407200014 → 1.18.0-alpha-202407262302
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/communication-react.d.ts +33 -94
 - package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-D4ctXnw1.js → ChatMessageComponentAsRichTextEditBox-CmXCpkwp.js} +9 -58
 - package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-CmXCpkwp.js.map +1 -0
 - package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-F6eqVXer.js → RichTextSendBoxWrapper-DI4k0qyf.js} +2 -2
 - package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-F6eqVXer.js.map → RichTextSendBoxWrapper-DI4k0qyf.js.map} +1 -1
 - package/dist/dist-cjs/communication-react/{index-BJO_NOTU.js → index-BSczaURy.js} +479 -831
 - package/dist/dist-cjs/communication-react/index-BSczaURy.js.map +1 -0
 - package/dist/dist-cjs/communication-react/index.js +1 -1
 - package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
 - package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
 - package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +1 -1
 - package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +3 -3
 - package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
 - package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js +2 -2
 - package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js.map +1 -1
 - package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.d.ts +3 -3
 - package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.js.map +1 -1
 - package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.d.ts +1 -1
 - package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js +7 -15
 - package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js.map +1 -1
 - package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +1 -3
 - package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
 - package/dist/dist-esm/calling-stateful-client/src/CallContext.js +2 -2
 - package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
 - package/dist/dist-esm/calling-stateful-client/src/Converter.js +1 -1
 - package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
 - package/dist/dist-esm/calling-stateful-client/src/IncomingCallDeclarative.d.ts +8 -2
 - package/dist/dist-esm/calling-stateful-client/src/IncomingCallDeclarative.js.map +1 -1
 - package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.d.ts +2 -14
 - package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.js.map +1 -1
 - package/dist/dist-esm/calling-stateful-client/src/TypeGuards.d.ts +1 -9
 - package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js +0 -16
 - package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js.map +1 -1
 - package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +1 -1
 - package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
 - package/dist/dist-esm/chat-stateful-client/src/ChatClientState.d.ts +3 -5
 - package/dist/dist-esm/chat-stateful-client/src/ChatClientState.js.map +1 -1
 - package/dist/dist-esm/communication-react/src/index.d.ts +1 -1
 - package/dist/dist-esm/communication-react/src/index.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCard.js +8 -14
 - package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCard.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +2 -8
 - package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.d.ts +4 -6
 - package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js +12 -2
 - package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.d.ts +2 -2
 - package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +8 -60
 - package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +6 -8
 - package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js +4 -18
 - package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +3 -27
 - package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.d.ts +8 -8
 - package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.js +4 -4
 - package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +15 -9
 - package/dist/dist-esm/react-components/src/components/MessageThread.js +1 -10
 - package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js +1 -0
 - package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +22 -28
 - package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +0 -49
 - package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +18 -37
 - package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js +2 -20
 - package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/index.d.ts +1 -2
 - package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.d.ts +2 -2
 - package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.js +17 -15
 - package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/styles/Common.style.d.ts +1 -1
 - package/dist/dist-esm/react-components/src/components/styles/Common.style.js +1 -2
 - package/dist/dist-esm/react-components/src/components/styles/Common.style.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +2 -5
 - package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +3 -3
 - package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.d.ts +5 -1
 - package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js +21 -0
 - package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +3 -15
 - package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +14 -67
 - package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
 - package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +1 -1
 - package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
 - package/dist/dist-esm/react-components/src/localization/locales/ar-SA/strings.json +64 -102
 - package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/strings.json +62 -100
 - package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +62 -100
 - package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +62 -100
 - package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +3 -9
 - package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +62 -100
 - package/dist/dist-esm/react-components/src/localization/locales/fi-FI/strings.json +62 -100
 - package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +65 -103
 - package/dist/dist-esm/react-components/src/localization/locales/he-IL/strings.json +62 -100
 - package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +62 -100
 - package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +64 -102
 - package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +69 -107
 - package/dist/dist-esm/react-components/src/localization/locales/nb-NO/strings.json +62 -100
 - package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +68 -106
 - package/dist/dist-esm/react-components/src/localization/locales/pl-PL/strings.json +67 -105
 - package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +65 -103
 - package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +63 -101
 - package/dist/dist-esm/react-components/src/localization/locales/sv-SE/strings.json +62 -100
 - package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +63 -101
 - package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +64 -102
 - package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +63 -101
 - package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js +4 -4
 - package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js.map +1 -1
 - package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useMeetingPhoneInfo.js +1 -1
 - package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useMeetingPhoneInfo.js.map +1 -1
 - package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +1 -1
 - package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
 - package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +31 -66
 - package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
 - package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.d.ts +1 -33
 - package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js +6 -198
 - package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js.map +1 -1
 - package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/useImageUpload.d.ts +12 -0
 - package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/useImageUpload.js +115 -0
 - package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/useImageUpload.js.map +1 -0
 - package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.d.ts +7 -7
 - package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js.map +1 -1
 - package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +10 -10
 - package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
 - package/dist/dist-esm/react-composites/src/composites/common/MeetingPhoneInfoPaneContent.js +4 -4
 - package/dist/dist-esm/react-composites/src/composites/common/MeetingPhoneInfoPaneContent.js.map +1 -1
 - package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.d.ts +5 -2
 - package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js.map +1 -1
 - package/dist/dist-esm/react-composites/src/composites/common/constants.d.ts +0 -4
 - package/dist/dist-esm/react-composites/src/composites/common/constants.js +0 -4
 - package/dist/dist-esm/react-composites/src/composites/common/constants.js.map +1 -1
 - package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +2 -6
 - package/dist/dist-esm/react-composites/src/composites/common/icons.js +1 -5
 - package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json +5 -10
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +1 -6
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +1 -6
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +1 -6
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +1 -6
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json +5 -10
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +5 -10
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/strings.json +5 -10
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +5 -10
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +1 -6
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +5 -10
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/strings.json +1 -6
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +1 -6
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/strings.json +1 -6
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +5 -10
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +1 -6
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/strings.json +5 -10
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +1 -6
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +5 -10
 - package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +5 -10
 - package/package.json +14 -14
 - package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-D4ctXnw1.js.map +0 -1
 - package/dist/dist-cjs/communication-react/index-BJO_NOTU.js.map +0 -1
 - package/dist/dist-esm/calling-stateful-client/src/TeamsIncomingCallDeclarative.d.ts +0 -17
 - package/dist/dist-esm/calling-stateful-client/src/TeamsIncomingCallDeclarative.js +0 -49
 - package/dist/dist-esm/calling-stateful-client/src/TeamsIncomingCallDeclarative.js.map +0 -1
 - package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.d.ts +0 -49
 - package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.js +0 -48
 - package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.js.map +0 -1
 
    
        package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"file":"ChatMessageComponentWrapper.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/ChatMessage/ChatMessageComponentWrapper.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAevC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAC;AAClG,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC; 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"ChatMessageComponentWrapper.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/ChatMessage/ChatMessageComponentWrapper.tsx"],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QACJ,CAAC;QAED,OAAO,CAAC,CAAC,CAAC;YACR,mHAAmH;YACnH,MAAM,sBAAsB,GAAG,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,yCAAK,CAAC,CAAC,CAAC,eAAe,mBAAM,KAAK,EAAG,CAAC;YACrG,OAAO,CACL,6BAAK,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,kBAAkB,IAC5C,sBAAsB,CACnB,CACP,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,KAA6C,EAAe,EAAE;IACzF,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QAChC,OAAO,oBAAC,4BAA4B,oBAAK,KAAK,EAAI,CAAC;IACrD,CAAC;SAAM,CAAC;QACN,OAAO,oBAAC,0BAA0B,oBAAK,KAAK,EAAI,CAAC;IACnD,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { MessageStatus } from '@internal/acs-ui-common';\nimport React, { useMemo } from 'react';\nimport { MessageProps, MessageRenderer, MessageThreadStyles, _ChatMessageProps } from '../MessageThread';\n/* @conditional-compile-remove(rich-text-editor) */\nimport { RichTextEditorOptions } from '../MessageThread';\nimport { ChatMessage, OnRenderAvatarCallback } from '../../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../types';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMenuAction } from '../../types/Attachment';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(mention) */\nimport { MentionOptions } from '../MentionPopover';\nimport { MessageStatusIndicatorProps } from '../MessageStatusIndicator';\nimport { FluentChatMessageComponentWrapperProps } from './MessageComponents/FluentChatMessageComponent';\nimport { DefaultSystemMessage } from './DefaultSystemMessage';\nimport { InlineImageOptions } from './ChatMessageContent';\nimport { FluentChatMyMessageComponent } from './MyMessageComponents/FluentChatMyMessageComponent';\nimport { FluentChatMessageComponent } from './MessageComponents/FluentChatMessageComponent';\n\n/**\n * Props for {@link ChatMessageComponentWrapper}\n *\n * @private\n */\nexport type ChatMessageComponentWrapperProps = _ChatMessageProps & {\n  /**\n   * UserId of the current user.\n   */\n  userId: string;\n  styles: MessageThreadStyles | undefined;\n  shouldOverlapAvatarAndMessage: boolean;\n  onRenderMessageStatus: ((messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null) | undefined;\n  defaultStatusRenderer: (\n    message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage,\n    participantCount: number,\n    readCount: number,\n    status?: MessageStatus\n  ) => JSX.Element;\n  onRenderMessage?: (messageProps: MessageProps, messageRenderer?: MessageRenderer) => JSX.Element;\n  onRenderAvatar?: OnRenderAvatarCallback;\n  showMessageStatus?: boolean;\n  participantCount?: number;\n  readCount?: number;\n  onActionButtonClick: (\n    message: ChatMessage,\n    setMessageReadBy: (\n      readBy: {\n        id: string;\n        displayName: string;\n      }[]\n    ) => void\n  ) => void;\n  /* @conditional-compile-remove(date-time-customization) */\n  onDisplayDateTimeString?: (messageDate: Date) => string;\n  inlineImageOptions?: InlineImageOptions;\n  /* @conditional-compile-remove(mention) */\n  mentionOptions?: MentionOptions;\n  /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n  onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;\n  /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n  /**\n   * Optional callback to define custom actions for attachments.\n   */\n  actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];\n  /* @conditional-compile-remove(rich-text-editor) */\n  richTextEditorOptions?: RichTextEditorOptions;\n};\n\n/**\n * The wrapper component to display different types of chat message.\n *\n * @private\n */\nexport const ChatMessageComponentWrapper = (props: ChatMessageComponentWrapperProps): JSX.Element => {\n  const { message, styles, onRenderMessage, key: messageKey } = props;\n\n  const systemMessageStyle = useMemo(() => {\n    return {\n      paddingTop: '0.5rem'\n    };\n  }, []);\n\n  const customMessageStyle = useMemo(() => {\n    return { paddingTop: '1rem', paddingBottom: '0.25rem' };\n  }, []);\n\n  /* @conditional-compile-remove(data-loss-prevention) */\n  // Similar logic as switch statement case 'chat', if statement for conditional compile (merge logic to switch case when stabilize)\n  if (message.messageType === 'blocked') {\n    const myChatMessageStyle =\n      message.status === 'failed'\n        ? styles?.failedMyChatMessageContainer ?? styles?.myChatMessageContainer\n        : styles?.myChatMessageContainer;\n    const blockedMessageStyle = styles?.blockedMessageContainer;\n    const messageContainerStyle = message.mine ? myChatMessageStyle : blockedMessageStyle;\n    return fluentChatComponent({ ...props, message: message, messageContainerStyle: messageContainerStyle });\n  }\n\n  switch (message.messageType) {\n    case 'chat': {\n      const myChatMessageStyle =\n        message.status === 'failed'\n          ? styles?.failedMyChatMessageContainer ?? styles?.myChatMessageContainer\n          : styles?.myChatMessageContainer;\n      const chatMessageStyle = styles?.chatMessageContainer;\n      const messageContainerStyle = message.mine ? myChatMessageStyle : chatMessageStyle;\n      return fluentChatComponent({ ...props, message: message, messageContainerStyle: messageContainerStyle });\n    }\n\n    case 'system': {\n      const messageContainerStyle = styles?.systemMessageContainer;\n      const systemMessageComponent =\n        onRenderMessage === undefined ? (\n          <DefaultSystemMessage {...props} />\n        ) : (\n          onRenderMessage({ ...props, messageContainerStyle }, (props) => <DefaultSystemMessage {...props} />)\n        );\n      return (\n        <div key={messageKey} style={systemMessageStyle}>\n          {systemMessageComponent}\n        </div>\n      );\n    }\n\n    default: {\n      // We do not handle custom type message by default, users can handle custom type by using onRenderMessage function.\n      const customMessageComponent = onRenderMessage === undefined ? <></> : onRenderMessage({ ...props });\n      return (\n        <div key={messageKey} style={customMessageStyle}>\n          {customMessageComponent}\n        </div>\n      );\n    }\n  }\n};\n\nconst fluentChatComponent = (props: FluentChatMessageComponentWrapperProps): JSX.Element => {\n  if (props.message.mine === true) {\n    return <FluentChatMyMessageComponent {...props} />;\n  } else {\n    return <FluentChatMessageComponent {...props} />;\n  }\n};\n"]}
         
     | 
| 
         @@ -3,6 +3,7 @@ import { ChatMessage } from '../../../types'; 
     | 
|
| 
       3 
3 
     | 
    
         
             
            import { AttachmentMetadata } from "../../../../../acs-ui-common/src";
         
     | 
| 
       4 
4 
     | 
    
         
             
            import { AttachmentMetadataInProgress } from "../../../../../acs-ui-common/src";
         
     | 
| 
       5 
5 
     | 
    
         
             
            import { MessageThreadStrings } from '../../MessageThread';
         
     | 
| 
      
 6 
     | 
    
         
            +
            import { RichTextEditorOptions } from '../../MessageThread';
         
     | 
| 
       6 
7 
     | 
    
         
             
            import { MentionLookupOptions } from '../../MentionPopover';
         
     | 
| 
       7 
8 
     | 
    
         
             
            import type { ChatMessageComponentAsRichTextEditBoxProps } from './ChatMessageComponentAsRichTextEditBox';
         
     | 
| 
       8 
9 
     | 
    
         
             
            /**
         
     | 
| 
         @@ -24,12 +25,9 @@ export type ChatMessageComponentAsEditBoxPickerProps = { 
     | 
|
| 
       24 
25 
     | 
    
         
             
                message: ChatMessage;
         
     | 
| 
       25 
26 
     | 
    
         
             
                strings: MessageThreadStrings;
         
     | 
| 
       26 
27 
     | 
    
         
             
                mentionLookupOptions?: MentionLookupOptions;
         
     | 
| 
       27 
     | 
    
         
            -
                 
     | 
| 
       28 
     | 
    
         
            -
                 
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
       30 
     | 
    
         
            -
                }) => void;
         
     | 
| 
       31 
     | 
    
         
            -
                onCancelInlineImageUpload?: (imageId: string, messageId: string) => void;
         
     | 
| 
       32 
     | 
    
         
            -
                onUploadInlineImage?: (imageUrl: string, imageFileName: string, messageId: string) => void;
         
     | 
| 
      
 28 
     | 
    
         
            +
                richTextEditorOptions?: RichTextEditorOptions;
         
     | 
| 
      
 29 
     | 
    
         
            +
                onCancelInlineImageUpload?: (imageId: string) => void;
         
     | 
| 
      
 30 
     | 
    
         
            +
                onUploadInlineImage?: (imageUrl: string, imageFileName: string) => void;
         
     | 
| 
       33 
31 
     | 
    
         
             
                imageUploadsInProgress?: AttachmentMetadataInProgress[];
         
     | 
| 
       34 
32 
     | 
    
         
             
            };
         
     | 
| 
       35 
33 
     | 
    
         
             
            /**
         
     | 
| 
         @@ -20,14 +20,24 @@ export const loadChatMessageComponentAsRichTextEditBox = () => import('./ChatMes 
     | 
|
| 
       20 
20 
     | 
    
         
             
             * @private
         
     | 
| 
       21 
21 
     | 
    
         
             
             */
         
     | 
| 
       22 
22 
     | 
    
         
             
            export const ChatMessageComponentAsEditBoxPicker = (props) => {
         
     | 
| 
      
 23 
     | 
    
         
            +
                /* @conditional-compile-remove(rich-text-editor) */
         
     | 
| 
      
 24 
     | 
    
         
            +
                const { richTextEditorOptions } = props;
         
     | 
| 
       23 
25 
     | 
    
         
             
                const simpleEditBox = useMemo(() => {
         
     | 
| 
       24 
26 
     | 
    
         
             
                    return React.createElement(ChatMessageComponentAsEditBox, Object.assign({}, props));
         
     | 
| 
       25 
27 
     | 
    
         
             
                }, [props]);
         
     | 
| 
       26 
28 
     | 
    
         
             
                /* @conditional-compile-remove(rich-text-editor) */
         
     | 
| 
       27 
     | 
    
         
            -
                if ( 
     | 
| 
      
 29 
     | 
    
         
            +
                if (richTextEditorOptions) {
         
     | 
| 
       28 
30 
     | 
    
         
             
                    return (React.createElement(_ErrorBoundary, { fallback: simpleEditBox },
         
     | 
| 
       29 
31 
     | 
    
         
             
                        React.createElement(Suspense, { fallback: simpleEditBox },
         
     | 
| 
       30 
     | 
    
         
            -
                            React.createElement(ChatMessageComponentAsRichTextEditBox, Object.assign({}, props 
     | 
| 
      
 32 
     | 
    
         
            +
                            React.createElement(ChatMessageComponentAsRichTextEditBox, Object.assign({}, props, { 
         
     | 
| 
      
 33 
     | 
    
         
            +
                                /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
      
 34 
     | 
    
         
            +
                                onPaste: richTextEditorOptions === null || richTextEditorOptions === void 0 ? void 0 : richTextEditorOptions.onPaste, 
         
     | 
| 
      
 35 
     | 
    
         
            +
                                /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
      
 36 
     | 
    
         
            +
                                onUploadInlineImage: richTextEditorOptions === null || richTextEditorOptions === void 0 ? void 0 : richTextEditorOptions.onUploadInlineImage, 
         
     | 
| 
      
 37 
     | 
    
         
            +
                                /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
      
 38 
     | 
    
         
            +
                                imageUploadsInProgress: richTextEditorOptions === null || richTextEditorOptions === void 0 ? void 0 : richTextEditorOptions.imageUploadsInProgress, 
         
     | 
| 
      
 39 
     | 
    
         
            +
                                /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
      
 40 
     | 
    
         
            +
                                onCancelInlineImageUpload: richTextEditorOptions === null || richTextEditorOptions === void 0 ? void 0 : richTextEditorOptions.onCancelInlineImageUpload })))));
         
     | 
| 
       31 
41 
     | 
    
         
             
                }
         
     | 
| 
       32 
42 
     | 
    
         
             
                return simpleEditBox;
         
     | 
| 
       33 
43 
     | 
    
         
             
            };
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"file":"ChatMessageComponentAsEditBoxPicker.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,mDAAmD;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC; 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"ChatMessageComponentAsEditBoxPicker.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,mDAAmD;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AASjC,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAKhF,mDAAmD;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,mDAAmD;AACnD,MAAM,qCAAqC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,yCAAyC,CAAC,CAAC,CAAC;AAElH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,GAEtD,EAAE,CAAC,MAAM,CAAC,yCAAyC,CAAC,CAAC;AA0BxD;;GAEG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,KAA+C,EAAe,EAAE;IAClH,mDAAmD;IACnD,MAAM,EAAE,qBAAqB,EAAE,GAAG,KAAK,CAAC;IAExC,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE;QACjC,OAAO,oBAAC,6BAA6B,oBAAK,KAAK,EAAI,CAAC;IACtD,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,mDAAmD;IACnD,IAAI,qBAAqB,EAAE,CAAC;QAC1B,OAAO,CACL,oBAAC,cAAc,IAAC,QAAQ,EAAE,aAAa;YACrC,oBAAC,QAAQ,IAAC,QAAQ,EAAE,aAAa;gBAC/B,oBAAC,qCAAqC,oBAChC,KAAK;oBACT,gEAAgE;oBAChE,OAAO,EAAE,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,OAAO;oBACvC,gEAAgE;oBAChE,mBAAmB,EAAE,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,mBAAmB;oBAC/D,gEAAgE;oBAChE,sBAAsB,EAAE,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,sBAAsB;oBACrE,gEAAgE;oBAChE,yBAAyB,EAAE,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,yBAAyB,IAC3E,CACO,CACI,CAClB,CAAC;IACJ,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useMemo } from 'react';\n/* @conditional-compile-remove(rich-text-editor) */\nimport { Suspense } from 'react';\nimport { ChatMessage } from '../../../types';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { AttachmentMetadataInProgress } from '@internal/acs-ui-common';\nimport { MessageThreadStrings } from '../../MessageThread';\n/* @conditional-compile-remove(rich-text-editor) */\nimport { RichTextEditorOptions } from '../../MessageThread';\nimport { ChatMessageComponentAsEditBox } from './ChatMessageComponentAsEditBox';\n/* @conditional-compile-remove(mention) */\nimport { MentionLookupOptions } from '../../MentionPopover';\n/* @conditional-compile-remove(rich-text-editor) */\nimport type { ChatMessageComponentAsRichTextEditBoxProps } from './ChatMessageComponentAsRichTextEditBox';\n/* @conditional-compile-remove(rich-text-editor) */\nimport { _ErrorBoundary } from '../../ErrorBoundary';\n\n/* @conditional-compile-remove(rich-text-editor) */\nconst ChatMessageComponentAsRichTextEditBox = React.lazy(() => import('./ChatMessageComponentAsRichTextEditBox'));\n\n/**\n * @private\n * Use this function to load RoosterJS dependencies early in the lifecycle.\n * It should be the same import as used for lazy loading.\n *\n * @conditional-compile-remove(rich-text-editor)\n */\nexport const loadChatMessageComponentAsRichTextEditBox = (): Promise<{\n  default: React.ComponentType<ChatMessageComponentAsRichTextEditBoxProps>;\n}> => import('./ChatMessageComponentAsRichTextEditBox');\n\n/**\n * @private\n */\nexport type ChatMessageComponentAsEditBoxPickerProps = {\n  onCancel?: (messageId: string) => void;\n  onSubmit: (\n    text: string,\n    /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n    attachmentMetadata?: AttachmentMetadata[]\n  ) => void;\n  message: ChatMessage;\n  strings: MessageThreadStrings;\n  /* @conditional-compile-remove(mention) */\n  mentionLookupOptions?: MentionLookupOptions;\n  /* @conditional-compile-remove(rich-text-editor) */\n  richTextEditorOptions?: RichTextEditorOptions;\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  onCancelInlineImageUpload?: (imageId: string) => void;\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  onUploadInlineImage?: (imageUrl: string, imageFileName: string) => void;\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  imageUploadsInProgress?: AttachmentMetadataInProgress[];\n};\n\n/**\n * @private\n */\nexport const ChatMessageComponentAsEditBoxPicker = (props: ChatMessageComponentAsEditBoxPickerProps): JSX.Element => {\n  /* @conditional-compile-remove(rich-text-editor) */\n  const { richTextEditorOptions } = props;\n\n  const simpleEditBox = useMemo(() => {\n    return <ChatMessageComponentAsEditBox {...props} />;\n  }, [props]);\n\n  /* @conditional-compile-remove(rich-text-editor) */\n  if (richTextEditorOptions) {\n    return (\n      <_ErrorBoundary fallback={simpleEditBox}>\n        <Suspense fallback={simpleEditBox}>\n          <ChatMessageComponentAsRichTextEditBox\n            {...props}\n            /* @conditional-compile-remove(rich-text-editor-image-upload) */\n            onPaste={richTextEditorOptions?.onPaste}\n            /* @conditional-compile-remove(rich-text-editor-image-upload) */\n            onUploadInlineImage={richTextEditorOptions?.onUploadInlineImage}\n            /* @conditional-compile-remove(rich-text-editor-image-upload) */\n            imageUploadsInProgress={richTextEditorOptions?.imageUploadsInProgress}\n            /* @conditional-compile-remove(rich-text-editor-image-upload) */\n            onCancelInlineImageUpload={richTextEditorOptions?.onCancelInlineImageUpload}\n          />\n        </Suspense>\n      </_ErrorBoundary>\n    );\n  }\n\n  return simpleEditBox;\n};\n"]}
         
     | 
| 
         @@ -12,8 +12,8 @@ export type ChatMessageComponentAsRichTextEditBoxProps = { 
     | 
|
| 
       12 
12 
     | 
    
         
             
                onPaste?: (event: {
         
     | 
| 
       13 
13 
     | 
    
         
             
                    content: DocumentFragment;
         
     | 
| 
       14 
14 
     | 
    
         
             
                }) => void;
         
     | 
| 
       15 
     | 
    
         
            -
                onCancelInlineImageUpload?: (imageId: string 
     | 
| 
       16 
     | 
    
         
            -
                onUploadInlineImage?: (imageUrl: string, imageFileName: string 
     | 
| 
      
 15 
     | 
    
         
            +
                onCancelInlineImageUpload?: (imageId: string) => void;
         
     | 
| 
      
 16 
     | 
    
         
            +
                onUploadInlineImage?: (imageUrl: string, imageFileName: string) => void;
         
     | 
| 
       17 
17 
     | 
    
         
             
                imageUploadsInProgress?: AttachmentMetadataInProgress[];
         
     | 
| 
       18 
18 
     | 
    
         
             
            };
         
     | 
| 
       19 
19 
     | 
    
         
             
            /**
         
     | 
| 
         @@ -15,7 +15,7 @@ import { _AttachmentUploadCards } from '../../Attachment/AttachmentUploadCards'; 
     | 
|
| 
       15 
15 
     | 
    
         
             
            import { useChatMessageRichTextEditContainerStyles } from '../../styles/ChatMessageComponent.styles';
         
     | 
| 
       16 
16 
     | 
    
         
             
            import { MAXIMUM_LENGTH_OF_MESSAGE } from '../../utils/SendBoxUtils';
         
     | 
| 
       17 
17 
     | 
    
         
             
            /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       18 
     | 
    
         
            -
            import { cancelInlineImageUpload, hasIncompleteAttachmentUploads, insertImagesToContentString, isAttachmentUploadCompleted 
     | 
| 
      
 18 
     | 
    
         
            +
            import { cancelInlineImageUpload, hasIncompleteAttachmentUploads, insertImagesToContentString, isAttachmentUploadCompleted } from '../../utils/SendBoxUtils';
         
     | 
| 
       19 
19 
     | 
    
         
             
            import { getMessageState, onRenderCancelIcon, onRenderSubmitIcon } from '../../utils/ChatMessageComponentAsEditBoxUtils';
         
     | 
| 
       20 
20 
     | 
    
         
             
            /* @conditional-compile-remove(file-sharing-acs) */
         
     | 
| 
       21 
21 
     | 
    
         
             
            import { attachmentMetadataReducer, getMessageWithAttachmentMetadata, doesMessageContainMultipleAttachments } from '../../utils/ChatMessageComponentAsEditBoxUtils';
         
     | 
| 
         @@ -27,8 +27,6 @@ import { useLocale } from '../../../localization'; 
     | 
|
| 
       27 
27 
     | 
    
         
             
            import { FluentV9ThemeProvider } from '../../../theming/FluentV9ThemeProvider';
         
     | 
| 
       28 
28 
     | 
    
         
             
            /* @conditional-compile-remove(file-sharing-acs) */
         
     | 
| 
       29 
29 
     | 
    
         
             
            import { attachmentUploadCardsStyles } from '../../styles/SendBox.styles';
         
     | 
| 
       30 
     | 
    
         
            -
            /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       31 
     | 
    
         
            -
            import { BROKEN_IMAGE_SVG_DATA } from '../../styles/Common.style';
         
     | 
| 
       32 
30 
     | 
    
         
             
            /**
         
     | 
| 
       33 
31 
     | 
    
         
             
             * @private
         
     | 
| 
       34 
32 
     | 
    
         
             
             */
         
     | 
| 
         @@ -43,31 +41,7 @@ export const ChatMessageComponentAsRichTextEditBox = (props) => { 
     | 
|
| 
       43 
41 
     | 
    
         
             
                imageUploadsInProgress, 
         
     | 
| 
       44 
42 
     | 
    
         
             
                /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       45 
43 
     | 
    
         
             
                onCancelInlineImageUpload } = props;
         
     | 
| 
       46 
     | 
    
         
            -
                const  
     | 
| 
       47 
     | 
    
         
            -
                    /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       48 
     | 
    
         
            -
                    const content = message.content;
         
     | 
| 
       49 
     | 
    
         
            -
                    /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       50 
     | 
    
         
            -
                    const document = new DOMParser().parseFromString(content !== null && content !== void 0 ? content : '', 'text/html');
         
     | 
| 
       51 
     | 
    
         
            -
                    // The broken image element is a div element with all the attributes of the original image element.
         
     | 
| 
       52 
     | 
    
         
            -
                    // We need to convert it to a img element so the Rooster knows how to render it.
         
     | 
| 
       53 
     | 
    
         
            -
                    // And we need to copy over all the attributes such as id, width, etc.
         
     | 
| 
       54 
     | 
    
         
            -
                    // which is needed for sending the message with the images correctly.
         
     | 
| 
       55 
     | 
    
         
            -
                    /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       56 
     | 
    
         
            -
                    document.querySelectorAll('.broken-image-wrapper').forEach((brokenImage) => {
         
     | 
| 
       57 
     | 
    
         
            -
                        var _a;
         
     | 
| 
       58 
     | 
    
         
            -
                        const imageElement = document.createElement('img');
         
     | 
| 
       59 
     | 
    
         
            -
                        const attributes = brokenImage.attributes;
         
     | 
| 
       60 
     | 
    
         
            -
                        for (const attribute of attributes) {
         
     | 
| 
       61 
     | 
    
         
            -
                            imageElement.setAttribute(attribute.name, attribute.value);
         
     | 
| 
       62 
     | 
    
         
            -
                        }
         
     | 
| 
       63 
     | 
    
         
            -
                        imageElement.src = BROKEN_IMAGE_SVG_DATA;
         
     | 
| 
       64 
     | 
    
         
            -
                        (_a = brokenImage.parentElement) === null || _a === void 0 ? void 0 : _a.replaceChild(imageElement, brokenImage);
         
     | 
| 
       65 
     | 
    
         
            -
                    });
         
     | 
| 
       66 
     | 
    
         
            -
                    /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       67 
     | 
    
         
            -
                    return document.body.innerHTML;
         
     | 
| 
       68 
     | 
    
         
            -
                    return message.content;
         
     | 
| 
       69 
     | 
    
         
            -
                }, [message]);
         
     | 
| 
       70 
     | 
    
         
            -
                const [textValue, setTextValue] = useState(initialContent || '');
         
     | 
| 
      
 44 
     | 
    
         
            +
                const [textValue, setTextValue] = useState(message.content || '');
         
     | 
| 
       71 
45 
     | 
    
         
             
                /* @conditional-compile-remove(file-sharing-acs) */
         
     | 
| 
       72 
46 
     | 
    
         
             
                const [attachmentMetadata, handleAttachmentAction] = useReducer(attachmentMetadataReducer, (_a = getMessageWithAttachmentMetadata(message)) !== null && _a !== void 0 ? _a : []);
         
     | 
| 
       73 
47 
     | 
    
         
             
                /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
         @@ -77,11 +51,6 @@ export const ChatMessageComponentAsRichTextEditBox = (props) => { 
     | 
|
| 
       77 
51 
     | 
    
         
             
                const messageState = useMemo(() => {
         
     | 
| 
       78 
52 
     | 
    
         
             
                    return getMessageState(textValue, /* @conditional-compile-remove(file-sharing-acs) */ attachmentMetadata !== null && attachmentMetadata !== void 0 ? attachmentMetadata : []);
         
     | 
| 
       79 
53 
     | 
    
         
             
                }, [/* @conditional-compile-remove(file-sharing-acs) */ attachmentMetadata, textValue]);
         
     | 
| 
       80 
     | 
    
         
            -
                /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       81 
     | 
    
         
            -
                const imageUploadErrorMessage = useMemo(() => {
         
     | 
| 
       82 
     | 
    
         
            -
                    var _a, _b;
         
     | 
| 
       83 
     | 
    
         
            -
                    return (_b = (_a = imageUploadsInProgress === null || imageUploadsInProgress === void 0 ? void 0 : imageUploadsInProgress.filter((image) => image.error).pop()) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.message;
         
     | 
| 
       84 
     | 
    
         
            -
                }, [imageUploadsInProgress]);
         
     | 
| 
       85 
54 
     | 
    
         
             
                const submitEnabled = messageState === 'OK';
         
     | 
| 
       86 
55 
     | 
    
         
             
                const editContainerStyles = useChatMessageRichTextEditContainerStyles();
         
     | 
| 
       87 
56 
     | 
    
         
             
                const chatMyMessageStyles = useChatMyMessageStyles();
         
     | 
| 
         @@ -126,13 +95,8 @@ export const ChatMessageComponentAsRichTextEditBox = (props) => { 
     | 
|
| 
       126 
95 
     | 
    
         
             
                    }
         
     | 
| 
       127 
96 
     | 
    
         
             
                    let content = textValue;
         
     | 
| 
       128 
97 
     | 
    
         
             
                    /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       129 
     | 
    
         
            -
                    content = removeBrokenImageContent(content);
         
     | 
| 
       130 
     | 
    
         
            -
                    /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       131 
98 
     | 
    
         
             
                    if (isAttachmentUploadCompleted(imageUploadsInProgress)) {
         
     | 
| 
       132 
     | 
    
         
            -
                        insertImagesToContentString(textValue, imageUploadsInProgress 
     | 
| 
       133 
     | 
    
         
            -
                            onSubmit(content, /* @conditional-compile-remove(file-sharing-acs) */ attachmentMetadata || []);
         
     | 
| 
       134 
     | 
    
         
            -
                        });
         
     | 
| 
       135 
     | 
    
         
            -
                        return;
         
     | 
| 
      
 99 
     | 
    
         
            +
                        content = insertImagesToContentString(textValue, imageUploadsInProgress);
         
     | 
| 
       136 
100 
     | 
    
         
             
                    }
         
     | 
| 
       137 
101 
     | 
    
         
             
                    // it's very important to pass an empty attachment here
         
     | 
| 
       138 
102 
     | 
    
         
             
                    // so when user removes all attachments, UI can reflect it instantly
         
     | 
| 
         @@ -193,40 +157,24 @@ export const ChatMessageComponentAsRichTextEditBox = (props) => { 
     | 
|
| 
       193 
157 
     | 
    
         
             
                const onChangeHandler = useCallback((content, 
         
     | 
| 
       194 
158 
     | 
    
         
             
                /* @conditional-compile-remove(rich-text-editor-image-upload) */ imageSrcArray) => {
         
     | 
| 
       195 
159 
     | 
    
         
             
                    /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       196 
     | 
    
         
            -
                    cancelInlineImageUpload( 
     | 
| 
       197 
     | 
    
         
            -
                        imageSrcArray,
         
     | 
| 
       198 
     | 
    
         
            -
                        imageUploadsInProgress,
         
     | 
| 
       199 
     | 
    
         
            -
                        messageId: message.messageId,
         
     | 
| 
       200 
     | 
    
         
            -
                        editBoxOnCancelInlineImageUpload: onCancelInlineImageUpload,
         
     | 
| 
       201 
     | 
    
         
            -
                        sendBoxOnCancelInlineImageUpload: undefined
         
     | 
| 
       202 
     | 
    
         
            -
                    });
         
     | 
| 
      
 160 
     | 
    
         
            +
                    cancelInlineImageUpload(imageSrcArray, imageUploadsInProgress, onCancelInlineImageUpload);
         
     | 
| 
       203 
161 
     | 
    
         
             
                    setText(content);
         
     | 
| 
       204 
162 
     | 
    
         
             
                }, [
         
     | 
| 
       205 
163 
     | 
    
         
             
                    setText,
         
     | 
| 
       206 
164 
     | 
    
         
             
                    /* @conditional-compile-remove(rich-text-editor-image-upload) */ imageUploadsInProgress,
         
     | 
| 
       207 
     | 
    
         
            -
                    /* @conditional-compile-remove(rich-text-editor-image-upload) */ onCancelInlineImageUpload 
     | 
| 
       208 
     | 
    
         
            -
                    /* @conditional-compile-remove(rich-text-editor-image-upload) */ message.messageId
         
     | 
| 
      
 165 
     | 
    
         
            +
                    /* @conditional-compile-remove(rich-text-editor-image-upload) */ onCancelInlineImageUpload
         
     | 
| 
       209 
166 
     | 
    
         
             
                ]);
         
     | 
| 
       210 
167 
     | 
    
         
             
                const getContent = () => {
         
     | 
| 
       211 
168 
     | 
    
         
             
                    return (React.createElement(Stack, { className: mergeStyles(editBoxWidthStyles) },
         
     | 
| 
       212 
169 
     | 
    
         
             
                        React.createElement(RichTextSendBoxErrors, { textTooLongMessage: textTooLongMessage, systemMessage: message.failureReason, 
         
     | 
| 
       213 
     | 
    
         
            -
                            /* @conditional-compile-remove(rich-text-editor-image-upload) */ attachmentUploadsPendingError: attachmentUploadsPendingError, 
     | 
| 
       214 
     | 
    
         
            -
             
     | 
| 
       215 
     | 
    
         
            -
                            attachmentProgressError: imageUploadErrorMessage
         
     | 
| 
       216 
     | 
    
         
            -
                                ? {
         
     | 
| 
       217 
     | 
    
         
            -
                                    message: imageUploadErrorMessage,
         
     | 
| 
       218 
     | 
    
         
            -
                                    timestamp: Date.now()
         
     | 
| 
       219 
     | 
    
         
            -
                                }
         
     | 
| 
       220 
     | 
    
         
            -
                                : undefined }),
         
     | 
| 
       221 
     | 
    
         
            -
                        React.createElement(RichTextInputBoxComponent, { placeholderText: strings.editBoxPlaceholderText, onChange: onChangeHandler, editorComponentRef: editTextFieldRef, initialContent: initialContent, strings: richTextLocaleStrings, disabled: false, actionComponents: actionButtons, richTextEditorStyleProps: editBoxRichTextEditorStyle, isHorizontalLayoutDisabled: true, 
         
     | 
| 
      
 170 
     | 
    
         
            +
                            /* @conditional-compile-remove(rich-text-editor-image-upload) */ attachmentUploadsPendingError: attachmentUploadsPendingError }),
         
     | 
| 
      
 171 
     | 
    
         
            +
                        React.createElement(RichTextInputBoxComponent, { placeholderText: strings.editBoxPlaceholderText, onChange: onChangeHandler, editorComponentRef: editTextFieldRef, initialContent: message.content, strings: richTextLocaleStrings, disabled: false, actionComponents: actionButtons, richTextEditorStyleProps: editBoxRichTextEditorStyle, isHorizontalLayoutDisabled: true, 
         
     | 
| 
       222 
172 
     | 
    
         
             
                            /* @conditional-compile-remove(file-sharing-acs) */
         
     | 
| 
       223 
173 
     | 
    
         
             
                            onRenderAttachmentUploads: onRenderAttachmentUploads, 
         
     | 
| 
       224 
174 
     | 
    
         
             
                            /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       225 
175 
     | 
    
         
             
                            onPaste: onPaste, 
         
     | 
| 
       226 
176 
     | 
    
         
             
                            /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       227 
     | 
    
         
            -
                            onUploadInlineImage:  
     | 
| 
       228 
     | 
    
         
            -
                                onUploadInlineImage && onUploadInlineImage(imageUrl, imageFileName, message.messageId);
         
     | 
| 
       229 
     | 
    
         
            -
                            } })));
         
     | 
| 
      
 177 
     | 
    
         
            +
                            onUploadInlineImage: onUploadInlineImage })));
         
     | 
| 
       230 
178 
     | 
    
         
             
                };
         
     | 
| 
       231 
179 
     | 
    
         
             
                const attached = message.attached === true ? 'center' : message.attached === 'bottom' ? 'bottom' : 'top';
         
     | 
| 
       232 
180 
     | 
    
         
             
                return (React.createElement(ChatMyMessage, { attached: attached, root: {
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"file":"ChatMessageComponentAsRichTextEditBox.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,yCAAgC;AAGxD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzE,mDAAmD;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAGhF,OAAO,EAAE,yCAAyC,EAAE,MAAM,0CAA0C,CAAC;AACrG,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,gEAAgE;AAChE,OAAO,EACL,uBAAuB,EACvB,8BAA8B,EAC9B,2BAA2B,EAC3B,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,gDAAgD,CAAC;AACxD,mDAAmD;AACnD,OAAO,EACL,yBAAyB,EACzB,g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AAC;gBACzF,CAAC,GACD,CACI,CACT,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;IACzG,OAAO,CACL,oBAAC,aAAa,IACZ,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE;YACJ,SAAS,EAAE,YAAY,CACrB,mBAAmB,CAAC,IAAI;YACxB,mDAAmD;YACnD,sBAAsB,CAAC,CAAC,CAAC,mBAAmB,CAAC,4BAA4B,CAAC,CAAC,CAAC,SAAS,CACtF;SACF,EACD,IAAI,EAAE;YACJ,SAAS,EAAE,YAAY,CACrB,mBAAmB,CAAC,IAAI,EACxB,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAClE;SACF,IAEA,UAAU,EAAE,CACC,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qCAAqC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { mergeStyles, Stack } from '@fluentui/react';\nimport { ChatMyMessage } from '@fluentui-contrib/react-chat';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { _formatString } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { AttachmentMetadataInProgress } from '@internal/acs-ui-common';\nimport { useTheme } from '../../../theming';\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { useReducer } from 'react';\nimport { editBoxWidthStyles, richTextEditBoxActionButtonIcon } from '../../styles/EditBox.styles';\nimport { InputBoxButton } from '../../InputBoxButton';\nimport { MessageThreadStrings } from '../../MessageThread';\nimport { useChatMyMessageStyles } from '../../styles/MessageThread.styles';\nimport { ChatMessage } from '../../../types';\nimport { _AttachmentUploadCards } from '../../Attachment/AttachmentUploadCards';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { useChatMessageRichTextEditContainerStyles } from '../../styles/ChatMessageComponent.styles';\nimport { MAXIMUM_LENGTH_OF_MESSAGE } from '../../utils/SendBoxUtils';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport {\n  cancelInlineImageUpload,\n  hasIncompleteAttachmentUploads,\n  insertImagesToContentString,\n  isAttachmentUploadCompleted,\n  removeBrokenImageContent\n} from '../../utils/SendBoxUtils';\nimport {\n  getMessageState,\n  onRenderCancelIcon,\n  onRenderSubmitIcon\n} from '../../utils/ChatMessageComponentAsEditBoxUtils';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport {\n  attachmentMetadataReducer,\n  getMessageWithAttachmentMetadata,\n  doesMessageContainMultipleAttachments\n} from '../../utils/ChatMessageComponentAsEditBoxUtils';\nimport { RichTextEditorComponentRef } from '../../RichTextEditor/RichTextEditor';\nimport { RichTextInputBoxComponent } from '../../RichTextEditor/RichTextInputBoxComponent';\nimport { editBoxRichTextEditorStyle, richTextActionButtonsStyle } from '../../styles/RichTextEditor.styles';\nimport { RichTextSendBoxErrors } from '../../RichTextEditor/RichTextSendBoxErrors';\nimport { useLocale } from '../../../localization';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { FluentV9ThemeProvider } from '../../../theming/FluentV9ThemeProvider';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { attachmentUploadCardsStyles } from '../../styles/SendBox.styles';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { SendBoxErrorBarError } from '../../SendBoxErrorBar';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { BROKEN_IMAGE_SVG_DATA } from '../../styles/Common.style';\n\n/** @private */\nexport type ChatMessageComponentAsRichTextEditBoxProps = {\n  onCancel?: (messageId: string) => void;\n  onSubmit: (\n    text: string,\n    /* @conditional-compile-remove(file-sharing-acs) */\n    attachmentMetadata?: AttachmentMetadata[]\n  ) => void;\n  message: ChatMessage;\n  strings: MessageThreadStrings;\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  onPaste?: (event: { content: DocumentFragment }) => void;\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  onCancelInlineImageUpload?: (imageId: string, messageId: string) => void;\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  onUploadInlineImage?: (imageUrl: string, imageFileName: string, messageId: string) => void;\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  imageUploadsInProgress?: AttachmentMetadataInProgress[];\n};\n\n/**\n * @private\n */\nexport const ChatMessageComponentAsRichTextEditBox = (\n  props: ChatMessageComponentAsRichTextEditBoxProps\n): JSX.Element => {\n  const {\n    onCancel,\n    onSubmit,\n    strings,\n    message,\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 initialContent = useMemo(() => {\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */\n    const content = message.content;\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */\n    const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n    // The broken image element is a div element with all the attributes of the original image element.\n    // We need to convert it to a img element so the Rooster knows how to render it.\n    // And we need to copy over all the attributes such as id, width, etc.\n    // which is needed for sending the message with the images correctly.\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */\n    document.querySelectorAll('.broken-image-wrapper').forEach((brokenImage) => {\n      const imageElement = document.createElement('img');\n      const attributes = brokenImage.attributes;\n      for (const attribute of attributes) {\n        imageElement.setAttribute(attribute.name, attribute.value);\n      }\n\n      imageElement.src = BROKEN_IMAGE_SVG_DATA;\n      brokenImage.parentElement?.replaceChild(imageElement, brokenImage);\n    });\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */\n    return document.body.innerHTML;\n    return message.content;\n  }, [message]);\n\n  const [textValue, setTextValue] = useState<string>(initialContent || '');\n\n  /* @conditional-compile-remove(file-sharing-acs) */\n  const [attachmentMetadata, handleAttachmentAction] = useReducer(\n    attachmentMetadataReducer,\n    getMessageWithAttachmentMetadata(message) ?? []\n  );\n\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  const [attachmentUploadsPendingError, setAttachmentUploadsPendingError] = useState<SendBoxErrorBarError | undefined>(\n    undefined\n  );\n  const editTextFieldRef = React.useRef<RichTextEditorComponentRef>(null);\n  const theme = useTheme();\n  const messageState = useMemo(() => {\n    return getMessageState(textValue, /* @conditional-compile-remove(file-sharing-acs) */ attachmentMetadata ?? []);\n  }, [/* @conditional-compile-remove(file-sharing-acs) */ attachmentMetadata, textValue]);\n\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  const imageUploadErrorMessage = useMemo(() => {\n    return imageUploadsInProgress?.filter((image) => image.error).pop()?.error?.message;\n  }, [imageUploadsInProgress]);\n\n  const submitEnabled = messageState === 'OK';\n\n  const editContainerStyles = useChatMessageRichTextEditContainerStyles();\n  const chatMyMessageStyles = useChatMyMessageStyles();\n  const locale = useLocale().strings;\n\n  const setText = useCallback((newValue?: string): void => {\n    setTextValue(newValue ?? '');\n  }, []);\n\n  useEffect(() => {\n    editTextFieldRef.current?.focus();\n  }, []);\n\n  const textTooLongMessage = useMemo(() => {\n    return messageState === 'too long'\n      ? _formatString(strings.editBoxTextLimit, { limitNumber: `${MAXIMUM_LENGTH_OF_MESSAGE}` })\n      : undefined;\n  }, [messageState, strings.editBoxTextLimit]);\n\n  const iconClassName = useCallback(\n    (isHover: boolean) => {\n      const color = isHover ? theme.palette.accent : theme.palette.neutralSecondary;\n      return mergeStyles(richTextEditBoxActionButtonIcon, { color });\n    },\n    [theme.palette.accent, theme.palette.neutralSecondary]\n  );\n\n  const onRenderThemedCancelIcon = useCallback(\n    (isHover: boolean) => {\n      return onRenderCancelIcon(iconClassName(isHover));\n    },\n    [iconClassName]\n  );\n\n  const onRenderThemedSubmitIcon = useCallback(\n    (isHover: boolean) => {\n      return onRenderSubmitIcon(iconClassName(isHover));\n    },\n    [iconClassName]\n  );\n\n  /* @conditional-compile-remove(file-sharing-acs) */\n  const hasMultipleAttachments = useMemo(() => {\n    return doesMessageContainMultipleAttachments(message);\n  }, [message]);\n\n  const onSubmitHandler = useCallback((): void => {\n    if (!submitEnabled) {\n      return;\n    }\n    // Don't send message until all attachments have been uploaded successfully\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */\n    setAttachmentUploadsPendingError(undefined);\n\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */\n    if (hasIncompleteAttachmentUploads(imageUploadsInProgress)) {\n      setAttachmentUploadsPendingError({ message: strings.attachmentUploadsPendingError, timestamp: Date.now() });\n      return;\n    }\n\n    let content = textValue;\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */\n    content = removeBrokenImageContent(content);\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */\n    if (isAttachmentUploadCompleted(imageUploadsInProgress)) {\n      insertImagesToContentString(textValue, imageUploadsInProgress, (content) => {\n        onSubmit(content, /* @conditional-compile-remove(file-sharing-acs) */ attachmentMetadata || []);\n      });\n      return;\n    }\n    // it's very important to pass an empty attachment here\n    // so when user removes all attachments, UI can reflect it instantly\n    // if you set it to undefined, the attachments pre-edited would still be there\n    // until edit message event is received\n    onSubmit(content, /* @conditional-compile-remove(file-sharing-acs) */ attachmentMetadata || []);\n  }, [\n    submitEnabled,\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */\n    imageUploadsInProgress,\n    textValue,\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */\n    strings.attachmentUploadsPendingError,\n    onSubmit,\n    /* @conditional-compile-remove(file-sharing-acs) */\n    attachmentMetadata\n  ]);\n\n  const actionButtons = useMemo(() => {\n    return (\n      <Stack horizontal>\n        <InputBoxButton\n          className={richTextActionButtonsStyle}\n          ariaLabel={strings.editBoxCancelButton}\n          tooltipContent={strings.editBoxCancelButton}\n          onRenderIcon={onRenderThemedCancelIcon}\n          onClick={() => {\n            onCancel && onCancel(message.messageId);\n          }}\n          id={'dismissIconWrapper'}\n          data-testId={strings.editBoxCancelButton}\n        />\n        <InputBoxButton\n          className={richTextActionButtonsStyle}\n          ariaLabel={strings.editBoxSubmitButton}\n          tooltipContent={strings.editBoxSubmitButton}\n          onRenderIcon={onRenderThemedSubmitIcon}\n          onClick={(e) => {\n            onSubmitHandler();\n            e.stopPropagation();\n          }}\n          id={'submitIconWrapper'}\n          data-testId={strings.editBoxSubmitButton}\n        />\n      </Stack>\n    );\n  }, [\n    message.messageId,\n    onCancel,\n    onRenderThemedCancelIcon,\n    onRenderThemedSubmitIcon,\n    strings.editBoxCancelButton,\n    strings.editBoxSubmitButton,\n    onSubmitHandler\n  ]);\n  const richTextLocaleStrings = useMemo(() => {\n    /* @conditional-compile-remove(rich-text-editor) */\n    return { ...locale.richTextSendBox, ...strings };\n    return locale.sendBox;\n  }, [\n    /* @conditional-compile-remove(rich-text-editor) */ locale.richTextSendBox,\n    /* @conditional-compile-remove(rich-text-editor) */ strings,\n    locale.sendBox\n  ]);\n\n  /* @conditional-compile-remove(file-sharing-acs) */\n  const onCancelAttachmentUpload = useCallback((attachmentId: string) => {\n    // edit box only capable of removing attachments\n    // we need to expand attachment actions\n    // if we want to support more actions e.g. add\n    handleAttachmentAction({ type: 'remove', id: attachmentId });\n  }, []);\n\n  /* @conditional-compile-remove(file-sharing-acs) */\n  const onRenderAttachmentUploads = useCallback(() => {\n    return (\n      <Stack className={attachmentUploadCardsStyles}>\n        <FluentV9ThemeProvider v8Theme={theme}>\n          <_AttachmentUploadCards\n            attachments={attachmentMetadata}\n            onCancelAttachmentUpload={onCancelAttachmentUpload}\n          />\n        </FluentV9ThemeProvider>\n      </Stack>\n    );\n  }, [attachmentMetadata, onCancelAttachmentUpload, theme]);\n\n  const onChangeHandler = useCallback(\n    (\n      content: string | undefined,\n      /* @conditional-compile-remove(rich-text-editor-image-upload) */ imageSrcArray?: Array<string>\n    ) => {\n      /* @conditional-compile-remove(rich-text-editor-image-upload) */\n      cancelInlineImageUpload({\n        imageSrcArray,\n        imageUploadsInProgress,\n        messageId: message.messageId,\n        editBoxOnCancelInlineImageUpload: onCancelInlineImageUpload,\n        sendBoxOnCancelInlineImageUpload: undefined\n      });\n      setText(content);\n    },\n    [\n      setText,\n      /* @conditional-compile-remove(rich-text-editor-image-upload) */ imageUploadsInProgress,\n      /* @conditional-compile-remove(rich-text-editor-image-upload) */ onCancelInlineImageUpload,\n      /* @conditional-compile-remove(rich-text-editor-image-upload) */ message.messageId\n    ]\n  );\n\n  const getContent = (): JSX.Element => {\n    return (\n      <Stack className={mergeStyles(editBoxWidthStyles)}>\n        <RichTextSendBoxErrors\n          textTooLongMessage={textTooLongMessage}\n          systemMessage={message.failureReason}\n          /* @conditional-compile-remove(rich-text-editor-image-upload) */ attachmentUploadsPendingError={\n            attachmentUploadsPendingError\n          }\n          /* @conditional-compile-remove(rich-text-editor-image-upload) */\n          attachmentProgressError={\n            imageUploadErrorMessage\n              ? {\n                  message: imageUploadErrorMessage,\n                  timestamp: Date.now()\n                }\n              : undefined\n          }\n        />\n        <RichTextInputBoxComponent\n          placeholderText={strings.editBoxPlaceholderText}\n          onChange={onChangeHandler}\n          editorComponentRef={editTextFieldRef}\n          initialContent={initialContent}\n          strings={richTextLocaleStrings}\n          disabled={false}\n          actionComponents={actionButtons}\n          richTextEditorStyleProps={editBoxRichTextEditorStyle}\n          isHorizontalLayoutDisabled={true}\n          /* @conditional-compile-remove(file-sharing-acs) */\n          onRenderAttachmentUploads={onRenderAttachmentUploads}\n          /* @conditional-compile-remove(rich-text-editor-image-upload) */\n          onPaste={onPaste}\n          /* @conditional-compile-remove(rich-text-editor-image-upload) */\n          onUploadInlineImage={(imageUrl: string, imageFileName: string) => {\n            onUploadInlineImage && onUploadInlineImage(imageUrl, imageFileName, message.messageId);\n          }}\n        />\n      </Stack>\n    );\n  };\n\n  const attached = message.attached === true ? 'center' : message.attached === 'bottom' ? 'bottom' : 'top';\n  return (\n    <ChatMyMessage\n      attached={attached}\n      root={{\n        className: mergeClasses(\n          chatMyMessageStyles.root,\n          /* @conditional-compile-remove(file-sharing-acs) */\n          hasMultipleAttachments ? chatMyMessageStyles.multipleAttachmentsInEditing : undefined\n        )\n      }}\n      body={{\n        className: mergeClasses(\n          editContainerStyles.body,\n          attached !== 'top' ? editContainerStyles.bodyAttached : undefined\n        )\n      }}\n    >\n      {getContent()}\n    </ChatMyMessage>\n  );\n};\n\nexport default ChatMessageComponentAsRichTextEditBox;\n"]}
         
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"ChatMessageComponentAsRichTextEditBox.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,yCAAgC;AAGxD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzE,mDAAmD;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO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oBAAC,aAAa,IACZ,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE;YACJ,SAAS,EAAE,YAAY,CACrB,mBAAmB,CAAC,IAAI;YACxB,mDAAmD;YACnD,sBAAsB,CAAC,CAAC,CAAC,mBAAmB,CAAC,4BAA4B,CAAC,CAAC,CAAC,SAAS,CACtF;SACF,EACD,IAAI,EAAE;YACJ,SAAS,EAAE,YAAY,CACrB,mBAAmB,CAAC,IAAI,EACxB,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAClE;SACF,IAEA,UAAU,EAAE,CACC,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qCAAqC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { mergeStyles, Stack } from '@fluentui/react';\nimport { ChatMyMessage } from '@fluentui-contrib/react-chat';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { _formatString } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { AttachmentMetadataInProgress } from '@internal/acs-ui-common';\nimport { useTheme } from '../../../theming';\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { useReducer } from 'react';\nimport { editBoxWidthStyles, richTextEditBoxActionButtonIcon } from '../../styles/EditBox.styles';\nimport { InputBoxButton } from '../../InputBoxButton';\nimport { MessageThreadStrings } from '../../MessageThread';\nimport { useChatMyMessageStyles } from '../../styles/MessageThread.styles';\nimport { ChatMessage } from '../../../types';\nimport { _AttachmentUploadCards } from '../../Attachment/AttachmentUploadCards';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { useChatMessageRichTextEditContainerStyles } from '../../styles/ChatMessageComponent.styles';\nimport { MAXIMUM_LENGTH_OF_MESSAGE } from '../../utils/SendBoxUtils';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport {\n  cancelInlineImageUpload,\n  hasIncompleteAttachmentUploads,\n  insertImagesToContentString,\n  isAttachmentUploadCompleted\n} from '../../utils/SendBoxUtils';\nimport {\n  getMessageState,\n  onRenderCancelIcon,\n  onRenderSubmitIcon\n} from '../../utils/ChatMessageComponentAsEditBoxUtils';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport {\n  attachmentMetadataReducer,\n  getMessageWithAttachmentMetadata,\n  doesMessageContainMultipleAttachments\n} from '../../utils/ChatMessageComponentAsEditBoxUtils';\nimport { RichTextEditorComponentRef } from '../../RichTextEditor/RichTextEditor';\nimport { RichTextInputBoxComponent } from '../../RichTextEditor/RichTextInputBoxComponent';\nimport { editBoxRichTextEditorStyle, richTextActionButtonsStyle } from '../../styles/RichTextEditor.styles';\nimport { RichTextSendBoxErrors } from '../../RichTextEditor/RichTextSendBoxErrors';\nimport { useLocale } from '../../../localization';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { FluentV9ThemeProvider } from '../../../theming/FluentV9ThemeProvider';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { attachmentUploadCardsStyles } from '../../styles/SendBox.styles';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { SendBoxErrorBarError } from '../../SendBoxErrorBar';\n\n/** @private */\nexport type ChatMessageComponentAsRichTextEditBoxProps = {\n  onCancel?: (messageId: string) => void;\n  onSubmit: (\n    text: string,\n    /* @conditional-compile-remove(file-sharing-acs) */\n    attachmentMetadata?: AttachmentMetadata[]\n  ) => void;\n  message: ChatMessage;\n  strings: MessageThreadStrings;\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  onPaste?: (event: { content: DocumentFragment }) => void;\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  onCancelInlineImageUpload?: (imageId: string) => void;\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  onUploadInlineImage?: (imageUrl: string, imageFileName: string) => void;\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  imageUploadsInProgress?: AttachmentMetadataInProgress[];\n};\n\n/**\n * @private\n */\nexport const ChatMessageComponentAsRichTextEditBox = (\n  props: ChatMessageComponentAsRichTextEditBoxProps\n): JSX.Element => {\n  const {\n    onCancel,\n    onSubmit,\n    strings,\n    message,\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 [textValue, setTextValue] = useState<string>(message.content || '');\n  /* @conditional-compile-remove(file-sharing-acs) */\n  const [attachmentMetadata, handleAttachmentAction] = useReducer(\n    attachmentMetadataReducer,\n    getMessageWithAttachmentMetadata(message) ?? []\n  );\n\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  const [attachmentUploadsPendingError, setAttachmentUploadsPendingError] = useState<SendBoxErrorBarError | undefined>(\n    undefined\n  );\n  const editTextFieldRef = React.useRef<RichTextEditorComponentRef>(null);\n  const theme = useTheme();\n  const messageState = useMemo(() => {\n    return getMessageState(textValue, /* @conditional-compile-remove(file-sharing-acs) */ attachmentMetadata ?? []);\n  }, [/* @conditional-compile-remove(file-sharing-acs) */ attachmentMetadata, textValue]);\n\n  const submitEnabled = messageState === 'OK';\n\n  const editContainerStyles = useChatMessageRichTextEditContainerStyles();\n  const chatMyMessageStyles = useChatMyMessageStyles();\n  const locale = useLocale().strings;\n\n  const setText = useCallback((newValue?: string): void => {\n    setTextValue(newValue ?? '');\n  }, []);\n\n  useEffect(() => {\n    editTextFieldRef.current?.focus();\n  }, []);\n\n  const textTooLongMessage = useMemo(() => {\n    return messageState === 'too long'\n      ? _formatString(strings.editBoxTextLimit, { limitNumber: `${MAXIMUM_LENGTH_OF_MESSAGE}` })\n      : undefined;\n  }, [messageState, strings.editBoxTextLimit]);\n\n  const iconClassName = useCallback(\n    (isHover: boolean) => {\n      const color = isHover ? theme.palette.accent : theme.palette.neutralSecondary;\n      return mergeStyles(richTextEditBoxActionButtonIcon, { color });\n    },\n    [theme.palette.accent, theme.palette.neutralSecondary]\n  );\n\n  const onRenderThemedCancelIcon = useCallback(\n    (isHover: boolean) => {\n      return onRenderCancelIcon(iconClassName(isHover));\n    },\n    [iconClassName]\n  );\n\n  const onRenderThemedSubmitIcon = useCallback(\n    (isHover: boolean) => {\n      return onRenderSubmitIcon(iconClassName(isHover));\n    },\n    [iconClassName]\n  );\n\n  /* @conditional-compile-remove(file-sharing-acs) */\n  const hasMultipleAttachments = useMemo(() => {\n    return doesMessageContainMultipleAttachments(message);\n  }, [message]);\n\n  const onSubmitHandler = useCallback((): void => {\n    if (!submitEnabled) {\n      return;\n    }\n    // Don't send message until all attachments have been uploaded successfully\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */\n    setAttachmentUploadsPendingError(undefined);\n\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */\n    if (hasIncompleteAttachmentUploads(imageUploadsInProgress)) {\n      setAttachmentUploadsPendingError({ message: strings.attachmentUploadsPendingError, timestamp: Date.now() });\n      return;\n    }\n\n    let content = textValue;\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */\n    if (isAttachmentUploadCompleted(imageUploadsInProgress)) {\n      content = insertImagesToContentString(textValue, imageUploadsInProgress);\n    }\n    // it's very important to pass an empty attachment here\n    // so when user removes all attachments, UI can reflect it instantly\n    // if you set it to undefined, the attachments pre-edited would still be there\n    // until edit message event is received\n    onSubmit(content, /* @conditional-compile-remove(file-sharing-acs) */ attachmentMetadata || []);\n  }, [\n    submitEnabled,\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */\n    imageUploadsInProgress,\n    textValue,\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */\n    strings.attachmentUploadsPendingError,\n    onSubmit,\n    /* @conditional-compile-remove(file-sharing-acs) */\n    attachmentMetadata\n  ]);\n\n  const actionButtons = useMemo(() => {\n    return (\n      <Stack horizontal>\n        <InputBoxButton\n          className={richTextActionButtonsStyle}\n          ariaLabel={strings.editBoxCancelButton}\n          tooltipContent={strings.editBoxCancelButton}\n          onRenderIcon={onRenderThemedCancelIcon}\n          onClick={() => {\n            onCancel && onCancel(message.messageId);\n          }}\n          id={'dismissIconWrapper'}\n          data-testId={strings.editBoxCancelButton}\n        />\n        <InputBoxButton\n          className={richTextActionButtonsStyle}\n          ariaLabel={strings.editBoxSubmitButton}\n          tooltipContent={strings.editBoxSubmitButton}\n          onRenderIcon={onRenderThemedSubmitIcon}\n          onClick={(e) => {\n            onSubmitHandler();\n            e.stopPropagation();\n          }}\n          id={'submitIconWrapper'}\n          data-testId={strings.editBoxSubmitButton}\n        />\n      </Stack>\n    );\n  }, [\n    message.messageId,\n    onCancel,\n    onRenderThemedCancelIcon,\n    onRenderThemedSubmitIcon,\n    strings.editBoxCancelButton,\n    strings.editBoxSubmitButton,\n    onSubmitHandler\n  ]);\n  const richTextLocaleStrings = useMemo(() => {\n    /* @conditional-compile-remove(rich-text-editor) */\n    return { ...locale.richTextSendBox, ...strings };\n    return locale.sendBox;\n  }, [\n    /* @conditional-compile-remove(rich-text-editor) */ locale.richTextSendBox,\n    /* @conditional-compile-remove(rich-text-editor) */ strings,\n    locale.sendBox\n  ]);\n\n  /* @conditional-compile-remove(file-sharing-acs) */\n  const onCancelAttachmentUpload = useCallback((attachmentId: string) => {\n    // edit box only capable of removing attachments\n    // we need to expand attachment actions\n    // if we want to support more actions e.g. add\n    handleAttachmentAction({ type: 'remove', id: attachmentId });\n  }, []);\n\n  /* @conditional-compile-remove(file-sharing-acs) */\n  const onRenderAttachmentUploads = useCallback(() => {\n    return (\n      <Stack className={attachmentUploadCardsStyles}>\n        <FluentV9ThemeProvider v8Theme={theme}>\n          <_AttachmentUploadCards\n            attachments={attachmentMetadata}\n            onCancelAttachmentUpload={onCancelAttachmentUpload}\n          />\n        </FluentV9ThemeProvider>\n      </Stack>\n    );\n  }, [attachmentMetadata, onCancelAttachmentUpload, theme]);\n\n  const onChangeHandler = useCallback(\n    (\n      content: string | undefined,\n      /* @conditional-compile-remove(rich-text-editor-image-upload) */ imageSrcArray?: Array<string>\n    ) => {\n      /* @conditional-compile-remove(rich-text-editor-image-upload) */\n      cancelInlineImageUpload(imageSrcArray, imageUploadsInProgress, onCancelInlineImageUpload);\n      setText(content);\n    },\n    [\n      setText,\n      /* @conditional-compile-remove(rich-text-editor-image-upload) */ imageUploadsInProgress,\n      /* @conditional-compile-remove(rich-text-editor-image-upload) */ onCancelInlineImageUpload\n    ]\n  );\n\n  const getContent = (): JSX.Element => {\n    return (\n      <Stack className={mergeStyles(editBoxWidthStyles)}>\n        <RichTextSendBoxErrors\n          textTooLongMessage={textTooLongMessage}\n          systemMessage={message.failureReason}\n          /* @conditional-compile-remove(rich-text-editor-image-upload) */ attachmentUploadsPendingError={\n            attachmentUploadsPendingError\n          }\n        />\n        <RichTextInputBoxComponent\n          placeholderText={strings.editBoxPlaceholderText}\n          onChange={onChangeHandler}\n          editorComponentRef={editTextFieldRef}\n          initialContent={message.content}\n          strings={richTextLocaleStrings}\n          disabled={false}\n          actionComponents={actionButtons}\n          richTextEditorStyleProps={editBoxRichTextEditorStyle}\n          isHorizontalLayoutDisabled={true}\n          /* @conditional-compile-remove(file-sharing-acs) */\n          onRenderAttachmentUploads={onRenderAttachmentUploads}\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\n  const attached = message.attached === true ? 'center' : message.attached === 'bottom' ? 'bottom' : 'top';\n  return (\n    <ChatMyMessage\n      attached={attached}\n      root={{\n        className: mergeClasses(\n          chatMyMessageStyles.root,\n          /* @conditional-compile-remove(file-sharing-acs) */\n          hasMultipleAttachments ? chatMyMessageStyles.multipleAttachmentsInEditing : undefined\n        )\n      }}\n      body={{\n        className: mergeClasses(\n          editContainerStyles.body,\n          attached !== 'top' ? editContainerStyles.bodyAttached : undefined\n        )\n      }}\n    >\n      {getContent()}\n    </ChatMyMessage>\n  );\n};\n\nexport default ChatMessageComponentAsRichTextEditBox;\n"]}
         
     | 
| 
         @@ -1,11 +1,11 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            /// <reference types="react" />
         
     | 
| 
       2 
2 
     | 
    
         
             
            import { MessageThreadStrings, UpdateMessageCallback } from '../../MessageThread';
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { RichTextEditorOptions } from '../../MessageThread';
         
     | 
| 
       3 
4 
     | 
    
         
             
            import { ChatMessage, ComponentSlotStyle, OnRenderAvatarCallback } from '../../../types';
         
     | 
| 
       4 
5 
     | 
    
         
             
            import { BlockedMessage } from '../../../types';
         
     | 
| 
       5 
6 
     | 
    
         
             
            import { AttachmentMenuAction } from '../../../types/Attachment';
         
     | 
| 
       6 
7 
     | 
    
         
             
            import { AttachmentMetadata } from "../../../../../acs-ui-common/src";
         
     | 
| 
       7 
8 
     | 
    
         
             
            import { MessageOptions } from "../../../../../acs-ui-common/src";
         
     | 
| 
       8 
     | 
    
         
            -
            import { AttachmentMetadataInProgress } from "../../../../../acs-ui-common/src";
         
     | 
| 
       9 
9 
     | 
    
         
             
            import { MentionOptions } from '../../MentionPopover';
         
     | 
| 
       10 
10 
     | 
    
         
             
            import { InlineImageOptions } from '../ChatMessageContent';
         
     | 
| 
       11 
11 
     | 
    
         
             
            type ChatMyMessageComponentProps = {
         
     | 
| 
         @@ -76,13 +76,11 @@ type ChatMyMessageComponentProps = { 
     | 
|
| 
       76 
76 
     | 
    
         
             
                 * @beta
         
     | 
| 
       77 
77 
     | 
    
         
             
                 */
         
     | 
| 
       78 
78 
     | 
    
         
             
                actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];
         
     | 
| 
       79 
     | 
    
         
            -
                 
     | 
| 
       80 
     | 
    
         
            -
             
     | 
| 
       81 
     | 
    
         
            -
             
     | 
| 
       82 
     | 
    
         
            -
             
     | 
| 
       83 
     | 
    
         
            -
                 
     | 
| 
       84 
     | 
    
         
            -
                onUploadInlineImage?: (imageUrl: string, imageFileName: string, messageId: string) => void;
         
     | 
| 
       85 
     | 
    
         
            -
                imageUploadsInProgress?: AttachmentMetadataInProgress[];
         
     | 
| 
      
 79 
     | 
    
         
            +
                /**
         
     | 
| 
      
 80 
     | 
    
         
            +
                 * Optional flag to enable rich text editor.
         
     | 
| 
      
 81 
     | 
    
         
            +
                 * @beta
         
     | 
| 
      
 82 
     | 
    
         
            +
                 */
         
     | 
| 
      
 83 
     | 
    
         
            +
                richTextEditorOptions?: RichTextEditorOptions;
         
     | 
| 
       86 
84 
     | 
    
         
             
            };
         
     | 
| 
       87 
85 
     | 
    
         
             
            /**
         
     | 
| 
       88 
86 
     | 
    
         
             
             * @private
         
     | 
| 
         @@ -12,8 +12,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge 
     | 
|
| 
       12 
12 
     | 
    
         
             
            import React, { useCallback, useState } from 'react';
         
     | 
| 
       13 
13 
     | 
    
         
             
            import { ChatMyMessageComponentAsMessageBubble } from './ChatMyMessageComponentAsMessageBubble';
         
     | 
| 
       14 
14 
     | 
    
         
             
            import { ChatMessageComponentAsEditBoxPicker } from './ChatMessageComponentAsEditBoxPicker';
         
     | 
| 
       15 
     | 
    
         
            -
            /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       16 
     | 
    
         
            -
            import { removeBrokenImageContent } from '../../utils/SendBoxUtils';
         
     | 
| 
       17 
15 
     | 
    
         
             
            /**
         
     | 
| 
       18 
16 
     | 
    
         
             
             * @private
         
     | 
| 
       19 
17 
     | 
    
         
             
             */
         
     | 
| 
         @@ -35,17 +33,13 @@ export const ChatMyMessageComponent = (props) => { 
     | 
|
| 
       35 
33 
     | 
    
         
             
                }, [onDeleteMessage, message.messageId, message.messageType, clientMessageId]);
         
     | 
| 
       36 
34 
     | 
    
         
             
                const onResendClick = useCallback(() => {
         
     | 
| 
       37 
35 
     | 
    
         
             
                    onDeleteMessage && clientMessageId && onDeleteMessage(clientMessageId);
         
     | 
| 
       38 
     | 
    
         
            -
                    let newContent = content !== null && content !== void 0 ? content : '';
         
     | 
| 
       39 
     | 
    
         
            -
                    /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       40 
     | 
    
         
            -
                    newContent = removeBrokenImageContent(newContent);
         
     | 
| 
       41 
36 
     | 
    
         
             
                    onSendMessage &&
         
     | 
| 
       42 
     | 
    
         
            -
                        onSendMessage( 
     | 
| 
      
 37 
     | 
    
         
            +
                        onSendMessage(content !== undefined ? content : '', 
         
     | 
| 
       43 
38 
     | 
    
         
             
                        /* @conditional-compile-remove(file-sharing-acs) */
         
     | 
| 
       44 
39 
     | 
    
         
             
                        /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       45 
40 
     | 
    
         
             
                        {
         
     | 
| 
       46 
41 
     | 
    
         
             
                            /* @conditional-compile-remove(file-sharing-acs) */ attachments: `attachments` in message ? message.attachments : undefined,
         
     | 
| 
       47 
     | 
    
         
            -
                             
     | 
| 
       48 
     | 
    
         
            -
                            type: props.isRichTextEditorEnabled ? 'html' : 'text'
         
     | 
| 
      
 42 
     | 
    
         
            +
                            type: props.richTextEditorOptions ? 'html' : 'text'
         
     | 
| 
       49 
43 
     | 
    
         
             
                        });
         
     | 
| 
       50 
44 
     | 
    
         
             
                }, [
         
     | 
| 
       51 
45 
     | 
    
         
             
                    message,
         
     | 
| 
         @@ -53,7 +47,7 @@ export const ChatMyMessageComponent = (props) => { 
     | 
|
| 
       53 
47 
     | 
    
         
             
                    clientMessageId,
         
     | 
| 
       54 
48 
     | 
    
         
             
                    onSendMessage,
         
     | 
| 
       55 
49 
     | 
    
         
             
                    content,
         
     | 
| 
       56 
     | 
    
         
            -
                    /* @conditional-compile-remove(rich-text-editor) */ props. 
     | 
| 
      
 50 
     | 
    
         
            +
                    /* @conditional-compile-remove(rich-text-editor-image-upload) */ props.richTextEditorOptions
         
     | 
| 
       57 
51 
     | 
    
         
             
                ]);
         
     | 
| 
       58 
52 
     | 
    
         
             
                const onSubmitHandler = useCallback(
         
     | 
| 
       59 
53 
     | 
    
         
             
                // due to a bug in babel, we can't use arrow function here
         
     | 
| 
         @@ -82,15 +76,7 @@ export const ChatMyMessageComponent = (props) => { 
     | 
|
| 
       82 
76 
     | 
    
         
             
                        /* @conditional-compile-remove(mention) */
         
     | 
| 
       83 
77 
     | 
    
         
             
                        mentionLookupOptions: (_a = props.mentionOptions) === null || _a === void 0 ? void 0 : _a.lookupOptions, 
         
     | 
| 
       84 
78 
     | 
    
         
             
                        /* @conditional-compile-remove(rich-text-editor) */
         
     | 
| 
       85 
     | 
    
         
            -
                         
     | 
| 
       86 
     | 
    
         
            -
                        /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       87 
     | 
    
         
            -
                        onPaste: props.onPaste, 
         
     | 
| 
       88 
     | 
    
         
            -
                        /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       89 
     | 
    
         
            -
                        onUploadInlineImage: props.onUploadInlineImage, 
         
     | 
| 
       90 
     | 
    
         
            -
                        /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       91 
     | 
    
         
            -
                        imageUploadsInProgress: props.imageUploadsInProgress, 
         
     | 
| 
       92 
     | 
    
         
            -
                        /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       93 
     | 
    
         
            -
                        onCancelInlineImageUpload: props.onCancelInlineImageUpload }));
         
     | 
| 
      
 79 
     | 
    
         
            +
                        richTextEditorOptions: props.richTextEditorOptions }));
         
     | 
| 
       94 
80 
     | 
    
         
             
                }
         
     | 
| 
       95 
81 
     | 
    
         
             
                else {
         
     | 
| 
       96 
82 
     | 
    
         
             
                    return (React.createElement(ChatMyMessageComponentAsMessageBubble, Object.assign({}, props, { onRemoveClick: onRemoveClick, onEditClick: onEditClick, onResendClick: onResendClick, onRenderAvatar: props.onRenderAvatar, 
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"file":"ChatMyMessageComponent.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAGlC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAgBrD,OAAO,EAAE,qCAAqC,EAAE,MAAM,yCAAyC,CAAC;AAChG,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,gEAAgE;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AA0FpE;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAkC,EAAe,EAAE;;IACxF,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC1D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAE1E,MAAM,eAAe,GAAG,iBAAiB,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3F,MAAM,OAAO,GAAG,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IACnE,MAAM,aAAa,GAAG,WAAW,CAAC,GAAG,EAAE;QACrC,IAAI,eAAe,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;YACzC,eAAe,CAAC,OAAO,CA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AAC,OAAO,EACtB,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;YAC5C,0CAA0C;YAC1C,qBAAqB,EAAE,MAAA,KAAK,CAAC,cAAc,0CAAE,cAAc,IAC3D,CACH,CAAC;IACJ,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { _formatString } from '@internal/acs-ui-common';\nimport React, { useCallback, useState } from 'react';\nimport { MessageThreadStrings, UpdateMessageCallback } from '../../MessageThread';\nimport { ChatMessage, ComponentSlotStyle, OnRenderAvatarCallback } from '../../../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../../types';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMenuAction } from '../../../types/Attachment';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { AttachmentMetadataInProgress } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(mention) */\nimport { MentionOptions } from '../../MentionPopover';\nimport { InlineImageOptions } from '../ChatMessageContent';\nimport { ChatMyMessageComponentAsMessageBubble } from './ChatMyMessageComponentAsMessageBubble';\nimport { ChatMessageComponentAsEditBoxPicker } from './ChatMessageComponentAsEditBoxPicker';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { removeBrokenImageContent } from '../../utils/SendBoxUtils';\n\ntype ChatMyMessageComponentProps = {\n  message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;\n  userId: string;\n  messageContainerStyle?: ComponentSlotStyle;\n  showDate?: boolean;\n  disableEditing?: boolean;\n  onUpdateMessage?: UpdateMessageCallback;\n  onCancelEditMessage?: (messageId: string) => void;\n  /**\n   * Callback to delete a message. Also called before resending a message that failed to send.\n   * @param messageId ID of the message to delete\n   */\n  onDeleteMessage?: (messageId: string) => Promise<void>;\n  /**\n   * Callback to send a message\n   * @param content The message content to send\n   */\n  onSendMessage?: (\n    content: string,\n    /* @conditional-compile-remove(file-sharing-acs) */\n    options?: MessageOptions\n  ) => Promise<void>;\n  strings: MessageThreadStrings;\n  messageStatus?: string;\n  /**\n   * Optional text to display when the message status is 'failed'.\n   */\n  failureReason?: string;\n  /**\n   * Whether the status indicator for each message is displayed or not.\n   */\n  showMessageStatus?: boolean;\n  /**\n   * Whether to overlap avatar and message when the view is width constrained.\n   */\n  shouldOverlapAvatarAndMessage: boolean;\n  remoteParticipantsCount?: number;\n  onActionButtonClick: (\n    message: ChatMessage,\n    setMessageReadBy: (readBy: { id: string; displayName: string }[]) => void\n  ) => void;\n  /**\n   * Optional callback to override render of the avatar.\n   *\n   * @param userId - user Id\n   */\n  onRenderAvatar?: OnRenderAvatarCallback;\n  /* @conditional-compile-remove(date-time-customization) */\n  /**\n   * Optional function to provide customized date format.\n   * @beta\n   */\n  onDisplayDateTimeString?: (messageDate: Date) => string;\n  /* @conditional-compile-remove(mention) */\n  /**\n   * Optional props needed to lookup suggestions and display mentions in the mention scenario.\n   * @beta\n   */\n  mentionOptions?: MentionOptions;\n  /**\n   * Optional callback called when an inline image is clicked.\n   * @beta\n   */\n  inlineImageOptions?: InlineImageOptions;\n  /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n  /**\n   * Optional callback to render message attachments in the message component.\n   * @beta\n   */\n  onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;\n  /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n  /**\n   * Optional callback to define custom actions for attachments.\n   * @beta\n   */\n  actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];\n  /* @conditional-compile-remove(rich-text-editor) */\n  isRichTextEditorEnabled?: boolean;\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  onPaste?: (event: { content: DocumentFragment }) => void;\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  onCancelInlineImageUpload?: (imageId: string, messageId: string) => void;\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  onUploadInlineImage?: (imageUrl: string, imageFileName: string, messageId: string) => void;\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  imageUploadsInProgress?: AttachmentMetadataInProgress[];\n};\n\n/**\n * @private\n */\nexport const ChatMyMessageComponent = (props: ChatMyMessageComponentProps): JSX.Element => {\n  const { onDeleteMessage, onSendMessage, message } = props;\n  const [isEditing, setIsEditing] = useState(false);\n\n  const onEditClick = useCallback(() => setIsEditing(true), [setIsEditing]);\n\n  const clientMessageId = 'clientMessageId' in message ? message.clientMessageId : undefined;\n  const content = 'content' in message ? message.content : undefined;\n  const onRemoveClick = useCallback(() => {\n    if (onDeleteMessage && message.messageId) {\n      onDeleteMessage(message.messageId);\n    }\n    // when fail to send, message does not have message id, delete message using clientMessageId\n    else if (onDeleteMessage && message.messageType === 'chat' && clientMessageId) {\n      onDeleteMessage(clientMessageId);\n    }\n  }, [onDeleteMessage, message.messageId, message.messageType, clientMessageId]);\n\n  const onResendClick = useCallback(() => {\n    onDeleteMessage && clientMessageId && onDeleteMessage(clientMessageId);\n    let newContent = content ?? '';\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */\n    newContent = removeBrokenImageContent(newContent);\n    onSendMessage &&\n      onSendMessage(\n        newContent,\n        /* @conditional-compile-remove(file-sharing-acs) */\n        /* @conditional-compile-remove(rich-text-editor-image-upload) */\n        {\n          /* @conditional-compile-remove(file-sharing-acs) */ attachments:\n            `attachments` in message ? message.attachments : undefined,\n          /* @conditional-compile-remove(rich-text-editor) */\n          type: props.isRichTextEditorEnabled ? 'html' : 'text'\n        }\n      );\n  }, [\n    message,\n    onDeleteMessage,\n    clientMessageId,\n    onSendMessage,\n    content,\n    /* @conditional-compile-remove(rich-text-editor) */ props.isRichTextEditorEnabled\n  ]);\n\n  const onSubmitHandler = useCallback(\n    // due to a bug in babel, we can't use arrow function here\n    // affecting conditional-compile-remove(attachment-upload)\n    async function (\n      text: string,\n      /* @conditional-compile-remove(file-sharing-acs) */\n      attachments?: AttachmentMetadata[] | undefined\n    ) {\n      /* @conditional-compile-remove(file-sharing-acs) */\n      if (`attachments` in message && attachments) {\n        message.attachments = attachments;\n      }\n      props.onUpdateMessage &&\n        message.messageId &&\n        (await props.onUpdateMessage(\n          message.messageId,\n          text,\n          /* @conditional-compile-remove(file-sharing-acs) */\n          { attachments: attachments }\n        ));\n      setIsEditing(false);\n    },\n    [message, props]\n  );\n  if (isEditing && message.messageType === 'chat') {\n    return (\n      <ChatMessageComponentAsEditBoxPicker\n        message={message}\n        strings={props.strings}\n        onSubmit={onSubmitHandler}\n        onCancel={(messageId) => {\n          props.onCancelEditMessage && props.onCancelEditMessage(messageId);\n          setIsEditing(false);\n        }}\n        /* @conditional-compile-remove(mention) */\n        mentionLookupOptions={props.mentionOptions?.lookupOptions}\n        /* @conditional-compile-remove(rich-text-editor) */\n        isRichTextEditorEnabled={props.isRichTextEditorEnabled}\n        /* @conditional-compile-remove(rich-text-editor-image-upload) */\n        onPaste={props.onPaste}\n        /* @conditional-compile-remove(rich-text-editor-image-upload) */\n        onUploadInlineImage={props.onUploadInlineImage}\n        /* @conditional-compile-remove(rich-text-editor-image-upload) */\n        imageUploadsInProgress={props.imageUploadsInProgress}\n        /* @conditional-compile-remove(rich-text-editor-image-upload) */\n        onCancelInlineImageUpload={props.onCancelInlineImageUpload}\n      />\n    );\n  } else {\n    return (\n      <ChatMyMessageComponentAsMessageBubble\n        {...props}\n        onRemoveClick={onRemoveClick}\n        onEditClick={onEditClick}\n        onResendClick={onResendClick}\n        onRenderAvatar={props.onRenderAvatar}\n        /* @conditional-compile-remove(date-time-customization) */\n        onDisplayDateTimeString={props.onDisplayDateTimeString}\n        strings={props.strings}\n        inlineImageOptions={props.inlineImageOptions}\n        /* @conditional-compile-remove(mention) */\n        mentionDisplayOptions={props.mentionOptions?.displayOptions}\n      />\n    );\n  }\n};\n"]}
         
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"ChatMyMessageComponent.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAGlC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAgBrD,OAAO,EAAE,qCAAqC,EAAE,MAAM,yCAAyC,CAAC;AAChG,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAsF5F;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAkC,EAAe,EAAE;;IACxF,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC1D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAE1E,MAAM,eAAe,GAAG,iBAAiB,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3F,MAAM,OAAO,GAAG,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IACnE,MAAM,aAAa,GAAG,WAAW,CAAC,GAAG,EAAE;QACrC,IAAI,eAAe,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;YACzC,eAAe,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACrC,CAAC;QACD,4FAA4F;aACvF,IAAI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CAAC;YACL,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;KAAA,EACD,CAAC,OAAO,EAAE,KAAK,CAAC,CACjB,CAAC;IACF,IAAI,SAAS,IAAI,OAAO,CAAC,WAAW,KAAK,MAAM,EAAE,CAAC;QAChD,OAAO,CACL,oBAAC,mCAAmC,IAClC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE;gBACtB,KAAK,CAAC,mBAAmB,IAAI,KAAK,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;gBAClE,YAAY,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC;YACD,0CAA0C;YAC1C,oBAAoB,EAAE,MAAA,KAAK,CAAC,cAAc,0CAAE,aAAa;YACzD,mDAAmD;YACnD,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,GAClD,CACH,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CACL,oBAAC,qCAAqC,oBAChC,KAAK,IACT,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,0DAA0D;YAC1D,uBAAuB,EAAE,KAAK,CAAC,uBAAuB,EACtD,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;YAC5C,0CAA0C;YAC1C,qBAAqB,EAAE,MAAA,KAAK,CAAC,cAAc,0CAAE,cAAc,IAC3D,CACH,CAAC;IACJ,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { _formatString } from '@internal/acs-ui-common';\nimport React, { useCallback, useState } from 'react';\nimport { MessageThreadStrings, UpdateMessageCallback } from '../../MessageThread';\n/* @conditional-compile-remove(rich-text-editor) */\nimport { RichTextEditorOptions } from '../../MessageThread';\nimport { ChatMessage, ComponentSlotStyle, OnRenderAvatarCallback } from '../../../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../../types';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMenuAction } from '../../../types/Attachment';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(mention) */\nimport { MentionOptions } from '../../MentionPopover';\nimport { InlineImageOptions } from '../ChatMessageContent';\nimport { ChatMyMessageComponentAsMessageBubble } from './ChatMyMessageComponentAsMessageBubble';\nimport { ChatMessageComponentAsEditBoxPicker } from './ChatMessageComponentAsEditBoxPicker';\n\ntype ChatMyMessageComponentProps = {\n  message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;\n  userId: string;\n  messageContainerStyle?: ComponentSlotStyle;\n  showDate?: boolean;\n  disableEditing?: boolean;\n  onUpdateMessage?: UpdateMessageCallback;\n  onCancelEditMessage?: (messageId: string) => void;\n  /**\n   * Callback to delete a message. Also called before resending a message that failed to send.\n   * @param messageId ID of the message to delete\n   */\n  onDeleteMessage?: (messageId: string) => Promise<void>;\n  /**\n   * Callback to send a message\n   * @param content The message content to send\n   */\n  onSendMessage?: (\n    content: string,\n    /* @conditional-compile-remove(file-sharing-acs) */\n    options?: MessageOptions\n  ) => Promise<void>;\n  strings: MessageThreadStrings;\n  messageStatus?: string;\n  /**\n   * Optional text to display when the message status is 'failed'.\n   */\n  failureReason?: string;\n  /**\n   * Whether the status indicator for each message is displayed or not.\n   */\n  showMessageStatus?: boolean;\n  /**\n   * Whether to overlap avatar and message when the view is width constrained.\n   */\n  shouldOverlapAvatarAndMessage: boolean;\n  remoteParticipantsCount?: number;\n  onActionButtonClick: (\n    message: ChatMessage,\n    setMessageReadBy: (readBy: { id: string; displayName: string }[]) => void\n  ) => void;\n  /**\n   * Optional callback to override render of the avatar.\n   *\n   * @param userId - user Id\n   */\n  onRenderAvatar?: OnRenderAvatarCallback;\n  /* @conditional-compile-remove(date-time-customization) */\n  /**\n   * Optional function to provide customized date format.\n   * @beta\n   */\n  onDisplayDateTimeString?: (messageDate: Date) => string;\n  /* @conditional-compile-remove(mention) */\n  /**\n   * Optional props needed to lookup suggestions and display mentions in the mention scenario.\n   * @beta\n   */\n  mentionOptions?: MentionOptions;\n  /**\n   * Optional callback called when an inline image is clicked.\n   * @beta\n   */\n  inlineImageOptions?: InlineImageOptions;\n  /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n  /**\n   * Optional callback to render message attachments in the message component.\n   * @beta\n   */\n  onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;\n  /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n  /**\n   * Optional callback to define custom actions for attachments.\n   * @beta\n   */\n  actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];\n  /* @conditional-compile-remove(rich-text-editor) */\n  /**\n   * Optional flag to enable rich text editor.\n   * @beta\n   */\n  richTextEditorOptions?: RichTextEditorOptions;\n};\n\n/**\n * @private\n */\nexport const ChatMyMessageComponent = (props: ChatMyMessageComponentProps): JSX.Element => {\n  const { onDeleteMessage, onSendMessage, message } = props;\n  const [isEditing, setIsEditing] = useState(false);\n\n  const onEditClick = useCallback(() => setIsEditing(true), [setIsEditing]);\n\n  const clientMessageId = 'clientMessageId' in message ? message.clientMessageId : undefined;\n  const content = 'content' in message ? message.content : undefined;\n  const onRemoveClick = useCallback(() => {\n    if (onDeleteMessage && message.messageId) {\n      onDeleteMessage(message.messageId);\n    }\n    // when fail to send, message does not have message id, delete message using clientMessageId\n    else if (onDeleteMessage && message.messageType === 'chat' && clientMessageId) {\n      onDeleteMessage(clientMessageId);\n    }\n  }, [onDeleteMessage, message.messageId, message.messageType, clientMessageId]);\n\n  const onResendClick = useCallback(() => {\n    onDeleteMessage && clientMessageId && onDeleteMessage(clientMessageId);\n    onSendMessage &&\n      onSendMessage(\n        content !== undefined ? content : '',\n        /* @conditional-compile-remove(file-sharing-acs) */\n        /* @conditional-compile-remove(rich-text-editor-image-upload) */\n        {\n          /* @conditional-compile-remove(file-sharing-acs) */ attachments:\n            `attachments` in message ? message.attachments : undefined,\n          type: props.richTextEditorOptions ? 'html' : 'text'\n        }\n      );\n  }, [\n    message,\n    onDeleteMessage,\n    clientMessageId,\n    onSendMessage,\n    content,\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */ props.richTextEditorOptions\n  ]);\n\n  const onSubmitHandler = useCallback(\n    // due to a bug in babel, we can't use arrow function here\n    // affecting conditional-compile-remove(attachment-upload)\n    async function (\n      text: string,\n      /* @conditional-compile-remove(file-sharing-acs) */\n      attachments?: AttachmentMetadata[] | undefined\n    ) {\n      /* @conditional-compile-remove(file-sharing-acs) */\n      if (`attachments` in message && attachments) {\n        message.attachments = attachments;\n      }\n      props.onUpdateMessage &&\n        message.messageId &&\n        (await props.onUpdateMessage(\n          message.messageId,\n          text,\n          /* @conditional-compile-remove(file-sharing-acs) */\n          { attachments: attachments }\n        ));\n      setIsEditing(false);\n    },\n    [message, props]\n  );\n  if (isEditing && message.messageType === 'chat') {\n    return (\n      <ChatMessageComponentAsEditBoxPicker\n        message={message}\n        strings={props.strings}\n        onSubmit={onSubmitHandler}\n        onCancel={(messageId) => {\n          props.onCancelEditMessage && props.onCancelEditMessage(messageId);\n          setIsEditing(false);\n        }}\n        /* @conditional-compile-remove(mention) */\n        mentionLookupOptions={props.mentionOptions?.lookupOptions}\n        /* @conditional-compile-remove(rich-text-editor) */\n        richTextEditorOptions={props.richTextEditorOptions}\n      />\n    );\n  } else {\n    return (\n      <ChatMyMessageComponentAsMessageBubble\n        {...props}\n        onRemoveClick={onRemoveClick}\n        onEditClick={onEditClick}\n        onResendClick={onResendClick}\n        onRenderAvatar={props.onRenderAvatar}\n        /* @conditional-compile-remove(date-time-customization) */\n        onDisplayDateTimeString={props.onDisplayDateTimeString}\n        strings={props.strings}\n        inlineImageOptions={props.inlineImageOptions}\n        /* @conditional-compile-remove(mention) */\n        mentionDisplayOptions={props.mentionOptions?.displayOptions}\n      />\n    );\n  }\n};\n"]}
         
     | 
| 
         @@ -27,15 +27,7 @@ export const FluentChatMyMessageComponent = (props) => { 
     | 
|
| 
       27 
27 
     | 
    
         
             
                /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
         
     | 
| 
       28 
28 
     | 
    
         
             
                onRenderAttachmentDownloads, 
         
     | 
| 
       29 
29 
     | 
    
         
             
                /* @conditional-compile-remove(rich-text-editor) */
         
     | 
| 
       30 
     | 
    
         
            -
                 
     | 
| 
       31 
     | 
    
         
            -
                /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       32 
     | 
    
         
            -
                onPaste, 
         
     | 
| 
       33 
     | 
    
         
            -
                /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       34 
     | 
    
         
            -
                imageUploadsInProgress, 
         
     | 
| 
       35 
     | 
    
         
            -
                /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       36 
     | 
    
         
            -
                onCancelInlineImageUpload, 
         
     | 
| 
       37 
     | 
    
         
            -
                /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       38 
     | 
    
         
            -
                onUploadInlineImage } = props;
         
     | 
| 
      
 30 
     | 
    
         
            +
                richTextEditorOptions } = props;
         
     | 
| 
       39 
31 
     | 
    
         
             
                const chatMessageRenderStyles = useChatMessageRenderStyles();
         
     | 
| 
       40 
32 
     | 
    
         
             
                /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
         
     | 
| 
       41 
33 
     | 
    
         
             
                const onRenderAttachmentDownloadsMemo = useMemo(() => {
         
     | 
| 
         @@ -62,15 +54,7 @@ export const FluentChatMyMessageComponent = (props) => { 
     | 
|
| 
       62 
54 
     | 
    
         
             
                            /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
         
     | 
| 
       63 
55 
     | 
    
         
             
                            actionsForAttachment: actionsForAttachment, 
         
     | 
| 
       64 
56 
     | 
    
         
             
                            /* @conditional-compile-remove(rich-text-editor) */
         
     | 
| 
       65 
     | 
    
         
            -
                             
     | 
| 
       66 
     | 
    
         
            -
                            /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       67 
     | 
    
         
            -
                            onPaste: onPaste, 
         
     | 
| 
       68 
     | 
    
         
            -
                            /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       69 
     | 
    
         
            -
                            onCancelInlineImageUpload: onCancelInlineImageUpload, 
         
     | 
| 
       70 
     | 
    
         
            -
                            /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       71 
     | 
    
         
            -
                            onUploadInlineImage: onUploadInlineImage, 
         
     | 
| 
       72 
     | 
    
         
            -
                            /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       73 
     | 
    
         
            -
                            imageUploadsInProgress: imageUploadsInProgress })));
         
     | 
| 
      
 57 
     | 
    
         
            +
                            richTextEditorOptions: richTextEditorOptions })));
         
     | 
| 
       74 
58 
     | 
    
         
             
                    }
         
     | 
| 
       75 
59 
     | 
    
         
             
                    return React.createElement(React.Fragment, null);
         
     | 
| 
       76 
60 
     | 
    
         
             
                }, [
         
     | 
| 
         @@ -92,15 +76,7 @@ export const FluentChatMyMessageComponent = (props) => { 
     | 
|
| 
       92 
76 
     | 
    
         
             
                    // eslint-disable-next-line react-hooks/exhaustive-deps
         
     | 
| 
       93 
77 
     | 
    
         
             
                    new Date().toDateString(),
         
     | 
| 
       94 
78 
     | 
    
         
             
                    /* @conditional-compile-remove(rich-text-editor) */
         
     | 
| 
       95 
     | 
    
         
            -
                     
     | 
| 
       96 
     | 
    
         
            -
                    /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       97 
     | 
    
         
            -
                    onPaste,
         
     | 
| 
       98 
     | 
    
         
            -
                    /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       99 
     | 
    
         
            -
                    onCancelInlineImageUpload,
         
     | 
| 
       100 
     | 
    
         
            -
                    /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       101 
     | 
    
         
            -
                    onUploadInlineImage,
         
     | 
| 
       102 
     | 
    
         
            -
                    /* @conditional-compile-remove(rich-text-editor-image-upload) */
         
     | 
| 
       103 
     | 
    
         
            -
                    imageUploadsInProgress
         
     | 
| 
      
 79 
     | 
    
         
            +
                    richTextEditorOptions
         
     | 
| 
       104 
80 
     | 
    
         
             
                ]);
         
     | 
| 
       105 
81 
     | 
    
         
             
                const messageRenderer = useCallback((messageProps) => {
         
     | 
| 
       106 
82 
     | 
    
         
             
                    return onRenderMessage === undefined
         
     |