@azure/communication-react 1.7.0-alpha-202307150015 → 1.7.0-alpha-202307190021

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/communication-react.d.ts +20 -3
  2. package/dist/dist-cjs/communication-react/index.js +118 -47
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  6. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +16 -0
  7. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  8. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +2 -0
  9. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +9 -0
  10. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  11. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +1 -0
  12. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +6 -0
  13. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  14. package/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.d.ts +16 -0
  15. package/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.js +24 -0
  16. package/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.js.map +1 -0
  17. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +1 -0
  18. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  19. package/dist/dist-esm/react-components/src/components/CaptionsBanner.d.ts +6 -1
  20. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +2 -2
  21. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
  22. package/dist/dist-esm/react-components/src/components/FileDownloadCards.d.ts +3 -3
  23. package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +1 -1
  24. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +2 -3
  25. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +1 -1
  26. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js +3 -2
  27. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js.map +1 -1
  28. package/dist/dist-esm/react-components/src/components/styles/Captions.style.d.ts +2 -1
  29. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js +5 -1
  30. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js.map +1 -1
  31. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  32. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +8 -4
  33. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  34. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.d.ts +1 -0
  35. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +1 -1
  36. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  37. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/lobbySelector.d.ts +3 -0
  38. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localAndRemotePIPSelector.d.ts +3 -0
  39. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localVideoStreamSelector.d.ts +2 -0
  40. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localVideoStreamSelector.js +3 -1
  41. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localVideoStreamSelector.js.map +1 -1
  42. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/networkReconnectTileSelector.d.ts +3 -0
  43. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.d.ts +5 -1
  44. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js +14 -4
  45. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js.map +1 -1
  46. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +8 -3
  47. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  48. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButtonWithUnreadMessagesBadge.d.ts +3 -4
  49. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButtonWithUnreadMessagesBadge.js +4 -26
  50. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButtonWithUnreadMessagesBadge.js.map +1 -1
  51. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/useUnreadMessagesTracker.d.ts +7 -0
  52. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/useUnreadMessagesTracker.js +32 -0
  53. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/useUnreadMessagesTracker.js.map +1 -0
  54. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.js +2 -3
  55. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.js.map +1 -1
  56. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.d.ts +1 -0
  57. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +1 -1
  58. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  59. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +15 -5
  60. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  61. package/package.json +8 -8
@@ -74,6 +74,7 @@ import { MicrosoftTeamsUserIdentifier } from '@azure/communication-common';
74
74
  import { MicrosoftTeamsUserKind } from '@azure/communication-common';
75
75
  import type { NetworkDiagnosticChangedEventArgs } from '@azure/communication-calling';
76
76
  import { PartialTheme } from '@fluentui/react';
77
+ import { ParticipantCapabilities } from '@azure/communication-calling';
77
78
  import { ParticipantRole } from '@azure/communication-calling';
78
79
  import { PermissionConstraints } from '@azure/communication-calling';
79
80
  import { PersonaInitialsColor } from '@fluentui/react';
@@ -2332,6 +2333,10 @@ export declare interface CallState {
2332
2333
  * Transfer state of call
2333
2334
  */
2334
2335
  transfer: TransferFeature;
2336
+ /**
2337
+ * Proxy of {@link @azure/communication-calling#CapabilitiesFeature}.
2338
+ */
2339
+ capabilities?: CapabilitiesCallFeature;
2335
2340
  }
2336
2341
 
2337
2342
  /**
@@ -3398,6 +3403,18 @@ export declare type CameraSitePermissionsStrings = SitePermissionsStrings;
3398
3403
  */
3399
3404
  export declare type CancelEditCallback = (messageId: string) => void;
3400
3405
 
3406
+ /**
3407
+ * State only version of {@link @azure/communication-calling#CapabilitiesFeature}
3408
+ *
3409
+ * @beta
3410
+ */
3411
+ export declare interface CapabilitiesCallFeature {
3412
+ /**
3413
+ * Proxy of {@link @azure/communication-calling#CapabilitiesFeature.capabilities}.
3414
+ */
3415
+ capabilities: ParticipantCapabilities;
3416
+ }
3417
+
3401
3418
  /**
3402
3419
  * @beta
3403
3420
  * strings for captions setting modal
@@ -6132,7 +6149,7 @@ export declare type FileMetadata = FileSharingMetadata | /* @conditional-compile
6132
6149
  /**
6133
6150
  * @beta
6134
6151
  */
6135
- export declare type FileMetadataAttachmentType = 'fileSharing' | /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ 'inlineImage' | /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ 'attachedImage' | 'unknown';
6152
+ export declare type FileMetadataAttachmentType = 'fileSharing' | /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ 'inlineImage' | 'unknown';
6136
6153
 
6137
6154
  /**
6138
6155
  * Meta Data containing basic information about the uploaded file.
@@ -6141,7 +6158,7 @@ export declare type FileMetadataAttachmentType = 'fileSharing' | /* @conditional
6141
6158
  */
6142
6159
  export declare interface FileSharingMetadata extends BaseFileMetadata {
6143
6160
  attachmentType: 'fileSharing';
6144
- payload?: Record<string, string> | undefined;
6161
+ payload?: Record<string, string>;
6145
6162
  }
6146
6163
 
6147
6164
  /**
@@ -6528,7 +6545,7 @@ export declare interface _Identifiers {
6528
6545
  * @beta
6529
6546
  */
6530
6547
  export declare interface ImageFileMetadata extends BaseFileMetadata {
6531
- attachmentType: 'inlineImage' | 'attachedImage';
6548
+ attachmentType: 'inlineImage';
6532
6549
  previewUrl?: string;
6533
6550
  }
6534
6551
 
@@ -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-202307150015';
181
+ var telemetryVersion = '1.7.0-alpha-202307190021';
182
182
 
183
183
  // Copyright (c) Microsoft Corporation.
184
184
  /**
@@ -1843,6 +1843,15 @@ class CallContext$2 {
1843
1843
  }
1844
1844
  });
1845
1845
  }
1846
+ /* @conditional-compile-remove(capabilities) */
1847
+ setCapabilities(callId, capabilities) {
1848
+ this.modifyState((draft) => {
1849
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
1850
+ if (call) {
1851
+ call.capabilities = { capabilities: capabilities };
1852
+ }
1853
+ });
1854
+ }
1846
1855
  setCallScreenShareParticipant(callId, participantKey) {
1847
1856
  this.modifyState((draft) => {
1848
1857
  const call = draft.calls[this._callIdHistory.latestCallId(callId)];
@@ -3264,6 +3273,30 @@ class OptimalVideoCountSubscriber {
3264
3273
  }
3265
3274
  }
3266
3275
 
3276
+ // Copyright (c) Microsoft Corporation.
3277
+ // Licensed under the MIT license.
3278
+ /* @conditional-compile-remove(capabilities) */
3279
+ /**
3280
+ * @private
3281
+ */
3282
+ class CapabilitiesSubscriber {
3283
+ constructor(callIdRef, context, capabilities) {
3284
+ this.subscribe = () => {
3285
+ this._capabilitiesFeature.on('capabilitiesChanged', this.capabilitiesChanged);
3286
+ };
3287
+ this.unsubscribe = () => {
3288
+ this._capabilitiesFeature.off('capabilitiesChanged', this.capabilitiesChanged);
3289
+ };
3290
+ this.capabilitiesChanged = () => {
3291
+ this._context.setCapabilities(this._callIdRef.callId, this._capabilitiesFeature.capabilities);
3292
+ };
3293
+ this._callIdRef = callIdRef;
3294
+ this._context = context;
3295
+ this._capabilitiesFeature = capabilities;
3296
+ this.subscribe();
3297
+ }
3298
+ }
3299
+
3267
3300
  // Copyright (c) Microsoft Corporation.
3268
3301
  /**
3269
3302
  * Keeps track of the listeners assigned to a particular call because when we get an event from SDK, it doesn't tell us
@@ -3328,6 +3361,8 @@ class CallSubscriber {
3328
3361
  this._optimalVideoCountSubscriber.unsubscribe();
3329
3362
  /* @conditional-compile-remove(close-captions) */
3330
3363
  (_a = this._captionsSubscriber) === null || _a === void 0 ? void 0 : _a.unsubscribe();
3364
+ /* @conditional-compile-remove(capabilities) */
3365
+ this._capabilitiesSubscriber.unsubscribe();
3331
3366
  };
3332
3367
  this.stateChanged = () => {
3333
3368
  this._context.setCallState(this._callIdRef.callId, this._call.state);
@@ -3429,6 +3464,8 @@ class CallSubscriber {
3429
3464
  });
3430
3465
  /* @conditional-compile-remove(video-background-effects) */
3431
3466
  this._localVideoStreamVideoEffectsSubscribers = new Map();
3467
+ /* @conditional-compile-remove(capabilities) */
3468
+ this._capabilitiesSubscriber = new CapabilitiesSubscriber(this._callIdRef, this._context, this._call.feature(communicationCalling.Features.Capabilities));
3432
3469
  this.subscribe();
3433
3470
  }
3434
3471
  addParticipantListener(participant) {
@@ -7529,9 +7566,8 @@ const TextFieldWithMention = (props) => {
7529
7566
  // Update the caret position, used for positioning the suggestions popover
7530
7567
  const textField = event.currentTarget;
7531
7568
  const relativePosition = textareaCaretTs.Caret.getRelativePosition(textField);
7532
- const adjustOffset = Math.max(0, textField.scrollHeight - textField.clientHeight);
7533
- if (relativePosition.top > adjustOffset) {
7534
- relativePosition.top -= adjustOffset;
7569
+ if (textField.scrollHeight > textField.clientHeight) {
7570
+ relativePosition.top -= textField.scrollTop;
7535
7571
  }
7536
7572
  setCaretPosition(relativePosition);
7537
7573
  if (triggerPriorIndex !== undefined) {
@@ -16119,7 +16155,8 @@ const _VideoBackgroundEffectsPicker = (props) => {
16119
16155
  optionsByRow.map((options, rowIndex) => {
16120
16156
  var _a;
16121
16157
  return (React__default['default'].createElement(react.Stack, { className: react.mergeStyles((_a = props.styles) === null || _a === void 0 ? void 0 : _a.rowRoot), wrap: props.itemsPerRow === 'wrap', horizontal: true, key: rowIndex, tokens: { childrenGap: '0.5rem' }, "data-ui-id": "video-effects-picker-row" },
16122
- options.map((option) => (React__default['default'].createElement(_VideoEffectsItem, Object.assign({}, option, { key: option.itemKey, itemKey: option.itemKey })))),
16158
+ options.map((option) => (React__default['default'].createElement(react.FocusZone, { key: option.itemKey, shouldFocusOnMount: option.itemKey === 'none' },
16159
+ React__default['default'].createElement(_VideoEffectsItem, Object.assign({}, option, { itemKey: option.itemKey }))))),
16123
16160
  fillCount > 0 &&
16124
16161
  rowIndex === optionsByRow.length - 1 &&
16125
16162
  Array.from({ length: fillCount }).map((_, index) => (React__default['default'].createElement(react.Stack, { key: index, styles: hiddenVideoEffectsItemContainerStyles, "data-ui-id": "video-effects-hidden-item" })))));
@@ -16184,7 +16221,11 @@ const captionContainerClassName = react.mergeStyles({
16184
16221
  /**
16185
16222
  * @private
16186
16223
  */
16187
- const captionsBannerClassName = react.mergeStyles(Object.assign({ height: _pxToRem(100), overflowY: 'auto', overflowX: 'hidden' }, scrollbarStyles));
16224
+ const captionsBannerClassName = (formFactor) => {
16225
+ return {
16226
+ root: Object.assign({ overflowX: 'hidden', height: formFactor === 'compact' ? '4.5rem' : '6.25rem', overflowY: 'auto' }, scrollbarStyles)
16227
+ };
16228
+ };
16188
16229
  /**
16189
16230
  * @private
16190
16231
  */
@@ -16239,7 +16280,7 @@ const _Caption = (props) => {
16239
16280
  * A component for displaying a CaptionsBanner with user icon, displayName and captions text.
16240
16281
  */
16241
16282
  const _CaptionsBanner = (props) => {
16242
- const { captions, isCaptionsOn, startCaptionsInProgress, onRenderAvatar, strings } = props;
16283
+ const { captions, isCaptionsOn, startCaptionsInProgress, onRenderAvatar, strings, formFactor = 'default' } = props;
16243
16284
  const captionsScrollDivRef = React.useRef(null);
16244
16285
  const [isAtBottomOfScroll, setIsAtBottomOfScroll] = React.useState(true);
16245
16286
  const scrollToBottom = () => {
@@ -16270,7 +16311,7 @@ const _CaptionsBanner = (props) => {
16270
16311
  }, [captions, isAtBottomOfScroll]);
16271
16312
  return (React__default['default'].createElement(React__default['default'].Fragment, null, startCaptionsInProgress && (React__default['default'].createElement(react.FocusZone, { as: "ul", className: captionsContainerClassName },
16272
16313
  isCaptionsOn && (React__default['default'].createElement(c, { innerRef: captionsScrollDivRef },
16273
- React__default['default'].createElement(react.Stack, { verticalAlign: "start", className: captionsBannerClassName }, captions.map((caption) => {
16314
+ React__default['default'].createElement(react.Stack, { verticalAlign: "start", styles: captionsBannerClassName(formFactor) }, captions.map((caption) => {
16274
16315
  return (React__default['default'].createElement("div", { key: caption.id, className: captionContainerClassName, "data-is-focusable": true },
16275
16316
  React__default['default'].createElement(_Caption, Object.assign({}, caption, { onRenderAvatar: onRenderAvatar }))));
16276
16317
  })))),
@@ -21636,11 +21677,10 @@ const CaptionsBanner = (props) => {
21636
21677
  };
21637
21678
  return (React__default['default'].createElement(React__default['default'].Fragment, null,
21638
21679
  /* @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 },
21680
+ /* @conditional-compile-remove(close-captions) */ React__default['default'].createElement("div", { className: containerClassName },
21641
21681
  React__default['default'].createElement(react.Stack, { horizontalAlign: "center" },
21642
21682
  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 })))),
21683
+ React__default['default'].createElement(_CaptionsBanner, Object.assign({}, captionsBannerProps, handlers, { formFactor: props.isMobile ? 'compact' : 'default', strings: captionsBannerStrings })))),
21644
21684
  !props.isMobile && captionsBannerProps.isCaptionsOn && (React__default['default'].createElement("div", { className: floatingChildClassName },
21645
21685
  React__default['default'].createElement(CaptionsBannerMoreButton, { onCaptionsSettingsClick: onClickCaptionsSettings }))))));
21646
21686
  };
@@ -22143,12 +22183,14 @@ const bannerNotificationStyles = {
22143
22183
  /**
22144
22184
  * @private
22145
22185
  */
22146
- const callArrangementContainerStyles = {
22147
- root: {
22148
- width: '100%',
22149
- height: '100%',
22150
- flexDirection: 'column-reverse' // to allow first initial keyboard focus on ControlBar
22151
- }
22186
+ const callArrangementContainerStyles = (verticalControlBar) => {
22187
+ return {
22188
+ root: {
22189
+ width: '100%',
22190
+ height: '100%',
22191
+ flexDirection: verticalControlBar ? 'unset' : 'column-reverse' // to allow first initial keyboard focus on ControlBar
22192
+ }
22193
+ };
22152
22194
  };
22153
22195
 
22154
22196
  // Copyright (c) Microsoft Corporation.
@@ -22262,7 +22304,7 @@ const CallControls = (props) => {
22262
22304
  /* @conditional-compile-remove(PSTN-calls) */
22263
22305
  React__default['default'].createElement(SendDtmfDialpad, { isMobile: !!props.isMobile, strings: dialpadStrings, showDialpad: showDialpad, onDismissDialpad: onDismissDialpad }),
22264
22306
  React__default['default'].createElement(react.Stack.Item, null,
22265
- React__default['default'].createElement(ControlBar, { layout: "horizontal", styles: controlBarStyles(theme.semanticColors.bodyBackground) },
22307
+ React__default['default'].createElement(ControlBar, { layout: props.displayVertical ? 'vertical' : 'horizontal', styles: controlBarStyles(theme.semanticColors.bodyBackground) },
22266
22308
  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
22309
  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
22310
  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 +22765,7 @@ const CommonCallControlBar = (props) => {
22723
22765
  React__default['default'].createElement(HiddenFocusStartPoint, null),
22724
22766
  React__default['default'].createElement(react.Stack.Item, null,
22725
22767
  React__default['default'].createElement("div", { ref: controlBarContainerRef },
22726
- React__default['default'].createElement(ControlBar, { layout: "horizontal", styles: centerContainerStyles },
22768
+ React__default['default'].createElement(ControlBar, { layout: props.displayVertical ? 'vertical' : 'horizontal', styles: centerContainerStyles },
22727
22769
  microphoneButtonIsEnabled && (React__default['default'].createElement(Microphone, { displayType: options.displayType, styles: commonButtonStyles, splitButtonsForDeviceSelection: !props.mobileView,
22728
22770
  /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
22729
22771
  disabled: props.disableButtonsForHoldScreen || isDisabled$2(options.microphoneButton) })),
@@ -24003,7 +24045,9 @@ const localVideoSelector = reselect__namespace.createSelector([callStatusSelecto
24003
24045
  return {
24004
24046
  isAvailable: !!localVideoStream,
24005
24047
  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
24048
+ renderElement: (_b = localVideoStream === null || localVideoStream === void 0 ? void 0 : localVideoStream.view) === null || _b === void 0 ? void 0 : _b.target,
24049
+ /* @conditional-compile-remove(video-background-effects) */
24050
+ activeVideoEffects: localVideoStream === null || localVideoStream === void 0 ? void 0 : localVideoStream.videoEffects
24007
24051
  };
24008
24052
  });
24009
24053
 
@@ -24022,6 +24066,7 @@ var __awaiter$9 = (window && window.__awaiter) || function (thisArg, _arguments,
24022
24066
  */
24023
24067
  /** @beta */
24024
24068
  const VideoEffectsPaneContent = (props) => {
24069
+ var _a;
24025
24070
  const { onDismissError, activeVideoEffectError,
24026
24071
  /* @conditional-compile-remove(video-background-effects) */
24027
24072
  activeVideoEffectChange } = props;
@@ -24032,6 +24077,8 @@ const VideoEffectsPaneContent = (props) => {
24032
24077
  /* @conditional-compile-remove(video-background-effects) */
24033
24078
  const strings = locale.strings.call;
24034
24079
  /* @conditional-compile-remove(video-background-effects) */
24080
+ const activeVideoEffects = (_a = useSelector$1(localVideoSelector).activeVideoEffects) === null || _a === void 0 ? void 0 : _a.activeEffects;
24081
+ /* @conditional-compile-remove(video-background-effects) */
24035
24082
  const selectableVideoEffects = React.useMemo(() => {
24036
24083
  const videoEffects = [
24037
24084
  {
@@ -24078,19 +24125,19 @@ const VideoEffectsPaneContent = (props) => {
24078
24125
  const blurEffect = {
24079
24126
  effectName: effectKey
24080
24127
  };
24081
- adapter.updateSelectedVideoBackgroundEffect(blurEffect);
24082
24128
  activeVideoEffectChange({
24083
24129
  type: 'blur',
24084
24130
  timestamp: new Date(Date.now())
24085
24131
  });
24086
24132
  yield adapter.startVideoBackgroundEffect(blurEffect);
24133
+ adapter.updateSelectedVideoBackgroundEffect(blurEffect);
24087
24134
  }
24088
24135
  else if (effectKey === 'none') {
24089
24136
  const noneEffect = {
24090
24137
  effectName: effectKey
24091
24138
  };
24092
- adapter.updateSelectedVideoBackgroundEffect(noneEffect);
24093
24139
  yield adapter.stopVideoBackgroundEffects();
24140
+ adapter.updateSelectedVideoBackgroundEffect(noneEffect);
24094
24141
  }
24095
24142
  else {
24096
24143
  const backgroundImg = selectableVideoEffects.find((effect) => {
@@ -24102,15 +24149,22 @@ const VideoEffectsPaneContent = (props) => {
24102
24149
  key: effectKey,
24103
24150
  backgroundImageUrl: backgroundImg.backgroundProps.url
24104
24151
  };
24105
- adapter.updateSelectedVideoBackgroundEffect(replaceEffect);
24106
24152
  activeVideoEffectChange({
24107
24153
  type: 'replacement',
24108
24154
  timestamp: new Date(Date.now())
24109
24155
  });
24110
24156
  yield adapter.startVideoBackgroundEffect(replaceEffect);
24157
+ adapter.updateSelectedVideoBackgroundEffect(replaceEffect);
24111
24158
  }
24112
24159
  }
24113
24160
  }), [adapter, activeVideoEffectChange, selectableVideoEffects]);
24161
+ /* @conditional-compile-remove(video-background-effects) */
24162
+ if (activeVideoEffectError && activeVideoEffects && activeVideoEffects.length === 0) {
24163
+ const noneEffect = {
24164
+ effectName: 'none'
24165
+ };
24166
+ adapter.updateSelectedVideoBackgroundEffect(noneEffect);
24167
+ }
24114
24168
  return VideoEffectsPaneTrampoline(onDismissError, activeVideoEffectError,
24115
24169
  /* @conditional-compile-remove(video-background-effects) */
24116
24170
  selectableVideoEffects,
@@ -24127,7 +24181,7 @@ const VideoEffectsPaneTrampoline = (onDismissError, activeVideoEffectError, sele
24127
24181
  /* @conditional-compile-remove(video-background-effects) */
24128
24182
  const locale = useLocale();
24129
24183
  /* @conditional-compile-remove(video-background-effects) */
24130
- return (React__default['default'].createElement(react.Stack, { horizontalAlign: "center" },
24184
+ return (React__default['default'].createElement(react.Stack, { className: react.mergeStyles({ paddingLeft: '0.5rem' }) },
24131
24185
  activeVideoEffectError && isCameraOn && (React__default['default'].createElement(react.MessageBar, { messageBarType: react.MessageBarType.error, onDismiss: () => onDismissError(activeVideoEffectError) }, locale.strings.call.unableToStartVideoEffect)),
24132
24186
  showWarning && (React__default['default'].createElement(react.MessageBar, { messageBarType: react.MessageBarType.warning }, locale.strings.call.cameraOffBackgroundEffectWarningText)),
24133
24187
  React__default['default'].createElement(_VideoBackgroundEffectsPicker, { label: locale.strings.call.videoEffectsPaneBackgroundSelectionTitle, styles: backgroundPickerStyles, options: selectableVideoEffects !== null && selectableVideoEffects !== void 0 ? selectableVideoEffects : [], onChange: onEffectChange, selectedEffectKey: selectedEffect })));
@@ -24599,14 +24653,18 @@ const CallArrangement = (props) => {
24599
24653
  const hasJoinedCall = useSelector$1(getCallStatus) === 'Connected';
24600
24654
  const minMaxDragPosition = useMinMaxDragPosition(props.modalLayerHostId);
24601
24655
  const pipStyles = React.useMemo(() => getPipStyles(theme), [theme]);
24656
+ const verticalControlBar = props.mobileView && containerWidth && containerHeight && containerWidth / containerHeight > 1 ? true : false;
24602
24657
  return (React__default['default'].createElement("div", { ref: containerRef, className: react.mergeStyles(containerDivStyles), id: props.id },
24603
24658
  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.Item, { className: react.mergeStyles({ zIndex: CONTROL_BAR_Z_INDEX }) }, 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,
24659
+ React__default['default'].createElement(react.Stack, { reversed: true, horizontal: verticalControlBar, grow: true, styles: callArrangementContainerStyles(verticalControlBar) },
24660
+ ((_b = props.callControlProps) === null || _b === void 0 ? void 0 : _b.options) !== false && !isMobileWithActivePane && (React__default['default'].createElement(react.Stack, { verticalAlign: 'center', className: react.mergeStyles({
24661
+ zIndex: CONTROL_BAR_Z_INDEX,
24662
+ padding: verticalControlBar ? '0.25rem' : 'unset'
24663
+ }) }, 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
24664
  /* @conditional-compile-remove(one-to-n-calling) */
24607
24665
  peopleButtonChecked: isPeoplePaneOpen,
24608
24666
  /* @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,
24667
+ 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
24668
  /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
24611
24669
  disableButtonsForHoldScreen: isInLocalHold, peopleButtonChecked: isPeoplePaneOpen, onPeopleButtonClicked: togglePeoplePane, onMoreButtonClicked: onMoreButtonClicked,
24612
24670
  /* @conditional-compile-remove(close-captions) */
@@ -24614,7 +24672,7 @@ const CallArrangement = (props) => {
24614
24672
  /* @conditional-compile-remove(video-background-effects) */
24615
24673
  onShowVideoEffectsPicker: openVideoEffectsPane,
24616
24674
  /* @conditional-compile-remove(PSTN-calls) */
24617
- onClickShowDialpad: alternateCallerId ? onClickShowDialpad : undefined }))))),
24675
+ onClickShowDialpad: alternateCallerId ? onClickShowDialpad : undefined, displayVertical: verticalControlBar }))))),
24618
24676
  ((_d = props.callControlProps) === null || _d === void 0 ? void 0 : _d.options) !== false && showDrawer && (React__default['default'].createElement(react.Stack, { styles: drawerContainerStylesValue },
24619
24677
  React__default['default'].createElement(PreparedMoreDrawer, { callControls: props.callControlProps.options, onLightDismiss: closeDrawer, onPeopleButtonClicked: onMoreDrawerPeopleClicked,
24620
24678
  /* @conditional-compile-remove(PSTN-calls) */
@@ -28627,11 +28685,6 @@ const notificationTextStyles = react.memoizeFunction((theme) => ({
28627
28685
  }));
28628
28686
 
28629
28687
  // 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
28688
  const filledIcon = React__default['default'].createElement(CallWithChatCompositeIcon, { iconName: 'ControlBarChatButtonActive' });
28636
28689
  const regularIcon = React__default['default'].createElement(CallWithChatCompositeIcon, { iconName: 'ControlBarChatButtonInactive' });
28637
28690
  /**
@@ -28639,8 +28692,7 @@ const regularIcon = React__default['default'].createElement(CallWithChatComposit
28639
28692
  */
28640
28693
  const ChatButtonWithUnreadMessagesBadge = (props) => {
28641
28694
  var _a, _b, _c, _d;
28642
- const { chatAdapter, isChatPaneVisible, newMessageLabel } = props;
28643
- const [unreadChatMessagesCount, setUnreadChatMessagesCount] = React.useState(0);
28695
+ const { newMessageLabel, unreadChatMessagesCount, hideUnreadChatMessagesBadge } = props;
28644
28696
  const baseIcon = props.showLabel ? regularIcon : filledIcon;
28645
28697
  const callWithChatStrings = useCallWithChatCompositeStrings();
28646
28698
  const numberOfMsgToolTip = ((_a = props.strings) === null || _a === void 0 ? void 0 : _a.tooltipOffContent) && unreadChatMessagesCount > 0
@@ -28659,9 +28711,25 @@ const ChatButtonWithUnreadMessagesBadge = (props) => {
28659
28711
  const onRenderOnIcon = React.useCallback(() => baseIcon, [baseIcon]);
28660
28712
  const notificationOnIcon = React.useCallback(() => {
28661
28713
  return (React__default['default'].createElement(react.Stack, { styles: chatNotificationContainerStyles },
28662
- unreadChatMessagesCount > 0 && (React__default['default'].createElement(NotificationIcon, { chatMessagesCount: unreadChatMessagesCount, label: newMessageLabel })),
28714
+ unreadChatMessagesCount > 0 && !hideUnreadChatMessagesBadge && (React__default['default'].createElement(NotificationIcon, { chatMessagesCount: unreadChatMessagesCount, label: newMessageLabel })),
28663
28715
  baseIcon));
28664
- }, [unreadChatMessagesCount, newMessageLabel, baseIcon]);
28716
+ }, [unreadChatMessagesCount, newMessageLabel, baseIcon, hideUnreadChatMessagesBadge]);
28717
+ return (React__default['default'].createElement(ChatButton, Object.assign({}, props, { "data-ui-id": "call-with-chat-composite-chat-button", onRenderOffIcon: notificationOnIcon, onRenderOnIcon: onRenderOnIcon, strings: chatStrings })));
28718
+ };
28719
+ const chatNotificationContainerStyles = {
28720
+ root: {
28721
+ display: 'inline',
28722
+ position: 'relative'
28723
+ }
28724
+ };
28725
+
28726
+ // Copyright (c) Microsoft Corporation.
28727
+ /**
28728
+ * Used by the CallWithChatComposite to track unread messages for showing as a badge on the Chat Button.
28729
+ * @private
28730
+ */
28731
+ const useUnreadMessagesTracker = (chatAdapter, isChatPaneVisible) => {
28732
+ const [unreadChatMessagesCount, setUnreadChatMessagesCount] = React.useState(0);
28665
28733
  React.useEffect(() => {
28666
28734
  if (isChatPaneVisible) {
28667
28735
  setUnreadChatMessagesCount(0);
@@ -28677,14 +28745,13 @@ const ChatButtonWithUnreadMessagesBadge = (props) => {
28677
28745
  chatAdapter.off('messageReceived', incrementUnreadChatMessagesCount);
28678
28746
  };
28679
28747
  }, [chatAdapter, setUnreadChatMessagesCount, isChatPaneVisible, unreadChatMessagesCount]);
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
- }
28748
+ return unreadChatMessagesCount;
28687
28749
  };
28750
+ /**
28751
+ * Helper function to determine if the message in the event is a valid one from a user.
28752
+ * Display name is used since system messages will not have one.
28753
+ */
28754
+ const validNewChatMessage = (message) => !!message.senderDisplayName && (message.type === 'text' || message.type === 'html');
28688
28755
 
28689
28756
  // Copyright (c) Microsoft Corporation.
28690
28757
  const CallWithChatScreen = (props) => {
@@ -28762,18 +28829,22 @@ const CallWithChatScreen = (props) => {
28762
28829
  disabled: chatButtonDisabled
28763
28830
  }
28764
28831
  : undefined, [chatButtonDisabled, mobileView, toggleChat, showChatButton]);
28832
+ const unreadChatMessagesCount = useUnreadMessagesTracker(chatProps.adapter, isChatOpen);
28765
28833
  const customChatButton = React.useCallback((args) => ({
28766
28834
  placement: mobileView ? 'primary' : 'secondary',
28767
- onRenderButton: () => (React__default['default'].createElement(ChatButtonWithUnreadMessagesBadge, { chatAdapter: chatProps.adapter, isChatPaneVisible: isChatOpen, checked: isChatOpen, showLabel: args.displayType !== 'compact', onClick: toggleChat, disabled: chatButtonDisabled, strings: chatButtonStrings, styles: commonButtonStyles, newMessageLabel: callWithChatStrings.chatButtonNewMessageNotificationLabel }))
28835
+ 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,
28836
+ // As chat is disabled when on hold, we don't want to show the unread badge when on hold
28837
+ hideUnreadChatMessagesBadge: isOnHold }))
28768
28838
  }), [
28769
28839
  callWithChatStrings.chatButtonNewMessageNotificationLabel,
28770
28840
  chatButtonStrings,
28771
- chatProps.adapter,
28772
28841
  commonButtonStyles,
28773
28842
  isChatOpen,
28774
28843
  chatButtonDisabled,
28775
28844
  mobileView,
28776
- toggleChat
28845
+ toggleChat,
28846
+ unreadChatMessagesCount,
28847
+ isOnHold
28777
28848
  ]);
28778
28849
  const callControlOptionsFromProps = React.useMemo(() => (Object.assign({}, (typeof props.callControls === 'object' ? props.callControls : {}))), [props.callControls]);
28779
28850
  const injectedCustomButtonsFromProps = React.useMemo(() => {