@azure/communication-react 1.7.0-alpha-202307150015 → 1.7.0-alpha-202307180021
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 +3 -3
- package/dist/dist-cjs/communication-react/index.js +76 -42
- 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/react-components/src/components/CaptionsBanner.d.ts +6 -1
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +2 -2
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.d.ts +3 -3
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.d.ts +2 -1
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.js +5 -1
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +8 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/lobbySelector.d.ts +3 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localAndRemotePIPSelector.d.ts +3 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localVideoStreamSelector.d.ts +2 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localVideoStreamSelector.js +3 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localVideoStreamSelector.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/networkReconnectTileSelector.d.ts +3 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.d.ts +5 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js +14 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +8 -3
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButtonWithUnreadMessagesBadge.d.ts +3 -4
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButtonWithUnreadMessagesBadge.js +4 -26
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButtonWithUnreadMessagesBadge.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/useUnreadMessagesTracker.d.ts +7 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/useUnreadMessagesTracker.js +32 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/useUnreadMessagesTracker.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.js +2 -3
- package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +13 -3
- package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
- package/package.json +8 -8
@@ -6132,7 +6132,7 @@ export declare type FileMetadata = FileSharingMetadata | /* @conditional-compile
|
|
6132
6132
|
/**
|
6133
6133
|
* @beta
|
6134
6134
|
*/
|
6135
|
-
export declare type FileMetadataAttachmentType = 'fileSharing' | /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ 'inlineImage' |
|
6135
|
+
export declare type FileMetadataAttachmentType = 'fileSharing' | /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ 'inlineImage' | 'unknown';
|
6136
6136
|
|
6137
6137
|
/**
|
6138
6138
|
* Meta Data containing basic information about the uploaded file.
|
@@ -6141,7 +6141,7 @@ export declare type FileMetadataAttachmentType = 'fileSharing' | /* @conditional
|
|
6141
6141
|
*/
|
6142
6142
|
export declare interface FileSharingMetadata extends BaseFileMetadata {
|
6143
6143
|
attachmentType: 'fileSharing';
|
6144
|
-
payload?: Record<string, string
|
6144
|
+
payload?: Record<string, string>;
|
6145
6145
|
}
|
6146
6146
|
|
6147
6147
|
/**
|
@@ -6528,7 +6528,7 @@ export declare interface _Identifiers {
|
|
6528
6528
|
* @beta
|
6529
6529
|
*/
|
6530
6530
|
export declare interface ImageFileMetadata extends BaseFileMetadata {
|
6531
|
-
attachmentType: 'inlineImage'
|
6531
|
+
attachmentType: 'inlineImage';
|
6532
6532
|
previewUrl?: string;
|
6533
6533
|
}
|
6534
6534
|
|
@@ -178,7 +178,7 @@ const _isValidIdentifier = (identifier) => {
|
|
178
178
|
// Copyright (c) Microsoft Corporation.
|
179
179
|
// Licensed under the MIT license.
|
180
180
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
181
|
-
var telemetryVersion = '1.7.0-alpha-
|
181
|
+
var telemetryVersion = '1.7.0-alpha-202307180021';
|
182
182
|
|
183
183
|
// Copyright (c) Microsoft Corporation.
|
184
184
|
/**
|
@@ -16184,7 +16184,11 @@ const captionContainerClassName = react.mergeStyles({
|
|
16184
16184
|
/**
|
16185
16185
|
* @private
|
16186
16186
|
*/
|
16187
|
-
const captionsBannerClassName =
|
16187
|
+
const captionsBannerClassName = (formFactor) => {
|
16188
|
+
return {
|
16189
|
+
root: Object.assign({ overflowX: 'hidden', height: formFactor === 'compact' ? '4.5rem' : '6.25rem', overflowY: 'auto' }, scrollbarStyles)
|
16190
|
+
};
|
16191
|
+
};
|
16188
16192
|
/**
|
16189
16193
|
* @private
|
16190
16194
|
*/
|
@@ -16239,7 +16243,7 @@ const _Caption = (props) => {
|
|
16239
16243
|
* A component for displaying a CaptionsBanner with user icon, displayName and captions text.
|
16240
16244
|
*/
|
16241
16245
|
const _CaptionsBanner = (props) => {
|
16242
|
-
const { captions, isCaptionsOn, startCaptionsInProgress, onRenderAvatar, strings } = props;
|
16246
|
+
const { captions, isCaptionsOn, startCaptionsInProgress, onRenderAvatar, strings, formFactor = 'default' } = props;
|
16243
16247
|
const captionsScrollDivRef = React.useRef(null);
|
16244
16248
|
const [isAtBottomOfScroll, setIsAtBottomOfScroll] = React.useState(true);
|
16245
16249
|
const scrollToBottom = () => {
|
@@ -16270,7 +16274,7 @@ const _CaptionsBanner = (props) => {
|
|
16270
16274
|
}, [captions, isAtBottomOfScroll]);
|
16271
16275
|
return (React__default['default'].createElement(React__default['default'].Fragment, null, startCaptionsInProgress && (React__default['default'].createElement(react.FocusZone, { as: "ul", className: captionsContainerClassName },
|
16272
16276
|
isCaptionsOn && (React__default['default'].createElement(c, { innerRef: captionsScrollDivRef },
|
16273
|
-
React__default['default'].createElement(react.Stack, { verticalAlign: "start",
|
16277
|
+
React__default['default'].createElement(react.Stack, { verticalAlign: "start", styles: captionsBannerClassName(formFactor) }, captions.map((caption) => {
|
16274
16278
|
return (React__default['default'].createElement("div", { key: caption.id, className: captionContainerClassName, "data-is-focusable": true },
|
16275
16279
|
React__default['default'].createElement(_Caption, Object.assign({}, caption, { onRenderAvatar: onRenderAvatar }))));
|
16276
16280
|
})))),
|
@@ -21636,11 +21640,10 @@ const CaptionsBanner = (props) => {
|
|
21636
21640
|
};
|
21637
21641
|
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
21638
21642
|
/* @conditional-compile-remove(close-captions) */ isCaptionsSettingsOpen && (React__default['default'].createElement(CaptionsSettingsModal, { showCaptionsSettingsModal: isCaptionsSettingsOpen, onDismissCaptionsSettings: onDismissCaptionsSettings })),
|
21639
|
-
/* @conditional-compile-remove(close-captions) */
|
21640
|
-
React__default['default'].createElement("div", { className: containerClassName },
|
21643
|
+
/* @conditional-compile-remove(close-captions) */ React__default['default'].createElement("div", { className: containerClassName },
|
21641
21644
|
React__default['default'].createElement(react.Stack, { horizontalAlign: "center" },
|
21642
21645
|
React__default['default'].createElement(react.Stack.Item, { style: { width: props.isMobile ? mobileViewBannerWidth : desktopViewBannerWidth } },
|
21643
|
-
React__default['default'].createElement(_CaptionsBanner, Object.assign({}, captionsBannerProps, handlers, { strings: captionsBannerStrings })))),
|
21646
|
+
React__default['default'].createElement(_CaptionsBanner, Object.assign({}, captionsBannerProps, handlers, { formFactor: props.isMobile ? 'compact' : 'default', strings: captionsBannerStrings })))),
|
21644
21647
|
!props.isMobile && captionsBannerProps.isCaptionsOn && (React__default['default'].createElement("div", { className: floatingChildClassName },
|
21645
21648
|
React__default['default'].createElement(CaptionsBannerMoreButton, { onCaptionsSettingsClick: onClickCaptionsSettings }))))));
|
21646
21649
|
};
|
@@ -22143,12 +22146,14 @@ const bannerNotificationStyles = {
|
|
22143
22146
|
/**
|
22144
22147
|
* @private
|
22145
22148
|
*/
|
22146
|
-
const callArrangementContainerStyles = {
|
22147
|
-
|
22148
|
-
|
22149
|
-
|
22150
|
-
|
22151
|
-
|
22149
|
+
const callArrangementContainerStyles = (verticalControlBar) => {
|
22150
|
+
return {
|
22151
|
+
root: {
|
22152
|
+
width: '100%',
|
22153
|
+
height: '100%',
|
22154
|
+
flexDirection: verticalControlBar ? 'unset' : 'column-reverse' // to allow first initial keyboard focus on ControlBar
|
22155
|
+
}
|
22156
|
+
};
|
22152
22157
|
};
|
22153
22158
|
|
22154
22159
|
// Copyright (c) Microsoft Corporation.
|
@@ -22262,7 +22267,7 @@ const CallControls = (props) => {
|
|
22262
22267
|
/* @conditional-compile-remove(PSTN-calls) */
|
22263
22268
|
React__default['default'].createElement(SendDtmfDialpad, { isMobile: !!props.isMobile, strings: dialpadStrings, showDialpad: showDialpad, onDismissDialpad: onDismissDialpad }),
|
22264
22269
|
React__default['default'].createElement(react.Stack.Item, null,
|
22265
|
-
React__default['default'].createElement(ControlBar, { layout:
|
22270
|
+
React__default['default'].createElement(ControlBar, { layout: props.displayVertical ? 'vertical' : 'horizontal', styles: controlBarStyles(theme.semanticColors.bodyBackground) },
|
22266
22271
|
microphoneButtonIsEnabled && (React__default['default'].createElement(Microphone, { displayType: options === null || options === void 0 ? void 0 : options.displayType, disabled: isDisabled$2(options === null || options === void 0 ? void 0 : options.microphoneButton) })),
|
22267
22272
|
cameraButtonIsEnabled && (React__default['default'].createElement(Camera, { displayType: options === null || options === void 0 ? void 0 : options.displayType, disabled: isDisabled$2(options === null || options === void 0 ? void 0 : options.cameraButton) })),
|
22268
22273
|
screenShareButtonIsEnabled && (React__default['default'].createElement(ScreenShare, { option: options === null || options === void 0 ? void 0 : options.screenShareButton, displayType: options === null || options === void 0 ? void 0 : options.displayType, disabled: isDisabled$2(options === null || options === void 0 ? void 0 : options.screenShareButton) })),
|
@@ -22723,7 +22728,7 @@ const CommonCallControlBar = (props) => {
|
|
22723
22728
|
React__default['default'].createElement(HiddenFocusStartPoint, null),
|
22724
22729
|
React__default['default'].createElement(react.Stack.Item, null,
|
22725
22730
|
React__default['default'].createElement("div", { ref: controlBarContainerRef },
|
22726
|
-
React__default['default'].createElement(ControlBar, { layout:
|
22731
|
+
React__default['default'].createElement(ControlBar, { layout: props.displayVertical ? 'vertical' : 'horizontal', styles: centerContainerStyles },
|
22727
22732
|
microphoneButtonIsEnabled && (React__default['default'].createElement(Microphone, { displayType: options.displayType, styles: commonButtonStyles, splitButtonsForDeviceSelection: !props.mobileView,
|
22728
22733
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
22729
22734
|
disabled: props.disableButtonsForHoldScreen || isDisabled$2(options.microphoneButton) })),
|
@@ -24003,7 +24008,9 @@ const localVideoSelector = reselect__namespace.createSelector([callStatusSelecto
|
|
24003
24008
|
return {
|
24004
24009
|
isAvailable: !!localVideoStream,
|
24005
24010
|
isMirrored: (_a = localVideoStream === null || localVideoStream === void 0 ? void 0 : localVideoStream.view) === null || _a === void 0 ? void 0 : _a.isMirrored,
|
24006
|
-
renderElement: (_b = localVideoStream === null || localVideoStream === void 0 ? void 0 : localVideoStream.view) === null || _b === void 0 ? void 0 : _b.target
|
24011
|
+
renderElement: (_b = localVideoStream === null || localVideoStream === void 0 ? void 0 : localVideoStream.view) === null || _b === void 0 ? void 0 : _b.target,
|
24012
|
+
/* @conditional-compile-remove(video-background-effects) */
|
24013
|
+
activeVideoEffects: localVideoStream === null || localVideoStream === void 0 ? void 0 : localVideoStream.videoEffects
|
24007
24014
|
};
|
24008
24015
|
});
|
24009
24016
|
|
@@ -24022,6 +24029,7 @@ var __awaiter$9 = (window && window.__awaiter) || function (thisArg, _arguments,
|
|
24022
24029
|
*/
|
24023
24030
|
/** @beta */
|
24024
24031
|
const VideoEffectsPaneContent = (props) => {
|
24032
|
+
var _a;
|
24025
24033
|
const { onDismissError, activeVideoEffectError,
|
24026
24034
|
/* @conditional-compile-remove(video-background-effects) */
|
24027
24035
|
activeVideoEffectChange } = props;
|
@@ -24032,6 +24040,8 @@ const VideoEffectsPaneContent = (props) => {
|
|
24032
24040
|
/* @conditional-compile-remove(video-background-effects) */
|
24033
24041
|
const strings = locale.strings.call;
|
24034
24042
|
/* @conditional-compile-remove(video-background-effects) */
|
24043
|
+
const activeVideoEffects = (_a = useSelector$1(localVideoSelector).activeVideoEffects) === null || _a === void 0 ? void 0 : _a.activeEffects;
|
24044
|
+
/* @conditional-compile-remove(video-background-effects) */
|
24035
24045
|
const selectableVideoEffects = React.useMemo(() => {
|
24036
24046
|
const videoEffects = [
|
24037
24047
|
{
|
@@ -24078,19 +24088,19 @@ const VideoEffectsPaneContent = (props) => {
|
|
24078
24088
|
const blurEffect = {
|
24079
24089
|
effectName: effectKey
|
24080
24090
|
};
|
24081
|
-
adapter.updateSelectedVideoBackgroundEffect(blurEffect);
|
24082
24091
|
activeVideoEffectChange({
|
24083
24092
|
type: 'blur',
|
24084
24093
|
timestamp: new Date(Date.now())
|
24085
24094
|
});
|
24086
24095
|
yield adapter.startVideoBackgroundEffect(blurEffect);
|
24096
|
+
adapter.updateSelectedVideoBackgroundEffect(blurEffect);
|
24087
24097
|
}
|
24088
24098
|
else if (effectKey === 'none') {
|
24089
24099
|
const noneEffect = {
|
24090
24100
|
effectName: effectKey
|
24091
24101
|
};
|
24092
|
-
adapter.updateSelectedVideoBackgroundEffect(noneEffect);
|
24093
24102
|
yield adapter.stopVideoBackgroundEffects();
|
24103
|
+
adapter.updateSelectedVideoBackgroundEffect(noneEffect);
|
24094
24104
|
}
|
24095
24105
|
else {
|
24096
24106
|
const backgroundImg = selectableVideoEffects.find((effect) => {
|
@@ -24102,15 +24112,22 @@ const VideoEffectsPaneContent = (props) => {
|
|
24102
24112
|
key: effectKey,
|
24103
24113
|
backgroundImageUrl: backgroundImg.backgroundProps.url
|
24104
24114
|
};
|
24105
|
-
adapter.updateSelectedVideoBackgroundEffect(replaceEffect);
|
24106
24115
|
activeVideoEffectChange({
|
24107
24116
|
type: 'replacement',
|
24108
24117
|
timestamp: new Date(Date.now())
|
24109
24118
|
});
|
24110
24119
|
yield adapter.startVideoBackgroundEffect(replaceEffect);
|
24120
|
+
adapter.updateSelectedVideoBackgroundEffect(replaceEffect);
|
24111
24121
|
}
|
24112
24122
|
}
|
24113
24123
|
}), [adapter, activeVideoEffectChange, selectableVideoEffects]);
|
24124
|
+
/* @conditional-compile-remove(video-background-effects) */
|
24125
|
+
if (activeVideoEffectError && activeVideoEffects && activeVideoEffects.length === 0) {
|
24126
|
+
const noneEffect = {
|
24127
|
+
effectName: 'none'
|
24128
|
+
};
|
24129
|
+
adapter.updateSelectedVideoBackgroundEffect(noneEffect);
|
24130
|
+
}
|
24114
24131
|
return VideoEffectsPaneTrampoline(onDismissError, activeVideoEffectError,
|
24115
24132
|
/* @conditional-compile-remove(video-background-effects) */
|
24116
24133
|
selectableVideoEffects,
|
@@ -24599,14 +24616,18 @@ const CallArrangement = (props) => {
|
|
24599
24616
|
const hasJoinedCall = useSelector$1(getCallStatus) === 'Connected';
|
24600
24617
|
const minMaxDragPosition = useMinMaxDragPosition(props.modalLayerHostId);
|
24601
24618
|
const pipStyles = React.useMemo(() => getPipStyles(theme), [theme]);
|
24619
|
+
const verticalControlBar = props.mobileView && containerWidth && containerHeight && containerWidth / containerHeight > 1 ? true : false;
|
24602
24620
|
return (React__default['default'].createElement("div", { ref: containerRef, className: react.mergeStyles(containerDivStyles), id: props.id },
|
24603
24621
|
React__default['default'].createElement(react.Stack, { verticalFill: true, horizontalAlign: "stretch", className: containerClassName, "data-ui-id": props.dataUiId },
|
24604
|
-
React__default['default'].createElement(react.Stack, { grow: true, styles: callArrangementContainerStyles },
|
24605
|
-
((_b = props.callControlProps) === null || _b === void 0 ? void 0 : _b.options) !== false && !isMobileWithActivePane && (React__default['default'].createElement(react.Stack
|
24622
|
+
React__default['default'].createElement(react.Stack, { reversed: true, horizontal: verticalControlBar, grow: true, styles: callArrangementContainerStyles(verticalControlBar) },
|
24623
|
+
((_b = props.callControlProps) === null || _b === void 0 ? void 0 : _b.options) !== false && !isMobileWithActivePane && (React__default['default'].createElement(react.Stack, { verticalAlign: 'center', className: react.mergeStyles({
|
24624
|
+
zIndex: CONTROL_BAR_Z_INDEX,
|
24625
|
+
padding: verticalControlBar ? '0.25rem' : 'unset'
|
24626
|
+
}) }, isLegacyCallControlEnabled((_c = props.callControlProps) === null || _c === void 0 ? void 0 : _c.options) ? (React__default['default'].createElement(CallControls, Object.assign({}, props.callControlProps, { containerWidth: containerWidth, containerHeight: containerHeight, isMobile: props.mobileView,
|
24606
24627
|
/* @conditional-compile-remove(one-to-n-calling) */
|
24607
24628
|
peopleButtonChecked: isPeoplePaneOpen,
|
24608
24629
|
/* @conditional-compile-remove(one-to-n-calling) */
|
24609
|
-
onPeopleButtonClicked: togglePeoplePane }))) : (React__default['default'].createElement(CommonCallControlBar, Object.assign({}, props.callControlProps, { callControls: props.callControlProps.options, callAdapter: adapter, mobileView: props.mobileView, disableButtonsForLobbyPage: isInLobby,
|
24630
|
+
onPeopleButtonClicked: togglePeoplePane, displayVertical: verticalControlBar }))) : (React__default['default'].createElement(CommonCallControlBar, Object.assign({}, props.callControlProps, { callControls: props.callControlProps.options, callAdapter: adapter, mobileView: props.mobileView, disableButtonsForLobbyPage: isInLobby,
|
24610
24631
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
24611
24632
|
disableButtonsForHoldScreen: isInLocalHold, peopleButtonChecked: isPeoplePaneOpen, onPeopleButtonClicked: togglePeoplePane, onMoreButtonClicked: onMoreButtonClicked,
|
24612
24633
|
/* @conditional-compile-remove(close-captions) */
|
@@ -24614,7 +24635,7 @@ const CallArrangement = (props) => {
|
|
24614
24635
|
/* @conditional-compile-remove(video-background-effects) */
|
24615
24636
|
onShowVideoEffectsPicker: openVideoEffectsPane,
|
24616
24637
|
/* @conditional-compile-remove(PSTN-calls) */
|
24617
|
-
onClickShowDialpad: alternateCallerId ? onClickShowDialpad : undefined }))))),
|
24638
|
+
onClickShowDialpad: alternateCallerId ? onClickShowDialpad : undefined, displayVertical: verticalControlBar }))))),
|
24618
24639
|
((_d = props.callControlProps) === null || _d === void 0 ? void 0 : _d.options) !== false && showDrawer && (React__default['default'].createElement(react.Stack, { styles: drawerContainerStylesValue },
|
24619
24640
|
React__default['default'].createElement(PreparedMoreDrawer, { callControls: props.callControlProps.options, onLightDismiss: closeDrawer, onPeopleButtonClicked: onMoreDrawerPeopleClicked,
|
24620
24641
|
/* @conditional-compile-remove(PSTN-calls) */
|
@@ -28627,11 +28648,6 @@ const notificationTextStyles = react.memoizeFunction((theme) => ({
|
|
28627
28648
|
}));
|
28628
28649
|
|
28629
28650
|
// Copyright (c) Microsoft Corporation.
|
28630
|
-
/**
|
28631
|
-
* Helper function to determine if the message in the event is a valid one from a user.
|
28632
|
-
* Display name is used since system messages will not have one.
|
28633
|
-
*/
|
28634
|
-
const validNewChatMessage = (message) => !!message.senderDisplayName && (message.type === 'text' || message.type === 'html');
|
28635
28651
|
const filledIcon = React__default['default'].createElement(CallWithChatCompositeIcon, { iconName: 'ControlBarChatButtonActive' });
|
28636
28652
|
const regularIcon = React__default['default'].createElement(CallWithChatCompositeIcon, { iconName: 'ControlBarChatButtonInactive' });
|
28637
28653
|
/**
|
@@ -28639,8 +28655,7 @@ const regularIcon = React__default['default'].createElement(CallWithChatComposit
|
|
28639
28655
|
*/
|
28640
28656
|
const ChatButtonWithUnreadMessagesBadge = (props) => {
|
28641
28657
|
var _a, _b, _c, _d;
|
28642
|
-
const {
|
28643
|
-
const [unreadChatMessagesCount, setUnreadChatMessagesCount] = React.useState(0);
|
28658
|
+
const { newMessageLabel, unreadChatMessagesCount, hideUnreadChatMessagesBadge } = props;
|
28644
28659
|
const baseIcon = props.showLabel ? regularIcon : filledIcon;
|
28645
28660
|
const callWithChatStrings = useCallWithChatCompositeStrings();
|
28646
28661
|
const numberOfMsgToolTip = ((_a = props.strings) === null || _a === void 0 ? void 0 : _a.tooltipOffContent) && unreadChatMessagesCount > 0
|
@@ -28659,9 +28674,25 @@ const ChatButtonWithUnreadMessagesBadge = (props) => {
|
|
28659
28674
|
const onRenderOnIcon = React.useCallback(() => baseIcon, [baseIcon]);
|
28660
28675
|
const notificationOnIcon = React.useCallback(() => {
|
28661
28676
|
return (React__default['default'].createElement(react.Stack, { styles: chatNotificationContainerStyles },
|
28662
|
-
unreadChatMessagesCount > 0 && (React__default['default'].createElement(NotificationIcon, { chatMessagesCount: unreadChatMessagesCount, label: newMessageLabel })),
|
28677
|
+
unreadChatMessagesCount > 0 && !hideUnreadChatMessagesBadge && (React__default['default'].createElement(NotificationIcon, { chatMessagesCount: unreadChatMessagesCount, label: newMessageLabel })),
|
28663
28678
|
baseIcon));
|
28664
|
-
}, [unreadChatMessagesCount, newMessageLabel, baseIcon]);
|
28679
|
+
}, [unreadChatMessagesCount, newMessageLabel, baseIcon, hideUnreadChatMessagesBadge]);
|
28680
|
+
return (React__default['default'].createElement(ChatButton, Object.assign({}, props, { "data-ui-id": "call-with-chat-composite-chat-button", onRenderOffIcon: notificationOnIcon, onRenderOnIcon: onRenderOnIcon, strings: chatStrings })));
|
28681
|
+
};
|
28682
|
+
const chatNotificationContainerStyles = {
|
28683
|
+
root: {
|
28684
|
+
display: 'inline',
|
28685
|
+
position: 'relative'
|
28686
|
+
}
|
28687
|
+
};
|
28688
|
+
|
28689
|
+
// Copyright (c) Microsoft Corporation.
|
28690
|
+
/**
|
28691
|
+
* Used by the CallWithChatComposite to track unread messages for showing as a badge on the Chat Button.
|
28692
|
+
* @private
|
28693
|
+
*/
|
28694
|
+
const useUnreadMessagesTracker = (chatAdapter, isChatPaneVisible) => {
|
28695
|
+
const [unreadChatMessagesCount, setUnreadChatMessagesCount] = React.useState(0);
|
28665
28696
|
React.useEffect(() => {
|
28666
28697
|
if (isChatPaneVisible) {
|
28667
28698
|
setUnreadChatMessagesCount(0);
|
@@ -28677,14 +28708,13 @@ const ChatButtonWithUnreadMessagesBadge = (props) => {
|
|
28677
28708
|
chatAdapter.off('messageReceived', incrementUnreadChatMessagesCount);
|
28678
28709
|
};
|
28679
28710
|
}, [chatAdapter, setUnreadChatMessagesCount, isChatPaneVisible, unreadChatMessagesCount]);
|
28680
|
-
return
|
28681
|
-
};
|
28682
|
-
const chatNotificationContainerStyles = {
|
28683
|
-
root: {
|
28684
|
-
display: 'inline',
|
28685
|
-
position: 'relative'
|
28686
|
-
}
|
28711
|
+
return unreadChatMessagesCount;
|
28687
28712
|
};
|
28713
|
+
/**
|
28714
|
+
* Helper function to determine if the message in the event is a valid one from a user.
|
28715
|
+
* Display name is used since system messages will not have one.
|
28716
|
+
*/
|
28717
|
+
const validNewChatMessage = (message) => !!message.senderDisplayName && (message.type === 'text' || message.type === 'html');
|
28688
28718
|
|
28689
28719
|
// Copyright (c) Microsoft Corporation.
|
28690
28720
|
const CallWithChatScreen = (props) => {
|
@@ -28762,18 +28792,22 @@ const CallWithChatScreen = (props) => {
|
|
28762
28792
|
disabled: chatButtonDisabled
|
28763
28793
|
}
|
28764
28794
|
: undefined, [chatButtonDisabled, mobileView, toggleChat, showChatButton]);
|
28795
|
+
const unreadChatMessagesCount = useUnreadMessagesTracker(chatProps.adapter, isChatOpen);
|
28765
28796
|
const customChatButton = React.useCallback((args) => ({
|
28766
28797
|
placement: mobileView ? 'primary' : 'secondary',
|
28767
|
-
onRenderButton: () => (React__default['default'].createElement(ChatButtonWithUnreadMessagesBadge, {
|
28798
|
+
onRenderButton: () => (React__default['default'].createElement(ChatButtonWithUnreadMessagesBadge, { checked: isChatOpen, showLabel: args.displayType !== 'compact', onClick: toggleChat, disabled: chatButtonDisabled, strings: chatButtonStrings, styles: commonButtonStyles, newMessageLabel: callWithChatStrings.chatButtonNewMessageNotificationLabel, unreadChatMessagesCount: unreadChatMessagesCount,
|
28799
|
+
// As chat is disabled when on hold, we don't want to show the unread badge when on hold
|
28800
|
+
hideUnreadChatMessagesBadge: isOnHold }))
|
28768
28801
|
}), [
|
28769
28802
|
callWithChatStrings.chatButtonNewMessageNotificationLabel,
|
28770
28803
|
chatButtonStrings,
|
28771
|
-
chatProps.adapter,
|
28772
28804
|
commonButtonStyles,
|
28773
28805
|
isChatOpen,
|
28774
28806
|
chatButtonDisabled,
|
28775
28807
|
mobileView,
|
28776
|
-
toggleChat
|
28808
|
+
toggleChat,
|
28809
|
+
unreadChatMessagesCount,
|
28810
|
+
isOnHold
|
28777
28811
|
]);
|
28778
28812
|
const callControlOptionsFromProps = React.useMemo(() => (Object.assign({}, (typeof props.callControls === 'object' ? props.callControls : {}))), [props.callControls]);
|
28779
28813
|
const injectedCustomButtonsFromProps = React.useMemo(() => {
|