@azure/communication-react 1.5.1-alpha-202304172318 → 1.5.1-alpha-202304180012

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 (26) hide show
  1. package/dist/communication-react.d.ts +2 -0
  2. package/dist/dist-cjs/communication-react/index.js +49 -17
  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-composites/src/composites/CallComposite/components/CallArrangement.js +1 -1
  7. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  8. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +1 -1
  9. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  10. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/activeVideoBackgroundEffectSelector.d.ts +7 -0
  11. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/activeVideoBackgroundEffectSelector.js +21 -0
  12. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/activeVideoBackgroundEffectSelector.js.map +1 -0
  13. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +5 -0
  14. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +5 -0
  15. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  16. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +2 -1
  17. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  18. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +3 -1
  19. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  20. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +3 -1
  21. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +6 -2
  22. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  23. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.d.ts +0 -2
  24. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +20 -10
  25. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  26. package/package.json +8 -8
@@ -2646,6 +2646,8 @@ export declare interface CallWithChatClientState {
2646
2646
  environmentInfo?: EnvironmentInfo;
2647
2647
  /** Default set of background images for background replacement effect */
2648
2648
  videoBackgroundImages?: VideoBackgroundImage[];
2649
+ /** State to track the selected video background effect */
2650
+ selectedVideoBackgroundEffect?: SelectedVideoBackgroundEffect;
2649
2651
  }
2650
2652
 
2651
2653
  /**
@@ -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-202304172318';
165
+ var telemetryVersion = '1.5.1-alpha-202304180012';
166
166
 
167
167
  // Copyright (c) Microsoft Corporation.
168
168
  /**
@@ -19365,6 +19365,11 @@ const getDominantSpeakerInfo = (state) => { var _a; return (_a = state.call) ===
19365
19365
  * @private
19366
19366
  */
19367
19367
  const getRemoteParticipants = (state) => { var _a; return (_a = state.call) === null || _a === void 0 ? void 0 : _a.remoteParticipants; };
19368
+ /* @conditional-compile-remove(video-background-effects) */
19369
+ /**
19370
+ * @private
19371
+ */
19372
+ const getSelectedVideoEffect = (state) => state.selectedVideoBackgroundEffect;
19368
19373
  /* @conditional-compile-remove(close-captions) */
19369
19374
  /**
19370
19375
  * @private
@@ -21788,6 +21793,22 @@ const PreparedMoreDrawer = (props) => {
21788
21793
  return React__default['default'].createElement(MoreDrawer, Object.assign({}, props, deviceProps, callHandlers, { strings: moreDrawerStrings }));
21789
21794
  };
21790
21795
 
21796
+ // Copyright (c) Microsoft Corporation.
21797
+ /* @conditional-compile-remove(video-background-effects) */
21798
+ /**
21799
+ * @private
21800
+ */
21801
+ const activeVideoBackgroundEffectSelector = reselect__namespace.createSelector([getSelectedVideoEffect], (selectedVideoBackgroundEffect) => {
21802
+ if (selectedVideoBackgroundEffect &&
21803
+ (selectedVideoBackgroundEffect.effectName === 'blur' || selectedVideoBackgroundEffect.effectName === 'none')) {
21804
+ return selectedVideoBackgroundEffect.effectName;
21805
+ }
21806
+ else if (selectedVideoBackgroundEffect && selectedVideoBackgroundEffect.effectName === 'replacement') {
21807
+ return selectedVideoBackgroundEffect === null || selectedVideoBackgroundEffect === void 0 ? void 0 : selectedVideoBackgroundEffect.effectKey;
21808
+ }
21809
+ return 'none';
21810
+ });
21811
+
21791
21812
  var __awaiter$9 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
21792
21813
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
21793
21814
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -21807,6 +21828,8 @@ const VideoEffectsPane = (props) => {
21807
21828
  /* @conditional-compile-remove(video-background-effects) */
21808
21829
  const locale = useLocale();
21809
21830
  /* @conditional-compile-remove(video-background-effects) */
21831
+ const adapter = useAdapter();
21832
+ /* @conditional-compile-remove(video-background-effects) */
21810
21833
  const strings = locale.strings.call;
21811
21834
  /* @conditional-compile-remove(video-background-effects) */
21812
21835
  const selectableVideoEffects = React.useMemo(() => {
@@ -21832,7 +21855,7 @@ const VideoEffectsPane = (props) => {
21832
21855
  }
21833
21856
  }
21834
21857
  ];
21835
- const videoEffectImages = props.adapter.getState().videoBackgroundImages;
21858
+ const videoEffectImages = adapter.getState().videoBackgroundImages;
21836
21859
  if (videoEffectImages) {
21837
21860
  videoEffectImages.forEach((img) => {
21838
21861
  var _a;
@@ -21848,22 +21871,22 @@ const VideoEffectsPane = (props) => {
21848
21871
  });
21849
21872
  }
21850
21873
  return videoEffects;
21851
- }, [strings, props.adapter]);
21874
+ }, [strings, adapter]);
21852
21875
  /* @conditional-compile-remove(video-background-effects) */
21853
21876
  const onEffectChange = React.useCallback((effectKey) => __awaiter$9(void 0, void 0, void 0, function* () {
21854
21877
  if (effectKey === 'blur') {
21855
21878
  const blurEffect = {
21856
21879
  effectName: effectKey
21857
21880
  };
21858
- props.adapter.updateSelectedVideoBackgroundEffect(blurEffect);
21859
- yield props.adapter.blurVideoBackground();
21881
+ adapter.updateSelectedVideoBackgroundEffect(blurEffect);
21882
+ yield adapter.blurVideoBackground();
21860
21883
  }
21861
21884
  else if (effectKey === 'none') {
21862
21885
  const noneEffect = {
21863
21886
  effectName: effectKey
21864
21887
  };
21865
- props.adapter.updateSelectedVideoBackgroundEffect(noneEffect);
21866
- yield props.adapter.stopVideoBackgroundEffect();
21888
+ adapter.updateSelectedVideoBackgroundEffect(noneEffect);
21889
+ yield adapter.stopVideoBackgroundEffect();
21867
21890
  }
21868
21891
  else {
21869
21892
  const backgroundImg = selectableVideoEffects.find((effect) => {
@@ -21875,11 +21898,11 @@ const VideoEffectsPane = (props) => {
21875
21898
  effectKey,
21876
21899
  backgroundImageUrl: backgroundImg.backgroundProps.url
21877
21900
  };
21878
- props.adapter.updateSelectedVideoBackgroundEffect(replaceEffect);
21879
- yield props.adapter.replaceVideoBackground({ backgroundImageUrl: backgroundImg.backgroundProps.url });
21901
+ adapter.updateSelectedVideoBackgroundEffect(replaceEffect);
21902
+ yield adapter.replaceVideoBackground({ backgroundImageUrl: backgroundImg.backgroundProps.url });
21880
21903
  }
21881
21904
  }
21882
- }), [props.adapter, selectableVideoEffects]);
21905
+ }), [adapter, selectableVideoEffects]);
21883
21906
  return VideoEffectsPaneTrampoline(showVideoEffectsOptions, setshowVideoEffectsOptions,
21884
21907
  /* @conditional-compile-remove(video-background-effects) */
21885
21908
  selectableVideoEffects,
@@ -21890,7 +21913,9 @@ const VideoEffectsPaneTrampoline = (showVideoEffectsOptions, setshowVideoEffects
21890
21913
  /* @conditional-compile-remove(video-background-effects) */
21891
21914
  const locale = useLocale();
21892
21915
  /* @conditional-compile-remove(video-background-effects) */
21893
- return (React__default['default'].createElement(react.Panel, { headerText: locale.strings.call.effects, isOpen: showVideoEffectsOptions, onDismiss: () => setshowVideoEffectsOptions(false), hasCloseButton: true, closeButtonAriaLabel: "Close", isLightDismiss: true }, selectableVideoEffects && (React__default['default'].createElement(_VideoBackgroundEffectsPicker, { options: selectableVideoEffects, onChange: onEffectChange }))));
21916
+ const selectedEffect = useSelector$1(activeVideoBackgroundEffectSelector);
21917
+ /* @conditional-compile-remove(video-background-effects) */
21918
+ return (React__default['default'].createElement(react.Panel, { headerText: locale.strings.call.effects, isOpen: showVideoEffectsOptions, onDismiss: () => setshowVideoEffectsOptions(false), hasCloseButton: true, closeButtonAriaLabel: "Close", isLightDismiss: true }, selectableVideoEffects && (React__default['default'].createElement(_VideoBackgroundEffectsPicker, { options: selectableVideoEffects, onChange: onEffectChange, selectedEffectKey: selectedEffect }))));
21894
21919
  };
21895
21920
 
21896
21921
  // Copyright (c) Microsoft Corporation.
@@ -22045,7 +22070,7 @@ const CallArrangement = (props) => {
22045
22070
  /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */
22046
22071
  callPaneContent()),
22047
22072
  /* @conditional-compile-remove(video-background-effects) */
22048
- React__default['default'].createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setShowVideoEffectsPane, adapter: adapter })))));
22073
+ React__default['default'].createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setShowVideoEffectsPane })))));
22049
22074
  };
22050
22075
  /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */
22051
22076
  const showShowPeopleTabHeaderButton$1 = (callControls) => {
@@ -23383,7 +23408,7 @@ const ConfigurationPage = (props) => {
23383
23408
  React__default['default'].createElement(react.Stack, { styles: mobileWithPreview ? startCallButtonContainerStyleMobile : startCallButtonContainerStyleDesktop },
23384
23409
  React__default['default'].createElement(StartCallButton, { className: mobileWithPreview ? startCallButtonStyleMobile : undefined, onClick: startCallHandler, disabled: disableStartCallButton })))),
23385
23410
  /* @conditional-compile-remove(video-background-effects) */
23386
- React__default['default'].createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setVideoEffectsPane, adapter: adapter })));
23411
+ React__default['default'].createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setVideoEffectsPane })));
23387
23412
  };
23388
23413
  const localPreviewTrampoline = (mobileView, doNotShow) => {
23389
23414
  /* @conditional-compile-remove(rooms) */
@@ -25275,7 +25300,9 @@ function callAdapterStateFromCallWithChatAdapterState(callWithChatAdapterState)
25275
25300
  /* @conditional-compile-remove(unsupported-browser) */
25276
25301
  environmentInfo: callWithChatAdapterState.environmentInfo,
25277
25302
  /* @conditional-compile-remove(video-background-effects) */
25278
- videoBackgroundImages: callWithChatAdapterState.videoBackgroundImages
25303
+ videoBackgroundImages: callWithChatAdapterState.videoBackgroundImages,
25304
+ /* @conditional-compile-remove(video-background-effects) */
25305
+ selectedVideoBackgroundEffect: callWithChatAdapterState.selectedVideoBackgroundEffect
25279
25306
  };
25280
25307
  }
25281
25308
 
@@ -25628,7 +25655,8 @@ const CallWithChatScreen = (props) => {
25628
25655
  style: callCompositeContainerCSS },
25629
25656
  React__default['default'].createElement(CallComposite, Object.assign({}, props, { formFactor: formFactor, options: callCompositeOptions, adapter: callAdapter, fluentTheme: fluentTheme }))),
25630
25657
  /* @conditional-compile-remove(video-background-effects) */
25631
- React__default['default'].createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setShowVideoEffectsPane, adapter: callAdapter }),
25658
+ React__default['default'].createElement(CallAdapterProvider, { adapter: callAdapter },
25659
+ React__default['default'].createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setShowVideoEffectsPane })),
25632
25660
  chatProps.adapter && callAdapter && hasJoinedCall && (React__default['default'].createElement(CallWithChatPane, { chatCompositeProps: chatProps, inviteLink: props.joinInvitationURL, onClose: closePane, chatAdapter: chatProps.adapter, callAdapter: callAdapter, onFetchAvatarPersonaData: props.onFetchAvatarPersonaData, onFetchParticipantMenuItems: props.onFetchParticipantMenuItems, onChatButtonClicked: showShowChatTabHeaderButton(props.callControls) ? selectChat : undefined, onPeopleButtonClicked: showShowPeopleTabHeaderButton(props.callControls) ? selectPeople : undefined, modalLayerHostId: modalLayerHostId, mobileView: mobileView, activePane: activePane,
25633
25661
  /* @conditional-compile-remove(file-sharing) */
25634
25662
  fileSharing: props.fileSharing, rtl: props.rtl, callControls: typeof props.callControls !== 'boolean' ? props.callControls : undefined }))),
@@ -25728,7 +25756,9 @@ function callWithChatAdapterStateFromBackingStates(callAdapter, chatAdapter) {
25728
25756
  /* @conditional-compile-remove(unsupported-browser) */
25729
25757
  environmentInfo: callAdapterState.environmentInfo,
25730
25758
  /* @conditional-compile-remove(video-background-effects) */
25731
- videoBackgroundImages: callAdapterState.videoBackgroundImages
25759
+ videoBackgroundImages: callAdapterState.videoBackgroundImages,
25760
+ /* @conditional-compile-remove(video-background-effects) */
25761
+ selectedVideoBackgroundEffect: callAdapterState.selectedVideoBackgroundEffect
25732
25762
  };
25733
25763
  }
25734
25764
  /**
@@ -25745,7 +25775,9 @@ function mergeChatAdapterStateIntoCallWithChatAdapterState(existingCallWithChatA
25745
25775
  function mergeCallAdapterStateIntoCallWithChatAdapterState(existingCallWithChatAdapterState, callAdapterState) {
25746
25776
  return Object.assign(Object.assign({}, existingCallWithChatAdapterState), { userId: callAdapterState.userId, page: callAdapterState.page, displayName: callAdapterState.displayName, devices: callAdapterState.devices, call: callAdapterState.call, isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled, isTeamsCall: callAdapterState.isTeamsCall, latestCallErrors: callAdapterState.latestErrors,
25747
25777
  /* @conditional-compile-remove(video-background-effects) */
25748
- videoBackgroundImages: callAdapterState.videoBackgroundImages });
25778
+ videoBackgroundImages: callAdapterState.videoBackgroundImages,
25779
+ /* @conditional-compile-remove(video-background-effects) */
25780
+ selectedVideoBackgroundEffect: callAdapterState.selectedVideoBackgroundEffect });
25749
25781
  }
25750
25782
 
25751
25783
  // Copyright (c) Microsoft Corporation.