@azure/communication-react 1.11.1-alpha-202312210012 → 1.11.1-alpha-202312220012
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 +31 -24
- package/dist/dist-cjs/communication-react/index.js +131 -229
- package/dist/dist-cjs/communication-react/index.js.map +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/calling-stateful-client/src/CallClientState.d.ts +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js +1 -1
- 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 -38
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js +0 -1
- package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.d.ts +2 -2
- package/dist/dist-esm/communication-react/src/index.js +0 -1
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js +1 -7
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js +25 -8
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js +15 -31
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +2 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +1 -14
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/FluentChatMessageComponentWrapper.js +2 -17
- package/dist/dist-esm/react-components/src/components/ChatMessage/FluentChatMessageComponentWrapper.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.d.ts +12 -6
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.js +9 -13
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ImageGallery.d.ts +4 -4
- package/dist/dist-esm/react-components/src/components/ImageGallery.js +3 -14
- package/dist/dist-esm/react-components/src/components/ImageGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/MessageThread.js +4 -18
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.js +0 -1
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/ImageGallery.style.js +19 -25
- package/dist/dist-esm/react-components/src/components/styles/ImageGallery.style.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/theming/themes.d.ts +9 -9
- package/dist/dist-esm/react-components/src/theming/themes.js +10 -12
- package/dist/dist-esm/react-components/src/theming/themes.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +3 -2
- package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +2 -8
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +1 -16
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +2 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +8 -17
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts +2 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUpload.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUpload.js +2 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUpload.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
- package/package.json +1 -1
@@ -170,7 +170,7 @@ function getDefaultExportFromCjs (x) {
|
|
170
170
|
// Copyright (c) Microsoft Corporation.
|
171
171
|
// Licensed under the MIT License.
|
172
172
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
173
|
-
var telemetryVersion = '1.11.1-alpha-
|
173
|
+
var telemetryVersion = '1.11.1-alpha-202312220012';
|
174
174
|
|
175
175
|
|
176
176
|
var telemetryVersion$1 = /*@__PURE__*/getDefaultExportFromCjs(telemetryVersion);
|
@@ -5939,13 +5939,12 @@ const lightTheme = {
|
|
5939
5939
|
/* @conditional-compile-remove(raise-hand) */
|
5940
5940
|
raiseHandGold: '#eaa300'
|
5941
5941
|
},
|
5942
|
-
/* @conditional-compile-remove(image-gallery) */
|
5943
5942
|
chatPalette: {
|
5944
|
-
|
5945
|
-
|
5946
|
-
|
5947
|
-
|
5948
|
-
|
5943
|
+
imageGalleryOverlayBlack: '#000000',
|
5944
|
+
imageGalleryTitleWhite: '#ffffff',
|
5945
|
+
imageGalleryDefaultButtonBackground: '#1b1a19',
|
5946
|
+
imageGalleryButtonBackgroundHover: '#252423',
|
5947
|
+
imageGalleryButtonBackgroundActive: '#292827'
|
5949
5948
|
},
|
5950
5949
|
semanticColors: {
|
5951
5950
|
errorText: '#a80000'
|
@@ -5990,13 +5989,12 @@ const darkTheme = {
|
|
5990
5989
|
/* @conditional-compile-remove(raise-hand) */
|
5991
5990
|
raiseHandGold: '#eaa300'
|
5992
5991
|
},
|
5993
|
-
/* @conditional-compile-remove(image-gallery) */
|
5994
5992
|
chatPalette: {
|
5995
|
-
|
5996
|
-
|
5997
|
-
|
5998
|
-
|
5999
|
-
|
5993
|
+
imageGalleryOverlayBlack: '#000000',
|
5994
|
+
imageGalleryTitleWhite: '#ffffff',
|
5995
|
+
imageGalleryDefaultButtonBackground: '#1b1a19',
|
5996
|
+
imageGalleryButtonBackgroundHover: '#252423',
|
5997
|
+
imageGalleryButtonBackgroundActive: '#292827'
|
6000
5998
|
},
|
6001
5999
|
semanticColors: {
|
6002
6000
|
errorText: '#f1707b'
|
@@ -8507,14 +8505,13 @@ const cancelIcon = { iconName: 'Cancel' };
|
|
8507
8505
|
const downloadIcon = {
|
8508
8506
|
iconName: 'Download'
|
8509
8507
|
};
|
8510
|
-
/* @conditional-compile-remove(image-gallery) */
|
8511
8508
|
/**
|
8512
8509
|
* @private
|
8513
8510
|
*/
|
8514
8511
|
const overlayStyles = (theme) => {
|
8515
8512
|
return {
|
8516
8513
|
root: {
|
8517
|
-
background: theme.chatPalette.
|
8514
|
+
background: theme.chatPalette.imageGalleryOverlayBlack,
|
8518
8515
|
opacity: '0.85'
|
8519
8516
|
}
|
8520
8517
|
};
|
@@ -8564,14 +8561,13 @@ const titleBarContainerStyle = {
|
|
8564
8561
|
alignContent: 'center',
|
8565
8562
|
alignItems: 'center'
|
8566
8563
|
};
|
8567
|
-
/* @conditional-compile-remove(image-gallery) */
|
8568
8564
|
/**
|
8569
8565
|
* @private
|
8570
8566
|
*/
|
8571
8567
|
const titleStyle$2 = (theme) => {
|
8572
8568
|
return {
|
8573
8569
|
paddingLeft: '0.5rem',
|
8574
|
-
color: theme.chatPalette.
|
8570
|
+
color: theme.chatPalette.imageGalleryTitleWhite,
|
8575
8571
|
fontFamily: 'inherit',
|
8576
8572
|
fontSize: '0.875rem',
|
8577
8573
|
fontStyle: 'normal',
|
@@ -8619,33 +8615,30 @@ const normalImageStyle = {
|
|
8619
8615
|
maxHeight: '100%',
|
8620
8616
|
maxWidth: '100%'
|
8621
8617
|
};
|
8622
|
-
/* @conditional-compile-remove(image-gallery) */
|
8623
8618
|
/**
|
8624
8619
|
* @private
|
8625
8620
|
*/
|
8626
8621
|
const brokenImageStyle = (theme) => {
|
8627
8622
|
return {
|
8628
|
-
color: theme.chatPalette.
|
8623
|
+
color: theme.chatPalette.imageGalleryTitleWhite
|
8629
8624
|
};
|
8630
8625
|
};
|
8631
|
-
/* @conditional-compile-remove(image-gallery) */
|
8632
8626
|
/**
|
8633
8627
|
* @private
|
8634
8628
|
*/
|
8635
8629
|
const closeButtonStyles = (theme) => {
|
8636
8630
|
return {
|
8637
|
-
color: theme.chatPalette.
|
8631
|
+
color: theme.chatPalette.imageGalleryTitleWhite,
|
8638
8632
|
':hover': {
|
8639
|
-
color: theme.chatPalette.
|
8640
|
-
backgroundColor: theme.chatPalette.
|
8633
|
+
color: theme.chatPalette.imageGalleryTitleWhite,
|
8634
|
+
backgroundColor: theme.chatPalette.imageGalleryButtonBackgroundHover
|
8641
8635
|
},
|
8642
8636
|
':active': {
|
8643
|
-
color: theme.chatPalette.
|
8644
|
-
backgroundColor: theme.chatPalette.
|
8637
|
+
color: theme.chatPalette.imageGalleryTitleWhite,
|
8638
|
+
backgroundColor: theme.chatPalette.imageGalleryButtonBackgroundActive
|
8645
8639
|
}
|
8646
8640
|
};
|
8647
8641
|
};
|
8648
|
-
/* @conditional-compile-remove(image-gallery) */
|
8649
8642
|
/**
|
8650
8643
|
* @private
|
8651
8644
|
*/
|
@@ -8658,38 +8651,37 @@ const downloadButtonStyle = (theme) => {
|
|
8658
8651
|
fontWeight: 600,
|
8659
8652
|
padding: '0.38rem 0.75rem',
|
8660
8653
|
borderRadius: '4px',
|
8661
|
-
backgroundColor: theme.chatPalette.
|
8662
|
-
color: theme.chatPalette.
|
8654
|
+
backgroundColor: theme.chatPalette.imageGalleryDefaultButtonBackground,
|
8655
|
+
color: theme.chatPalette.imageGalleryTitleWhite,
|
8663
8656
|
whiteSpace: 'nowrap',
|
8664
8657
|
':hover': {
|
8665
|
-
color: theme.chatPalette.
|
8666
|
-
backgroundColor: theme.chatPalette.
|
8658
|
+
color: theme.chatPalette.imageGalleryTitleWhite,
|
8659
|
+
backgroundColor: theme.chatPalette.imageGalleryButtonBackgroundHover
|
8667
8660
|
},
|
8668
8661
|
':active': {
|
8669
|
-
color: theme.chatPalette.
|
8670
|
-
backgroundColor: theme.chatPalette.
|
8662
|
+
color: theme.chatPalette.imageGalleryTitleWhite,
|
8663
|
+
backgroundColor: theme.chatPalette.imageGalleryButtonBackgroundActive
|
8671
8664
|
},
|
8672
8665
|
'@media (max-width: 25rem)': {
|
8673
8666
|
display: 'none'
|
8674
8667
|
}
|
8675
8668
|
};
|
8676
8669
|
};
|
8677
|
-
/* @conditional-compile-remove(image-gallery) */
|
8678
8670
|
/**
|
8679
8671
|
* @private
|
8680
8672
|
*/
|
8681
8673
|
const smallDownloadButtonContainerStyle = (theme) => {
|
8682
8674
|
return {
|
8683
8675
|
marginRight: '0.5rem',
|
8684
|
-
color: theme.chatPalette.
|
8676
|
+
color: theme.chatPalette.imageGalleryTitleWhite,
|
8685
8677
|
whiteSpace: 'nowrap',
|
8686
8678
|
':hover': {
|
8687
|
-
color: theme.chatPalette.
|
8688
|
-
backgroundColor: theme.chatPalette.
|
8679
|
+
color: theme.chatPalette.imageGalleryTitleWhite,
|
8680
|
+
backgroundColor: theme.chatPalette.imageGalleryButtonBackgroundHover
|
8689
8681
|
},
|
8690
8682
|
':active': {
|
8691
|
-
color: theme.chatPalette.
|
8692
|
-
backgroundColor: theme.chatPalette.
|
8683
|
+
color: theme.chatPalette.imageGalleryTitleWhite,
|
8684
|
+
backgroundColor: theme.chatPalette.imageGalleryButtonBackgroundActive
|
8693
8685
|
},
|
8694
8686
|
'@media (min-width: 25rem)': {
|
8695
8687
|
display: 'none'
|
@@ -8699,17 +8691,14 @@ const smallDownloadButtonContainerStyle = (theme) => {
|
|
8699
8691
|
|
8700
8692
|
// Copyright (c) Microsoft Corporation.
|
8701
8693
|
// Licensed under the MIT License.
|
8702
|
-
/* @conditional-compile-remove(image-gallery) */
|
8703
|
-
/* @conditional-compile-remove(image-gallery) */
|
8704
8694
|
/**
|
8705
8695
|
* Component to render a fullscreen modal for a selected image.
|
8706
8696
|
*
|
8707
|
-
* @
|
8697
|
+
* @public
|
8708
8698
|
*/
|
8709
8699
|
const ImageGallery = (props) => {
|
8710
8700
|
const { isOpen, images, onImageDownloadButtonClicked, onDismiss, onError, startIndex = 0 } = props;
|
8711
8701
|
const theme = useTheme();
|
8712
|
-
/* @conditional-compile-remove(image-gallery) */
|
8713
8702
|
const localeStrings = useLocale$1().strings.imageGallery;
|
8714
8703
|
const [isImageLoaded, setIsImageLoaded] = React.useState(true);
|
8715
8704
|
const imageStyle = isImageLoaded ? normalImageStyle : brokenImageStyle(theme);
|
@@ -8720,13 +8709,9 @@ const ImageGallery = (props) => {
|
|
8720
8709
|
image.titleIcon,
|
8721
8710
|
React.createElement(react.Stack.Item, { className: react.mergeStyles(titleStyle$2(theme)), "aria-label": image === null || image === void 0 ? void 0 : image.title }, image === null || image === void 0 ? void 0 : image.title)),
|
8722
8711
|
React.createElement(react.Stack, { className: react.mergeStyles(controlBarContainerStyle) },
|
8723
|
-
React.createElement(react.DefaultButton, { className: react.mergeStyles(downloadButtonStyle(theme)),
|
8724
|
-
/* @conditional-compile-remove(image-gallery) */
|
8725
|
-
text: localeStrings.downloadButtonLabel, onClick: () => onImageDownloadButtonClicked((image === null || image === void 0 ? void 0 : image.imageUrl) || '', (image === null || image === void 0 ? void 0 : image.downloadFilename) || 'image'), onRenderIcon: () => React.createElement(react.Icon, { iconName: downloadIcon.iconName, className: react.mergeStyles(downloadIconStyle) }), "aria-live": 'polite', "aria-label": localeStrings.downloadButtonLabel }),
|
8712
|
+
React.createElement(react.DefaultButton, { className: react.mergeStyles(downloadButtonStyle(theme)), text: localeStrings.downloadButtonLabel, onClick: () => onImageDownloadButtonClicked((image === null || image === void 0 ? void 0 : image.imageUrl) || '', (image === null || image === void 0 ? void 0 : image.downloadFilename) || 'image'), onRenderIcon: () => React.createElement(react.Icon, { iconName: downloadIcon.iconName, className: react.mergeStyles(downloadIconStyle) }), "aria-live": 'polite', "aria-label": localeStrings.downloadButtonLabel }),
|
8726
8713
|
React.createElement(react.IconButton, { iconProps: downloadIcon, className: react.mergeStyles(smallDownloadButtonContainerStyle(theme)), onClick: () => onImageDownloadButtonClicked(image === null || image === void 0 ? void 0 : image.imageUrl, image === null || image === void 0 ? void 0 : image.downloadFilename), "aria-label": localeStrings.downloadButtonLabel, "aria-live": 'polite' }),
|
8727
|
-
React.createElement(react.IconButton, { iconProps: cancelIcon, className: react.mergeStyles(closeButtonStyles(theme)), onClick: onDismiss,
|
8728
|
-
/* @conditional-compile-remove(image-gallery) */
|
8729
|
-
ariaLabel: localeStrings.dismissButtonAriaLabel, "aria-live": 'polite' }))));
|
8714
|
+
React.createElement(react.IconButton, { iconProps: cancelIcon, className: react.mergeStyles(closeButtonStyles(theme)), onClick: onDismiss, ariaLabel: localeStrings.dismissButtonAriaLabel, "aria-live": 'polite' }))));
|
8730
8715
|
};
|
8731
8716
|
const renderBodyWithLightDismiss = () => {
|
8732
8717
|
return (React.createElement(react.Stack, { className: react.mergeStyles(bodyContainer), onClick: () => props.onDismiss() }, images.length > startIndex && (React.createElement("img", { src: image === null || image === void 0 ? void 0 : image.imageUrl, className: react.mergeStyles(imageStyle), alt: (image === null || image === void 0 ? void 0 : image.altText) || 'image', "aria-label": 'image-gallery-main-image', "aria-live": 'polite', onError: (event) => {
|
@@ -9883,10 +9868,12 @@ const ChatMessageComponentAsEditBox = (props) => {
|
|
9883
9868
|
/* @conditional-compile-remove(mention) */
|
9884
9869
|
const { mentionLookupOptions } = props;
|
9885
9870
|
const [textValue, setTextValue] = React.useState(message.content || '');
|
9871
|
+
/* @conditional-compile-remove(file-sharing) */
|
9886
9872
|
const [attachmentMetadata, setAttachedFilesMetadata] = React.useState(getMessageAttachedFilesMetadata(message));
|
9887
9873
|
const editTextFieldRef = React.useRef(null);
|
9888
9874
|
const theme = useTheme();
|
9889
|
-
const messageState = getMessageState(textValue,
|
9875
|
+
const messageState = getMessageState(textValue,
|
9876
|
+
/* @conditional-compile-remove(file-sharing) */ attachmentMetadata !== null && attachmentMetadata !== void 0 ? attachmentMetadata : []);
|
9890
9877
|
const submitEnabled = messageState === 'OK';
|
9891
9878
|
const editContainerStyles = useChatMessageEditContainerStyles();
|
9892
9879
|
const chatMyMessageStyles = useChatMyMessageStyles();
|
@@ -9905,6 +9892,7 @@ const ChatMessageComponentAsEditBox = (props) => {
|
|
9905
9892
|
const editBoxStyles = React.useMemo(() => {
|
9906
9893
|
return react.concatStyleSets(editBoxStyleSet, { textField: { borderColor: theme.palette.themePrimary } });
|
9907
9894
|
}, [theme.palette.themePrimary]);
|
9895
|
+
/* @conditional-compile-remove(file-sharing) */
|
9908
9896
|
const onRenderFileUploads = React.useCallback(() => {
|
9909
9897
|
return (!!attachmentMetadata &&
|
9910
9898
|
attachmentMetadata.length > 0 && (React.createElement("div", { style: { margin: '0.25rem' } },
|
@@ -9924,7 +9912,8 @@ const ChatMessageComponentAsEditBox = (props) => {
|
|
9924
9912
|
}
|
9925
9913
|
}, onEnterKeyDown: () => {
|
9926
9914
|
submitEnabled &&
|
9927
|
-
onSubmit(textValue, message.metadata,
|
9915
|
+
onSubmit(textValue, message.metadata,
|
9916
|
+
/* @conditional-compile-remove(file-sharing) */ {
|
9928
9917
|
attachmentMetadata
|
9929
9918
|
});
|
9930
9919
|
}, supportNewline: false, maxLength: MAXIMUM_LENGTH_OF_MESSAGE, errorMessage: textTooLongMessage, styles: editBoxStyles,
|
@@ -9940,11 +9929,12 @@ const ChatMessageComponentAsEditBox = (props) => {
|
|
9940
9929
|
React.createElement(react.Stack.Item, { align: "end" },
|
9941
9930
|
React.createElement(InputBoxButton, { className: editingButtonStyle, ariaLabel: strings.editBoxSubmitButton, tooltipContent: strings.editBoxSubmitButton, onRenderIcon: onRenderThemedSubmitIcon, onClick: (e) => {
|
9942
9931
|
submitEnabled &&
|
9943
|
-
onSubmit(textValue, message.metadata,
|
9932
|
+
onSubmit(textValue, message.metadata,
|
9933
|
+
/* @conditional-compile-remove(file-sharing) */ {
|
9944
9934
|
attachmentMetadata
|
9945
9935
|
});
|
9946
9936
|
e.stopPropagation();
|
9947
|
-
}, id: 'submitIconWrapper' }))),
|
9937
|
+
}, id: 'submitIconWrapper' }))), /* @conditional-compile-remove(file-sharing) */
|
9948
9938
|
onRenderFileUploads()));
|
9949
9939
|
};
|
9950
9940
|
const bodyClassName = reactComponents.mergeClasses(editContainerStyles.body, message.failureReason !== undefined ? editContainerStyles.bodyError : editContainerStyles.bodyDefault);
|
@@ -9955,11 +9945,23 @@ const ChatMessageComponentAsEditBox = (props) => {
|
|
9955
9945
|
} }, getContent()));
|
9956
9946
|
};
|
9957
9947
|
const isMessageTooLong = (messageText) => messageText.length > MAXIMUM_LENGTH_OF_MESSAGE;
|
9958
|
-
|
9959
|
-
|
9948
|
+
function isMessageEmpty(messageText,
|
9949
|
+
/* @conditional-compile-remove(file-sharing) */
|
9950
|
+
attachmentMetadata) {
|
9951
|
+
/* @conditional-compile-remove(file-sharing) */
|
9952
|
+
return messageText.trim().length === 0 && (attachmentMetadata === null || attachmentMetadata === void 0 ? void 0 : attachmentMetadata.length) === 0;
|
9953
|
+
}
|
9954
|
+
function getMessageState(messageText,
|
9955
|
+
/* @conditional-compile-remove(file-sharing) */ attachmentMetadata) {
|
9956
|
+
return isMessageEmpty(messageText, /* @conditional-compile-remove(file-sharing) */ attachmentMetadata)
|
9957
|
+
? 'too short'
|
9958
|
+
: isMessageTooLong(messageText)
|
9959
|
+
? 'too long'
|
9960
|
+
: 'OK';
|
9961
|
+
}
|
9962
|
+
/* @conditional-compile-remove(file-sharing) */
|
9960
9963
|
// @TODO: Remove when file-sharing feature becomes stable.
|
9961
9964
|
const getMessageAttachedFilesMetadata = (message) => {
|
9962
|
-
/* @conditional-compile-remove(file-sharing) */
|
9963
9965
|
return message.files;
|
9964
9966
|
};
|
9965
9967
|
|
@@ -10250,15 +10252,7 @@ const MessageContentWithLiveAria = (props) => {
|
|
10250
10252
|
props.content));
|
10251
10253
|
};
|
10252
10254
|
const MessageContentAsRichTextHTML = (props) => {
|
10253
|
-
const {
|
10254
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10255
|
-
// message is used only in useEffect that is under teams-inline-images-and-file-sharing cc
|
10256
|
-
message,
|
10257
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10258
|
-
attachmentsMap,
|
10259
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10260
|
-
onFetchAttachments } = props;
|
10261
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10255
|
+
const { message, attachmentsMap, onFetchAttachments } = props;
|
10262
10256
|
React.useEffect(() => {
|
10263
10257
|
var _a;
|
10264
10258
|
if (!attachmentsMap || !onFetchAttachments) {
|
@@ -10322,7 +10316,6 @@ const messageContentAriaText = (props) => {
|
|
10322
10316
|
};
|
10323
10317
|
const processNodeDefinitions = htmlToReact.ProcessNodeDefinitions();
|
10324
10318
|
const htmlToReactParser = htmlToReact.Parser();
|
10325
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10326
10319
|
const processInlineImage = (props) => ({
|
10327
10320
|
// Custom <img> processing
|
10328
10321
|
shouldProcessNode: (node) => {
|
@@ -10343,11 +10336,9 @@ const processInlineImage = (props) => ({
|
|
10343
10336
|
if (props.attachmentsMap && node.attribs.id in props.attachmentsMap) {
|
10344
10337
|
node.attribs = Object.assign(Object.assign({}, node.attribs), { src: props.attachmentsMap[node.attribs.id] });
|
10345
10338
|
}
|
10346
|
-
/* @conditional-compile-remove(image-gallery) */
|
10347
10339
|
const handleOnClick = () => {
|
10348
10340
|
props.onInlineImageClicked && props.onInlineImageClicked(node.attribs.id);
|
10349
10341
|
};
|
10350
|
-
/* @conditional-compile-remove(image-gallery) */
|
10351
10342
|
return (React.createElement("span", { "data-ui-id": node.attribs.id, onClick: handleOnClick, tabIndex: 0, role: "button", style: {
|
10352
10343
|
cursor: 'pointer'
|
10353
10344
|
}, onKeyDown: (e) => {
|
@@ -10383,7 +10374,6 @@ const processMention = (props) => ({
|
|
10383
10374
|
const processHtmlToReact = (props) => {
|
10384
10375
|
var _a;
|
10385
10376
|
const steps = [
|
10386
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10387
10377
|
processInlineImage(props),
|
10388
10378
|
/* @conditional-compile-remove(mention) */
|
10389
10379
|
processMention(props),
|
@@ -10447,19 +10437,19 @@ const _FileDownloadCards = (props) => {
|
|
10447
10437
|
return (_b = (_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile) !== null && _b !== void 0 ? _b : localeStrings.downloadFile;
|
10448
10438
|
}, [(_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile, localeStrings.downloadFile]);
|
10449
10439
|
const isFileSharingAttachment = React.useCallback((attachment) => {
|
10450
|
-
/* @conditional-compile-remove(
|
10440
|
+
/* @conditional-compile-remove(file-sharing) */
|
10451
10441
|
return attachment.attachmentType === 'file';
|
10452
10442
|
}, []);
|
10453
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10454
10443
|
const isShowDownloadIcon = React.useCallback((attachment) => {
|
10455
10444
|
var _a;
|
10456
|
-
/* @conditional-compile-remove(
|
10445
|
+
/* @conditional-compile-remove(file-sharing) */
|
10457
10446
|
return attachment.attachmentType === 'file' && ((_a = attachment.payload) === null || _a === void 0 ? void 0 : _a.teamsFileAttachment) !== 'true';
|
10458
10447
|
}, []);
|
10448
|
+
/* @conditional-compile-remove(file-sharing) */
|
10459
10449
|
const fileCardGroupDescription = React.useMemo(() => () => {
|
10460
10450
|
var _a, _b, _c;
|
10461
10451
|
const fileGroupLocaleString = (_b = (_a = props.strings) === null || _a === void 0 ? void 0 : _a.fileCardGroupMessage) !== null && _b !== void 0 ? _b : localeStrings.fileCardGroupMessage;
|
10462
|
-
/* @conditional-compile-remove(
|
10452
|
+
/* @conditional-compile-remove(file-sharing) */
|
10463
10453
|
return _formatString(fileGroupLocaleString, {
|
10464
10454
|
fileCount: `${(_c = fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.filter(isFileSharingAttachment).length) !== null && _c !== void 0 ? _c : 0}`
|
10465
10455
|
});
|
@@ -10485,22 +10475,19 @@ const _FileDownloadCards = (props) => {
|
|
10485
10475
|
}
|
10486
10476
|
}
|
10487
10477
|
}), [props]);
|
10488
|
-
if (!fileMetadata ||
|
10489
|
-
fileMetadata.length === 0 ||
|
10490
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ !fileMetadata.some(isFileSharingAttachment)) {
|
10478
|
+
if (!fileMetadata || fileMetadata.length === 0 || !fileMetadata.some(isFileSharingAttachment)) {
|
10491
10479
|
return React.createElement(React.Fragment, null);
|
10492
10480
|
}
|
10493
10481
|
return (React.createElement("div", { style: fileDownloadCardsStyle, "data-ui-id": "file-download-card-group" },
|
10494
|
-
React.createElement(_FileCardGroup
|
10482
|
+
React.createElement(_FileCardGroup /* @conditional-compile-remove(file-sharing) */, { ariaLabel: fileCardGroupDescription() }, fileMetadata &&
|
10495
10483
|
fileMetadata
|
10496
10484
|
.filter((attachment) => {
|
10497
|
-
/* @conditional-compile-remove(
|
10485
|
+
/* @conditional-compile-remove(file-sharing) */
|
10498
10486
|
return isFileSharingAttachment(attachment);
|
10499
10487
|
})
|
10500
10488
|
.map((file) => file)
|
10501
10489
|
.map((file) => (React.createElement(react.TooltipHost, { content: downloadFileButtonString(), key: file.name },
|
10502
|
-
React.createElement(_FileCard, { fileName: file.name, key: file.name, fileExtension: file.extension, actionIcon: showSpinner ? (React.createElement(react.Spinner, { size: react.SpinnerSize.medium, "aria-live": 'polite', role: 'status' })) :
|
10503
|
-
isShowDownloadIcon(file) ? (React.createElement(react.IconButton, { className: iconButtonClassName, ariaLabel: downloadFileButtonString() },
|
10490
|
+
React.createElement(_FileCard, { fileName: file.name, key: file.name, fileExtension: file.extension, actionIcon: showSpinner ? (React.createElement(react.Spinner, { size: react.SpinnerSize.medium, "aria-live": 'polite', role: 'status' })) : isShowDownloadIcon(file) ? (React.createElement(react.IconButton, { className: iconButtonClassName, ariaLabel: downloadFileButtonString() },
|
10504
10491
|
React.createElement(DownloadIconTrampoline, null))) : undefined, actionHandler: () => fileDownloadHandler(userId, file) })))))));
|
10505
10492
|
};
|
10506
10493
|
/**
|
@@ -10511,7 +10498,7 @@ const DownloadIconTrampoline = () => {
|
|
10511
10498
|
return React.createElement(react.Icon, { "data-ui-id": "file-download-card-download-icon", iconName: "DownloadFile", style: actionIconStyle });
|
10512
10499
|
};
|
10513
10500
|
const useLocaleStringsTrampoline = () => {
|
10514
|
-
/* @conditional-compile-remove(file-sharing)
|
10501
|
+
/* @conditional-compile-remove(file-sharing) */
|
10515
10502
|
return useLocale$1().strings.messageThread;
|
10516
10503
|
};
|
10517
10504
|
|
@@ -10547,9 +10534,9 @@ const MessageBubble = (props) => {
|
|
10547
10534
|
const ids = useIdentifiers();
|
10548
10535
|
const theme = useTheme();
|
10549
10536
|
const locale = useLocale$1();
|
10550
|
-
const { userId, message, onRemoveClick, onResendClick, disableEditing, showDate, messageContainerStyle, strings, onEditClick, remoteParticipantsCount = 0, onRenderAvatar, showMessageStatus, messageStatus,
|
10551
|
-
/* @conditional-compile-remove(
|
10552
|
-
onInlineImageClicked, shouldOverlapAvatarAndMessage } = props;
|
10537
|
+
const { userId, message, onRemoveClick, onResendClick, disableEditing, showDate, messageContainerStyle, strings, onEditClick, remoteParticipantsCount = 0, onRenderAvatar, showMessageStatus, messageStatus,
|
10538
|
+
/* @conditional-compile-remove(file-sharing) */
|
10539
|
+
fileDownloadHandler, onInlineImageClicked, shouldOverlapAvatarAndMessage } = props;
|
10553
10540
|
const defaultTimeStamp = message.createdOn
|
10554
10541
|
? generateDefaultTimestamp(message.createdOn, showDate, strings)
|
10555
10542
|
: undefined;
|
@@ -10589,17 +10576,18 @@ const MessageBubble = (props) => {
|
|
10589
10576
|
setChatMessageActionFlyoutTarget(undefined);
|
10590
10577
|
}, [setChatMessageActionFlyoutTarget]);
|
10591
10578
|
const defaultOnRenderFileDownloads = React.useCallback(() => {
|
10579
|
+
/* @conditional-compile-remove(file-sharing) */
|
10592
10580
|
return (React.createElement(_FileDownloadCards, { userId: userId,
|
10593
|
-
/* @conditional-compile-remove(file-sharing)
|
10594
|
-
fileMetadata: message.files || [],
|
10595
|
-
/* @conditional-compile-remove(file-sharing)
|
10596
|
-
strings: { downloadFile: strings.downloadFile, fileCardGroupMessage: strings.fileCardGroupMessage } }));
|
10581
|
+
/* @conditional-compile-remove(file-sharing) */
|
10582
|
+
fileMetadata: message.files || [],
|
10583
|
+
/* @conditional-compile-remove(file-sharing) */
|
10584
|
+
downloadHandler: fileDownloadHandler, strings: { downloadFile: strings.downloadFile, fileCardGroupMessage: strings.fileCardGroupMessage } }));
|
10597
10585
|
}, [
|
10598
10586
|
userId,
|
10599
10587
|
message,
|
10600
|
-
/* @conditional-compile-remove(file-sharing)
|
10588
|
+
/* @conditional-compile-remove(file-sharing) */
|
10601
10589
|
strings,
|
10602
|
-
/* @conditional-compile-remove(file-sharing)
|
10590
|
+
/* @conditional-compile-remove(file-sharing) */
|
10603
10591
|
fileDownloadHandler
|
10604
10592
|
]);
|
10605
10593
|
const editedOn = 'editedOn' in message ? message.editedOn : undefined;
|
@@ -10612,7 +10600,6 @@ const MessageBubble = (props) => {
|
|
10612
10600
|
}
|
10613
10601
|
return undefined;
|
10614
10602
|
}, [editedOn, message.messageType, messageStatus, strings.editedTag, strings.failToSendTag, theme]);
|
10615
|
-
/* @conditional-compile-remove(image-gallery) */
|
10616
10603
|
const handleOnInlineImageClicked = React.useCallback((attachmentId) => __awaiter$x(void 0, void 0, void 0, function* () {
|
10617
10604
|
if (onInlineImageClicked === undefined) {
|
10618
10605
|
return;
|
@@ -10626,35 +10613,18 @@ const MessageBubble = (props) => {
|
|
10626
10613
|
React.createElement(BlockedMessageContent, { message: message, strings: strings })));
|
10627
10614
|
}
|
10628
10615
|
return (React.createElement("div", { tabIndex: 0, className: "ui-chat__message__content" },
|
10629
|
-
React.createElement(ChatMessageContent, { message: message, strings: strings,
|
10630
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10631
|
-
onFetchAttachments: props.onFetchAttachments,
|
10632
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10633
|
-
attachmentsMap: props.attachmentsMap,
|
10616
|
+
React.createElement(ChatMessageContent, { message: message, strings: strings, onFetchAttachments: props.onFetchAttachments, attachmentsMap: props.attachmentsMap,
|
10634
10617
|
/* @conditional-compile-remove(mention) */
|
10635
|
-
mentionDisplayOptions: props.mentionDisplayOptions,
|
10636
|
-
/* @conditional-compile-remove(image-gallery) */
|
10637
|
-
onInlineImageClicked: handleOnInlineImageClicked }),
|
10618
|
+
mentionDisplayOptions: props.mentionDisplayOptions, onInlineImageClicked: handleOnInlineImageClicked }),
|
10638
10619
|
props.onRenderFileDownloads ? props.onRenderFileDownloads(userId, message) : defaultOnRenderFileDownloads()));
|
10639
|
-
}, [
|
10640
|
-
defaultOnRenderFileDownloads,
|
10641
|
-
message,
|
10642
|
-
props,
|
10643
|
-
strings,
|
10644
|
-
userId,
|
10645
|
-
/* @conditional-compile-remove(image-gallery) */
|
10646
|
-
handleOnInlineImageClicked
|
10647
|
-
]);
|
10620
|
+
}, [defaultOnRenderFileDownloads, message, props, strings, userId, handleOnInlineImageClicked]);
|
10648
10621
|
const isBlockedMessage = /* @conditional-compile-remove(data-loss-prevention) */ message.messageType === 'blocked';
|
10649
10622
|
const chatMyMessageStyles = useChatMyMessageStyles();
|
10650
10623
|
const chatMessageCommonStyles = useChatMessageCommonStyles();
|
10651
10624
|
const chatMessageStyles = useChatMessageStyles();
|
10652
10625
|
const chatItemMessageContainerClassName = reactComponents.mergeClasses(
|
10653
10626
|
// messageContainerStyle used in className and style prop as style prop can't handle CSS selectors
|
10654
|
-
chatMessageStyles.body,
|
10655
|
-
// disable placeholder functionality for GA releases as it might confuse users
|
10656
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10657
|
-
chatMessageStyles.bodyWithPlaceholderImage, isBlockedMessage
|
10627
|
+
chatMessageStyles.body, chatMessageStyles.bodyWithPlaceholderImage, isBlockedMessage
|
10658
10628
|
? chatMessageCommonStyles.blocked
|
10659
10629
|
: props.message.status === 'failed'
|
10660
10630
|
? chatMessageCommonStyles.failed
|
@@ -10779,13 +10749,7 @@ const ChatMessageComponent = (props) => {
|
|
10779
10749
|
else {
|
10780
10750
|
return (React.createElement(ChatMessageComponentAsMessageBubble, Object.assign({}, props, { onRemoveClick: onRemoveClick, onEditClick: onEditClick, onResendClick: onResendClick, onRenderAvatar: props.onRenderAvatar,
|
10781
10751
|
/* @conditional-compile-remove(date-time-customization) */
|
10782
|
-
onDisplayDateTimeString: props.onDisplayDateTimeString, strings: props.strings,
|
10783
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10784
|
-
onFetchAttachments: props.onFetchAttachments,
|
10785
|
-
/* @conditional-compile-remove(image-gallery) */
|
10786
|
-
onInlineImageClicked: props.onInlineImageClicked,
|
10787
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10788
|
-
attachmentsMap: props.attachmentsMap,
|
10752
|
+
onDisplayDateTimeString: props.onDisplayDateTimeString, strings: props.strings, onFetchAttachments: props.onFetchAttachments, onInlineImageClicked: props.onInlineImageClicked, attachmentsMap: props.attachmentsMap,
|
10789
10753
|
/* @conditional-compile-remove(mention) */
|
10790
10754
|
mentionDisplayOptions: (_b = props.mentionOptions) === null || _b === void 0 ? void 0 : _b.displayOptions })));
|
10791
10755
|
}
|
@@ -10804,13 +10768,7 @@ const ChatMessageComponent = (props) => {
|
|
10804
10768
|
const FluentChatMessageComponentWrapper = (props) => {
|
10805
10769
|
const { message, styles, shouldOverlapAvatarAndMessage, onRenderMessage, onRenderAvatar, showMessageStatus, onRenderMessageStatus, participantCount, readCount, onActionButtonClick,
|
10806
10770
|
/* @conditional-compile-remove(date-time-customization) */
|
10807
|
-
onDisplayDateTimeString,
|
10808
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10809
|
-
onFetchInlineAttachment,
|
10810
|
-
/* @conditional-compile-remove(image-gallery) */
|
10811
|
-
onInlineImageClicked,
|
10812
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10813
|
-
inlineAttachments,
|
10771
|
+
onDisplayDateTimeString, onFetchInlineAttachment, onInlineImageClicked, inlineAttachments,
|
10814
10772
|
/* @conditional-compile-remove(mention) */
|
10815
10773
|
mentionOptions,
|
10816
10774
|
/* @conditional-compile-remove(file-sharing) */
|
@@ -10834,13 +10792,7 @@ const FluentChatMessageComponentWrapper = (props) => {
|
|
10834
10792
|
/* @conditional-compile-remove(file-sharing) */
|
10835
10793
|
strings: messageProps.strings, message: messageProps.message, userId: userId, remoteParticipantsCount: participantCount ? participantCount - 1 : 0, shouldOverlapAvatarAndMessage: shouldOverlapAvatarAndMessage, onRenderAvatar: onRenderAvatar, showMessageStatus: showMessageStatus, messageStatus: messageProps.message.status, onActionButtonClick: onActionButtonClick,
|
10836
10794
|
/* @conditional-compile-remove(date-time-customization) */
|
10837
|
-
onDisplayDateTimeString: onDisplayDateTimeString,
|
10838
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10839
|
-
onFetchAttachments: onFetchInlineAttachment,
|
10840
|
-
/* @conditional-compile-remove(image-gallery) */
|
10841
|
-
onInlineImageClicked: onInlineImageClicked,
|
10842
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10843
|
-
attachmentsMap: (_a = inlineAttachments[messageProps.message.messageId]) !== null && _a !== void 0 ? _a : {},
|
10795
|
+
onDisplayDateTimeString: onDisplayDateTimeString, onFetchAttachments: onFetchInlineAttachment, onInlineImageClicked: onInlineImageClicked, attachmentsMap: (_a = inlineAttachments[messageProps.message.messageId]) !== null && _a !== void 0 ? _a : {},
|
10844
10796
|
/* @conditional-compile-remove(mention) */
|
10845
10797
|
mentionOptions: mentionOptions,
|
10846
10798
|
/* @conditional-compile-remove(file-sharing) */
|
@@ -10857,11 +10809,8 @@ const FluentChatMessageComponentWrapper = (props) => {
|
|
10857
10809
|
userId,
|
10858
10810
|
/* @conditional-compile-remove(date-time-customization) */
|
10859
10811
|
onDisplayDateTimeString,
|
10860
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10861
10812
|
onFetchInlineAttachment,
|
10862
|
-
/* @conditional-compile-remove(image-gallery) */
|
10863
10813
|
onInlineImageClicked,
|
10864
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
10865
10814
|
inlineAttachments,
|
10866
10815
|
/* @conditional-compile-remove(mention) */
|
10867
10816
|
mentionOptions,
|
@@ -11091,7 +11040,7 @@ const isMessageSame = (first, second) => {
|
|
11091
11040
|
JSON.stringify(first.createdOn) === JSON.stringify(second.createdOn) &&
|
11092
11041
|
first.senderId === second.senderId &&
|
11093
11042
|
first.senderDisplayName === second.senderDisplayName &&
|
11094
|
-
first.
|
11043
|
+
JSON.stringify(first.editedOn) === JSON.stringify(second.editedOn));
|
11095
11044
|
};
|
11096
11045
|
/**
|
11097
11046
|
* Get the latest message from the message array.
|
@@ -11219,13 +11168,9 @@ const MessageThreadWrapper = (props) => {
|
|
11219
11168
|
var _a;
|
11220
11169
|
const { messages: newMessages, userId, participantCount, readReceiptsBySenderId, styles, disableJumpToNewMessageButton = false, showMessageDate = false, showMessageStatus = false, numberOfChatMessagesToReload = 5, onMessageSeen, onRenderMessageStatus, onRenderAvatar, onLoadPreviousChatMessages, onRenderJumpToNewMessageButton, onRenderMessage, onUpdateMessage, onCancelEditMessage, onDeleteMessage, onSendMessage,
|
11221
11170
|
/* @conditional-compile-remove(date-time-customization) */
|
11222
|
-
onDisplayDateTimeString,
|
11223
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11224
|
-
onFetchAttachments,
|
11171
|
+
onDisplayDateTimeString, onFetchAttachments,
|
11225
11172
|
/* @conditional-compile-remove(mention) */
|
11226
|
-
mentionOptions,
|
11227
|
-
/* @conditional-compile-remove(image-gallery) */
|
11228
|
-
onInlineImageClicked,
|
11173
|
+
mentionOptions, onInlineImageClicked,
|
11229
11174
|
/* @conditional-compile-remove(file-sharing) */
|
11230
11175
|
onRenderFileDownloads } = props;
|
11231
11176
|
// We need this state to wait for one tick and scroll to bottom after messages have been initialized.
|
@@ -11242,9 +11187,7 @@ const MessageThreadWrapper = (props) => {
|
|
11242
11187
|
const [lastSendingChatMessage, setLastSendingChatMessage] = React.useState(undefined);
|
11243
11188
|
// readCount and participantCount will only need to be updated on-fly when user hover on an indicator
|
11244
11189
|
const [readCountForHoveredIndicator, setReadCountForHoveredIndicator] = React.useState(undefined);
|
11245
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11246
11190
|
const [inlineAttachments, setInlineAttachments] = React.useState({});
|
11247
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11248
11191
|
const onFetchInlineAttachment = React.useCallback((attachments, messageId) => __awaiter$v(void 0, void 0, void 0, function* () {
|
11249
11192
|
if (!onFetchAttachments || attachments.length === 0) {
|
11250
11193
|
return;
|
@@ -11294,7 +11237,6 @@ const MessageThreadWrapper = (props) => {
|
|
11294
11237
|
isAllChatMessagesLoadedRef.current = false;
|
11295
11238
|
}
|
11296
11239
|
}, [onLoadPreviousChatMessages]);
|
11297
|
-
/* @conditional-compile-remove(file-sharing) */ /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11298
11240
|
React.useEffect(() => {
|
11299
11241
|
reactFileTypeIcons.initializeFileTypeIcons();
|
11300
11242
|
}, []);
|
@@ -11562,13 +11504,7 @@ const MessageThreadWrapper = (props) => {
|
|
11562
11504
|
className: reactComponents.mergeClasses(classes.root, react.mergeStyles(styles === null || styles === void 0 ? void 0 : styles.chatContainer)), ref: chatScrollDivRef, style: Object.assign({}, createStyleFromV8Style(styles === null || styles === void 0 ? void 0 : styles.chatContainer)) }, messagesToDisplay.map((message) => {
|
11563
11505
|
return (React.createElement(MemoChatMessageComponentWrapper, Object.assign({}, message, { userId: userId, key: message.key, styles: styles, shouldOverlapAvatarAndMessage: isNarrow, strings: strings, onRenderAvatar: onRenderAvatar, onRenderMessage: onRenderMessage, onRenderMessageStatus: onRenderMessageStatus, defaultStatusRenderer: defaultStatusRenderer, onActionButtonClick: onActionButtonClickMemo, readCount: readCountForHoveredIndicator, participantCount: participantCount,
|
11564
11506
|
/* @conditional-compile-remove(file-sharing) */
|
11565
|
-
fileDownloadHandler: props.fileDownloadHandler,
|
11566
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11567
|
-
onFetchInlineAttachment: onFetchInlineAttachment,
|
11568
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
11569
|
-
inlineAttachments: inlineAttachments,
|
11570
|
-
/* @conditional-compile-remove(image-gallery) */
|
11571
|
-
onInlineImageClicked: onInlineImageClicked,
|
11507
|
+
fileDownloadHandler: props.fileDownloadHandler, onFetchInlineAttachment: onFetchInlineAttachment, inlineAttachments: inlineAttachments, onInlineImageClicked: onInlineImageClicked,
|
11572
11508
|
/* @conditional-compile-remove(date-time-customization) */
|
11573
11509
|
onDisplayDateTimeString: onDisplayDateTimeString,
|
11574
11510
|
/* @conditional-compile-remove(mention) */
|
@@ -19881,7 +19817,7 @@ const createDefaultChatHandlers = memoizeOne((chatClient, chatThreadClient) => {
|
|
19881
19817
|
}),
|
19882
19818
|
onUpdateMessage: (messageId, content, options) => __awaiter$q(void 0, void 0, void 0, function* () {
|
19883
19819
|
const updatedMetadata = (options === null || options === void 0 ? void 0 : options.metadata) ? Object.assign({}, options.metadata) : {};
|
19884
|
-
updatedMetadata
|
19820
|
+
updatedMetadata.fileSharingMetadata = JSON.stringify((options === null || options === void 0 ? void 0 : options.attachmentMetadata) || []);
|
19885
19821
|
yield chatThreadClient.updateMessage(messageId, { content, metadata: updatedMetadata });
|
19886
19822
|
}),
|
19887
19823
|
onDeleteMessage: (messageId) => __awaiter$q(void 0, void 0, void 0, function* () {
|
@@ -20259,7 +20195,7 @@ const memoizedAllConvertChatMessage = memoizeFnAll((_key, chatMessage, userId, i
|
|
20259
20195
|
});
|
20260
20196
|
/* @conditional-compile-remove(file-sharing) */
|
20261
20197
|
const extractAttachedFilesMetadata = (metadata) => {
|
20262
|
-
const fileMetadata = metadata
|
20198
|
+
const fileMetadata = metadata.fileSharingMetadata;
|
20263
20199
|
if (!fileMetadata) {
|
20264
20200
|
return [];
|
20265
20201
|
}
|
@@ -20271,13 +20207,14 @@ const extractAttachedFilesMetadata = (metadata) => {
|
|
20271
20207
|
return [];
|
20272
20208
|
}
|
20273
20209
|
};
|
20274
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
20275
20210
|
const extractTeamsAttachmentsMetadata = (attachments) => {
|
20211
|
+
/* @conditional-compile-remove(file-sharing) */
|
20276
20212
|
const files = [];
|
20277
20213
|
const inlineImages = [];
|
20278
20214
|
attachments.forEach((attachment) => {
|
20279
20215
|
var _a;
|
20280
20216
|
const attachmentType = mapAttachmentType(attachment.attachmentType);
|
20217
|
+
/* @conditional-compile-remove(file-sharing) */
|
20281
20218
|
const contentType = extractAttachmentContentTypeFromName(attachment.name);
|
20282
20219
|
if (attachmentType === 'inlineImage') {
|
20283
20220
|
inlineImages.push({
|
@@ -20287,36 +20224,52 @@ const extractTeamsAttachmentsMetadata = (attachments) => {
|
|
20287
20224
|
previewUrl: attachment.previewUrl
|
20288
20225
|
});
|
20289
20226
|
}
|
20290
|
-
|
20227
|
+
/* @conditional-compile-remove(file-sharing) */
|
20228
|
+
if (attachmentType === 'file') {
|
20291
20229
|
files.push({
|
20292
20230
|
attachmentType: attachmentType,
|
20293
20231
|
id: attachment.id,
|
20294
20232
|
name: (_a = attachment.name) !== null && _a !== void 0 ? _a : '',
|
20295
|
-
extension: contentType
|
20233
|
+
extension: contentType,
|
20296
20234
|
url: extractAttachmentUrl(attachment),
|
20297
20235
|
payload: { teamsFileAttachment: 'true' }
|
20298
20236
|
});
|
20299
20237
|
}
|
20300
20238
|
});
|
20301
|
-
return { files, inlineImages };
|
20239
|
+
return { /* @conditional-compile-remove(file-sharing) */ files, inlineImages };
|
20240
|
+
};
|
20241
|
+
/* @conditional-compile-remove(data-loss-prevention) */
|
20242
|
+
const convertToUiBlockedMessage = (message, userId, isSeen, isLargeGroup) => {
|
20243
|
+
const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;
|
20244
|
+
return {
|
20245
|
+
messageType: 'blocked',
|
20246
|
+
createdOn: message.createdOn,
|
20247
|
+
warningText: undefined,
|
20248
|
+
status: !isLargeGroup && message.status === 'delivered' && isSeen ? 'seen' : message.status,
|
20249
|
+
senderDisplayName: message.senderDisplayName,
|
20250
|
+
senderId: messageSenderId,
|
20251
|
+
messageId: message.id,
|
20252
|
+
deletedOn: message.deletedOn,
|
20253
|
+
mine: messageSenderId === userId,
|
20254
|
+
link: DEFAULT_DATA_LOSS_PREVENTION_POLICY_URL
|
20255
|
+
};
|
20302
20256
|
};
|
20303
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
20304
20257
|
const mapAttachmentType = (attachmentType) => {
|
20305
20258
|
if (attachmentType === 'image') {
|
20306
20259
|
return 'inlineImage';
|
20307
20260
|
}
|
20308
|
-
|
20261
|
+
/* @conditional-compile-remove(file-sharing) */
|
20262
|
+
if (attachmentType === 'file') {
|
20309
20263
|
return 'file';
|
20310
20264
|
}
|
20311
20265
|
return 'unknown';
|
20312
20266
|
};
|
20313
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
20314
20267
|
const extractAttachmentUrl = (attachment) => {
|
20268
|
+
/* @conditional-compile-remove(file-sharing) */
|
20315
20269
|
return attachment.attachmentType === 'file' && attachment.previewUrl ? attachment.previewUrl : attachment.url || '';
|
20316
20270
|
};
|
20317
20271
|
const processChatMessageContent = (message) => {
|
20318
20272
|
var _a, _b, _c, _d, _e;
|
20319
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
20320
20273
|
if (sanitizedMessageContentType(message.type).includes('html') && ((_a = message.content) === null || _a === void 0 ? void 0 : _a.attachments)) {
|
20321
20274
|
const attachments = (_b = message.content) === null || _b === void 0 ? void 0 : _b.attachments;
|
20322
20275
|
const teamsImageHtmlContent = attachments
|
@@ -20329,12 +20282,10 @@ const processChatMessageContent = (message) => {
|
|
20329
20282
|
}
|
20330
20283
|
return (_e = message.content) === null || _e === void 0 ? void 0 : _e.message;
|
20331
20284
|
};
|
20332
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
20333
20285
|
const generateImageAttachmentImgHtml = (attachment) => {
|
20334
20286
|
const contentType = extractAttachmentContentTypeFromName(attachment.name);
|
20335
20287
|
return `\r\n<p><img alt="image" src="" itemscope="${contentType}" id="${attachment.id}"></p>`;
|
20336
20288
|
};
|
20337
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
20338
20289
|
const extractAttachmentContentTypeFromName = (name) => {
|
20339
20290
|
if (name === undefined) {
|
20340
20291
|
return '';
|
@@ -20346,43 +20297,26 @@ const extractAttachmentContentTypeFromName = (name) => {
|
|
20346
20297
|
const contentType = name.substring(indexOfLastDot + 1);
|
20347
20298
|
return contentType;
|
20348
20299
|
};
|
20349
|
-
/* @conditional-compile-remove(file-sharing) @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
20350
20300
|
const extractAttachmentsMetadata = (message) => {
|
20351
20301
|
var _a, _b;
|
20302
|
+
/* @conditional-compile-remove(file-sharing) */
|
20352
20303
|
let files = [];
|
20353
20304
|
let inlineImages = [];
|
20354
20305
|
/* @conditional-compile-remove(file-sharing) */
|
20355
20306
|
if (message.metadata) {
|
20356
20307
|
files = files.concat(extractAttachedFilesMetadata(message.metadata));
|
20357
20308
|
}
|
20358
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
20359
20309
|
if ((_a = message.content) === null || _a === void 0 ? void 0 : _a.attachments) {
|
20360
20310
|
const teamsAttachments = extractTeamsAttachmentsMetadata((_b = message.content) === null || _b === void 0 ? void 0 : _b.attachments);
|
20311
|
+
/* @conditional-compile-remove(file-sharing) */
|
20361
20312
|
files = files.concat(teamsAttachments.files);
|
20362
20313
|
inlineImages = inlineImages.concat(teamsAttachments.inlineImages);
|
20363
20314
|
}
|
20364
|
-
return { files, inlineImages };
|
20365
|
-
};
|
20366
|
-
/* @conditional-compile-remove(data-loss-prevention) */
|
20367
|
-
const convertToUiBlockedMessage = (message, userId, isSeen, isLargeGroup) => {
|
20368
|
-
const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;
|
20369
|
-
return {
|
20370
|
-
messageType: 'blocked',
|
20371
|
-
createdOn: message.createdOn,
|
20372
|
-
warningText: undefined,
|
20373
|
-
status: !isLargeGroup && message.status === 'delivered' && isSeen ? 'seen' : message.status,
|
20374
|
-
senderDisplayName: message.senderDisplayName,
|
20375
|
-
senderId: messageSenderId,
|
20376
|
-
messageId: message.id,
|
20377
|
-
deletedOn: message.deletedOn,
|
20378
|
-
mine: messageSenderId === userId,
|
20379
|
-
link: DEFAULT_DATA_LOSS_PREVENTION_POLICY_URL
|
20380
|
-
};
|
20315
|
+
return { /* @conditional-compile-remove(file-sharing) */ files, inlineImages };
|
20381
20316
|
};
|
20382
20317
|
const convertToUiChatMessage = (message, userId, isSeen, isLargeGroup) => {
|
20383
20318
|
const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;
|
20384
|
-
/* @conditional-compile-remove(file-sharing)
|
20385
|
-
const { files, inlineImages } = extractAttachmentsMetadata(message);
|
20319
|
+
const { /* @conditional-compile-remove(file-sharing) */ files, inlineImages } = extractAttachmentsMetadata(message);
|
20386
20320
|
return {
|
20387
20321
|
messageType: 'chat',
|
20388
20322
|
createdOn: message.createdOn,
|
@@ -20397,9 +20331,8 @@ const convertToUiChatMessage = (message, userId, isSeen, isLargeGroup) => {
|
|
20397
20331
|
deletedOn: message.deletedOn,
|
20398
20332
|
mine: messageSenderId === userId,
|
20399
20333
|
metadata: message.metadata,
|
20400
|
-
/* @conditional-compile-remove(file-sharing)
|
20334
|
+
/* @conditional-compile-remove(file-sharing) */
|
20401
20335
|
files,
|
20402
|
-
/* @conditional-compile-remove(file-sharing) @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
20403
20336
|
inlineImages
|
20404
20337
|
};
|
20405
20338
|
};
|
@@ -20494,9 +20427,7 @@ const isMessageValidToRender = (message) => {
|
|
20494
20427
|
if (message.deletedOn) {
|
20495
20428
|
return false;
|
20496
20429
|
}
|
20497
|
-
if (((_a = message.metadata) === null || _a === void 0 ? void 0 : _a
|
20498
|
-
(
|
20499
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ (_b = message.content) === null || _b === void 0 ? void 0 : _b.attachments)) {
|
20430
|
+
if (((_a = message.metadata) === null || _a === void 0 ? void 0 : _a.fileSharingMetadata) || ((_b = message.content) === null || _b === void 0 ? void 0 : _b.attachments)) {
|
20500
20431
|
return true;
|
20501
20432
|
}
|
20502
20433
|
/* @conditional-compile-remove(data-loss-prevention) */
|
@@ -21216,7 +21147,6 @@ class EventSubscriber {
|
|
21216
21147
|
version: event.version,
|
21217
21148
|
content: {
|
21218
21149
|
message: event.message,
|
21219
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
21220
21150
|
attachments: event.attachments
|
21221
21151
|
},
|
21222
21152
|
type: this.convertEventType(event.type),
|
@@ -21807,7 +21737,8 @@ class FileUpload {
|
|
21807
21737
|
else {
|
21808
21738
|
this.metadata = data;
|
21809
21739
|
}
|
21810
|
-
|
21740
|
+
const name = data === null || data === void 0 ? void 0 : data.name;
|
21741
|
+
this.fileName = name;
|
21811
21742
|
}
|
21812
21743
|
notifyUploadProgressChanged(value) {
|
21813
21744
|
this._emitter.emit('uploadProgressChange', this.id, value);
|
@@ -22271,20 +22202,17 @@ class ChatContext {
|
|
22271
22202
|
* @private
|
22272
22203
|
*/
|
22273
22204
|
class AzureCommunicationChatAdapter {
|
22274
|
-
constructor(chatClient, chatThreadClient,
|
22275
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ options) {
|
22276
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
22205
|
+
constructor(chatClient, chatThreadClient, options) {
|
22277
22206
|
this.credential = undefined;
|
22278
22207
|
this.emitter = new EventEmitter();
|
22279
22208
|
this.bindAllPublicMethods();
|
22280
22209
|
this.chatClient = chatClient;
|
22281
22210
|
this.chatThreadClient = chatThreadClient;
|
22282
22211
|
this.context = new ChatContext(chatClient.getState(), chatThreadClient.threadId);
|
22283
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
22284
22212
|
if (options && options.credential) {
|
22285
22213
|
this.credential = options.credential;
|
22286
22214
|
}
|
22287
|
-
/* @conditional-compile-remove(file-sharing) */
|
22215
|
+
/* @conditional-compile-remove(file-sharing) */
|
22288
22216
|
this.fileUploadAdapter = new AzureCommunicationFileUploadAdapter(this.context);
|
22289
22217
|
const onStateChange = (clientState) => {
|
22290
22218
|
// unsubscribe when the instance gets disposed
|
@@ -22328,7 +22256,6 @@ class AzureCommunicationChatAdapter {
|
|
22328
22256
|
this.updateFileUploadErrorMessage = this.updateFileUploadErrorMessage.bind(this);
|
22329
22257
|
/* @conditional-compile-remove(file-sharing) */
|
22330
22258
|
this.updateFileUploadMetadata = this.updateFileUploadMetadata.bind(this);
|
22331
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
22332
22259
|
this.downloadAttachments = this.downloadAttachments.bind(this);
|
22333
22260
|
}
|
22334
22261
|
dispose() {
|
@@ -22470,7 +22397,6 @@ class AzureCommunicationChatAdapter {
|
|
22470
22397
|
updateFileUploadMetadata(id, metadata) {
|
22471
22398
|
this.fileUploadAdapter.updateFileUploadMetadata(id, metadata);
|
22472
22399
|
}
|
22473
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
22474
22400
|
downloadAttachments(options) {
|
22475
22401
|
return __awaiter$k(this, void 0, void 0, function* () {
|
22476
22402
|
return this.asyncTeeErrorToEventEmitter(() => __awaiter$k(this, void 0, void 0, function* () {
|
@@ -22491,7 +22417,6 @@ class AzureCommunicationChatAdapter {
|
|
22491
22417
|
}));
|
22492
22418
|
});
|
22493
22419
|
}
|
22494
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
22495
22420
|
downloadAuthenticatedFile(accessToken, options) {
|
22496
22421
|
return __awaiter$k(this, void 0, void 0, function* () {
|
22497
22422
|
function fetchWithAuthentication(url, token) {
|
@@ -22632,10 +22557,8 @@ const _createAzureCommunicationChatAdapterInner = (endpoint, userId, displayName
|
|
22632
22557
|
}, undefined, telemetryImplementationHint);
|
22633
22558
|
const chatThreadClient = yield chatClient.getChatThreadClient(threadId);
|
22634
22559
|
yield chatClient.startRealtimeNotifications();
|
22635
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
22636
22560
|
const options = { credential: credential };
|
22637
|
-
const adapter = yield createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient,
|
22638
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ options);
|
22561
|
+
const adapter = yield createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient, options);
|
22639
22562
|
return adapter;
|
22640
22563
|
});
|
22641
22564
|
/**
|
@@ -22742,12 +22665,9 @@ beforeDispose) => {
|
|
22742
22665
|
*
|
22743
22666
|
* @public
|
22744
22667
|
*/
|
22745
|
-
function createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient,
|
22746
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
22747
|
-
options) {
|
22668
|
+
function createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient, options) {
|
22748
22669
|
return __awaiter$k(this, void 0, void 0, function* () {
|
22749
|
-
return new AzureCommunicationChatAdapter(chatClient, chatThreadClient,
|
22750
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ options);
|
22670
|
+
return new AzureCommunicationChatAdapter(chatClient, chatThreadClient, options);
|
22751
22671
|
});
|
22752
22672
|
}
|
22753
22673
|
const isChatError = (e) => {
|
@@ -23416,11 +23336,8 @@ const ChatScreen = (props) => {
|
|
23416
23336
|
const defaultNumberOfChatMessagesToReload = 5;
|
23417
23337
|
/* @conditional-compile-remove(file-sharing) */
|
23418
23338
|
const [downloadErrorMessage, setDownloadErrorMessage] = React.useState('');
|
23419
|
-
/* @conditional-compile-remove(image-gallery) */
|
23420
23339
|
const [fullSizeAttachments, setFullSizeAttachments] = React.useState({});
|
23421
|
-
/* @conditional-compile-remove(image-gallery) */
|
23422
23340
|
const [galleryImages, setGalleryImages] = React.useState([]);
|
23423
|
-
/* @conditional-compile-remove(image-gallery) */
|
23424
23341
|
const [isImageGalleryOpen, setIsImageGalleryOpen] = React.useState(false);
|
23425
23342
|
const adapter = useAdapter$1();
|
23426
23343
|
const theme = useTheme();
|
@@ -23465,7 +23382,6 @@ const ChatScreen = (props) => {
|
|
23465
23382
|
const onRenderFileDownloads = React.useCallback((userId, message) => (React.createElement(_FileDownloadCards, { userId: userId, fileMetadata: message.files || [], downloadHandler: fileSharing === null || fileSharing === void 0 ? void 0 : fileSharing.downloadHandler, onDownloadErrorMessage: (errorMessage) => {
|
23466
23383
|
setDownloadErrorMessage(errorMessage);
|
23467
23384
|
} })), [fileSharing === null || fileSharing === void 0 ? void 0 : fileSharing.downloadHandler]);
|
23468
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
23469
23385
|
const onRenderInlineAttachment = React.useCallback((attachment) => __awaiter$i(void 0, void 0, void 0, function* () {
|
23470
23386
|
const entry = {};
|
23471
23387
|
attachment.forEach((target) => {
|
@@ -23476,7 +23392,6 @@ const ChatScreen = (props) => {
|
|
23476
23392
|
const blob = yield adapter.downloadAttachments({ attachmentUrls: entry });
|
23477
23393
|
return blob;
|
23478
23394
|
}), [adapter]);
|
23479
|
-
/* @conditional-compile-remove(image-gallery) */
|
23480
23395
|
const onInlineImageClicked = React.useCallback((attachmentId, messageId) => __awaiter$i(void 0, void 0, void 0, function* () {
|
23481
23396
|
var _a, _b;
|
23482
23397
|
const messages = (_a = messageThreadProps.messages) === null || _a === void 0 ? void 0 : _a.filter((message) => {
|
@@ -23524,7 +23439,6 @@ const ChatScreen = (props) => {
|
|
23524
23439
|
}
|
23525
23440
|
}
|
23526
23441
|
}), [adapter, fullSizeAttachments, messageThreadProps.messages, onRenderAvatarCallback]);
|
23527
|
-
/* @conditional-compile-remove(image-gallery) */
|
23528
23442
|
const onImageDownloadButtonClicked = React.useCallback((imageUrl, downloadFilename) => {
|
23529
23443
|
if (imageUrl === '') {
|
23530
23444
|
return;
|
@@ -23563,11 +23477,7 @@ const ChatScreen = (props) => {
|
|
23563
23477
|
}, []), fileDownloadErrorMessage: downloadErrorMessage || '' }),
|
23564
23478
|
React.createElement(MessageThread, Object.assign({}, messageThreadProps, { onRenderAvatar: onRenderAvatarCallback, onRenderMessage: onRenderMessage,
|
23565
23479
|
/* @conditional-compile-remove(file-sharing) */
|
23566
|
-
onRenderFileDownloads: onRenderFileDownloads,
|
23567
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
23568
|
-
onFetchAttachments: onRenderInlineAttachment,
|
23569
|
-
/* @conditional-compile-remove(image-gallery) */
|
23570
|
-
onInlineImageClicked: onInlineImageClicked, numberOfChatMessagesToReload: defaultNumberOfChatMessagesToReload, styles: messageThreadStyles })),
|
23480
|
+
onRenderFileDownloads: onRenderFileDownloads, onFetchAttachments: onRenderInlineAttachment, onInlineImageClicked: onInlineImageClicked, numberOfChatMessagesToReload: defaultNumberOfChatMessagesToReload, styles: messageThreadStyles })),
|
23571
23481
|
React.createElement(react.Stack, { className: react.mergeStyles(sendboxContainerStyles) },
|
23572
23482
|
React.createElement("div", { className: react.mergeStyles(typingIndicatorContainerStyles) }, onRenderTypingIndicator ? (onRenderTypingIndicator(typingIndicatorProps.typingUsers)) : (React.createElement(TypingIndicator, Object.assign({}, typingIndicatorProps, { styles: typingIndicatorStyles })))),
|
23573
23483
|
React.createElement(react.Stack, { horizontal: formFactor === 'mobile' },
|
@@ -23582,7 +23492,6 @@ const ChatScreen = (props) => {
|
|
23582
23492
|
formFactor !== 'mobile' && React.createElement(AttachFileButton, null)))),
|
23583
23493
|
/* @conditional-compile-remove(chat-composite-participant-pane) */
|
23584
23494
|
(options === null || options === void 0 ? void 0 : options.participantPane) === true && (React.createElement(ChatScreenPeoplePane, { onFetchAvatarPersonaData: onFetchAvatarPersonaData, onFetchParticipantMenuItems: props.onFetchParticipantMenuItems, isMobile: formFactor === 'mobile' }))),
|
23585
|
-
/* @conditional-compile-remove(image-gallery) */
|
23586
23495
|
React.createElement(ImageGallery, { isOpen: isImageGalleryOpen, images: galleryImages, onDismiss: () => {
|
23587
23496
|
setGalleryImages([]);
|
23588
23497
|
setIsImageGalleryOpen(false);
|
@@ -33119,7 +33028,6 @@ class CallWithChatBackedChatAdapter {
|
|
33119
33028
|
};
|
33120
33029
|
this.callWithChatAdapter = callWithChatAdapter;
|
33121
33030
|
}
|
33122
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
33123
33031
|
downloadAttachments(options) {
|
33124
33032
|
return __awaiter$3(this, void 0, void 0, function* () {
|
33125
33033
|
return yield this.callWithChatAdapter.downloadAttachments(options);
|
@@ -33752,7 +33660,6 @@ class AzureCommunicationCallWithChatAdapter {
|
|
33752
33660
|
this.updateFileUploadErrorMessage = this.updateFileUploadErrorMessage.bind(this);
|
33753
33661
|
/* @conditional-compile-remove(file-sharing) */
|
33754
33662
|
this.updateFileUploadMetadata = this.updateFileUploadMetadata.bind(this);
|
33755
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
33756
33663
|
this.downloadAttachments = this.downloadAttachments.bind(this);
|
33757
33664
|
/* @conditional-compile-remove(PSTN-calls) */
|
33758
33665
|
this.holdCall.bind(this);
|
@@ -33997,7 +33904,6 @@ class AzureCommunicationCallWithChatAdapter {
|
|
33997
33904
|
return yield this.chatAdapter.deleteMessage(messageId);
|
33998
33905
|
});
|
33999
33906
|
}
|
34000
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
34001
33907
|
downloadAttachments(options) {
|
34002
33908
|
return __awaiter$2(this, void 0, void 0, function* () {
|
34003
33909
|
return yield this.chatAdapter.downloadAttachments(options);
|
@@ -34389,15 +34295,11 @@ beforeDispose) => {
|
|
34389
34295
|
*/
|
34390
34296
|
const createAzureCommunicationCallWithChatAdapterFromClients = ({ callClient, callAgent, callLocator, chatClient, chatThreadClient,
|
34391
34297
|
/* @conditional-compile-remove(video-background-effects) */
|
34392
|
-
callAdapterOptions,
|
34393
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
34394
|
-
chatAdapterOptions }) => __awaiter$2(void 0, void 0, void 0, function* () {
|
34298
|
+
callAdapterOptions, chatAdapterOptions }) => __awaiter$2(void 0, void 0, void 0, function* () {
|
34395
34299
|
const createCallAdapterPromise = createAzureCommunicationCallAdapterFromClient(callClient, callAgent, callLocator,
|
34396
34300
|
/* @conditional-compile-remove(video-background-effects) */
|
34397
34301
|
callAdapterOptions);
|
34398
|
-
const createChatAdapterPromise = createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient,
|
34399
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
34400
|
-
chatAdapterOptions);
|
34302
|
+
const createChatAdapterPromise = createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient, chatAdapterOptions);
|
34401
34303
|
const [callAdapter, chatAdapter] = yield Promise.all([createCallAdapterPromise, createChatAdapterPromise]);
|
34402
34304
|
return new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter);
|
34403
34305
|
});
|