@azure/communication-react 1.4.3-alpha-202301150014.0 → 1.4.3-alpha-202301180013.0
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/dist-cjs/communication-react/index.js +35 -84
- 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/VideoGallery/DefaultLayout.js +8 -6
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +8 -6
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.d.ts +7 -16
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +20 -15
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery.js +1 -9
- package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
- package/package.json +8 -8
- package/dist/dist-esm/react-components/src/components/VideoGallery/PinnedParticipantsLayout.d.ts +0 -25
- package/dist/dist-esm/react-components/src/components/VideoGallery/PinnedParticipantsLayout.js +0 -65
- package/dist/dist-esm/react-components/src/components/VideoGallery/PinnedParticipantsLayout.js.map +0 -1
package/dist/dist-esm/react-components/src/components/VideoGallery/PinnedParticipantsLayout.d.ts
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import { FloatingLocalVideoLayoutProps } from './FloatingLocalVideoLayout';
|
3
|
-
/**
|
4
|
-
* Props for {@link PinnedParticipantsLayout}.
|
5
|
-
*
|
6
|
-
* @private
|
7
|
-
*/
|
8
|
-
export interface PinnedParticipantsLayoutProps extends FloatingLocalVideoLayoutProps {
|
9
|
-
/**
|
10
|
-
* List of pinned participant userIds
|
11
|
-
*/
|
12
|
-
pinnedParticipants?: string[];
|
13
|
-
/**
|
14
|
-
* Whether local video should be floating
|
15
|
-
*/
|
16
|
-
isLocalVideoFloating?: boolean;
|
17
|
-
}
|
18
|
-
/**
|
19
|
-
* PinnedParticipantsLayout displays remote participants and a screen sharing component in
|
20
|
-
* a grid and horizontal gallery while floating the local video
|
21
|
-
*
|
22
|
-
* @private
|
23
|
-
*/
|
24
|
-
export declare const PinnedParticipantsLayout: (props: PinnedParticipantsLayoutProps) => JSX.Element;
|
25
|
-
//# sourceMappingURL=PinnedParticipantsLayout.d.ts.map
|
package/dist/dist-esm/react-components/src/components/VideoGallery/PinnedParticipantsLayout.js
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
2
|
-
// Licensed under the MIT license.
|
3
|
-
import { LayerHost, mergeStyles, Stack } from '@fluentui/react';
|
4
|
-
import { useId } from '@fluentui/react-hooks';
|
5
|
-
import React from 'react';
|
6
|
-
import { useTheme } from '../../theming';
|
7
|
-
import { GridLayout } from '../GridLayout';
|
8
|
-
import { isNarrowWidth } from '../utils/responsive';
|
9
|
-
import { FloatingLocalVideo } from './FloatingLocalVideo';
|
10
|
-
import { ScrollableHorizontalGallery } from './ScrollableHorizontalGallery';
|
11
|
-
import { localVideoTileContainerStyle, localVideoTileWithControlsContainerStyle, LOCAL_VIDEO_TILE_ZINDEX } from './styles/FloatingLocalVideo.styles';
|
12
|
-
import { innerLayoutStyle, layerHostStyle, rootLayoutStyle } from './styles/FloatingLocalVideoLayout.styles';
|
13
|
-
import { videoGalleryLayoutGap } from './styles/Layout.styles';
|
14
|
-
import { usePinnedParticipantLayout } from './utils/videoGalleryLayoutUtils';
|
15
|
-
import { VideoGalleryResponsiveHorizontalGallery } from './VideoGalleryResponsiveHorizontalGallery';
|
16
|
-
/**
|
17
|
-
* PinnedParticipantsLayout displays remote participants and a screen sharing component in
|
18
|
-
* a grid and horizontal gallery while floating the local video
|
19
|
-
*
|
20
|
-
* @private
|
21
|
-
*/
|
22
|
-
export const PinnedParticipantsLayout = (props) => {
|
23
|
-
const { remoteParticipants = [], pinnedParticipants = [], dominantSpeakers, localVideoComponent, screenShareComponent, onRenderRemoteParticipant, styles, maxRemoteVideoStreams, showCameraSwitcherInLocalPreview, parentWidth, parentHeight, isLocalVideoFloating } = props;
|
24
|
-
const theme = useTheme();
|
25
|
-
const isNarrow = parentWidth ? isNarrowWidth(parentWidth) : false;
|
26
|
-
const pinnedParticipantsLayout = usePinnedParticipantLayout({
|
27
|
-
remoteParticipants,
|
28
|
-
pinnedParticipantUserIds: pinnedParticipants,
|
29
|
-
dominantSpeakers,
|
30
|
-
maxRemoteVideoStreams,
|
31
|
-
isScreenShareActive: !!screenShareComponent
|
32
|
-
});
|
33
|
-
let activeVideoStreams = 0;
|
34
|
-
const shouldFloatLocalVideo = isLocalVideoFloating && remoteParticipants.length > 0;
|
35
|
-
const gridTiles = pinnedParticipantsLayout.gridParticipants.map((p) => {
|
36
|
-
var _a, _b;
|
37
|
-
return onRenderRemoteParticipant(p, maxRemoteVideoStreams && maxRemoteVideoStreams >= 0
|
38
|
-
? ((_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable) && activeVideoStreams++ < maxRemoteVideoStreams
|
39
|
-
: (_b = p.videoStream) === null || _b === void 0 ? void 0 : _b.isAvailable);
|
40
|
-
});
|
41
|
-
if (localVideoComponent && !shouldFloatLocalVideo) {
|
42
|
-
gridTiles.push(localVideoComponent);
|
43
|
-
}
|
44
|
-
const horizontalGalleryTiles = pinnedParticipantsLayout.horizontalGalleryParticipants.map((p) => {
|
45
|
-
var _a, _b;
|
46
|
-
return onRenderRemoteParticipant(p, maxRemoteVideoStreams && maxRemoteVideoStreams >= 0
|
47
|
-
? ((_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable) && activeVideoStreams++ < maxRemoteVideoStreams
|
48
|
-
: (_b = p.videoStream) === null || _b === void 0 ? void 0 : _b.isAvailable);
|
49
|
-
});
|
50
|
-
const layerHostId = useId('layerhost');
|
51
|
-
const wrappedLocalVideoComponent = localVideoComponent && shouldFloatLocalVideo ? (
|
52
|
-
// When we use showCameraSwitcherInLocalPreview it disables dragging to allow keyboard navigation.
|
53
|
-
showCameraSwitcherInLocalPreview ? (React.createElement(Stack, { className: mergeStyles(localVideoTileWithControlsContainerStyle(theme, isNarrow), {
|
54
|
-
boxShadow: theme.effects.elevation8,
|
55
|
-
zIndex: LOCAL_VIDEO_TILE_ZINDEX
|
56
|
-
}) }, localVideoComponent)) : horizontalGalleryTiles.length > 0 ? (React.createElement(Stack, { className: mergeStyles(localVideoTileContainerStyle(theme, isNarrow)) }, localVideoComponent)) : (React.createElement(FloatingLocalVideo, { localVideoComponent: localVideoComponent, layerHostId: layerHostId, isNarrow: isNarrow, parentWidth: parentWidth, parentHeight: parentHeight }))) : undefined;
|
57
|
-
return (React.createElement(Stack, { styles: rootLayoutStyle },
|
58
|
-
React.createElement(Stack, { horizontal: false, styles: innerLayoutStyle, tokens: videoGalleryLayoutGap },
|
59
|
-
screenShareComponent ? (screenShareComponent) : (React.createElement(GridLayout, { key: "grid-layout", styles: styles === null || styles === void 0 ? void 0 : styles.gridLayout }, gridTiles)),
|
60
|
-
horizontalGalleryTiles.length > 0 &&
|
61
|
-
(isNarrow ? (React.createElement(ScrollableHorizontalGallery, { horizontalGalleryElements: horizontalGalleryTiles })) : (React.createElement(VideoGalleryResponsiveHorizontalGallery, { isNarrow: isNarrow, shouldFloatLocalVideo: true, horizontalGalleryElements: horizontalGalleryTiles, styles: styles === null || styles === void 0 ? void 0 : styles.horizontalGallery })))),
|
62
|
-
wrappedLocalVideoComponent,
|
63
|
-
React.createElement(LayerHost, { id: layerHostId, className: mergeStyles(layerHostStyle) })));
|
64
|
-
};
|
65
|
-
//# sourceMappingURL=PinnedParticipantsLayout.js.map
|
package/dist/dist-esm/react-components/src/components/VideoGallery/PinnedParticipantsLayout.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"PinnedParticipantsLayout.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/PinnedParticipantsLayout.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EACL,4BAA4B,EAC5B,wCAAwC,EACxC,uBAAuB,EACxB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC7G,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,uCAAuC,EAAE,MAAM,2CAA2C,CAAC;AAkBpG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAAoC,EAAe,EAAE;IAC5F,MAAM,EACJ,kBAAkB,GAAG,EAAE,EACvB,kBAAkB,GAAG,EAAE,EACvB,gBA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M,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,IACrD,SAAS,CACC,CACd;YACA,sBAAsB,CAAC,MAAM,GAAG,CAAC;gBAChC,CAAC,QAAQ,CAAC,CAAC,CAAC,CACV,oBAAC,2BAA2B,IAAC,yBAAyB,EAAE,sBAAsB,GAAI,CACnF,CAAC,CAAC,CAAC,CACF,oBAAC,uCAAuC,IACtC,QAAQ,EAAE,QAAQ,EAClB,qBAAqB,EAAE,IAAI,EAC3B,yBAAyB,EAAE,sBAAsB,EACjD,MAAM,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,iBAAiB,GACjC,CACH,CAAC,CACE;QACP,0BAA0B;QAC3B,oBAAC,SAAS,IAAC,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,cAAc,CAAC,GAAI,CAChE,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LayerHost, mergeStyles, Stack } from '@fluentui/react';\nimport { useId } from '@fluentui/react-hooks';\nimport React from 'react';\nimport { useTheme } from '../../theming';\nimport { GridLayout } from '../GridLayout';\nimport { isNarrowWidth } from '../utils/responsive';\nimport { FloatingLocalVideo } from './FloatingLocalVideo';\nimport { FloatingLocalVideoLayoutProps } from './FloatingLocalVideoLayout';\nimport { ScrollableHorizontalGallery } from './ScrollableHorizontalGallery';\nimport {\n localVideoTileContainerStyle,\n localVideoTileWithControlsContainerStyle,\n LOCAL_VIDEO_TILE_ZINDEX\n} from './styles/FloatingLocalVideo.styles';\nimport { innerLayoutStyle, layerHostStyle, rootLayoutStyle } from './styles/FloatingLocalVideoLayout.styles';\nimport { videoGalleryLayoutGap } from './styles/Layout.styles';\nimport { usePinnedParticipantLayout } from './utils/videoGalleryLayoutUtils';\nimport { VideoGalleryResponsiveHorizontalGallery } from './VideoGalleryResponsiveHorizontalGallery';\n\n/**\n * Props for {@link PinnedParticipantsLayout}.\n *\n * @private\n */\nexport interface PinnedParticipantsLayoutProps extends FloatingLocalVideoLayoutProps {\n /**\n * List of pinned participant userIds\n */\n pinnedParticipants?: string[];\n /**\n * Whether local video should be floating\n */\n isLocalVideoFloating?: boolean;\n}\n\n/**\n * PinnedParticipantsLayout displays remote participants and a screen sharing component in\n * a grid and horizontal gallery while floating the local video\n *\n * @private\n */\nexport const PinnedParticipantsLayout = (props: PinnedParticipantsLayoutProps): JSX.Element => {\n const {\n remoteParticipants = [],\n pinnedParticipants = [],\n dominantSpeakers,\n localVideoComponent,\n screenShareComponent,\n onRenderRemoteParticipant,\n styles,\n maxRemoteVideoStreams,\n showCameraSwitcherInLocalPreview,\n parentWidth,\n parentHeight,\n isLocalVideoFloating\n } = props;\n\n const theme = useTheme();\n\n const isNarrow = parentWidth ? isNarrowWidth(parentWidth) : false;\n\n const pinnedParticipantsLayout = usePinnedParticipantLayout({\n remoteParticipants,\n pinnedParticipantUserIds: pinnedParticipants,\n dominantSpeakers,\n maxRemoteVideoStreams,\n isScreenShareActive: !!screenShareComponent\n });\n\n let activeVideoStreams = 0;\n\n const shouldFloatLocalVideo = isLocalVideoFloating && remoteParticipants.length > 0;\n\n const gridTiles = pinnedParticipantsLayout.gridParticipants.map((p) => {\n return onRenderRemoteParticipant(\n p,\n maxRemoteVideoStreams && maxRemoteVideoStreams >= 0\n ? p.videoStream?.isAvailable && activeVideoStreams++ < maxRemoteVideoStreams\n : p.videoStream?.isAvailable\n );\n });\n\n if (localVideoComponent && !shouldFloatLocalVideo) {\n gridTiles.push(localVideoComponent);\n }\n\n const horizontalGalleryTiles = pinnedParticipantsLayout.horizontalGalleryParticipants.map((p) => {\n return onRenderRemoteParticipant(\n p,\n maxRemoteVideoStreams && maxRemoteVideoStreams >= 0\n ? p.videoStream?.isAvailable && activeVideoStreams++ < maxRemoteVideoStreams\n : p.videoStream?.isAvailable\n );\n });\n\n const layerHostId = useId('layerhost');\n\n const wrappedLocalVideoComponent =\n localVideoComponent && shouldFloatLocalVideo ? (\n // When we use showCameraSwitcherInLocalPreview it disables dragging to allow keyboard navigation.\n showCameraSwitcherInLocalPreview ? (\n <Stack\n className={mergeStyles(localVideoTileWithControlsContainerStyle(theme, isNarrow), {\n boxShadow: theme.effects.elevation8,\n zIndex: LOCAL_VIDEO_TILE_ZINDEX\n })}\n >\n {localVideoComponent}\n </Stack>\n ) : horizontalGalleryTiles.length > 0 ? (\n <Stack className={mergeStyles(localVideoTileContainerStyle(theme, isNarrow))}>{localVideoComponent}</Stack>\n ) : (\n <FloatingLocalVideo\n localVideoComponent={localVideoComponent}\n layerHostId={layerHostId}\n isNarrow={isNarrow}\n parentWidth={parentWidth}\n parentHeight={parentHeight}\n />\n )\n ) : undefined;\n\n return (\n <Stack styles={rootLayoutStyle}>\n <Stack horizontal={false} styles={innerLayoutStyle} tokens={videoGalleryLayoutGap}>\n {screenShareComponent ? (\n screenShareComponent\n ) : (\n <GridLayout key=\"grid-layout\" styles={styles?.gridLayout}>\n {gridTiles}\n </GridLayout>\n )}\n {horizontalGalleryTiles.length > 0 &&\n (isNarrow ? (\n <ScrollableHorizontalGallery horizontalGalleryElements={horizontalGalleryTiles} />\n ) : (\n <VideoGalleryResponsiveHorizontalGallery\n isNarrow={isNarrow}\n shouldFloatLocalVideo={true}\n horizontalGalleryElements={horizontalGalleryTiles}\n styles={styles?.horizontalGallery}\n />\n ))}\n </Stack>\n {wrappedLocalVideoComponent}\n <LayerHost id={layerHostId} className={mergeStyles(layerHostStyle)} />\n </Stack>\n );\n};\n"]}
|