@azure/communication-react 1.5.1-alpha-202303230013 → 1.5.1-alpha-202303240013
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.
- package/dist/communication-react.d.ts +2 -0
- package/dist/dist-cjs/communication-react/index.js +108 -99
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/HorizontalGallery.js +7 -2
- package/dist/dist-esm/react-components/src/components/HorizontalGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ResponsiveHorizontalGallery.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/ResponsiveHorizontalGallery.js +1 -2
- package/dist/dist-esm/react-components/src/components/ResponsiveHorizontalGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js +11 -7
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +10 -10
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js +2 -2
- package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.d.ts +9 -9
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js +15 -15
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.js +2 -2
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.d.ts +4 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.js +8 -7
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.js +4 -7
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/OverflowGalleryUtils.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/OverflowGalleryUtils.js +5 -4
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/OverflowGalleryUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/HorizontalGallery.styles.js +1 -0
- package/dist/dist-esm/react-components/src/components/styles/HorizontalGallery.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.d.ts +2 -0
- package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js +1 -0
- package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js.map +1 -1
- package/package.json +8 -8
@@ -5743,6 +5743,8 @@ export declare interface _Identifiers {
|
|
5743
5743
|
overflowGalleryLeftNavButton: string;
|
5744
5744
|
/** `data-ui-id` value for overflow gallery component's right navigation button */
|
5745
5745
|
overflowGalleryRightNavButton: string;
|
5746
|
+
/** `data-ui-id` value for the video tiles in the horizontal gallery */
|
5747
|
+
horizontalGalleryVideoTile: string;
|
5746
5748
|
/** `data-ui-id` value for `VerticalGallery` Component's children video tiles */
|
5747
5749
|
verticalGalleryVideoTile: string;
|
5748
5750
|
/** `data-ui-id` value for `VerticalGallery` Component's page counter */
|
@@ -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-
|
165
|
+
var telemetryVersion = '1.5.1-alpha-202303240013';
|
166
166
|
|
167
167
|
// Copyright (c) Microsoft Corporation.
|
168
168
|
/**
|
@@ -4326,6 +4326,7 @@ const defaultIdentifiers = {
|
|
4326
4326
|
overflowGalleryRightNavButton: 'overflow-gallery-right-nav-button',
|
4327
4327
|
/* @conditional-compile-remove(vertical-gallery) */
|
4328
4328
|
verticalGalleryVideoTile: 'vertical-gallery-video-tile',
|
4329
|
+
horizontalGalleryVideoTile: 'horizontal-gallery-video-tile',
|
4329
4330
|
/* @conditional-compile-remove(vertical-gallery) */
|
4330
4331
|
verticalGalleryPageCounter: 'vertical-gallery-page-counter'
|
4331
4332
|
};
|
@@ -9408,6 +9409,7 @@ const rootStyle$1 = {
|
|
9408
9409
|
*/
|
9409
9410
|
const childrenContainerStyle$1 = {
|
9410
9411
|
height: '100%',
|
9412
|
+
width: '100%',
|
9411
9413
|
gap: `${HORIZONTAL_GALLERY_GAP}rem`
|
9412
9414
|
};
|
9413
9415
|
|
@@ -9444,7 +9446,7 @@ const DEFAULT_CHILDREN_PER_PAGE = 5;
|
|
9444
9446
|
* @returns
|
9445
9447
|
*/
|
9446
9448
|
const HorizontalGallery = (props) => {
|
9447
|
-
var _a
|
9449
|
+
var _a;
|
9448
9450
|
const { children, childrenPerPage = DEFAULT_CHILDREN_PER_PAGE, styles, onFetchTilesToRender } = props;
|
9449
9451
|
const ids = useIdentifiers();
|
9450
9452
|
const [page, setPage] = React.useState(0);
|
@@ -9468,13 +9470,18 @@ const HorizontalGallery = (props) => {
|
|
9468
9470
|
const showButtons = numberOfChildren > childrenPerPage;
|
9469
9471
|
const disablePreviousButton = page === 0;
|
9470
9472
|
const disableNextButton = page === lastPage;
|
9473
|
+
const childrenStyles = React.useMemo(() => {
|
9474
|
+
return { root: styles === null || styles === void 0 ? void 0 : styles.children };
|
9475
|
+
}, [styles === null || styles === void 0 ? void 0 : styles.children]);
|
9471
9476
|
// If children per page is 0 or less return empty element
|
9472
9477
|
if (childrenPerPage <= 0) {
|
9473
9478
|
return React__default['default'].createElement(React__default['default'].Fragment, null);
|
9474
9479
|
}
|
9475
9480
|
return (React__default['default'].createElement(react.Stack, { horizontal: true, className: react.mergeStyles(rootStyle$1, (_a = props.styles) === null || _a === void 0 ? void 0 : _a.root) },
|
9476
9481
|
showButtons && (React__default['default'].createElement(HorizontalGalleryNavigationButton, { key: "previous-nav-button", icon: React__default['default'].createElement(react.Icon, { iconName: "HorizontalGalleryLeftButton" }), styles: styles === null || styles === void 0 ? void 0 : styles.previousButton, onClick: () => setPage(Math.max(0, Math.min(lastPage, page - 1))), disabled: disablePreviousButton, identifier: ids.overflowGalleryLeftNavButton })),
|
9477
|
-
React__default['default'].createElement(react.Stack, { horizontal: true, className: react.mergeStyles(childrenContainerStyle$1
|
9482
|
+
React__default['default'].createElement(react.Stack, { horizontal: true, className: react.mergeStyles(childrenContainerStyle$1) }, childrenOnCurrentPage.map((child, i) => {
|
9483
|
+
return (React__default['default'].createElement(react.Stack.Item, { styles: childrenStyles, key: i, "data-ui-id": ids.horizontalGalleryVideoTile }, child));
|
9484
|
+
})),
|
9478
9485
|
showButtons && (React__default['default'].createElement(HorizontalGalleryNavigationButton, { key: "next-nav-button", icon: React__default['default'].createElement(react.Icon, { iconName: "HorizontalGalleryRightButton" }), styles: styles === null || styles === void 0 ? void 0 : styles.nextButton, onClick: () => setPage(Math.min(lastPage, page + 1)), disabled: disableNextButton, identifier: ids.overflowGalleryRightNavButton }))));
|
9479
9486
|
};
|
9480
9487
|
const HorizontalGalleryNavigationButton = (props) => {
|
@@ -9490,22 +9497,22 @@ react.mergeStyles({ position: 'relative', width: '100%', height: '100%' });
|
|
9490
9497
|
/**
|
9491
9498
|
* Small floating modal width and height in rem for small screen
|
9492
9499
|
*/
|
9493
|
-
const
|
9500
|
+
const SMALL_FLOATING_MODAL_SIZE_REM = { width: 3.625, height: 6.5 };
|
9494
9501
|
/**
|
9495
9502
|
* Large floating modal width and height in rem for large screen
|
9496
9503
|
* Aspect ratio: 16:9
|
9497
9504
|
*/
|
9498
|
-
const
|
9505
|
+
const LARGE_FLOATING_MODAL_SIZE_REM = { width: 13.438, height: 7.5 };
|
9499
9506
|
/**
|
9500
9507
|
* Vertical gallery floating modal width and height in rem
|
9501
9508
|
* Aspect ratio: 16:9
|
9502
9509
|
*/
|
9503
|
-
const
|
9510
|
+
const SHORT_VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM = { width: 9, height: 5.063 };
|
9504
9511
|
/**
|
9505
9512
|
* Vertical gallery floating modal width and height in rem
|
9506
9513
|
* Aspect ratio: 16:9
|
9507
9514
|
*/
|
9508
|
-
const
|
9515
|
+
const VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM = { width: 11, height: 6.25 };
|
9509
9516
|
/**
|
9510
9517
|
* @private
|
9511
9518
|
* z-index to ensure that the local video tile is above the video gallery.
|
@@ -9514,31 +9521,31 @@ const LOCAL_VIDEO_TILE_ZINDEX = 2;
|
|
9514
9521
|
/**
|
9515
9522
|
* @private
|
9516
9523
|
*/
|
9517
|
-
const localVideoTileContainerStyle = (theme,
|
9524
|
+
const localVideoTileContainerStyle = (theme, localVideoTileSizeRem) => {
|
9518
9525
|
return {
|
9519
|
-
minWidth:
|
9520
|
-
minHeight:
|
9526
|
+
minWidth: `${localVideoTileSizeRem.width}rem`,
|
9527
|
+
minHeight: `${localVideoTileSizeRem.height}rem`,
|
9521
9528
|
position: 'absolute',
|
9522
|
-
bottom:
|
9529
|
+
bottom: `${localVideoTileOuterPaddingRem}rem`,
|
9523
9530
|
borderRadius: theme.effects.roundedCorner4,
|
9524
9531
|
overflow: 'hidden',
|
9525
|
-
right:
|
9532
|
+
right: `${localVideoTileOuterPaddingRem}rem`
|
9526
9533
|
};
|
9527
9534
|
};
|
9528
9535
|
/**
|
9529
9536
|
* @private
|
9530
9537
|
*/
|
9531
|
-
const localVideoTileWithControlsContainerStyle = (theme,
|
9532
|
-
return react.concatStyleSets(localVideoTileContainerStyle(theme,
|
9538
|
+
const localVideoTileWithControlsContainerStyle = (theme, localVideoTileSizeRem) => {
|
9539
|
+
return react.concatStyleSets(localVideoTileContainerStyle(theme, localVideoTileSizeRem), {
|
9533
9540
|
root: { boxShadow: theme.effects.elevation8 }
|
9534
9541
|
});
|
9535
9542
|
};
|
9536
9543
|
/**
|
9537
9544
|
* @private
|
9538
9545
|
*/
|
9539
|
-
const floatingLocalVideoModalStyle = (theme,
|
9546
|
+
const floatingLocalVideoModalStyle = (theme, modalSizeRem) => {
|
9540
9547
|
return react.concatStyleSets({
|
9541
|
-
main: localVideoTileContainerStyle(theme,
|
9548
|
+
main: localVideoTileContainerStyle(theme, modalSizeRem)
|
9542
9549
|
}, {
|
9543
9550
|
main: {
|
9544
9551
|
boxShadow: theme.effects.elevation8,
|
@@ -9551,10 +9558,10 @@ const floatingLocalVideoModalStyle = (theme, modalSize) => {
|
|
9551
9558
|
};
|
9552
9559
|
/**
|
9553
9560
|
* Padding equal to the amount the modal should stay inside the bounds of the container.
|
9554
|
-
* i.e. if this is
|
9561
|
+
* i.e. if this is 0.5rem, the modal should always be at least 0.5rem inside the container at all times on all sides.
|
9555
9562
|
* @private
|
9556
9563
|
*/
|
9557
|
-
const
|
9564
|
+
const localVideoTileOuterPaddingRem = 0.5;
|
9558
9565
|
/**
|
9559
9566
|
* @private
|
9560
9567
|
*/
|
@@ -9576,6 +9583,62 @@ const localVideoModalStyles = {
|
|
9576
9583
|
}
|
9577
9584
|
};
|
9578
9585
|
|
9586
|
+
// Copyright (c) Microsoft Corporation.
|
9587
|
+
/**
|
9588
|
+
* @private
|
9589
|
+
*/
|
9590
|
+
const horizontalGalleryContainerStyle = (shouldFloatLocalVideo, isNarrow) => {
|
9591
|
+
return {
|
9592
|
+
minHeight: isNarrow
|
9593
|
+
? `${SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM.height}rem`
|
9594
|
+
: `${LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM.height}rem`,
|
9595
|
+
width: shouldFloatLocalVideo
|
9596
|
+
? isNarrow
|
9597
|
+
? `calc(100% - ${SMALL_FLOATING_MODAL_SIZE_REM.width}rem)`
|
9598
|
+
: `calc(100% - ${LARGE_FLOATING_MODAL_SIZE_REM.width}rem)`
|
9599
|
+
: '100%',
|
9600
|
+
paddingRight: '0.5rem'
|
9601
|
+
};
|
9602
|
+
};
|
9603
|
+
/**
|
9604
|
+
* @private
|
9605
|
+
*/
|
9606
|
+
const horizontalGalleryStyle = (isNarrow) => {
|
9607
|
+
return {
|
9608
|
+
children: isNarrow ? SMALL_HORIZONTAL_GALLERY_TILE_STYLE : LARGE_HORIZONTAL_GALLERY_TILE_STYLE
|
9609
|
+
};
|
9610
|
+
};
|
9611
|
+
/**
|
9612
|
+
* Small horizontal gallery tile size in rem
|
9613
|
+
* @private
|
9614
|
+
*/
|
9615
|
+
const SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM = { height: 6.5, width: 6.5 };
|
9616
|
+
/**
|
9617
|
+
* Large horizontal gallery tile size in rem
|
9618
|
+
* @private
|
9619
|
+
*/
|
9620
|
+
const LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM = { height: 7.5, minWidth: 7.5, maxWidth: 13.43 };
|
9621
|
+
/**
|
9622
|
+
* @private
|
9623
|
+
*/
|
9624
|
+
const SMALL_HORIZONTAL_GALLERY_TILE_STYLE = {
|
9625
|
+
minHeight: `${SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM.height}rem`,
|
9626
|
+
minWidth: `${SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM.width}rem`,
|
9627
|
+
maxHeight: `${SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM.height}rem`,
|
9628
|
+
maxWidth: `${SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM.width}rem`
|
9629
|
+
};
|
9630
|
+
/**
|
9631
|
+
* @private
|
9632
|
+
*/
|
9633
|
+
const LARGE_HORIZONTAL_GALLERY_TILE_STYLE = {
|
9634
|
+
minHeight: `${LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM.height}rem`,
|
9635
|
+
minWidth: `${LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM.minWidth}rem`,
|
9636
|
+
maxHeight: `${LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM.height}rem`,
|
9637
|
+
maxWidth: `${LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM.maxWidth}rem`,
|
9638
|
+
width: '100%',
|
9639
|
+
height: '100%'
|
9640
|
+
};
|
9641
|
+
|
9579
9642
|
// Copyright (c) Microsoft Corporation.
|
9580
9643
|
/**
|
9581
9644
|
* VerticalGallery tile size in rem:
|
@@ -9609,22 +9672,20 @@ const verticalGalleryContainerStyle = (shouldFloatLocalVideo, isNarrow, isShort)
|
|
9609
9672
|
return isNarrow && isShort
|
9610
9673
|
? {
|
9611
9674
|
width: `${SHORT_VERTICAL_GALLERY_TILE_SIZE_REM.width + 1.5}rem`,
|
9612
|
-
height: shouldFloatLocalVideo ? `calc(100% - ${
|
9675
|
+
height: shouldFloatLocalVideo ? `calc(100% - ${SMALL_FLOATING_MODAL_SIZE_REM.height}rem)` : '100%',
|
9613
9676
|
paddingBottom: '0.5rem'
|
9614
9677
|
}
|
9615
9678
|
: !isNarrow && isShort
|
9616
9679
|
? {
|
9617
9680
|
width: `${SHORT_VERTICAL_GALLERY_TILE_SIZE_REM.width + 1.5}rem`,
|
9618
9681
|
height: shouldFloatLocalVideo
|
9619
|
-
? `calc(100% - ${
|
9682
|
+
? `calc(100% - ${SHORT_VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM.height}rem)`
|
9620
9683
|
: '100%',
|
9621
9684
|
paddingBottom: '0.5rem'
|
9622
9685
|
}
|
9623
9686
|
: {
|
9624
9687
|
width: `${VERTICAL_GALLERY_TILE_SIZE_REM.width + 1.5}rem`,
|
9625
|
-
height: shouldFloatLocalVideo
|
9626
|
-
? `calc(100% - ${_pxToRem(VERTICAL_GALLERY_FLOATING_MODAL_SIZE_PX.height)})`
|
9627
|
-
: '100%',
|
9688
|
+
height: shouldFloatLocalVideo ? `calc(100% - ${VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM.height}rem)` : '100%',
|
9628
9689
|
paddingBottom: '0.5rem'
|
9629
9690
|
};
|
9630
9691
|
};
|
@@ -9665,8 +9726,8 @@ const verticalGalleryStyle = (isShort) => {
|
|
9665
9726
|
* @private
|
9666
9727
|
*/
|
9667
9728
|
const calculateHorizontalChildrenPerPage = (args) => {
|
9668
|
-
const { numberOfChildren, containerWidth, buttonWidthRem,
|
9669
|
-
const
|
9729
|
+
const { numberOfChildren, containerWidth, buttonWidthRem, gapWidthRem } = args;
|
9730
|
+
const childMinWidth = _convertRemToPx(LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM.minWidth);
|
9670
9731
|
const gapWidth = _convertRemToPx(gapWidthRem);
|
9671
9732
|
/** First check how many children can fit in containerWidth.
|
9672
9733
|
* __________________________________
|
@@ -9676,7 +9737,7 @@ const calculateHorizontalChildrenPerPage = (args) => {
|
|
9676
9737
|
* <-----------containerWidth--------->
|
9677
9738
|
* containerWidth = n * childWidth + (n - 1) * gapWidth. Isolate n and take the floor.
|
9678
9739
|
*/
|
9679
|
-
const numberOfChildrenInContainer = Math.floor((containerWidth + gapWidth) / (
|
9740
|
+
const numberOfChildrenInContainer = Math.floor((containerWidth + gapWidth) / (childMinWidth + gapWidth));
|
9680
9741
|
// If all children fit then return numberOfChildrenInContainer
|
9681
9742
|
if (numberOfChildren <= numberOfChildrenInContainer) {
|
9682
9743
|
return numberOfChildrenInContainer;
|
@@ -9694,7 +9755,7 @@ const calculateHorizontalChildrenPerPage = (args) => {
|
|
9694
9755
|
const childrenSpace = containerWidth - 2 * buttonWidth - 2 * gapWidth;
|
9695
9756
|
// Now that we have childrenSpace width we can figure out how many children can fit in childrenSpace.
|
9696
9757
|
// childrenSpace = n * childWidth + (n - 1) * gapWidth. Isolate n and take the floor.
|
9697
|
-
return Math.max(Math.floor((childrenSpace + gapWidth) / (
|
9758
|
+
return Math.max(Math.floor((childrenSpace + gapWidth) / (childMinWidth + gapWidth)), 1);
|
9698
9759
|
};
|
9699
9760
|
/**
|
9700
9761
|
* Helper function to find the number of children for the VerticalGallery on each page.
|
@@ -9753,7 +9814,7 @@ const calculateVerticalChildrenPerPage = (args) => {
|
|
9753
9814
|
* available width obtained from a ResizeObserver, width per child, gap width, and button width
|
9754
9815
|
*/
|
9755
9816
|
const ResponsiveHorizontalGallery = (props) => {
|
9756
|
-
const {
|
9817
|
+
const { gapWidthRem, buttonWidthRem = 0, onFetchTilesToRender } = props;
|
9757
9818
|
const containerRef = React.useRef(null);
|
9758
9819
|
const containerWidth = _useContainerWidth(containerRef);
|
9759
9820
|
const leftPadding = containerRef.current ? parseFloat(getComputedStyle(containerRef.current).paddingLeft) : 0;
|
@@ -9761,7 +9822,6 @@ const ResponsiveHorizontalGallery = (props) => {
|
|
9761
9822
|
const childrenPerPage = calculateHorizontalChildrenPerPage({
|
9762
9823
|
numberOfChildren: React__default['default'].Children.count(props.children),
|
9763
9824
|
containerWidth: (containerWidth !== null && containerWidth !== void 0 ? containerWidth : 0) - leftPadding - rightPadding,
|
9764
|
-
childWidthRem,
|
9765
9825
|
gapWidthRem,
|
9766
9826
|
buttonWidthRem
|
9767
9827
|
});
|
@@ -9963,60 +10023,6 @@ const ResponsiveVerticalGallery = (props) => {
|
|
9963
10023
|
React__default['default'].createElement(VerticalGallery, { childrenPerPage: childrenPerPage, styles: verticalGalleryStyles, onFetchTilesToRender: onFetchTilesToRender }, children)));
|
9964
10024
|
};
|
9965
10025
|
|
9966
|
-
// Copyright (c) Microsoft Corporation.
|
9967
|
-
/**
|
9968
|
-
* @private
|
9969
|
-
*/
|
9970
|
-
const horizontalGalleryContainerStyle = (shouldFloatLocalVideo, isNarrow) => {
|
9971
|
-
return {
|
9972
|
-
minHeight: isNarrow
|
9973
|
-
? `${SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM.height}rem`
|
9974
|
-
: `${LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM.height}rem`,
|
9975
|
-
width: shouldFloatLocalVideo
|
9976
|
-
? isNarrow
|
9977
|
-
? `calc(100% - ${_pxToRem(SMALL_FLOATING_MODAL_SIZE_PX.width)})`
|
9978
|
-
: `calc(100% - ${_pxToRem(LARGE_FLOATING_MODAL_SIZE_PX.width)})`
|
9979
|
-
: '100%',
|
9980
|
-
paddingRight: '0.5rem'
|
9981
|
-
};
|
9982
|
-
};
|
9983
|
-
/**
|
9984
|
-
* @private
|
9985
|
-
*/
|
9986
|
-
const horizontalGalleryStyle = (isNarrow) => {
|
9987
|
-
return {
|
9988
|
-
children: isNarrow ? SMALL_HORIZONTAL_GALLERY_TILE_STYLE : LARGE_HORIZONTAL_GALLERY_TILE_STYLE
|
9989
|
-
};
|
9990
|
-
};
|
9991
|
-
/**
|
9992
|
-
* Small horizontal gallery tile size in rem
|
9993
|
-
* @private
|
9994
|
-
*/
|
9995
|
-
const SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM = { height: 6.5, width: 6.5 };
|
9996
|
-
/**
|
9997
|
-
* Large horizontal gallery tile size in rem
|
9998
|
-
* @private
|
9999
|
-
*/
|
10000
|
-
const LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM = { height: 7.5, width: 10 };
|
10001
|
-
/**
|
10002
|
-
* @private
|
10003
|
-
*/
|
10004
|
-
const SMALL_HORIZONTAL_GALLERY_TILE_STYLE = {
|
10005
|
-
minHeight: `${SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM.height}rem`,
|
10006
|
-
minWidth: `${SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM.width}rem`,
|
10007
|
-
maxHeight: `${SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM.height}rem`,
|
10008
|
-
maxWidth: `${SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM.width}rem`
|
10009
|
-
};
|
10010
|
-
/**
|
10011
|
-
* @private
|
10012
|
-
*/
|
10013
|
-
const LARGE_HORIZONTAL_GALLERY_TILE_STYLE = {
|
10014
|
-
minHeight: `${LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM.height}rem`,
|
10015
|
-
minWidth: `${LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM.width}rem`,
|
10016
|
-
maxHeight: `${LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM.height}rem`,
|
10017
|
-
maxWidth: `${LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM.width}rem`
|
10018
|
-
};
|
10019
|
-
|
10020
10026
|
// Copyright (c) Microsoft Corporation.
|
10021
10027
|
/**
|
10022
10028
|
* @private
|
@@ -10034,7 +10040,7 @@ const scrollableHorizontalGalleryStyles = {
|
|
10034
10040
|
*/
|
10035
10041
|
const scrollableHorizontalGalleryContainerStyles = react.mergeStyles({
|
10036
10042
|
display: 'flex',
|
10037
|
-
width: `calc(100% - ${
|
10043
|
+
width: `calc(100% - ${SMALL_FLOATING_MODAL_SIZE_REM.width}rem)`,
|
10038
10044
|
minHeight: `${SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM.height}rem`,
|
10039
10045
|
overflow: 'scroll',
|
10040
10046
|
'-ms-overflow-style': 'none',
|
@@ -10106,7 +10112,7 @@ const OverflowGallery = (props) => {
|
|
10106
10112
|
if (isNarrow) {
|
10107
10113
|
return (React__default['default'].createElement(ScrollableHorizontalGallery, { horizontalGalleryElements: overflowGalleryElements, onFetchTilesToRender: onFetchTilesToRender, key: "scrollable-horizontal-gallery" }));
|
10108
10114
|
}
|
10109
|
-
return (React__default['default'].createElement(ResponsiveHorizontalGallery, { key: "responsive-horizontal-gallery", containerStyles: containerStyles, onFetchTilesToRender: onFetchTilesToRender, horizontalGalleryStyles: galleryStyles,
|
10115
|
+
return (React__default['default'].createElement(ResponsiveHorizontalGallery, { key: "responsive-horizontal-gallery", containerStyles: containerStyles, onFetchTilesToRender: onFetchTilesToRender, horizontalGalleryStyles: galleryStyles, buttonWidthRem: HORIZONTAL_GALLERY_BUTTON_WIDTH, gapWidthRem: HORIZONTAL_GALLERY_GAP }, overflowGalleryElements));
|
10110
10116
|
};
|
10111
10117
|
|
10112
10118
|
// Copyright (c) Microsoft Corporation.
|
@@ -10870,12 +10876,15 @@ const DRAG_OPTIONS$1 = {
|
|
10870
10876
|
// This is a workaround for: https://github.com/microsoft/fluentui/issues/20122
|
10871
10877
|
// Because our modal starts in the bottom right corner, we can say that this is the max (i.e. rightmost and bottomost)
|
10872
10878
|
// position the modal can be dragged to.
|
10873
|
-
const modalMaxDragPosition = {
|
10879
|
+
const modalMaxDragPosition = {
|
10880
|
+
x: _convertRemToPx(localVideoTileOuterPaddingRem),
|
10881
|
+
y: _convertRemToPx(localVideoTileOuterPaddingRem)
|
10882
|
+
};
|
10874
10883
|
/**
|
10875
10884
|
* @private
|
10876
10885
|
*/
|
10877
10886
|
const FloatingLocalVideo = (props) => {
|
10878
|
-
const { localVideoComponent, layerHostId,
|
10887
|
+
const { localVideoComponent, layerHostId, localVideoSizeRem, parentWidth, parentHeight } = props;
|
10879
10888
|
const theme = useTheme();
|
10880
10889
|
// The minimum drag position is the top left of the video gallery. i.e. the modal (PiP) should not be able
|
10881
10890
|
// to be dragged offscreen and these are the top and left bounds of that calculation.
|
@@ -10883,11 +10892,11 @@ const FloatingLocalVideo = (props) => {
|
|
10883
10892
|
? {
|
10884
10893
|
// We use -parentWidth/Height because our modal is positioned to start in the bottom right,
|
10885
10894
|
// hence (0,0) is the bottom right of the video gallery.
|
10886
|
-
x: -parentWidth +
|
10887
|
-
y: -parentHeight +
|
10895
|
+
x: -parentWidth + _convertRemToPx(localVideoSizeRem.width) + _convertRemToPx(localVideoTileOuterPaddingRem),
|
10896
|
+
y: -parentHeight + _convertRemToPx(localVideoSizeRem.height) + _convertRemToPx(localVideoTileOuterPaddingRem)
|
10888
10897
|
}
|
10889
|
-
: undefined, [parentHeight, parentWidth,
|
10890
|
-
const modalStyles = React.useMemo(() => floatingLocalVideoModalStyle(theme,
|
10898
|
+
: undefined, [parentHeight, parentWidth, localVideoSizeRem.width, localVideoSizeRem.height]);
|
10899
|
+
const modalStyles = React.useMemo(() => floatingLocalVideoModalStyle(theme, localVideoSizeRem), [theme, localVideoSizeRem]);
|
10891
10900
|
const layerProps = React.useMemo(() => ({ hostId: layerHostId }), [layerHostId]);
|
10892
10901
|
return (React__default['default'].createElement(_ModalClone, { isOpen: true, isModeless: true, dragOptions: DRAG_OPTIONS$1, styles: modalStyles, layerProps: layerProps, maxDragPosition: modalMaxDragPosition, minDragPosition: modalMinDragPosition }, localVideoComponent));
|
10893
10902
|
};
|
@@ -10970,19 +10979,19 @@ const FloatingLocalVideoLayout = (props) => {
|
|
10970
10979
|
: (_b = p.videoStream) === null || _b === void 0 ? void 0 : _b.isAvailable);
|
10971
10980
|
});
|
10972
10981
|
const layerHostId = reactHooks.useId('layerhost');
|
10973
|
-
const
|
10982
|
+
const localVideoSizeRem = React.useMemo(() => {
|
10974
10983
|
if (isNarrow) {
|
10975
|
-
return
|
10984
|
+
return SMALL_FLOATING_MODAL_SIZE_REM;
|
10976
10985
|
}
|
10977
10986
|
/* @conditional-compile-remove(vertical-gallery) */
|
10978
10987
|
if ((horizontalGalleryTiles.length > 0 || !!screenShareComponent) && overflowGalleryLayout === 'VerticalRight') {
|
10979
10988
|
return isNarrow
|
10980
|
-
?
|
10989
|
+
? SMALL_FLOATING_MODAL_SIZE_REM
|
10981
10990
|
: isShort
|
10982
|
-
?
|
10983
|
-
:
|
10991
|
+
? SHORT_VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM
|
10992
|
+
: VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM;
|
10984
10993
|
}
|
10985
|
-
return
|
10994
|
+
return LARGE_FLOATING_MODAL_SIZE_REM;
|
10986
10995
|
}, [
|
10987
10996
|
horizontalGalleryTiles.length,
|
10988
10997
|
isNarrow,
|
@@ -10992,10 +11001,10 @@ const FloatingLocalVideoLayout = (props) => {
|
|
10992
11001
|
]);
|
10993
11002
|
const wrappedLocalVideoComponent = localVideoComponent && shouldFloatLocalVideo ? (
|
10994
11003
|
// When we use showCameraSwitcherInLocalPreview it disables dragging to allow keyboard navigation.
|
10995
|
-
showCameraSwitcherInLocalPreview ? (React__default['default'].createElement(react.Stack, { className: react.mergeStyles(localVideoTileWithControlsContainerStyle(theme,
|
11004
|
+
showCameraSwitcherInLocalPreview ? (React__default['default'].createElement(react.Stack, { className: react.mergeStyles(localVideoTileWithControlsContainerStyle(theme, localVideoSizeRem), {
|
10996
11005
|
boxShadow: theme.effects.elevation8,
|
10997
11006
|
zIndex: LOCAL_VIDEO_TILE_ZINDEX
|
10998
|
-
}) }, localVideoComponent)) : horizontalGalleryTiles.length > 0 || !!screenShareComponent ? (React__default['default'].createElement(react.Stack, { className: react.mergeStyles(localVideoTileContainerStyle(theme,
|
11007
|
+
}) }, localVideoComponent)) : horizontalGalleryTiles.length > 0 || !!screenShareComponent ? (React__default['default'].createElement(react.Stack, { className: react.mergeStyles(localVideoTileContainerStyle(theme, localVideoSizeRem)) }, localVideoComponent)) : (React__default['default'].createElement(FloatingLocalVideo, { localVideoComponent: localVideoComponent, layerHostId: layerHostId, localVideoSizeRem: localVideoSizeRem, parentWidth: parentWidth, parentHeight: parentHeight }))) : undefined;
|
10999
11008
|
const overflowGallery = React.useMemo(() => {
|
11000
11009
|
if (horizontalGalleryTiles.length === 0 && !screenShareComponent) {
|
11001
11010
|
return null;
|