@azure/communication-react 1.5.1-alpha-202303090014 → 1.5.1-alpha-202303100015

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/dist-cjs/communication-react/index.js +95 -27
  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-components/src/components/ResponsiveVerticalGallery.d.ts +2 -0
  6. package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.js +6 -5
  7. package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.js.map +1 -1
  8. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +10 -1
  9. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
  10. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +17 -3
  11. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
  12. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.d.ts +4 -0
  13. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.js.map +1 -1
  14. package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.d.ts +1 -0
  15. package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js +13 -5
  16. package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.d.ts +8 -0
  18. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js +6 -1
  19. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js.map +1 -1
  20. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.d.ts +26 -2
  21. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.js +42 -14
  22. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.js.map +1 -1
  23. package/dist/dist-esm/react-components/src/components/utils/responsive.d.ts +6 -0
  24. package/dist/dist-esm/react-components/src/components/utils/responsive.js +7 -0
  25. package/dist/dist-esm/react-components/src/components/utils/responsive.js.map +1 -1
  26. 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-202303090014';
165
+ var telemetryVersion = '1.5.1-alpha-202303100015';
166
166
 
167
167
  // Copyright (c) Microsoft Corporation.
168
168
  /**
@@ -7033,12 +7033,19 @@ const _useContainerHeight = (containerRef) => {
7033
7033
  return height;
7034
7034
  };
7035
7035
  const NARROW_WIDTH_REM = 30;
7036
+ const SHORT_HEIGHT_REM = 23.75;
7036
7037
  /**
7037
7038
  * Utility function to determine if container width is narrow
7038
7039
  * @param containerWidthRem container width in rem
7039
7040
  * @returns boolean
7040
7041
  */
7041
7042
  const isNarrowWidth = (containerWidthRem) => containerWidthRem <= _convertRemToPx(NARROW_WIDTH_REM);
7043
+ /**
7044
+ * Utility function to determine if container width is short
7045
+ * @param containerWidthRem container height in rem
7046
+ * @returns boolean
7047
+ */
7048
+ const isShortHeight = (containerHeightRem) => containerHeightRem <= _convertRemToPx(SHORT_HEIGHT_REM);
7042
7049
 
7043
7050
  /**
7044
7051
  * @private
@@ -9695,7 +9702,12 @@ const LARGE_FLOATING_MODAL_SIZE_PX = { width: 215, height: 120 };
9695
9702
  * Vertical gallery floating modal width and height in rem
9696
9703
  * Aspect ratio: 16:9
9697
9704
  */
9698
- const VERTICAL_GALLERY_FLOATING_MODAL_SIZE_PX = { width: 144, height: 81 };
9705
+ const SHORT_VERTICAL_GALLERY_FLOATING_MODAL_SIZE_PX = { width: 144, height: 81 };
9706
+ /**
9707
+ * Vertical gallery floating modal width and height in rem
9708
+ * Aspect ratio: 16:9
9709
+ */
9710
+ const VERTICAL_GALLERY_FLOATING_MODAL_SIZE_PX = { width: 176, height: 100 };
9699
9711
  /**
9700
9712
  * @private
9701
9713
  * z-index to ensure that the local video tile is above the video gallery.
@@ -9775,7 +9787,16 @@ const localVideoModalStyles = {
9775
9787
  *
9776
9788
  * @private
9777
9789
  */
9778
- const VERTICAL_GALLERY_TILE_SIZE_REM = { minHeight: 5.625, maxHeight: 9, width: 9 };
9790
+ const SHORT_VERTICAL_GALLERY_TILE_SIZE_REM = { minHeight: 5.625, maxHeight: 9, width: 9 };
9791
+ /**
9792
+ * VerticalGallery tile size in rem:
9793
+ *
9794
+ * min - smallest possible size of the tile (90px)
9795
+ * max - Largest size we want the vertical tiles (144px)
9796
+ *
9797
+ * @private
9798
+ */
9799
+ const VERTICAL_GALLERY_TILE_SIZE_REM = { minHeight: 6.75, maxHeight: 11, width: 11 };
9779
9800
  /**
9780
9801
  * Styles for the VerticalGallery's container set in parent.
9781
9802
  *
@@ -9784,20 +9805,39 @@ const VERTICAL_GALLERY_TILE_SIZE_REM = { minHeight: 5.625, maxHeight: 9, width:
9784
9805
  * @param shouldFloatLocalVideo whether rendered in floating layout or not
9785
9806
  * @returns Style set for VerticalGallery container.
9786
9807
  */
9787
- const verticalGalleryContainerStyle = (shouldFloatLocalVideo, isNarrow) => {
9788
- return isNarrow
9808
+ const verticalGalleryContainerStyle = (shouldFloatLocalVideo, isNarrow, isShort) => {
9809
+ return isNarrow && isShort
9789
9810
  ? {
9790
- width: `${VERTICAL_GALLERY_TILE_SIZE_REM.width}rem`,
9811
+ width: `${SHORT_VERTICAL_GALLERY_TILE_SIZE_REM.width}rem`,
9791
9812
  height: shouldFloatLocalVideo ? `calc(100% - ${_pxToRem(SMALL_FLOATING_MODAL_SIZE_PX.height)})` : '100%',
9792
9813
  paddingBottom: '0.5rem'
9793
9814
  }
9794
- : {
9795
- width: `${VERTICAL_GALLERY_TILE_SIZE_REM.width}rem`,
9796
- height: shouldFloatLocalVideo
9797
- ? `calc(100% - ${_pxToRem(VERTICAL_GALLERY_FLOATING_MODAL_SIZE_PX.height)})`
9798
- : '100%',
9799
- paddingBottom: '0.5rem'
9800
- };
9815
+ : !isNarrow && isShort
9816
+ ? {
9817
+ width: `${SHORT_VERTICAL_GALLERY_TILE_SIZE_REM.width}rem`,
9818
+ height: shouldFloatLocalVideo
9819
+ ? `calc(100% - ${_pxToRem(SHORT_VERTICAL_GALLERY_FLOATING_MODAL_SIZE_PX.height)})`
9820
+ : '100%',
9821
+ paddingBottom: '0.5rem'
9822
+ }
9823
+ : {
9824
+ width: `${VERTICAL_GALLERY_TILE_SIZE_REM.width}rem`,
9825
+ height: shouldFloatLocalVideo
9826
+ ? `calc(100% - ${_pxToRem(VERTICAL_GALLERY_FLOATING_MODAL_SIZE_PX.height)})`
9827
+ : '100%',
9828
+ paddingBottom: '0.5rem'
9829
+ };
9830
+ };
9831
+ /**
9832
+ * @private
9833
+ */
9834
+ const SHORT_VERTICAL_GALLERY_TILE_STYLE = {
9835
+ minHeight: `${SHORT_VERTICAL_GALLERY_TILE_SIZE_REM.minHeight}rem`,
9836
+ minWidth: `${SHORT_VERTICAL_GALLERY_TILE_SIZE_REM.width}rem`,
9837
+ maxHeight: `${SHORT_VERTICAL_GALLERY_TILE_SIZE_REM.maxHeight}rem`,
9838
+ maxWidth: `${SHORT_VERTICAL_GALLERY_TILE_SIZE_REM.width}rem`,
9839
+ width: '100%',
9840
+ height: '100%'
9801
9841
  };
9802
9842
  /**
9803
9843
  * @private
@@ -9813,8 +9853,8 @@ const VERTICAL_GALLERY_TILE_STYLE = {
9813
9853
  /**
9814
9854
  * @private
9815
9855
  */
9816
- const verticalGalleryStyle = {
9817
- children: VERTICAL_GALLERY_TILE_STYLE
9856
+ const verticalGalleryStyle = (isShort) => {
9857
+ return isShort ? { children: SHORT_VERTICAL_GALLERY_TILE_STYLE } : { children: VERTICAL_GALLERY_TILE_STYLE };
9818
9858
  };
9819
9859
 
9820
9860
  // Copyright (c) Microsoft Corporation.
@@ -9826,7 +9866,7 @@ const verticalGalleryStyle = {
9826
9866
  * @beta
9827
9867
  */
9828
9868
  const ResponsiveVerticalGallery = (props) => {
9829
- const { children, containerStyles, verticalGalleryStyles, gapHeightRem, controlBarHeightRem } = props;
9869
+ const { children, containerStyles, verticalGalleryStyles, gapHeightRem, controlBarHeightRem, isShort } = props;
9830
9870
  const containerRef = React.useRef(null);
9831
9871
  const containerHeight = _useContainerHeight(containerRef);
9832
9872
  const topPadding = containerRef.current ? parseFloat(getComputedStyle(containerRef.current).paddingTop) : 0;
@@ -9835,7 +9875,8 @@ const ResponsiveVerticalGallery = (props) => {
9835
9875
  numberOfChildren: React__default['default'].Children.count(children),
9836
9876
  containerHeight: (containerHeight !== null && containerHeight !== void 0 ? containerHeight : 0) - topPadding - bottomPadding,
9837
9877
  gapHeightRem,
9838
- controlBarHeight: controlBarHeightRem !== null && controlBarHeightRem !== void 0 ? controlBarHeightRem : 2
9878
+ controlBarHeight: controlBarHeightRem !== null && controlBarHeightRem !== void 0 ? controlBarHeightRem : 2,
9879
+ isShort: isShort !== null && isShort !== void 0 ? isShort : false
9839
9880
  });
9840
9881
  return (React__default['default'].createElement("div", { ref: containerRef, className: react.mergeStyles(containerStyles) },
9841
9882
  React__default['default'].createElement(VerticalGallery, { childrenPerPage: childrenPerPage, styles: verticalGalleryStyles }, children)));
@@ -9844,8 +9885,8 @@ const ResponsiveVerticalGallery = (props) => {
9844
9885
  * Helper function to find the number of children for the VerticalGallery on each page.
9845
9886
  */
9846
9887
  const calculateChildrenPerPage = (args) => {
9847
- const { numberOfChildren, containerHeight, gapHeightRem, controlBarHeight } = args;
9848
- const childMinHeightPx = _convertRemToPx(VERTICAL_GALLERY_TILE_SIZE_REM.minHeight);
9888
+ const { numberOfChildren, containerHeight, gapHeightRem, controlBarHeight, isShort } = args;
9889
+ const childMinHeightPx = _convertRemToPx(isShort ? SHORT_VERTICAL_GALLERY_TILE_SIZE_REM.minHeight : VERTICAL_GALLERY_TILE_SIZE_REM.minHeight);
9849
9890
  const gapHeightPx = _convertRemToPx(gapHeightRem);
9850
9891
  const controlBarHeightPx = _convertRemToPx(controlBarHeight);
9851
9892
  /** First check how many children can fit in containerHeight.
@@ -9988,31 +10029,39 @@ const ScrollableHorizontalGallery = (props) => {
9988
10029
  * @private
9989
10030
  */
9990
10031
  const OverflowGallery = (props) => {
9991
- const { shouldFloatLocalVideo = false, isNarrow = false, overflowGalleryElements, horizontalGalleryStyles,
10032
+ const { shouldFloatLocalVideo = false, isNarrow = false,
10033
+ /* @conditional-compile-remove(vertical-gallery) */
10034
+ isShort = false, overflowGalleryElements, horizontalGalleryStyles,
9992
10035
  /* @conditional-compile-remove(vertical-gallery) */ overflowGalleryLayout = 'HorizontalBottom',
9993
10036
  /* @conditional-compile-remove(vertical-gallery) */ veritcalGalleryStyles } = props;
9994
10037
  const containerStyles = React.useMemo(() => {
9995
10038
  /* @conditional-compile-remove(vertical-gallery) */
9996
10039
  if (overflowGalleryLayout === 'VerticalRight') {
9997
- return verticalGalleryContainerStyle(shouldFloatLocalVideo, isNarrow);
10040
+ return verticalGalleryContainerStyle(shouldFloatLocalVideo, isNarrow, isShort);
9998
10041
  }
9999
10042
  return horizontalGalleryContainerStyle(shouldFloatLocalVideo, isNarrow);
10000
- }, [shouldFloatLocalVideo, isNarrow, /* @conditional-compile-remove(vertical-gallery) */ overflowGalleryLayout]);
10043
+ }, [
10044
+ shouldFloatLocalVideo,
10045
+ /* @conditional-compile-remove(vertical-gallery) */ isShort,
10046
+ isNarrow,
10047
+ /* @conditional-compile-remove(vertical-gallery) */ overflowGalleryLayout
10048
+ ]);
10001
10049
  const galleryStyles = React.useMemo(() => {
10002
10050
  /* @conditional-compile-remove(vertical-gallery) */
10003
10051
  if (overflowGalleryLayout === 'VerticalRight') {
10004
- return react.concatStyleSets(verticalGalleryStyle, veritcalGalleryStyles);
10052
+ return react.concatStyleSets(verticalGalleryStyle(isShort), veritcalGalleryStyles);
10005
10053
  }
10006
10054
  return react.concatStyleSets(horizontalGalleryStyle(isNarrow), horizontalGalleryStyles);
10007
10055
  }, [
10008
10056
  isNarrow,
10057
+ /* @conditional-compile-remove(vertical-gallery) */ isShort,
10009
10058
  horizontalGalleryStyles,
10010
10059
  /* @conditional-compile-remove(vertical-gallery) */ overflowGalleryLayout,
10011
10060
  /* @conditional-compile-remove(vertical-gallery) */ veritcalGalleryStyles
10012
10061
  ]);
10013
10062
  /* @conditional-compile-remove(vertical-gallery) */
10014
10063
  if (overflowGalleryLayout === 'VerticalRight') {
10015
- return (React__default['default'].createElement(ResponsiveVerticalGallery, { key: "responsive-vertical-gallery", containerStyles: containerStyles, verticalGalleryStyles: galleryStyles, controlBarHeightRem: HORIZONTAL_GALLERY_BUTTON_WIDTH, gapHeightRem: HORIZONTAL_GALLERY_GAP }, overflowGalleryElements));
10064
+ return (React__default['default'].createElement(ResponsiveVerticalGallery, { key: "responsive-vertical-gallery", containerStyles: containerStyles, verticalGalleryStyles: galleryStyles, controlBarHeightRem: HORIZONTAL_GALLERY_BUTTON_WIDTH, gapHeightRem: HORIZONTAL_GALLERY_GAP, isShort: isShort }, overflowGalleryElements));
10016
10065
  }
10017
10066
  /* @conditional-compile-remove(pinned-participants) */
10018
10067
  if (isNarrow) {
@@ -10030,9 +10079,13 @@ const OverflowGallery = (props) => {
10030
10079
  */
10031
10080
  const DefaultLayout = (props) => {
10032
10081
  const { remoteParticipants = [], dominantSpeakers, localVideoComponent, screenShareComponent, onRenderRemoteParticipant, styles, maxRemoteVideoStreams, parentWidth,
10082
+ /* @conditional-compile-remove(vertical-gallery) */
10083
+ parentHeight,
10033
10084
  /* @conditional-compile-remove(pinned-participants) */ pinnedParticipantUserIds,
10034
10085
  /* @conditional-compile-remove(vertical-gallery) */ overflowGalleryLayout = 'HorizontalBottom' } = props;
10035
10086
  const isNarrow = parentWidth ? isNarrowWidth(parentWidth) : false;
10087
+ /* @conditional-compile-remove(vertical-gallery) */
10088
+ const isShort = parentHeight ? isShortHeight(parentHeight) : false;
10036
10089
  const { gridParticipants, horizontalGalleryParticipants } = useOrganizedParticipants({
10037
10090
  remoteParticipants,
10038
10091
  dominantSpeakers,
@@ -10060,13 +10113,16 @@ const DefaultLayout = (props) => {
10060
10113
  if (horizontalGalleryTiles.length === 0) {
10061
10114
  return null;
10062
10115
  }
10063
- return (React__default['default'].createElement(OverflowGallery, { isNarrow: isNarrow, shouldFloatLocalVideo: false, overflowGalleryElements: horizontalGalleryTiles, horizontalGalleryStyles: styles === null || styles === void 0 ? void 0 : styles.horizontalGallery,
10116
+ return (React__default['default'].createElement(OverflowGallery, { isNarrow: isNarrow,
10117
+ /* @conditional-compile-remove(vertical-gallery) */
10118
+ isShort: isShort, shouldFloatLocalVideo: false, overflowGalleryElements: horizontalGalleryTiles, horizontalGalleryStyles: styles === null || styles === void 0 ? void 0 : styles.horizontalGallery,
10064
10119
  /* @conditional-compile-remove(vertical-gallery) */
10065
10120
  veritcalGalleryStyles: styles === null || styles === void 0 ? void 0 : styles.verticalGallery,
10066
10121
  /* @conditional-compile-remove(pinned-participants) */
10067
10122
  overflowGalleryLayout: overflowGalleryLayout }));
10068
10123
  }, [
10069
10124
  isNarrow,
10125
+ /* @conditional-compile-remove(vertical-gallery) */ isShort,
10070
10126
  horizontalGalleryTiles,
10071
10127
  styles === null || styles === void 0 ? void 0 : styles.horizontalGallery,
10072
10128
  /* @conditional-compile-remove(vertical-gallery) */ overflowGalleryLayout,
@@ -10827,6 +10883,8 @@ const FloatingLocalVideoLayout = (props) => {
10827
10883
  /* @conditional-compile-remove(vertical-gallery) */ overflowGalleryLayout = 'HorizontalBottom' } = props;
10828
10884
  const theme = useTheme();
10829
10885
  const isNarrow = parentWidth ? isNarrowWidth(parentWidth) : false;
10886
+ /* @conditional-compile-remove(vertical-gallery) */
10887
+ const isShort = parentHeight ? isShortHeight(parentHeight) : false;
10830
10888
  const { gridParticipants, horizontalGalleryParticipants } = useOrganizedParticipants({
10831
10889
  remoteParticipants,
10832
10890
  dominantSpeakers,
@@ -10858,12 +10916,17 @@ const FloatingLocalVideoLayout = (props) => {
10858
10916
  }
10859
10917
  /* @conditional-compile-remove(vertical-gallery) */
10860
10918
  if (horizontalGalleryTiles.length > 0 && overflowGalleryLayout === 'VerticalRight') {
10861
- return isNarrow ? SMALL_FLOATING_MODAL_SIZE_PX : VERTICAL_GALLERY_FLOATING_MODAL_SIZE_PX;
10919
+ return isNarrow
10920
+ ? SMALL_FLOATING_MODAL_SIZE_PX
10921
+ : isShort
10922
+ ? SHORT_VERTICAL_GALLERY_FLOATING_MODAL_SIZE_PX
10923
+ : VERTICAL_GALLERY_FLOATING_MODAL_SIZE_PX;
10862
10924
  }
10863
10925
  return LARGE_FLOATING_MODAL_SIZE_PX;
10864
10926
  }, [
10865
10927
  horizontalGalleryTiles.length,
10866
10928
  isNarrow,
10929
+ /* @conditional-compile-remove(vertical-gallery) */ isShort,
10867
10930
  /* @conditional-compile-remove(vertical-gallery) */ overflowGalleryLayout
10868
10931
  ]);
10869
10932
  const wrappedLocalVideoComponent = localVideoComponent && shouldFloatLocalVideo ? (
@@ -10876,13 +10939,18 @@ const FloatingLocalVideoLayout = (props) => {
10876
10939
  if (horizontalGalleryTiles.length === 0) {
10877
10940
  return null;
10878
10941
  }
10879
- return (React__default['default'].createElement(OverflowGallery, { isNarrow: isNarrow, shouldFloatLocalVideo: true, overflowGalleryElements: horizontalGalleryTiles, horizontalGalleryStyles: styles === null || styles === void 0 ? void 0 : styles.horizontalGallery,
10942
+ return (React__default['default'].createElement(OverflowGallery
10943
+ /* @conditional-compile-remove(vertical-gallery) */
10944
+ , {
10945
+ /* @conditional-compile-remove(vertical-gallery) */
10946
+ isShort: isShort, isNarrow: isNarrow, shouldFloatLocalVideo: true, overflowGalleryElements: horizontalGalleryTiles, horizontalGalleryStyles: styles === null || styles === void 0 ? void 0 : styles.horizontalGallery,
10880
10947
  /* @conditional-compile-remove(vertical-gallery) */
10881
10948
  veritcalGalleryStyles: styles === null || styles === void 0 ? void 0 : styles.verticalGallery,
10882
10949
  /* @conditional-compile-remove(vertical-gallery) */
10883
10950
  overflowGalleryLayout: overflowGalleryLayout }));
10884
10951
  }, [
10885
10952
  isNarrow,
10953
+ /* @conditional-compile-remove(vertical-gallery) */ isShort,
10886
10954
  horizontalGalleryTiles,
10887
10955
  styles === null || styles === void 0 ? void 0 : styles.horizontalGallery,
10888
10956
  /* @conditional-compile-remove(vertical-gallery) */ overflowGalleryLayout,