@azure/communication-react 1.18.0-alpha-202407060013 → 1.18.0-alpha-202407090014
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/communication-react.d.ts +17 -4
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-DMEk2o-G.js → ChatMessageComponentAsRichTextEditBox-RrIa2t97.js} +62 -17
- package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-RrIa2t97.js.map +1 -0
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-ByJFtf0Z.js → RichTextSendBoxWrapper-Bz_1ebsD.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-ByJFtf0Z.js.map → RichTextSendBoxWrapper-Bz_1ebsD.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-BPO9X27C.js → index-DGXoGo4W.js} +242 -94
- package/dist/dist-cjs/communication-react/index-DGXoGo4W.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js +42 -4
- package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +34 -8
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js +3 -0
- package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js +7 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +62 -15
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js +1 -3
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +18 -0
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +0 -4
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +7 -35
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/Common.style.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/styles/Common.style.js +4 -0
- package/dist/dist-esm/react-components/src/components/styles/Common.style.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +18 -0
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +17 -1
- package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +70 -4
- package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +2 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +28 -16
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js +3 -1
- package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js.map +1 -1
- package/package.json +1 -1
- package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-DMEk2o-G.js.map +0 -1
- package/dist/dist-cjs/communication-react/index-BPO9X27C.js.map +0 -1
@@ -4,6 +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
8
|
// Minimum chat bubble width. This matches the minimum chat bubble width from FluentUI
|
8
9
|
// that can contain a message and a timestamp.
|
9
10
|
const CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM = 6.25;
|
@@ -201,6 +202,23 @@ export const useChatMessageStyles = makeStyles({
|
|
201
202
|
top: '0',
|
202
203
|
left: '0',
|
203
204
|
display: 'block'
|
205
|
+
},
|
206
|
+
'& .broken-image-wrapper': {
|
207
|
+
width: '12rem',
|
208
|
+
height: '12rem',
|
209
|
+
marginTop: '0.75rem',
|
210
|
+
display: 'flex',
|
211
|
+
justifyContent: 'center',
|
212
|
+
alignItems: 'center',
|
213
|
+
outline: `1px solid ${tokens.colorNeutralForegroundDisabled}`,
|
214
|
+
backgroundColor: tokens.colorNeutralBackground2
|
215
|
+
},
|
216
|
+
'& .broken-image-wrapper:after': {
|
217
|
+
content: `''`,
|
218
|
+
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");`,
|
219
|
+
width: '3rem',
|
220
|
+
height: '3rem',
|
221
|
+
backgroundColor: `${tokens.colorNeutralForeground2}`
|
204
222
|
}
|
205
223
|
},
|
206
224
|
bodyWithoutAvatar: {
|
@@ -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,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;AAEvG,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,aAAa,GAAG,CAAC,CAAC;AACxB,sDAAsD;AACtD,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAEpC;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,WAAW,CAAC;IACrD,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,MAAM;IACjB,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,QAAQ;CACpB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,WAAW,CAAC;I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,MAAM,EAAE,CAAC,GACV,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,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';\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 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 multipleAttachments: {\n width: '100%',\n maxWidth: `${(_ATTACHMENT_CARD_WIDTH_IN_REM + _ATTACHMENT_CARD_MARGIN_IN_PX) * 2}rem`\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 bodyWithPlaceholderImage: {\n '& img[src=\"\"]': {\n display: 'block',\n position: 'relative',\n marginBottom: '5px'\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 },\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 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,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,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,aAAa,GAAG,CAAC,CAAC;AACxB,sDAAsD;AACtD,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAEpC;;GAEG;AACH,MAAM,CAAC,MAAM,2B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AAa,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 { 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 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 multipleAttachments: {\n width: '100%',\n maxWidth: `${(_ATTACHMENT_CARD_WIDTH_IN_REM + _ATTACHMENT_CARD_MARGIN_IN_PX) * 2}rem`\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 bodyWithPlaceholderImage: {\n '& img[src=\"\"]': {\n display: 'block',\n position: 'relative',\n marginBottom: '5px'\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 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 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 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,4 +1,5 @@
|
|
1
1
|
import { AttachmentMetadataInProgress } from "../../../../acs-ui-common/src";
|
2
|
+
import { AttachmentMetadata } from "../../../../acs-ui-common/src";
|
2
3
|
/**
|
3
4
|
* @private
|
4
5
|
*/
|
@@ -12,7 +13,7 @@ export declare const hasIncompleteAttachmentUploads: (attachmentsWithProgress: A
|
|
12
13
|
*/
|
13
14
|
export declare const isAttachmentUploadCompleted: (attachmentsWithProgress: AttachmentMetadataInProgress[] | undefined) => boolean;
|
14
15
|
/**
|
15
|
-
* @
|
16
|
+
* @internal
|
16
17
|
*/
|
17
18
|
export declare const addUploadedImagesToMessage: (message: string, uploadInlineImages: AttachmentMetadataInProgress[]) => string;
|
18
19
|
/**
|
@@ -38,4 +39,19 @@ export declare const isSendBoxButtonAriaDisabled: ({ hasContent, hasCompletedAtt
|
|
38
39
|
hasError: boolean;
|
39
40
|
disabled: boolean;
|
40
41
|
}) => boolean;
|
42
|
+
/**
|
43
|
+
* @internal
|
44
|
+
*/
|
45
|
+
export declare const cancelInlineImageUpload: (imageSrcArray: string[] | undefined, imageUploadsInProgress: AttachmentMetadataInProgress[] | undefined, onCancelInlineImageUpload?: (id: string) => void) => void;
|
46
|
+
/**
|
47
|
+
* @internal
|
48
|
+
*/
|
49
|
+
export declare const toAttachmentMetadata: (attachmentsWithProgress: AttachmentMetadataInProgress[] | undefined, attachmentType?: 'image') => AttachmentMetadata[] | undefined;
|
50
|
+
/**
|
51
|
+
* @internal
|
52
|
+
*/
|
53
|
+
export declare const insertAttachmentsAndImages: (content: string, attachments: AttachmentMetadataInProgress[] | undefined, imageUploadsInProgress: AttachmentMetadataInProgress[] | undefined) => {
|
54
|
+
content: string;
|
55
|
+
attachmentArray: AttachmentMetadata[] | undefined;
|
56
|
+
};
|
41
57
|
//# sourceMappingURL=SendBoxUtils.d.ts.map
|
@@ -24,15 +24,21 @@ export const isAttachmentUploadCompleted = (attachmentsWithProgress) => {
|
|
24
24
|
};
|
25
25
|
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
26
26
|
/**
|
27
|
-
* @
|
27
|
+
* @internal
|
28
28
|
*/
|
29
29
|
// Before sending the image, we need to add the image id we get back after uploading the images to the message content.
|
30
30
|
export const addUploadedImagesToMessage = (message, uploadInlineImages) => {
|
31
|
+
if (message === '') {
|
32
|
+
return message;
|
33
|
+
}
|
31
34
|
const document = new DOMParser().parseFromString(message !== null && message !== void 0 ? message : '', 'text/html');
|
32
35
|
document.querySelectorAll('img').forEach((img) => {
|
33
|
-
var _a
|
34
|
-
|
35
|
-
|
36
|
+
var _a;
|
37
|
+
if (!img.id) {
|
38
|
+
const uploadInlineImage = uploadInlineImages.find((imageUpload) => !imageUpload.error && (imageUpload.url === img.src || imageUpload.id === img.id));
|
39
|
+
img.id = (_a = uploadInlineImage === null || uploadInlineImage === void 0 ? void 0 : uploadInlineImage.id) !== null && _a !== void 0 ? _a : '';
|
40
|
+
img.src = '';
|
41
|
+
}
|
36
42
|
});
|
37
43
|
const newMessage = document.body.innerHTML;
|
38
44
|
return newMessage;
|
@@ -73,4 +79,64 @@ hasCompletedAttachmentUploads, hasError, disabled }) => {
|
|
73
79
|
hasError ||
|
74
80
|
disabled);
|
75
81
|
};
|
82
|
+
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
83
|
+
/**
|
84
|
+
* @internal
|
85
|
+
*/
|
86
|
+
export const cancelInlineImageUpload = (imageSrcArray, imageUploadsInProgress, onCancelInlineImageUpload) => {
|
87
|
+
if (imageSrcArray && imageUploadsInProgress && (imageUploadsInProgress === null || imageUploadsInProgress === void 0 ? void 0 : imageUploadsInProgress.length) > 0) {
|
88
|
+
imageUploadsInProgress === null || imageUploadsInProgress === void 0 ? void 0 : imageUploadsInProgress.map((uploadImage) => {
|
89
|
+
if (uploadImage.url && imageSrcArray && !(imageSrcArray === null || imageSrcArray === void 0 ? void 0 : imageSrcArray.includes(uploadImage.url))) {
|
90
|
+
onCancelInlineImageUpload === null || onCancelInlineImageUpload === void 0 ? void 0 : onCancelInlineImageUpload(uploadImage.id);
|
91
|
+
}
|
92
|
+
});
|
93
|
+
}
|
94
|
+
};
|
95
|
+
/* @conditional-compile-remove(file-sharing-acs) */
|
96
|
+
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
97
|
+
/**
|
98
|
+
* @internal
|
99
|
+
*/
|
100
|
+
export const toAttachmentMetadata = (attachmentsWithProgress,
|
101
|
+
/* @conditional-compile-remove(rich-text-editor-image-upload) */ attachmentType) => {
|
102
|
+
return attachmentsWithProgress === null || attachmentsWithProgress === void 0 ? void 0 : attachmentsWithProgress.filter((attachment) => {
|
103
|
+
var _a;
|
104
|
+
return !('error' in attachment) && !((_a = attachment.error) === null || _a === void 0 ? void 0 : _a.message);
|
105
|
+
}).map((attachment) => {
|
106
|
+
let url = attachment.url || '';
|
107
|
+
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
108
|
+
if (attachmentType === 'image') {
|
109
|
+
url = '';
|
110
|
+
}
|
111
|
+
return {
|
112
|
+
id: attachment.id,
|
113
|
+
name: attachment.name,
|
114
|
+
url,
|
115
|
+
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
116
|
+
attachmentType: attachmentType
|
117
|
+
};
|
118
|
+
});
|
119
|
+
};
|
120
|
+
/* @conditional-compile-remove(file-sharing-acs) */
|
121
|
+
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
122
|
+
/**
|
123
|
+
* @internal
|
124
|
+
*/
|
125
|
+
export const insertAttachmentsAndImages = (content, attachments, imageUploadsInProgress) => {
|
126
|
+
if (!attachments && !imageUploadsInProgress) {
|
127
|
+
return { content, attachmentArray: undefined };
|
128
|
+
}
|
129
|
+
/* @conditional-compile-remove(file-sharing-acs) */
|
130
|
+
let attachmentArray = toAttachmentMetadata(attachments);
|
131
|
+
let newContent = content;
|
132
|
+
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
133
|
+
if (imageUploadsInProgress) {
|
134
|
+
newContent = addUploadedImagesToMessage(content, imageUploadsInProgress);
|
135
|
+
const imageArray = toAttachmentMetadata(imageUploadsInProgress, 'image');
|
136
|
+
if (imageArray) {
|
137
|
+
attachmentArray = attachmentArray ? attachmentArray === null || attachmentArray === void 0 ? void 0 : attachmentArray.concat(imageArray) : imageArray;
|
138
|
+
}
|
139
|
+
}
|
140
|
+
return { content: newContent, attachmentArray };
|
141
|
+
};
|
76
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;AAKlC;;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,CAAC;AACJ,CAAC,CAAC;AAEF,mDAAmD;AACnD;;GAE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tC,OAAO,EAAE,CAAC;IACZ,CAAC;SAAM,CAAC;QACN,OAAO,OAAO,CAAC;IACjB,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,EAC1C,UAAU;AACV,mDAAmD;AACnD,6BAA6B,EAC7B,QAAQ,EACR,QAAQ,EAOT,EAAW,EAAE;IACZ,OAAO;IACL,aAAa;IACb,CAAC,CAAC,UAAU,IAAI,mDAAmD,CAAC,6BAA6B,CAAC;QAClG,sBAAsB;QACtB,QAAQ;QACR,QAAQ,CACT,CAAC;AACJ,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\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 * @private\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 const document = new DOMParser().parseFromString(message ?? '', 'text/html');\n document.querySelectorAll('img').forEach((img) => {\n img.id = uploadInlineImages.find((imageUpload) => !imageUpload.error && imageUpload.url === img.src)?.id ?? '';\n img.src = '';\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"]}
|
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,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BAAkE,EACM,EAAE;IAC1E,IAAI,CAAC,WAAW,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC5C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC;IACjD,CAAC;IACD,mDAAmD;IACnD,IAAI,eAAe,GAAG,oBAAoB,CAAC,WAAW,CAAC,CAAC;IACxD,IAAI,UAAU,GAAG,OAAO,CAAC;IACzB,gEAAgE;IAChE,IAAI,sBAAsB,EAAE,CAAC;QAC3B,UAAU,GAAG,0BAA0B,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC;QACzE,MAAM,UAAU,GAAG,oBAAoB,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;QACzE,IAAI,UAAU,EAAE,CAAC;YACf,eAAe,GAAG,eAAe,CAAC,CAAC,CAAC,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;QACvF,CAAC;IACH,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC;AAClD,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(rich-text-editor-image-upload) */\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 && !imageSrcArray?.includes(uploadImage.url)) {\n onCancelInlineImageUpload?.(uploadImage.id);\n }\n });\n }\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const toAttachmentMetadata = (\n attachmentsWithProgress: AttachmentMetadataInProgress[] | undefined,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ attachmentType?: 'image'\n): AttachmentMetadata[] | undefined => {\n return attachmentsWithProgress\n ?.filter((attachment) => {\n return !('error' in attachment) && !attachment.error?.message;\n })\n .map((attachment) => {\n let url = attachment.url || '';\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n if (attachmentType === 'image') {\n url = '';\n }\n return {\n id: attachment.id,\n name: attachment.name,\n url,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n attachmentType: attachmentType\n };\n });\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const insertAttachmentsAndImages = (\n content: string,\n attachments: AttachmentMetadataInProgress[] | undefined,\n imageUploadsInProgress: AttachmentMetadataInProgress[] | undefined\n): { content: string; attachmentArray: AttachmentMetadata[] | undefined } => {\n if (!attachments && !imageUploadsInProgress) {\n return { content, attachmentArray: undefined };\n }\n /* @conditional-compile-remove(file-sharing-acs) */\n let attachmentArray = toAttachmentMetadata(attachments);\n let newContent = content;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n if (imageUploadsInProgress) {\n newContent = addUploadedImagesToMessage(content, imageUploadsInProgress);\n const imageArray = toAttachmentMetadata(imageUploadsInProgress, 'image');\n if (imageArray) {\n attachmentArray = attachmentArray ? attachmentArray?.concat(imageArray) : imageArray;\n }\n }\n return { content: newContent, attachmentArray };\n};\n"]}
|
@@ -220,7 +220,8 @@
|
|
220
220
|
"richTextDeleteColumnMenu": "Delete column",
|
221
221
|
"richTextDeleteRowMenu": "Delete row",
|
222
222
|
"richTextDeleteTableMenu": "Delete table",
|
223
|
-
"richTextToolbarMoreButtonAriaLabel": "More options"
|
223
|
+
"richTextToolbarMoreButtonAriaLabel": "More options",
|
224
|
+
"attachmentUploadsPendingError": "Uploading... Please wait."
|
224
225
|
},
|
225
226
|
"errorBar": {
|
226
227
|
"unableToReachChatService": "You are offline",
|
@@ -324,33 +324,43 @@ export const ChatScreen = (props) => {
|
|
324
324
|
});
|
325
325
|
});
|
326
326
|
}, [adapter, /* @conditional-compile-remove(rich-text-editor-image-upload) */ handleInlineImageUploadAction]);
|
327
|
+
const onUpdateMessageHandler = useCallback((messageId, content) => __awaiter(void 0, void 0, void 0, function* () {
|
328
|
+
yield messageThreadProps.onUpdateMessage(messageId, content);
|
329
|
+
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
330
|
+
handleInlineImageUploadAction({ type: AttachmentUploadActionType.Clear });
|
331
|
+
}), [/* @conditional-compile-remove(rich-text-editor-image-upload) */ handleInlineImageUploadAction, messageThreadProps]);
|
332
|
+
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
333
|
+
const onCancelEditMessageHandler = useCallback(() => {
|
334
|
+
handleInlineImageUploadAction({ type: AttachmentUploadActionType.Clear });
|
335
|
+
}, [handleInlineImageUploadAction]);
|
327
336
|
/* @conditional-compile-remove(file-sharing-acs) */
|
328
337
|
const onCancelUploadHandler = useCallback((id) => {
|
329
338
|
var _a, _b;
|
330
339
|
handleUploadAction({ type: AttachmentUploadActionType.Remove, id });
|
331
340
|
(_b = (_a = attachmentOptions === null || attachmentOptions === void 0 ? void 0 : attachmentOptions.uploadOptions) === null || _a === void 0 ? void 0 : _a.handleAttachmentRemoval) === null || _b === void 0 ? void 0 : _b.call(_a, id);
|
332
341
|
}, [attachmentOptions === null || attachmentOptions === void 0 ? void 0 : attachmentOptions.uploadOptions]);
|
333
|
-
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
334
|
-
const removeImageTags = useCallback((event) => {
|
335
|
-
event.content.querySelectorAll('img').forEach((image) => {
|
336
|
-
// If the image is the only child of its parent, remove all the parents of this img element.
|
337
|
-
let parentNode = image.parentElement;
|
338
|
-
let currentNode = image;
|
339
|
-
while ((parentNode === null || parentNode === void 0 ? void 0 : parentNode.childNodes.length) === 1) {
|
340
|
-
currentNode = parentNode;
|
341
|
-
parentNode = parentNode.parentElement;
|
342
|
-
}
|
343
|
-
currentNode === null || currentNode === void 0 ? void 0 : currentNode.remove();
|
344
|
-
});
|
345
|
-
}, []);
|
346
342
|
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
347
343
|
const richTextEditorOptions = useMemo(() => {
|
348
344
|
return (options === null || options === void 0 ? void 0 : options.richTextEditor)
|
349
345
|
? {
|
350
|
-
/* @conditional-compile-remove(rich-text-editor-image-upload) */ onPaste:
|
346
|
+
/* @conditional-compile-remove(rich-text-editor-image-upload) */ onPaste: undefined,
|
347
|
+
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
348
|
+
onUploadInlineImage: onUploadInlineImage,
|
349
|
+
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
350
|
+
imageUploadsInProgress: imageUploadsInProgress,
|
351
|
+
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
352
|
+
onCancelInlineImageUpload: onCancelInlineImageUploadHandler
|
351
353
|
}
|
352
354
|
: undefined;
|
353
|
-
}, [
|
355
|
+
}, [
|
356
|
+
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
357
|
+
imageUploadsInProgress,
|
358
|
+
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
359
|
+
onCancelInlineImageUploadHandler,
|
360
|
+
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
361
|
+
onUploadInlineImage,
|
362
|
+
options === null || options === void 0 ? void 0 : options.richTextEditor
|
363
|
+
]);
|
354
364
|
return (React.createElement(Stack, { className: chatContainer, grow: true },
|
355
365
|
(options === null || options === void 0 ? void 0 : options.topic) !== false && React.createElement(ChatHeader, Object.assign({}, headerProps)),
|
356
366
|
React.createElement(Stack, { className: chatArea, tokens: participantListContainerPadding, horizontal: true, grow: true },
|
@@ -360,7 +370,9 @@ export const ChatScreen = (props) => {
|
|
360
370
|
React.createElement(AttachmentDownloadErrorBar, { onDismissDownloadErrorMessage: useCallback(() => {
|
361
371
|
setDownloadErrorMessage('');
|
362
372
|
}, []), attachmentDownloadErrorMessage: downloadErrorMessage || '' }),
|
363
|
-
React.createElement(MessageThread, Object.assign({}, messageThreadProps, {
|
373
|
+
React.createElement(MessageThread, Object.assign({}, messageThreadProps, { onUpdateMessage: onUpdateMessageHandler,
|
374
|
+
/* @conditional-compile-remove(rich-text-editor-image-upload) */
|
375
|
+
onCancelEditMessage: onCancelEditMessageHandler, onRenderAvatar: onRenderAvatarCallback, onRenderMessage: onRenderMessage,
|
364
376
|
/* @conditional-compile-remove(file-sharing-acs) */
|
365
377
|
onRenderAttachmentDownloads: onRenderAttachmentDownloads, inlineImageOptions: inlineImageOptions, numberOfChatMessagesToReload: defaultNumberOfChatMessagesToReload, styles: messageThreadStyles,
|
366
378
|
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChatScreen.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/ChatComposite/ChatScreen.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACx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gBAC7B,OAAO,CAAC,uBAAuB,CAAC;oBAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,QAAQ;oBAC5C,SAAS,EAAE,gBAAgB,CAAC,SAAS;oBACrC,WAAW,EAAE,gBAAgB,CAAC,QAAQ;iBACvC,CAAC,CAAC;YACL,CAAC,EACD,uBAAuB,EAAE,uBAAuB,IAChD,CACH,CACK,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { isIOS } from '@fluentui/react';\nimport { mergeStyles, Stack } from '@fluentui/react';\nimport { PersonaSize } from '@fluentui/react';\nimport {\n CommunicationParticipant,\n ErrorBar,\n MessageProps,\n MessageRenderer,\n MessageThread,\n MessageThreadStyles,\n ParticipantMenuItemsCallback,\n SendBoxStylesProps,\n TypingIndicator,\n TypingIndicatorStylesProps,\n useTheme\n} from '@internal/react-components';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { ChatMessage } from '@internal/react-components';\nimport React, { useCallback, useEffect, useMemo } from 'react';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { useReducer } from 'react';\nimport { useState } from 'react';\nimport { AvatarPersona, AvatarPersonaDataCallback, AvatarPersonaProps } from '../common/AvatarPersona';\nimport { useAdapter } from './adapter/ChatAdapterProvider';\nimport { ChatCompositeOptions } from './ChatComposite';\nimport { ChatHeader, getHeaderProps } from './ChatHeader';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentUploadButtonWrapper as AttachmentUploadButton } from './file-sharing';\nimport { useAdaptedSelector } from './hooks/useAdaptedSelector';\nimport { usePropsFor } from './hooks/usePropsFor';\n\nimport {\n chatArea,\n chatContainer,\n chatWrapper,\n messageThreadChatCompositeStyles,\n sendboxContainerStyles,\n typingIndicatorContainerStyles\n} from './styles/Chat.styles';\nimport { participantListContainerPadding } from '../common/styles/ParticipantContainer.styles';\n/* @conditional-compile-remove(chat-composite-participant-pane) */\nimport { ChatScreenPeoplePane } from './ChatScreenPeoplePane';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentDownloadErrorBar } from './AttachmentDownloadErrorBar';\nimport { _AttachmentDownloadCards } from '@internal/react-components';\nimport { ImageOverlay } from '@internal/react-components';\nimport { InlineImage } from '@internal/react-components';\nimport { ResourceFetchResult } from '@internal/chat-stateful-client';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentOptions } from '@internal/react-components';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { nanoid } from 'nanoid';\n/* @conditional-compile-remove(file-sharing-acs) */\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { AttachmentUploadActionType, AttachmentUpload, AttachmentUploadReducer } from './file-sharing/AttachmentUpload';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\nimport { SendBoxPicker } from '../common/SendBoxPicker';\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport { loadRichTextSendBox } from '../common/SendBoxPicker';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { useImageUpload } from './image-upload/useImageUpload';\n\n/**\n * @private\n */\nexport type ChatScreenProps = {\n options?: ChatCompositeOptions;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onRenderMessage?: (messageProps: MessageProps, defaultOnRender?: MessageRenderer) => JSX.Element;\n onRenderTypingIndicator?: (typingUsers: CommunicationParticipant[]) => JSX.Element;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n styles?: ChatScreenStyles;\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentOptions?: AttachmentOptions;\n formFactor?: 'desktop' | 'mobile';\n};\n\n/**\n * @private\n */\nexport type ChatScreenStyles = {\n messageThread?: MessageThreadStyles;\n sendBox?: SendBoxStylesProps;\n typingIndicator?: TypingIndicatorStylesProps;\n};\n\n/**\n * @private\n */\ninterface OverlayImageItem {\n imageSrc: string;\n title: string;\n titleIcon: JSX.Element;\n attachmentId: string;\n messageId: string;\n imageUrl: string;\n}\n\n/**\n * @private\n */\nexport const ChatScreen = (props: ChatScreenProps): JSX.Element => {\n const {\n onFetchAvatarPersonaData,\n onRenderMessage,\n onRenderTypingIndicator,\n options,\n styles,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentOptions,\n formFactor\n } = props;\n\n const defaultNumberOfChatMessagesToReload = 5;\n /* @conditional-compile-remove(file-sharing-acs) */\n const [downloadErrorMessage, setDownloadErrorMessage] = React.useState('');\n const [overlayImageItem, setOverlayImageItem] = useState<OverlayImageItem>();\n const [isImageOverlayOpen, setIsImageOverlayOpen] = useState<boolean>(false);\n /* @conditional-compile-remove(file-sharing-acs) */\n const [uploads, handleUploadAction] = useReducer(AttachmentUploadReducer, []);\n const adapter = useAdapter();\n const theme = useTheme();\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n const [inlineImageUploads, handleInlineImageUploadAction, onUploadInlineImage, onCancelInlineImageUploadHandler] =\n useImageUpload();\n\n useEffect(() => {\n // Initial data should be always fetched by the composite(or external caller) instead of the adapter\n const fetchData: () => Promise<void> = async () => {\n // Fetch initial data for adapter\n await adapter.fetchInitialData();\n // Fetch initial set of messages. Without fetching messages here, if the Composite's adapter is changed the message thread does not load new messages.\n await adapter.loadPreviousChatMessages(defaultNumberOfChatMessagesToReload);\n };\n fetchData();\n }, [adapter]);\n\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n useEffect(() => {\n // if rich text editor is enabled, the rich text editor component should be loaded early for good UX\n if (options?.richTextEditor) {\n // this line is needed to load the Rooster JS dependencies early in the lifecycle\n // when the rich text editor is enabled\n loadRichTextSendBox();\n }\n }, [options?.richTextEditor]);\n\n const messageThreadProps = usePropsFor(MessageThread);\n const typingIndicatorProps = usePropsFor(TypingIndicator);\n const headerProps = useAdaptedSelector(getHeaderProps);\n const errorBarProps = usePropsFor(ErrorBar);\n\n useEffect(() => {\n if (overlayImageItem === undefined) {\n return;\n }\n const message = adapter.getState().thread.chatMessages[overlayImageItem.messageId];\n if (message === undefined) {\n return;\n }\n const resourceCache = message.resourceCache;\n if (overlayImageItem.imageSrc === '' && resourceCache && resourceCache[overlayImageItem.imageUrl]) {\n const fullSizeImageSrc = getResourceSourceUrl(resourceCache[overlayImageItem.imageUrl]);\n if (fullSizeImageSrc === undefined || fullSizeImageSrc === '' || overlayImageItem.imageSrc === fullSizeImageSrc) {\n return;\n }\n setOverlayImageItem({\n ...overlayImageItem,\n imageSrc: fullSizeImageSrc\n });\n }\n // Disable eslint because we are using the overlayImageItem in this effect but don't want to have it as a dependency, as it will cause an infinite loop.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [messageThreadProps.messages]);\n\n const getResourceSourceUrl = (result: ResourceFetchResult): string => {\n let src = '';\n if (result.error || !result.sourceUrl) {\n src = 'blob://';\n } else {\n src = result.sourceUrl;\n }\n\n return src;\n };\n\n const onRenderAvatarCallback = useCallback(\n (userId?: string, defaultOptions?: AvatarPersonaProps) => {\n return (\n <AvatarPersona\n userId={userId}\n hidePersonaDetails={true}\n {...defaultOptions}\n dataProvider={onFetchAvatarPersonaData}\n />\n );\n },\n [onFetchAvatarPersonaData]\n );\n\n const messageThreadStyles = useMemo(() => {\n return Object.assign(\n {},\n messageThreadChatCompositeStyles(theme.semanticColors.bodyBackground),\n styles?.messageThread\n );\n }, [styles?.messageThread, theme.semanticColors.bodyBackground]);\n\n const typingIndicatorStyles = useMemo(() => {\n return Object.assign({}, styles?.typingIndicator);\n }, [styles?.typingIndicator]);\n\n const sendBoxStyles = useMemo(() => {\n return Object.assign({}, styles?.sendBox);\n }, [styles?.sendBox]);\n\n const userId = toFlatCommunicationIdentifier(adapter.getState().userId);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const setKeyboardFocusAfterFileSelection = useCallback(() => {\n // look up sendbox by ID for now, we will use `useRef`\n // once attachment button is moved inside of send box component\n // see ADO workitem #3764245\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n if (props.options?.richTextEditor) {\n const richTextSendBox = document?.querySelector(`[id=\"richTextSendBox\"]`) as HTMLDivElement;\n richTextSendBox?.focus();\n return;\n }\n const sendBox = document?.querySelector(`[id=\"sendbox\"]`) as HTMLTextAreaElement;\n // set send box on focus after file selection per A11y requirement\n sendBox?.focus();\n }, [\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n props.options?.richTextEditor\n ]);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const attachmentUploadButtonOnChange = useCallback(\n (files: FileList | null): void => {\n setKeyboardFocusAfterFileSelection();\n\n if (!files) {\n return;\n }\n\n // Get files, change to tasks, store locally and pass back to Contoso\n const newUploads = Array.from(files).map((file): AttachmentUpload => {\n const taskId = nanoid();\n return {\n file,\n taskId,\n metadata: {\n id: taskId,\n name: file.name,\n progress: 0\n },\n notifyUploadProgressChanged: (value: number) => {\n handleUploadAction({ type: AttachmentUploadActionType.Progress, taskId, progress: value });\n },\n notifyUploadCompleted: (id: string, url: string) => {\n handleUploadAction({ type: AttachmentUploadActionType.Completed, taskId, id, url });\n },\n notifyUploadFailed: (message: string) => {\n handleUploadAction({ type: AttachmentUploadActionType.Failed, taskId, message });\n // remove the failed upload task when error banner is auto dismissed after 10 seconds\n // so the banner won't be shown again on UI re-rendering.\n setTimeout(() => {\n handleUploadAction({ type: AttachmentUploadActionType.Remove, id: taskId });\n }, 10 * 1000);\n }\n };\n });\n\n handleUploadAction({ type: AttachmentUploadActionType.Set, newUploads });\n attachmentOptions?.uploadOptions?.handleAttachmentSelection(newUploads);\n },\n [attachmentOptions?.uploadOptions, setKeyboardFocusAfterFileSelection]\n );\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const onRenderAttachmentDownloads = useCallback(\n (message: ChatMessage) =>\n message?.attachments?.length ?? 0 > 0 ? (\n <_AttachmentDownloadCards\n attachments={message.attachments}\n message={message}\n actionsForAttachment={attachmentOptions?.downloadOptions?.actionsForAttachment}\n onActionHandlerFailed={(errorMessage: string) => {\n setDownloadErrorMessage(errorMessage);\n }}\n />\n ) : (\n <></>\n ),\n [attachmentOptions?.downloadOptions?.actionsForAttachment]\n );\n\n const onInlineImageClicked = useCallback(\n (attachmentId: string, messageId: string) => {\n const message = adapter.getState().thread.chatMessages[messageId];\n const inlinedImages = message.content?.attachments?.filter((attachment) => {\n return attachment.attachmentType === 'image' && attachment.id === attachmentId;\n });\n\n if (!inlinedImages || inlinedImages.length <= 0) {\n return;\n }\n\n const attachment = inlinedImages[0];\n\n const resourceCache = message.resourceCache;\n let imageSrc = '';\n\n if (attachment.url) {\n if (resourceCache && resourceCache[attachment.url]) {\n imageSrc = getResourceSourceUrl(resourceCache[attachment.url]);\n } else {\n adapter.downloadResourceToCache({\n threadId: adapter.getState().thread.threadId,\n messageId: messageId,\n resourceUrl: attachment.url\n });\n }\n }\n\n const titleIconRenderOptions = {\n text: message.senderDisplayName,\n size: PersonaSize.size32,\n showOverflowTooltip: false,\n imageAlt: message.senderDisplayName\n };\n\n const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;\n const titleIcon = onRenderAvatarCallback && onRenderAvatarCallback(messageSenderId, titleIconRenderOptions);\n const overlayImage: OverlayImageItem = {\n title: message.senderDisplayName || '',\n titleIcon: titleIcon,\n attachmentId: attachment.id,\n imageSrc: imageSrc,\n messageId: messageId,\n imageUrl: attachment.url || ''\n };\n\n setIsImageOverlayOpen(true);\n setOverlayImageItem(overlayImage);\n },\n [adapter, onRenderAvatarCallback, userId]\n );\n\n const onRenderInlineImage = useCallback(\n (inlineImage: InlineImage, defaultOnRender: (inlineImage: InlineImage) => JSX.Element): JSX.Element => {\n const message = adapter.getState().thread.chatMessages[inlineImage.messageId];\n const attachment = message?.content?.attachments?.find(\n (attachment) => attachment.id === inlineImage.imageAttributes.id\n );\n\n if (attachment === undefined) {\n return defaultOnRender(inlineImage);\n }\n\n let pointerEvents: 'none' | 'auto' = inlineImage.imageAttributes.src === '' ? 'none' : 'auto';\n const resourceCache = message.resourceCache;\n if (\n resourceCache &&\n attachment.previewUrl &&\n resourceCache[attachment.previewUrl] &&\n resourceCache[attachment.previewUrl].error\n ) {\n pointerEvents = 'none';\n }\n\n return (\n <span\n key={inlineImage.imageAttributes.id}\n onClick={() => onInlineImageClicked(inlineImage.imageAttributes.id || '', inlineImage.messageId)}\n tabIndex={0}\n role=\"button\"\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n onInlineImageClicked(inlineImage.imageAttributes.id || '', inlineImage.messageId);\n }\n }}\n style={{ cursor: 'pointer', pointerEvents }}\n >\n {defaultOnRender(inlineImage)}\n </span>\n );\n },\n [adapter, onInlineImageClicked]\n );\n\n const inlineImageOptions = useMemo(() => {\n return { onRenderInlineImage: onRenderInlineImage };\n }, [onRenderInlineImage]);\n\n const onDownloadButtonClicked = useCallback(\n (imageSrc: string): void => {\n if (imageSrc === '') {\n return;\n }\n if (isIOS()) {\n window.open(imageSrc, '_blank');\n } else {\n // Create a new anchor element\n const a = document.createElement('a');\n // Set the href and download attributes for the anchor element\n a.href = imageSrc;\n a.download = overlayImageItem?.attachmentId || '';\n a.rel = 'noopener noreferrer';\n a.target = '_blank';\n\n // Programmatically click the anchor element to trigger the download\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n }\n },\n [overlayImageItem?.attachmentId]\n );\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const AttachmentButton = useCallback(() => {\n if (!attachmentOptions?.uploadOptions?.handleAttachmentSelection) {\n return null;\n }\n return (\n <AttachmentUploadButton\n supportedMediaTypes={attachmentOptions?.uploadOptions?.supportedMediaTypes}\n disableMultipleUploads={attachmentOptions?.uploadOptions?.disableMultipleUploads}\n onChange={attachmentUploadButtonOnChange}\n />\n );\n return <></>;\n }, [\n attachmentOptions?.uploadOptions?.handleAttachmentSelection,\n attachmentOptions?.uploadOptions?.supportedMediaTypes,\n attachmentOptions?.uploadOptions?.disableMultipleUploads,\n attachmentUploadButtonOnChange\n ]);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const attachments = useMemo(() => {\n return uploads?.map((v) => v.metadata);\n }, [uploads]);\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n const imageUploadsInProgress = useMemo(() => {\n return inlineImageUploads?.map((v) => v.metadata);\n }, [inlineImageUploads]);\n\n const onSendMessageHandler = useCallback(\n async function (\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */ /* @conditional-compile-remove(rich-text-editor-composite-support) */ options?: MessageOptions\n ) {\n /* @conditional-compile-remove(file-sharing-acs) */\n const attachments = options?.attachments ?? [];\n /* @conditional-compile-remove(file-sharing-acs) */\n handleUploadAction({ type: AttachmentUploadActionType.Clear });\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n handleInlineImageUploadAction({ type: AttachmentUploadActionType.Clear });\n\n /* @conditional-compile-remove(file-sharing-acs) */\n await adapter.sendMessage(content, {\n attachments: attachments,\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n type: options?.type\n });\n /* @conditional-compile-remove(file-sharing-acs) */\n return;\n await adapter.sendMessage(content, {\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n type: options?.type\n });\n },\n [adapter, /* @conditional-compile-remove(rich-text-editor-image-upload) */ handleInlineImageUploadAction]\n );\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const onCancelUploadHandler = useCallback(\n (id: string) => {\n handleUploadAction({ type: AttachmentUploadActionType.Remove, id });\n attachmentOptions?.uploadOptions?.handleAttachmentRemoval?.(id);\n },\n [attachmentOptions?.uploadOptions]\n );\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n const removeImageTags = useCallback((event: { content: DocumentFragment }) => {\n event.content.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 /* @conditional-compile-remove(rich-text-editor-composite-support) */\n const richTextEditorOptions = useMemo(() => {\n return options?.richTextEditor\n ? {\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ onPaste: removeImageTags\n }\n : undefined;\n }, [options?.richTextEditor, removeImageTags]);\n\n return (\n <Stack className={chatContainer} grow>\n {options?.topic !== false && <ChatHeader {...headerProps} />}\n <Stack className={chatArea} tokens={participantListContainerPadding} horizontal grow>\n <Stack className={chatWrapper} grow>\n {options?.errorBar !== false && <ErrorBar {...errorBarProps} />}\n {\n /* @conditional-compile-remove(file-sharing-acs) */\n <AttachmentDownloadErrorBar\n onDismissDownloadErrorMessage={useCallback(() => {\n setDownloadErrorMessage('');\n }, [])}\n attachmentDownloadErrorMessage={downloadErrorMessage || ''}\n />\n }\n <MessageThread\n {...messageThreadProps}\n onRenderAvatar={onRenderAvatarCallback}\n onRenderMessage={onRenderMessage}\n /* @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentDownloads={onRenderAttachmentDownloads}\n inlineImageOptions={inlineImageOptions}\n numberOfChatMessagesToReload={defaultNumberOfChatMessagesToReload}\n styles={messageThreadStyles}\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditorOptions={richTextEditorOptions}\n />\n <Stack className={mergeStyles(sendboxContainerStyles)}>\n <div className={mergeStyles(typingIndicatorContainerStyles)}>\n {onRenderTypingIndicator ? (\n onRenderTypingIndicator(typingIndicatorProps.typingUsers)\n ) : (\n <TypingIndicator {...typingIndicatorProps} styles={typingIndicatorStyles} />\n )}\n </div>\n <Stack horizontal={formFactor === 'mobile'}>\n {formFactor === 'mobile' && (\n /* @conditional-compile-remove(file-sharing-acs) */\n <Stack verticalAlign=\"center\">\n <AttachmentButton />\n </Stack>\n )}\n <Stack grow>\n <SendBoxPicker\n styles={sendBoxStyles}\n autoFocus={options?.autoFocus}\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditorOptions={richTextEditorOptions}\n /* @conditional-compile-remove(file-sharing-acs) */\n attachments={attachments}\n /* @conditional-compile-remove(file-sharing-acs) */\n onCancelAttachmentUpload={onCancelUploadHandler}\n // we need to overwrite onSendMessage for SendBox because we need to clear attachment state\n // when submit button is clicked\n onSendMessage={onSendMessageHandler}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onUploadInlineImage={onUploadInlineImage}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n imageUploadsInProgress={imageUploadsInProgress}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onCancelInlineImageUpload={onCancelInlineImageUploadHandler}\n />\n </Stack>\n {formFactor !== 'mobile' && (\n /* @conditional-compile-remove(file-sharing-acs) */\n <AttachmentButton />\n )}\n </Stack>\n </Stack>\n </Stack>\n {\n /* @conditional-compile-remove(chat-composite-participant-pane) */\n options?.participantPane === true && (\n <ChatScreenPeoplePane\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={props.onFetchParticipantMenuItems}\n isMobile={formFactor === 'mobile'}\n />\n )\n }\n </Stack>\n {overlayImageItem && (\n <ImageOverlay\n {...overlayImageItem}\n isOpen={isImageOverlayOpen}\n onDismiss={() => {\n setOverlayImageItem(undefined);\n setIsImageOverlayOpen(false);\n adapter.removeResourceFromCache({\n threadId: adapter.getState().thread.threadId,\n messageId: overlayImageItem.messageId,\n resourceUrl: overlayImageItem.imageUrl\n });\n }}\n onDownloadButtonClicked={onDownloadButtonClicked}\n />\n )}\n </Stack>\n );\n};\n"]}
|
1
|
+
{"version":3,"file":"ChatScreen.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/ChatComposite/ChatScreen.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAA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,kBAAkB,EAC1B,SAAS,EAAE,GAAG,EAAE;gBACd,mBAAmB,CAAC,SAAS,CAAC,CAAC;gBAC/B,qBAAqB,CAAC,KAAK,CAAC,CAAC;gBAC7B,OAAO,CAAC,uBAAuB,CAAC;oBAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,QAAQ;oBAC5C,SAAS,EAAE,gBAAgB,CAAC,SAAS;oBACrC,WAAW,EAAE,gBAAgB,CAAC,QAAQ;iBACvC,CAAC,CAAC;YACL,CAAC,EACD,uBAAuB,EAAE,uBAAuB,IAChD,CACH,CACK,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { isIOS } from '@fluentui/react';\nimport { mergeStyles, Stack } from '@fluentui/react';\nimport { PersonaSize } from '@fluentui/react';\nimport {\n CommunicationParticipant,\n ErrorBar,\n MessageProps,\n MessageRenderer,\n MessageThread,\n MessageThreadStyles,\n ParticipantMenuItemsCallback,\n SendBoxStylesProps,\n TypingIndicator,\n TypingIndicatorStylesProps,\n useTheme\n} from '@internal/react-components';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { ChatMessage } from '@internal/react-components';\nimport React, { useCallback, useEffect, useMemo } from 'react';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { useReducer } from 'react';\nimport { useState } from 'react';\nimport { AvatarPersona, AvatarPersonaDataCallback, AvatarPersonaProps } from '../common/AvatarPersona';\nimport { useAdapter } from './adapter/ChatAdapterProvider';\nimport { ChatCompositeOptions } from './ChatComposite';\nimport { ChatHeader, getHeaderProps } from './ChatHeader';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentUploadButtonWrapper as AttachmentUploadButton } from './file-sharing';\nimport { useAdaptedSelector } from './hooks/useAdaptedSelector';\nimport { usePropsFor } from './hooks/usePropsFor';\n\nimport {\n chatArea,\n chatContainer,\n chatWrapper,\n messageThreadChatCompositeStyles,\n sendboxContainerStyles,\n typingIndicatorContainerStyles\n} from './styles/Chat.styles';\nimport { participantListContainerPadding } from '../common/styles/ParticipantContainer.styles';\n/* @conditional-compile-remove(chat-composite-participant-pane) */\nimport { ChatScreenPeoplePane } from './ChatScreenPeoplePane';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentDownloadErrorBar } from './AttachmentDownloadErrorBar';\nimport { _AttachmentDownloadCards } from '@internal/react-components';\nimport { ImageOverlay } from '@internal/react-components';\nimport { InlineImage } from '@internal/react-components';\nimport { ResourceFetchResult } from '@internal/chat-stateful-client';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentOptions } from '@internal/react-components';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { nanoid } from 'nanoid';\n/* @conditional-compile-remove(file-sharing-acs) */\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { AttachmentUploadActionType, AttachmentUpload, AttachmentUploadReducer } from './file-sharing/AttachmentUpload';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\nimport { SendBoxPicker } from '../common/SendBoxPicker';\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport { loadRichTextSendBox } from '../common/SendBoxPicker';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { useImageUpload } from './image-upload/useImageUpload';\n\n/**\n * @private\n */\nexport type ChatScreenProps = {\n options?: ChatCompositeOptions;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onRenderMessage?: (messageProps: MessageProps, defaultOnRender?: MessageRenderer) => JSX.Element;\n onRenderTypingIndicator?: (typingUsers: CommunicationParticipant[]) => JSX.Element;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n styles?: ChatScreenStyles;\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentOptions?: AttachmentOptions;\n formFactor?: 'desktop' | 'mobile';\n};\n\n/**\n * @private\n */\nexport type ChatScreenStyles = {\n messageThread?: MessageThreadStyles;\n sendBox?: SendBoxStylesProps;\n typingIndicator?: TypingIndicatorStylesProps;\n};\n\n/**\n * @private\n */\ninterface OverlayImageItem {\n imageSrc: string;\n title: string;\n titleIcon: JSX.Element;\n attachmentId: string;\n messageId: string;\n imageUrl: string;\n}\n\n/**\n * @private\n */\nexport const ChatScreen = (props: ChatScreenProps): JSX.Element => {\n const {\n onFetchAvatarPersonaData,\n onRenderMessage,\n onRenderTypingIndicator,\n options,\n styles,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentOptions,\n formFactor\n } = props;\n\n const defaultNumberOfChatMessagesToReload = 5;\n /* @conditional-compile-remove(file-sharing-acs) */\n const [downloadErrorMessage, setDownloadErrorMessage] = React.useState('');\n const [overlayImageItem, setOverlayImageItem] = useState<OverlayImageItem>();\n const [isImageOverlayOpen, setIsImageOverlayOpen] = useState<boolean>(false);\n /* @conditional-compile-remove(file-sharing-acs) */\n const [uploads, handleUploadAction] = useReducer(AttachmentUploadReducer, []);\n const adapter = useAdapter();\n const theme = useTheme();\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n const [inlineImageUploads, handleInlineImageUploadAction, onUploadInlineImage, onCancelInlineImageUploadHandler] =\n useImageUpload();\n\n useEffect(() => {\n // Initial data should be always fetched by the composite(or external caller) instead of the adapter\n const fetchData: () => Promise<void> = async () => {\n // Fetch initial data for adapter\n await adapter.fetchInitialData();\n // Fetch initial set of messages. Without fetching messages here, if the Composite's adapter is changed the message thread does not load new messages.\n await adapter.loadPreviousChatMessages(defaultNumberOfChatMessagesToReload);\n };\n fetchData();\n }, [adapter]);\n\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n useEffect(() => {\n // if rich text editor is enabled, the rich text editor component should be loaded early for good UX\n if (options?.richTextEditor) {\n // this line is needed to load the Rooster JS dependencies early in the lifecycle\n // when the rich text editor is enabled\n loadRichTextSendBox();\n }\n }, [options?.richTextEditor]);\n\n const messageThreadProps = usePropsFor(MessageThread);\n const typingIndicatorProps = usePropsFor(TypingIndicator);\n const headerProps = useAdaptedSelector(getHeaderProps);\n const errorBarProps = usePropsFor(ErrorBar);\n\n useEffect(() => {\n if (overlayImageItem === undefined) {\n return;\n }\n const message = adapter.getState().thread.chatMessages[overlayImageItem.messageId];\n if (message === undefined) {\n return;\n }\n const resourceCache = message.resourceCache;\n if (overlayImageItem.imageSrc === '' && resourceCache && resourceCache[overlayImageItem.imageUrl]) {\n const fullSizeImageSrc = getResourceSourceUrl(resourceCache[overlayImageItem.imageUrl]);\n if (fullSizeImageSrc === undefined || fullSizeImageSrc === '' || overlayImageItem.imageSrc === fullSizeImageSrc) {\n return;\n }\n setOverlayImageItem({\n ...overlayImageItem,\n imageSrc: fullSizeImageSrc\n });\n }\n // Disable eslint because we are using the overlayImageItem in this effect but don't want to have it as a dependency, as it will cause an infinite loop.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [messageThreadProps.messages]);\n\n const getResourceSourceUrl = (result: ResourceFetchResult): string => {\n let src = '';\n if (result.error || !result.sourceUrl) {\n src = 'blob://';\n } else {\n src = result.sourceUrl;\n }\n\n return src;\n };\n\n const onRenderAvatarCallback = useCallback(\n (userId?: string, defaultOptions?: AvatarPersonaProps) => {\n return (\n <AvatarPersona\n userId={userId}\n hidePersonaDetails={true}\n {...defaultOptions}\n dataProvider={onFetchAvatarPersonaData}\n />\n );\n },\n [onFetchAvatarPersonaData]\n );\n\n const messageThreadStyles = useMemo(() => {\n return Object.assign(\n {},\n messageThreadChatCompositeStyles(theme.semanticColors.bodyBackground),\n styles?.messageThread\n );\n }, [styles?.messageThread, theme.semanticColors.bodyBackground]);\n\n const typingIndicatorStyles = useMemo(() => {\n return Object.assign({}, styles?.typingIndicator);\n }, [styles?.typingIndicator]);\n\n const sendBoxStyles = useMemo(() => {\n return Object.assign({}, styles?.sendBox);\n }, [styles?.sendBox]);\n\n const userId = toFlatCommunicationIdentifier(adapter.getState().userId);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const setKeyboardFocusAfterFileSelection = useCallback(() => {\n // look up sendbox by ID for now, we will use `useRef`\n // once attachment button is moved inside of send box component\n // see ADO workitem #3764245\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n if (props.options?.richTextEditor) {\n const richTextSendBox = document?.querySelector(`[id=\"richTextSendBox\"]`) as HTMLDivElement;\n richTextSendBox?.focus();\n return;\n }\n const sendBox = document?.querySelector(`[id=\"sendbox\"]`) as HTMLTextAreaElement;\n // set send box on focus after file selection per A11y requirement\n sendBox?.focus();\n }, [\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n props.options?.richTextEditor\n ]);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const attachmentUploadButtonOnChange = useCallback(\n (files: FileList | null): void => {\n setKeyboardFocusAfterFileSelection();\n\n if (!files) {\n return;\n }\n\n // Get files, change to tasks, store locally and pass back to Contoso\n const newUploads = Array.from(files).map((file): AttachmentUpload => {\n const taskId = nanoid();\n return {\n file,\n taskId,\n metadata: {\n id: taskId,\n name: file.name,\n progress: 0\n },\n notifyUploadProgressChanged: (value: number) => {\n handleUploadAction({ type: AttachmentUploadActionType.Progress, taskId, progress: value });\n },\n notifyUploadCompleted: (id: string, url: string) => {\n handleUploadAction({ type: AttachmentUploadActionType.Completed, taskId, id, url });\n },\n notifyUploadFailed: (message: string) => {\n handleUploadAction({ type: AttachmentUploadActionType.Failed, taskId, message });\n // remove the failed upload task when error banner is auto dismissed after 10 seconds\n // so the banner won't be shown again on UI re-rendering.\n setTimeout(() => {\n handleUploadAction({ type: AttachmentUploadActionType.Remove, id: taskId });\n }, 10 * 1000);\n }\n };\n });\n\n handleUploadAction({ type: AttachmentUploadActionType.Set, newUploads });\n attachmentOptions?.uploadOptions?.handleAttachmentSelection(newUploads);\n },\n [attachmentOptions?.uploadOptions, setKeyboardFocusAfterFileSelection]\n );\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const onRenderAttachmentDownloads = useCallback(\n (message: ChatMessage) =>\n message?.attachments?.length ?? 0 > 0 ? (\n <_AttachmentDownloadCards\n attachments={message.attachments}\n message={message}\n actionsForAttachment={attachmentOptions?.downloadOptions?.actionsForAttachment}\n onActionHandlerFailed={(errorMessage: string) => {\n setDownloadErrorMessage(errorMessage);\n }}\n />\n ) : (\n <></>\n ),\n [attachmentOptions?.downloadOptions?.actionsForAttachment]\n );\n\n const onInlineImageClicked = useCallback(\n (attachmentId: string, messageId: string) => {\n const message = adapter.getState().thread.chatMessages[messageId];\n const inlinedImages = message.content?.attachments?.filter((attachment) => {\n return attachment.attachmentType === 'image' && attachment.id === attachmentId;\n });\n\n if (!inlinedImages || inlinedImages.length <= 0) {\n return;\n }\n\n const attachment = inlinedImages[0];\n\n const resourceCache = message.resourceCache;\n let imageSrc = '';\n\n if (attachment.url) {\n if (resourceCache && resourceCache[attachment.url]) {\n imageSrc = getResourceSourceUrl(resourceCache[attachment.url]);\n } else {\n adapter.downloadResourceToCache({\n threadId: adapter.getState().thread.threadId,\n messageId: messageId,\n resourceUrl: attachment.url\n });\n }\n }\n\n const titleIconRenderOptions = {\n text: message.senderDisplayName,\n size: PersonaSize.size32,\n showOverflowTooltip: false,\n imageAlt: message.senderDisplayName\n };\n\n const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;\n const titleIcon = onRenderAvatarCallback && onRenderAvatarCallback(messageSenderId, titleIconRenderOptions);\n const overlayImage: OverlayImageItem = {\n title: message.senderDisplayName || '',\n titleIcon: titleIcon,\n attachmentId: attachment.id,\n imageSrc: imageSrc,\n messageId: messageId,\n imageUrl: attachment.url || ''\n };\n\n setIsImageOverlayOpen(true);\n setOverlayImageItem(overlayImage);\n },\n [adapter, onRenderAvatarCallback, userId]\n );\n\n const onRenderInlineImage = useCallback(\n (inlineImage: InlineImage, defaultOnRender: (inlineImage: InlineImage) => JSX.Element): JSX.Element => {\n const message = adapter.getState().thread.chatMessages[inlineImage.messageId];\n const attachment = message?.content?.attachments?.find(\n (attachment) => attachment.id === inlineImage.imageAttributes.id\n );\n\n if (attachment === undefined) {\n return defaultOnRender(inlineImage);\n }\n\n let pointerEvents: 'none' | 'auto' = inlineImage.imageAttributes.src === '' ? 'none' : 'auto';\n const resourceCache = message.resourceCache;\n if (\n resourceCache &&\n attachment.previewUrl &&\n resourceCache[attachment.previewUrl] &&\n resourceCache[attachment.previewUrl].error\n ) {\n pointerEvents = 'none';\n }\n\n return (\n <span\n key={inlineImage.imageAttributes.id}\n onClick={() => onInlineImageClicked(inlineImage.imageAttributes.id || '', inlineImage.messageId)}\n tabIndex={0}\n role=\"button\"\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n onInlineImageClicked(inlineImage.imageAttributes.id || '', inlineImage.messageId);\n }\n }}\n style={{ cursor: 'pointer', pointerEvents }}\n >\n {defaultOnRender(inlineImage)}\n </span>\n );\n },\n [adapter, onInlineImageClicked]\n );\n\n const inlineImageOptions = useMemo(() => {\n return { onRenderInlineImage: onRenderInlineImage };\n }, [onRenderInlineImage]);\n\n const onDownloadButtonClicked = useCallback(\n (imageSrc: string): void => {\n if (imageSrc === '') {\n return;\n }\n if (isIOS()) {\n window.open(imageSrc, '_blank');\n } else {\n // Create a new anchor element\n const a = document.createElement('a');\n // Set the href and download attributes for the anchor element\n a.href = imageSrc;\n a.download = overlayImageItem?.attachmentId || '';\n a.rel = 'noopener noreferrer';\n a.target = '_blank';\n\n // Programmatically click the anchor element to trigger the download\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n }\n },\n [overlayImageItem?.attachmentId]\n );\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const AttachmentButton = useCallback(() => {\n if (!attachmentOptions?.uploadOptions?.handleAttachmentSelection) {\n return null;\n }\n return (\n <AttachmentUploadButton\n supportedMediaTypes={attachmentOptions?.uploadOptions?.supportedMediaTypes}\n disableMultipleUploads={attachmentOptions?.uploadOptions?.disableMultipleUploads}\n onChange={attachmentUploadButtonOnChange}\n />\n );\n return <></>;\n }, [\n attachmentOptions?.uploadOptions?.handleAttachmentSelection,\n attachmentOptions?.uploadOptions?.supportedMediaTypes,\n attachmentOptions?.uploadOptions?.disableMultipleUploads,\n attachmentUploadButtonOnChange\n ]);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const attachments = useMemo(() => {\n return uploads?.map((v) => v.metadata);\n }, [uploads]);\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n const imageUploadsInProgress = useMemo(() => {\n return inlineImageUploads?.map((v) => v.metadata);\n }, [inlineImageUploads]);\n\n const onSendMessageHandler = useCallback(\n async function (\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */ /* @conditional-compile-remove(rich-text-editor-composite-support) */ options?: MessageOptions\n ) {\n /* @conditional-compile-remove(file-sharing-acs) */\n const attachments = options?.attachments ?? [];\n /* @conditional-compile-remove(file-sharing-acs) */\n handleUploadAction({ type: AttachmentUploadActionType.Clear });\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n handleInlineImageUploadAction({ type: AttachmentUploadActionType.Clear });\n\n /* @conditional-compile-remove(file-sharing-acs) */\n await adapter.sendMessage(content, {\n attachments: attachments,\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n type: options?.type\n });\n /* @conditional-compile-remove(file-sharing-acs) */\n return;\n await adapter.sendMessage(content, {\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n type: options?.type\n });\n },\n [adapter, /* @conditional-compile-remove(rich-text-editor-image-upload) */ handleInlineImageUploadAction]\n );\n\n const onUpdateMessageHandler = useCallback(\n async (messageId: string, content: string) => {\n await messageThreadProps.onUpdateMessage(messageId, content);\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n handleInlineImageUploadAction({ type: AttachmentUploadActionType.Clear });\n },\n [/* @conditional-compile-remove(rich-text-editor-image-upload) */ handleInlineImageUploadAction, messageThreadProps]\n );\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n const onCancelEditMessageHandler = useCallback(() => {\n handleInlineImageUploadAction({ type: AttachmentUploadActionType.Clear });\n }, [handleInlineImageUploadAction]);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const onCancelUploadHandler = useCallback(\n (id: string) => {\n handleUploadAction({ type: AttachmentUploadActionType.Remove, id });\n attachmentOptions?.uploadOptions?.handleAttachmentRemoval?.(id);\n },\n [attachmentOptions?.uploadOptions]\n );\n\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n const richTextEditorOptions = useMemo(() => {\n return options?.richTextEditor\n ? {\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ onPaste: undefined,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onUploadInlineImage: onUploadInlineImage,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n imageUploadsInProgress: imageUploadsInProgress,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onCancelInlineImageUpload: onCancelInlineImageUploadHandler\n }\n : undefined;\n }, [\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n imageUploadsInProgress,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onCancelInlineImageUploadHandler,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onUploadInlineImage,\n options?.richTextEditor\n ]);\n\n return (\n <Stack className={chatContainer} grow>\n {options?.topic !== false && <ChatHeader {...headerProps} />}\n <Stack className={chatArea} tokens={participantListContainerPadding} horizontal grow>\n <Stack className={chatWrapper} grow>\n {options?.errorBar !== false && <ErrorBar {...errorBarProps} />}\n {\n /* @conditional-compile-remove(file-sharing-acs) */\n <AttachmentDownloadErrorBar\n onDismissDownloadErrorMessage={useCallback(() => {\n setDownloadErrorMessage('');\n }, [])}\n attachmentDownloadErrorMessage={downloadErrorMessage || ''}\n />\n }\n <MessageThread\n {...messageThreadProps}\n onUpdateMessage={onUpdateMessageHandler}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onCancelEditMessage={onCancelEditMessageHandler}\n onRenderAvatar={onRenderAvatarCallback}\n onRenderMessage={onRenderMessage}\n /* @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentDownloads={onRenderAttachmentDownloads}\n inlineImageOptions={inlineImageOptions}\n numberOfChatMessagesToReload={defaultNumberOfChatMessagesToReload}\n styles={messageThreadStyles}\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditorOptions={richTextEditorOptions}\n />\n <Stack className={mergeStyles(sendboxContainerStyles)}>\n <div className={mergeStyles(typingIndicatorContainerStyles)}>\n {onRenderTypingIndicator ? (\n onRenderTypingIndicator(typingIndicatorProps.typingUsers)\n ) : (\n <TypingIndicator {...typingIndicatorProps} styles={typingIndicatorStyles} />\n )}\n </div>\n <Stack horizontal={formFactor === 'mobile'}>\n {formFactor === 'mobile' && (\n /* @conditional-compile-remove(file-sharing-acs) */\n <Stack verticalAlign=\"center\">\n <AttachmentButton />\n </Stack>\n )}\n <Stack grow>\n <SendBoxPicker\n styles={sendBoxStyles}\n autoFocus={options?.autoFocus}\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditorOptions={richTextEditorOptions}\n /* @conditional-compile-remove(file-sharing-acs) */\n attachments={attachments}\n /* @conditional-compile-remove(file-sharing-acs) */\n onCancelAttachmentUpload={onCancelUploadHandler}\n // we need to overwrite onSendMessage for SendBox because we need to clear attachment state\n // when submit button is clicked\n onSendMessage={onSendMessageHandler}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onUploadInlineImage={onUploadInlineImage}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n imageUploadsInProgress={imageUploadsInProgress}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onCancelInlineImageUpload={onCancelInlineImageUploadHandler}\n />\n </Stack>\n {formFactor !== 'mobile' && (\n /* @conditional-compile-remove(file-sharing-acs) */\n <AttachmentButton />\n )}\n </Stack>\n </Stack>\n </Stack>\n {\n /* @conditional-compile-remove(chat-composite-participant-pane) */\n options?.participantPane === true && (\n <ChatScreenPeoplePane\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={props.onFetchParticipantMenuItems}\n isMobile={formFactor === 'mobile'}\n />\n )\n }\n </Stack>\n {overlayImageItem && (\n <ImageOverlay\n {...overlayImageItem}\n isOpen={isImageOverlayOpen}\n onDismiss={() => {\n setOverlayImageItem(undefined);\n setIsImageOverlayOpen(false);\n adapter.removeResourceFromCache({\n threadId: adapter.getState().thread.threadId,\n messageId: overlayImageItem.messageId,\n resourceUrl: overlayImageItem.imageUrl\n });\n }}\n onDownloadButtonClicked={onDownloadButtonClicked}\n />\n )}\n </Stack>\n );\n};\n"]}
|