@azure/communication-react 1.4.2-alpha-202211020017.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 (31) hide show
  1. package/dist/communication-react.d.ts +8 -4
  2. package/dist/dist-cjs/communication-react/index.js +37 -12
  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/BrowserPermissionDenied.d.ts +3 -3
  7. package/dist/dist-esm/react-components/src/components/BrowserPermissionDenied.js +6 -4
  8. package/dist/dist-esm/react-components/src/components/BrowserPermissionDenied.js.map +1 -1
  9. package/dist/dist-esm/react-components/src/components/BrowserPermissionDeniedIOS.d.ts +1 -1
  10. package/dist/dist-esm/react-components/src/components/BrowserPermissionDeniedIOS.js +19 -18
  11. package/dist/dist-esm/react-components/src/components/BrowserPermissionDeniedIOS.js.map +1 -1
  12. package/dist/dist-esm/react-components/src/components/DevicePermissionDropdown.d.ts +4 -0
  13. package/dist/dist-esm/react-components/src/components/DevicePermissionDropdown.js +3 -2
  14. package/dist/dist-esm/react-components/src/components/DevicePermissionDropdown.js.map +1 -1
  15. package/dist/dist-esm/react-components/src/components/DomainPermissions.js +2 -4
  16. package/dist/dist-esm/react-components/src/components/DomainPermissions.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/utils.d.ts +4 -0
  18. package/dist/dist-esm/react-components/src/components/utils.js +7 -0
  19. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  20. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.d.ts +1 -0
  21. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.js +1 -1
  22. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.js.map +1 -1
  23. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.d.ts +1 -0
  24. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.js +1 -1
  25. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.js.map +1 -1
  26. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.d.ts +1 -0
  27. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +6 -2
  28. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
  29. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +20 -1
  30. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  31. 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
@@ -4427,6 +4427,10 @@ export declare interface _DevicePermissionDropdownProps {
4427
4427
  * @param constrain - Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }
4428
4428
  */
4429
4429
  askDevicePermission?(constrain: _PermissionConstraints): Promise<void>;
4430
+ /**
4431
+ * Optional callback when component is clicked
4432
+ */
4433
+ onClick?: () => void;
4430
4434
  /**
4431
4435
  * Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }
4432
4436
  */
@@ -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-202211020017.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
 
@@ -17392,7 +17396,7 @@ const ConfigurationpageCameraDropdown = (props) => {
17392
17396
  actionButtonContent: 'Allow'
17393
17397
  };
17394
17398
  /* @conditional-compile-remove(call-readiness) */
17395
- 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)));
17396
17400
  /* @conditional-compile-remove(call-readiness) */
17397
17401
  if (props.callReadinessOptedIn) {
17398
17402
  return React__default['default'].createElement(React__default['default'].Fragment, null, props.cameraPermissionGranted ? props.cameraGrantedDropdown : cameraBlockedDropdown);
@@ -17413,7 +17417,7 @@ const ConfigurationpageMicDropdown = (props) => {
17413
17417
  actionButtonContent: 'Allow'
17414
17418
  };
17415
17419
  /* @conditional-compile-remove(call-readiness) */
17416
- 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)));
17417
17421
  /* @conditional-compile-remove(call-readiness) */
17418
17422
  if (props.callReadinessOptedIn) {
17419
17423
  return React__default['default'].createElement(React__default['default'].Fragment, null,
@@ -17527,7 +17531,9 @@ const LocalDeviceSettings = (props) => {
17527
17531
  /* @conditional-compile-remove(call-readiness) */
17528
17532
  dropdownProps: dropdownProps,
17529
17533
  /* @conditional-compile-remove(call-readiness) */
17530
- 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 }))),
17531
17537
  React__default['default'].createElement(react.Stack, null,
17532
17538
  React__default['default'].createElement(react.Label, { id: 'call-composite-local-sound-settings-label', className: react.mergeStyles(dropDownStyles(theme).label), disabled: !micPermissionGranted }, soundLabel),
17533
17539
  React__default['default'].createElement(react.Stack, { "data-ui-id": "call-composite-sound-settings", tokens: mainStackTokens },
@@ -17535,7 +17541,9 @@ const LocalDeviceSettings = (props) => {
17535
17541
  /* @conditional-compile-remove(call-readiness) */
17536
17542
  dropdownProps: dropdownProps,
17537
17543
  /* @conditional-compile-remove(call-readiness) */
17538
- 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 }),
17539
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) => {
17540
17548
  props.onSelectSpeaker(props.speakers[index !== null && index !== void 0 ? index : 0]);
17541
17549
  }, onRenderTitle: (props) => onRenderTitle('Speaker', props) })))));
@@ -17891,6 +17899,8 @@ const ConfigurationPage = (props) => {
17891
17899
  // do nothing here
17892
17900
  // only way to dismiss this drawer is clicking on allow access which will leads to device permission prompt
17893
17901
  };
17902
+ /* @conditional-compile-remove(call-readiness) */
17903
+ const [isModalShowing, setIsModalShowing] = React.useState(false);
17894
17904
  return (React__default['default'].createElement(react.Stack, { className: mobileView ? configurationContainerStyleMobile : configurationContainerStyleDesktop },
17895
17905
  React__default['default'].createElement(react.Stack, { styles: bannerNotificationStyles },
17896
17906
  React__default['default'].createElement(ConfigurationpageErrorBar
@@ -17909,6 +17919,17 @@ const ConfigurationPage = (props) => {
17909
17919
  /* @conditional-compile-remove(call-readiness) */
17910
17920
  callReadinessOptedIn: callReadinessOptedIn })),
17911
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) */
17912
17933
  mobileView && isDrawerShowing && callReadinessOptedIn && (React__default['default'].createElement(_DrawerSurface, { onLightDismiss: onLightDismissTriggered, styles: drawerContainerStyles(DRAWER_HIGH_Z_BAND) },
17913
17934
  React__default['default'].createElement(DomainPermissions, { appName: 'app', onTroubleshootingClick: onPermissionsTroubleshootingClick
17914
17935
  ? () => {
@@ -17934,7 +17955,11 @@ const ConfigurationPage = (props) => {
17934
17955
  callDescription),
17935
17956
  React__default['default'].createElement(LocalDeviceSettings, Object.assign({}, options, localDeviceSettingsHandlers, { cameraPermissionGranted: cameraPermissionGranted, microphonePermissionGranted: microphonePermissionGranted,
17936
17957
  /* @conditional-compile-remove(call-readiness) */
17937
- callReadinessOptedIn: callReadinessOptedIn })))),
17958
+ callReadinessOptedIn: callReadinessOptedIn,
17959
+ /* @conditional-compile-remove(call-readiness) */
17960
+ onClickEnableDevicePermission: () => {
17961
+ setIsModalShowing(true);
17962
+ } })))),
17938
17963
  React__default['default'].createElement(react.Stack, { styles: mobileWithPreview ? startCallButtonContainerStyleMobile : startCallButtonContainerStyleDesktop },
17939
17964
  React__default['default'].createElement(StartCallButton, { className: mobileWithPreview ? startCallButtonStyleMobile : undefined, onClick: startCallHandler, disabled: disableStartCallButton }))))));
17940
17965
  };