@azure/communication-react 1.4.2-alpha-202211010021.0 → 1.4.2-alpha-202211030017.0

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 (46) hide show
  1. package/dist/communication-react.d.ts +12 -5
  2. package/dist/dist-cjs/communication-react/index.js +55 -21
  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-component-bindings/src/baseSelectors.d.ts +5 -0
  7. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +5 -0
  8. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  9. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +10 -3
  10. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
  11. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.d.ts +7 -1
  12. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js +11 -0
  13. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js.map +1 -1
  14. package/dist/dist-esm/react-components/src/components/BrowserPermissionDenied.d.ts +3 -3
  15. package/dist/dist-esm/react-components/src/components/BrowserPermissionDenied.js +6 -4
  16. package/dist/dist-esm/react-components/src/components/BrowserPermissionDenied.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/BrowserPermissionDeniedIOS.d.ts +1 -1
  18. package/dist/dist-esm/react-components/src/components/BrowserPermissionDeniedIOS.js +19 -18
  19. package/dist/dist-esm/react-components/src/components/BrowserPermissionDeniedIOS.js.map +1 -1
  20. package/dist/dist-esm/react-components/src/components/DevicePermissionDropdown.d.ts +4 -0
  21. package/dist/dist-esm/react-components/src/components/DevicePermissionDropdown.js +3 -2
  22. package/dist/dist-esm/react-components/src/components/DevicePermissionDropdown.js.map +1 -1
  23. package/dist/dist-esm/react-components/src/components/DomainPermissions.js +2 -4
  24. package/dist/dist-esm/react-components/src/components/DomainPermissions.js.map +1 -1
  25. package/dist/dist-esm/react-components/src/components/utils.d.ts +4 -0
  26. package/dist/dist-esm/react-components/src/components/utils.js +7 -0
  27. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  28. package/dist/dist-esm/react-components/src/permissions/PermissionsProvider.d.ts +2 -1
  29. package/dist/dist-esm/react-components/src/permissions/PermissionsProvider.js.map +1 -1
  30. package/dist/dist-esm/react-components/src/types/ParticipantListParticipant.d.ts +3 -0
  31. package/dist/dist-esm/react-components/src/types/ParticipantListParticipant.js.map +1 -1
  32. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.d.ts +1 -0
  33. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.js +1 -1
  34. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.js.map +1 -1
  35. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.d.ts +1 -0
  36. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.js +1 -1
  37. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.js.map +1 -1
  38. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.d.ts +1 -0
  39. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +6 -2
  40. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
  41. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +20 -1
  42. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  43. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +5 -0
  44. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +5 -0
  45. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  46. package/package.json +8 -8
@@ -365,7 +365,7 @@ export declare interface BrowserPermissionDeniedIOSProps extends BrowserPermissi
365
365
  /**
366
366
  * Localization strings for BrowserPermissionDeniedIOS component.
367
367
  */
368
- strings: BrowserPermissionDeniedIOSStrings;
368
+ strings?: BrowserPermissionDeniedIOSStrings;
369
369
  /**
370
370
  * Link to image source.
371
371
  *
@@ -433,15 +433,15 @@ export declare interface BrowserPermissionDeniedProps {
433
433
  /**
434
434
  * Action to be taken by the more help link. Possible to send to external page or show other modal.
435
435
  */
436
- onTroubleshootingClick: () => void;
436
+ onTroubleshootingClick?: () => void;
437
437
  /**
438
438
  * Action to be taken by the try again primary button.
439
439
  */
440
- onTryAgainClick: () => void;
440
+ onTryAgainClick?: () => void;
441
441
  /**
442
442
  * Localization strings for BrowserPermissionDenied component.
443
443
  */
444
- strings: BrowserPermissionDeniedStrings;
444
+ strings?: BrowserPermissionDeniedStrings;
445
445
  /**
446
446
  * Allows users to pass in an object contains custom CSS styles.
447
447
  * @Example
@@ -1726,6 +1726,8 @@ export declare type CallParticipantListParticipant = ParticipantListParticipant
1726
1726
  isMuted?: boolean;
1727
1727
  /** Whether calling participant is speaking */
1728
1728
  isSpeaking?: boolean;
1729
+ /** Role of participant in Rooms call */
1730
+ role?: Role;
1729
1731
  };
1730
1732
 
1731
1733
  /**
@@ -4425,6 +4427,10 @@ export declare interface _DevicePermissionDropdownProps {
4425
4427
  * @param constrain - Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }
4426
4428
  */
4427
4429
  askDevicePermission?(constrain: _PermissionConstraints): Promise<void>;
4430
+ /**
4431
+ * Optional callback when component is clicked
4432
+ */
4433
+ onClick?: () => void;
4428
4434
  /**
4429
4435
  * Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }
4430
4436
  */
@@ -6764,8 +6770,9 @@ export declare interface RemoteVideoStreamState {
6764
6770
 
6765
6771
  /**
6766
6772
  * @beta
6773
+ * The role of a call participant.
6767
6774
  */
6768
- export declare type Role = 'Presenter' | 'Attendee' | 'Consumer';
6775
+ export declare type Role = 'Presenter' | 'Attendee' | 'Consumer' | 'Organizer';
6769
6776
 
6770
6777
  /**
6771
6778
  * A button to start / stop screen sharing.
@@ -202,7 +202,7 @@ const _toCommunicationIdentifier = (id) => {
202
202
  // Copyright (c) Microsoft Corporation.
203
203
  // Licensed under the MIT license.
204
204
  // GENERATED FILE. DO NOT EDIT MANUALLY.
205
- var telemetryVersion = '1.4.2-alpha-202211010021.0';
205
+ var telemetryVersion = '1.4.2-alpha-202211030017.0';
206
206
 
207
207
  // Copyright (c) Microsoft Corporation.
208
208
  /**
@@ -1510,6 +1510,13 @@ const customIconName = {
1510
1510
  callVideoRecoveredBySystem: 'ErrorBarCallVideoRecoveredBySystem',
1511
1511
  callMacOsCameraAccessDenied: 'ErrorBarCallMacOsCameraAccessDenied'
1512
1512
  };
1513
+ /* @conditional-compile-remove(call-readiness) */
1514
+ /**
1515
+ * @private
1516
+ */
1517
+ const isValidString = (string) => {
1518
+ return !!string && string.length > 0;
1519
+ };
1513
1520
 
1514
1521
  // Copyright (c) Microsoft Corporation.
1515
1522
  /**
@@ -7263,10 +7270,6 @@ const DomainPermissions = (props) => {
7263
7270
  /* @conditional-compile-remove(call-readiness) */
7264
7271
  return React__default['default'].createElement(DomainPermissionsContainer, Object.assign({}, props, { strings: props.strings ? props.strings : locale }));
7265
7272
  };
7266
- /* @conditional-compile-remove(call-readiness) */
7267
- const isValidString = (string) => {
7268
- return !!string && string.length > 0;
7269
- };
7270
7273
 
7271
7274
  // Copyright (c) Microsoft Corporation.
7272
7275
  /**
@@ -8478,7 +8481,7 @@ const showErrorBar = (errorType, devicePermissionErrorBar, networkErrorBar) => {
8478
8481
  * @internal
8479
8482
  */
8480
8483
  const _DevicePermissionDropdown = (props) => {
8481
- const { icon, askDevicePermission, constrain, strings, options, styles } = props;
8484
+ const { icon, askDevicePermission, onClick, constrain, strings, options, styles } = props;
8482
8485
  const onRenderPlaceholder = () => {
8483
8486
  return (React__default['default'].createElement(react.Stack, { horizontal: true, verticalAlign: "center" },
8484
8487
  icon,
@@ -8487,10 +8490,11 @@ const _DevicePermissionDropdown = (props) => {
8487
8490
  const onRenderCaretDown = () => {
8488
8491
  return React__default['default'].createElement(react.Text, null, strings === null || strings === void 0 ? void 0 : strings.actionButtonContent);
8489
8492
  };
8490
- return (React__default['default'].createElement(react.Dropdown, { placeholder: strings === null || strings === void 0 ? void 0 : strings.placeHolderText, label: strings === null || strings === void 0 ? void 0 : strings.label, onRenderPlaceholder: onRenderPlaceholder, onRenderCaretDown: onRenderCaretDown, onClick: () => {
8493
+ return (React__default['default'].createElement(react.Dropdown, { "data-ui-id": 'permission-dropdown', placeholder: strings === null || strings === void 0 ? void 0 : strings.placeHolderText, label: strings === null || strings === void 0 ? void 0 : strings.label, onRenderPlaceholder: onRenderPlaceholder, onRenderCaretDown: onRenderCaretDown, onClick: () => {
8491
8494
  if (askDevicePermission) {
8492
8495
  askDevicePermission(constrain !== null && constrain !== void 0 ? constrain : { video: true, audio: true });
8493
8496
  }
8497
+ onClick === null || onClick === void 0 ? void 0 : onClick();
8494
8498
  }, options: options !== null && options !== void 0 ? options : [], styles: styles }));
8495
8499
  };
8496
8500
 
@@ -8619,12 +8623,6 @@ const updateUserDisplayNamesTrampoline$2 = (remoteParticipants) => {
8619
8623
  };
8620
8624
 
8621
8625
  // Copyright (c) Microsoft Corporation.
8622
- /**
8623
- * @private
8624
- */
8625
- const memoizedConvertAllremoteParticipants = memoizeFnAll((userId, displayName, state, isMuted, isScreenSharing, isSpeaking) => {
8626
- return convertRemoteParticipantToParticipantListParticipant(userId, displayName, state, isMuted, isScreenSharing, isSpeaking);
8627
- });
8628
8626
  const convertRemoteParticipantToParticipantListParticipant = (userId, displayName, state, isMuted, isScreenSharing, isSpeaking) => {
8629
8627
  const identifier = fromFlatCommunicationIdentifier(userId);
8630
8628
  return {
@@ -8639,10 +8637,22 @@ const convertRemoteParticipantToParticipantListParticipant = (userId, displayNam
8639
8637
  isRemovable: communicationCommon.getIdentifierKind(identifier).kind === 'communicationUser' || communicationCommon.getIdentifierKind(identifier).kind === 'phoneNumber'
8640
8638
  };
8641
8639
  };
8640
+ /* @conditional-compile-remove(rooms) */
8641
+ /**
8642
+ * @private
8643
+ */
8644
+ const memoizedConvertAllremoteParticipantsBeta = memoizeFnAll((userId, displayName, state, isMuted, isScreenSharing, isSpeaking, role) => {
8645
+ return convertRemoteParticipantToParticipantListParticipantBeta(userId, displayName, state, isMuted, isScreenSharing, isSpeaking, role);
8646
+ });
8647
+ /* @conditional-compile-remove(rooms) */
8648
+ const convertRemoteParticipantToParticipantListParticipantBeta = (userId, displayName, state, isMuted, isScreenSharing, isSpeaking, role) => {
8649
+ return Object.assign(Object.assign({}, convertRemoteParticipantToParticipantListParticipant(userId, displayName, state, isMuted, isScreenSharing, isSpeaking)), { role });
8650
+ };
8642
8651
 
8643
8652
  // Copyright (c) Microsoft Corporation.
8644
8653
  const convertRemoteParticipantsToParticipantListParticipants = (remoteParticipants) => {
8645
- return memoizedConvertAllremoteParticipants((memoizeFn) => {
8654
+ /* eslint-disable @typescript-eslint/explicit-function-return-type */
8655
+ const conversionCallback = (memoizeFn) => {
8646
8656
  return (remoteParticipants
8647
8657
  // temporarily hiding lobby participants in ACS clients till we can admit users through ACS clients
8648
8658
  .filter((participant) => {
@@ -8650,7 +8660,8 @@ const convertRemoteParticipantsToParticipantListParticipants = (remoteParticipan
8650
8660
  })
8651
8661
  .map((participant) => {
8652
8662
  const isScreenSharing = Object.values(participant.videoStreams).some((videoStream) => videoStream.mediaStreamType === 'ScreenSharing' && videoStream.isAvailable);
8653
- return memoizeFn(toFlatCommunicationIdentifier(participant.identifier), participant.displayName, participant.state, participant.isMuted, isScreenSharing, participant.isSpeaking);
8663
+ return memoizeFn(toFlatCommunicationIdentifier(participant.identifier), participant.displayName, participant.state, participant.isMuted, isScreenSharing, participant.isSpeaking,
8664
+ /* @conditional-compile-remove(rooms) */ participant.role);
8654
8665
  })
8655
8666
  .sort((a, b) => {
8656
8667
  var _a, _b;
@@ -8666,7 +8677,9 @@ const convertRemoteParticipantsToParticipantListParticipants = (remoteParticipan
8666
8677
  return 0;
8667
8678
  }
8668
8679
  }));
8669
- });
8680
+ };
8681
+ /* @conditional-compile-remove(rooms) */
8682
+ return memoizedConvertAllremoteParticipantsBeta(conversionCallback);
8670
8683
  };
8671
8684
  /**
8672
8685
  * Selects data that drives {@link ParticipantList} component.
@@ -17383,7 +17396,7 @@ const ConfigurationpageCameraDropdown = (props) => {
17383
17396
  actionButtonContent: 'Allow'
17384
17397
  };
17385
17398
  /* @conditional-compile-remove(call-readiness) */
17386
- const cameraBlockedDropdown = (React__default['default'].createElement(_DevicePermissionDropdown, Object.assign({ styles: dropDownStyles(theme), constrain: { video: true, audio: false }, strings: devicePermissionDropdownStringsCamera, icon: React__default['default'].createElement(CallCompositeIcon, { iconName: "ControlButtonCameraOn", style: { height: '1.25rem', marginRight: '0.625rem' } }) }, props.dropdownProps)));
17399
+ const cameraBlockedDropdown = (React__default['default'].createElement(_DevicePermissionDropdown, Object.assign({ styles: dropDownStyles(theme), constrain: { video: true, audio: false }, strings: devicePermissionDropdownStringsCamera, icon: React__default['default'].createElement(CallCompositeIcon, { iconName: "ControlButtonCameraOn", style: { height: '1.25rem', marginRight: '0.625rem' } }), onClick: props.onClickEnableDevicePermission }, props.dropdownProps)));
17387
17400
  /* @conditional-compile-remove(call-readiness) */
17388
17401
  if (props.callReadinessOptedIn) {
17389
17402
  return React__default['default'].createElement(React__default['default'].Fragment, null, props.cameraPermissionGranted ? props.cameraGrantedDropdown : cameraBlockedDropdown);
@@ -17404,7 +17417,7 @@ const ConfigurationpageMicDropdown = (props) => {
17404
17417
  actionButtonContent: 'Allow'
17405
17418
  };
17406
17419
  /* @conditional-compile-remove(call-readiness) */
17407
- const microphoneBlockedDropdown = (React__default['default'].createElement(_DevicePermissionDropdown, Object.assign({ styles: dropDownStyles(theme), constrain: { video: false, audio: true }, strings: devicePermissionDropdownStringsMicrophone, icon: React__default['default'].createElement(CallCompositeIcon, { iconName: "ControlButtonMicOn", style: { height: '1.25rem', marginRight: '0.625rem' } }) }, props.dropdownProps)));
17420
+ const microphoneBlockedDropdown = (React__default['default'].createElement(_DevicePermissionDropdown, Object.assign({ styles: dropDownStyles(theme), constrain: { video: false, audio: true }, strings: devicePermissionDropdownStringsMicrophone, icon: React__default['default'].createElement(CallCompositeIcon, { iconName: "ControlButtonMicOn", style: { height: '1.25rem', marginRight: '0.625rem' } }), onClick: props.onClickEnableDevicePermission }, props.dropdownProps)));
17408
17421
  /* @conditional-compile-remove(call-readiness) */
17409
17422
  if (props.callReadinessOptedIn) {
17410
17423
  return React__default['default'].createElement(React__default['default'].Fragment, null,
@@ -17518,7 +17531,9 @@ const LocalDeviceSettings = (props) => {
17518
17531
  /* @conditional-compile-remove(call-readiness) */
17519
17532
  dropdownProps: dropdownProps,
17520
17533
  /* @conditional-compile-remove(call-readiness) */
17521
- callReadinessOptedIn: (_b = props.callReadinessOptedIn) !== null && _b !== void 0 ? _b : false }))),
17534
+ callReadinessOptedIn: (_b = props.callReadinessOptedIn) !== null && _b !== void 0 ? _b : false,
17535
+ /* @conditional-compile-remove(call-readiness) */
17536
+ onClickEnableDevicePermission: props.onClickEnableDevicePermission }))),
17522
17537
  React__default['default'].createElement(react.Stack, null,
17523
17538
  React__default['default'].createElement(react.Label, { id: 'call-composite-local-sound-settings-label', className: react.mergeStyles(dropDownStyles(theme).label), disabled: !micPermissionGranted }, soundLabel),
17524
17539
  React__default['default'].createElement(react.Stack, { "data-ui-id": "call-composite-sound-settings", tokens: mainStackTokens },
@@ -17526,7 +17541,9 @@ const LocalDeviceSettings = (props) => {
17526
17541
  /* @conditional-compile-remove(call-readiness) */
17527
17542
  dropdownProps: dropdownProps,
17528
17543
  /* @conditional-compile-remove(call-readiness) */
17529
- callReadinessOptedIn: (_c = props.callReadinessOptedIn) !== null && _c !== void 0 ? _c : false }),
17544
+ callReadinessOptedIn: (_c = props.callReadinessOptedIn) !== null && _c !== void 0 ? _c : false,
17545
+ /* @conditional-compile-remove(call-readiness) */
17546
+ onClickEnableDevicePermission: props.onClickEnableDevicePermission }),
17530
17547
  React__default['default'].createElement(react.Dropdown, { "aria-labelledby": 'call-composite-local-sound-settings-label', placeholder: defaultPlaceHolder, styles: dropDownStyles(theme), disabled: props.speakers.length === 0, options: getDropDownList(props.speakers), defaultSelectedKey: props.selectedSpeaker ? props.selectedSpeaker.id : defaultDeviceId(props.speakers), onChange: (event, option, index) => {
17531
17548
  props.onSelectSpeaker(props.speakers[index !== null && index !== void 0 ? index : 0]);
17532
17549
  }, onRenderTitle: (props) => onRenderTitle('Speaker', props) })))));
@@ -17882,6 +17899,8 @@ const ConfigurationPage = (props) => {
17882
17899
  // do nothing here
17883
17900
  // only way to dismiss this drawer is clicking on allow access which will leads to device permission prompt
17884
17901
  };
17902
+ /* @conditional-compile-remove(call-readiness) */
17903
+ const [isModalShowing, setIsModalShowing] = React.useState(false);
17885
17904
  return (React__default['default'].createElement(react.Stack, { className: mobileView ? configurationContainerStyleMobile : configurationContainerStyleDesktop },
17886
17905
  React__default['default'].createElement(react.Stack, { styles: bannerNotificationStyles },
17887
17906
  React__default['default'].createElement(ConfigurationpageErrorBar
@@ -17900,6 +17919,17 @@ const ConfigurationPage = (props) => {
17900
17919
  /* @conditional-compile-remove(call-readiness) */
17901
17920
  callReadinessOptedIn: callReadinessOptedIn })),
17902
17921
  /* @conditional-compile-remove(call-readiness) */
17922
+ //show this when clicking on enable camera button or enable mic button on desktop for the first time
17923
+ //does not show if user has already grant mic or camera access
17924
+ !mobileView && !cameraPermissionGranted && !microphonePermissionGranted && callReadinessOptedIn && (React__default['default'].createElement(react.Modal, { isOpen: isModalShowing, isBlocking: false, onDismiss: () => {
17925
+ setIsModalShowing(false);
17926
+ }, overlay: { styles: { root: { background: 'rgba(0,0,0,0.9)' } } } },
17927
+ React__default['default'].createElement(DomainPermissions, { appName: 'app', onTroubleshootingClick: onPermissionsTroubleshootingClick
17928
+ ? () => {
17929
+ onPermissionsTroubleshootingClick(permissionsState);
17930
+ }
17931
+ : undefined }))),
17932
+ /* @conditional-compile-remove(call-readiness) */
17903
17933
  mobileView && isDrawerShowing && callReadinessOptedIn && (React__default['default'].createElement(_DrawerSurface, { onLightDismiss: onLightDismissTriggered, styles: drawerContainerStyles(DRAWER_HIGH_Z_BAND) },
17904
17934
  React__default['default'].createElement(DomainPermissions, { appName: 'app', onTroubleshootingClick: onPermissionsTroubleshootingClick
17905
17935
  ? () => {
@@ -17925,7 +17955,11 @@ const ConfigurationPage = (props) => {
17925
17955
  callDescription),
17926
17956
  React__default['default'].createElement(LocalDeviceSettings, Object.assign({}, options, localDeviceSettingsHandlers, { cameraPermissionGranted: cameraPermissionGranted, microphonePermissionGranted: microphonePermissionGranted,
17927
17957
  /* @conditional-compile-remove(call-readiness) */
17928
- callReadinessOptedIn: callReadinessOptedIn })))),
17958
+ callReadinessOptedIn: callReadinessOptedIn,
17959
+ /* @conditional-compile-remove(call-readiness) */
17960
+ onClickEnableDevicePermission: () => {
17961
+ setIsModalShowing(true);
17962
+ } })))),
17929
17963
  React__default['default'].createElement(react.Stack, { styles: mobileWithPreview ? startCallButtonContainerStyleMobile : startCallButtonContainerStyleDesktop },
17930
17964
  React__default['default'].createElement(StartCallButton, { className: mobileWithPreview ? startCallButtonStyleMobile : undefined, onClick: startCallHandler, disabled: disableStartCallButton }))))));
17931
17965
  };