@azure/communication-react 1.5.1-alpha-202304250012 → 1.5.1-alpha-202304260013

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 (29) hide show
  1. package/dist/dist-cjs/communication-react/index.js +121 -104
  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/calling-component-bindings/src/captionsSelector.js +3 -1
  6. package/dist/dist-esm/calling-component-bindings/src/captionsSelector.js.map +1 -1
  7. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.d.ts +1 -1
  8. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js +1 -1
  9. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js.map +1 -1
  10. package/dist/dist-esm/calling-stateful-client/src/index.d.ts +1 -0
  11. package/dist/dist-esm/calling-stateful-client/src/index.js +2 -0
  12. package/dist/dist-esm/calling-stateful-client/src/index.js.map +1 -1
  13. package/dist/dist-esm/react-components/src/components/CaptionsBanner.d.ts +1 -0
  14. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +2 -2
  15. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
  16. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js +1 -1
  17. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js.map +1 -1
  18. package/dist/dist-esm/react-components/src/components/utils.js +5 -1
  19. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  20. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +15 -5
  21. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  22. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +3 -3
  23. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  24. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +2 -1
  25. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  26. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.d.ts +4 -0
  27. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js +4 -1
  28. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js.map +1 -1
  29. package/package.json +8 -8
@@ -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-202304250012';
165
+ var telemetryVersion = '1.5.1-alpha-202304260013';
166
166
 
167
167
  // Copyright (c) Microsoft Corporation.
168
168
  /**
@@ -1025,10 +1025,12 @@ const _changeSpokenLanguageSelector = reselect__namespace.createSelector([getSup
1025
1025
  const _captionsBannerSelector = reselect__namespace.createSelector([getCaptions, getCaptionsStatus], (captions, isCaptionsFeatureActive) => {
1026
1026
  const captionsInfo = captions === null || captions === void 0 ? void 0 : captions.map((c) => {
1027
1027
  var _a, _b;
1028
+ const userId = c.speaker.identifier ? toFlatCommunicationIdentifier(c.speaker.identifier) : '';
1028
1029
  return {
1030
+ id: c.timestamp.getTime() + userId + c.speaker.displayName,
1029
1031
  displayName: (_a = c.speaker.displayName) !== null && _a !== void 0 ? _a : 'Unnamed Participant',
1030
1032
  captionText: (_b = c.captionText) !== null && _b !== void 0 ? _b : '',
1031
- userId: c.speaker.identifier ? toFlatCommunicationIdentifier(c.speaker.identifier) : ''
1033
+ userId
1032
1034
  };
1033
1035
  });
1034
1036
  return {
@@ -1327,7 +1329,7 @@ const _isTeamsCallAgent = (callAgent) => {
1327
1329
  };
1328
1330
  /* @conditional-compile-remove(close-captions) */
1329
1331
  /**
1330
- * @private
1332
+ * @internal
1331
1333
  * Determine whether a call is:
1332
1334
  * A TeamsCall
1333
1335
  * or a ACS Call joining the teams meeting
@@ -4850,6 +4852,7 @@ const extension = (fileName) => fileName.split('.').pop() || '';
4850
4852
  * Always returns a new Array so that the state variable is updated, trigerring a render.
4851
4853
  */
4852
4854
  const dismissError = (dismissedErrors, toDismiss) => {
4855
+ var _a;
4853
4856
  const now = new Date(Date.now());
4854
4857
  for (const error of dismissedErrors) {
4855
4858
  if (error.type === toDismiss.type) {
@@ -4859,12 +4862,15 @@ const dismissError = (dismissedErrors, toDismiss) => {
4859
4862
  return Array.from(dismissedErrors);
4860
4863
  }
4861
4864
  }
4865
+ const toDismissTimestamp = (_a = toDismiss.timestamp) !== null && _a !== void 0 ? _a : now;
4862
4866
  // Record that this error was dismissed for the first time right now.
4863
4867
  return [
4864
4868
  ...dismissedErrors,
4865
4869
  {
4866
4870
  type: toDismiss.type,
4867
- dismissedAt: now,
4871
+ // the error time could be sometimes later than the button click time, which cause the dismiss not working
4872
+ // so we set the dismiss time to the later one
4873
+ dismissedAt: now > toDismissTimestamp ? now : toDismissTimestamp,
4868
4874
  activeSince: toDismiss.timestamp
4869
4875
  }
4870
4876
  ];
@@ -14001,7 +14007,7 @@ const captionsContainerClassName = react.mergeStyles({
14001
14007
  const captionContainerClassName = react.mergeStyles({
14002
14008
  marginTop: _pxToRem(6),
14003
14009
  marginBottom: _pxToRem(6),
14004
- overflowAnchor: 'none'
14010
+ overflowAnchor: 'auto'
14005
14011
  });
14006
14012
  /**
14007
14013
  * @private
@@ -14087,8 +14093,8 @@ const _CaptionsBanner = (props) => {
14087
14093
  }, [captions, isAtBottomOfScroll]);
14088
14094
  return (React__default['default'].createElement(React__default['default'].Fragment, null, isCaptionsOn && (React__default['default'].createElement(react.FocusZone, { as: "ul", className: captionsContainerClassName },
14089
14095
  React__default['default'].createElement(reactNorthstar.Ref, { innerRef: captionsScrollDivRef },
14090
- React__default['default'].createElement(react.Stack, { verticalAlign: "start", className: captionsBannerClassName }, captions.map((caption, key) => {
14091
- return (React__default['default'].createElement("div", { key: key, className: captionContainerClassName, "data-is-focusable": true },
14096
+ React__default['default'].createElement(react.Stack, { verticalAlign: "start", className: captionsBannerClassName }, captions.map((caption) => {
14097
+ return (React__default['default'].createElement("div", { key: caption.id, className: captionContainerClassName, "data-is-focusable": true },
14092
14098
  React__default['default'].createElement(_Caption, Object.assign({}, caption, { onRenderAvatar: onRenderAvatar }))));
14093
14099
  })))))));
14094
14100
  };
@@ -19649,6 +19655,98 @@ const SendDtmfDialpad = (props) => {
19649
19655
  React__default['default'].createElement(Dialpad, Object.assign({ styles: dialpadStyle }, dialpadProps, { textFieldValue: textFieldValue, onChange: onChange, showDeleteButton: false, strings: strings, isMobile: isMobile }))))));
19650
19656
  };
19651
19657
 
19658
+ // Copyright (c) Microsoft Corporation.
19659
+ // Licensed under the MIT license.
19660
+ /** @private */
19661
+ const controlBarContainerStyles$1 = {
19662
+ paddingTop: '0.25rem',
19663
+ paddingBottom: '0.25rem',
19664
+ // @TODO: this should be exposed through a custom CallComposite Theme API that extends the fluent theme with semantic values
19665
+ boxShadow: `
19666
+ 0px 6.400000095367432px 14.399999618530273px 0px #00000021;
19667
+ 0px 1.2000000476837158px 3.5999999046325684px 0px #0000001A;
19668
+ `
19669
+ };
19670
+
19671
+ // Copyright (c) Microsoft Corporation.
19672
+ const VIDEO_GALLERY_Z_INDEX = 1;
19673
+ // The control bar must be in a higher z-band than the video gallery so the drop shadow appears on top of the video gallery
19674
+ /** @private */
19675
+ const CONTROL_BAR_Z_INDEX = VIDEO_GALLERY_Z_INDEX + 1;
19676
+ // The notification container should be in the highest z-band to ensure it shows on top of all other content.
19677
+ const NOTIFICATION_CONTAINER_Z_INDEX = Math.max(CONTROL_BAR_Z_INDEX, VIDEO_GALLERY_Z_INDEX) + 1;
19678
+ /** @private */
19679
+ const DRAWER_Z_INDEX = NOTIFICATION_CONTAINER_Z_INDEX + 1;
19680
+ /**
19681
+ * @private
19682
+ */
19683
+ const callControlsContainerStyles = react.mergeStyles(controlBarContainerStyles$1, {
19684
+ zIndex: CONTROL_BAR_Z_INDEX
19685
+ });
19686
+ const containerStyle$2 = {
19687
+ width: '100%',
19688
+ position: 'relative',
19689
+ minHeight: '13rem' // linked to minimum space allocated to media gallery
19690
+ };
19691
+ /**
19692
+ * @private
19693
+ */
19694
+ const containerStyleDesktop = react.mergeStyles(Object.assign(Object.assign({}, containerStyle$2), { minWidth: '30rem' }));
19695
+ /**
19696
+ * @private
19697
+ */
19698
+ const containerStyleMobile = react.mergeStyles(Object.assign(Object.assign({}, containerStyle$2), { minWidth: '17.5rem' }));
19699
+ /**
19700
+ * @private
19701
+ */
19702
+ const galleryParentContainerStyles = (backgroundColor) => ({
19703
+ root: {
19704
+ zIndex: VIDEO_GALLERY_Z_INDEX,
19705
+ width: '100%',
19706
+ background: backgroundColor
19707
+ }
19708
+ });
19709
+ /**
19710
+ * @private
19711
+ */
19712
+ const mediaGalleryContainerStyles$1 = {
19713
+ root: {
19714
+ height: '100%'
19715
+ }
19716
+ };
19717
+ /**
19718
+ * @private
19719
+ */
19720
+ const notificationsContainerStyles = {
19721
+ root: {
19722
+ width: '100%',
19723
+ position: 'absolute',
19724
+ top: 0,
19725
+ left: 0,
19726
+ padding: '1rem',
19727
+ zIndex: NOTIFICATION_CONTAINER_Z_INDEX,
19728
+ pointerEvents: 'none' // to allow the operation of controls underneath the notification container
19729
+ }
19730
+ };
19731
+ /**
19732
+ * @private
19733
+ */
19734
+ const bannerNotificationStyles = {
19735
+ root: {
19736
+ pointerEvents: 'auto' // to allow the dismissal or error and warning bars in the notification container
19737
+ }
19738
+ };
19739
+ /**
19740
+ * @private
19741
+ */
19742
+ const callArrangementContainerStyles = {
19743
+ root: {
19744
+ width: '100%',
19745
+ height: '100%',
19746
+ flexDirection: 'column-reverse' // to allow first initial keyboard focus on ControlBar
19747
+ }
19748
+ };
19749
+
19652
19750
  // Copyright (c) Microsoft Corporation.
19653
19751
  // Enforce a background color on control bar to ensure it matches the composite background color.
19654
19752
  const controlBarStyles = react.memoizeFunction((background) => ({ root: { background: background } }));
@@ -19756,7 +19854,7 @@ const CallControls = (props) => {
19756
19854
  let cameraButtonIsEnabled = isEnabled$2(options === null || options === void 0 ? void 0 : options.cameraButton);
19757
19855
  /* @conditional-compile-remove(rooms) */
19758
19856
  cameraButtonIsEnabled = rolePermissions.cameraButton && cameraButtonIsEnabled;
19759
- return (React__default['default'].createElement(react.Stack, { horizontalAlign: "center" },
19857
+ return (React__default['default'].createElement(react.Stack, { horizontalAlign: "center", className: callControlsContainerStyles },
19760
19858
  /* @conditional-compile-remove(PSTN-calls) */
19761
19859
  React__default['default'].createElement(SendDtmfDialpad, { isMobile: !!props.isMobile, strings: dialpadStrings, showDialpad: showDialpad, onDismissDialpad: onDismissDialpad }),
19762
19860
  React__default['default'].createElement(react.Stack.Item, null,
@@ -19803,95 +19901,6 @@ const PeopleButton = (props) => {
19803
19901
  return (React__default['default'].createElement(ControlBarButton, Object.assign({}, props, { strings: strings, labelKey: 'peopleButtonLabelKey', onRenderOnIcon: onRenderOnIcon !== null && onRenderOnIcon !== void 0 ? onRenderOnIcon : icon, onRenderOffIcon: onRenderOffIcon !== null && onRenderOffIcon !== void 0 ? onRenderOffIcon : icon, onClick: onClick, styles: styles })));
19804
19902
  };
19805
19903
 
19806
- // Copyright (c) Microsoft Corporation.
19807
- // Licensed under the MIT license.
19808
- /** @private */
19809
- const controlBarContainerStyles$1 = {
19810
- paddingTop: '0.25rem',
19811
- paddingBottom: '0.25rem',
19812
- // @TODO: this should be exposed through a custom CallComposite Theme API that extends the fluent theme with semantic values
19813
- boxShadow: `
19814
- 0px 6.400000095367432px 14.399999618530273px 0px #00000021;
19815
- 0px 1.2000000476837158px 3.5999999046325684px 0px #0000001A;
19816
- `
19817
- };
19818
-
19819
- // Copyright (c) Microsoft Corporation.
19820
- const VIDEO_GALLERY_Z_INDEX = 1;
19821
- // The control bar must be in a higher z-band than the video gallery so the drop shadow appears on top of the video gallery
19822
- const CONTROL_BAR_Z_INDEX = VIDEO_GALLERY_Z_INDEX + 1;
19823
- // The notification container should be in the highest z-band to ensure it shows on top of all other content.
19824
- const NOTIFICATION_CONTAINER_Z_INDEX = Math.max(CONTROL_BAR_Z_INDEX, VIDEO_GALLERY_Z_INDEX) + 1;
19825
- /**
19826
- * @private
19827
- */
19828
- const callControlsContainerStyles = react.mergeStyles(controlBarContainerStyles$1, {
19829
- zIndex: CONTROL_BAR_Z_INDEX
19830
- });
19831
- const containerStyle$2 = {
19832
- width: '100%',
19833
- position: 'relative',
19834
- minHeight: '13rem' // linked to minimum space allocated to media gallery
19835
- };
19836
- /**
19837
- * @private
19838
- */
19839
- const containerStyleDesktop = react.mergeStyles(Object.assign(Object.assign({}, containerStyle$2), { minWidth: '30rem' }));
19840
- /**
19841
- * @private
19842
- */
19843
- const containerStyleMobile = react.mergeStyles(Object.assign(Object.assign({}, containerStyle$2), { minWidth: '17.5rem' }));
19844
- /**
19845
- * @private
19846
- */
19847
- const galleryParentContainerStyles = (backgroundColor) => ({
19848
- root: {
19849
- zIndex: VIDEO_GALLERY_Z_INDEX,
19850
- width: '100%',
19851
- background: backgroundColor
19852
- }
19853
- });
19854
- /**
19855
- * @private
19856
- */
19857
- const mediaGalleryContainerStyles$1 = {
19858
- root: {
19859
- height: '100%'
19860
- }
19861
- };
19862
- /**
19863
- * @private
19864
- */
19865
- const notificationsContainerStyles = {
19866
- root: {
19867
- width: '100%',
19868
- position: 'absolute',
19869
- top: 0,
19870
- left: 0,
19871
- padding: '1rem',
19872
- zIndex: NOTIFICATION_CONTAINER_Z_INDEX,
19873
- pointerEvents: 'none' // to allow the operation of controls underneath the notification container
19874
- }
19875
- };
19876
- /**
19877
- * @private
19878
- */
19879
- const bannerNotificationStyles = {
19880
- root: {
19881
- pointerEvents: 'auto' // to allow the dismissal or error and warning bars in the notification container
19882
- }
19883
- };
19884
- /**
19885
- * @private
19886
- */
19887
- const callArrangementContainerStyles = {
19888
- root: {
19889
- width: '100%',
19890
- height: '100%',
19891
- flexDirection: 'column-reverse' // to allow first initial keyboard focus on ControlBar
19892
- }
19893
- };
19894
-
19895
19904
  // Copyright (c) Microsoft Corporation.
19896
19905
  /**
19897
19906
  * The hook to bypass limitation of conditional build for CallWithChatComposite
@@ -22099,7 +22108,7 @@ const CallArrangement = (props) => {
22099
22108
  const onClickShowDialpad = () => {
22100
22109
  setShowDtmfDialpad(true);
22101
22110
  };
22102
- const drawerContainerStylesValue = React.useMemo(() => drawerContainerStyles(10), []);
22111
+ const drawerContainerStylesValue = React.useMemo(() => drawerContainerStyles(DRAWER_Z_INDEX), []);
22103
22112
  // To be removed once feature is out of beta, replace with callCompositeContainerCSS
22104
22113
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
22105
22114
  const callCompositeContainerFlex = () => {
@@ -22145,7 +22154,7 @@ const CallArrangement = (props) => {
22145
22154
  React__default['default'].createElement(react.Stack, { grow: true, styles: callArrangementContainerStyles },
22146
22155
  ((_b = props.callControlProps) === null || _b === void 0 ? void 0 : _b.options) !== false &&
22147
22156
  /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */
22148
- !isMobileWithActivePane && (React__default['default'].createElement(react.Stack.Item, { className: callControlsContainerStyles }, isLegacyCallControlEnabled((_c = props.callControlProps) === null || _c === void 0 ? void 0 : _c.options) ? (React__default['default'].createElement(CallControls, Object.assign({}, props.callControlProps, { containerWidth: containerWidth, containerHeight: containerHeight, isMobile: props.mobileView,
22157
+ !isMobileWithActivePane && (React__default['default'].createElement(react.Stack.Item, { className: react.mergeStyles({ zIndex: CONTROL_BAR_Z_INDEX }) }, isLegacyCallControlEnabled((_c = props.callControlProps) === null || _c === void 0 ? void 0 : _c.options) ? (React__default['default'].createElement(CallControls, Object.assign({}, props.callControlProps, { containerWidth: containerWidth, containerHeight: containerHeight, isMobile: props.mobileView,
22149
22158
  /* @conditional-compile-remove(one-to-n-calling) */
22150
22159
  peopleButtonChecked: activePane === 'people',
22151
22160
  /* @conditional-compile-remove(one-to-n-calling) */
@@ -24392,6 +24401,14 @@ class AzureCommunicationCallAdapter {
24392
24401
  this.locator = locator;
24393
24402
  this.deviceManager = deviceManager;
24394
24403
  const isTeamsMeeting = 'meetingLink' in this.locator;
24404
+ /* @conditional-compile-remove(rooms) */
24405
+ const isRoomsCall = 'roomId' in this.locator;
24406
+ /* @conditional-compile-remove(rooms) */
24407
+ // to prevent showing components that depend on role such as local video tile, camera button, etc. in a rooms call
24408
+ // we set the default roleHint as 'Consumer' when roleHint is undefined since it has the lowest level of permissions
24409
+ if (isRoomsCall && (options === null || options === void 0 ? void 0 : options.roleHint) === undefined) {
24410
+ options = Object.assign(Object.assign({}, options), { roleHint: 'Consumer' });
24411
+ }
24395
24412
  this.context = new CallContext(callClient.getState(), isTeamsMeeting, options);
24396
24413
  this.context.onCallEnded((endCallData) => this.emitter.emit('callEnded', endCallData));
24397
24414
  const onStateChange = (clientState) => {
@@ -24837,11 +24854,11 @@ class AzureCommunicationCallAdapter {
24837
24854
  }
24838
24855
  /* @conditional-compile-remove(close-captions) */
24839
24856
  subscribeToCaptionEvents() {
24840
- var _a, _b, _c, _d;
24841
- if (((_a = this.call) === null || _a === void 0 ? void 0 : _a.state) === 'Connected') {
24842
- (_b = this.call) === null || _b === void 0 ? void 0 : _b.feature(communicationCalling.Features.TeamsCaptions).on('captionsReceived', this.captionsReceived.bind(this));
24843
- (_c = this.call) === null || _c === void 0 ? void 0 : _c.feature(communicationCalling.Features.TeamsCaptions).on('isCaptionsActiveChanged', this.isCaptionsActiveChanged.bind(this));
24844
- (_d = this.call) === null || _d === void 0 ? void 0 : _d.off('stateChanged', this.subscribeToCaptionEvents.bind(this));
24857
+ var _a, _b, _c;
24858
+ if (this.call && this.call.state === 'Connected' && _isTeamsMeetingCall(this.call)) {
24859
+ (_a = this.call) === null || _a === void 0 ? void 0 : _a.feature(communicationCalling.Features.TeamsCaptions).on('captionsReceived', this.captionsReceived.bind(this));
24860
+ (_b = this.call) === null || _b === void 0 ? void 0 : _b.feature(communicationCalling.Features.TeamsCaptions).on('isCaptionsActiveChanged', this.isCaptionsActiveChanged.bind(this));
24861
+ (_c = this.call) === null || _c === void 0 ? void 0 : _c.off('stateChanged', this.subscribeToCaptionEvents.bind(this));
24845
24862
  }
24846
24863
  }
24847
24864
  subscribeCallEvents() {