@azure/communication-react 1.5.1-alpha-202302150014 → 1.5.1-alpha-202302160014

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 (32) hide show
  1. package/dist/communication-react.d.ts +32 -1
  2. package/dist/dist-cjs/communication-react/index.js +90 -65
  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-composites/src/composites/CallComposite/components/buttons/Custom.d.ts +0 -5
  21. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.js +1 -31
  22. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.js.map +1 -1
  23. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js +5 -5
  24. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js.map +1 -1
  25. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.d.ts +16 -3
  26. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.js +49 -44
  27. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.js.map +1 -1
  28. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/DesktopMoreButton.js +17 -4
  29. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/DesktopMoreButton.js.map +1 -1
  30. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js +4 -4
  31. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js.map +1 -1
  32. 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-202302150014';
164
+ var telemetryVersion = '1.5.1-alpha-202302160014';
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
  }
@@ -10833,7 +10843,7 @@ const ControlBarButton = (props) => {
10833
10843
  : (_l = props === null || props === void 0 ? void 0 : props.strings) === null || _l === void 0 ? void 0 : _l.tooltipOffContent);
10834
10844
  const tooltipId = ((_m = props.tooltipId) !== null && _m !== void 0 ? _m : props.labelKey) ? props.labelKey + '-tooltip' : undefined;
10835
10845
  return (React__default['default'].createElement(ControlButtonTooltip, { content: tooltipContent, id: tooltipId },
10836
- 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))));
10837
10847
  };
10838
10848
 
10839
10849
  // Copyright (c) Microsoft Corporation.
@@ -17138,11 +17148,7 @@ const Camera = (props) => {
17138
17148
 
17139
17149
  // Copyright (c) Microsoft Corporation.
17140
17150
  /** @private */
17141
- const generateCustomControlBarButtonStrings = (text) => {
17142
- return { label: text };
17143
- };
17144
- /** @private */
17145
- const generateCustomControlBarButtons = (onFetchCustomButtonProps, displayType) => {
17151
+ const generateCustomControlBarButtons$1 = (onFetchCustomButtonProps, displayType) => {
17146
17152
  const response = {
17147
17153
  primary: undefined
17148
17154
  };
@@ -17155,7 +17161,7 @@ const generateCustomControlBarButtons = (onFetchCustomButtonProps, displayType)
17155
17161
  .filter((buttonProps) => buttonProps.placement === key)
17156
17162
  .map((buttonProps, i) => {
17157
17163
  var _a;
17158
- 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 }));
17159
17165
  })));
17160
17166
  }
17161
17167
  return response;
@@ -17583,7 +17589,7 @@ const CallControls = (props) => {
17583
17589
  const [showDialpad, setShowDialpad] = React.useState(false);
17584
17590
  const theme = react.useTheme();
17585
17591
  /* @conditional-compile-remove(control-bar-button-injection) */
17586
- 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]);
17587
17593
  // when props.options is false then we want to hide the whole control bar.
17588
17594
  if (props.options === false) {
17589
17595
  return React__default['default'].createElement(React__default['default'].Fragment, null);
@@ -21814,54 +21820,60 @@ const CUSTOM_BUTTON_OPTIONS = {
21814
21820
  };
21815
21821
  /** @private */
21816
21822
  const generateCustomCallWithChatControlBarButton = (onFetchCustomButtonProps, displayType) => {
21817
- const response = {
21818
- primary: undefined,
21819
- secondary: undefined,
21820
- 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)
21821
21828
  };
21822
- if (!onFetchCustomButtonProps) {
21823
- return response;
21824
- }
21825
- const allButtonProps = onFetchCustomButtonProps.map((f) => f({ displayType }));
21826
- for (const key in response) {
21827
- response[key] = (React__default['default'].createElement(React__default['default'].Fragment, null, allButtonProps
21828
- .filter((buttonProps) => buttonProps.placement === key)
21829
- .map((buttonProps, i) => {
21830
- var _a;
21831
- 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 }));
21832
- })));
21833
- }
21834
- return response;
21835
21829
  };
21836
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 */
21837
21849
  const generateCustomCallWithChatDrawerButtons = (onFetchCustomButtonProps, displayType) => {
21838
- const response = {
21839
- primary: undefined,
21840
- secondary: undefined,
21841
- 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)
21842
21855
  };
21843
- if (!onFetchCustomButtonProps) {
21844
- return response;
21845
- }
21846
- const allButtonProps = onFetchCustomButtonProps.map((f) => f({ displayType }));
21847
- for (const key in response) {
21848
- response[key] = (React__default['default'].createElement(React__default['default'].Fragment, null, allButtonProps
21849
- .filter((buttonProps) => buttonProps.placement === key)
21850
- .map((buttonProps, i) => {
21851
- var _a, _b;
21852
- return ({
21853
- disabled: buttonProps.disabled,
21854
- id: buttonProps.id,
21855
- iconProps: { iconName: buttonProps.iconName },
21856
- itemKey: (_a = buttonProps.key) !== null && _a !== void 0 ? _a : `${buttonProps.placement}_${i}`,
21857
- key: (_b = buttonProps.key) !== null && _b !== void 0 ? _b : `${buttonProps.placement}_${i}`,
21858
- onItemClick: buttonProps.onItemClick,
21859
- text: buttonProps.text
21860
- });
21861
- })));
21862
- }
21863
- return response;
21864
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)
21864
+ };
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 }));
21865
21877
  /* @conditional-compile-remove(control-bar-button-injection) */
21866
21878
  /** @private */
21867
21879
  const onFetchCustomButtonPropsTrampoline = (options) => {
@@ -21876,7 +21888,6 @@ const onFetchCustomButtonPropsTrampoline = (options) => {
21876
21888
  * @private
21877
21889
  */
21878
21890
  const DesktopMoreButton = (props) => {
21879
- var _a;
21880
21891
  /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
21881
21892
  const localeStrings = useLocale();
21882
21893
  /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
@@ -21916,9 +21927,23 @@ const DesktopMoreButton = (props) => {
21916
21927
  });
21917
21928
  }
21918
21929
  /* @conditional-compile-remove(control-bar-button-injection) */
21919
- 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
+ });
21920
21937
  /* @conditional-compile-remove(control-bar-button-injection) */
21921
- (_a = customDrawerButtons['overflow']) === null || _a === void 0 ? void 0 : _a.props.children.forEach((element) => {
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
+ });
21945
+ /* @conditional-compile-remove(control-bar-button-injection) */
21946
+ customDrawerButtons['overflow'].forEach((element) => {
21922
21947
  moreButtonContextualMenuItems.push(Object.assign({ itemProps: {
21923
21948
  styles: buttonFlyoutIncreasedSizeStyles
21924
21949
  } }, element));
@@ -22041,10 +22066,10 @@ const CallWithChatControlBar = (props) => {
22041
22066
  disabled: props.disableButtonsForHoldScreen || isDisabled$2(options.screenShareButton) })),
22042
22067
  /* @conditional-compile-remove(control-bar-button-injection) */
22043
22068
  (_a = customButtons['primary']) === null || _a === void 0 ? void 0 :
22044
- _a.props.children.slice(0, props.mobileView
22069
+ _a.slice(0, props.mobileView
22045
22070
  ? CUSTOM_BUTTON_OPTIONS.MAX_PRIMARY_MOBILE_CUSTOM_BUTTONS
22046
- : CUSTOM_BUTTON_OPTIONS.MAX_PRIMARY_DESKTOP_CUSTOM_BUTTONS).map((element) => {
22047
- 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' }));
22048
22073
  }),
22049
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 })),
22050
22075
  /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ isEnabled$1(options === null || options === void 0 ? void 0 : options.moreButton) &&
@@ -22056,8 +22081,8 @@ const CallWithChatControlBar = (props) => {
22056
22081
  !props.mobileView && (React__default['default'].createElement(react.Stack, { horizontal: true, className: !props.mobileView ? react.mergeStyles(desktopButtonContainerStyle) : undefined },
22057
22082
  /* @conditional-compile-remove(control-bar-button-injection) */
22058
22083
  (_b = customButtons['secondary']) === null || _b === void 0 ? void 0 :
22059
- _b.props.children.slice(0, CUSTOM_BUTTON_OPTIONS.MAX_SECONDARY_DESKTOP_CUSTOM_BUTTONS).map((element) => {
22060
- 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' }));
22061
22086
  }),
22062
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 })),
22063
22088
  isEnabled$1(options === null || options === void 0 ? void 0 : options.chatButton) && chatButton))));
@@ -22433,7 +22458,7 @@ const inferCallWithChatControlOptions = (callWithChatControls) => {
22433
22458
  };
22434
22459
  /** @private */
22435
22460
  const MoreDrawer = (props) => {
22436
- var _a, _b, _c, _d, _e;
22461
+ var _a, _b;
22437
22462
  const drawerMenuItems = [];
22438
22463
  const { speakers, onSelectSpeaker, onLightDismiss } = props;
22439
22464
  /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
@@ -22543,15 +22568,15 @@ const MoreDrawer = (props) => {
22543
22568
  /* @conditional-compile-remove(control-bar-button-injection) */
22544
22569
  const customDrawerButtons = React.useMemo(() => generateCustomCallWithChatDrawerButtons(onFetchCustomButtonPropsTrampoline(drawerSelectionOptions !== false ? drawerSelectionOptions : undefined), drawerSelectionOptions !== false ? drawerSelectionOptions === null || drawerSelectionOptions === void 0 ? void 0 : drawerSelectionOptions.displayType : undefined), [drawerSelectionOptions]);
22545
22570
  /* @conditional-compile-remove(control-bar-button-injection) */
22546
- (_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) => {
22547
22572
  drawerMenuItems.push(element);
22548
22573
  });
22549
22574
  /* @conditional-compile-remove(control-bar-button-injection) */
22550
- (_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) => {
22551
22576
  drawerMenuItems.push(element);
22552
22577
  });
22553
22578
  /* @conditional-compile-remove(control-bar-button-injection) */
22554
- (_e = customDrawerButtons['secondary']) === null || _e === void 0 ? void 0 : _e.props.children.forEach((element) => {
22579
+ customDrawerButtons['overflow'].forEach((element) => {
22555
22580
  drawerMenuItems.push(element);
22556
22581
  });
22557
22582
  return React__default['default'].createElement(_DrawerMenu, { items: drawerMenuItems, onLightDismiss: props.onLightDismiss });