@azure/communication-react 1.18.0-alpha-202406130013 → 1.18.0-alpha-202406150014
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-Armuv0sV.js → ChatMessageComponentAsRichTextEditBox-XMNUmuTx.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-Armuv0sV.js.map → ChatMessageComponentAsRichTextEditBox-XMNUmuTx.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-tA7MAdZl.js → RichTextSendBoxWrapper-BLmR8ku0.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-tA7MAdZl.js.map → RichTextSendBoxWrapper-BLmR8ku0.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-BGFUrfo5.js → index-CzkriUUT.js} +49 -36
- package/dist/dist-cjs/communication-react/index-CzkriUUT.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +3 -0
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.d.ts +2 -3
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js +31 -23
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +2 -2
- package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js +5 -2
- package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/styles/ParticipantContainer.styles.d.ts +7 -2
- package/dist/dist-esm/react-composites/src/composites/common/styles/ParticipantContainer.styles.js +4 -5
- package/dist/dist-esm/react-composites/src/composites/common/styles/ParticipantContainer.styles.js.map +1 -1
- package/package.json +1 -1
- package/dist/dist-cjs/communication-react/index-BGFUrfo5.js.map +0 -1
@@ -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-
|
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-202406150014';\n"]}
|
@@ -99,12 +99,15 @@ const generateLiveMessage = (props) => {
|
|
99
99
|
return `${props.message.editedOn ? props.strings.editedTag : ''} ${props.message.mine ? '' : liveAuthor} ${extractContentForAllyMessage(props)} `;
|
100
100
|
};
|
101
101
|
const messageContentAriaText = (props) => {
|
102
|
+
var _a, _b;
|
102
103
|
const message = extractContentForAllyMessage(props);
|
103
104
|
return props.message.mine
|
104
105
|
? _formatString(props.strings.messageContentMineAriaText, {
|
106
|
+
status: (_a = props.message.status) !== null && _a !== void 0 ? _a : '',
|
105
107
|
message: message
|
106
108
|
})
|
107
109
|
: _formatString(props.strings.messageContentAriaText, {
|
110
|
+
status: (_b = props.message.status) !== null && _b !== void 0 ? _b : '',
|
108
111
|
author: `${props.message.senderDisplayName}`,
|
109
112
|
message: message
|
110
113
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChatMessageContent.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/ChatMessage/ChatMessageContent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,sCAAgC;AACxD,OAAO,KAAK,EAAE,EAA0B,OAAO,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,OAAO,MAAM,eAAe,CAAC;AAIpC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAIvC,uDAAuD;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,0CAA0C;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,SAAS,MAAM,WAAW,CAAC;AAqDlC,eAAe;AACf,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAA8B,EAAe,EAAE;IAChF,QAAQ,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAClC,KAAK,MAAM;YACT,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAC;QACrC,KAAK,MAAM;YACT,OAAO,4BAA4B,CAAC,KAAK,CAAC,CAAC;QAC7C,KAAK,eAAe;YAClB,OAAO,4BAA4B,CAAC,KAAK,CAAC,CAAC;QAC7C;YACE,OAAO,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;YAC7C,OAAO,yCAAK,CAAC;IACjB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,0BAA0B,GAAG,CAAC,KAAsC,EAAe,EAAE;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AAM,SAAS,GAA2B;QACxC,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,GAAG;QACR,IAAI,EAAE,GAAG;QACT,EAAE,EAAE,GAAG;QACP,EAAE,EAAE,GAAG;KACR,CAAC;IAEF,OAAO,CACL,aAAa;QACX,gEAAgE;QAChE,2EAA2E;SAC1E,OAAO,CAAC,YAAY,EAAE,UAAU,KAAK,EAAE,MAAM;QAC5C,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC,CAAC;QACF,sCAAsC;QACtC,uFAAuF;QACvF,iDAAiD;SAChD,OAAO,CAAC,YAAY,EAAE,UAAU,KAAK,EAAE,MAAM;QAC5C,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACjC,OAAO,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC,CAAC,CACL,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport parse, { HTMLReactParserOptions, Element as DOMElement } from 'html-react-parser';\nimport { attributesToProps } from 'html-react-parser';\nimport Linkify from 'react-linkify';\nimport { ChatMessage } from '../../types/ChatMessage';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../types/ChatMessage';\nimport { Link } from '@fluentui/react';\n/* @conditional-compile-remove(mention) */\nimport { MentionDisplayOptions, Mention } from '../MentionPopover';\n\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { FontIcon, Stack } from '@fluentui/react';\nimport { MessageThreadStrings } from '../MessageThread';\nimport LiveMessage from '../Announcer/LiveMessage';\n/* @conditional-compile-remove(mention) */\nimport { defaultOnMentionRender } from './MentionRenderer';\nimport DOMPurify from 'dompurify';\nimport { _AttachmentDownloadCardsStrings } from '../Attachment/AttachmentDownloadCards';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\n\ntype ChatMessageContentProps = {\n message: ChatMessage;\n strings: MessageThreadStrings;\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions?: MentionDisplayOptions;\n inlineImageOptions?: InlineImageOptions;\n};\n\n/* @conditional-compile-remove(data-loss-prevention) */\ntype BlockedMessageContentProps = {\n message: BlockedMessage;\n strings: MessageThreadStrings;\n};\n\ntype MessageContentWithLiveAriaProps = {\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;\n liveMessage: string;\n ariaLabel?: string;\n content: JSX.Element;\n};\n\n/**\n * InlineImage's state, as reflected in the UI.\n *\n * @public\n */\nexport interface InlineImage {\n /** ID of the message that the inline image is belonged to */\n messageId: string;\n /** Attributes of the inline image */\n imageAttributes: React.ImgHTMLAttributes<HTMLImageElement>;\n}\n\n/**\n * Options to display inline image in the inline image scenario.\n *\n * @public\n */\nexport interface InlineImageOptions {\n /**\n * Optional callback to render an inline image of in a message.\n */\n onRenderInlineImage?: (\n inlineImage: InlineImage,\n defaultOnRender: (inlineImage: InlineImage) => JSX.Element\n ) => JSX.Element;\n}\n\n/** @private */\nexport const ChatMessageContent = (props: ChatMessageContentProps): JSX.Element => {\n switch (props.message.contentType) {\n case 'text':\n return MessageContentAsText(props);\n case 'html':\n return MessageContentAsRichTextHTML(props);\n case 'richtext/html':\n return MessageContentAsRichTextHTML(props);\n default:\n console.warn('unknown message content type');\n return <></>;\n }\n};\n\nconst MessageContentWithLiveAria = (props: MessageContentWithLiveAriaProps): JSX.Element => {\n return (\n <div data-ui-status={props.message.status} role=\"text\" aria-label={props.ariaLabel}>\n <LiveMessage message={props.liveMessage} ariaLive=\"polite\" />\n {props.content}\n </div>\n );\n};\n\nconst MessageContentAsRichTextHTML = (props: ChatMessageContentProps): JSX.Element => {\n return (\n <MessageContentWithLiveAria\n message={props.message}\n liveMessage={generateLiveMessage(props)}\n ariaLabel={messageContentAriaText(props)}\n content={processHtmlToReact(props)}\n />\n );\n};\n\nconst MessageContentAsText = (props: ChatMessageContentProps): JSX.Element => {\n return (\n <MessageContentWithLiveAria\n message={props.message}\n liveMessage={generateLiveMessage(props)}\n ariaLabel={messageContentAriaText(props)}\n content={\n <Linkify\n componentDecorator={(decoratedHref: string, decoratedText: string, key: number) => {\n return (\n <Link target=\"_blank\" href={decoratedHref} key={key}>\n {decoratedText}\n </Link>\n );\n }}\n >\n {props.message.content}\n </Linkify>\n }\n />\n );\n};\n\n/* @conditional-compile-remove(data-loss-prevention) */\n/**\n * @private\n */\nexport const BlockedMessageContent = (props: BlockedMessageContentProps): JSX.Element => {\n const Icon: JSX.Element = <FontIcon iconName={'DataLossPreventionProhibited'} />;\n const blockedMessage =\n props.message.warningText === undefined ? props.strings.blockedWarningText : props.message.warningText;\n const blockedMessageLink = props.message.link;\n const blockedMessageLinkText = blockedMessageLink\n ? props.message.linkText ?? props.strings.blockedWarningLinkText\n : '';\n\n const liveAuthor =\n props.message.mine || props.message.senderDisplayName === undefined ? '' : props.message.senderDisplayName;\n const liveBlockedWarningText = `${liveAuthor} ${blockedMessage} ${blockedMessageLinkText}`;\n return (\n <MessageContentWithLiveAria\n message={props.message}\n liveMessage={liveBlockedWarningText}\n ariaLabel={liveBlockedWarningText}\n content={\n <Stack horizontal wrap>\n {Icon}\n {blockedMessage && <p>{blockedMessage}</p>}\n {blockedMessageLink && (\n <Link target={'_blank'} href={blockedMessageLink}>\n {blockedMessageLinkText}\n </Link>\n )}\n </Stack>\n }\n />\n );\n};\n\nconst extractContentForAllyMessage = (props: ChatMessageContentProps): string => {\n let attachments = undefined;\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n attachments = props.message.attachments;\n if (props.message.content || attachments) {\n // Replace all <img> tags with 'image' for aria.\n const parsedContent = DOMPurify.sanitize(props.message.content ?? '', {\n ALLOWED_TAGS: ['img'],\n RETURN_DOM_FRAGMENT: true\n });\n\n parsedContent.childNodes.forEach((child) => {\n if (child.nodeName.toLowerCase() !== 'img') {\n return;\n }\n const imageTextNode = document.createElement('div');\n imageTextNode.innerHTML = 'image ';\n parsedContent.replaceChild(imageTextNode, child);\n });\n\n // Inject message attachment count for aria.\n // this is only applying to file attachments not for inline images.\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n if (attachments && attachments.length > 0) {\n const attachmentCardDescription = attachmentCardGroupDescription(props);\n const attachmentTextNode = document.createElement('div');\n attachmentTextNode.innerHTML = `${attachmentCardDescription}`;\n parsedContent.appendChild(attachmentTextNode);\n }\n\n // Strip all html tags from the content for aria.\n let message = DOMPurify.sanitize(parsedContent, { ALLOWED_TAGS: [] });\n // decode HTML entities so that screen reader can read the content properly.\n message = decodeEntities(message);\n return message;\n }\n return '';\n};\n\nconst generateLiveMessage = (props: ChatMessageContentProps): string => {\n const liveAuthor = _formatString(props.strings.liveAuthorIntro, { author: `${props.message.senderDisplayName}` });\n\n return `${props.message.editedOn ? props.strings.editedTag : ''} ${\n props.message.mine ? '' : liveAuthor\n } ${extractContentForAllyMessage(props)} `;\n};\n\nconst messageContentAriaText = (props: ChatMessageContentProps): string | undefined => {\n const message = extractContentForAllyMessage(props);\n return props.message.mine\n ? _formatString(props.strings.messageContentMineAriaText, {\n message: message\n })\n : _formatString(props.strings.messageContentAriaText, {\n author: `${props.message.senderDisplayName}`,\n message: message\n });\n};\n\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nconst attachmentCardGroupDescription = (props: ChatMessageContentProps): string => {\n const attachments = props.message.attachments;\n return getAttachmentCountLiveMessage(attachments ?? [], props.strings.attachmentCardGroupMessage);\n};\n\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n/**\n * @private\n */\nexport const getAttachmentCountLiveMessage = (\n attachments: AttachmentMetadata[],\n attachmentCardGroupMessage: string\n): string => {\n if (attachments.length === 0) {\n return '';\n }\n return _formatString(attachmentCardGroupMessage, {\n attachmentCount: `${attachments.length}`\n });\n return '';\n};\n\nconst defaultOnRenderInlineImage = (inlineImage: InlineImage): JSX.Element => {\n return (\n <img\n key={inlineImage.imageAttributes.id}\n tabIndex={0}\n data-ui-id={inlineImage.imageAttributes.id}\n {...inlineImage.imageAttributes}\n />\n );\n};\n\nconst processHtmlToReact = (props: ChatMessageContentProps): JSX.Element => {\n const options: HTMLReactParserOptions = {\n transform(reactNode, domNode) {\n if (domNode instanceof DOMElement && domNode.attribs) {\n // Transform custom rendering of mentions\n /* @conditional-compile-remove(mention) */\n if (domNode.name === 'msft-mention') {\n const { id } = domNode.attribs;\n const mention: Mention = {\n id: id,\n displayText: (domNode.children[0] as unknown as Text).nodeValue ?? ''\n };\n if (props.mentionDisplayOptions?.onRenderMention) {\n return props.mentionDisplayOptions.onRenderMention(mention, defaultOnMentionRender);\n }\n return defaultOnMentionRender(mention);\n }\n\n // Transform inline images\n if (domNode.name && domNode.name === 'img' && domNode.attribs && domNode.attribs.id) {\n domNode.attribs['aria-label'] = domNode.attribs.name;\n const imgProps = attributesToProps(domNode.attribs);\n const inlineImageProps: InlineImage = { messageId: props.message.messageId, imageAttributes: imgProps };\n\n return props.inlineImageOptions?.onRenderInlineImage\n ? props.inlineImageOptions.onRenderInlineImage(inlineImageProps, defaultOnRenderInlineImage)\n : defaultOnRenderInlineImage(inlineImageProps);\n }\n\n // Transform links to open in new tab\n if (domNode.name === 'a' && React.isValidElement<React.AnchorHTMLAttributes<HTMLAnchorElement>>(reactNode)) {\n return React.cloneElement(reactNode, {\n target: '_blank',\n rel: 'noreferrer noopener'\n });\n }\n }\n // Pass through the original node\n return reactNode as unknown as JSX.Element;\n }\n };\n return <>{parse(props.message.content ?? '', options)}</>;\n};\n\nconst decodeEntities = (encodedString: string): string => {\n // This regular expression matches HTML entities.\n const translate_re = /&(nbsp|amp|quot|lt|gt);/g;\n // This object maps HTML entities to their respective characters.\n const translate: Record<string, string> = {\n nbsp: ' ',\n amp: '&',\n quot: '\"',\n lt: '<',\n gt: '>'\n };\n\n return (\n encodedString\n // Find all matches of HTML entities defined in translate_re and\n // replace them with the corresponding character from the translate object.\n .replace(translate_re, function (match, entity) {\n return translate[entity];\n })\n // Find numeric entities (e.g., A)\n // and replace them with the equivalent character using the String.fromCharCode method,\n // which converts Unicode values into characters.\n .replace(/&#(\\d+);/gi, function (match, numStr) {\n const num = parseInt(numStr, 10);\n return String.fromCharCode(num);\n })\n );\n};\n"]}
|
1
|
+
{"version":3,"file":"ChatMessageContent.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/ChatMessage/ChatMessageContent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,sCAAgC;AACxD,OAAO,KAAK,EAAE,EAA0B,OAAO,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,OAAO,MAAM,eAAe,CAAC;AAIpC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAIvC,uDAAuD;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,0CAA0C;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,SAAS,MAAM,WAAW,CAAC;AAqDlC,eAAe;AACf,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAA8B,EAAe,EAAE;IAChF,QAAQ,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAClC,KAAK,MAAM;YACT,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAC;QACrC,KAAK,MAAM;YACT,OAAO,4BAA4B,CAAC,KAAK,CAAC,CAAC;QAC7C,KAAK,eAAe;Y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AAC;gBACL,CAAC;YACH,CAAC;YACD,iCAAiC;YACjC,OAAO,SAAmC,CAAC;QAC7C,CAAC;KACF,CAAC;IACF,OAAO,0CAAG,KAAK,CAAC,MAAA,KAAK,CAAC,OAAO,CAAC,OAAO,mCAAI,EAAE,EAAE,OAAO,CAAC,CAAI,CAAC;AAC5D,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,aAAqB,EAAU,EAAE;IACvD,iDAAiD;IACjD,MAAM,YAAY,GAAG,0BAA0B,CAAC;IAChD,iEAAiE;IACjE,MAAM,SAAS,GAA2B;QACxC,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,GAAG;QACR,IAAI,EAAE,GAAG;QACT,EAAE,EAAE,GAAG;QACP,EAAE,EAAE,GAAG;KACR,CAAC;IAEF,OAAO,CACL,aAAa;QACX,gEAAgE;QAChE,2EAA2E;SAC1E,OAAO,CAAC,YAAY,EAAE,UAAU,KAAK,EAAE,MAAM;QAC5C,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC,CAAC;QACF,sCAAsC;QACtC,uFAAuF;QACvF,iDAAiD;SAChD,OAAO,CAAC,YAAY,EAAE,UAAU,KAAK,EAAE,MAAM;QAC5C,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACjC,OAAO,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC,CAAC,CACL,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport parse, { HTMLReactParserOptions, Element as DOMElement } from 'html-react-parser';\nimport { attributesToProps } from 'html-react-parser';\nimport Linkify from 'react-linkify';\nimport { ChatMessage } from '../../types/ChatMessage';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../types/ChatMessage';\nimport { Link } from '@fluentui/react';\n/* @conditional-compile-remove(mention) */\nimport { MentionDisplayOptions, Mention } from '../MentionPopover';\n\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { FontIcon, Stack } from '@fluentui/react';\nimport { MessageThreadStrings } from '../MessageThread';\nimport LiveMessage from '../Announcer/LiveMessage';\n/* @conditional-compile-remove(mention) */\nimport { defaultOnMentionRender } from './MentionRenderer';\nimport DOMPurify from 'dompurify';\nimport { _AttachmentDownloadCardsStrings } from '../Attachment/AttachmentDownloadCards';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\n\ntype ChatMessageContentProps = {\n message: ChatMessage;\n strings: MessageThreadStrings;\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions?: MentionDisplayOptions;\n inlineImageOptions?: InlineImageOptions;\n};\n\n/* @conditional-compile-remove(data-loss-prevention) */\ntype BlockedMessageContentProps = {\n message: BlockedMessage;\n strings: MessageThreadStrings;\n};\n\ntype MessageContentWithLiveAriaProps = {\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;\n liveMessage: string;\n ariaLabel?: string;\n content: JSX.Element;\n};\n\n/**\n * InlineImage's state, as reflected in the UI.\n *\n * @public\n */\nexport interface InlineImage {\n /** ID of the message that the inline image is belonged to */\n messageId: string;\n /** Attributes of the inline image */\n imageAttributes: React.ImgHTMLAttributes<HTMLImageElement>;\n}\n\n/**\n * Options to display inline image in the inline image scenario.\n *\n * @public\n */\nexport interface InlineImageOptions {\n /**\n * Optional callback to render an inline image of in a message.\n */\n onRenderInlineImage?: (\n inlineImage: InlineImage,\n defaultOnRender: (inlineImage: InlineImage) => JSX.Element\n ) => JSX.Element;\n}\n\n/** @private */\nexport const ChatMessageContent = (props: ChatMessageContentProps): JSX.Element => {\n switch (props.message.contentType) {\n case 'text':\n return MessageContentAsText(props);\n case 'html':\n return MessageContentAsRichTextHTML(props);\n case 'richtext/html':\n return MessageContentAsRichTextHTML(props);\n default:\n console.warn('unknown message content type');\n return <></>;\n }\n};\n\nconst MessageContentWithLiveAria = (props: MessageContentWithLiveAriaProps): JSX.Element => {\n return (\n <div data-ui-status={props.message.status} role=\"text\" aria-label={props.ariaLabel}>\n <LiveMessage message={props.liveMessage} ariaLive=\"polite\" />\n {props.content}\n </div>\n );\n};\n\nconst MessageContentAsRichTextHTML = (props: ChatMessageContentProps): JSX.Element => {\n return (\n <MessageContentWithLiveAria\n message={props.message}\n liveMessage={generateLiveMessage(props)}\n ariaLabel={messageContentAriaText(props)}\n content={processHtmlToReact(props)}\n />\n );\n};\n\nconst MessageContentAsText = (props: ChatMessageContentProps): JSX.Element => {\n return (\n <MessageContentWithLiveAria\n message={props.message}\n liveMessage={generateLiveMessage(props)}\n ariaLabel={messageContentAriaText(props)}\n content={\n <Linkify\n componentDecorator={(decoratedHref: string, decoratedText: string, key: number) => {\n return (\n <Link target=\"_blank\" href={decoratedHref} key={key}>\n {decoratedText}\n </Link>\n );\n }}\n >\n {props.message.content}\n </Linkify>\n }\n />\n );\n};\n\n/* @conditional-compile-remove(data-loss-prevention) */\n/**\n * @private\n */\nexport const BlockedMessageContent = (props: BlockedMessageContentProps): JSX.Element => {\n const Icon: JSX.Element = <FontIcon iconName={'DataLossPreventionProhibited'} />;\n const blockedMessage =\n props.message.warningText === undefined ? props.strings.blockedWarningText : props.message.warningText;\n const blockedMessageLink = props.message.link;\n const blockedMessageLinkText = blockedMessageLink\n ? props.message.linkText ?? props.strings.blockedWarningLinkText\n : '';\n\n const liveAuthor =\n props.message.mine || props.message.senderDisplayName === undefined ? '' : props.message.senderDisplayName;\n const liveBlockedWarningText = `${liveAuthor} ${blockedMessage} ${blockedMessageLinkText}`;\n return (\n <MessageContentWithLiveAria\n message={props.message}\n liveMessage={liveBlockedWarningText}\n ariaLabel={liveBlockedWarningText}\n content={\n <Stack horizontal wrap>\n {Icon}\n {blockedMessage && <p>{blockedMessage}</p>}\n {blockedMessageLink && (\n <Link target={'_blank'} href={blockedMessageLink}>\n {blockedMessageLinkText}\n </Link>\n )}\n </Stack>\n }\n />\n );\n};\n\nconst extractContentForAllyMessage = (props: ChatMessageContentProps): string => {\n let attachments = undefined;\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n attachments = props.message.attachments;\n if (props.message.content || attachments) {\n // Replace all <img> tags with 'image' for aria.\n const parsedContent = DOMPurify.sanitize(props.message.content ?? '', {\n ALLOWED_TAGS: ['img'],\n RETURN_DOM_FRAGMENT: true\n });\n\n parsedContent.childNodes.forEach((child) => {\n if (child.nodeName.toLowerCase() !== 'img') {\n return;\n }\n const imageTextNode = document.createElement('div');\n imageTextNode.innerHTML = 'image ';\n parsedContent.replaceChild(imageTextNode, child);\n });\n\n // Inject message attachment count for aria.\n // this is only applying to file attachments not for inline images.\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n if (attachments && attachments.length > 0) {\n const attachmentCardDescription = attachmentCardGroupDescription(props);\n const attachmentTextNode = document.createElement('div');\n attachmentTextNode.innerHTML = `${attachmentCardDescription}`;\n parsedContent.appendChild(attachmentTextNode);\n }\n\n // Strip all html tags from the content for aria.\n let message = DOMPurify.sanitize(parsedContent, { ALLOWED_TAGS: [] });\n // decode HTML entities so that screen reader can read the content properly.\n message = decodeEntities(message);\n return message;\n }\n return '';\n};\n\nconst generateLiveMessage = (props: ChatMessageContentProps): string => {\n const liveAuthor = _formatString(props.strings.liveAuthorIntro, { author: `${props.message.senderDisplayName}` });\n\n return `${props.message.editedOn ? props.strings.editedTag : ''} ${\n props.message.mine ? '' : liveAuthor\n } ${extractContentForAllyMessage(props)} `;\n};\n\nconst messageContentAriaText = (props: ChatMessageContentProps): string | undefined => {\n const message = extractContentForAllyMessage(props);\n return props.message.mine\n ? _formatString(props.strings.messageContentMineAriaText, {\n status: props.message.status ?? '',\n message: message\n })\n : _formatString(props.strings.messageContentAriaText, {\n status: props.message.status ?? '',\n author: `${props.message.senderDisplayName}`,\n message: message\n });\n};\n\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nconst attachmentCardGroupDescription = (props: ChatMessageContentProps): string => {\n const attachments = props.message.attachments;\n return getAttachmentCountLiveMessage(attachments ?? [], props.strings.attachmentCardGroupMessage);\n};\n\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n/**\n * @private\n */\nexport const getAttachmentCountLiveMessage = (\n attachments: AttachmentMetadata[],\n attachmentCardGroupMessage: string\n): string => {\n if (attachments.length === 0) {\n return '';\n }\n return _formatString(attachmentCardGroupMessage, {\n attachmentCount: `${attachments.length}`\n });\n return '';\n};\n\nconst defaultOnRenderInlineImage = (inlineImage: InlineImage): JSX.Element => {\n return (\n <img\n key={inlineImage.imageAttributes.id}\n tabIndex={0}\n data-ui-id={inlineImage.imageAttributes.id}\n {...inlineImage.imageAttributes}\n />\n );\n};\n\nconst processHtmlToReact = (props: ChatMessageContentProps): JSX.Element => {\n const options: HTMLReactParserOptions = {\n transform(reactNode, domNode) {\n if (domNode instanceof DOMElement && domNode.attribs) {\n // Transform custom rendering of mentions\n /* @conditional-compile-remove(mention) */\n if (domNode.name === 'msft-mention') {\n const { id } = domNode.attribs;\n const mention: Mention = {\n id: id,\n displayText: (domNode.children[0] as unknown as Text).nodeValue ?? ''\n };\n if (props.mentionDisplayOptions?.onRenderMention) {\n return props.mentionDisplayOptions.onRenderMention(mention, defaultOnMentionRender);\n }\n return defaultOnMentionRender(mention);\n }\n\n // Transform inline images\n if (domNode.name && domNode.name === 'img' && domNode.attribs && domNode.attribs.id) {\n domNode.attribs['aria-label'] = domNode.attribs.name;\n const imgProps = attributesToProps(domNode.attribs);\n const inlineImageProps: InlineImage = { messageId: props.message.messageId, imageAttributes: imgProps };\n\n return props.inlineImageOptions?.onRenderInlineImage\n ? props.inlineImageOptions.onRenderInlineImage(inlineImageProps, defaultOnRenderInlineImage)\n : defaultOnRenderInlineImage(inlineImageProps);\n }\n\n // Transform links to open in new tab\n if (domNode.name === 'a' && React.isValidElement<React.AnchorHTMLAttributes<HTMLAnchorElement>>(reactNode)) {\n return React.cloneElement(reactNode, {\n target: '_blank',\n rel: 'noreferrer noopener'\n });\n }\n }\n // Pass through the original node\n return reactNode as unknown as JSX.Element;\n }\n };\n return <>{parse(props.message.content ?? '', options)}</>;\n};\n\nconst decodeEntities = (encodedString: string): string => {\n // This regular expression matches HTML entities.\n const translate_re = /&(nbsp|amp|quot|lt|gt);/g;\n // This object maps HTML entities to their respective characters.\n const translate: Record<string, string> = {\n nbsp: ' ',\n amp: '&',\n quot: '\"',\n lt: '<',\n gt: '>'\n };\n\n return (\n encodedString\n // Find all matches of HTML entities defined in translate_re and\n // replace them with the corresponding character from the translate object.\n .replace(translate_re, function (match, entity) {\n return translate[entity];\n })\n // Find numeric entities (e.g., A)\n // and replace them with the equivalent character using the String.fromCharCode method,\n // which converts Unicode values into characters.\n .replace(/&#(\\d+);/gi, function (match, numStr) {\n const num = parseInt(numStr, 10);\n return String.fromCharCode(num);\n })\n );\n};\n"]}
|
package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.d.ts
CHANGED
@@ -18,9 +18,8 @@ export default class CopyPastePlugin implements EditorPlugin {
|
|
18
18
|
*/
|
19
19
|
export declare const removeImageElement: (event: BeforePasteEvent) => void;
|
20
20
|
/**
|
21
|
-
*
|
21
|
+
* Update the scroll position of the editor after pasting content to ensure the content is visible.
|
22
22
|
* @param event - The plugin event.
|
23
|
-
* @param editor - The editor instance.
|
24
23
|
*/
|
25
|
-
export declare const scrollToBottomAfterContentPaste: (event: PluginEvent
|
24
|
+
export declare const scrollToBottomAfterContentPaste: (event: PluginEvent) => void;
|
26
25
|
//# sourceMappingURL=CopyPastePlugin.d.ts.map
|
package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js
CHANGED
@@ -17,7 +17,7 @@ export default class CopyPastePlugin {
|
|
17
17
|
handleBeforePasteEvent(event, /* @conditional-compile-remove(rich-text-editor-image-upload) */ this.onPaste);
|
18
18
|
if (this.editor !== null && !this.editor.isDisposed()) {
|
19
19
|
// scroll the editor to the correct position after pasting content
|
20
|
-
scrollToBottomAfterContentPaste(event
|
20
|
+
scrollToBottomAfterContentPaste(event);
|
21
21
|
}
|
22
22
|
}
|
23
23
|
}
|
@@ -53,33 +53,41 @@ export const removeImageElement = (event) => {
|
|
53
53
|
}
|
54
54
|
};
|
55
55
|
/**
|
56
|
-
*
|
56
|
+
* Update the scroll position of the editor after pasting content to ensure the content is visible.
|
57
57
|
* @param event - The plugin event.
|
58
|
-
* @param editor - The editor instance.
|
59
58
|
*/
|
60
|
-
export const scrollToBottomAfterContentPaste = (event
|
59
|
+
export const scrollToBottomAfterContentPaste = (event) => {
|
61
60
|
if (event.eventType === PluginEventType.ContentChanged && event.source === ContentChangedEventSource.Paste) {
|
62
|
-
|
63
|
-
// get current selection for the editor
|
61
|
+
// Get the current selection in the document
|
64
62
|
const selection = document.getSelection();
|
65
|
-
// if selection exists
|
66
|
-
if (selection
|
67
|
-
//
|
68
|
-
|
69
|
-
// the selection position relative to the viewport
|
70
|
-
const cursorRect = range.getBoundingClientRect();
|
71
|
-
// the scrollContainer position relative to the viewport
|
72
|
-
const scrollContainerRect = scrollContainer.getBoundingClientRect();
|
73
|
-
// 1. scrollContainer.scrollTop represents the number of pixels that the content of scrollContainer is scrolled upward.
|
74
|
-
// 2. subtract the top position of the scrollContainer element (scrollContainerRect.top) to
|
75
|
-
// translate the scroll position from being relative to the document to being relative to the viewport.
|
76
|
-
// 3. add the top position of the cursor (containerRect.top) to moves the scroll position to the cursor's position.
|
77
|
-
const updatedScrollTop = scrollContainer.scrollTop - scrollContainerRect.top + cursorRect.top;
|
78
|
-
scrollContainer.scrollTo({
|
79
|
-
top: updatedScrollTop,
|
80
|
-
behavior: 'smooth'
|
81
|
-
});
|
63
|
+
// Check if a selection exists and it has at least one range
|
64
|
+
if (!selection || selection.rangeCount <= 0) {
|
65
|
+
// If no selection or range, exit the function
|
66
|
+
return;
|
82
67
|
}
|
68
|
+
// Get the first range of the selection
|
69
|
+
// A user can normally only select one range at a time, so the rangeCount will usually be 1
|
70
|
+
const range = selection.getRangeAt(0);
|
71
|
+
// If the common ancestor container of the range is the document itself,
|
72
|
+
// it might mean that the editable element is getting removed from the DOM
|
73
|
+
// In such cases, especially in Safari, trying to modify the range might throw a HierarchyRequest error
|
74
|
+
if (range.commonAncestorContainer === document) {
|
75
|
+
return;
|
76
|
+
}
|
77
|
+
// Create a temporary span element to use as an anchor for scrolling
|
78
|
+
// We can't use the anchor node directly because if it's a Text node, calling scrollIntoView() on it will throw an error
|
79
|
+
const tempElement = document.createElement('span');
|
80
|
+
// Collapse the range to its end point
|
81
|
+
// This means the start and end points of the range will be the same, and it will not contain any content
|
82
|
+
range.collapse(false);
|
83
|
+
// Insert the temporary element at the cursor's position at the end of the range
|
84
|
+
range.insertNode(tempElement);
|
85
|
+
// Scroll the temporary element into view
|
86
|
+
// the element will be aligned at the center of the scroll container, otherwise, text and images may be positioned incorrectly
|
87
|
+
tempElement.scrollIntoView({
|
88
|
+
block: 'center'
|
89
|
+
});
|
90
|
+
tempElement.remove();
|
83
91
|
}
|
84
92
|
};
|
85
93
|
//# sourceMappingURL=CopyPastePlugin.js.map
|
package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CopyPastePlugin.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAE7F;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAApC;QACU,WAAM,GAAmB,IAAI,CAAC;IAuBxC,CAAC;IAlBC,OAAO;QACL,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,UAAU,CAAC,MAAe;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,OAAO,KAAU,CAAC;IAElB,aAAa,CAAC,KAAkB;QAC9B,sBAAsB,CAAC,KAAK,EAAE,gEAAgE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE7G,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC;YACtD,kEAAkE;YAClE,+BAA+B,CAAC,KAAK,
|
1
|
+
{"version":3,"file":"CopyPastePlugin.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAE7F;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAApC;QACU,WAAM,GAAmB,IAAI,CAAC;IAuBxC,CAAC;IAlBC,OAAO;QACL,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,UAAU,CAAC,MAAe;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,OAAO,KAAU,CAAC;IAElB,aAAa,CAAC,KAAkB;QAC9B,sBAAsB,CAAC,KAAK,EAAE,gEAAgE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE7G,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC;YACtD,kEAAkE;YAClE,+BAA+B,CAAC,KAAK,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;CACF;AAED,MAAM,sBAAsB,GAAG,CAC7B,KAAkB;AAClB,gEAAgE,CAAC,OAEvD,EACJ,EAAE;IACR,IAAI,KAAK,CAAC,SAAS,KAAK,eAAe,CAAC,WAAW,IAAI,KAAK,CAAC,S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AS,CAAC,UAAU,IAAI,CAAC,EAAE,CAAC;YAC5C,8CAA8C;YAC9C,OAAO;QACT,CAAC;QAED,uCAAuC;QACvC,2FAA2F;QAC3F,MAAM,KAAK,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAEtC,wEAAwE;QACxE,0EAA0E;QAC1E,uGAAuG;QACvG,IAAI,KAAK,CAAC,uBAAuB,KAAK,QAAQ,EAAE,CAAC;YAC/C,OAAO;QACT,CAAC;QAED,oEAAoE;QACpE,wHAAwH;QACxH,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACnD,sCAAsC;QACtC,yGAAyG;QACzG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACtB,gFAAgF;QAChF,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAE9B,yCAAyC;QACzC,8HAA8H;QAC9H,WAAW,CAAC,cAAc,CAAC;YACzB,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAC;QACH,WAAW,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { PluginEvent, EditorPlugin, IEditor, BeforePasteEvent } from 'roosterjs-content-model-types';\nimport { ContentChangedEventSource, PluginEventType } from '../../utils/RichTextEditorUtils';\n\n/**\n * CopyPastePlugin is a plugin for handling copy and paste events in the editor.\n */\nexport default class CopyPastePlugin implements EditorPlugin {\n private editor: IEditor | null = null;\n // don't set value in constructor to be able to update it without plugin recreation\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste?: (event: { content: DocumentFragment }) => void;\n\n getName(): string {\n return 'CopyPastePlugin';\n }\n\n initialize(editor: IEditor): void {\n this.editor = editor;\n }\n\n dispose(): void {}\n\n onPluginEvent(event: PluginEvent): void {\n handleBeforePasteEvent(event, /* @conditional-compile-remove(rich-text-editor-image-upload) */ this.onPaste);\n\n if (this.editor !== null && !this.editor.isDisposed()) {\n // scroll the editor to the correct position after pasting content\n scrollToBottomAfterContentPaste(event);\n }\n }\n}\n\nconst handleBeforePasteEvent = (\n event: PluginEvent,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ onPaste?: (event: {\n content: DocumentFragment;\n }) => void\n): void => {\n if (event.eventType === PluginEventType.BeforePaste && event.pasteType === 'normal') {\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste?.({ content: event.fragment });\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n return;\n\n // the initial behavior\n // removes inline image elements from the pasted content when rich-text-editor-image-upload not available\n removeImageElement(event as BeforePasteEvent);\n }\n};\n\n/**\n * @internal\n * Exported only for unit testing\n */\nexport const removeImageElement = (event: BeforePasteEvent): void => {\n // We don't support the pasting options such as paste as image yet.\n if (event.pasteType === 'normal') {\n event.fragment.querySelectorAll('img').forEach((image) => {\n // If the image is the only child of its parent, remove all the parents of this img element.\n let parentNode: HTMLElement | null = image.parentElement;\n let currentNode: HTMLElement = image;\n while (parentNode?.childNodes.length === 1) {\n currentNode = parentNode;\n parentNode = parentNode.parentElement;\n }\n currentNode?.remove();\n });\n }\n};\n\n/**\n * Update the scroll position of the editor after pasting content to ensure the content is visible.\n * @param event - The plugin event.\n */\nexport const scrollToBottomAfterContentPaste = (event: PluginEvent): void => {\n if (event.eventType === PluginEventType.ContentChanged && event.source === ContentChangedEventSource.Paste) {\n // Get the current selection in the document\n const selection = document.getSelection();\n\n // Check if a selection exists and it has at least one range\n if (!selection || selection.rangeCount <= 0) {\n // If no selection or range, exit the function\n return;\n }\n\n // Get the first range of the selection\n // A user can normally only select one range at a time, so the rangeCount will usually be 1\n const range = selection.getRangeAt(0);\n\n // If the common ancestor container of the range is the document itself,\n // it might mean that the editable element is getting removed from the DOM\n // In such cases, especially in Safari, trying to modify the range might throw a HierarchyRequest error\n if (range.commonAncestorContainer === document) {\n return;\n }\n\n // Create a temporary span element to use as an anchor for scrolling\n // We can't use the anchor node directly because if it's a Text node, calling scrollIntoView() on it will throw an error\n const tempElement = document.createElement('span');\n // Collapse the range to its end point\n // This means the start and end points of the range will be the same, and it will not contain any content\n range.collapse(false);\n // Insert the temporary element at the cursor's position at the end of the range\n range.insertNode(tempElement);\n\n // Scroll the temporary element into view\n // the element will be aligned at the center of the scroll container, otherwise, text and images may be positioned incorrectly\n tempElement.scrollIntoView({\n block: 'center'\n });\n tempElement.remove();\n }\n};\n"]}
|
@@ -185,8 +185,8 @@
|
|
185
185
|
"failToSendTag": "Failed to send",
|
186
186
|
"editedTag": "Edited",
|
187
187
|
"liveAuthorIntro": "{author} says",
|
188
|
-
"messageContentAriaText": "{author} said {message}",
|
189
|
-
"messageContentMineAriaText": "You said {message}",
|
188
|
+
"messageContentAriaText": "{status} {author} said {message}",
|
189
|
+
"messageContentMineAriaText": "{status} You said {message}",
|
190
190
|
"editBoxTextLimit": "Your message is over the limit of {limitNumber} characters",
|
191
191
|
"editBoxPlaceholderText": "Edit your message",
|
192
192
|
"newMessagesIndicator": "New messages",
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import React, { useMemo } from 'react';
|
4
4
|
import { participantListContainerStyle, participantListMobileStyle, participantListStack, participantListStyle, participantListWrapper, displayNameStyles, headingMoreButtonStyles } from './styles/ParticipantContainer.styles';
|
5
5
|
import { ParticipantList } from "../../../../react-components/src";
|
6
|
-
import { FocusZone, Stack, Text, useTheme } from '@fluentui/react';
|
6
|
+
import { FocusZone, Stack, Text, TooltipHost, TooltipOverflowMode, getId, useTheme } from '@fluentui/react';
|
7
7
|
import { DefaultButton } from '@fluentui/react';
|
8
8
|
import { AvatarPersona } from './AvatarPersona';
|
9
9
|
import { useId } from '@fluentui/react-hooks';
|
@@ -26,6 +26,7 @@ export const ParticipantListWithHeading = (props) => {
|
|
26
26
|
const theme = useTheme();
|
27
27
|
/* @conditional-compile-remove(total-participant-count) */
|
28
28
|
const totalParticipantCount = participantListProps.totalParticipantCount;
|
29
|
+
const tooltipId = getId('text-tooltip');
|
29
30
|
const subheadingStyleThemed = useMemo(() => ({
|
30
31
|
root: {
|
31
32
|
color: theme.palette.neutralSecondary,
|
@@ -43,7 +44,9 @@ export const ParticipantListWithHeading = (props) => {
|
|
43
44
|
React.createElement(FocusZone, { className: participantListContainerStyle, shouldFocusOnMount: true },
|
44
45
|
React.createElement(ParticipantList, Object.assign({}, participantListProps, { pinnedParticipants: pinnedParticipants, styles: props.isMobile ? participantListMobileStyle : participantListStyle, onRenderAvatar: (userId, options) => (React.createElement(React.Fragment, null,
|
45
46
|
React.createElement(AvatarPersona, Object.assign({ "data-ui-id": "chat-composite-participant-custom-avatar", userId: userId }, options, { hidePersonaDetails: !!(options === null || options === void 0 ? void 0 : options.text), dataProvider: onFetchAvatarPersonaData, allowActiveBorder: true })),
|
46
|
-
(options === null || options === void 0 ? void 0 : options.text) && (React.createElement(
|
47
|
+
(options === null || options === void 0 ? void 0 : options.text) && (React.createElement("div", { style: displayNameStyles },
|
48
|
+
React.createElement(TooltipHost, { content: options === null || options === void 0 ? void 0 : options.text, id: tooltipId, overflowMode: TooltipOverflowMode.Parent },
|
49
|
+
React.createElement(Text, { nowrap: false, "aria-labelledby": tooltipId }, options === null || options === void 0 ? void 0 : options.text)))))), onFetchParticipantMenuItems: onFetchParticipantMenuItems, showParticipantOverflowTooltip: !props.isMobile, participantAriaLabelledBy: subheadingUniqueId })))));
|
47
50
|
};
|
48
51
|
const paneTitleTrampoline = (paneTitle, totalParticipantCount) => {
|
49
52
|
const participantCountString = totalParticipantCount
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ParticipantContainer.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/common/ParticipantContainer.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAsD,yCAAmC;AACjH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"ParticipantContainer.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/common/ParticipantContainer.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAsD,yCAAmC;AACjH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,mBAAmB,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC5G,OAAO,EAAE,aAAa,EAAwB,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,aAAa,EAA6B,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,sCAAgC;AAUxD;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAgC,EAAe,EAAE;IACpF,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,+BAA+B,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9F,OAAO,CACL,oBAAC,KAAK,IAAC,SAAS,EAAE,+BAA+B;QAC/C,oBAAC,0BAA0B,oBAAK,KAA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iB;wBAC3B,oBAAC,WAAW,IAAC,OAAO,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,CAAC,MAAM;4BAC1F,oBAAC,IAAI,IAAC,MAAM,EAAE,KAAK,qBAAmB,SAAS,IAC5C,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CACT,CACK,CACV,CACP,CACA,CACJ,EACD,2BAA2B,EAAE,2BAA2B,EACxD,8BAA8B,EAAE,CAAC,KAAK,CAAC,QAAQ,EAC/C,yBAAyB,EAAE,kBAAkB,IAC7C,CACQ,CACN,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,SAAiB,EAAE,qBAA8B,EAAU,EAAE;IACxF,MAAM,sBAAsB,GAAG,qBAAqB;QAClD,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,qBAAqB,GAAG,EAAE;QAClD,CAAC,CAAC,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC;IAC5B,OAAO,aAAa,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;AAC1D,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useMemo } from 'react';\nimport {\n participantListContainerStyle,\n participantListMobileStyle,\n participantListStack,\n participantListStyle,\n participantListWrapper,\n displayNameStyles,\n headingMoreButtonStyles\n} from './styles/ParticipantContainer.styles';\nimport { ParticipantList, ParticipantListProps, ParticipantMenuItemsCallback } from '@internal/react-components';\nimport { FocusZone, Stack, Text, TooltipHost, TooltipOverflowMode, getId, useTheme } from '@fluentui/react';\nimport { DefaultButton, IContextualMenuProps } from '@fluentui/react';\nimport { AvatarPersona, AvatarPersonaDataCallback } from './AvatarPersona';\nimport { useId } from '@fluentui/react-hooks';\nimport { _formatString } from '@internal/acs-ui-common';\n\ntype ParticipantContainerProps = {\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n participantListProps: ParticipantListProps;\n title?: string;\n isMobile?: boolean;\n};\n\n/**\n * @private\n */\nexport const ParticipantContainer = (props: ParticipantContainerProps): JSX.Element => {\n const theme = useTheme();\n const participantListWrapperClassName = useMemo(() => participantListWrapper(theme), [theme]);\n return (\n <Stack className={participantListWrapperClassName}>\n <ParticipantListWithHeading {...props} />\n </Stack>\n );\n};\n\n/**\n * @private\n */\nexport const ParticipantListWithHeading = (props: {\n participantListProps: ParticipantListProps;\n title?: string;\n isMobile?: boolean;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n headingMoreButtonAriaLabel?: string;\n onClickHeadingMoreButton?: () => void;\n headingMoreButtonMenuProps?: IContextualMenuProps;\n pinnedParticipants?: string[];\n}): JSX.Element => {\n const {\n onFetchAvatarPersonaData,\n onFetchParticipantMenuItems,\n title,\n participantListProps,\n headingMoreButtonAriaLabel,\n onClickHeadingMoreButton,\n headingMoreButtonMenuProps,\n pinnedParticipants\n } = props;\n const subheadingUniqueId = useId();\n const theme = useTheme();\n /* @conditional-compile-remove(total-participant-count) */\n const totalParticipantCount = participantListProps.totalParticipantCount;\n const tooltipId: string = getId('text-tooltip');\n const subheadingStyleThemed = useMemo(\n () => ({\n root: {\n color: theme.palette.neutralSecondary,\n margin: props.isMobile ? '0.5rem 1rem' : '0.5rem',\n fontSize: theme.fonts.smallPlus.fontSize\n }\n }),\n [theme.palette.neutralSecondary, theme.fonts.smallPlus.fontSize, props.isMobile]\n );\n\n return (\n <Stack className={participantListStack}>\n <Stack horizontal horizontalAlign=\"space-between\" verticalAlign=\"center\">\n <Stack.Item grow styles={subheadingStyleThemed} aria-label={title} id={subheadingUniqueId}>\n {paneTitleTrampoline(\n title ?? '',\n /* @conditional-compile-remove(total-participant-count) */ totalParticipantCount\n )}\n </Stack.Item>\n {(onClickHeadingMoreButton ||\n (headingMoreButtonMenuProps?.items && headingMoreButtonMenuProps.items.length > 0)) && (\n <Stack.Item>\n <DefaultButton\n ariaLabel={headingMoreButtonAriaLabel}\n styles={headingMoreButtonStyles(theme)}\n iconProps={{ iconName: 'PeoplePaneMoreButton' }}\n onClick={onClickHeadingMoreButton ? () => onClickHeadingMoreButton() : undefined}\n menuProps={props.onClickHeadingMoreButton ? undefined : props.headingMoreButtonMenuProps}\n onRenderMenuIcon={() => null}\n />\n </Stack.Item>\n )}\n </Stack>\n <FocusZone className={participantListContainerStyle} shouldFocusOnMount={true}>\n <ParticipantList\n {...participantListProps}\n pinnedParticipants={pinnedParticipants}\n styles={props.isMobile ? participantListMobileStyle : participantListStyle}\n onRenderAvatar={(userId, options) => (\n <>\n <AvatarPersona\n data-ui-id=\"chat-composite-participant-custom-avatar\"\n userId={userId}\n {...options}\n {...{ hidePersonaDetails: !!options?.text }}\n dataProvider={onFetchAvatarPersonaData}\n allowActiveBorder={true}\n />\n {options?.text && (\n <div style={displayNameStyles}>\n <TooltipHost content={options?.text} id={tooltipId} overflowMode={TooltipOverflowMode.Parent}>\n <Text nowrap={false} aria-labelledby={tooltipId}>\n {options?.text}\n </Text>\n </TooltipHost>\n </div>\n )}\n </>\n )}\n onFetchParticipantMenuItems={onFetchParticipantMenuItems}\n showParticipantOverflowTooltip={!props.isMobile}\n participantAriaLabelledBy={subheadingUniqueId}\n />\n </FocusZone>\n </Stack>\n );\n};\n\nconst paneTitleTrampoline = (paneTitle: string, totalParticipantCount?: number): string => {\n const participantCountString = totalParticipantCount\n ? { numberOfPeople: `(${totalParticipantCount})` }\n : { numberOfPeople: ' ' };\n return _formatString(paneTitle, participantCountString);\n};\n"]}
|
package/dist/dist-esm/react-composites/src/composites/common/styles/ParticipantContainer.styles.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { IStackStyles, IStackItemStyles, IStackTokens, Theme,
|
1
|
+
import { IStackStyles, IStackItemStyles, IStackTokens, Theme, IButtonStyles } from '@fluentui/react';
|
2
2
|
import { ParticipantListStyles } from "../../../../../react-components/src";
|
3
3
|
/**
|
4
4
|
* @private
|
@@ -73,7 +73,12 @@ export declare const participantListMobileStyle: ParticipantListStyles;
|
|
73
73
|
/**
|
74
74
|
* @private
|
75
75
|
*/
|
76
|
-
export declare const displayNameStyles:
|
76
|
+
export declare const displayNameStyles: {
|
77
|
+
padding: string;
|
78
|
+
textOverflow: string;
|
79
|
+
overflow: string;
|
80
|
+
whiteSpace: string;
|
81
|
+
};
|
77
82
|
/**
|
78
83
|
* @private
|
79
84
|
*/
|
package/dist/dist-esm/react-composites/src/composites/common/styles/ParticipantContainer.styles.js
CHANGED
@@ -139,11 +139,10 @@ export const participantListMobileStyle = {
|
|
139
139
|
* @private
|
140
140
|
*/
|
141
141
|
export const displayNameStyles = {
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
}
|
142
|
+
padding: '0.5rem',
|
143
|
+
textOverflow: 'ellipsis',
|
144
|
+
overflow: 'hidden',
|
145
|
+
whiteSpace: 'nowrap'
|
147
146
|
};
|
148
147
|
/**
|
149
148
|
* @private
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ParticipantContainer.styles.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/common/styles/ParticipantContainer.styles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,
|
1
|
+
{"version":3,"file":"ParticipantContainer.styles.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/common/styles/ParticipantContainer.styles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAgD,WAAW,EAAwB,MAAM,iBAAiB,CAAC;AAElH,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAqB;IACvD,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,gBA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EAAE;YACJ,OAAO,EAAE,aAAa;SACvB;KACF;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO,EAAE,QAAQ;IACjB,YAAY,EAAE,UAAU;IACxB,QAAQ,EAAE,QAAQ;IAClB,UAAU,EAAE,QAAQ;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,KAAY,EAAiB,EAAE;IACrE,OAAO;QACL,IAAI,EAAE;YACJ,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,QAAQ;YAClB,OAAO,EAAE,gBAAgB;YACzB,WAAW,EAAE,SAAS;YACtB,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;SACnB;QACD,WAAW,EAAE;YACX,UAAU,EAAE,MAAM;SACnB;QACD,WAAW,EAAE;YACX,UAAU,EAAE,MAAM;SACnB;QACD,WAAW,EAAE;YACX,UAAU,EAAE,MAAM;SACnB;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,gBAAgB;YACrC,OAAO,EAAE,MAAM;YACf,UAAU,EAAE,QAAQ;SACrB;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IStackStyles, IStackItemStyles, IStackTokens, mergeStyles, Theme, IButtonStyles } from '@fluentui/react';\nimport { ParticipantListStyles } from '@internal/react-components';\nimport { CHAT_CONTAINER_ZINDEX } from '../../ChatComposite/styles/Chat.styles';\n\n/**\n * @private\n */\nexport const sidePaneContainerStyles: IStackItemStyles = {\n root: {\n height: '100%',\n padding: '0.5rem 0.25rem',\n width: '21.5rem'\n }\n};\n\n/**\n * @private\n */\nexport const sidePaneContainerHiddenStyles: IStackItemStyles = {\n root: {\n ...sidePaneContainerStyles,\n display: 'none'\n }\n};\n\n/**\n * @private\n */\nexport const sidePaneContainerTokens: IStackTokens = {\n childrenGap: '0.5rem'\n};\n\n/**\n * @private\n */\nexport const sidePaneHeaderStyles: IStackItemStyles = {\n root: {\n lineHeight: '1.5rem',\n fontSize: '1.125rem',\n padding: '0.75rem 0.75rem 0.75rem 0.25rem',\n fontWeight: '600'\n }\n};\n\n/**\n * @private\n */\nexport const sidePaneHeaderContainerStyles: IStackStyles = {\n root: {\n margin: '0 0.25rem'\n }\n};\n\n/**\n * @private\n */\nexport const paneBodyContainer: IStackStyles = { root: { flexDirection: 'column', display: 'flex' } };\n\n/**\n * @private\n */\nexport const scrollableContainer: IStackStyles = { root: { flexBasis: '0', flexGrow: '1', overflowY: 'auto' } };\n\n/**\n * @private\n */\nexport const scrollableContainerContents: IStackItemStyles = {\n root: {\n flexGrow: '1',\n flexBasis: '0',\n maxWidth: '100%',\n // Create a new stacking context so that `pipStyles` can set zIndex above the container.\n position: 'relative'\n }\n};\n\n/**\n * @private\n */\nexport const containerContextStyles: IStackStyles = { root: { position: 'absolute', height: '100%', width: '100%' } };\n/**\n * @private\n */\nexport const peopleSubheadingStyle: IStackItemStyles = {\n root: {\n fontSize: '0.75rem'\n }\n};\n\n/**\n * @private\n */\nexport const peoplePaneContainerTokens: IStackTokens = {\n childrenGap: '0.5rem'\n};\n\n/**\n * @private\n */\nexport const participantListWrapper = (theme: Theme): string =>\n mergeStyles({\n width: '20rem',\n maxWidth: '50%',\n height: '100%',\n position: 'absolute',\n right: '0',\n boxShadow: theme.effects.elevation16,\n background: theme.semanticColors.bodyBackground,\n // zIndex to set the participant pane above the chat container\n zIndex: CHAT_CONTAINER_ZINDEX + 1\n });\n\n/**\n * @private\n */\nexport const participantListContainerPadding = { childrenGap: '0.5rem' };\n\n/**\n * @private\n */\nexport const participantListStack = mergeStyles({\n height: '100%'\n});\n\n/**\n * @private\n */\nexport const participantListContainerStyle = mergeStyles({\n height: '100%',\n overflowY: 'auto',\n overflowX: 'hidden'\n});\n\n/**\n * @private\n */\nexport const participantListStyle: ParticipantListStyles = {\n root: { padding: '0rem' },\n participantItemStyles: {\n root: {\n padding: '0.5rem'\n }\n }\n};\n\n/**\n * @private\n */\nexport const participantListMobileStyle: ParticipantListStyles = {\n root: { padding: '0rem' },\n participantItemStyles: {\n root: {\n padding: '0.5rem 1rem'\n }\n }\n};\n\n/**\n * @private\n */\nexport const displayNameStyles = {\n padding: '0.5rem',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n whiteSpace: 'nowrap'\n};\n\n/**\n * @private\n */\nexport const headingMoreButtonStyles = (theme: Theme): IButtonStyles => {\n return {\n root: {\n height: '100%',\n minWidth: '1.5rem',\n padding: '0.5rem 0.25rem',\n marginRight: '0.25rem',\n border: 'none',\n background: 'none'\n },\n rootHovered: {\n background: 'none'\n },\n rootPressed: {\n background: 'none'\n },\n rootFocused: {\n background: 'none'\n },\n icon: {\n color: theme.palette.neutralSecondary,\n display: 'flex',\n alignItems: 'center'\n }\n };\n};\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@azure/communication-react",
|
3
|
-
"version": "1.18.0-alpha-
|
3
|
+
"version": "1.18.0-alpha-202406150014",
|
4
4
|
"sideEffects": false,
|
5
5
|
"description": "React library for building modern communication user experiences utilizing Azure Communication Services",
|
6
6
|
"keywords": [
|