@azure/communication-react 1.3.3-alpha-202210250024.0 → 1.3.3-alpha-202210260016.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 (21) hide show
  1. package/dist/communication-react.d.ts +1 -0
  2. package/dist/dist-cjs/communication-react/index.js +161 -9
  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/callControlSelectors.js +6 -3
  7. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js.map +1 -1
  8. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.d.ts +1 -0
  9. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
  10. package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.d.ts +2 -1
  11. package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.js +24 -14
  12. package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.js.map +1 -1
  13. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +7 -3
  14. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  15. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageErrorBar.d.ts +27 -0
  16. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageErrorBar.js +30 -0
  17. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageErrorBar.js.map +1 -0
  18. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.d.ts +5 -0
  19. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +25 -2
  20. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  21. package/package.json +8 -8
@@ -7072,6 +7072,7 @@ export declare interface StatefulCallClient extends CallClient {
7072
7072
  * @param stream - The LocalVideoStreamState or RemoteVideoStreamState to dispose.
7073
7073
  */
7074
7074
  disposeView(callId: string | undefined, participantId: CommunicationIdentifier | undefined, stream: LocalVideoStreamState | RemoteVideoStreamState): void;
7075
+ /** @conditional-compile-remove(one-to-n-calling) */
7075
7076
  /**
7076
7077
  * The CallAgent is used to handle calls.
7077
7078
  * To create the CallAgent, pass a CommunicationTokenCredential object provided from SDK.
@@ -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.3.3-alpha-202210250024.0';
205
+ var telemetryVersion = '1.3.3-alpha-202210260016.0';
206
206
 
207
207
  // Copyright (c) Microsoft Corporation.
208
208
  /**
@@ -525,14 +525,17 @@ const screenShareButtonSelector = reselect__namespace.createSelector([getIsScree
525
525
  */
526
526
  const devicesButtonSelector = reselect__namespace.createSelector([getDeviceManager$1], (deviceManager) => {
527
527
  return {
528
- microphones: deviceManager.microphones,
529
- speakers: deviceManager.speakers,
530
- cameras: deviceManager.cameras,
528
+ microphones: removeBlankNameDevices(deviceManager.microphones),
529
+ speakers: removeBlankNameDevices(deviceManager.speakers),
530
+ cameras: removeBlankNameDevices(deviceManager.cameras),
531
531
  selectedMicrophone: deviceManager.selectedMicrophone,
532
532
  selectedSpeaker: deviceManager.selectedSpeaker,
533
533
  selectedCamera: deviceManager.selectedCamera
534
534
  };
535
535
  });
536
+ function removeBlankNameDevices(devices) {
537
+ return devices.filter((device) => device.name !== '');
538
+ }
536
539
  /* @conditional-compile-remove(PSTN-calls) */
537
540
  /**
538
541
  * Selector for the {@link HoldButton} component.
@@ -8345,6 +8348,102 @@ const UnsupportedBrowser = (props) => {
8345
8348
  return React__default['default'].createElement(UnsupportedBrowserContainer, Object.assign({}, props, { strings: strings }));
8346
8349
  };
8347
8350
 
8351
+ // Copyright (c) Microsoft Corporation.
8352
+ /**
8353
+ * @private
8354
+ */
8355
+ const dismissButtonStyle = (theme) => ({
8356
+ root: {
8357
+ padding: '0.375rem 1.25rem',
8358
+ width: '3.75rem',
8359
+ height: '2rem',
8360
+ background: theme.palette.white,
8361
+ border: `1px solid ${theme.palette.neutralQuaternaryAlt}`,
8362
+ borderRadius: '0.063rem',
8363
+ color: theme.palette.black
8364
+ }
8365
+ });
8366
+ /**
8367
+ * @private
8368
+ */
8369
+ const messageBarStyle = (theme, errorType) => ({
8370
+ innerText: {
8371
+ paddingTop: errorType === react.MessageBarType.warning ? '0.15rem' : '0.1rem',
8372
+ lineHeight: 'none',
8373
+ color: theme.palette.black,
8374
+ alignSelf: 'center',
8375
+ whiteSpace: 'normal'
8376
+ },
8377
+ icon: {
8378
+ marginTop: '0.375rem',
8379
+ marginBottom: '0.375rem'
8380
+ },
8381
+ content: {
8382
+ lineHeight: 'inherit'
8383
+ },
8384
+ dismissal: {
8385
+ height: 0,
8386
+ paddingTop: '0.8rem'
8387
+ }
8388
+ });
8389
+ /**
8390
+ * @private
8391
+ */
8392
+ const linkStyle = (theme) => ({
8393
+ root: {
8394
+ span: {
8395
+ color: theme.palette.black
8396
+ }
8397
+ }
8398
+ });
8399
+
8400
+ // Copyright (c) Microsoft Corporation.
8401
+ /**
8402
+ * @internal
8403
+ * A component to show device Permission/network connection related errors, contains link that leads to further trouble shooting guide
8404
+ */
8405
+ const _TroubleshootingGuideErrorBar = (props) => {
8406
+ var _a;
8407
+ const theme = react.useTheme();
8408
+ // error bar strings
8409
+ const localeStrings = useLocale$1().strings.errorBar;
8410
+ const strings = (_a = props.strings) !== null && _a !== void 0 ? _a : localeStrings;
8411
+ const [dismissedErrors, setDismissedErrors] = React.useState([]);
8412
+ const { onPermissionsTroubleshootingClick, onNetworkingTroubleshootingClick, permissionsState = {
8413
+ camera: 'denied',
8414
+ microphone: 'denied'
8415
+ }, troubleshootingGuideStrings } = props;
8416
+ // dropDismissalsForInactiveErrors only returns a new object if `dismissedErrors` actually changes.
8417
+ // Without this behaviour, this `useEffect` block would cause a render loop.
8418
+ React.useEffect(() => setDismissedErrors(dropDismissalsForInactiveErrors(props.activeErrorMessages, dismissedErrors)), [props.activeErrorMessages, dismissedErrors]);
8419
+ const toShow = errorsToShow(props.activeErrorMessages, dismissedErrors);
8420
+ return (React__default['default'].createElement(react.Stack, { "data-ui-id": "error-bar-stack" }, toShow.map((error) => {
8421
+ const devicePermissionErrorBar = (React__default['default'].createElement("div", null,
8422
+ strings[error.type],
8423
+ ' ',
8424
+ onPermissionsTroubleshootingClick && (React__default['default'].createElement(react.Link, { styles: linkStyle(theme), onClick: () => {
8425
+ onPermissionsTroubleshootingClick(permissionsState);
8426
+ }, underline: true },
8427
+ React__default['default'].createElement("span", null, troubleshootingGuideStrings.devicePermissionLinkText)))));
8428
+ const networkErrorBar = (React__default['default'].createElement("div", null,
8429
+ strings[error.type],
8430
+ ' ',
8431
+ onNetworkingTroubleshootingClick && (React__default['default'].createElement(react.Link, { styles: linkStyle(theme), onClick: onNetworkingTroubleshootingClick, underline: true },
8432
+ React__default['default'].createElement("span", null, troubleshootingGuideStrings.networkTroubleshootingLinkText)))));
8433
+ return (React__default['default'].createElement(react.MessageBar, Object.assign({}, props, { styles: messageBarStyle(theme, messageBarType(error.type)), key: error.type, messageBarType: messageBarType(error.type), messageBarIconProps: messageBarIconProps(error.type), actions: React__default['default'].createElement(react.MessageBarButton, { text: troubleshootingGuideStrings.dismissButtonText, styles: dismissButtonStyle(theme), onClick: () => {
8434
+ setDismissedErrors(dismissError(dismissedErrors, error));
8435
+ }, ariaLabel: strings.dismissButtonAriaLabel }), isMultiline: false }), showErrorBar(error.type, devicePermissionErrorBar, networkErrorBar)));
8436
+ })));
8437
+ };
8438
+ const showErrorBar = (errorType, devicePermissionErrorBar, networkErrorBar) => {
8439
+ if (errorType === 'callNetworkQualityLow') {
8440
+ return networkErrorBar;
8441
+ }
8442
+ else {
8443
+ return devicePermissionErrorBar;
8444
+ }
8445
+ };
8446
+
8348
8447
  // Copyright (c) Microsoft Corporation.
8349
8448
  /**
8350
8449
  * A dropdown to trigger device permission prompt
@@ -17620,13 +17719,43 @@ const startCallButtonStyleMobile = react.mergeStyles({
17620
17719
  maxWidth: 'unset'
17621
17720
  });
17622
17721
 
17722
+ // Copyright (c) Microsoft Corporation.
17723
+ /**
17724
+ * @private
17725
+ */
17726
+ const ConfigurationpageErrorBar = (props) => {
17727
+ const { errorBarProps,
17728
+ /* @conditional-compile-remove(call-readiness) */
17729
+ showTroubleShootingErrorBar = false,
17730
+ /* @conditional-compile-remove(call-readiness) */
17731
+ onPermissionsTroubleshootingClick,
17732
+ /* @conditional-compile-remove(call-readiness) */
17733
+ onNetworkingTroubleShootingClick,
17734
+ /* @conditional-compile-remove(call-readiness) */
17735
+ permissionsState } = props;
17736
+ /* @conditional-compile-remove(call-readiness) */
17737
+ const permissionTroubleshootingGuideStrings = {
17738
+ devicePermissionLinkText: 'Troubleshooting Camera and Microphone Permissions',
17739
+ networkTroubleshootingLinkText: 'Troubleshooting Network Connection',
17740
+ dismissButtonText: 'OK'
17741
+ };
17742
+ /* @conditional-compile-remove(call-readiness) */
17743
+ if (showTroubleShootingErrorBar) {
17744
+ return (React__default['default'].createElement(_TroubleshootingGuideErrorBar, Object.assign({ troubleshootingGuideStrings: permissionTroubleshootingGuideStrings, onPermissionsTroubleshootingClick: onPermissionsTroubleshootingClick, onNetworkingTroubleshootingClick: onNetworkingTroubleShootingClick, permissionsState: permissionsState }, errorBarProps)));
17745
+ }
17746
+ return React__default['default'].createElement(ErrorBar, Object.assign({}, errorBarProps));
17747
+ };
17748
+
17623
17749
  // Copyright (c) Microsoft Corporation.
17624
17750
  /**
17625
17751
  * @private
17626
17752
  */
17627
17753
  const ConfigurationPage = (props) => {
17628
17754
  var _a, _b;
17629
- const { startCallHandler, mobileView, /* @conditional-compile-remove(call-readiness) */ devicePermissions } = props;
17755
+ const { startCallHandler, mobileView,
17756
+ /* @conditional-compile-remove(call-readiness) */ devicePermissions,
17757
+ /* @conditional-compile-remove(call-readiness) */ onPermissionsTroubleshootingClick,
17758
+ /* @conditional-compile-remove(call-readiness) */ onNetworkingTroubleShootingClick } = props;
17630
17759
  const options = useAdaptedSelector(getSelector$1(DevicesButton));
17631
17760
  const localDeviceSettingsHandlers = useHandlers();
17632
17761
  const { video: cameraPermissionGranted, audio: microphonePermissionGranted } = useSelector$1(devicePermissionSelector);
@@ -17664,9 +17793,28 @@ const ConfigurationPage = (props) => {
17664
17793
  let mobileWithPreview = mobileView;
17665
17794
  /* @conditional-compile-remove(rooms) */
17666
17795
  mobileWithPreview = mobileWithPreview && rolePermissions.cameraButton;
17796
+ /* @conditional-compile-remove(call-readiness) */
17797
+ const permissionsState = {
17798
+ camera: cameraPermissionGranted ? 'granted' : 'denied',
17799
+ microphone: microphonePermissionGranted ? 'granted' : 'denied'
17800
+ };
17801
+ /* @conditional-compile-remove(call-readiness) */
17802
+ const networkErrors = errorBarProps.activeErrorMessages.filter((message) => message.type === 'callNetworkQualityLow');
17667
17803
  return (React__default['default'].createElement(react.Stack, { className: mobileView ? configurationContainerStyleMobile : configurationContainerStyleDesktop },
17668
17804
  React__default['default'].createElement(react.Stack, { styles: bannerNotificationStyles },
17669
- React__default['default'].createElement(ErrorBar, Object.assign({}, errorBarProps))),
17805
+ React__default['default'].createElement(ConfigurationpageErrorBar
17806
+ /* @conditional-compile-remove(call-readiness) */
17807
+ // show trouble shooting error bar when encountering network error/ permission error
17808
+ , {
17809
+ /* @conditional-compile-remove(call-readiness) */
17810
+ // show trouble shooting error bar when encountering network error/ permission error
17811
+ showTroubleShootingErrorBar: !cameraPermissionGranted || !microphonePermissionGranted || networkErrors.length > 0,
17812
+ /* @conditional-compile-remove(call-readiness) */
17813
+ permissionsState: permissionsState,
17814
+ /* @conditional-compile-remove(call-readiness) */
17815
+ onNetworkingTroubleShootingClick: onNetworkingTroubleShootingClick,
17816
+ /* @conditional-compile-remove(call-readiness) */
17817
+ onPermissionsTroubleshootingClick: onPermissionsTroubleshootingClick, errorBarProps: errorBarProps })),
17670
17818
  React__default['default'].createElement(react.Stack, { grow: true, horizontal: !mobileWithPreview, horizontalAlign: mobileWithPreview ? 'stretch' : 'center', verticalAlign: "center", tokens: mobileWithPreview ? configurationStackTokensMobile : configurationStackTokensDesktop },
17671
17819
  mobileWithPreview && (React__default['default'].createElement(react.Stack.Item, null,
17672
17820
  title,
@@ -18077,7 +18225,7 @@ var __awaiter$5 = (window && window.__awaiter) || function (thisArg, _arguments,
18077
18225
  });
18078
18226
  };
18079
18227
  const MainScreen = (props) => {
18080
- var _a, _b;
18228
+ var _a, _b, _c, _d;
18081
18229
  const { callInvitationUrl, onRenderAvatar, onFetchAvatarPersonaData, onFetchParticipantMenuItems } = props;
18082
18230
  const page = useSelector$1(getPage);
18083
18231
  const adapter = useAdapter();
@@ -18098,7 +18246,11 @@ const MainScreen = (props) => {
18098
18246
  adapter.joinCall();
18099
18247
  },
18100
18248
  /* @conditional-compile-remove(call-readiness) */
18101
- devicePermissions: (_a = props.options) === null || _a === void 0 ? void 0 : _a.devicePermissions }));
18249
+ devicePermissions: (_a = props.options) === null || _a === void 0 ? void 0 : _a.devicePermissions,
18250
+ /* @conditional-compile-remove(call-readiness) */
18251
+ onPermissionsTroubleshootingClick: (_b = props.options) === null || _b === void 0 ? void 0 : _b.onPermissionsTroubleshootingClick,
18252
+ /* @conditional-compile-remove(call-readiness) */
18253
+ onNetworkingTroubleShootingClick: (_c = props.options) === null || _c === void 0 ? void 0 : _c.onNetworkingTroubleShootingClick }));
18102
18254
  break;
18103
18255
  case 'accessDeniedTeamsMeeting':
18104
18256
  pageElement = (React__default['default'].createElement(NoticePage, { iconName: "NoticePageAccessDeniedTeamsMeeting", title: locale.strings.call.failedToJoinTeamsMeetingReasonAccessDeniedTitle, moreDetails: locale.strings.call.failedToJoinTeamsMeetingReasonAccessDeniedMoreDetails, dataUiId: 'access-denied-teams-meeting-page' }));
@@ -18130,7 +18282,7 @@ const MainScreen = (props) => {
18130
18282
  case unsupportedEnvironmentPageTrampoline():
18131
18283
  pageElement = (React__default['default'].createElement(React__default['default'].Fragment, null,
18132
18284
  /* @conditional-compile-remove(unsupported-browser) */
18133
- React__default['default'].createElement(UnsupportedBrowserPage, { onTroubleshootingClick: (_b = props.options) === null || _b === void 0 ? void 0 : _b.onEnvironmentInfoTroubleshootingClick })));
18285
+ React__default['default'].createElement(UnsupportedBrowserPage, { onTroubleshootingClick: (_d = props.options) === null || _d === void 0 ? void 0 : _d.onEnvironmentInfoTroubleshootingClick })));
18134
18286
  }
18135
18287
  if (!pageElement) {
18136
18288
  throw new Error('Invalid call composite page');