@azure/communication-react 1.18.0-alpha-202407162158 → 1.18.0-alpha-202407170014

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 (24) hide show
  1. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-DEZmHBTJ.js → ChatMessageComponentAsRichTextEditBox-BZ2Y7hMk.js} +29 -4
  2. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-BZ2Y7hMk.js.map +1 -0
  3. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CJxasrJl.js → RichTextSendBoxWrapper-DHxkzYTL.js} +2 -2
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CJxasrJl.js.map → RichTextSendBoxWrapper-DHxkzYTL.js.map} +1 -1
  5. package/dist/dist-cjs/communication-react/{index-BsoS46cI.js → index-BCy65nmk.js} +34 -9
  6. package/dist/dist-cjs/communication-react/index-BCy65nmk.js.map +1 -0
  7. package/dist/dist-cjs/communication-react/index.js +1 -1
  8. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  10. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +31 -3
  11. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +1 -1
  12. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js +6 -1
  13. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
  14. package/dist/dist-esm/react-components/src/components/styles/Common.style.d.ts +1 -1
  15. package/dist/dist-esm/react-components/src/components/styles/Common.style.js +2 -1
  16. package/dist/dist-esm/react-components/src/components/styles/Common.style.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +2 -2
  18. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  19. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +4 -0
  20. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +19 -0
  21. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  22. package/package.json +1 -1
  23. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-DEZmHBTJ.js.map +0 -1
  24. package/dist/dist-cjs/communication-react/index-BsoS46cI.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-BsoS46cI.js');
3
+ var index = require('./index-BCy65nmk.js');
4
4
  require('react');
5
5
  require('@fluentui/react');
6
6
  require('@fluentui/react-components');
@@ -2,5 +2,5 @@
2
2
  // Copyright (c) Microsoft Corporation.
3
3
  // Licensed under the MIT License.
4
4
  // GENERATED FILE. DO NOT EDIT MANUALLY.
5
- module.exports = '1.18.0-alpha-202407162158';
5
+ module.exports = '1.18.0-alpha-202407170014';
6
6
  //# sourceMappingURL=telemetryVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.18.0-alpha-202407162158';\n"]}
1
+ {"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.18.0-alpha-202407170014';\n"]}
@@ -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 } from '../../utils/SendBoxUtils';
18
+ import { cancelInlineImageUpload, hasIncompleteAttachmentUploads, insertImagesToContentString, isAttachmentUploadCompleted, removeBrokenImageContent } 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,6 +27,8 @@ 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';
30
32
  /**
31
33
  * @private
32
34
  */
@@ -41,7 +43,31 @@ export const ChatMessageComponentAsRichTextEditBox = (props) => {
41
43
  imageUploadsInProgress,
42
44
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
43
45
  onCancelInlineImageUpload } = props;
44
- const [textValue, setTextValue] = useState(message.content || '');
46
+ const initialContent = useMemo(() => {
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 || '');
45
71
  /* @conditional-compile-remove(file-sharing-acs) */
46
72
  const [attachmentMetadata, handleAttachmentAction] = useReducer(attachmentMetadataReducer, (_a = getMessageWithAttachmentMetadata(message)) !== null && _a !== void 0 ? _a : []);
47
73
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
@@ -95,6 +121,8 @@ export const ChatMessageComponentAsRichTextEditBox = (props) => {
95
121
  }
96
122
  let content = textValue;
97
123
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
124
+ content = removeBrokenImageContent(textValue);
125
+ /* @conditional-compile-remove(rich-text-editor-image-upload) */
98
126
  if (isAttachmentUploadCompleted(imageUploadsInProgress)) {
99
127
  content = insertImagesToContentString(textValue, imageUploadsInProgress);
100
128
  }
@@ -168,7 +196,7 @@ export const ChatMessageComponentAsRichTextEditBox = (props) => {
168
196
  return (React.createElement(Stack, { className: mergeStyles(editBoxWidthStyles) },
169
197
  React.createElement(RichTextSendBoxErrors, { textTooLongMessage: textTooLongMessage, systemMessage: message.failureReason,
170
198
  /* @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,
199
+ React.createElement(RichTextInputBoxComponent, { placeholderText: strings.editBoxPlaceholderText, onChange: onChangeHandler, editorComponentRef: editTextFieldRef, initialContent: initialContent, strings: richTextLocaleStrings, disabled: false, actionComponents: actionButtons, richTextEditorStyleProps: editBoxRichTextEditorStyle, isHorizontalLayoutDisabled: true,
172
200
  /* @conditional-compile-remove(file-sharing-acs) */
173
201
  onRenderAttachmentUploads: onRenderAttachmentUploads,
174
202
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
@@ -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,kB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AAC,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} 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
+ {"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,gCAAgC,EAChC,qCAAqC,EACtC,MAAM,gDAAgD,CAAC;AAExD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,C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AAE,gBAAgB,EACpC,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,qBAAqB,EAC9B,QAAQ,EAAE,KAAK,EACf,gBAAgB,EAAE,aAAa,EAC/B,wBAAwB,EAAE,0BAA0B,EACpD,0BAA0B,EAAE,IAAI;gBAChC,mDAAmD;gBACnD,yBAAyB,EAAE,yBAAyB;gBACpD,gEAAgE;gBAChE,OAAO,EAAE,OAAO;gBAChB,gEAAgE;gBAChE,mBAAmB,EAAE,mBAAmB,GACxC,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) => 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 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 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(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={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={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"]}
@@ -12,6 +12,8 @@ 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';
15
17
  /**
16
18
  * @private
17
19
  */
@@ -33,8 +35,11 @@ export const ChatMyMessageComponent = (props) => {
33
35
  }, [onDeleteMessage, message.messageId, message.messageType, clientMessageId]);
34
36
  const onResendClick = useCallback(() => {
35
37
  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);
36
41
  onSendMessage &&
37
- onSendMessage(content !== undefined ? content : '',
42
+ onSendMessage(newContent,
38
43
  /* @conditional-compile-remove(file-sharing-acs) */
39
44
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
40
45
  {
@@ -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;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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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"]}
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;AAsFpE;;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,GAA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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/* @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 /**\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 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 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"]}
@@ -14,5 +14,5 @@ export declare const scrollbarStyles: {
14
14
  /**
15
15
  * @private
16
16
  */
17
- export declare const ERROR_IMAGE_SVG_PATH = "M2.85 2.15a.5.5 0 1 0-.7.7l1.4 1.41A2.99 2.99 0 0 0 3 6v8a3 3 0 0 0 3 3h8c.65 0 1.25-.2 1.74-.55l1.4 1.4a.5.5 0 0 0 .71-.7l-15-15Zm6.56 7.97a1.5 1.5 0 0 0-.46.31l-4.67 4.59A2 2 0 0 1 4 14V6a2 2 0 0 1 .28-1.02l5.13 5.14ZM6 16a2 2 0 0 1-1.01-.27l4.66-4.58c.2-.2.5-.2.7 0l4.66 4.58A2 2 0 0 1 14 16H6ZM16 6v7.88l.9.9A3 3 0 0 0 17 14V6a3 3 0 0 0-3-3H6a3 3 0 0 0-.78.1l.9.9H14a2 2 0 0 1 2 2Zm-2 1.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0Zm-1 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z";
17
+ export declare const BROKEN_IMAGE_SVG_DATA = "data:image/svg+xml,%3Csvg width='3rem' height='3rem' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='currentColor'%3E%3Cpath d='M2.85 2.15a.5.5 0 1 0-.7.7l1.4 1.41A2.99 2.99 0 0 0 3 6v8a3 3 0 0 0 3 3h8c.65 0 1.25-.2 1.74-.55l1.4 1.4a.5.5 0 0 0 .71-.7l-15-15Zm6.56 7.97a1.5 1.5 0 0 0-.46.31l-4.67 4.59A2 2 0 0 1 4 14V6a2 2 0 0 1 .28-1.02l5.13 5.14ZM6 16a2 2 0 0 1-1.01-.27l4.66-4.58c.2-.2.5-.2.7 0l4.66 4.58A2 2 0 0 1 14 16H6ZM16 6v7.88l.9.9A3 3 0 0 0 17 14V6a3 3 0 0 0-3-3H6a3 3 0 0 0-.78.1l.9.9H14a2 2 0 0 1 2 2Zm-2 1.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0Zm-1 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z' fill='currentColor' /%3E%3C/svg%3E";
18
18
  //# sourceMappingURL=Common.style.d.ts.map
@@ -13,8 +13,9 @@ export const scrollbarStyles = {
13
13
  background: 'rgba(150, 150, 150)'
14
14
  }
15
15
  };
16
+ const ERROR_IMAGE_SVG_PATH = 'M2.85 2.15a.5.5 0 1 0-.7.7l1.4 1.41A2.99 2.99 0 0 0 3 6v8a3 3 0 0 0 3 3h8c.65 0 1.25-.2 1.74-.55l1.4 1.4a.5.5 0 0 0 .71-.7l-15-15Zm6.56 7.97a1.5 1.5 0 0 0-.46.31l-4.67 4.59A2 2 0 0 1 4 14V6a2 2 0 0 1 .28-1.02l5.13 5.14ZM6 16a2 2 0 0 1-1.01-.27l4.66-4.58c.2-.2.5-.2.7 0l4.66 4.58A2 2 0 0 1 14 16H6ZM16 6v7.88l.9.9A3 3 0 0 0 17 14V6a3 3 0 0 0-3-3H6a3 3 0 0 0-.78.1l.9.9H14a2 2 0 0 1 2 2Zm-2 1.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0Zm-1 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z';
16
17
  /**
17
18
  * @private
18
19
  */
19
- export const ERROR_IMAGE_SVG_PATH = 'M2.85 2.15a.5.5 0 1 0-.7.7l1.4 1.41A2.99 2.99 0 0 0 3 6v8a3 3 0 0 0 3 3h8c.65 0 1.25-.2 1.74-.55l1.4 1.4a.5.5 0 0 0 .71-.7l-15-15Zm6.56 7.97a1.5 1.5 0 0 0-.46.31l-4.67 4.59A2 2 0 0 1 4 14V6a2 2 0 0 1 .28-1.02l5.13 5.14ZM6 16a2 2 0 0 1-1.01-.27l4.66-4.58c.2-.2.5-.2.7 0l4.66 4.58A2 2 0 0 1 14 16H6ZM16 6v7.88l.9.9A3 3 0 0 0 17 14V6a3 3 0 0 0-3-3H6a3 3 0 0 0-.78.1l.9.9H14a2 2 0 0 1 2 2Zm-2 1.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0Zm-1 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z';
20
+ export const BROKEN_IMAGE_SVG_DATA = `data:image/svg+xml,%3Csvg width='3rem' height='3rem' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='currentColor'%3E%3Cpath d='${ERROR_IMAGE_SVG_PATH}' fill='currentColor' /%3E%3C/svg%3E`;
20
21
  //# sourceMappingURL=Common.style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Common.style.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/Common.style.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,2CAA2C,EAAE;QAC3C,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE,QAAQ;KACjB;IACD,uDAAuD,EAAE;QACvD,YAAY,EAAE,MAAM;QACpB,UAAU,EAAE,qBAAqB;KAClC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,mdAAmd,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @private\n */\nexport const scrollbarStyles = {\n '::-webkit-scrollbar, *::-webkit-scrollbar': {\n width: '0.3rem',\n height: '0.3rem'\n },\n '::-webkit-scrollbar-thumb, *::-webkit-scrollbar-thumb': {\n borderRadius: '10px',\n background: 'rgba(150, 150, 150)'\n }\n};\n\n/**\n * @private\n */\nexport const ERROR_IMAGE_SVG_PATH =\n 'M2.85 2.15a.5.5 0 1 0-.7.7l1.4 1.41A2.99 2.99 0 0 0 3 6v8a3 3 0 0 0 3 3h8c.65 0 1.25-.2 1.74-.55l1.4 1.4a.5.5 0 0 0 .71-.7l-15-15Zm6.56 7.97a1.5 1.5 0 0 0-.46.31l-4.67 4.59A2 2 0 0 1 4 14V6a2 2 0 0 1 .28-1.02l5.13 5.14ZM6 16a2 2 0 0 1-1.01-.27l4.66-4.58c.2-.2.5-.2.7 0l4.66 4.58A2 2 0 0 1 14 16H6ZM16 6v7.88l.9.9A3 3 0 0 0 17 14V6a3 3 0 0 0-3-3H6a3 3 0 0 0-.78.1l.9.9H14a2 2 0 0 1 2 2Zm-2 1.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0Zm-1 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z';\n"]}
1
+ {"version":3,"file":"Common.style.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/Common.style.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,2CAA2C,EAAE;QAC3C,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE,QAAQ;KACjB;IACD,uDAAuD,EAAE;QACvD,YAAY,EAAE,MAAM;QACpB,UAAU,EAAE,qBAAqB;KAClC;CACF,CAAC;AAEF,MAAM,oBAAoB,GACxB,mdAAmd,CAAC;AAEtd;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,gJAAgJ,oBAAoB,sCAAsC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @private\n */\nexport const scrollbarStyles = {\n '::-webkit-scrollbar, *::-webkit-scrollbar': {\n width: '0.3rem',\n height: '0.3rem'\n },\n '::-webkit-scrollbar-thumb, *::-webkit-scrollbar-thumb': {\n borderRadius: '10px',\n background: 'rgba(150, 150, 150)'\n }\n};\n\nconst ERROR_IMAGE_SVG_PATH =\n 'M2.85 2.15a.5.5 0 1 0-.7.7l1.4 1.41A2.99 2.99 0 0 0 3 6v8a3 3 0 0 0 3 3h8c.65 0 1.25-.2 1.74-.55l1.4 1.4a.5.5 0 0 0 .71-.7l-15-15Zm6.56 7.97a1.5 1.5 0 0 0-.46.31l-4.67 4.59A2 2 0 0 1 4 14V6a2 2 0 0 1 .28-1.02l5.13 5.14ZM6 16a2 2 0 0 1-1.01-.27l4.66-4.58c.2-.2.5-.2.7 0l4.66 4.58A2 2 0 0 1 14 16H6ZM16 6v7.88l.9.9A3 3 0 0 0 17 14V6a3 3 0 0 0-3-3H6a3 3 0 0 0-.78.1l.9.9H14a2 2 0 0 1 2 2Zm-2 1.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0Zm-1 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z';\n\n/**\n * @private\n */\nexport const BROKEN_IMAGE_SVG_DATA = `data:image/svg+xml,%3Csvg width='3rem' height='3rem' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='currentColor'%3E%3Cpath d='${ERROR_IMAGE_SVG_PATH}' fill='currentColor' /%3E%3C/svg%3E`;\n"]}
@@ -4,7 +4,7 @@ import { mergeStyles } from '@fluentui/react';
4
4
  import { makeStyles, shorthands, tokens } from '@fluentui/react-components';
5
5
  import { MESSAGE_STATUS_INDICATOR_SIZE_REM } from './MessageStatusIndicator.styles';
6
6
  import { _ATTACHMENT_CARD_MARGIN_IN_PX, _ATTACHMENT_CARD_WIDTH_IN_REM } from './AttachmentCard.styles';
7
- import { ERROR_IMAGE_SVG_PATH } from './Common.style';
7
+ import { BROKEN_IMAGE_SVG_DATA } from './Common.style';
8
8
  // Minimum chat bubble width. This matches the minimum chat bubble width from FluentUI
9
9
  // that can contain a message and a timestamp.
10
10
  const CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM = 6.25;
@@ -254,7 +254,7 @@ export const useChatMessageCommonStyles = makeStyles({
254
254
  '& .broken-image-wrapper': Object.assign(Object.assign({ width: '12rem', height: '12rem', marginTop: '0.75rem', display: 'flex', justifyContent: 'center', alignItems: 'center' }, shorthands.outline('1px', 'solid', tokens.colorNeutralForegroundDisabled)), { backgroundColor: tokens.colorNeutralBackground2 }),
255
255
  '& .broken-image-wrapper:after': {
256
256
  content: `''`,
257
- maskImage: `url("data:image/svg+xml,%3Csvg width='3rem' height='3rem' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='currentColor'%3E%3Cpath d='${ERROR_IMAGE_SVG_PATH}' fill='currentColor' /%3E%3C/svg%3E");`,
257
+ maskImage: `url("${BROKEN_IMAGE_SVG_DATA}");`,
258
258
  width: '3rem',
259
259
  height: '3rem',
260
260
  backgroundColor: `${tokens.colorNeutralForeground2}`
@@ -1 +1 @@
1
- {"version":3,"file":"MessageThread.styles.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/MessageThread.styles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAiB,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,UA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EAAE,SAAS;CAClB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IButtonStyles, mergeStyles } from '@fluentui/react';\nimport { makeStyles, shorthands, tokens } from '@fluentui/react-components';\nimport { CSSProperties } from 'react';\nimport { MESSAGE_STATUS_INDICATOR_SIZE_REM } from './MessageStatusIndicator.styles';\nimport { ComponentSlotStyle } from '../../types';\nimport { _ATTACHMENT_CARD_MARGIN_IN_PX, _ATTACHMENT_CARD_WIDTH_IN_REM } from './AttachmentCard.styles';\nimport { ERROR_IMAGE_SVG_PATH } from './Common.style';\n\n// Minimum chat bubble width. This matches the minimum chat bubble width from FluentUI\n// that can contain a message and a timestamp.\nconst CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM = 6.25;\n\n// Chat messages should span just short of the width of the container.\n// When calculating the width of a message we also must take into account\n// the width of the avatar/gutter and the gap between the message and avatar/gutter.\nconst AVATAR_WIDTH_REM = 2;\nconst AVATAR_MARGIN_LEFT = 2.5;\nconst AVATAR_MESSAGE_GAP_REM = 0.125;\nconst MESSAGE_AMOUNT_OUT_FROM_EDGE_REM = 2;\n\n// Avatars should display on top of chat messages when the chat thread is narrow\nconst MESSAGE_AVATAR_OVERLAP_REM = 0.925;\nconst CHAT_MESSAGE_ZINDEX = 1;\nconst AVATAR_ZINDEX = 2;\n// new message button should be on top of chat message\nconst NEW_MESSAGE_BUTTON_ZINDEX = 2;\n\n/**\n * @private\n */\nexport const messageThreadContainerStyle = mergeStyles({\n height: '100%',\n width: '100%',\n maxHeight: '100%',\n overflow: 'auto',\n position: 'relative',\n alignSelf: 'center'\n});\n\n/**\n * @private\n */\nexport const messageThreadWrapperContainerStyle = mergeStyles({\n height: '100%',\n width: '100%',\n position: 'relative'\n});\n\n/**\n * @private\n */\nexport const noMessageStatusStyle = mergeStyles({\n // This should match the size of the message status indicator icon to ensure\n // multiple messages sent by the user are aligned correctly.\n width: `${MESSAGE_STATUS_INDICATOR_SIZE_REM}rem`\n});\n\n/**\n * @private\n */\nexport const useChatStyles = makeStyles({\n root: {\n // chat components sets max width value to 1056px, override it to 100%\n maxWidth: '100%',\n paddingTop: '0.8rem',\n paddingBottom: '0.5rem',\n paddingRight: '0.6rem',\n paddingLeft: '0.6rem',\n ...shorthands.border('none'),\n ...shorthands.overflow('auto'),\n // `height: 100%` ensures that the Chat component covers 100% of it's parents height\n // to prevent intermittent scrollbars when GIFs are present in the chat.\n height: '100%',\n\n '& a:link': {\n color: tokens.colorBrandForegroundLink\n },\n '& a:visited': {\n color: tokens.colorBrandForegroundLinkHover\n },\n '& a:hover': {\n color: tokens.colorBrandForegroundLinkHover\n }\n }\n});\n\n/**\n * @private\n */\nexport const useChatMessageRenderStyles = makeStyles({\n rootCommon: {},\n rootMessage: {\n ...shorthands.padding('0'),\n ...shorthands.margin('0'),\n maxWidth: '100%',\n minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`\n },\n rootMyMessage: {\n gridTemplateColumns: 'auto fit-content(0)',\n gridTemplateAreas: `\n \"body status\"\n `,\n columnGap: '0',\n gridGap: '0',\n ...shorthands.padding('0'),\n marginTop: '0',\n marginRight: '0',\n marginBottom: '0',\n marginLeft: '50px',\n width: `calc(100% - 50px)`\n },\n bodyCommon: {\n ...shorthands.padding('0'),\n marginRight: '0',\n marginBottom: '0',\n backgroundColor: 'transparent',\n maxWidth: '100%',\n minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`,\n '&:focus-visible': {\n outlineStyle: 'auto'\n }\n },\n bodyMyMessage: {\n width: '100%',\n marginTop: '0'\n },\n bodyWithoutAvatar: {\n marginLeft: `${AVATAR_MARGIN_LEFT}rem`,\n marginTop: '0'\n },\n bodyHiddenAvatar: {\n marginLeft: 0,\n marginTop: 0\n },\n bodyWithAvatar: {\n marginLeft: `0`,\n marginTop: '0.75rem'\n },\n avatarNoOverlap: {\n width: `calc(100% - ${AVATAR_WIDTH_REM + MESSAGE_AMOUNT_OUT_FROM_EDGE_REM + AVATAR_MESSAGE_GAP_REM}rem)`\n },\n avatarOverlap: {\n width: `calc(100% - ${AVATAR_WIDTH_REM + MESSAGE_AMOUNT_OUT_FROM_EDGE_REM - MESSAGE_AVATAR_OVERLAP_REM}rem)`\n }\n});\n\n/**\n * @private\n */\nexport const useChatMyMessageStyles = makeStyles({\n root: {\n // The first column's width should be set to 1fr\n // because otherwise rich text editor's width will grow indefinitely\n gridTemplateColumns: '1fr auto',\n gridTemplateAreas: `\n \". actions\"\n \"body body\"\n `,\n gridGap: '0',\n columnGap: '0',\n paddingTop: '0',\n marginLeft: '0'\n },\n body: {\n paddingBottom: '10px',\n marginTop: '1rem',\n maxWidth: '100%',\n minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`,\n marginLeft: '0rem',\n // This makes message bubble show border in high contrast mode making each message distinguishable\n ...shorthands.border('1px', 'solid', 'transparent'),\n\n '&:hover ~ .fui-ChatMyMessage__actions': {\n visibility: 'visible'\n },\n '&:focus ~ .fui-ChatMyMessage__actions': {\n visibility: 'visible'\n },\n '& msft-mention': {\n color: tokens.colorStatusWarningBackground3,\n fontWeight: 600\n },\n '&:focus-visible': {\n outlineStyle: 'auto'\n }\n },\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n bodyWithPlaceholderImage: {\n // Adding width and height to the placeholder image only for myMessages\n // because inline images sent from ACS doesn't have width and height in the image tag\n '& img[src=\"\"]': {\n width: '12rem',\n height: '12rem'\n }\n },\n bodyAttached: {\n marginTop: '0.125rem'\n },\n menu: {\n boxShadow: tokens.shadow4,\n backgroundColor: tokens.colorNeutralBackground1,\n marginRight: '1px',\n position: 'absolute',\n top: '-2px',\n right: '0',\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n zIndex: 1,\n lineHeight: tokens.lineHeightBase100,\n visibility: 'hidden',\n\n '&:hover, &:focus': {\n cursor: 'pointer',\n visibility: 'visible'\n }\n },\n menuAttached: {\n top: '-18px'\n },\n menuHidden: {\n visibility: 'hidden'\n },\n menuVisible: {\n visibility: 'visible'\n },\n multipleAttachmentsInViewing: {\n width: '100%',\n maxWidth: `${(_ATTACHMENT_CARD_WIDTH_IN_REM + _ATTACHMENT_CARD_MARGIN_IN_PX) * 2}rem`\n },\n multipleAttachmentsInEditing: {\n // when in editing state, the chat message width should not be\n // limited by content length but occupying the full width instead\n width: '100%',\n float: 'right'\n }\n});\n\n/**\n * @private\n */\nexport const newMessageButtonContainerStyle = mergeStyles({\n position: 'absolute',\n zIndex: NEW_MESSAGE_BUTTON_ZINDEX,\n bottom: 0,\n right: '1.5rem'\n});\n\n/**\n * @private\n */\nexport const chatMessageDateStyle: CSSProperties = {\n fontWeight: 600\n};\n\n/**\n * @private\n */\nexport const useChatMessageStyles = makeStyles({\n root: {\n paddingTop: '0'\n },\n body: {\n maxWidth: '100%',\n minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`,\n marginRight: '0rem',\n paddingBottom: '10px',\n zIndex: CHAT_MESSAGE_ZINDEX,\n // This makes message bubble show border in high contrast mode making each message distinguishable\n ...shorthands.border('1px', 'solid', 'transparent'),\n '& > div:first-of-type': {\n flexWrap: 'wrap'\n },\n '& msft-mention': {\n color: tokens.colorStatusWarningBackground3,\n fontWeight: tokens.fontWeightSemibold\n },\n '& img': {\n maxWidth: '100% !important', // Add !important to make sure it won't be overridden by style defined in element\n height: 'auto !important'\n },\n '& video': {\n maxWidth: '100% !important', // Add !important to make sure it won't be overridden by style defined in element\n height: 'auto !important'\n },\n '& p': {\n // Deal with awkward padding seen in messages from Teams.\n // For more info see https://github.com/Azure/communication-ui-library/pull/1507\n ...shorthands.marginBlock('0.125rem')\n },\n '& blockquote': {\n backgroundColor: tokens.colorBrandBackgroundInverted,\n clear: 'left',\n minHeight: '2.25rem',\n width: 'fit-content',\n marginTop: '7px',\n marginRight: '0px',\n marginLeft: '0px',\n marginBottom: '7px',\n paddingTop: '7px',\n paddingRight: '15px',\n paddingLeft: '15px',\n paddingBottom: '7px',\n ...shorthands.border('solid'),\n ...shorthands.borderRadius('4px'),\n ...shorthands.borderWidth('1px'),\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n borderLeftWidth: '4px'\n },\n '& code': {\n whiteSpace: 'pre-wrap'\n },\n '&:focus-visible': {\n outlineStyle: 'auto'\n }\n },\n bodyWithoutAvatar: {\n marginTop: '0.125rem'\n },\n bodyWithAvatar: {\n marginTop: `0.375rem`\n },\n avatarNoOverlap: {\n marginLeft: `${-AVATAR_MARGIN_LEFT + AVATAR_MESSAGE_GAP_REM}rem`\n },\n avatarOverlap: {\n marginLeft: `${-AVATAR_MARGIN_LEFT - MESSAGE_AVATAR_OVERLAP_REM}rem`\n },\n multipleAttachments: {\n width: `${(_ATTACHMENT_CARD_WIDTH_IN_REM + _ATTACHMENT_CARD_MARGIN_IN_PX) * 2}rem`\n }\n});\n\n/**\n * @private\n */\nexport const useChatMessageCommonStyles = makeStyles({\n body: {\n '& table': {\n backgroundColor: tokens.colorBrandBackgroundInverted,\n borderCollapse: 'collapse',\n tableLayout: 'auto',\n width: '100%',\n\n '& tr': {\n ...shorthands.border('1px', 'solid', `${tokens.colorNeutralStrokeAccessible}`),\n\n '& td': {\n ...shorthands.border('1px', 'solid', `${tokens.colorNeutralStrokeAccessible}`),\n wordBreak: 'normal',\n paddingTop: '0px',\n paddingRight: '5px'\n }\n }\n }\n },\n bodyWithPlaceholderImage: {\n '& img[src=\"\"]': {\n backgroundColor: tokens.colorNeutralBackground1Selected,\n // this ensures safari won't have default rendering when image source\n // becomes invalid such as empty string in this case\n fontSize: '0',\n position: 'relative',\n clipPath: 'inset(0.3px)',\n display: 'flex'\n },\n '& img[src=\"\"]:after': {\n backgroundColor: tokens.colorNeutralBackground1Selected,\n content: `url(\"data:image/gif;base64,R0lGODlhAQABAAAAACw=\")`,\n backgroundSize: 'center',\n position: 'absolute',\n width: '100%',\n height: '100%',\n top: '0',\n left: '0',\n display: 'block'\n },\n '& .broken-image-wrapper': {\n width: '12rem',\n height: '12rem',\n marginTop: '0.75rem',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n ...shorthands.outline('1px', 'solid', tokens.colorNeutralForegroundDisabled),\n backgroundColor: tokens.colorNeutralBackground2\n },\n '& .broken-image-wrapper:after': {\n content: `''`,\n maskImage: `url(\"data:image/svg+xml,%3Csvg width='3rem' height='3rem' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='currentColor'%3E%3Cpath d='${ERROR_IMAGE_SVG_PATH}' fill='currentColor' /%3E%3C/svg%3E\");`,\n width: '3rem',\n height: '3rem',\n backgroundColor: `${tokens.colorNeutralForeground2}`\n }\n },\n failed: {\n //TODO: can we reuse a theme color here?\n backgroundColor: 'rgba(168, 0, 0, 0.2)'\n },\n blocked: {\n maxWidth: '100%',\n minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`,\n marginRight: '0rem',\n color: tokens.colorNeutralForeground2,\n\n // This makes message bubble show border in high contrast mode making each message distinguishable\n ...shorthands.border('1px', 'solid', 'transparent'),\n '& i': {\n paddingTop: '0.25rem'\n },\n\n '& p': {\n // Deal with awkward padding seen in messages from Teams.\n // For more info see https://github.com/Azure/communication-ui-library/pull/1507\n ...shorthands.marginBlock('0.125rem'),\n paddingRight: '0.75rem',\n fontStyle: 'italic'\n },\n\n '& a': {\n ...shorthands.marginBlock('0.125rem'),\n fontStyle: 'normal',\n color: tokens.colorBrandForegroundLink,\n ...shorthands.textDecoration('none')\n }\n }\n});\n\n/**\n * @private\n */\nexport const gutterWithAvatar: ComponentSlotStyle = {\n paddingTop: '1.65rem',\n width: `${AVATAR_WIDTH_REM}rem`,\n position: 'relative',\n float: 'left',\n display: 'block',\n visibility: 'visible',\n zIndex: AVATAR_ZINDEX\n};\n\n/**\n * @private\n */\nexport const gutterWithHiddenAvatar: ComponentSlotStyle = {\n ...gutterWithAvatar,\n visibility: 'hidden',\n // we use this hidden avatar just as a width placeholder\n // the placeholder is needed for responsive bubble width\n height: 0\n};\n\n/**\n * @private\n */\nexport const newMessageButtonStyle = mergeStyles({\n float: 'right',\n width: 'fit-content'\n});\n\n/**\n * @private\n */\nexport const buttonWithIconStyles: IButtonStyles = {\n textContainer: {\n display: 'contents'\n }\n};\n\n/**\n * @private\n */\nexport const loadPreviousMessageButtonStyle = mergeStyles({\n border: 'none',\n minHeight: '1.5rem',\n '&:hover': { background: 'none' },\n '&:active': { background: 'none' }\n});\n\n/**\n * @private\n */\nexport const DownIconStyle = mergeStyles({\n marginRight: '0.5em'\n});\n\n/** @private */\nexport const dataLossIconStyle = mergeStyles({\n width: '1.25rem',\n height: '1.25rem'\n});\n"]}
1
+ {"version":3,"file":"MessageThread.styles.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/MessageThread.styles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAiB,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAE5E,OAAO,EAAE,iCAAiC,EAAE,MAAM,iCAAiC,CAAC;AAEpF,OAAO,EAAE,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACvG,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,sFAAsF;AACtF,8CAA8C;AAC9C,MAAM,oCAAoC,GAAG,IAAI,CAAC;AAElD,sEAAsE;AACtE,yEAAyE;AACzE,oFAAoF;AACpF,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,sBAAsB,GAAG,KAAK,CAAC;AACrC,MAAM,gCAAgC,GAAG,CAAC,CAAC;AAE3C,gFAAgF;AAChF,MAAM,0BAA0B,GAAG,KAAK,CAAC;AACzC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,a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AAM,qBAAqB,GAAG,WAAW,CAAC;IAC/C,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,aAAa;CACrB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAkB;IACjD,aAAa,EAAE;QACb,OAAO,EAAE,UAAU;KACpB;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,WAAW,CAAC;IACxD,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE;IACjC,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE;CACnC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;IACvC,WAAW,EAAE,OAAO;CACrB,CAAC,CAAC;AAEH,eAAe;AACf,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC;IAC3C,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;CAClB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IButtonStyles, mergeStyles } from '@fluentui/react';\nimport { makeStyles, shorthands, tokens } from '@fluentui/react-components';\nimport { CSSProperties } from 'react';\nimport { MESSAGE_STATUS_INDICATOR_SIZE_REM } from './MessageStatusIndicator.styles';\nimport { ComponentSlotStyle } from '../../types';\nimport { _ATTACHMENT_CARD_MARGIN_IN_PX, _ATTACHMENT_CARD_WIDTH_IN_REM } from './AttachmentCard.styles';\nimport { BROKEN_IMAGE_SVG_DATA } from './Common.style';\n\n// Minimum chat bubble width. This matches the minimum chat bubble width from FluentUI\n// that can contain a message and a timestamp.\nconst CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM = 6.25;\n\n// Chat messages should span just short of the width of the container.\n// When calculating the width of a message we also must take into account\n// the width of the avatar/gutter and the gap between the message and avatar/gutter.\nconst AVATAR_WIDTH_REM = 2;\nconst AVATAR_MARGIN_LEFT = 2.5;\nconst AVATAR_MESSAGE_GAP_REM = 0.125;\nconst MESSAGE_AMOUNT_OUT_FROM_EDGE_REM = 2;\n\n// Avatars should display on top of chat messages when the chat thread is narrow\nconst MESSAGE_AVATAR_OVERLAP_REM = 0.925;\nconst CHAT_MESSAGE_ZINDEX = 1;\nconst AVATAR_ZINDEX = 2;\n// new message button should be on top of chat message\nconst NEW_MESSAGE_BUTTON_ZINDEX = 2;\n\n/**\n * @private\n */\nexport const messageThreadContainerStyle = mergeStyles({\n height: '100%',\n width: '100%',\n maxHeight: '100%',\n overflow: 'auto',\n position: 'relative',\n alignSelf: 'center'\n});\n\n/**\n * @private\n */\nexport const messageThreadWrapperContainerStyle = mergeStyles({\n height: '100%',\n width: '100%',\n position: 'relative'\n});\n\n/**\n * @private\n */\nexport const noMessageStatusStyle = mergeStyles({\n // This should match the size of the message status indicator icon to ensure\n // multiple messages sent by the user are aligned correctly.\n width: `${MESSAGE_STATUS_INDICATOR_SIZE_REM}rem`\n});\n\n/**\n * @private\n */\nexport const useChatStyles = makeStyles({\n root: {\n // chat components sets max width value to 1056px, override it to 100%\n maxWidth: '100%',\n paddingTop: '0.8rem',\n paddingBottom: '0.5rem',\n paddingRight: '0.6rem',\n paddingLeft: '0.6rem',\n ...shorthands.border('none'),\n ...shorthands.overflow('auto'),\n // `height: 100%` ensures that the Chat component covers 100% of it's parents height\n // to prevent intermittent scrollbars when GIFs are present in the chat.\n height: '100%',\n\n '& a:link': {\n color: tokens.colorBrandForegroundLink\n },\n '& a:visited': {\n color: tokens.colorBrandForegroundLinkHover\n },\n '& a:hover': {\n color: tokens.colorBrandForegroundLinkHover\n }\n }\n});\n\n/**\n * @private\n */\nexport const useChatMessageRenderStyles = makeStyles({\n rootCommon: {},\n rootMessage: {\n ...shorthands.padding('0'),\n ...shorthands.margin('0'),\n maxWidth: '100%',\n minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`\n },\n rootMyMessage: {\n gridTemplateColumns: 'auto fit-content(0)',\n gridTemplateAreas: `\n \"body status\"\n `,\n columnGap: '0',\n gridGap: '0',\n ...shorthands.padding('0'),\n marginTop: '0',\n marginRight: '0',\n marginBottom: '0',\n marginLeft: '50px',\n width: `calc(100% - 50px)`\n },\n bodyCommon: {\n ...shorthands.padding('0'),\n marginRight: '0',\n marginBottom: '0',\n backgroundColor: 'transparent',\n maxWidth: '100%',\n minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`,\n '&:focus-visible': {\n outlineStyle: 'auto'\n }\n },\n bodyMyMessage: {\n width: '100%',\n marginTop: '0'\n },\n bodyWithoutAvatar: {\n marginLeft: `${AVATAR_MARGIN_LEFT}rem`,\n marginTop: '0'\n },\n bodyHiddenAvatar: {\n marginLeft: 0,\n marginTop: 0\n },\n bodyWithAvatar: {\n marginLeft: `0`,\n marginTop: '0.75rem'\n },\n avatarNoOverlap: {\n width: `calc(100% - ${AVATAR_WIDTH_REM + MESSAGE_AMOUNT_OUT_FROM_EDGE_REM + AVATAR_MESSAGE_GAP_REM}rem)`\n },\n avatarOverlap: {\n width: `calc(100% - ${AVATAR_WIDTH_REM + MESSAGE_AMOUNT_OUT_FROM_EDGE_REM - MESSAGE_AVATAR_OVERLAP_REM}rem)`\n }\n});\n\n/**\n * @private\n */\nexport const useChatMyMessageStyles = makeStyles({\n root: {\n // The first column's width should be set to 1fr\n // because otherwise rich text editor's width will grow indefinitely\n gridTemplateColumns: '1fr auto',\n gridTemplateAreas: `\n \". actions\"\n \"body body\"\n `,\n gridGap: '0',\n columnGap: '0',\n paddingTop: '0',\n marginLeft: '0'\n },\n body: {\n paddingBottom: '10px',\n marginTop: '1rem',\n maxWidth: '100%',\n minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`,\n marginLeft: '0rem',\n // This makes message bubble show border in high contrast mode making each message distinguishable\n ...shorthands.border('1px', 'solid', 'transparent'),\n\n '&:hover ~ .fui-ChatMyMessage__actions': {\n visibility: 'visible'\n },\n '&:focus ~ .fui-ChatMyMessage__actions': {\n visibility: 'visible'\n },\n '& msft-mention': {\n color: tokens.colorStatusWarningBackground3,\n fontWeight: 600\n },\n '&:focus-visible': {\n outlineStyle: 'auto'\n }\n },\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n bodyWithPlaceholderImage: {\n // Adding width and height to the placeholder image only for myMessages\n // because inline images sent from ACS doesn't have width and height in the image tag\n '& img[src=\"\"]': {\n width: '12rem',\n height: '12rem'\n }\n },\n bodyAttached: {\n marginTop: '0.125rem'\n },\n menu: {\n boxShadow: tokens.shadow4,\n backgroundColor: tokens.colorNeutralBackground1,\n marginRight: '1px',\n position: 'absolute',\n top: '-2px',\n right: '0',\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n zIndex: 1,\n lineHeight: tokens.lineHeightBase100,\n visibility: 'hidden',\n\n '&:hover, &:focus': {\n cursor: 'pointer',\n visibility: 'visible'\n }\n },\n menuAttached: {\n top: '-18px'\n },\n menuHidden: {\n visibility: 'hidden'\n },\n menuVisible: {\n visibility: 'visible'\n },\n multipleAttachmentsInViewing: {\n width: '100%',\n maxWidth: `${(_ATTACHMENT_CARD_WIDTH_IN_REM + _ATTACHMENT_CARD_MARGIN_IN_PX) * 2}rem`\n },\n multipleAttachmentsInEditing: {\n // when in editing state, the chat message width should not be\n // limited by content length but occupying the full width instead\n width: '100%',\n float: 'right'\n }\n});\n\n/**\n * @private\n */\nexport const newMessageButtonContainerStyle = mergeStyles({\n position: 'absolute',\n zIndex: NEW_MESSAGE_BUTTON_ZINDEX,\n bottom: 0,\n right: '1.5rem'\n});\n\n/**\n * @private\n */\nexport const chatMessageDateStyle: CSSProperties = {\n fontWeight: 600\n};\n\n/**\n * @private\n */\nexport const useChatMessageStyles = makeStyles({\n root: {\n paddingTop: '0'\n },\n body: {\n maxWidth: '100%',\n minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`,\n marginRight: '0rem',\n paddingBottom: '10px',\n zIndex: CHAT_MESSAGE_ZINDEX,\n // This makes message bubble show border in high contrast mode making each message distinguishable\n ...shorthands.border('1px', 'solid', 'transparent'),\n '& > div:first-of-type': {\n flexWrap: 'wrap'\n },\n '& msft-mention': {\n color: tokens.colorStatusWarningBackground3,\n fontWeight: tokens.fontWeightSemibold\n },\n '& img': {\n maxWidth: '100% !important', // Add !important to make sure it won't be overridden by style defined in element\n height: 'auto !important'\n },\n '& video': {\n maxWidth: '100% !important', // Add !important to make sure it won't be overridden by style defined in element\n height: 'auto !important'\n },\n '& p': {\n // Deal with awkward padding seen in messages from Teams.\n // For more info see https://github.com/Azure/communication-ui-library/pull/1507\n ...shorthands.marginBlock('0.125rem')\n },\n '& blockquote': {\n backgroundColor: tokens.colorBrandBackgroundInverted,\n clear: 'left',\n minHeight: '2.25rem',\n width: 'fit-content',\n marginTop: '7px',\n marginRight: '0px',\n marginLeft: '0px',\n marginBottom: '7px',\n paddingTop: '7px',\n paddingRight: '15px',\n paddingLeft: '15px',\n paddingBottom: '7px',\n ...shorthands.border('solid'),\n ...shorthands.borderRadius('4px'),\n ...shorthands.borderWidth('1px'),\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n borderLeftWidth: '4px'\n },\n '& code': {\n whiteSpace: 'pre-wrap'\n },\n '&:focus-visible': {\n outlineStyle: 'auto'\n }\n },\n bodyWithoutAvatar: {\n marginTop: '0.125rem'\n },\n bodyWithAvatar: {\n marginTop: `0.375rem`\n },\n avatarNoOverlap: {\n marginLeft: `${-AVATAR_MARGIN_LEFT + AVATAR_MESSAGE_GAP_REM}rem`\n },\n avatarOverlap: {\n marginLeft: `${-AVATAR_MARGIN_LEFT - MESSAGE_AVATAR_OVERLAP_REM}rem`\n },\n multipleAttachments: {\n width: `${(_ATTACHMENT_CARD_WIDTH_IN_REM + _ATTACHMENT_CARD_MARGIN_IN_PX) * 2}rem`\n }\n});\n\n/**\n * @private\n */\nexport const useChatMessageCommonStyles = makeStyles({\n body: {\n '& table': {\n backgroundColor: tokens.colorBrandBackgroundInverted,\n borderCollapse: 'collapse',\n tableLayout: 'auto',\n width: '100%',\n\n '& tr': {\n ...shorthands.border('1px', 'solid', `${tokens.colorNeutralStrokeAccessible}`),\n\n '& td': {\n ...shorthands.border('1px', 'solid', `${tokens.colorNeutralStrokeAccessible}`),\n wordBreak: 'normal',\n paddingTop: '0px',\n paddingRight: '5px'\n }\n }\n }\n },\n bodyWithPlaceholderImage: {\n '& img[src=\"\"]': {\n backgroundColor: tokens.colorNeutralBackground1Selected,\n // this ensures safari won't have default rendering when image source\n // becomes invalid such as empty string in this case\n fontSize: '0',\n position: 'relative',\n clipPath: 'inset(0.3px)',\n display: 'flex'\n },\n '& img[src=\"\"]:after': {\n backgroundColor: tokens.colorNeutralBackground1Selected,\n content: `url(\"data:image/gif;base64,R0lGODlhAQABAAAAACw=\")`,\n backgroundSize: 'center',\n position: 'absolute',\n width: '100%',\n height: '100%',\n top: '0',\n left: '0',\n display: 'block'\n },\n '& .broken-image-wrapper': {\n width: '12rem',\n height: '12rem',\n marginTop: '0.75rem',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n ...shorthands.outline('1px', 'solid', tokens.colorNeutralForegroundDisabled),\n backgroundColor: tokens.colorNeutralBackground2\n },\n '& .broken-image-wrapper:after': {\n content: `''`,\n maskImage: `url(\"${BROKEN_IMAGE_SVG_DATA}\");`,\n width: '3rem',\n height: '3rem',\n backgroundColor: `${tokens.colorNeutralForeground2}`\n }\n },\n failed: {\n //TODO: can we reuse a theme color here?\n backgroundColor: 'rgba(168, 0, 0, 0.2)'\n },\n blocked: {\n maxWidth: '100%',\n minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`,\n marginRight: '0rem',\n color: tokens.colorNeutralForeground2,\n\n // This makes message bubble show border in high contrast mode making each message distinguishable\n ...shorthands.border('1px', 'solid', 'transparent'),\n '& i': {\n paddingTop: '0.25rem'\n },\n\n '& p': {\n // Deal with awkward padding seen in messages from Teams.\n // For more info see https://github.com/Azure/communication-ui-library/pull/1507\n ...shorthands.marginBlock('0.125rem'),\n paddingRight: '0.75rem',\n fontStyle: 'italic'\n },\n\n '& a': {\n ...shorthands.marginBlock('0.125rem'),\n fontStyle: 'normal',\n color: tokens.colorBrandForegroundLink,\n ...shorthands.textDecoration('none')\n }\n }\n});\n\n/**\n * @private\n */\nexport const gutterWithAvatar: ComponentSlotStyle = {\n paddingTop: '1.65rem',\n width: `${AVATAR_WIDTH_REM}rem`,\n position: 'relative',\n float: 'left',\n display: 'block',\n visibility: 'visible',\n zIndex: AVATAR_ZINDEX\n};\n\n/**\n * @private\n */\nexport const gutterWithHiddenAvatar: ComponentSlotStyle = {\n ...gutterWithAvatar,\n visibility: 'hidden',\n // we use this hidden avatar just as a width placeholder\n // the placeholder is needed for responsive bubble width\n height: 0\n};\n\n/**\n * @private\n */\nexport const newMessageButtonStyle = mergeStyles({\n float: 'right',\n width: 'fit-content'\n});\n\n/**\n * @private\n */\nexport const buttonWithIconStyles: IButtonStyles = {\n textContainer: {\n display: 'contents'\n }\n};\n\n/**\n * @private\n */\nexport const loadPreviousMessageButtonStyle = mergeStyles({\n border: 'none',\n minHeight: '1.5rem',\n '&:hover': { background: 'none' },\n '&:active': { background: 'none' }\n});\n\n/**\n * @private\n */\nexport const DownIconStyle = mergeStyles({\n marginRight: '0.5em'\n});\n\n/** @private */\nexport const dataLossIconStyle = mergeStyles({\n width: '1.25rem',\n height: '1.25rem'\n});\n"]}
@@ -51,4 +51,8 @@ export declare const toAttachmentMetadata: (attachmentsWithProgress: AttachmentM
51
51
  * @internal
52
52
  */
53
53
  export declare const insertImagesToContentString: (content: string, imageUploadsInProgress?: AttachmentMetadataInProgress[]) => string;
54
+ /**
55
+ * @internal
56
+ */
57
+ export declare const removeBrokenImageContent: (content: string) => string;
54
58
  //# sourceMappingURL=SendBoxUtils.d.ts.map
@@ -120,4 +120,23 @@ export const insertImagesToContentString = (content, imageUploadsInProgress) =>
120
120
  const newContent = addUploadedImagesToMessage(content, imageUploadsInProgress);
121
121
  return newContent;
122
122
  };
123
+ /* @conditional-compile-remove(rich-text-editor-image-upload) */
124
+ /**
125
+ * @internal
126
+ */
127
+ export const removeBrokenImageContent = (content) => {
128
+ const document = new DOMParser().parseFromString(content, 'text/html');
129
+ document.querySelectorAll('img').forEach((img) => {
130
+ // Before submitting/resend the message, we need to trim the unnecessary attributes such as src,
131
+ // which is set to a local svg of a broken image icon at this point.
132
+ // Once message is submitted/resent, it will be fetched again and might not be a broken image anymore,
133
+ // That's why we need to remove the class and data-ui-id attribute of 'broken-image-wrapper'
134
+ if (img.className === 'broken-image-wrapper') {
135
+ img.removeAttribute('class');
136
+ img.removeAttribute('src');
137
+ img.removeAttribute('data-ui-id');
138
+ }
139
+ });
140
+ return document.body.innerHTML;
141
+ };
123
142
  //# sourceMappingURL=SendBoxUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SendBoxUtils.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/SendBoxUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAC9C,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAEpC,mDAAmD;AACnD;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAC5C,uBAAmE,EAC1D,EAAE;IACX,OAAO,CAAC,CAAC,CACP,CAAA,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,MAAM;QAC/B,CAAC,uBAAuB;aACrB,MAAM,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC;aACrD,KAAK,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAAC,gBAAgB,CAAC,QAAQ,KAAK,CAAC,IAAI,gBAAgB,CAAC,QAAQ,KAAK,SAAS,CAAC,CAC3G,CAA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W,CAAC,EAAE,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;AAEF,mDAAmD;AACnD;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,uBAAmE,EACjC,EAAE;IACpC,OAAO,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAC1B,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE;;QACtB,OAAO,CAAC,CAAC,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAA,MAAA,UAAU,CAAC,KAAK,0CAAE,OAAO,CAAA,CAAC;IAChE,CAAC,EACA,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;;QAClB,OAAO;YACL,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,GAAG,EAAE,MAAA,UAAU,CAAC,GAAG,mCAAI,EAAE;SAC1B,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,gEAAgE;AAChE;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,OAAe,EACf,sBAAuD,EAC/C,EAAE;IACV,IAAI,CAAC,sBAAsB,IAAI,sBAAsB,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QAClE,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,MAAM,UAAU,GAAG,0BAA0B,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC;IAC/E,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadataInProgress } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\n\n/**\n * @private\n */\nexport const MAXIMUM_LENGTH_OF_MESSAGE = 8000;\nconst EMPTY_MESSAGE_REGEX = /^\\s*$/;\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * @private\n */\nexport const hasIncompleteAttachmentUploads = (\n attachmentsWithProgress: AttachmentMetadataInProgress[] | undefined\n): boolean => {\n return !!(\n attachmentsWithProgress?.length &&\n !attachmentsWithProgress\n .filter((attachmentUpload) => !attachmentUpload.error)\n .every((attachmentUpload) => attachmentUpload.progress === 1 && attachmentUpload.progress !== undefined)\n );\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * @private\n */\nexport const isAttachmentUploadCompleted = (\n attachmentsWithProgress: AttachmentMetadataInProgress[] | undefined\n): boolean => {\n return !!attachmentsWithProgress?.find((attachment) => !attachment.error);\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\n// Before sending the image, we need to add the image id we get back after uploading the images to the message content.\nexport const addUploadedImagesToMessage = (\n message: string,\n uploadInlineImages: AttachmentMetadataInProgress[]\n): string => {\n if (message === '') {\n return message;\n }\n const document = new DOMParser().parseFromString(message ?? '', 'text/html');\n document.querySelectorAll('img').forEach((img) => {\n if (!img.id) {\n const uploadInlineImage = uploadInlineImages.find(\n (imageUpload) => !imageUpload.error && (imageUpload.url === img.src || imageUpload.id === img.id)\n );\n img.id = uploadInlineImage?.id ?? '';\n img.src = '';\n }\n });\n const newMessage = document.body.innerHTML;\n return newMessage;\n};\n\n/**\n * @private\n */\nexport const isMessageTooLong = (valueLength: number): boolean => {\n return valueLength > MAXIMUM_LENGTH_OF_MESSAGE;\n};\n\n/**\n * @private\n */\nexport const sanitizeText = (message: string): string => {\n if (EMPTY_MESSAGE_REGEX.test(message)) {\n return '';\n } else {\n return message;\n }\n};\n\n/**\n * Determines whether the send box should be disabled for ARIA accessibility.\n *\n * @param hasContent - Indicates whether the send box has content.\n * @param hasCompletedAttachmentUploads - Indicates whether attachment uploads have completed.\n * @param hasError - Indicates whether there is an error.\n * @param disabled - Indicates whether the send box is disabled.\n * @returns A boolean value indicating whether the send box should be disabled for ARIA accessibility.\n */\nexport const isSendBoxButtonAriaDisabled = ({\n hasContent,\n /* @conditional-compile-remove(file-sharing-acs) */\n hasCompletedAttachmentUploads,\n hasError,\n disabled\n}: {\n hasContent: boolean;\n /* @conditional-compile-remove(file-sharing-acs) */\n hasCompletedAttachmentUploads: boolean;\n hasError: boolean;\n disabled: boolean;\n}): boolean => {\n return (\n // no content\n !(hasContent || /* @conditional-compile-remove(file-sharing-acs) */ hasCompletedAttachmentUploads) ||\n //error message exists\n hasError ||\n disabled\n );\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const cancelInlineImageUpload = (\n imageSrcArray: string[] | undefined,\n imageUploadsInProgress: AttachmentMetadataInProgress[] | undefined,\n onCancelInlineImageUpload?: (id: string) => void\n): void => {\n if (imageSrcArray && imageUploadsInProgress && imageUploadsInProgress?.length > 0) {\n imageUploadsInProgress?.map((uploadImage) => {\n if (uploadImage.url && !imageSrcArray?.includes(uploadImage.url)) {\n onCancelInlineImageUpload?.(uploadImage.id);\n }\n });\n }\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * @internal\n */\nexport const toAttachmentMetadata = (\n attachmentsWithProgress: AttachmentMetadataInProgress[] | undefined\n): AttachmentMetadata[] | undefined => {\n return attachmentsWithProgress\n ?.filter((attachment) => {\n return !('error' in attachment) && !attachment.error?.message;\n })\n .map((attachment) => {\n return {\n id: attachment.id,\n name: attachment.name,\n url: attachment.url ?? ''\n };\n });\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const insertImagesToContentString = (\n content: string,\n imageUploadsInProgress?: AttachmentMetadataInProgress[]\n): string => {\n if (!imageUploadsInProgress || imageUploadsInProgress.length <= 0) {\n return content;\n }\n const newContent = addUploadedImagesToMessage(content, imageUploadsInProgress);\n return newContent;\n};\n"]}
1
+ {"version":3,"file":"SendBoxUtils.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/SendB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gEAAgE;AAChE;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,OAAe,EACf,sBAAuD,EAC/C,EAAE;IACV,IAAI,CAAC,sBAAsB,IAAI,sBAAsB,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QAClE,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,MAAM,UAAU,GAAG,0BAA0B,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC;IAC/E,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,gEAAgE;AAChE;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,OAAe,EAAU,EAAE;IAClE,MAAM,QAAQ,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACvE,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAC/C,gGAAgG;QAChG,oEAAoE;QACpE,sGAAsG;QACtG,4FAA4F;QAC5F,IAAI,GAAG,CAAC,SAAS,KAAK,sBAAsB,EAAE,CAAC;YAC7C,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YAC7B,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;YAC3B,GAAG,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;QACpC,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;AACjC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadataInProgress } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\n\n/**\n * @private\n */\nexport const MAXIMUM_LENGTH_OF_MESSAGE = 8000;\nconst EMPTY_MESSAGE_REGEX = /^\\s*$/;\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * @private\n */\nexport const hasIncompleteAttachmentUploads = (\n attachmentsWithProgress: AttachmentMetadataInProgress[] | undefined\n): boolean => {\n return !!(\n attachmentsWithProgress?.length &&\n !attachmentsWithProgress\n .filter((attachmentUpload) => !attachmentUpload.error)\n .every((attachmentUpload) => attachmentUpload.progress === 1 && attachmentUpload.progress !== undefined)\n );\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * @private\n */\nexport const isAttachmentUploadCompleted = (\n attachmentsWithProgress: AttachmentMetadataInProgress[] | undefined\n): boolean => {\n return !!attachmentsWithProgress?.find((attachment) => !attachment.error);\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\n// Before sending the image, we need to add the image id we get back after uploading the images to the message content.\nexport const addUploadedImagesToMessage = (\n message: string,\n uploadInlineImages: AttachmentMetadataInProgress[]\n): string => {\n if (message === '') {\n return message;\n }\n const document = new DOMParser().parseFromString(message ?? '', 'text/html');\n document.querySelectorAll('img').forEach((img) => {\n if (!img.id) {\n const uploadInlineImage = uploadInlineImages.find(\n (imageUpload) => !imageUpload.error && (imageUpload.url === img.src || imageUpload.id === img.id)\n );\n img.id = uploadInlineImage?.id ?? '';\n img.src = '';\n }\n });\n const newMessage = document.body.innerHTML;\n return newMessage;\n};\n\n/**\n * @private\n */\nexport const isMessageTooLong = (valueLength: number): boolean => {\n return valueLength > MAXIMUM_LENGTH_OF_MESSAGE;\n};\n\n/**\n * @private\n */\nexport const sanitizeText = (message: string): string => {\n if (EMPTY_MESSAGE_REGEX.test(message)) {\n return '';\n } else {\n return message;\n }\n};\n\n/**\n * Determines whether the send box should be disabled for ARIA accessibility.\n *\n * @param hasContent - Indicates whether the send box has content.\n * @param hasCompletedAttachmentUploads - Indicates whether attachment uploads have completed.\n * @param hasError - Indicates whether there is an error.\n * @param disabled - Indicates whether the send box is disabled.\n * @returns A boolean value indicating whether the send box should be disabled for ARIA accessibility.\n */\nexport const isSendBoxButtonAriaDisabled = ({\n hasContent,\n /* @conditional-compile-remove(file-sharing-acs) */\n hasCompletedAttachmentUploads,\n hasError,\n disabled\n}: {\n hasContent: boolean;\n /* @conditional-compile-remove(file-sharing-acs) */\n hasCompletedAttachmentUploads: boolean;\n hasError: boolean;\n disabled: boolean;\n}): boolean => {\n return (\n // no content\n !(hasContent || /* @conditional-compile-remove(file-sharing-acs) */ hasCompletedAttachmentUploads) ||\n //error message exists\n hasError ||\n disabled\n );\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const cancelInlineImageUpload = (\n imageSrcArray: string[] | undefined,\n imageUploadsInProgress: AttachmentMetadataInProgress[] | undefined,\n onCancelInlineImageUpload?: (id: string) => void\n): void => {\n if (imageSrcArray && imageUploadsInProgress && imageUploadsInProgress?.length > 0) {\n imageUploadsInProgress?.map((uploadImage) => {\n if (uploadImage.url && !imageSrcArray?.includes(uploadImage.url)) {\n onCancelInlineImageUpload?.(uploadImage.id);\n }\n });\n }\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * @internal\n */\nexport const toAttachmentMetadata = (\n attachmentsWithProgress: AttachmentMetadataInProgress[] | undefined\n): AttachmentMetadata[] | undefined => {\n return attachmentsWithProgress\n ?.filter((attachment) => {\n return !('error' in attachment) && !attachment.error?.message;\n })\n .map((attachment) => {\n return {\n id: attachment.id,\n name: attachment.name,\n url: attachment.url ?? ''\n };\n });\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const insertImagesToContentString = (\n content: string,\n imageUploadsInProgress?: AttachmentMetadataInProgress[]\n): string => {\n if (!imageUploadsInProgress || imageUploadsInProgress.length <= 0) {\n return content;\n }\n const newContent = addUploadedImagesToMessage(content, imageUploadsInProgress);\n return newContent;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const removeBrokenImageContent = (content: string): string => {\n const document = new DOMParser().parseFromString(content, 'text/html');\n document.querySelectorAll('img').forEach((img) => {\n // Before submitting/resend the message, we need to trim the unnecessary attributes such as src,\n // which is set to a local svg of a broken image icon at this point.\n // Once message is submitted/resent, it will be fetched again and might not be a broken image anymore,\n // That's why we need to remove the class and data-ui-id attribute of 'broken-image-wrapper'\n if (img.className === 'broken-image-wrapper') {\n img.removeAttribute('class');\n img.removeAttribute('src');\n img.removeAttribute('data-ui-id');\n }\n });\n return document.body.innerHTML;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/communication-react",
3
- "version": "1.18.0-alpha-202407162158",
3
+ "version": "1.18.0-alpha-202407170014",
4
4
  "sideEffects": false,
5
5
  "description": "React library for building modern communication user experiences utilizing Azure Communication Services",
6
6
  "keywords": [