@azure/communication-react 1.5.1-alpha-202305040013 → 1.5.1-alpha-202305050017

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 (20) hide show
  1. package/dist/dist-cjs/communication-react/index.js +61 -37
  2. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  3. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  5. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +6 -0
  6. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  7. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js +26 -3
  8. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js.map +1 -1
  9. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +6 -0
  10. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  11. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/videoBackgroundErrorsSelector.d.ts +1 -1
  12. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/videoBackgroundErrorsSelector.js +1 -1
  13. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/videoBackgroundErrorsSelector.js.map +1 -1
  14. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +12 -0
  15. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +13 -0
  16. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  17. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.d.ts +5 -1
  18. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +5 -24
  19. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  20. package/package.json +10 -10
@@ -162,7 +162,7 @@ const _toCommunicationIdentifier = (id) => {
162
162
  // Copyright (c) Microsoft Corporation.
163
163
  // Licensed under the MIT license.
164
164
  // GENERATED FILE. DO NOT EDIT MANUALLY.
165
- var telemetryVersion = '1.5.1-alpha-202305040013';
165
+ var telemetryVersion = '1.5.1-alpha-202305050017';
166
166
 
167
167
  // Copyright (c) Microsoft Corporation.
168
168
  /**
@@ -4851,7 +4851,7 @@ const extension = (fileName) => fileName.split('.').pop() || '';
4851
4851
  * @returns DismissedError[]
4852
4852
  * Always returns a new Array so that the state variable is updated, trigerring a render.
4853
4853
  */
4854
- const dismissError$1 = (dismissedErrors, toDismiss) => {
4854
+ const dismissError = (dismissedErrors, toDismiss) => {
4855
4855
  var _a;
4856
4856
  const now = new Date(Date.now());
4857
4857
  for (const error of dismissedErrors) {
@@ -5058,7 +5058,7 @@ const ErrorBar = (props) => {
5058
5058
  height: 0,
5059
5059
  paddingTop: '0.8rem'
5060
5060
  }
5061
- }, key: error.type, messageBarType: messageBarType(error.type), messageBarIconProps: messageBarIconProps(error.type), onDismiss: () => setDismissedErrors(dismissError$1(dismissedErrors, error)), dismissButtonAriaLabel: strings.dismissButtonAriaLabel, dismissIconProps: { iconName: 'ErrorBarClear' } }), strings[error.type])))));
5061
+ }, key: error.type, messageBarType: messageBarType(error.type), messageBarIconProps: messageBarIconProps(error.type), onDismiss: () => setDismissedErrors(dismissError(dismissedErrors, error)), dismissButtonAriaLabel: strings.dismissButtonAriaLabel, dismissIconProps: { iconName: 'ErrorBarClear' } }), strings[error.type])))));
5062
5062
  };
5063
5063
 
5064
5064
  // Copyright (c) Microsoft Corporation.
@@ -13807,7 +13807,7 @@ const _TroubleshootingGuideErrorBar = (props) => {
13807
13807
  onNetworkingTroubleshootingClick && (React__default['default'].createElement(react.Link, { onClick: onNetworkingTroubleshootingClick, underline: true },
13808
13808
  React__default['default'].createElement("span", null, troubleshootingGuideStrings.networkTroubleshootingLinkText)))));
13809
13809
  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: () => {
13810
- setDismissedErrors(dismissError$1(dismissedErrors, error));
13810
+ setDismissedErrors(dismissError(dismissedErrors, error));
13811
13811
  }, ariaLabel: strings.dismissButtonAriaLabel }), isMultiline: false }), showErrorBar(error.type, devicePermissionErrorBar, networkErrorBar)));
13812
13812
  })));
13813
13813
  };
@@ -17530,6 +17530,19 @@ const createParticipantModifier = (createModifiedParticipant) => {
17530
17530
  ? Object.assign(Object.assign({}, state.call), { remoteParticipants: modifiedParticipants }) : undefined });
17531
17531
  };
17532
17532
  };
17533
+ /**
17534
+ * @private
17535
+ */
17536
+ const dismissVideoEffectsError = (toDismiss) => {
17537
+ var _a;
17538
+ const now = new Date(Date.now());
17539
+ const toDismissTimestamp = (_a = toDismiss.timestamp) !== null && _a !== void 0 ? _a : now;
17540
+ // Record that this error was dismissed for the first time right now.
17541
+ return {
17542
+ dismissedAt: now > toDismissTimestamp ? now : toDismissTimestamp,
17543
+ activeSince: toDismiss.timestamp
17544
+ };
17545
+ };
17533
17546
 
17534
17547
  // Copyright (c) Microsoft Corporation.
17535
17548
  // Licensed under the MIT license.
@@ -21689,18 +21702,6 @@ const activeVideoBackgroundEffectSelector = reselect__namespace.createSelector([
21689
21702
  return 'none';
21690
21703
  });
21691
21704
 
21692
- // Copyright (c) Microsoft Corporation.
21693
- /* @conditional-compile-remove(video-background-effects) */
21694
- /**
21695
- * @private
21696
- */
21697
- const videoBackgroundErrorsSelector = reselect__namespace.createSelector([getLatestErrors], (errors) => {
21698
- if (errors && errors['VideoEffectsFeature.startEffects']) {
21699
- return errors['VideoEffectsFeature.startEffects'];
21700
- }
21701
- return null;
21702
- });
21703
-
21704
21705
  // Copyright (c) Microsoft Corporation.
21705
21706
  /**
21706
21707
  * @private
@@ -21737,7 +21738,7 @@ var __awaiter$8 = (window && window.__awaiter) || function (thisArg, _arguments,
21737
21738
  * @private
21738
21739
  */
21739
21740
  /** @beta */
21740
- const VideoEffectsPaneContent = () => {
21741
+ const VideoEffectsPaneContent = (props) => {
21741
21742
  /* @conditional-compile-remove(video-background-effects) */
21742
21743
  const locale = useLocale();
21743
21744
  /* @conditional-compile-remove(video-background-effects) */
@@ -21816,19 +21817,15 @@ const VideoEffectsPaneContent = () => {
21816
21817
  }
21817
21818
  }
21818
21819
  }), [adapter, selectableVideoEffects]);
21819
- return VideoEffectsPaneTrampoline(
21820
+ return VideoEffectsPaneTrampoline(props.onDismissError, props.activeVideoEffectError,
21820
21821
  /* @conditional-compile-remove(video-background-effects) */
21821
21822
  selectableVideoEffects,
21822
21823
  /* @conditional-compile-remove(video-background-effects) */
21823
21824
  onEffectChange);
21824
21825
  };
21825
- const VideoEffectsPaneTrampoline = (selectableVideoEffects, onEffectChange) => {
21826
- /* @conditional-compile-remove(video-background-effects) */
21827
- const [dismissedError, setDismissedError] = React.useState();
21826
+ const VideoEffectsPaneTrampoline = (onDismissError, activeVideoEffectError, selectableVideoEffects, onEffectChange) => {
21828
21827
  /* @conditional-compile-remove(video-background-effects) */
21829
- const latestEffectError = useSelector$1(videoBackgroundErrorsSelector);
21830
- /* @conditional-compile-remove(video-background-effects) */
21831
- const showError = latestEffectError && (!dismissedError || latestEffectError.timestamp > dismissedError.dismissedAt);
21828
+ const videoEffectError = activeVideoEffectError && activeVideoEffectError();
21832
21829
  /* @conditional-compile-remove(video-background-effects) */
21833
21830
  const selectedEffect = useSelector$1(activeVideoBackgroundEffectSelector);
21834
21831
  /* @conditional-compile-remove(video-background-effects) */
@@ -21839,7 +21836,7 @@ const VideoEffectsPaneTrampoline = (selectableVideoEffects, onEffectChange) => {
21839
21836
  const locale = useLocale();
21840
21837
  /* @conditional-compile-remove(video-background-effects) */
21841
21838
  return (React__default['default'].createElement(react.Stack, { horizontalAlign: "center" },
21842
- showError && latestEffectError && (React__default['default'].createElement(react.MessageBar, { messageBarType: react.MessageBarType.error, onDismiss: () => setDismissedError(dismissError(latestEffectError)) }, locale.strings.call.unableToStartVideoEffect)),
21839
+ videoEffectError && (React__default['default'].createElement(react.MessageBar, { messageBarType: react.MessageBarType.error, onDismiss: () => onDismissError(videoEffectError) }, locale.strings.call.unableToStartVideoEffect)),
21843
21840
  showWarning && (React__default['default'].createElement(react.MessageBar, { messageBarType: react.MessageBarType.warning }, locale.strings.call.cameraOffBackgroundEffectWarningText)),
21844
21841
  React__default['default'].createElement(_VideoBackgroundEffectsPicker, { label: "Background" // TODO [jaburnsi]: localize
21845
21842
  , styles: backgroundPickerStyles, options: selectableVideoEffects !== null && selectableVideoEffects !== void 0 ? selectableVideoEffects : [], onChange: onEffectChange, selectedEffectKey: selectedEffect })));
@@ -21852,17 +21849,18 @@ const backgroundPickerStyles = {
21852
21849
  fontWeight: '400'
21853
21850
  }
21854
21851
  };
21852
+
21853
+ // Copyright (c) Microsoft Corporation.
21855
21854
  /* @conditional-compile-remove(video-background-effects) */
21856
- const dismissError = (toDismiss) => {
21857
- var _a;
21858
- const now = new Date(Date.now());
21859
- const toDismissTimestamp = (_a = toDismiss.timestamp) !== null && _a !== void 0 ? _a : now;
21860
- // Record that this error was dismissed for the first time right now.
21861
- return {
21862
- dismissedAt: now > toDismissTimestamp ? now : toDismissTimestamp,
21863
- activeSince: toDismiss.timestamp
21864
- };
21865
- };
21855
+ /**
21856
+ * @private
21857
+ */
21858
+ const videoBackgroundErrorsSelector = reselect__namespace.createSelector([getLatestErrors], (errors) => {
21859
+ if (errors && errors['VideoEffectsFeature.startEffects']) {
21860
+ return errors['VideoEffectsFeature.startEffects'];
21861
+ }
21862
+ return undefined;
21863
+ });
21866
21864
 
21867
21865
  // Copyright (c) Microsoft Corporation.
21868
21866
  const VIDEO_EFFECTS_SIDE_PANE_ID = 'videoeffects';
@@ -21881,9 +21879,27 @@ const useVideoEffectsPane = (updateSidePaneRenderer, mobileView) => {
21881
21879
  /* @conditional-compile-remove(video-background-effects) */
21882
21880
  dismissSidePaneButtonAriaLabel: (_c = (_b = locale.strings.call.dismissSidePaneButtonLabel) !== null && _b !== void 0 ? _b : locale.strings.callWithChat.dismissSidePaneButtonLabel) !== null && _c !== void 0 ? _c : 'Close', mobileView: mobileView }));
21883
21881
  }, [closePane, /* @conditional-compile-remove(video-background-effects) */ locale.strings, mobileView]);
21884
- const onRenderContent = React.useCallback(() => {
21885
- return React__default['default'].createElement(VideoEffectsPaneContent, null);
21882
+ const [dismissedVideoEffectsError, setDismissedVideoEffectsError] = React.useState();
21883
+ const onDismissVideoEffectError = React.useCallback((error) => {
21884
+ setDismissedVideoEffectsError(dismissVideoEffectsError(error));
21886
21885
  }, []);
21886
+ /* @conditional-compile-remove(video-background-effects) */
21887
+ const latestVideoEffectError = useSelector$1(videoBackgroundErrorsSelector);
21888
+ const activeVideoEffectError = React.useCallback(() => {
21889
+ /* @conditional-compile-remove(video-background-effects) */
21890
+ if (latestVideoEffectError &&
21891
+ (!dismissedVideoEffectsError || latestVideoEffectError.timestamp > dismissedVideoEffectsError.dismissedAt)) {
21892
+ return latestVideoEffectError;
21893
+ }
21894
+ return undefined;
21895
+ }, [
21896
+ dismissedVideoEffectsError,
21897
+ /* @conditional-compile-remove(video-background-effects) */
21898
+ latestVideoEffectError
21899
+ ]);
21900
+ const onRenderContent = React.useCallback(() => {
21901
+ return (React__default['default'].createElement(VideoEffectsPaneContent, { onDismissError: onDismissVideoEffectError, activeVideoEffectError: activeVideoEffectError }));
21902
+ }, [onDismissVideoEffectError, activeVideoEffectError]);
21887
21903
  const sidePaneRenderer = React.useMemo(() => ({
21888
21904
  headerRenderer: onRenderHeader,
21889
21905
  contentRenderer: onRenderContent,
@@ -22185,6 +22201,10 @@ const CallArrangement = (props) => {
22185
22201
  if (!rolePermissions.cameraButton && props.errorBarProps) {
22186
22202
  errorBarProps = Object.assign(Object.assign({}, props.errorBarProps), { activeErrorMessages: props.errorBarProps.activeErrorMessages.filter((e) => e.type !== 'callCameraAccessDenied' && e.type !== 'callCameraAccessDeniedSafari') });
22187
22203
  }
22204
+ /* @conditional-compile-remove(video-background-effects) */
22205
+ if (useIsParticularSidePaneOpen('videoeffects') && props.errorBarProps) {
22206
+ errorBarProps = Object.assign(Object.assign({}, props.errorBarProps), { activeErrorMessages: props.errorBarProps.activeErrorMessages.filter((e) => e.type !== 'unableToStartVideoEffect') });
22207
+ }
22188
22208
  /* @conditional-compile-remove(close-captions) */
22189
22209
  const isTeamsCall = useSelector$1(getIsTeamsCall);
22190
22210
  /* @conditional-compile-remove(close-captions) */
@@ -23491,6 +23511,10 @@ const ConfigurationPage = (props) => {
23491
23511
  if (!rolePermissions.cameraButton) {
23492
23512
  errorBarProps = Object.assign(Object.assign({}, errorBarProps), { activeErrorMessages: errorBarProps.activeErrorMessages.filter((e) => e.type !== 'callCameraAccessDenied' && e.type !== 'callCameraAccessDeniedSafari') });
23493
23513
  }
23514
+ /* @conditional-compile-remove(video-background-effects) */
23515
+ if (useIsParticularSidePaneOpen('videoeffects') && errorBarProps) {
23516
+ errorBarProps = Object.assign(Object.assign({}, errorBarProps), { activeErrorMessages: errorBarProps.activeErrorMessages.filter((e) => e.type !== 'unableToStartVideoEffect') });
23517
+ }
23494
23518
  /* @conditional-compile-remove(rooms) */
23495
23519
  if (!rolePermissions.microphoneButton) {
23496
23520
  // If user's role permissions do not allow access to the microphone button then DO NOT disable the start call button