@azure/communication-react 1.5.1-alpha-202302140014 → 1.5.1-alpha-202302152318

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 (36) hide show
  1. package/dist/communication-react.d.ts +32 -1
  2. package/dist/dist-cjs/communication-react/index.js +97 -74
  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 +22 -1
  7. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  8. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.d.ts +13 -1
  9. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js +8 -1
  10. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js.map +1 -1
  11. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.d.ts +1 -0
  12. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js +3 -0
  13. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js.map +1 -1
  14. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +1 -1
  15. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
  16. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +1 -0
  17. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  18. package/dist/dist-esm/react-components/src/components/ControlBarButton.js +1 -1
  19. package/dist/dist-esm/react-components/src/components/ControlBarButton.js.map +1 -1
  20. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +3 -3
  21. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
  22. package/dist/dist-esm/react-components/src/components/VideoTile.js +4 -6
  23. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  24. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.d.ts +0 -5
  25. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.js +1 -31
  26. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.js.map +1 -1
  27. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js +5 -5
  28. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js.map +1 -1
  29. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.d.ts +16 -3
  30. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.js +49 -44
  31. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.js.map +1 -1
  32. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/DesktopMoreButton.js +17 -4
  33. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/DesktopMoreButton.js.map +1 -1
  34. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js +4 -4
  35. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js.map +1 -1
  36. package/package.json +8 -8
@@ -64,6 +64,7 @@ import { IStyleFunctionOrObject } from '@fluentui/react';
64
64
  import { ITextFieldStyles } from '@fluentui/react';
65
65
  import { LatestMediaDiagnostics } from '@azure/communication-calling';
66
66
  import { LatestNetworkDiagnostics } from '@azure/communication-calling';
67
+ import { LocalVideoStream } from '@azure/communication-calling';
67
68
  import type { MediaDiagnosticChangedEventArgs } from '@azure/communication-calling';
68
69
  import { MediaStreamType } from '@azure/communication-calling';
69
70
  import { MicrosoftTeamsUserIdentifier } from '@azure/communication-common';
@@ -93,6 +94,7 @@ import { TypingIndicatorReceivedEvent } from '@azure/communication-chat';
93
94
  import { UnknownIdentifier } from '@azure/communication-common';
94
95
  import { UnknownIdentifierKind } from '@azure/communication-common';
95
96
  import { VideoDeviceInfo } from '@azure/communication-calling';
97
+ import { VideoEffectName } from '@azure/communication-calling';
96
98
  import { VideoStreamRenderer } from '@azure/communication-calling';
97
99
  import { VideoStreamRendererView } from '@azure/communication-calling';
98
100
 
@@ -1776,7 +1778,7 @@ export declare type CallErrors = {
1776
1778
  *
1777
1779
  * @public
1778
1780
  */
1779
- export declare type CallErrorTarget = 'Call.addParticipant' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.dispose' | 'Call.feature' | 'Call.hangUp' | 'Call.hold' | 'Call.mute' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.muteIncomingAudio' | 'Call.off' | 'Call.on' | 'Call.removeParticipant' | 'Call.resume' | 'Call.sendDtmf' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.startAudio' | 'Call.startScreenSharing' | 'Call.startVideo' | 'Call.stopScreenSharing' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.stopAudio' | 'Call.stopVideo' | 'Call.unmute' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.unmuteIncomingAudio' | 'CallAgent.dispose' | 'CallAgent.feature' | 'CallAgent.join' | 'CallAgent.off' | 'CallAgent.on' | 'CallAgent.startCall' | 'CallClient.createCallAgent' | /* @conditional-compile-remove(calling-beta-sdk) */ /* @conditional-compile-remove(teams-identity-support) */ 'CallClient.createTeamsCallAgent' | 'CallClient.feature' | 'CallClient.getDeviceManager' | /* @conditional-compile-remove(calling-beta-sdk) */ 'CallClient.getEnvironmentInfo' | 'DeviceManager.askDevicePermission' | 'DeviceManager.getCameras' | 'DeviceManager.getMicrophones' | 'DeviceManager.getSpeakers' | 'DeviceManager.off' | 'DeviceManager.on' | 'DeviceManager.selectMicrophone' | 'DeviceManager.selectSpeaker' | 'IncomingCall.accept' | 'IncomingCall.reject' | /* @conditional-compile-remove(calling-beta-sdk) */ /* @conditional-compile-remove(teams-identity-support) */ 'TeamsCall.addParticipant';
1781
+ export declare type CallErrorTarget = 'Call.addParticipant' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.dispose' | 'Call.feature' | 'Call.hangUp' | 'Call.hold' | 'Call.mute' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.muteIncomingAudio' | 'Call.off' | 'Call.on' | 'Call.removeParticipant' | 'Call.resume' | 'Call.sendDtmf' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.startAudio' | 'Call.startScreenSharing' | 'Call.startVideo' | 'Call.stopScreenSharing' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.stopAudio' | 'Call.stopVideo' | 'Call.unmute' | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.unmuteIncomingAudio' | 'CallAgent.dispose' | 'CallAgent.feature' | 'CallAgent.join' | 'CallAgent.off' | 'CallAgent.on' | 'CallAgent.startCall' | 'CallClient.createCallAgent' | /* @conditional-compile-remove(calling-beta-sdk) */ /* @conditional-compile-remove(teams-identity-support) */ 'CallClient.createTeamsCallAgent' | 'CallClient.feature' | 'CallClient.getDeviceManager' | /* @conditional-compile-remove(calling-beta-sdk) */ 'CallClient.getEnvironmentInfo' | 'DeviceManager.askDevicePermission' | 'DeviceManager.getCameras' | 'DeviceManager.getMicrophones' | 'DeviceManager.getSpeakers' | 'DeviceManager.off' | 'DeviceManager.on' | 'DeviceManager.selectMicrophone' | 'DeviceManager.selectSpeaker' | 'IncomingCall.accept' | 'IncomingCall.reject' | /* @conditional-compile-remove(calling-beta-sdk) */ /* @conditional-compile-remove(teams-identity-support) */ 'TeamsCall.addParticipant' | /* @conditional-compile-remove(video-background-effects) */ 'VideoEffectsFeature.startEffects';
1780
1782
 
1781
1783
  /**
1782
1784
  * Callback for {@link CallAdapterSubscribers} 'callIdChanged' event.
@@ -5857,6 +5859,27 @@ export declare interface LocalVideoStreamState {
5857
5859
  * API. This can be undefined if the stream has not yet been rendered and defined after createView creates the view.
5858
5860
  */
5859
5861
  view?: VideoStreamRendererViewState;
5862
+ /**
5863
+ * Stores the state of the video effects.
5864
+ * @beta
5865
+ */
5866
+ videoEffects?: LocalVideoStreamVideoEffectsState;
5867
+ }
5868
+
5869
+ /**
5870
+ * State only version of a LocalVideoStream's {@link @azure/communication-calling#VideoEffectsFeature}.
5871
+ *
5872
+ * @beta
5873
+ */
5874
+ export declare interface LocalVideoStreamVideoEffectsState {
5875
+ /**
5876
+ * State of the video background effect.
5877
+ */
5878
+ isActive: boolean;
5879
+ /**
5880
+ * Name of the effect if one is active.
5881
+ */
5882
+ effectName?: VideoEffectName;
5860
5883
  }
5861
5884
 
5862
5885
  /**
@@ -7587,6 +7610,14 @@ export declare interface StatefulDeviceManager extends DeviceManager {
7587
7610
  * {@link StatefulDeviceManager}. See also {@link DeviceManagerState.selectedCamera}.
7588
7611
  */
7589
7612
  selectCamera: (VideoDeviceInfo: any) => void;
7613
+ /**
7614
+ * Gets the list of unparented video streams. This is a list of video streams that have not been added to a
7615
+ * {@link @azure/communication-calling#Call}. This is useful for developers who want to interact with rendered
7616
+ * video streams before they have started a call. See also {@link @azure/communication-react#CallClient.createView}.
7617
+ *
7618
+ * @beta
7619
+ */
7620
+ getUnparentedVideoStreams: LocalVideoStream[];
7590
7621
  }
7591
7622
 
7592
7623
  /**
@@ -161,7 +161,7 @@ const _toCommunicationIdentifier = (id) => {
161
161
  // Copyright (c) Microsoft Corporation.
162
162
  // Licensed under the MIT license.
163
163
  // GENERATED FILE. DO NOT EDIT MANUALLY.
164
- var telemetryVersion = '1.5.1-alpha-202302140014';
164
+ var telemetryVersion = '1.5.1-alpha-202302152318';
165
165
 
166
166
  // Copyright (c) Microsoft Corporation.
167
167
  /**
@@ -1059,8 +1059,10 @@ const dedupeById = (devices) => {
1059
1059
  *
1060
1060
  * @param deviceManager - DeviceManager from SDK
1061
1061
  * @param context - CallContext from StatefulCallClient
1062
+ *
1063
+ * @private
1062
1064
  */
1063
- const deviceManagerDeclaratify = (deviceManager, context) => {
1065
+ const deviceManagerDeclaratify = (deviceManager, context, internalContext) => {
1064
1066
  const proxyDeviceManager = new ProxyDeviceManager(deviceManager, context);
1065
1067
  Object.defineProperty(deviceManager, 'unsubscribe', {
1066
1068
  configurable: false,
@@ -1070,6 +1072,11 @@ const deviceManagerDeclaratify = (deviceManager, context) => {
1070
1072
  configurable: false,
1071
1073
  value: (videoDeviceInfo) => proxyDeviceManager.selectCamera(videoDeviceInfo)
1072
1074
  });
1075
+ /* @conditional-compile-remove(video-background-effects) */
1076
+ Object.defineProperty(deviceManager, 'getUnparentedViews', {
1077
+ configurable: false,
1078
+ value: () => internalContext.getUnparentedRenderInfos()
1079
+ });
1073
1080
  return new Proxy(deviceManager, proxyDeviceManager);
1074
1081
  };
1075
1082
 
@@ -3514,6 +3521,9 @@ class InternalCallContext {
3514
3521
  getUnparentedRenderInfo(localVideoStream) {
3515
3522
  return this._unparentedRenderInfos.get(localVideoStream.source.id);
3516
3523
  }
3524
+ getUnparentedRenderInfos() {
3525
+ return [...this._unparentedRenderInfos].map(([, renderInfo]) => renderInfo.stream);
3526
+ }
3517
3527
  setUnparentedRenderInfo(statefulStream, stream, status, renderer) {
3518
3528
  this._unparentedRenderInfos.set(statefulStream.source.id, { stream, status, renderer });
3519
3529
  }
@@ -3767,7 +3777,7 @@ class ProxyCallClient {
3767
3777
  else {
3768
3778
  this._sdkDeviceManager = deviceManager;
3769
3779
  }
3770
- this._deviceManager = deviceManagerDeclaratify(deviceManager, this._context);
3780
+ this._deviceManager = deviceManagerDeclaratify(deviceManager, this._context, this._internalContext);
3771
3781
  return this._deviceManager;
3772
3782
  }), 'CallClient.getDeviceManager');
3773
3783
  }
@@ -8660,18 +8670,16 @@ const VideoTile = (props) => {
8660
8670
  const canShowContextMenuButton = isHovered || isFocused;
8661
8671
  return (React__default['default'].createElement(react.Stack, Object.assign({ "data-ui-id": ids.videoTile, className: react.mergeStyles(rootStyles, {
8662
8672
  background: theme.palette.neutralLighter,
8663
- borderRadius: theme.effects.roundedCorner4,
8664
- // To ensure that the video tile is focusable when there is a floating video tile
8665
- zIndex: 1
8673
+ borderRadius: theme.effects.roundedCorner4
8666
8674
  }, isSpeaking && {
8667
- '&::before': {
8675
+ '&::after': {
8668
8676
  content: `''`,
8669
8677
  position: 'absolute',
8670
- zIndex: 1,
8671
8678
  border: `0.25rem solid ${theme.palette.themePrimary}`,
8672
8679
  borderRadius: theme.effects.roundedCorner4,
8673
8680
  width: '100%',
8674
- height: '100%'
8681
+ height: '100%',
8682
+ pointerEvents: 'none'
8675
8683
  }
8676
8684
  }, styles === null || styles === void 0 ? void 0 : styles.root) }, longPressHandlersTrampoline),
8677
8685
  React__default['default'].createElement("div", Object.assign({ ref: videoTileRef, style: { width: '100%', height: '100%' } }, hoverHandlers, { "data-is-focusable": true }),
@@ -10400,11 +10408,11 @@ const FloatingLocalVideoLayout = (props) => {
10400
10408
  return (React__default['default'].createElement(VideoGalleryResponsiveHorizontalGallery, { isNarrow: isNarrow, shouldFloatLocalVideo: true, horizontalGalleryElements: horizontalGalleryTiles, styles: styles === null || styles === void 0 ? void 0 : styles.horizontalGallery }));
10401
10409
  }, [isNarrow, horizontalGalleryTiles, styles === null || styles === void 0 ? void 0 : styles.horizontalGallery]);
10402
10410
  return (React__default['default'].createElement(react.Stack, { styles: rootLayoutStyle },
10411
+ wrappedLocalVideoComponent,
10412
+ React__default['default'].createElement(react.LayerHost, { id: layerHostId, className: react.mergeStyles(layerHostStyle) }),
10403
10413
  React__default['default'].createElement(react.Stack, { horizontal: false, styles: innerLayoutStyle, tokens: videoGalleryLayoutGap },
10404
10414
  screenShareComponent ? (screenShareComponent) : (React__default['default'].createElement(GridLayout, { key: "grid-layout", styles: styles === null || styles === void 0 ? void 0 : styles.gridLayout }, gridTiles)),
10405
- horizontalGallery),
10406
- wrappedLocalVideoComponent,
10407
- React__default['default'].createElement(react.LayerHost, { id: layerHostId, className: react.mergeStyles(layerHostStyle) })));
10415
+ horizontalGallery)));
10408
10416
  };
10409
10417
 
10410
10418
  // Copyright (c) Microsoft Corporation.
@@ -10835,7 +10843,7 @@ const ControlBarButton = (props) => {
10835
10843
  : (_l = props === null || props === void 0 ? void 0 : props.strings) === null || _l === void 0 ? void 0 : _l.tooltipOffContent);
10836
10844
  const tooltipId = ((_m = props.tooltipId) !== null && _m !== void 0 ? _m : props.labelKey) ? props.labelKey + '-tooltip' : undefined;
10837
10845
  return (React__default['default'].createElement(ControlButtonTooltip, { content: tooltipContent, id: tooltipId },
10838
- React__default['default'].createElement(react.DefaultButton, Object.assign({}, props, { styles: componentStyles, onRenderText: props.showLabel && props.onRenderText ? props.onRenderText : undefined, onRenderIcon: (_o = props.onRenderIcon) !== null && _o !== void 0 ? _o : DefaultRenderIcon, ariaLabel: (_r = (_q = (_p = props.splitButtonAriaLabel) !== null && _p !== void 0 ? _p : props.ariaLabel) !== null && _q !== void 0 ? _q : tooltipContent) !== null && _r !== void 0 ? _r : labelText, allowDisabledFocus: (_s = props.allowDisabledFocus) !== null && _s !== void 0 ? _s : true, menuTriggerKeyCode: react.KeyCodes.down }), props.showLabel ? labelText : React__default['default'].createElement(React__default['default'].Fragment, null))));
10846
+ React__default['default'].createElement(react.DefaultButton, Object.assign({}, props, { styles: componentStyles, onRenderText: props.showLabel && props.onRenderText ? props.onRenderText : undefined, onRenderIcon: (_o = props.onRenderIcon) !== null && _o !== void 0 ? _o : DefaultRenderIcon, ariaLabel: (_r = (_q = (_p = props.splitButtonAriaLabel) !== null && _p !== void 0 ? _p : props.ariaLabel) !== null && _q !== void 0 ? _q : tooltipContent) !== null && _r !== void 0 ? _r : labelText, allowDisabledFocus: (_s = props.allowDisabledFocus) !== null && _s !== void 0 ? _s : true, menuTriggerKeyCode: react.KeyCodes.down, text: undefined }), props.showLabel ? labelText : React__default['default'].createElement(React__default['default'].Fragment, null))));
10839
10847
  };
10840
10848
 
10841
10849
  // Copyright (c) Microsoft Corporation.
@@ -17140,11 +17148,7 @@ const Camera = (props) => {
17140
17148
 
17141
17149
  // Copyright (c) Microsoft Corporation.
17142
17150
  /** @private */
17143
- const generateCustomControlBarButtonStrings = (text) => {
17144
- return { label: text };
17145
- };
17146
- /** @private */
17147
- const generateCustomControlBarButtons = (onFetchCustomButtonProps, displayType) => {
17151
+ const generateCustomControlBarButtons$1 = (onFetchCustomButtonProps, displayType) => {
17148
17152
  const response = {
17149
17153
  primary: undefined
17150
17154
  };
@@ -17157,7 +17161,7 @@ const generateCustomControlBarButtons = (onFetchCustomButtonProps, displayType)
17157
17161
  .filter((buttonProps) => buttonProps.placement === key)
17158
17162
  .map((buttonProps, i) => {
17159
17163
  var _a;
17160
- return (React__default['default'].createElement(ControlBarButton, { ariaDescription: buttonProps.ariaDescription, ariaLabel: buttonProps.ariaLabel, disabled: buttonProps.disabled, id: buttonProps.id, key: (_a = buttonProps.key) !== null && _a !== void 0 ? _a : `${buttonProps.placement}_${i}`, onClick: buttonProps.onItemClick, onRenderIcon: () => { var _a; return React__default['default'].createElement(react.Icon, { iconName: (_a = buttonProps.iconName) !== null && _a !== void 0 ? _a : 'ControlButtonOptions' }); }, showLabel: buttonProps.showLabel, strings: generateCustomControlBarButtonStrings(buttonProps.text), styles: buttonProps.styles }));
17164
+ return (React__default['default'].createElement(ControlBarButton, { ariaDescription: buttonProps.ariaDescription, ariaLabel: buttonProps.ariaLabel, disabled: buttonProps.disabled, id: buttonProps.id, key: (_a = buttonProps.key) !== null && _a !== void 0 ? _a : `${buttonProps.placement}_${i}`, onClick: buttonProps.onItemClick, onRenderIcon: () => { var _a; return React__default['default'].createElement(react.Icon, { iconName: (_a = buttonProps.iconName) !== null && _a !== void 0 ? _a : 'ControlButtonOptions' }); }, showLabel: buttonProps.showLabel, text: buttonProps.text, styles: buttonProps.styles }));
17161
17165
  })));
17162
17166
  }
17163
17167
  return response;
@@ -17585,7 +17589,7 @@ const CallControls = (props) => {
17585
17589
  const [showDialpad, setShowDialpad] = React.useState(false);
17586
17590
  const theme = react.useTheme();
17587
17591
  /* @conditional-compile-remove(control-bar-button-injection) */
17588
- const customButtons = React.useMemo(() => generateCustomControlBarButtons(onFetchCustomButtonPropsTrampoline$1(options), options === null || options === void 0 ? void 0 : options.displayType), [options]);
17592
+ const customButtons = React.useMemo(() => generateCustomControlBarButtons$1(onFetchCustomButtonPropsTrampoline$1(options), options === null || options === void 0 ? void 0 : options.displayType), [options]);
17589
17593
  // when props.options is false then we want to hide the whole control bar.
17590
17594
  if (props.options === false) {
17591
17595
  return React__default['default'].createElement(React__default['default'].Fragment, null);
@@ -21816,54 +21820,60 @@ const CUSTOM_BUTTON_OPTIONS = {
21816
21820
  };
21817
21821
  /** @private */
21818
21822
  const generateCustomCallWithChatControlBarButton = (onFetchCustomButtonProps, displayType) => {
21819
- const response = {
21820
- primary: undefined,
21821
- secondary: undefined,
21822
- overflow: undefined
21823
+ const allButtonProps = onFetchCustomButtonProps === null || onFetchCustomButtonProps === void 0 ? void 0 : onFetchCustomButtonProps.map((callback) => callback({ displayType }));
21824
+ return {
21825
+ primary: generateCustomControlBarButtons('primary', allButtonProps),
21826
+ secondary: generateCustomControlBarButtons('secondary', allButtonProps),
21827
+ overflow: generateCustomControlBarButtons('overflow', allButtonProps)
21823
21828
  };
21824
- if (!onFetchCustomButtonProps) {
21825
- return response;
21826
- }
21827
- const allButtonProps = onFetchCustomButtonProps.map((f) => f({ displayType }));
21828
- for (const key in response) {
21829
- response[key] = (React__default['default'].createElement(React__default['default'].Fragment, null, allButtonProps
21830
- .filter((buttonProps) => buttonProps.placement === key)
21831
- .map((buttonProps, i) => {
21832
- var _a;
21833
- return (React__default['default'].createElement(ControlBarButton, { ariaDescription: buttonProps.ariaDescription, ariaLabel: buttonProps.ariaLabel, disabled: buttonProps.disabled, id: buttonProps.id, key: (_a = buttonProps.key) !== null && _a !== void 0 ? _a : `${buttonProps.placement}_${i}`, onClick: buttonProps.onItemClick, onRenderIcon: () => { var _a; return React__default['default'].createElement(react.Icon, { iconName: (_a = buttonProps.iconName) !== null && _a !== void 0 ? _a : 'ControlButtonOptions' }); }, showLabel: buttonProps.showLabel, strings: generateCustomControlBarButtonStrings(buttonProps.text), styles: buttonProps.styles }));
21834
- })));
21835
- }
21836
- return response;
21837
21829
  };
21838
21830
  /** @private */
21831
+ const generateCustomControlBarButtons = (placement, customButtons) => customButtons
21832
+ ? customButtons
21833
+ .filter((buttonProps) => buttonProps.placement === placement)
21834
+ .map((buttonProps, i) => (internalProps) => {
21835
+ var _a, _b, _c, _d, _e, _f, _g, _h;
21836
+ return (React__default['default'].createElement(ControlBarButton, { ariaDescription: (_a = buttonProps.ariaDescription) !== null && _a !== void 0 ? _a : internalProps.ariaDescription, ariaLabel: (_b = buttonProps.ariaLabel) !== null && _b !== void 0 ? _b : internalProps.ariaLabel, disabled: (_c = buttonProps.disabled) !== null && _c !== void 0 ? _c : internalProps.disabled, id: (_d = buttonProps.id) !== null && _d !== void 0 ? _d : internalProps.id, key: (_e = buttonProps.key) !== null && _e !== void 0 ? _e : `${buttonProps.placement}_${i}`, onClick: (_f = buttonProps.onItemClick) !== null && _f !== void 0 ? _f : internalProps.onClick, onRenderIcon: () => {
21837
+ var _a, _b, _c;
21838
+ return (React__default['default'].createElement(react.Icon, { iconName: (_c = (_a = buttonProps.iconName) !== null && _a !== void 0 ? _a : (_b = internalProps.iconProps) === null || _b === void 0 ? void 0 : _b.iconName) !== null && _c !== void 0 ? _c : 'ControlButtonOptions' }));
21839
+ }, showLabel: (_g = buttonProps.showLabel) !== null && _g !== void 0 ? _g : internalProps.showLabel, text: (_h = buttonProps.text) !== null && _h !== void 0 ? _h : internalProps.text, styles: react.mergeStyleSets(internalProps.styles, buttonProps.styles) }));
21840
+ })
21841
+ : [];
21842
+ /** @private */
21843
+ const generateCustomDrawerButtons = (placement, customButtons) => customButtons
21844
+ ? customButtons
21845
+ .filter((buttonProps) => buttonProps.placement === placement)
21846
+ .map((buttonProps, i) => (Object.assign(Object.assign({}, buttonProps), { disabled: buttonProps.disabled, iconProps: { iconName: buttonProps.iconName }, id: buttonProps.id, itemKey: buttonProps.key ? '' + buttonProps.key : `${buttonProps.placement}_${i}`, onItemClick: buttonProps.onItemClick, text: buttonProps.text })))
21847
+ : [];
21848
+ /** @private */
21839
21849
  const generateCustomCallWithChatDrawerButtons = (onFetchCustomButtonProps, displayType) => {
21840
- const response = {
21841
- primary: undefined,
21842
- secondary: undefined,
21843
- overflow: undefined
21850
+ const customButtons = onFetchCustomButtonProps === null || onFetchCustomButtonProps === void 0 ? void 0 : onFetchCustomButtonProps.map((callback) => callback({ displayType }));
21851
+ return {
21852
+ primary: generateCustomDrawerButtons('primary', customButtons),
21853
+ secondary: generateCustomDrawerButtons('secondary', customButtons),
21854
+ overflow: generateCustomDrawerButtons('overflow', customButtons)
21855
+ };
21856
+ };
21857
+ /** @private */
21858
+ const generateCustomCallWithChatDesktopOverflowButtons = (onFetchCustomButtonProps, displayType) => {
21859
+ const customButtons = onFetchCustomButtonProps === null || onFetchCustomButtonProps === void 0 ? void 0 : onFetchCustomButtonProps.map((callback) => callback({ displayType }));
21860
+ return {
21861
+ primary: generateCustomDrawerButtons('primary', customButtons).map(drawerMenuItemToContextualMenuItem),
21862
+ secondary: generateCustomDrawerButtons('secondary', customButtons).map(drawerMenuItemToContextualMenuItem),
21863
+ overflow: generateCustomDrawerButtons('overflow', customButtons).map(drawerMenuItemToContextualMenuItem)
21844
21864
  };
21845
- if (!onFetchCustomButtonProps) {
21846
- return response;
21847
- }
21848
- const allButtonProps = onFetchCustomButtonProps.map((f) => f({ displayType }));
21849
- for (const key in response) {
21850
- response[key] = (React__default['default'].createElement(React__default['default'].Fragment, null, allButtonProps
21851
- .filter((buttonProps) => buttonProps.placement === key)
21852
- .map((buttonProps, i) => {
21853
- var _a, _b;
21854
- return ({
21855
- disabled: buttonProps.disabled,
21856
- id: buttonProps.id,
21857
- iconProps: { iconName: buttonProps.iconName },
21858
- itemKey: (_a = buttonProps.key) !== null && _a !== void 0 ? _a : `${buttonProps.placement}_${i}`,
21859
- key: (_b = buttonProps.key) !== null && _b !== void 0 ? _b : `${buttonProps.placement}_${i}`,
21860
- onItemClick: buttonProps.onItemClick,
21861
- text: buttonProps.text
21862
- });
21863
- })));
21864
- }
21865
- return response;
21866
21865
  };
21866
+ /** @private */
21867
+ const drawerMenuItemToContextualMenuItem = (item) => (Object.assign(Object.assign({}, item), { key: item.itemKey, onClick: item.onItemClick
21868
+ ? (ev) => {
21869
+ var _a;
21870
+ (_a = item.onItemClick) === null || _a === void 0 ? void 0 : _a.call(item, ev);
21871
+ }
21872
+ : undefined, subMenuProps: item.subMenuProps
21873
+ ? {
21874
+ items: item.subMenuProps.map(drawerMenuItemToContextualMenuItem)
21875
+ }
21876
+ : undefined }));
21867
21877
  /* @conditional-compile-remove(control-bar-button-injection) */
21868
21878
  /** @private */
21869
21879
  const onFetchCustomButtonPropsTrampoline = (options) => {
@@ -21878,7 +21888,6 @@ const onFetchCustomButtonPropsTrampoline = (options) => {
21878
21888
  * @private
21879
21889
  */
21880
21890
  const DesktopMoreButton = (props) => {
21881
- var _a;
21882
21891
  /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
21883
21892
  const localeStrings = useLocale();
21884
21893
  /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
@@ -21918,9 +21927,23 @@ const DesktopMoreButton = (props) => {
21918
21927
  });
21919
21928
  }
21920
21929
  /* @conditional-compile-remove(control-bar-button-injection) */
21921
- const customDrawerButtons = React.useMemo(() => generateCustomCallWithChatDrawerButtons(onFetchCustomButtonPropsTrampoline(typeof props.callControls === 'object' ? props.callControls : undefined), typeof props.callControls === 'object' ? props.callControls.displayType : undefined), [props.callControls]);
21930
+ const customDrawerButtons = React.useMemo(() => generateCustomCallWithChatDesktopOverflowButtons(onFetchCustomButtonPropsTrampoline(typeof props.callControls === 'object' ? props.callControls : undefined), typeof props.callControls === 'object' ? props.callControls.displayType : undefined), [props.callControls]);
21931
+ /* @conditional-compile-remove(control-bar-button-injection) */
21932
+ customDrawerButtons['primary'].slice(CUSTOM_BUTTON_OPTIONS.MAX_PRIMARY_DESKTOP_CUSTOM_BUTTONS).forEach((element) => {
21933
+ moreButtonContextualMenuItems.push(Object.assign({ itemProps: {
21934
+ styles: buttonFlyoutIncreasedSizeStyles
21935
+ } }, element));
21936
+ });
21937
+ /* @conditional-compile-remove(control-bar-button-injection) */
21938
+ customDrawerButtons['secondary']
21939
+ .slice(CUSTOM_BUTTON_OPTIONS.MAX_SECONDARY_DESKTOP_CUSTOM_BUTTONS)
21940
+ .forEach((element) => {
21941
+ moreButtonContextualMenuItems.push(Object.assign({ itemProps: {
21942
+ styles: buttonFlyoutIncreasedSizeStyles
21943
+ } }, element));
21944
+ });
21922
21945
  /* @conditional-compile-remove(control-bar-button-injection) */
21923
- (_a = customDrawerButtons['overflow']) === null || _a === void 0 ? void 0 : _a.props.children.forEach((element) => {
21946
+ customDrawerButtons['overflow'].forEach((element) => {
21924
21947
  moreButtonContextualMenuItems.push(Object.assign({ itemProps: {
21925
21948
  styles: buttonFlyoutIncreasedSizeStyles
21926
21949
  } }, element));
@@ -22043,10 +22066,10 @@ const CallWithChatControlBar = (props) => {
22043
22066
  disabled: props.disableButtonsForHoldScreen || isDisabled$2(options.screenShareButton) })),
22044
22067
  /* @conditional-compile-remove(control-bar-button-injection) */
22045
22068
  (_a = customButtons['primary']) === null || _a === void 0 ? void 0 :
22046
- _a.props.children.slice(0, props.mobileView
22069
+ _a.slice(0, props.mobileView
22047
22070
  ? CUSTOM_BUTTON_OPTIONS.MAX_PRIMARY_MOBILE_CUSTOM_BUTTONS
22048
- : CUSTOM_BUTTON_OPTIONS.MAX_PRIMARY_DESKTOP_CUSTOM_BUTTONS).map((element) => {
22049
- return (React__default['default'].createElement(element.type, Object.assign({}, element.props, { key: element.props.strings.label, styles: commonButtonStyles, displayType: options.displayType, showLabel: options.displayType !== 'compact' })));
22071
+ : CUSTOM_BUTTON_OPTIONS.MAX_PRIMARY_DESKTOP_CUSTOM_BUTTONS).map((CustomButton, i) => {
22072
+ return (React__default['default'].createElement(CustomButton, { key: `primary-custom-button-${i}`, styles: commonButtonStyles, showLabel: options.displayType !== 'compact' }));
22050
22073
  }),
22051
22074
  props.mobileView && (React__default['default'].createElement(MoreButton, { "data-ui-id": "call-with-chat-composite-more-button", strings: moreButtonStrings, onClick: props.onMoreButtonClicked, disabled: props.disableButtonsForLobbyPage })),
22052
22075
  /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ isEnabled$1(options === null || options === void 0 ? void 0 : options.moreButton) &&
@@ -22058,8 +22081,8 @@ const CallWithChatControlBar = (props) => {
22058
22081
  !props.mobileView && (React__default['default'].createElement(react.Stack, { horizontal: true, className: !props.mobileView ? react.mergeStyles(desktopButtonContainerStyle) : undefined },
22059
22082
  /* @conditional-compile-remove(control-bar-button-injection) */
22060
22083
  (_b = customButtons['secondary']) === null || _b === void 0 ? void 0 :
22061
- _b.props.children.slice(0, CUSTOM_BUTTON_OPTIONS.MAX_SECONDARY_DESKTOP_CUSTOM_BUTTONS).map((element) => {
22062
- return (React__default['default'].createElement(element.type, Object.assign({}, element.props, { key: element.props.key, styles: commonButtonStyles, displayType: options.displayType, showLabel: options.displayType !== 'compact' })));
22084
+ _b.slice(0, CUSTOM_BUTTON_OPTIONS.MAX_SECONDARY_DESKTOP_CUSTOM_BUTTONS).map((CustomButton, i) => {
22085
+ return (React__default['default'].createElement(CustomButton, { key: `secondary-custom-button-${i}`, styles: commonButtonStyles, showLabel: options.displayType !== 'compact' }));
22063
22086
  }),
22064
22087
  isEnabled$1(options === null || options === void 0 ? void 0 : options.peopleButton) && (React__default['default'].createElement(PeopleButton, { checked: props.peopleButtonChecked, showLabel: options.displayType !== 'compact', onClick: props.onPeopleButtonClicked, "data-ui-id": "call-with-chat-composite-people-button", disabled: props.disableButtonsForLobbyPage || isDisabled$2(options.peopleButton), strings: peopleButtonStrings, styles: commonButtonStyles })),
22065
22088
  isEnabled$1(options === null || options === void 0 ? void 0 : options.chatButton) && chatButton))));
@@ -22435,7 +22458,7 @@ const inferCallWithChatControlOptions = (callWithChatControls) => {
22435
22458
  };
22436
22459
  /** @private */
22437
22460
  const MoreDrawer = (props) => {
22438
- var _a, _b, _c, _d, _e;
22461
+ var _a, _b;
22439
22462
  const drawerMenuItems = [];
22440
22463
  const { speakers, onSelectSpeaker, onLightDismiss } = props;
22441
22464
  /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
@@ -22545,15 +22568,15 @@ const MoreDrawer = (props) => {
22545
22568
  /* @conditional-compile-remove(control-bar-button-injection) */
22546
22569
  const customDrawerButtons = React.useMemo(() => generateCustomCallWithChatDrawerButtons(onFetchCustomButtonPropsTrampoline(drawerSelectionOptions !== false ? drawerSelectionOptions : undefined), drawerSelectionOptions !== false ? drawerSelectionOptions === null || drawerSelectionOptions === void 0 ? void 0 : drawerSelectionOptions.displayType : undefined), [drawerSelectionOptions]);
22547
22570
  /* @conditional-compile-remove(control-bar-button-injection) */
22548
- (_c = customDrawerButtons['overflow']) === null || _c === void 0 ? void 0 : _c.props.children.forEach((element) => {
22571
+ customDrawerButtons['primary'].slice(CUSTOM_BUTTON_OPTIONS.MAX_PRIMARY_MOBILE_CUSTOM_BUTTONS).forEach((element) => {
22549
22572
  drawerMenuItems.push(element);
22550
22573
  });
22551
22574
  /* @conditional-compile-remove(control-bar-button-injection) */
22552
- (_d = customDrawerButtons['primary']) === null || _d === void 0 ? void 0 : _d.props.children.slice(CUSTOM_BUTTON_OPTIONS.MAX_PRIMARY_MOBILE_CUSTOM_BUTTONS).forEach((element) => {
22575
+ customDrawerButtons['secondary'].forEach((element) => {
22553
22576
  drawerMenuItems.push(element);
22554
22577
  });
22555
22578
  /* @conditional-compile-remove(control-bar-button-injection) */
22556
- (_e = customDrawerButtons['secondary']) === null || _e === void 0 ? void 0 : _e.props.children.forEach((element) => {
22579
+ customDrawerButtons['overflow'].forEach((element) => {
22557
22580
  drawerMenuItems.push(element);
22558
22581
  });
22559
22582
  return React__default['default'].createElement(_DrawerMenu, { items: drawerMenuItems, onLightDismiss: props.onLightDismiss });