@azure/communication-react 1.8.0-alpha-202309080012 → 1.8.0-alpha-202309130012

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 (22) hide show
  1. package/dist/communication-react.d.ts +4 -2
  2. package/dist/dist-cjs/communication-react/index.js +94 -36
  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/react-components/src/components/DevicesButton.d.ts +4 -4
  7. package/dist/dist-esm/react-components/src/components/DevicesButton.js +1 -1
  8. package/dist/dist-esm/react-components/src/components/DevicesButton.js.map +1 -1
  9. package/dist/dist-esm/react-components/src/components/index.d.ts +2 -2
  10. package/dist/dist-esm/react-components/src/components/index.js +1 -1
  11. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  12. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +1 -1
  13. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  14. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +90 -34
  15. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  16. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +3 -0
  17. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  18. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +4 -1
  19. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  20. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +4 -1
  21. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
  22. package/package.json +34 -34
@@ -1135,7 +1135,7 @@ export declare interface CallAdapterSubscribers {
1135
1135
  */
1136
1136
  on(event: 'transferRequested', listener: TransferRequestedListener): void;
1137
1137
  /**
1138
- * Unsubscribe function for 'capabilitiesChanged' event.
1138
+ * Subscribe function for 'capabilitiesChanged' event.
1139
1139
  */
1140
1140
  on(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;
1141
1141
  /**
@@ -2861,6 +2861,7 @@ export declare interface CallWithChatAdapterSubscriptions {
2861
2861
  on(event: 'isCaptionsActiveChanged', listener: IsCaptionsActiveChangedListener): void;
2862
2862
  on(event: 'isCaptionLanguageChanged', listener: IsCaptionLanguageChangedListener): void;
2863
2863
  on(event: 'isSpokenLanguageChanged', listener: IsSpokenLanguageChangedListener): void;
2864
+ on(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;
2864
2865
  off(event: 'callEnded', listener: CallEndedListener): void;
2865
2866
  off(event: 'isMutedChanged', listener: IsMutedChangedListener): void;
2866
2867
  off(event: 'callIdChanged', listener: CallIdChangedListener): void;
@@ -2876,6 +2877,7 @@ export declare interface CallWithChatAdapterSubscriptions {
2876
2877
  off(event: 'isCaptionsActiveChanged', listener: IsCaptionsActiveChangedListener): void;
2877
2878
  off(event: 'isCaptionLanguageChanged', listener: IsCaptionLanguageChangedListener): void;
2878
2879
  off(event: 'isSpokenLanguageChanged', listener: IsSpokenLanguageChangedListener): void;
2880
+ off(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;
2879
2881
  on(event: 'messageReceived', listener: MessageReceivedListener): void;
2880
2882
  on(event: 'messageSent', listener: MessageSentListener): void;
2881
2883
  on(event: 'messageRead', listener: MessageReadListener): void;
@@ -3349,7 +3351,7 @@ export declare interface CallWithChatControlOptions extends CommonCallControlOpt
3349
3351
  *
3350
3352
  * @public
3351
3353
  */
3352
- export declare type CallWithChatEvent = 'callError' | 'chatError' | 'callEnded' | 'isMutedChanged' | 'callIdChanged' | 'isLocalScreenSharingActiveChanged' | 'displayNameChanged' | 'isSpeakingChanged' | 'callParticipantsJoined' | 'callParticipantsLeft' | 'selectedMicrophoneChanged' | 'selectedSpeakerChanged' | /* @conditional-compile-remove(close-captions) */ 'isCaptionsActiveChanged' | /* @conditional-compile-remove(close-captions) */ 'captionsReceived' | /* @conditional-compile-remove(close-captions) */ 'isCaptionLanguageChanged' | /* @conditional-compile-remove(close-captions) */ 'isSpokenLanguageChanged' | 'messageReceived' | 'messageSent' | 'messageRead' | 'chatParticipantsAdded' | 'chatParticipantsRemoved';
3354
+ export declare type CallWithChatEvent = 'callError' | 'chatError' | 'callEnded' | 'isMutedChanged' | 'callIdChanged' | 'isLocalScreenSharingActiveChanged' | 'displayNameChanged' | 'isSpeakingChanged' | 'callParticipantsJoined' | 'callParticipantsLeft' | 'selectedMicrophoneChanged' | 'selectedSpeakerChanged' | /* @conditional-compile-remove(close-captions) */ 'isCaptionsActiveChanged' | /* @conditional-compile-remove(close-captions) */ 'captionsReceived' | /* @conditional-compile-remove(close-captions) */ 'isCaptionLanguageChanged' | /* @conditional-compile-remove(close-captions) */ 'isSpokenLanguageChanged' | /* @conditional-compile-remove(capabilities) */ 'capabilitiesChanged' | 'messageReceived' | 'messageSent' | 'messageRead' | 'chatParticipantsAdded' | 'chatParticipantsRemoved';
3353
3355
 
3354
3356
  /**
3355
3357
  * @beta
@@ -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.8.0-alpha-202309080012';
181
+ var telemetryVersion = '1.8.0-alpha-202309130012';
182
182
 
183
183
  // Copyright (c) Microsoft Corporation.
184
184
  /**
@@ -15365,7 +15365,7 @@ const _HighContrastAwareIcon = (props) => {
15365
15365
  * Generates default {@link IContextualMenuProps} for buttons that
15366
15366
  * show a drop-down to select devices to use.
15367
15367
  *
15368
- * @private
15368
+ * @internal
15369
15369
  */
15370
15370
  const generateDefaultDeviceMenuProps = (props, strings, primaryActionItem, isSelectCamAllowed = true, isSelectMicAllowed = true) => {
15371
15371
  var _a, _b;
@@ -23744,7 +23744,29 @@ const CallControls = (props) => {
23744
23744
  const raiseHandButtonProps = usePropsFor$1(RaiseHandButton);
23745
23745
  /* @conditional-compile-remove(PSTN-calls) */
23746
23746
  const alternateCallerId = useAdapter().getState().alternateCallerId;
23747
- /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(close-captions) */ /* @conditional-compile-remove(raise-hand) */
23747
+ const devicesButtonProps = usePropsFor$1(DevicesButton);
23748
+ let numberOfButtons = 0;
23749
+ const screenShareButtonIsEnabled = isEnabled$2(options === null || options === void 0 ? void 0 : options.screenShareButton);
23750
+ if (screenShareButtonIsEnabled) {
23751
+ numberOfButtons++;
23752
+ }
23753
+ const microphoneButtonIsEnabled = isEnabled$2(options === null || options === void 0 ? void 0 : options.microphoneButton);
23754
+ if (microphoneButtonIsEnabled) {
23755
+ numberOfButtons++;
23756
+ }
23757
+ const cameraButtonIsEnabled = isEnabled$2(options === null || options === void 0 ? void 0 : options.cameraButton);
23758
+ if (cameraButtonIsEnabled) {
23759
+ numberOfButtons++;
23760
+ }
23761
+ if (isEnabled$2(options === null || options === void 0 ? void 0 : options.endCallButton)) {
23762
+ numberOfButtons++;
23763
+ }
23764
+ const showParticipantsButtonInControlBar = isEnabled$2(options === null || options === void 0 ? void 0 : options.participantsButton) &&
23765
+ /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(PSTN-calls) */
23766
+ !props.isMobile;
23767
+ if (showParticipantsButtonInControlBar) {
23768
+ numberOfButtons++;
23769
+ }
23748
23770
  const moreButtonContextualMenuItems = () => {
23749
23771
  const items = [];
23750
23772
  if (props.isMobile && props.onPeopleButtonClicked && isEnabled$2(options === null || options === void 0 ? void 0 : options.participantsButton)) {
@@ -23795,32 +23817,72 @@ const CallControls = (props) => {
23795
23817
  }
23796
23818
  });
23797
23819
  }
23798
- /* @conditional-compile-remove(raise-hand) */
23799
- if (raiseHandButtonIsEnabled) {
23800
- items.push({
23801
- key: 'raiseHandButtonKey',
23802
- text: raiseHandButtonProps.checked
23803
- ? localeStrings.component.strings.raiseHandButton.onLabel
23804
- : localeStrings.component.strings.raiseHandButton.offLabel,
23805
- onClick: () => {
23806
- if (raiseHandButtonProps.onToggleRaiseHand) {
23807
- raiseHandButtonProps.onToggleRaiseHand();
23808
- }
23809
- },
23810
- iconProps: { iconName: 'RaiseHandContextualMenuItem', styles: { root: { lineHeight: 0 } } },
23811
- itemProps: {
23812
- styles: buttonFlyoutIncreasedSizeStyles
23813
- },
23814
- disabled: isDisabled$3(options === null || options === void 0 ? void 0 : options.raiseHandButton),
23815
- ['data-ui-id']: 'raise-hand-button'
23816
- });
23817
- }
23818
23820
  return items;
23819
23821
  };
23822
+ const moreButtonMenuItems = moreButtonContextualMenuItems();
23823
+ let showMoreButton = isEnabled$2(options === null || options === void 0 ? void 0 : options.moreButton) && moreButtonMenuItems.length > 0;
23824
+ if (showMoreButton) {
23825
+ numberOfButtons++;
23826
+ }
23827
+ const customButtons = React.useMemo(() => generateCustomControlBarButtons$1(onFetchCustomButtonPropsTrampoline$1(options), options === null || options === void 0 ? void 0 : options.displayType), [options]);
23828
+ numberOfButtons += React__default['default'].Children.count(customButtons['primary']) + React__default['default'].Children.count(customButtons['secondary']);
23829
+ let showDevicesButtonInControlBar = isEnabled$2(options === null || options === void 0 ? void 0 : options.devicesButton);
23830
+ if (showDevicesButtonInControlBar && (props.isMobile ? numberOfButtons < 5 : true)) {
23831
+ numberOfButtons++;
23832
+ }
23833
+ else {
23834
+ showDevicesButtonInControlBar = false;
23835
+ showMoreButton = isEnabled$2(options === null || options === void 0 ? void 0 : options.moreButton);
23836
+ }
23837
+ /* @conditional-compile-remove(raise-hand) */
23838
+ const raiseHandButtonIsEnabled = isEnabled$2(options === null || options === void 0 ? void 0 : options.raiseHandButton);
23839
+ /* @conditional-compile-remove(raise-hand) */
23840
+ let showRaiseHandButtonInControlBar = raiseHandButtonIsEnabled;
23841
+ /* @conditional-compile-remove(raise-hand) */
23842
+ if (showRaiseHandButtonInControlBar && (props.isMobile ? numberOfButtons < 5 : true)) {
23843
+ numberOfButtons++;
23844
+ }
23845
+ else {
23846
+ // If more button is not present but enabled then replace previous button (devices button) with more button
23847
+ if (!showMoreButton && isEnabled$2(options === null || options === void 0 ? void 0 : options.moreButton)) {
23848
+ showMoreButton = true;
23849
+ showDevicesButtonInControlBar = false;
23850
+ }
23851
+ showRaiseHandButtonInControlBar = false;
23852
+ }
23853
+ if (!showDevicesButtonInControlBar) {
23854
+ const devicesButtonMenu = generateDefaultDeviceMenuProps(devicesButtonProps, localeStrings.component.strings.devicesButton);
23855
+ moreButtonMenuItems.push({
23856
+ key: 'devicesButtonKey',
23857
+ text: localeStrings.component.strings.devicesButton.label,
23858
+ iconProps: { iconName: 'ControlButtonOptions', styles: { root: { lineHeight: 0 } } },
23859
+ subMenuProps: devicesButtonMenu,
23860
+ ['data-ui-id']: 'call-composite-more-menu-devices-button'
23861
+ });
23862
+ }
23863
+ /* @conditional-compile-remove(raise-hand) */
23864
+ if (!showRaiseHandButtonInControlBar) {
23865
+ moreButtonMenuItems.push({
23866
+ key: 'raiseHandButtonKey',
23867
+ text: raiseHandButtonProps.checked
23868
+ ? localeStrings.component.strings.raiseHandButton.onLabel
23869
+ : localeStrings.component.strings.raiseHandButton.offLabel,
23870
+ onClick: () => {
23871
+ if (raiseHandButtonProps.onToggleRaiseHand) {
23872
+ raiseHandButtonProps.onToggleRaiseHand();
23873
+ }
23874
+ },
23875
+ iconProps: { iconName: 'RaiseHandContextualMenuItem', styles: { root: { lineHeight: 0 } } },
23876
+ itemProps: {
23877
+ styles: buttonFlyoutIncreasedSizeStyles
23878
+ },
23879
+ disabled: isDisabled$3(options === null || options === void 0 ? void 0 : options.raiseHandButton),
23880
+ ['data-ui-id']: 'call-composite-more-menu-raise-hand-button'
23881
+ });
23882
+ }
23820
23883
  /* @conditional-compile-remove(PSTN-calls) */
23821
23884
  const [showDialpad, setShowDialpad] = React.useState(false);
23822
23885
  const theme = react.useTheme();
23823
- const customButtons = React.useMemo(() => generateCustomControlBarButtons$1(onFetchCustomButtonPropsTrampoline$1(options), options === null || options === void 0 ? void 0 : options.displayType), [options]);
23824
23886
  // when props.options is false then we want to hide the whole control bar.
23825
23887
  if (props.options === false) {
23826
23888
  return React__default['default'].createElement(React__default['default'].Fragment, null);
@@ -23829,11 +23891,6 @@ const CallControls = (props) => {
23829
23891
  const onDismissDialpad = () => {
23830
23892
  setShowDialpad(false);
23831
23893
  };
23832
- const screenShareButtonIsEnabled = isEnabled$2(options === null || options === void 0 ? void 0 : options.screenShareButton);
23833
- const microphoneButtonIsEnabled = isEnabled$2(options === null || options === void 0 ? void 0 : options.microphoneButton);
23834
- const cameraButtonIsEnabled = isEnabled$2(options === null || options === void 0 ? void 0 : options.cameraButton);
23835
- /* @conditional-compile-remove(raise-hand) */
23836
- const raiseHandButtonIsEnabled = isEnabled$2(options === null || options === void 0 ? void 0 : options.raiseHandButton);
23837
23894
  return (React__default['default'].createElement(react.Stack, { horizontalAlign: "center", className: callControlsContainerStyles },
23838
23895
  /* @conditional-compile-remove(PSTN-calls) */
23839
23896
  React__default['default'].createElement(SendDtmfDialpad, { isMobile: !!props.isMobile, strings: dialpadStrings, showDialpad: showDialpad, onDismissDialpad: onDismissDialpad }),
@@ -23841,16 +23898,14 @@ const CallControls = (props) => {
23841
23898
  React__default['default'].createElement(ControlBar, { layout: props.displayVertical ? 'vertical' : 'horizontal', styles: controlBarStyles(theme.semanticColors.bodyBackground) },
23842
23899
  microphoneButtonIsEnabled && (React__default['default'].createElement(Microphone, { displayType: options === null || options === void 0 ? void 0 : options.displayType, disabled: isDisabled$3(options === null || options === void 0 ? void 0 : options.microphoneButton) })),
23843
23900
  cameraButtonIsEnabled && (React__default['default'].createElement(Camera, { displayType: options === null || options === void 0 ? void 0 : options.displayType, disabled: isDisabled$3(options === null || options === void 0 ? void 0 : options.cameraButton) })),
23844
- /* @conditional-compile-remove(raise-hand) */ raiseHandButtonIsEnabled && !props.isMobile && (React__default['default'].createElement(RaiseHand, { displayType: options === null || options === void 0 ? void 0 : options.displayType })),
23901
+ /* @conditional-compile-remove(raise-hand) */ showRaiseHandButtonInControlBar && (React__default['default'].createElement(RaiseHand, { displayType: options === null || options === void 0 ? void 0 : options.displayType })),
23845
23902
  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$3(options === null || options === void 0 ? void 0 : options.screenShareButton) })),
23846
- isEnabled$2(options === null || options === void 0 ? void 0 : options.participantsButton) &&
23847
- /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(PSTN-calls) */
23848
- !props.isMobile && (React__default['default'].createElement(Participants, { option: options === null || options === void 0 ? void 0 : options.participantsButton, callInvitationURL: props.callInvitationURL, onFetchParticipantMenuItems: props.onFetchParticipantMenuItems, displayType: options === null || options === void 0 ? void 0 : options.displayType, increaseFlyoutItemSize: props.increaseFlyoutItemSize, isMobile: props.isMobile, disabled: isDisabled$3(options === null || options === void 0 ? void 0 : options.participantsButton) })) && (
23903
+ showParticipantsButtonInControlBar && (React__default['default'].createElement(Participants, { option: options === null || options === void 0 ? void 0 : options.participantsButton, callInvitationURL: props.callInvitationURL, onFetchParticipantMenuItems: props.onFetchParticipantMenuItems, displayType: options === null || options === void 0 ? void 0 : options.displayType, increaseFlyoutItemSize: props.increaseFlyoutItemSize, isMobile: props.isMobile, disabled: isDisabled$3(options === null || options === void 0 ? void 0 : options.participantsButton) })) && (
23849
23904
  /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(PSTN-calls) */
23850
23905
  React__default['default'].createElement(People, { checked: props.peopleButtonChecked, ariaLabel: peopleButtonStrings === null || peopleButtonStrings === void 0 ? void 0 : peopleButtonStrings.label, showLabel: (options === null || options === void 0 ? void 0 : options.displayType) !== 'compact', onClick: props.onPeopleButtonClicked, "data-ui-id": "call-composite-people-button", strings: peopleButtonStrings, disabled: isDisabled$3(options === null || options === void 0 ? void 0 : options.participantsButton) })),
23851
- isEnabled$2(options === null || options === void 0 ? void 0 : options.devicesButton) && (React__default['default'].createElement(Devices, { displayType: options === null || options === void 0 ? void 0 : options.displayType, increaseFlyoutItemSize: props.increaseFlyoutItemSize, disabled: isDisabled$3(options === null || options === void 0 ? void 0 : options.devicesButton) })),
23906
+ showDevicesButtonInControlBar && (React__default['default'].createElement(Devices, { displayType: options === null || options === void 0 ? void 0 : options.displayType, increaseFlyoutItemSize: props.increaseFlyoutItemSize, disabled: isDisabled$3(options === null || options === void 0 ? void 0 : options.devicesButton) })),
23852
23907
  /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(close-captions) */ /* @conditional-compile-remove(raise-hand) */
23853
- isEnabled$2(options === null || options === void 0 ? void 0 : options.moreButton) && moreButtonContextualMenuItems().length > 0 && (React__default['default'].createElement(MoreButton, { "data-ui-id": "common-call-composite-more-button", strings: moreButtonStrings, menuIconProps: { hidden: true }, menuProps: { items: moreButtonContextualMenuItems() }, showLabel: (options === null || options === void 0 ? void 0 : options.displayType) !== 'compact' })),
23908
+ showMoreButton && (React__default['default'].createElement(MoreButton, { "data-ui-id": "common-call-composite-more-button", strings: moreButtonStrings, menuIconProps: { hidden: true }, menuProps: { items: moreButtonMenuItems }, showLabel: (options === null || options === void 0 ? void 0 : options.displayType) !== 'compact' })),
23854
23909
  customButtons['primary'],
23855
23910
  isEnabled$2(options === null || options === void 0 ? void 0 : options.endCallButton) && React__default['default'].createElement(EndCall, { displayType: options === null || options === void 0 ? void 0 : options.displayType })))));
23856
23911
  };
@@ -24235,7 +24290,10 @@ const DesktopMoreButton = (props) => {
24235
24290
  }
24236
24291
  }
24237
24292
  }
24238
- ]
24293
+ ],
24294
+ calloutProps: {
24295
+ preventDismissOnEvent: _preventDismissOnEvent
24296
+ }
24239
24297
  }
24240
24298
  });
24241
24299
  }