@azure/communication-react 1.18.0-alpha-202407160014 → 1.18.0-alpha-202407162016

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-8xkyCDXN.js → ChatMessageComponentAsRichTextEditBox-Dkm1akf7.js} +2 -2
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-8xkyCDXN.js.map → ChatMessageComponentAsRichTextEditBox-Dkm1akf7.js.map} +1 -1
  3. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BM9W7R3u.js → RichTextSendBoxWrapper-BnmvwF_1.js} +2 -2
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BM9W7R3u.js.map → RichTextSendBoxWrapper-BnmvwF_1.js.map} +1 -1
  5. package/dist/dist-cjs/communication-react/{index-CNaC_GQ5.js → index-BF8P6_ls.js} +30 -83
  6. package/dist/dist-cjs/communication-react/index-BF8P6_ls.js.map +1 -0
  7. package/dist/dist-cjs/communication-react/index.js +1 -1
  8. package/dist/dist-esm/acs-ui-common/src/common.js +2 -10
  9. package/dist/dist-esm/acs-ui-common/src/common.js.map +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  11. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  12. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +0 -10
  13. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  14. package/dist/dist-esm/react-components/src/components/ResponsiveHorizontalGallery.js +1 -5
  15. package/dist/dist-esm/react-components/src/components/ResponsiveHorizontalGallery.js.map +1 -1
  16. package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.js +1 -5
  17. package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.js.map +1 -1
  18. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +1 -21
  19. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
  20. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +2 -6
  21. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  22. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.d.ts +1 -1
  23. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +15 -9
  24. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +1 -1
  25. package/dist/dist-esm/react-components/src/components/utils/responsive.js +2 -12
  26. package/dist/dist-esm/react-components/src/components/utils/responsive.js.map +1 -1
  27. package/package.json +2 -2
  28. package/dist/dist-cjs/communication-react/index-CNaC_GQ5.js.map +0 -1
@@ -4,7 +4,7 @@ var react = require('@fluentui/react');
4
4
  var reactChat = require('@fluentui-contrib/react-chat');
5
5
  var reactComponents = require('@fluentui/react-components');
6
6
  require('@azure/communication-common');
7
- var index = require('./index-CNaC_GQ5.js');
7
+ var index = require('./index-BF8P6_ls.js');
8
8
  var React = require('react');
9
9
  require('react-dom/client');
10
10
  require('@azure/communication-chat');
@@ -197,4 +197,4 @@ const ChatMessageComponentAsRichTextEditBox = (props) => {
197
197
 
198
198
  exports.ChatMessageComponentAsRichTextEditBox = ChatMessageComponentAsRichTextEditBox;
199
199
  exports.default = ChatMessageComponentAsRichTextEditBox;
200
- //# sourceMappingURL=ChatMessageComponentAsRichTextEditBox-8xkyCDXN.js.map
200
+ //# sourceMappingURL=ChatMessageComponentAsRichTextEditBox-Dkm1akf7.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatMessageComponentAsRichTextEditBox-8xkyCDXN.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';\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"],"names":["useState","useReducer","attachmentMetadataReducer","getMessageWithAttachmentMetadata","useTheme","useMemo","getMessageState","useChatMessageRichTextEditContainerStyles","useChatMyMessageStyles","useLocale","useCallback","useEffect","_formatString","MAXIMUM_LENGTH_OF_MESSAGE","mergeStyles","richTextEditBoxActionButtonIcon","onRenderCancelIcon","onRenderSubmitIcon","doesMessageContainMultipleAttachments","hasIncompleteAttachmentUploads","isAttachmentUploadCompleted","insertImagesToContentString","Stack","InputBoxButton","richTextActionButtonsStyle","attachmentUploadCardsStyles","FluentV9ThemeProvider","_AttachmentUploadCards","cancelInlineImageUpload","editBoxWidthStyles","RichTextSendBoxErrors","RichTextInputBoxComponent","editBoxRichTextEditorStyle","ChatMyMessage","mergeClasses"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAwEA;;AAEG;AACU,MAAA,qCAAqC,GAAG,CACnD,KAAiD,KAClC;;AACf,IAAA,MAAM,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,OAAO;;IAEP,OAAO;;IAEP,mBAAmB;;IAEnB,sBAAsB;;IAEtB,yBAAyB,EA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BAAA,yBAAyB,EAAE,yBAAyB;;AAEpD,gBAAA,OAAO,EAAE,OAAO;;AAEhB,gBAAA,mBAAmB,EAAE,mBAAmB,EACxC,CAAA,CACI,EACR;AACJ,KAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;IACzG,QACE,oBAACC,uBAAa,EAAA,EACZ,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE;AACJ,YAAA,SAAS,EAAEC,4BAAY,CACrB,mBAAmB,CAAC,IAAI;;YAExB,sBAAsB,GAAG,mBAAmB,CAAC,4BAA4B,GAAG,SAAS,CACtF;AACF,SAAA,EACD,IAAI,EAAE;YACJ,SAAS,EAAEA,4BAAY,CACrB,mBAAmB,CAAC,IAAI,EACxB,QAAQ,KAAK,KAAK,GAAG,mBAAmB,CAAC,YAAY,GAAG,SAAS,CAClE;AACF,SAAA,EAAA,EAEA,UAAU,EAAE,CACC,EAChB;AACJ;;;;;"}
1
+ {"version":3,"file":"ChatMessageComponentAsRichTextEditBox-Dkm1akf7.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';\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"],"names":["useState","useReducer","attachmentMetadataReducer","getMessageWithAttachmentMetadata","useTheme","useMemo","getMessageState","useChatMessageRichTextEditContainerStyles","useChatMyMessageStyles","useLocale","useCallback","useEffect","_formatString","MAXIMUM_LENGTH_OF_MESSAGE","mergeStyles","richTextEditBoxActionButtonIcon","onRenderCancelIcon","onRenderSubmitIcon","doesMessageContainMultipleAttachments","hasIncompleteAttachmentUploads","isAttachmentUploadCompleted","insertImagesToContentString","Stack","InputBoxButton","richTextActionButtonsStyle","attachmentUploadCardsStyles","FluentV9ThemeProvider","_AttachmentUploadCards","cancelInlineImageUpload","editBoxWidthStyles","RichTextSendBoxErrors","RichTextInputBoxComponent","editBoxRichTextEditorStyle","ChatMyMessage","mergeClasses"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAwEA;;AAEG;AACU,MAAA,qCAAqC,GAAG,CACnD,KAAiD,KAClC;;AACf,IAAA,MAAM,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,OAAO;;IAEP,OAAO;;IAEP,mBAAmB;;IAEnB,sBAAsB;;IAEtB,yBAAyB,EAC1B,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,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,E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Q,EAAE,QAAQ,EAClB,IAAI,EAAE;AACJ,YAAA,SAAS,EAAEC,4BAAY,CACrB,mBAAmB,CAAC,IAAI;;YAExB,sBAAsB,GAAG,mBAAmB,CAAC,4BAA4B,GAAG,SAAS,CACtF;AACF,SAAA,EACD,IAAI,EAAE;YACJ,SAAS,EAAEA,4BAAY,CACrB,mBAAmB,CAAC,IAAI,EACxB,QAAQ,KAAK,KAAK,GAAG,mBAAmB,CAAC,YAAY,GAAG,SAAS,CAClE;AACF,SAAA,EAAA,EAEA,UAAU,EAAE,CACC,EAChB;AACJ;;;;;"}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
- var index = require('./index-CNaC_GQ5.js');
4
+ var index = require('./index-BF8P6_ls.js');
5
5
  require('@fluentui/react');
6
6
  require('@fluentui/react-components');
7
7
  require('@fluentui-contrib/react-chat');
@@ -51,4 +51,4 @@ const RichTextSendBoxWrapper = (props) => {
51
51
  };
52
52
 
53
53
  exports.RichTextSendBoxWrapper = RichTextSendBoxWrapper;
54
- //# sourceMappingURL=RichTextSendBoxWrapper-BM9W7R3u.js.map
54
+ //# sourceMappingURL=RichTextSendBoxWrapper-BnmvwF_1.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextSendBoxWrapper-BM9W7R3u.js","sources":["../../../../react-composites/src/composites/common/RichTextSendBoxWrapper.tsx"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport React from 'react';\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport { usePropsFor } from '../ChatComposite/hooks/usePropsFor';\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport { RichTextSendBox, RichTextSendBoxProps } from '@internal/react-components';\n\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\n/**\n * @private\n *\n * Wrapper for RichTextSendBox component to allow us to use usePropsFor with richTextSendBox\n * before lazyLoading is done\n */\nexport const RichTextSendBoxWrapper = (props: RichTextSendBoxProps): JSX.Element => {\n const richTextSendBoxProps = usePropsFor(RichTextSendBox);\n\n return <RichTextSendBox {...richTextSendBoxProps} {...props} />;\n};\n"],"names":["usePropsFor","RichTextSendBox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAEA;AAOA;AACA;;;;;AAKG;AACU,MAAA,sBAAsB,GAAG,CAAC,KAA2B,KAAiB;AACjF,IAAA,MAAM,oBAAoB,GAAGA,iBAAW,CAACC,qBAAe,CAAC,CAAC;AAE1D,IAAA,OAAO,oBAACA,qBAAe,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,oBAAoB,EAAM,KAAK,EAAI,CAAC;AAClE;;;;"}
1
+ {"version":3,"file":"RichTextSendBoxWrapper-BnmvwF_1.js","sources":["../../../../react-composites/src/composites/common/RichTextSendBoxWrapper.tsx"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport React from 'react';\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport { usePropsFor } from '../ChatComposite/hooks/usePropsFor';\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport { RichTextSendBox, RichTextSendBoxProps } from '@internal/react-components';\n\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\n/**\n * @private\n *\n * Wrapper for RichTextSendBox component to allow us to use usePropsFor with richTextSendBox\n * before lazyLoading is done\n */\nexport const RichTextSendBoxWrapper = (props: RichTextSendBoxProps): JSX.Element => {\n const richTextSendBoxProps = usePropsFor(RichTextSendBox);\n\n return <RichTextSendBox {...richTextSendBoxProps} {...props} />;\n};\n"],"names":["usePropsFor","RichTextSendBox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAEA;AAOA;AACA;;;;;AAKG;AACU,MAAA,sBAAsB,GAAG,CAAC,KAA2B,KAAiB;AACjF,IAAA,MAAM,oBAAoB,GAAGA,iBAAW,CAACC,qBAAe,CAAC,CAAC;AAE1D,IAAA,OAAO,oBAACA,qBAAe,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,oBAAoB,EAAM,KAAK,EAAI,CAAC;AAClE;;;;"}
@@ -176,7 +176,7 @@ function getDefaultExportFromCjs (x) {
176
176
  // Copyright (c) Microsoft Corporation.
177
177
  // Licensed under the MIT License.
178
178
  // GENERATED FILE. DO NOT EDIT MANUALLY.
179
- var telemetryVersion = '1.18.0-alpha-202407160014';
179
+ var telemetryVersion = '1.18.0-alpha-202407162016';
180
180
 
181
181
 
182
182
  var telemetryVersion$1 = /*@__PURE__*/getDefaultExportFromCjs(telemetryVersion);
@@ -311,7 +311,7 @@ const createSafeReplacer = () => {
311
311
  * @returns units of pixels
312
312
  */
313
313
  const _convertRemToPx = (rem) => {
314
- return rem * getBrowserFontSizeInPx();
314
+ return rem * parseFloat(getComputedStyle(document.documentElement).fontSize);
315
315
  };
316
316
  /**
317
317
  * @internal
@@ -320,15 +320,7 @@ const _convertRemToPx = (rem) => {
320
320
  * @returns units of rem
321
321
  */
322
322
  const _convertPxToRem = (px) => {
323
- return px / getBrowserFontSizeInPx();
324
- };
325
- const getBrowserFontSizeInPx = () => {
326
- let fontSizeInPx = parseFloat(getComputedStyle(document.documentElement).fontSize);
327
- // If browser font size is not a number, default to 16 px
328
- if (Number.isNaN(fontSizeInPx)) {
329
- fontSizeInPx = 16;
330
- }
331
- return fontSizeInPx;
323
+ return px / parseFloat(getComputedStyle(document.documentElement).fontSize);
332
324
  };
333
325
  /**
334
326
  * @internal
@@ -6400,14 +6392,20 @@ const richTextEditorStyle = (props) => {
6400
6392
  minHeight: props.minHeight,
6401
6393
  maxHeight: props.maxHeight,
6402
6394
  maxWidth: '100%',
6403
- paddingTop: '0.5rem'
6395
+ // this is needed to fix an issue when text has some indentation, indentation uses blockquote tag and
6396
+ // it gets both horizontal margins because of the user agent stylesheet
6397
+ // remove this code when RoosterJS content model packages are used as they use different approach for indentation
6398
+ '& blockquote': {
6399
+ marginInlineEnd: '0'
6400
+ }
6404
6401
  });
6405
6402
  };
6406
6403
  /**
6407
6404
  * @private
6408
6405
  */
6409
- const richTextEditorWrapperStyle = (theme) => {
6406
+ const richTextEditorWrapperStyle = (theme, addTopOffset) => {
6410
6407
  return react.mergeStyles({
6408
+ paddingTop: `${addTopOffset ? '0.5rem' : '0'}`,
6411
6409
  paddingInlineStart: `0.75rem`,
6412
6410
  paddingInlineEnd: `0.75rem`,
6413
6411
  maxWidth: '100%',
@@ -6486,7 +6484,7 @@ const ribbonOverflowButtonRootStyles = (theme) => {
6486
6484
  },
6487
6485
  '.ribbon-table-button-regular-icon': {
6488
6486
  display: 'inline-block',
6489
- margin: '0 0.25rem 0 0.25rem',
6487
+ margin: '-0.25rem 0.25rem 0 0.25rem',
6490
6488
  width: '1.25rem',
6491
6489
  height: '1.25rem'
6492
6490
  },
@@ -6525,8 +6523,8 @@ const ribbonButtonRootStyles = (iconColor, hoverIconColor) => {
6525
6523
  */
6526
6524
  const toolbarButtonStyle = (theme) => {
6527
6525
  return {
6528
- icon: { color: theme.palette.neutralPrimary, height: 'auto', paddingTop: '0.25rem' },
6529
- menuIcon: { color: theme.palette.neutralPrimary, height: 'auto', paddingTop: '0.25rem' },
6526
+ icon: { color: theme.palette.neutralPrimary, height: 'auto' },
6527
+ menuIcon: { color: theme.palette.neutralPrimary, height: 'auto' },
6530
6528
  root: { minWidth: 'auto', backgroundColor: 'transparent' },
6531
6529
  rootChecked: ribbonButtonRootStyles(theme.palette.themePrimary, theme.palette.themePrimary),
6532
6530
  // there is a bug for Android where the press action is considered hover sometimes
@@ -6566,14 +6564,14 @@ const ribbonTableButtonRootStyles = (theme, isSelected) => {
6566
6564
  '.ribbon-table-button-regular-icon': {
6567
6565
  width: '1.25rem',
6568
6566
  height: '1.25rem',
6569
- margin: '0 0.25rem 0 0.25rem',
6567
+ margin: '-0.25rem 0.25rem 0 0.25rem',
6570
6568
  color: theme.palette.neutralPrimary,
6571
6569
  display: isSelected ? 'none' : 'inline-block'
6572
6570
  },
6573
6571
  '.ribbon-table-button-filled-icon': {
6574
6572
  width: '1.25rem',
6575
6573
  height: '1.25rem',
6576
- margin: '0 0.25rem 0 0.25rem',
6574
+ margin: '-0.25rem 0.25rem 0 0.25rem',
6577
6575
  color: theme.palette.themePrimary,
6578
6576
  display: isSelected ? 'inline-block' : 'none'
6579
6577
  }
@@ -6587,7 +6585,7 @@ const ribbonDividerStyle = (theme) => {
6587
6585
  return react.mergeStyles({
6588
6586
  color: theme.palette.neutralQuaternaryAlt,
6589
6587
  margin: '0 -0.5rem',
6590
- paddingTop: '0.25rem'
6588
+ paddingTop: '0.5rem'
6591
6589
  });
6592
6590
  };
6593
6591
  /**
@@ -6595,7 +6593,7 @@ const ribbonDividerStyle = (theme) => {
6595
6593
  */
6596
6594
  const richTextToolbarStyle = {
6597
6595
  // Override for the default white color of the Ribbon component
6598
- root: { backgroundColor: 'transparent', padding: '0.25rem 0 0 0', height: '2rem' }
6596
+ root: { backgroundColor: 'transparent', padding: '0px' }
6599
6597
  };
6600
6598
  /**
6601
6599
  * @private
@@ -7599,7 +7597,6 @@ const RichTextEditor = React.forwardRef((props, ref) => {
7599
7597
  const editorDiv = React.useRef(null);
7600
7598
  const theme = useTheme();
7601
7599
  const [contextMenuProps, setContextMenuProps] = React.useState(null);
7602
- const previousThemeDirection = React.useRef(themeDirection(theme));
7603
7600
  React.useImperativeHandle(ref, () => {
7604
7601
  return {
7605
7602
  focus() {
@@ -7781,24 +7778,9 @@ const RichTextEditor = React.forwardRef((props, ref) => {
7781
7778
  // don't update the editor on deps update as everything is handled in separate hooks or plugins
7782
7779
  // eslint-disable-next-line react-hooks/exhaustive-deps
7783
7780
  }, [theme, plugins]);
7784
- React.useEffect(() => {
7785
- const themeDirectionValue = themeDirection(theme);
7786
- // check that editor exists and theme was actually changed
7787
- // as format.direction will be undefined if setDirection is not called
7788
- if (editor.current && previousThemeDirection.current !== themeDirectionValue) {
7789
- const format = roosterjsContentModelApi.getFormatState(editor.current);
7790
- if (format.direction !== themeDirectionValue) {
7791
- // should be set after the hook where editor is created as the editor might be null
7792
- // setDirection will cause the focus change back to the editor and this might not be what we want to do (autoFocus prop)
7793
- // that's why it's not part of the create editor hook
7794
- roosterjsContentModelApi.setDirection(editor.current, theme.rtl ? 'rtl' : 'ltr');
7795
- }
7796
- previousThemeDirection.current = themeDirectionValue;
7797
- }
7798
- }, [theme]);
7799
7781
  return (React.createElement("div", { "data-testid": 'rich-text-editor-wrapper' },
7800
7782
  showRichTextEditorFormatting && toolbar,
7801
- React.createElement("div", { className: richTextEditorWrapperStyle(theme) },
7783
+ React.createElement("div", { className: richTextEditorWrapperStyle(theme, !showRichTextEditorFormatting) },
7802
7784
  React.createElement("div", { id: "richTextSendBox", ref: editorDiv, tabIndex: 0, role: "textbox", "aria-multiline": "true", "data-testid": 'rooster-rich-text-editor', className: richTextEditorStyle(props.styles), "aria-label": placeholderText })),
7803
7785
  contextMenuProps && React.createElement(react.ContextualMenu, Object.assign({}, contextMenuProps, { calloutProps: { isBeakVisible: false } }))));
7804
7786
  });
@@ -7829,9 +7811,6 @@ const setSelectionAfterLastSegment = (model, block) => {
7829
7811
  block.segments.push(marker);
7830
7812
  roosterjsContentModelDom.setSelection(model, marker);
7831
7813
  };
7832
- const themeDirection = (theme) => {
7833
- return theme.rtl ? 'rtl' : 'ltr';
7834
- };
7835
7814
 
7836
7815
  // Copyright (c) Microsoft Corporation.
7837
7816
  // Licensed under the MIT License.
@@ -8557,13 +8536,9 @@ const useChatMessageCommonStyles = reactComponents.makeStyles({
8557
8536
  },
8558
8537
  bodyWithPlaceholderImage: {
8559
8538
  '& img[src=""]': {
8560
- backgroundColor: reactComponents.tokens.colorNeutralBackground1Selected,
8561
- // this ensures safari won't have default rendering when image source
8562
- // becomes invalid such as empty string in this case
8563
- fontSize: '0',
8539
+ display: 'block',
8564
8540
  position: 'relative',
8565
- clipPath: 'inset(0.3px)',
8566
- display: 'flex'
8541
+ marginBottom: '5px'
8567
8542
  },
8568
8543
  '& img[src=""]:after': {
8569
8544
  backgroundColor: reactComponents.tokens.colorNeutralBackground1Selected,
@@ -9022,12 +8997,7 @@ const _useContainerWidth = (containerRef) => {
9022
8997
  const [width, setWidth] = React.useState(undefined);
9023
8998
  const observer = React.useRef(new ResizeObserver((entries) => {
9024
8999
  const { width } = entries[0].contentRect;
9025
- if (Number.isNaN(width)) {
9026
- setWidth(0);
9027
- }
9028
- else {
9029
- setWidth(width);
9030
- }
9000
+ setWidth(width);
9031
9001
  }));
9032
9002
  React.useEffect(() => {
9033
9003
  if (containerRef.current) {
@@ -9050,12 +9020,7 @@ const _useContainerHeight = (containerRef) => {
9050
9020
  const [height, setHeight] = React.useState(undefined);
9051
9021
  const observer = React.useRef(new ResizeObserver((entries) => {
9052
9022
  const { height } = entries[0].contentRect;
9053
- if (Number.isNaN(height)) {
9054
- setHeight(0);
9055
- }
9056
- else {
9057
- setHeight(height);
9058
- }
9023
+ setHeight(height);
9059
9024
  }));
9060
9025
  React.useEffect(() => {
9061
9026
  if (containerRef.current) {
@@ -10247,7 +10212,7 @@ class _ErrorBoundary extends React.Component {
10247
10212
  // Copyright (c) Microsoft Corporation.
10248
10213
  // Licensed under the MIT License.
10249
10214
  /* @conditional-compile-remove(rich-text-editor) */
10250
- const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-8xkyCDXN.js'); }));
10215
+ const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-Dkm1akf7.js'); }));
10251
10216
  /**
10252
10217
  * @private
10253
10218
  * Use this function to load RoosterJS dependencies early in the lifecycle.
@@ -10255,7 +10220,7 @@ const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve()
10255
10220
  *
10256
10221
  * @conditional-compile-remove(rich-text-editor)
10257
10222
  */
10258
- const loadChatMessageComponentAsRichTextEditBox = () => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-8xkyCDXN.js'); });
10223
+ const loadChatMessageComponentAsRichTextEditBox = () => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-Dkm1akf7.js'); });
10259
10224
  /**
10260
10225
  * @private
10261
10226
  */
@@ -14740,13 +14705,9 @@ const ResponsiveHorizontalGallery = (props) => {
14740
14705
  const containerWidth = _useContainerWidth(containerRef);
14741
14706
  const leftPadding = containerRef.current ? parseFloat(getComputedStyle(containerRef.current).paddingLeft) : 0;
14742
14707
  const rightPadding = containerRef.current ? parseFloat(getComputedStyle(containerRef.current).paddingRight) : 0;
14743
- let containerWidthWithoutPadding = Math.max((containerWidth !== null && containerWidth !== void 0 ? containerWidth : 0) - leftPadding - rightPadding, 0);
14744
- if (Number.isNaN(containerWidthWithoutPadding)) {
14745
- containerWidthWithoutPadding = 0;
14746
- }
14747
14708
  const childrenPerPage = calculateHorizontalChildrenPerPage({
14748
14709
  numberOfChildren: React.Children.count(props.children),
14749
- containerWidth: containerWidthWithoutPadding,
14710
+ containerWidth: (containerWidth !== null && containerWidth !== void 0 ? containerWidth : 0) - leftPadding - rightPadding,
14750
14711
  gapWidthRem,
14751
14712
  buttonWidthRem
14752
14713
  });
@@ -14935,13 +14896,9 @@ const ResponsiveVerticalGallery = (props) => {
14935
14896
  const containerHeight = _useContainerHeight(containerRef);
14936
14897
  const topPadding = containerRef.current ? parseFloat(getComputedStyle(containerRef.current).paddingTop) : 0;
14937
14898
  const bottomPadding = containerRef.current ? parseFloat(getComputedStyle(containerRef.current).paddingBottom) : 0;
14938
- let containerHeightWithoutPadding = Math.max((containerHeight !== null && containerHeight !== void 0 ? containerHeight : 0) - topPadding - bottomPadding, 0);
14939
- if (Number.isNaN(containerHeightWithoutPadding)) {
14940
- containerHeightWithoutPadding = 0;
14941
- }
14942
14899
  const childrenPerPage = calculateVerticalChildrenPerPage({
14943
14900
  numberOfChildren: (_a = React.Children.count(children)) !== null && _a !== void 0 ? _a : 0,
14944
- containerHeight: containerHeightWithoutPadding,
14901
+ containerHeight: (containerHeight !== null && containerHeight !== void 0 ? containerHeight : 0) - topPadding - bottomPadding,
14945
14902
  gapHeightRem,
14946
14903
  controlBarHeight: controlBarHeightRem !== null && controlBarHeightRem !== void 0 ? controlBarHeightRem : 2,
14947
14904
  isShort: isShort !== null && isShort !== void 0 ? isShort : false
@@ -20420,7 +20377,6 @@ const processChatMessageContent = (message) => {
20420
20377
  // else in loading or success state
20421
20378
  img.setAttribute('src', src);
20422
20379
  }
20423
- setImageWidthAndHeight(img);
20424
20380
  }
20425
20381
  });
20426
20382
  content = document.body.innerHTML;
@@ -20480,15 +20436,6 @@ const extractAttachmentContentTypeFromName = (name) => {
20480
20436
  const contentType = name.substring(indexOfLastDot + 1);
20481
20437
  return contentType;
20482
20438
  };
20483
- const setImageWidthAndHeight = (img) => {
20484
- if (img) {
20485
- // define aspect ratio explicitly to prevent image not being displayed correctly
20486
- // in safari, this includes image placeholder for loading state
20487
- const width = img.width;
20488
- const height = img.height;
20489
- img.style.aspectRatio = `${width}/${height}`;
20490
- }
20491
- };
20492
20439
  /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
20493
20440
  const extractAttachmentsMetadata = (message) => {
20494
20441
  var _a, _b;
@@ -22406,7 +22353,7 @@ const AttachmentDownloadErrorBar = (props) => {
22406
22353
  /**
22407
22354
  * Wrapper for RichTextSendBox component to allow us to use usePropsFor with richTextSendBox with lazy loading
22408
22355
  */
22409
- const RichTextSendBoxWrapper = React.lazy(() => Promise.resolve().then(function () { return require('./RichTextSendBoxWrapper-BM9W7R3u.js'); }).then((module) => ({ default: module.RichTextSendBoxWrapper })));
22356
+ const RichTextSendBoxWrapper = React.lazy(() => Promise.resolve().then(function () { return require('./RichTextSendBoxWrapper-BnmvwF_1.js'); }).then((module) => ({ default: module.RichTextSendBoxWrapper })));
22410
22357
  /**
22411
22358
  * @private
22412
22359
  * Use this function to load RoosterJS dependencies early in the lifecycle.
@@ -22414,7 +22361,7 @@ const RichTextSendBoxWrapper = React.lazy(() => Promise.resolve().then(function
22414
22361
  *
22415
22362
  /* @conditional-compile-remove(rich-text-editor-composite-support)
22416
22363
  */
22417
- const loadRichTextSendBox = () => Promise.resolve().then(function () { return require('./RichTextSendBoxWrapper-BM9W7R3u.js'); }).then((module) => ({ default: module.RichTextSendBoxWrapper }));
22364
+ const loadRichTextSendBox = () => Promise.resolve().then(function () { return require('./RichTextSendBoxWrapper-BnmvwF_1.js'); }).then((module) => ({ default: module.RichTextSendBoxWrapper }));
22418
22365
  /**
22419
22366
  * @private
22420
22367
  */
@@ -42447,4 +42394,4 @@ exports.useTeamsCall = useTeamsCall;
42447
42394
  exports.useTeamsCallAdapter = useTeamsCallAdapter;
42448
42395
  exports.useTeamsCallAgent = useTeamsCallAgent;
42449
42396
  exports.useTheme = useTheme;
42450
- //# sourceMappingURL=index-CNaC_GQ5.js.map
42397
+ //# sourceMappingURL=index-BF8P6_ls.js.map