@azure/communication-react 1.4.3-alpha-202301140013.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.
Files changed (40) hide show
  1. package/dist/dist-cjs/communication-react/index.js +272 -230
  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/RemoteVideoTile.d.ts +1 -1
  6. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +18 -4
  7. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
  8. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +24 -9
  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 +26 -11
  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/ScrollableHorizontalGallery.d.ts +9 -0
  15. package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.js +18 -0
  16. package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.js.map +1 -0
  17. package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.js +2 -3
  18. package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.js.map +1 -1
  19. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/Layout.styles.d.ts +6 -0
  20. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/Layout.styles.js +9 -0
  21. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/Layout.styles.js.map +1 -0
  22. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.d.ts +10 -0
  23. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.js +29 -0
  24. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.js.map +1 -0
  25. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.d.ts +7 -16
  26. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +20 -15
  27. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
  28. package/dist/dist-esm/react-components/src/components/VideoGallery.js +6 -10
  29. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  30. package/dist/dist-esm/react-components/src/components/utils/useLongPress.d.ts +1 -0
  31. package/dist/dist-esm/react-components/src/components/utils/useLongPress.js +7 -2
  32. package/dist/dist-esm/react-components/src/components/utils/useLongPress.js.map +1 -1
  33. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +2 -2
  34. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  35. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js +2 -0
  36. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js.map +1 -1
  37. package/package.json +11 -10
  38. package/dist/dist-esm/react-components/src/components/VideoGallery/PinnedParticipantsLayout.d.ts +0 -25
  39. package/dist/dist-esm/react-components/src/components/VideoGallery/PinnedParticipantsLayout.js +0 -62
  40. package/dist/dist-esm/react-components/src/components/VideoGallery/PinnedParticipantsLayout.js.map +0 -1
@@ -1,62 +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 { localVideoTileContainerStyle, localVideoTileWithControlsContainerStyle, LOCAL_VIDEO_TILE_ZINDEX } from './styles/FloatingLocalVideo.styles';
11
- import { innerLayoutStyle, layerHostStyle, rootLayoutStyle } from './styles/FloatingLocalVideoLayout.styles';
12
- import { usePinnedParticipantLayout } from './utils/videoGalleryLayoutUtils';
13
- import { VideoGalleryResponsiveHorizontalGallery } from './VideoGalleryResponsiveHorizontalGallery';
14
- /**
15
- * PinnedParticipantsLayout displays remote participants and a screen sharing component in
16
- * a grid and horizontal gallery while floating the local video
17
- *
18
- * @private
19
- */
20
- export const PinnedParticipantsLayout = (props) => {
21
- const { remoteParticipants = [], pinnedParticipants = [], dominantSpeakers, localVideoComponent, screenShareComponent, onRenderRemoteParticipant, styles, maxRemoteVideoStreams, showCameraSwitcherInLocalPreview, parentWidth, parentHeight, isLocalVideoFloating } = props;
22
- const theme = useTheme();
23
- const isNarrow = parentWidth ? isNarrowWidth(parentWidth) : false;
24
- const pinnedParticipantsLayout = usePinnedParticipantLayout({
25
- remoteParticipants,
26
- pinnedParticipantUserIds: pinnedParticipants,
27
- dominantSpeakers,
28
- maxRemoteVideoStreams,
29
- isScreenShareActive: !!screenShareComponent
30
- });
31
- let activeVideoStreams = 0;
32
- const shouldFloatLocalVideo = isLocalVideoFloating && remoteParticipants.length > 0;
33
- const gridTiles = pinnedParticipantsLayout.gridParticipants.map((p) => {
34
- var _a, _b;
35
- return onRenderRemoteParticipant(p, maxRemoteVideoStreams && maxRemoteVideoStreams >= 0
36
- ? ((_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable) && activeVideoStreams++ < maxRemoteVideoStreams
37
- : (_b = p.videoStream) === null || _b === void 0 ? void 0 : _b.isAvailable);
38
- });
39
- if (localVideoComponent && !shouldFloatLocalVideo) {
40
- gridTiles.push(localVideoComponent);
41
- }
42
- const horizontalGalleryTiles = pinnedParticipantsLayout.horizontalGalleryParticipants.map((p) => {
43
- var _a, _b;
44
- return onRenderRemoteParticipant(p, maxRemoteVideoStreams && maxRemoteVideoStreams >= 0
45
- ? ((_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable) && activeVideoStreams++ < maxRemoteVideoStreams
46
- : (_b = p.videoStream) === null || _b === void 0 ? void 0 : _b.isAvailable);
47
- });
48
- const layerHostId = useId('layerhost');
49
- const wrappedLocalVideoComponent = localVideoComponent && shouldFloatLocalVideo ? (
50
- // When we use showCameraSwitcherInLocalPreview it disables dragging to allow keyboard navigation.
51
- showCameraSwitcherInLocalPreview ? (React.createElement(Stack, { className: mergeStyles(localVideoTileWithControlsContainerStyle(theme, isNarrow), {
52
- boxShadow: theme.effects.elevation8,
53
- zIndex: LOCAL_VIDEO_TILE_ZINDEX
54
- }) }, 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;
55
- return (React.createElement(Stack, { styles: rootLayoutStyle },
56
- wrappedLocalVideoComponent,
57
- React.createElement(Stack, { horizontal: false, styles: innerLayoutStyle },
58
- screenShareComponent ? (screenShareComponent) : (React.createElement(GridLayout, { key: "grid-layout", styles: styles === null || styles === void 0 ? void 0 : styles.gridLayout }, gridTiles)),
59
- horizontalGalleryTiles.length > 0 && (React.createElement(VideoGalleryResponsiveHorizontalGallery, { isNarrow: isNarrow, shouldFloatLocalVideo: true, horizontalGalleryElements: horizontalGalleryTiles, styles: styles === null || styles === void 0 ? void 0 : styles.horizontalGallery })),
60
- React.createElement(LayerHost, { id: layerHostId, className: mergeStyles(layerHostStyle) }))));
61
- };
62
- //# sourceMappingURL=PinnedParticipantsLayout.js.map
@@ -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,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,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,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,MAAM,EACN,qBAAqB,EACrB,gCAAgC,EAChC,WAAW,EACX,YAAY,EACZ,oBAAoB,EACrB,GAAG,KAAK,CAAC;IAEV,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,MAAM,QAAQ,GAAG,WAAW,CA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,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,iBAAiB,GACjC,CACH;YACD,oBAAC,SAAS,IAAC,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,cAAc,CAAC,GAAI,CAChE,CACF,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 {\n localVideoTileContainerStyle,\n localVideoTileWithControlsContainerStyle,\n LOCAL_VIDEO_TILE_ZINDEX\n} from './styles/FloatingLocalVideo.styles';\nimport { innerLayoutStyle, layerHostStyle, rootLayoutStyle } from './styles/FloatingLocalVideoLayout.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 {wrappedLocalVideoComponent}\n <Stack horizontal={false} styles={innerLayoutStyle}>\n {screenShareComponent ? (\n screenShareComponent\n ) : (\n <GridLayout key=\"grid-layout\" styles={styles?.gridLayout}>\n {gridTiles}\n </GridLayout>\n )}\n {horizontalGalleryTiles.length > 0 && (\n <VideoGalleryResponsiveHorizontalGallery\n isNarrow={isNarrow}\n shouldFloatLocalVideo={true}\n horizontalGalleryElements={horizontalGalleryTiles}\n styles={styles?.horizontalGallery}\n />\n )}\n <LayerHost id={layerHostId} className={mergeStyles(layerHostStyle)} />\n </Stack>\n </Stack>\n );\n};\n"]}