@azure/communication-react 1.18.0-alpha-202407060013 → 1.18.0-alpha-202407090014
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/communication-react.d.ts +17 -4
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-DMEk2o-G.js → ChatMessageComponentAsRichTextEditBox-RrIa2t97.js} +62 -17
- package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-RrIa2t97.js.map +1 -0
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-ByJFtf0Z.js → RichTextSendBoxWrapper-Bz_1ebsD.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-ByJFtf0Z.js.map → RichTextSendBoxWrapper-Bz_1ebsD.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-BPO9X27C.js → index-DGXoGo4W.js} +242 -94
- package/dist/dist-cjs/communication-react/index-DGXoGo4W.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/chat-component-bindings/src/handlers/createHandlers.js +42 -4
- package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +34 -8
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js +3 -0
- package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js +7 -1
- 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 +4 -0
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +62 -15
- 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.js +1 -3
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +18 -0
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +0 -4
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +7 -35
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/Common.style.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/styles/Common.style.js +4 -0
- 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 +18 -0
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +17 -1
- package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +70 -4
- package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +28 -16
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js +3 -1
- package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js.map +1 -1
- package/package.json +1 -1
- package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-DMEk2o-G.js.map +0 -1
- package/dist/dist-cjs/communication-react/index-BPO9X27C.js.map +0 -1
@@ -26,6 +26,8 @@ export const loadRichTextSendBox = () => import('./RichTextSendBoxWrapper').then
|
|
26
26
|
export const SendBoxPicker = (props) => {
|
27
27
|
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
28
28
|
const { richTextEditorOptions } = props;
|
29
|
+
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
30
|
+
const { onPaste, onUploadInlineImage, imageUploadsInProgress, onCancelInlineImageUpload } = richTextEditorOptions || {};
|
29
31
|
const sendBoxProps = usePropsFor(SendBox);
|
30
32
|
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
31
33
|
const isRichTextEditorEnabled = useMemo(() => {
|
@@ -36,7 +38,7 @@ export const SendBoxPicker = (props) => {
|
|
36
38
|
if (isRichTextEditorEnabled) {
|
37
39
|
return (React.createElement(_ErrorBoundary, { fallback: sendBox },
|
38
40
|
React.createElement(Suspense, { fallback: sendBox },
|
39
|
-
React.createElement(RichTextSendBoxWrapper, Object.assign({}, props)))));
|
41
|
+
React.createElement(RichTextSendBoxWrapper, Object.assign({}, props, { onPaste: onPaste, onUploadInlineImage: onUploadInlineImage, imageUploadsInProgress: imageUploadsInProgress, onCancelInlineImageUpload: onCancelInlineImageUpload })))));
|
40
42
|
}
|
41
43
|
return sendBox;
|
42
44
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SendBoxPicker.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/common/SendBoxPicker.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,OAAO,EAAsB,yCAAmC;AAGzE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,qEAAqE;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,qEAAqE;AACrE,OAAO,EAAE,cAAc,EAAwB,yCAAmC;AAIlF,qEAAqE;AACrE;;GAEG;AACH,MAAM,sBAAsB,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAC7C,MAAM,CAAC,0BAA0B,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,sBAAsB,EAAE,CAAC,CAAC,CAClG,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAEhC,EAAE,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,sBAAsB,EAAE,CAAC,CAAC,CAAC;AA0BxG;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAyB,EAAe,EAAE;IACtE,qEAAqE;IACrE,MAAM,EAAE,qBAAqB,EAAE,GAAG,KAAK,CAAC;
|
1
|
+
{"version":3,"file":"SendBoxPicker.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/common/SendBoxPicker.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,OAAO,EAAsB,yCAAmC;AAGzE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,qEAAqE;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,qEAAqE;AACrE,OAAO,EAAE,cAAc,EAAwB,yCAAmC;AAIlF,qEAAqE;AACrE;;GAEG;AACH,MAAM,sBAAsB,GAAG,KAA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,OAAO,EAChB,mBAAmB,EAAE,mBAAmB,EACxC,sBAAsB,EAAE,sBAAsB,EAC9C,yBAAyB,EAAE,yBAAyB,IACpD,CACO,CACI,CAClB,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useMemo } from 'react';\nimport { SendBox, SendBoxStylesProps } from '@internal/react-components';\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport { RichTextEditorOptions } from '@internal/react-components';\nimport { usePropsFor } from '../ChatComposite/hooks/usePropsFor';\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport { Suspense } from 'react';\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport { _ErrorBoundary, RichTextSendBoxProps } from '@internal/react-components';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadataInProgress, MessageOptions } from '@internal/acs-ui-common';\n\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\n/**\n * Wrapper for RichTextSendBox component to allow us to use usePropsFor with richTextSendBox with lazy loading\n */\nconst RichTextSendBoxWrapper = React.lazy(() =>\n import('./RichTextSendBoxWrapper').then((module) => ({ default: module.RichTextSendBoxWrapper }))\n);\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-composite-support)\n */\nexport const loadRichTextSendBox = (): Promise<{\n default: React.ComponentType<RichTextSendBoxProps>;\n}> => import('./RichTextSendBoxWrapper').then((module) => ({ default: module.RichTextSendBoxWrapper }));\n\n/**\n * @private\n */\nexport type SendBoxPickerProps = {\n styles?: SendBoxStylesProps;\n autoFocus?: 'sendBoxTextField';\n onSendMessage: (\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */ options?: MessageOptions\n ) => Promise<void>;\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditorOptions?: RichTextEditorOptions;\n /* @conditional-compile-remove(file-sharing-acs) */\n attachments?: AttachmentMetadataInProgress[];\n /* @conditional-compile-remove(file-sharing-acs) */\n onCancelAttachmentUpload?: (attachmentId: 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 /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onCancelInlineImageUpload?: (imageId: string) => void;\n};\n\n/**\n * @private\n */\nexport const SendBoxPicker = (props: SendBoxPickerProps): JSX.Element => {\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n const { richTextEditorOptions } = props;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n const { onPaste, onUploadInlineImage, imageUploadsInProgress, onCancelInlineImageUpload } =\n richTextEditorOptions || {};\n\n const sendBoxProps = usePropsFor(SendBox);\n\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n const isRichTextEditorEnabled = useMemo(() => {\n return richTextEditorOptions !== undefined;\n }, [richTextEditorOptions]);\n\n const sendBox = useMemo(() => <SendBox {...sendBoxProps} {...props} />, [props, sendBoxProps]);\n\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n if (isRichTextEditorEnabled) {\n return (\n <_ErrorBoundary fallback={sendBox}>\n <Suspense fallback={sendBox}>\n <RichTextSendBoxWrapper\n {...props}\n onPaste={onPaste}\n onUploadInlineImage={onUploadInlineImage}\n imageUploadsInProgress={imageUploadsInProgress}\n onCancelInlineImageUpload={onCancelInlineImageUpload}\n />\n </Suspense>\n </_ErrorBoundary>\n );\n }\n return sendBox;\n};\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@azure/communication-react",
|
3
|
-
"version": "1.18.0-alpha-
|
3
|
+
"version": "1.18.0-alpha-202407090014",
|
4
4
|
"sideEffects": false,
|
5
5
|
"description": "React library for building modern communication user experiences utilizing Azure Communication Services",
|
6
6
|
"keywords": [
|
package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-DMEk2o-G.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ChatMessageComponentAsRichTextEditBox-DMEk2o-G.js","sources":["../../../../react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.tsx"],"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';\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';\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\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};\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 } = 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 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 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 // 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 submitEnabled &&\n onSubmit(textValue, /* @conditional-compile-remove(file-sharing-acs) */ attachmentMetadata);\n e.stopPropagation();\n }}\n id={'submitIconWrapper'}\n data-testId={strings.editBoxSubmitButton}\n />\n </Stack>\n );\n }, [\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentMetadata,\n message.messageId,\n onCancel,\n onRenderThemedCancelIcon,\n onRenderThemedSubmitIcon,\n onSubmit,\n strings.editBoxCancelButton,\n strings.editBoxSubmitButton,\n submitEnabled,\n textValue\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 getContent = (): JSX.Element => {\n return (\n <Stack className={mergeStyles(editBoxWidthStyles)}>\n <RichTextSendBoxErrors textTooLongMessage={textTooLongMessage} systemMessage={message.failureReason} />\n <RichTextInputBoxComponent\n placeholderText={strings.editBoxPlaceholderText}\n onChange={setText}\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 />\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.multipleAttachments : 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"],"names":["useState","useReducer","attachmentMetadataReducer","getMessageWithAttachmentMetadata","useTheme","useMemo","getMessageState","useChatMessageRichTextEditContainerStyles","useChatMyMessageStyles","useLocale","useCallback","useEffect","_formatString","MAXIMUM_LENGTH_OF_MESSAGE","mergeStyles","richTextEditBoxActionButtonIcon","onRenderCancelIcon","onRenderSubmitIcon","doesMessageContainMultipleAttachments","Stack","InputBoxButton","richTextActionButtonsStyle","attachmentUploadCardsStyles","FluentV9ThemeProvider","_AttachmentUploadCards","editBoxWidthStyles","RichTextSendBoxErrors","RichTextInputBoxComponent","editBoxRichTextEditorStyle","ChatMyMessage","mergeClasses"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAuDA;;AAEG;AACU,MAAA,qCAAqC,GAAG,CACnD,KAAiD,KAClC;;AACf,IAAA,MAAM,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,OAAO;;IAEP,OAAO,EACR,GAAG,KAAK,CAAC;AAEV,IAAA,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAGA,cAAQ,CAAS,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;;AAE1E,IAAA,MAAM,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,GAAGC,gBAAU,CAC7DC,+BAAyB,EACzB,CAAA,EAAA,GAAAC,sCAAgC,CAAC,OAAO,CAAC,MAAI,IAAA,IA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