@azure/communication-react 1.19.0-alpha-202409070015 → 1.19.0-alpha-202409100015
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 +34 -29
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-DFzIZcdr.js → ChatMessageComponentAsRichTextEditBox-eCfb0qTc.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-DFzIZcdr.js.map → ChatMessageComponentAsRichTextEditBox-eCfb0qTc.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-Bcr0yV14.js → RichTextSendBoxWrapper-CrqNnQ4h.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-Bcr0yV14.js.map → RichTextSendBoxWrapper-CrqNnQ4h.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-CczmcjJ7.js → index-DSX_hUlh.js} +65 -85
- package/dist/dist-cjs/communication-react/{index-CczmcjJ7.js.map → index-DSX_hUlh.js.map} +1 -1
- package/dist/dist-cjs/communication-react/index.js +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/calling-component-bindings/src/handlers/createHandlers.d.ts +4 -0
- package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js +2 -2
- package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/incomingCallStackSelector.d.ts +2 -2
- package/dist/dist-esm/calling-component-bindings/src/incomingCallStackSelector.js +1 -1
- package/dist/dist-esm/calling-component-bindings/src/incomingCallStackSelector.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.d.ts +2 -2
- package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.d.ts +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.d.ts +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/HoldButton.d.ts +3 -3
- package/dist/dist-esm/react-components/src/components/HoldButton.js +1 -1
- package/dist/dist-esm/react-components/src/components/HoldButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/IncomingCallNotification.d.ts +4 -4
- package/dist/dist-esm/react-components/src/components/IncomingCallNotification.js +1 -1
- package/dist/dist-esm/react-components/src/components/IncomingCallNotification.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/IncomingCallStack.d.ts +3 -3
- package/dist/dist-esm/react-components/src/components/IncomingCallStack.js +1 -1
- package/dist/dist-esm/react-components/src/components/IncomingCallStack.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +2 -14
- 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 +6 -21
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/LargeGalleryLayout.js +2 -14
- package/dist/dist-esm/react-components/src/components/VideoGallery/LargeGalleryLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js +6 -21
- package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.d.ts +8 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +34 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.d.ts +1 -1
- package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +3 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +5 -5
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +4 -4
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
- package/package.json +1 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { ControlBarButtonProps } from './ControlBarButton';
|
3
3
|
/**
|
4
|
-
*@
|
4
|
+
*@public
|
5
5
|
*/
|
6
6
|
export interface HoldButtonProps extends ControlBarButtonProps {
|
7
7
|
/**
|
@@ -16,7 +16,7 @@ export interface HoldButtonProps extends ControlBarButtonProps {
|
|
16
16
|
}
|
17
17
|
/**
|
18
18
|
* Strings for the hold button labels
|
19
|
-
* @
|
19
|
+
* @public
|
20
20
|
*/
|
21
21
|
export interface HoldButtonStrings {
|
22
22
|
/**
|
@@ -43,7 +43,7 @@ export interface HoldButtonStrings {
|
|
43
43
|
*
|
44
44
|
* @param props - properties for the hold button.
|
45
45
|
* @returns
|
46
|
-
* @
|
46
|
+
* @public
|
47
47
|
*/
|
48
48
|
export declare const HoldButton: (props: HoldButtonProps) => JSX.Element;
|
49
49
|
//# sourceMappingURL=HoldButton.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"HoldButton.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/HoldButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,gBAAgB,EAAyB,MAAM,oBAAoB,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAwCjE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAe,EAAE;IAChE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAExC,MAAM,gBAAgB,GAAG,GAAgB,EAAE;QACzC,OAAO,oBAAC,sBAAsB,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAC,gBAAgB,GAAG,CAAC;IACxF,CAAC,CAAC;IACF,MAAM,kBAAkB,GAAG,GAAgB,EAAE;QAC3C,OAAO,oBAAC,sBAAsB,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAC,YAAY,GAAG,CAAC;IACpF,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,gBAAgB,oBACX,KAAK,IACT,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,KAAK,CAAC,OAAO,EACtC,cAAc,EAAE,kBAAkB,EAClC,eAAe,EAAE,gBAAgB,IACjC,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ControlBarButton, ControlBarButtonProps } from './ControlBarButton';\nimport React from 'react';\nimport { _HighContrastAwareIcon } from './HighContrastAwareIcon';\n\n/**\n *@
|
1
|
+
{"version":3,"file":"HoldButton.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/HoldButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,gBAAgB,EAAyB,MAAM,oBAAoB,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAwCjE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAe,EAAE;IAChE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAExC,MAAM,gBAAgB,GAAG,GAAgB,EAAE;QACzC,OAAO,oBAAC,sBAAsB,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAC,gBAAgB,GAAG,CAAC;IACxF,CAAC,CAAC;IACF,MAAM,kBAAkB,GAAG,GAAgB,EAAE;QAC3C,OAAO,oBAAC,sBAAsB,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAC,YAAY,GAAG,CAAC;IACpF,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,gBAAgB,oBACX,KAAK,IACT,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,KAAK,CAAC,OAAO,EACtC,cAAc,EAAE,kBAAkB,EAClC,eAAe,EAAE,gBAAgB,IACjC,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ControlBarButton, ControlBarButtonProps } from './ControlBarButton';\nimport React from 'react';\nimport { _HighContrastAwareIcon } from './HighContrastAwareIcon';\n\n/**\n *@public\n */\nexport interface HoldButtonProps extends ControlBarButtonProps {\n /**\n * Utility property for using this component with communication react handlers\n * Holds the call or resumes it based on call state.\n */\n onToggleHold: () => Promise<void>;\n /**\n * Optional strings to override in component\n */\n strings?: HoldButtonStrings;\n}\n\n/**\n * Strings for the hold button labels\n * @public\n */\nexport interface HoldButtonStrings {\n /**\n * Label for when action is to resume call.\n */\n onLabel?: string;\n /**\n * Label for when action is to hold call.\n */\n offLabel?: string;\n /**\n * Content for when button is checked\n */\n tooltipOnContent?: string;\n /**\n * Content for when button is unchecked\n */\n tooltipOffContent?: string;\n}\n\n/**\n * a button to hold or resume a ongoing call.\n *\n * Can be used with {@link ControlBar}\n *\n * @param props - properties for the hold button.\n * @returns\n * @public\n */\nexport const HoldButton = (props: HoldButtonProps): JSX.Element => {\n const { onToggleHold, strings } = props;\n\n const onRenderHoldIcon = (): JSX.Element => {\n return <_HighContrastAwareIcon disabled={props.disabled} iconName=\"HoldCallButton\" />;\n };\n const onRenderResumeIcon = (): JSX.Element => {\n return <_HighContrastAwareIcon disabled={props.disabled} iconName=\"ResumeCall\" />;\n };\n\n return (\n <ControlBarButton\n {...props}\n strings={strings}\n onClick={onToggleHold ?? props.onClick}\n onRenderOnIcon={onRenderResumeIcon}\n onRenderOffIcon={onRenderHoldIcon}\n />\n );\n};\n"]}
|
@@ -3,7 +3,7 @@ import { IButtonStyles, IStackStyles } from '@fluentui/react';
|
|
3
3
|
/**
|
4
4
|
* Strings for the incoming call notification component.
|
5
5
|
*
|
6
|
-
* @
|
6
|
+
* @public
|
7
7
|
*/
|
8
8
|
export interface IncomingCallNotificationStrings {
|
9
9
|
/**
|
@@ -46,7 +46,7 @@ export interface IncomingCallNotificationStrings {
|
|
46
46
|
/**
|
47
47
|
* Styles for the incoming call notification component.
|
48
48
|
*
|
49
|
-
* @
|
49
|
+
* @public
|
50
50
|
*/
|
51
51
|
export interface IncomingCallNotificationStyles {
|
52
52
|
/**
|
@@ -69,7 +69,7 @@ export interface IncomingCallNotificationStyles {
|
|
69
69
|
/**
|
70
70
|
* Properties for the incoming call notification component.
|
71
71
|
*
|
72
|
-
* @
|
72
|
+
* @public
|
73
73
|
*/
|
74
74
|
export interface IncomingCallNotificationProps {
|
75
75
|
/**
|
@@ -126,7 +126,7 @@ export interface IncomingCallNotificationProps {
|
|
126
126
|
/**
|
127
127
|
* A Notification component that is to be used to represent incoming calls to the end user.
|
128
128
|
* Allows the user to accept or reject the incoming call.
|
129
|
-
* @
|
129
|
+
* @public
|
130
130
|
*/
|
131
131
|
export declare const IncomingCallNotification: (props: IncomingCallNotificationProps) => JSX.Element;
|
132
132
|
//# sourceMappingURL=IncomingCallNotification.d.ts.map
|
@@ -8,7 +8,7 @@ import { _formatString } from "../../../acs-ui-common/src";
|
|
8
8
|
/**
|
9
9
|
* A Notification component that is to be used to represent incoming calls to the end user.
|
10
10
|
* Allows the user to accept or reject the incoming call.
|
11
|
-
* @
|
11
|
+
* @public
|
12
12
|
*/
|
13
13
|
export const IncomingCallNotification = (props) => {
|
14
14
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"IncomingCallNotification.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/IncomingCallNotification.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,aAAa,EAEb,UAAU,EAEV,OAAO,EACP,WAAW,EACX,aAAa,EACb,KAAK,EACL,IAAI,EAEJ,QAAQ,EACT,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,mDAAmD;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,mCAAgC;AAgIxD;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAAoC,EAAe,EAAE;;IAC5F,MAAM,EACJ,UAAU,EACV,SAAS,EACT,WAAW,EACX,iBAAiB;IACjB,mDAAmD;IACnD,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,WAAW,EACX,MAAM,EACN,OAAO;IACP,mDAAmD;IACnD,aAAa,EACd,GAAG,KAAK,CAAC;IACV,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,mDAAmD;IACnD,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC,wBAAwB,CAAC;IACnE,mDAAmD;IACnD,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AI,EAAE;QACJ,WAAW,EAAE,QAAQ;KACtB;CACF,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,KAAY,EAAiB,EAAE;IACzD,OAAO;QACL,IAAI,EAAE;YACJ,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,cAAc;YACnC,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,MAAM;SACf;QACD,WAAW,EAAE;YACX,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,WAAW;SACjC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG,CAAC,KAAY,EAAiB,EAAE;IACpE,OAAO;QACL,IAAI,EAAE;YACJ,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;YAC1B,MAAM,EAAE,MAAM;YACd,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,cAAc;YAC1C,KAAK,EAAE,MAAM;YACb,QAAQ,EAAE,UAAU;SACrB;QACD,WAAW,EAAE;YACX,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;SAC3B;QACD,IAAI,EAAE;YACJ,MAAM,EAAE,SAAS;SAClB;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG,CAAC,KAAY,EAAiB,EAAE;IACpE,OAAO;QACL,IAAI,EAAE;YACJ,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,cAAc;YAC1C,QAAQ,EAAE,UAAU;YACpB,KAAK,EAAE,MAAM;SACd;QACD,IAAI,EAAE;YACJ,MAAM,EAAE,SAAS;SAClB;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n DefaultButton,\n IButtonStyles,\n IconButton,\n IStackStyles,\n Persona,\n PersonaSize,\n PrimaryButton,\n Stack,\n Text,\n Theme,\n useTheme\n} from '@fluentui/react';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { IContextualMenuProps } from '@fluentui/react';\nimport React from 'react';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { useLocale } from '../localization';\nimport { _formatString } from '@internal/acs-ui-common';\n\n/**\n * Strings for the incoming call notification component.\n *\n * @beta\n */\nexport interface IncomingCallNotificationStrings {\n /**\n * Placeholder CallerID for the incoming call notification.\n */\n incomingCallNotificationPlaceholderId?: string;\n /**\n * Placeholder Alert for the incoming call notification.\n */\n incomingCallNotificationPlaceholderAlert?: string;\n /**\n * Aria label for the accept with audio button in the incoming call notification.\n */\n incomingCallNoticicationAcceptWithAudioAriaLabel?: string;\n /**\n * Aria label for the accept with video button in the incoming call notification.\n */\n incomingCallNoticicationAcceptWithVideoAriaLabel?: string;\n /**\n * Aria label for the reject button in the incoming call notification.\n */\n incomingCallNoticicationRejectAriaLabel?: string;\n /**\n * Label for the accept button in the incoming call notification.\n */\n incomingCallNotificationAcceptButtonLabel?: string;\n /**\n * Label for the accept with video button in the incoming call notification.\n */\n incomingCallNotificationAccceptWithVideoButtonLabel?: string;\n /**\n * label for the reject button in the incoming call notification.\n */\n incomingCallNotificationRejectButtonLabel?: string;\n /**\n * Aria label for the incoming call dismiss button\n */\n incomingCallNotificationDismissButtonAriaLabel?: string;\n}\n\n/**\n * Styles for the incoming call notification component.\n *\n * @beta\n */\nexport interface IncomingCallNotificationStyles {\n /**\n * Styles for the accept buttons.\n */\n acceptButton?: IButtonStyles;\n /**\n * Styles for the reject button.\n */\n rejectButton?: IButtonStyles;\n /**\n * Styles for the root container.\n */\n root?: IStackStyles;\n /**\n * Styles for the avatar container.\n */\n avatarContainer?: IStackStyles;\n}\n\n/**\n * Properties for the incoming call notification component.\n *\n * @beta\n */\nexport interface IncomingCallNotificationProps {\n /**\n * Caller's Name\n */\n callerName?: string;\n /**\n * Alert Text\"\n */\n alertText?: string;\n /**\n * URL to the avatar image for the user\n */\n avatarImage?: string;\n /**\n * Size of the persona coin\n */\n personaSize?: number;\n /**\n * Callback to render the avatar\n */\n onRenderAvatar?: () => JSX.Element;\n /**\n * Callback to accept the call with audio\n */\n onAcceptWithAudio: () => void;\n /**\n * Callback to accept the call with Video\n */\n onAcceptWithVideo: () => void;\n /**\n * Callback to reject the call\n */\n onReject: () => void;\n /**\n * Callback when the notification is dismissed\n */\n onDismiss?: () => void;\n /**\n * Styles for the incoming call notification component.\n */\n styles?: IncomingCallNotificationStyles;\n /**\n * Strings for the incoming call notification component.\n */\n strings?: IncomingCallNotificationStrings;\n /**\n * Options for whether to show the accept with video button\n */\n acceptOptions: {\n showAcceptWithVideo: boolean;\n };\n}\n\n/**\n * A Notification component that is to be used to represent incoming calls to the end user.\n * Allows the user to accept or reject the incoming call.\n * @beta\n */\nexport const IncomingCallNotification = (props: IncomingCallNotificationProps): JSX.Element => {\n const {\n callerName,\n alertText,\n avatarImage,\n onAcceptWithAudio,\n /* @conditional-compile-remove(one-to-n-calling) */\n onAcceptWithVideo,\n onReject,\n onDismiss,\n personaSize,\n styles,\n strings,\n /* @conditional-compile-remove(one-to-n-calling) */\n acceptOptions\n } = props;\n const theme = useTheme();\n /* @conditional-compile-remove(one-to-n-calling) */\n const localeStrings = useLocale().strings.IncomingCallNotification;\n /* @conditional-compile-remove(one-to-n-calling) */\n const formattedMessageString =\n localeStrings.incomingCallNotificationPlaceholderAlert && callerName\n ? _formatString(localeStrings.incomingCallNotificationPlaceholderAlert, { callerName: callerName })\n : callerName;\n\n /* @conditional-compile-remove(one-to-n-calling) */\n const acceptManuOptions: IContextualMenuProps | undefined = acceptOptions.showAcceptWithVideo\n ? {\n items: [\n {\n key: 'audio',\n text:\n /* @conditional-compile-remove(one-to-n-calling) */ strings?.incomingCallNotificationAcceptButtonLabel ??\n localeStrings.incomingCallNotificationAcceptButtonLabel,\n onClick: () => onAcceptWithAudio()\n },\n {\n key: 'video',\n text:\n /* @conditional-compile-remove(one-to-n-calling) */ strings?.incomingCallNotificationAccceptWithVideoButtonLabel ??\n localeStrings.incomingCallNotificationAccceptWithVideoButtonLabel,\n onClick: () => onAcceptWithVideo()\n }\n ]\n }\n : undefined;\n\n return (\n <Stack\n tokens={{ childrenGap: '0.5rem' }}\n verticalAlign=\"center\"\n styles={styles?.root ? styles.root : incomingCallToastStyle(theme)}\n >\n <Stack horizontal verticalAlign=\"center\" tokens={{ childrenGap: personaSize ? '0.5rem' : '0rem' }}>\n <Stack\n horizontalAlign=\"start\"\n styles={styles?.avatarContainer ? styles.avatarContainer : incomingCallToastAvatarContainerStyle}\n >\n <Persona\n imageUrl={avatarImage}\n text={callerName}\n size={PersonaSize.size24}\n coinSize={personaSize}\n hidePersonaDetails={true}\n aria-label={callerName}\n />\n </Stack>\n\n <Stack grow horizontalAlign=\"center\" style={{ alignItems: 'flex-start', fontFamily: 'Segoe UI' }}>\n <Text\n tabIndex={0}\n aria-live={'assertive'}\n aria-label={alertText ?? /* @conditional-compile-remove(one-to-n-calling) */ formattedMessageString}\n >\n {alertText ??\n strings?.incomingCallNotificationPlaceholderAlert ??\n /* @conditional-compile-remove(one-to-n-calling) */ formattedMessageString}\n </Text>\n </Stack>\n <IconButton\n /* @conditional-compile-remove(one-to-n-calling) */\n ariaLabel={\n strings?.incomingCallNotificationDismissButtonAriaLabel ??\n localeStrings.incomingCallNotificationDismissButtonAriaLabel\n }\n iconProps={{ iconName: 'cancel' }}\n onClick={onDismiss}\n styles={dismissButtonStyle(theme)}\n />\n </Stack>\n\n <Stack horizontal horizontalAlign={'center'} tokens={{ childrenGap: '0.5rem' }}>\n <PrimaryButton\n styles={styles?.acceptButton ? styles.acceptButton : incomingCallAcceptButtonStyle(theme)}\n onClick={() => onAcceptWithAudio()}\n iconProps={{ iconName: 'IncomingCallNotificationAcceptIcon', style: { lineHeight: '1rem' } }}\n /* @conditional-compile-remove(one-to-n-calling) */\n ariaLabel={\n strings?.incomingCallNoticicationAcceptWithAudioAriaLabel ??\n localeStrings.incomingCallNoticicationAcceptWithAudioAriaLabel\n }\n /* @conditional-compile-remove(one-to-n-calling) */\n menuProps={acceptManuOptions}\n >\n {\n /* @conditional-compile-remove(one-to-n-calling) */ strings?.incomingCallNotificationAcceptButtonLabel ??\n localeStrings.incomingCallNotificationAcceptButtonLabel\n }\n </PrimaryButton>\n <DefaultButton\n styles={styles?.rejectButton ? styles.rejectButton : incomingCallRejectButtonStyle(theme)}\n onClick={() => onReject()}\n iconProps={{ iconName: 'IncomingCallNotificationRejectIcon' }}\n /* @conditional-compile-remove(one-to-n-calling) */\n ariaLabel={\n strings?.incomingCallNoticicationRejectAriaLabel ?? localeStrings.incomingCallNoticicationRejectAriaLabel\n }\n >\n {\n /* @conditional-compile-remove(one-to-n-calling) */ strings?.incomingCallNotificationRejectButtonLabel ??\n localeStrings.incomingCallNotificationRejectButtonLabel\n }\n </DefaultButton>\n </Stack>\n </Stack>\n );\n};\n\nconst incomingCallToastStyle = (theme: Theme): IStackStyles => {\n return {\n root: {\n width: '20rem',\n background: theme.palette.white,\n opacity: 0.95,\n borderRadius: '0.5rem',\n boxShadow: theme.effects.elevation8,\n padding: '1rem'\n }\n };\n};\n\nconst incomingCallToastAvatarContainerStyle: IStackStyles = {\n root: {\n marginRight: '0.5rem'\n }\n};\n\nconst dismissButtonStyle = (theme: Theme): IButtonStyles => {\n return {\n root: {\n color: theme.palette.neutralPrimary,\n width: '1rem',\n height: '1rem'\n },\n rootHovered: {\n color: theme.palette.neutralDark\n }\n };\n};\n\nconst incomingCallAcceptButtonStyle = (theme: Theme): IButtonStyles => {\n return {\n root: {\n color: theme.palette.white,\n border: 'none',\n borderRadius: theme.effects.roundedCorner4,\n width: '100%',\n maxWidth: '8.875rem'\n },\n rootHovered: {\n color: theme.palette.white\n },\n icon: {\n height: '1.25rem'\n }\n };\n};\n\nconst incomingCallRejectButtonStyle = (theme: Theme): IButtonStyles => {\n return {\n root: {\n borderRadius: theme.effects.roundedCorner4,\n maxWidth: '8.875rem',\n width: '100%'\n },\n icon: {\n height: '1.25rem'\n }\n };\n};\n"]}
|
1
|
+
{"version":3,"file":"IncomingCallNotification.js","sourceRoot":"","sources":["../../../../../../react-components/src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AAE,MAAM;YACd,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,cAAc;YAC1C,KAAK,EAAE,MAAM;YACb,QAAQ,EAAE,UAAU;SACrB;QACD,WAAW,EAAE;YACX,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;SAC3B;QACD,IAAI,EAAE;YACJ,MAAM,EAAE,SAAS;SAClB;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG,CAAC,KAAY,EAAiB,EAAE;IACpE,OAAO;QACL,IAAI,EAAE;YACJ,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,cAAc;YAC1C,QAAQ,EAAE,UAAU;YACpB,KAAK,EAAE,MAAM;SACd;QACD,IAAI,EAAE;YACJ,MAAM,EAAE,SAAS;SAClB;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n DefaultButton,\n IButtonStyles,\n IconButton,\n IStackStyles,\n Persona,\n PersonaSize,\n PrimaryButton,\n Stack,\n Text,\n Theme,\n useTheme\n} from '@fluentui/react';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { IContextualMenuProps } from '@fluentui/react';\nimport React from 'react';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { useLocale } from '../localization';\nimport { _formatString } from '@internal/acs-ui-common';\n\n/**\n * Strings for the incoming call notification component.\n *\n * @public\n */\nexport interface IncomingCallNotificationStrings {\n /**\n * Placeholder CallerID for the incoming call notification.\n */\n incomingCallNotificationPlaceholderId?: string;\n /**\n * Placeholder Alert for the incoming call notification.\n */\n incomingCallNotificationPlaceholderAlert?: string;\n /**\n * Aria label for the accept with audio button in the incoming call notification.\n */\n incomingCallNoticicationAcceptWithAudioAriaLabel?: string;\n /**\n * Aria label for the accept with video button in the incoming call notification.\n */\n incomingCallNoticicationAcceptWithVideoAriaLabel?: string;\n /**\n * Aria label for the reject button in the incoming call notification.\n */\n incomingCallNoticicationRejectAriaLabel?: string;\n /**\n * Label for the accept button in the incoming call notification.\n */\n incomingCallNotificationAcceptButtonLabel?: string;\n /**\n * Label for the accept with video button in the incoming call notification.\n */\n incomingCallNotificationAccceptWithVideoButtonLabel?: string;\n /**\n * label for the reject button in the incoming call notification.\n */\n incomingCallNotificationRejectButtonLabel?: string;\n /**\n * Aria label for the incoming call dismiss button\n */\n incomingCallNotificationDismissButtonAriaLabel?: string;\n}\n\n/**\n * Styles for the incoming call notification component.\n *\n * @public\n */\nexport interface IncomingCallNotificationStyles {\n /**\n * Styles for the accept buttons.\n */\n acceptButton?: IButtonStyles;\n /**\n * Styles for the reject button.\n */\n rejectButton?: IButtonStyles;\n /**\n * Styles for the root container.\n */\n root?: IStackStyles;\n /**\n * Styles for the avatar container.\n */\n avatarContainer?: IStackStyles;\n}\n\n/**\n * Properties for the incoming call notification component.\n *\n * @public\n */\nexport interface IncomingCallNotificationProps {\n /**\n * Caller's Name\n */\n callerName?: string;\n /**\n * Alert Text\"\n */\n alertText?: string;\n /**\n * URL to the avatar image for the user\n */\n avatarImage?: string;\n /**\n * Size of the persona coin\n */\n personaSize?: number;\n /**\n * Callback to render the avatar\n */\n onRenderAvatar?: () => JSX.Element;\n /**\n * Callback to accept the call with audio\n */\n onAcceptWithAudio: () => void;\n /**\n * Callback to accept the call with Video\n */\n onAcceptWithVideo: () => void;\n /**\n * Callback to reject the call\n */\n onReject: () => void;\n /**\n * Callback when the notification is dismissed\n */\n onDismiss?: () => void;\n /**\n * Styles for the incoming call notification component.\n */\n styles?: IncomingCallNotificationStyles;\n /**\n * Strings for the incoming call notification component.\n */\n strings?: IncomingCallNotificationStrings;\n /**\n * Options for whether to show the accept with video button\n */\n acceptOptions: {\n showAcceptWithVideo: boolean;\n };\n}\n\n/**\n * A Notification component that is to be used to represent incoming calls to the end user.\n * Allows the user to accept or reject the incoming call.\n * @public\n */\nexport const IncomingCallNotification = (props: IncomingCallNotificationProps): JSX.Element => {\n const {\n callerName,\n alertText,\n avatarImage,\n onAcceptWithAudio,\n /* @conditional-compile-remove(one-to-n-calling) */\n onAcceptWithVideo,\n onReject,\n onDismiss,\n personaSize,\n styles,\n strings,\n /* @conditional-compile-remove(one-to-n-calling) */\n acceptOptions\n } = props;\n const theme = useTheme();\n /* @conditional-compile-remove(one-to-n-calling) */\n const localeStrings = useLocale().strings.IncomingCallNotification;\n /* @conditional-compile-remove(one-to-n-calling) */\n const formattedMessageString =\n localeStrings.incomingCallNotificationPlaceholderAlert && callerName\n ? _formatString(localeStrings.incomingCallNotificationPlaceholderAlert, { callerName: callerName })\n : callerName;\n\n /* @conditional-compile-remove(one-to-n-calling) */\n const acceptManuOptions: IContextualMenuProps | undefined = acceptOptions.showAcceptWithVideo\n ? {\n items: [\n {\n key: 'audio',\n text:\n /* @conditional-compile-remove(one-to-n-calling) */ strings?.incomingCallNotificationAcceptButtonLabel ??\n localeStrings.incomingCallNotificationAcceptButtonLabel,\n onClick: () => onAcceptWithAudio()\n },\n {\n key: 'video',\n text:\n /* @conditional-compile-remove(one-to-n-calling) */ strings?.incomingCallNotificationAccceptWithVideoButtonLabel ??\n localeStrings.incomingCallNotificationAccceptWithVideoButtonLabel,\n onClick: () => onAcceptWithVideo()\n }\n ]\n }\n : undefined;\n\n return (\n <Stack\n tokens={{ childrenGap: '0.5rem' }}\n verticalAlign=\"center\"\n styles={styles?.root ? styles.root : incomingCallToastStyle(theme)}\n >\n <Stack horizontal verticalAlign=\"center\" tokens={{ childrenGap: personaSize ? '0.5rem' : '0rem' }}>\n <Stack\n horizontalAlign=\"start\"\n styles={styles?.avatarContainer ? styles.avatarContainer : incomingCallToastAvatarContainerStyle}\n >\n <Persona\n imageUrl={avatarImage}\n text={callerName}\n size={PersonaSize.size24}\n coinSize={personaSize}\n hidePersonaDetails={true}\n aria-label={callerName}\n />\n </Stack>\n\n <Stack grow horizontalAlign=\"center\" style={{ alignItems: 'flex-start', fontFamily: 'Segoe UI' }}>\n <Text\n tabIndex={0}\n aria-live={'assertive'}\n aria-label={alertText ?? /* @conditional-compile-remove(one-to-n-calling) */ formattedMessageString}\n >\n {alertText ??\n strings?.incomingCallNotificationPlaceholderAlert ??\n /* @conditional-compile-remove(one-to-n-calling) */ formattedMessageString}\n </Text>\n </Stack>\n <IconButton\n /* @conditional-compile-remove(one-to-n-calling) */\n ariaLabel={\n strings?.incomingCallNotificationDismissButtonAriaLabel ??\n localeStrings.incomingCallNotificationDismissButtonAriaLabel\n }\n iconProps={{ iconName: 'cancel' }}\n onClick={onDismiss}\n styles={dismissButtonStyle(theme)}\n />\n </Stack>\n\n <Stack horizontal horizontalAlign={'center'} tokens={{ childrenGap: '0.5rem' }}>\n <PrimaryButton\n styles={styles?.acceptButton ? styles.acceptButton : incomingCallAcceptButtonStyle(theme)}\n onClick={() => onAcceptWithAudio()}\n iconProps={{ iconName: 'IncomingCallNotificationAcceptIcon', style: { lineHeight: '1rem' } }}\n /* @conditional-compile-remove(one-to-n-calling) */\n ariaLabel={\n strings?.incomingCallNoticicationAcceptWithAudioAriaLabel ??\n localeStrings.incomingCallNoticicationAcceptWithAudioAriaLabel\n }\n /* @conditional-compile-remove(one-to-n-calling) */\n menuProps={acceptManuOptions}\n >\n {\n /* @conditional-compile-remove(one-to-n-calling) */ strings?.incomingCallNotificationAcceptButtonLabel ??\n localeStrings.incomingCallNotificationAcceptButtonLabel\n }\n </PrimaryButton>\n <DefaultButton\n styles={styles?.rejectButton ? styles.rejectButton : incomingCallRejectButtonStyle(theme)}\n onClick={() => onReject()}\n iconProps={{ iconName: 'IncomingCallNotificationRejectIcon' }}\n /* @conditional-compile-remove(one-to-n-calling) */\n ariaLabel={\n strings?.incomingCallNoticicationRejectAriaLabel ?? localeStrings.incomingCallNoticicationRejectAriaLabel\n }\n >\n {\n /* @conditional-compile-remove(one-to-n-calling) */ strings?.incomingCallNotificationRejectButtonLabel ??\n localeStrings.incomingCallNotificationRejectButtonLabel\n }\n </DefaultButton>\n </Stack>\n </Stack>\n );\n};\n\nconst incomingCallToastStyle = (theme: Theme): IStackStyles => {\n return {\n root: {\n width: '20rem',\n background: theme.palette.white,\n opacity: 0.95,\n borderRadius: '0.5rem',\n boxShadow: theme.effects.elevation8,\n padding: '1rem'\n }\n };\n};\n\nconst incomingCallToastAvatarContainerStyle: IStackStyles = {\n root: {\n marginRight: '0.5rem'\n }\n};\n\nconst dismissButtonStyle = (theme: Theme): IButtonStyles => {\n return {\n root: {\n color: theme.palette.neutralPrimary,\n width: '1rem',\n height: '1rem'\n },\n rootHovered: {\n color: theme.palette.neutralDark\n }\n };\n};\n\nconst incomingCallAcceptButtonStyle = (theme: Theme): IButtonStyles => {\n return {\n root: {\n color: theme.palette.white,\n border: 'none',\n borderRadius: theme.effects.roundedCorner4,\n width: '100%',\n maxWidth: '8.875rem'\n },\n rootHovered: {\n color: theme.palette.white\n },\n icon: {\n height: '1.25rem'\n }\n };\n};\n\nconst incomingCallRejectButtonStyle = (theme: Theme): IButtonStyles => {\n return {\n root: {\n borderRadius: theme.effects.roundedCorner4,\n maxWidth: '8.875rem',\n width: '100%'\n },\n icon: {\n height: '1.25rem'\n }\n };\n};\n"]}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import { IncomingCallNotificationStyles, IncomingCallNotificationStrings } from './IncomingCallNotification';
|
3
3
|
/**
|
4
4
|
* Represents an active incoming call.
|
5
|
-
* @
|
5
|
+
* @public
|
6
6
|
*/
|
7
7
|
export interface IncomingCallStackCall {
|
8
8
|
/**
|
@@ -25,7 +25,7 @@ export interface IncomingCallStackCall {
|
|
25
25
|
}
|
26
26
|
/**
|
27
27
|
* Props for the IncomingCallManager component.
|
28
|
-
* @
|
28
|
+
* @public
|
29
29
|
*/
|
30
30
|
export interface IncomingCallStackProps {
|
31
31
|
/**
|
@@ -67,7 +67,7 @@ export interface IncomingCallStackProps {
|
|
67
67
|
* Wrapper to manage multiple incoming calls
|
68
68
|
* @param props - {@link IncomingCallManagerProps}
|
69
69
|
* @returns
|
70
|
-
* @
|
70
|
+
* @public
|
71
71
|
*/
|
72
72
|
export declare const IncomingCallStack: (props: IncomingCallStackProps) => JSX.Element;
|
73
73
|
//# sourceMappingURL=IncomingCallStack.d.ts.map
|
@@ -8,7 +8,7 @@ import React from 'react';
|
|
8
8
|
* Wrapper to manage multiple incoming calls
|
9
9
|
* @param props - {@link IncomingCallManagerProps}
|
10
10
|
* @returns
|
11
|
-
* @
|
11
|
+
* @public
|
12
12
|
*/
|
13
13
|
export const IncomingCallStack = (props) => {
|
14
14
|
/* @conditional-compile-remove(one-to-n-calling) */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"IncomingCallStack.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/IncomingCallStack.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,mDAAmD;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,MAAM,OAAO,CAAC;AAkE1B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAA6B,EAAe,EAAE;IAC9E,mDAAmD;IACnD,MAAM,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACnH,OAAO,CACL,oBAAC,KAAK,IACJ,MAAM,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,EAClC,IAAI,EAAE,OAAO;QACb,mDAAmD,CAAC,QAAQ,EAAE,QAAQ;IAGpE,mDAAmD,CAAC,mBAAmB;SACpE,MAAM,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,YAAY,CAAC,EAAE,CAAC,CAAC;SAC3F,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE;QACpB,OAAO,CACL,oBAAC,wBAAwB,IACvB,GAAG,EAAE,YAAY,CAAC,EAAE,EACpB,UAAU,EAAE,YAAY,CAAC,UAAU,CAAC,WAAW,EAC/C,iBAAiB,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,CAAC,EACtD,iBAAiB,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,EAAE,IAAI,CAAC,EAC5D,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,CAAC,EAC7C,SAAS,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,CAAC,EAC9C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,EAAE,mBAAmB,EAAE,YAAY,CAAC,cAAc,EAAE,GACzC,CAC7B,CAAC;IACJ,CAAC,CAAC,CAEA,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { IncomingCallNotification } from './IncomingCallNotification';\nimport { IncomingCallNotificationStyles, IncomingCallNotificationStrings } from './IncomingCallNotification';\nimport { Stack } from '@fluentui/react';\nimport React from 'react';\n\n/**\n * Represents an active incoming call.\n * @
|
1
|
+
{"version":3,"file":"IncomingCallStack.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/IncomingCallStack.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,mDAAmD;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,MAAM,OAAO,CAAC;AAkE1B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAA6B,EAAe,EAAE;IAC9E,mDAAmD;IACnD,MAAM,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACnH,OAAO,CACL,oBAAC,KAAK,IACJ,MAAM,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,EAClC,IAAI,EAAE,OAAO;QACb,mDAAmD,CAAC,QAAQ,EAAE,QAAQ;IAGpE,mDAAmD,CAAC,mBAAmB;SACpE,MAAM,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,YAAY,CAAC,EAAE,CAAC,CAAC;SAC3F,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE;QACpB,OAAO,CACL,oBAAC,wBAAwB,IACvB,GAAG,EAAE,YAAY,CAAC,EAAE,EACpB,UAAU,EAAE,YAAY,CAAC,UAAU,CAAC,WAAW,EAC/C,iBAAiB,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,CAAC,EACtD,iBAAiB,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,EAAE,IAAI,CAAC,EAC5D,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,CAAC,EAC7C,SAAS,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,CAAC,EAC9C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,EAAE,mBAAmB,EAAE,YAAY,CAAC,cAAc,EAAE,GACzC,CAC7B,CAAC;IACJ,CAAC,CAAC,CAEA,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { IncomingCallNotification } from './IncomingCallNotification';\nimport { IncomingCallNotificationStyles, IncomingCallNotificationStrings } from './IncomingCallNotification';\nimport { Stack } from '@fluentui/react';\nimport React from 'react';\n\n/**\n * Represents an active incoming call.\n * @public\n */\nexport interface IncomingCallStackCall {\n /**\n * Unique identifier for the incoming call.\n */\n id: string;\n /**\n * Information about the caller.\n */\n callerInfo: {\n /**\n * Display name of the caller.\n */\n displayName?: string;\n };\n /**\n * Whether or not the call is a voip capable call.\n */\n videoAvailable: boolean;\n}\n/**\n * Props for the IncomingCallManager component.\n * @public\n */\nexport interface IncomingCallStackProps {\n /**\n * List of incoming calls.\n */\n activeIncomingCalls: IncomingCallStackCall[];\n /**\n * List of incoming calls that have ended.\n */\n removedIncomingCalls: IncomingCallStackCall[];\n /**\n * Handler to accept the incoming call.\n * @param incomingCallId - Id of the incoming call to accept.\n * @param useVideo - Whether to accept with video.\n * @returns void\n */\n onAcceptCall: (incomingCallId: string, useVideo?: boolean) => void;\n /**\n * Handler to reject the incoming call.\n * @param incomingCallId - id of the incoming call to reject\n * @returns - void\n */\n onRejectCall: (incomingCallId: string) => void;\n /**\n * Styles for the incoming call notifications.\n */\n styles?: IncomingCallNotificationStyles;\n /**\n * Strings for the incoming call notifications.\n */\n strings?: IncomingCallNotificationStrings;\n /**\n * Tab index for the incoming Call stack, this will set the tab order of the\n * incoming call notifications in your application.\n */\n tabIndex?: number;\n}\n\n/**\n * Wrapper to manage multiple incoming calls\n * @param props - {@link IncomingCallManagerProps}\n * @returns\n * @public\n */\nexport const IncomingCallStack = (props: IncomingCallStackProps): JSX.Element => {\n /* @conditional-compile-remove(one-to-n-calling) */\n const { activeIncomingCalls, removedIncomingCalls, onAcceptCall, onRejectCall, styles, strings, tabIndex } = props;\n return (\n <Stack\n tokens={{ childrenGap: '0.25rem' }}\n role={'group'}\n /* @conditional-compile-remove(one-to-n-calling) */ tabIndex={tabIndex}\n >\n {\n /* @conditional-compile-remove(one-to-n-calling) */ activeIncomingCalls\n .filter((incomingCall) => !removedIncomingCalls.some((call) => call.id === incomingCall.id))\n .map((incomingCall) => {\n return (\n <IncomingCallNotification\n key={incomingCall.id}\n callerName={incomingCall.callerInfo.displayName}\n onAcceptWithAudio={() => onAcceptCall(incomingCall.id)}\n onAcceptWithVideo={() => onAcceptCall(incomingCall.id, true)}\n onReject={() => onRejectCall(incomingCall.id)}\n onDismiss={() => onRejectCall(incomingCall.id)}\n styles={styles}\n strings={strings}\n acceptOptions={{ showAcceptWithVideo: incomingCall.videoAvailable }}\n ></IncomingCallNotification>\n );\n })\n }\n </Stack>\n );\n};\n"]}
|
@@ -7,7 +7,7 @@ import { isNarrowWidth } from '../utils/responsive';
|
|
7
7
|
import { isShortHeight } from '../utils/responsive';
|
8
8
|
import { rootLayoutStyle } from './styles/DefaultLayout.styles';
|
9
9
|
import { videoGalleryLayoutGap } from './styles/Layout.styles';
|
10
|
-
import { MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY, useOrganizedParticipants } from './utils/videoGalleryLayoutUtils';
|
10
|
+
import { MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY, renderTiles, useOrganizedParticipants } from './utils/videoGalleryLayoutUtils';
|
11
11
|
import { OverflowGallery } from './OverflowGallery';
|
12
12
|
/**
|
13
13
|
* DefaultLayout displays remote participants, local video component, and screen sharing component in
|
@@ -37,13 +37,6 @@ export const DefaultLayout = (props) => {
|
|
37
37
|
layout: 'default',
|
38
38
|
spotlightedParticipantUserIds
|
39
39
|
});
|
40
|
-
let activeVideoStreams = 0;
|
41
|
-
let gridTiles = gridParticipants.map((p) => {
|
42
|
-
var _a, _b;
|
43
|
-
return onRenderRemoteParticipant(p, maxRemoteVideoStreams && maxRemoteVideoStreams >= 0
|
44
|
-
? ((_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable) && activeVideoStreams++ < maxRemoteVideoStreams
|
45
|
-
: (_b = p.videoStream) === null || _b === void 0 ? void 0 : _b.isAvailable);
|
46
|
-
});
|
47
40
|
/**
|
48
41
|
* instantiate indexes available to render with indexes available that would be on first page
|
49
42
|
*
|
@@ -52,12 +45,7 @@ export const DefaultLayout = (props) => {
|
|
52
45
|
* this case when those components are here
|
53
46
|
*/
|
54
47
|
const [indexesToRender, setIndexesToRender] = useState([]);
|
55
|
-
let overflowGalleryTiles =
|
56
|
-
var _a, _b;
|
57
|
-
return onRenderRemoteParticipant(p, maxRemoteVideoStreams && maxRemoteVideoStreams >= 0
|
58
|
-
? ((_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable) && indexesToRender.includes(i) && activeVideoStreams++ < maxRemoteVideoStreams
|
59
|
-
: (_b = p.videoStream) === null || _b === void 0 ? void 0 : _b.isAvailable);
|
60
|
-
});
|
48
|
+
let { gridTiles, overflowGalleryTiles } = renderTiles(gridParticipants, onRenderRemoteParticipant, maxRemoteVideoStreams, indexesToRender, overflowGalleryParticipants, dominantSpeakers);
|
61
49
|
if (localVideoComponent) {
|
62
50
|
if (screenShareComponent || spotlightedParticipantUserIds.length > 0) {
|
63
51
|
overflowGalleryTiles = [localVideoComponent].concat(overflowGalleryTiles);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DefaultLayout.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/DefaultLayout.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,
|
1
|
+
{"version":3,"file":"DefaultLayout.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/DefaultLayout.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EACL,uCAAuC,EACvC,WAAW,EACX,wBAAwB,EACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AASpD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAyB,EAAe,EAAE;IACtE,MAAM,EACJ,kBAAkB,GAAG,EAAE,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,MAAM,EACN,qBAAqB,EACrB,WAAW,EACX,YAAY,EACZ,wBAAwB,GAAG,EAAE,EAC7B,uBAAuB,GAAG,kBAAkB,EAC5C,6BAA6B,GAAG,EAAE,EACnC,GAAG,KAAK,CAAC;IAEV,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAElE,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAEnE,qFAAqF;IACrF,+GAA+G;IAC/G,iHAAiH;IACjH,MAA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UAAU,IACrD,SAAS,CACC,CACd;QACA,yBAAyB,CAAC,eAAe,EAAE,KAAK,CAAC,uBAAuB,CAAC,CACpE,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAChC,OAA2B,EAC3B,eAAwE,EACpD,EAAE;IACtB,OAAO,eAAe,KAAK,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,yCAAK,CAAC;IAC7D,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Stack } from '@fluentui/react';\nimport React, { useMemo, useState, useRef } from 'react';\nimport { GridLayout } from '../GridLayout';\nimport { isNarrowWidth } from '../utils/responsive';\nimport { isShortHeight } from '../utils/responsive';\nimport { LayoutProps } from './Layout';\nimport { rootLayoutStyle } from './styles/DefaultLayout.styles';\nimport { videoGalleryLayoutGap } from './styles/Layout.styles';\nimport {\n MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY,\n renderTiles,\n useOrganizedParticipants\n} from './utils/videoGalleryLayoutUtils';\nimport { OverflowGallery } from './OverflowGallery';\n\n/**\n * Props for {@link DefaultLayout}.\n *\n * @private\n */\nexport type DefaultLayoutProps = LayoutProps;\n\n/**\n * DefaultLayout displays remote participants, local video component, and screen sharing component in\n * a grid an overflow gallery.\n *\n * @private\n */\nexport const DefaultLayout = (props: DefaultLayoutProps): JSX.Element => {\n const {\n remoteParticipants = [],\n localParticipant,\n dominantSpeakers,\n localVideoComponent,\n screenShareComponent,\n onRenderRemoteParticipant,\n styles,\n maxRemoteVideoStreams,\n parentWidth,\n parentHeight,\n pinnedParticipantUserIds = [],\n overflowGalleryPosition = 'horizontalBottom',\n spotlightedParticipantUserIds = []\n } = props;\n\n const isNarrow = parentWidth ? isNarrowWidth(parentWidth) : false;\n\n const isShort = parentHeight ? isShortHeight(parentHeight) : false;\n\n // This is for tracking the number of children in the first page of overflow gallery.\n // This number will be used for the maxOverflowGalleryDominantSpeakers when organizing the remote participants.\n // We need to add the local participant to the pinned participant count so we are placing the speakers correctly.\n const childrenPerPage = useRef(4);\n const remoteVideosOn = remoteParticipants.filter((p) => p.videoStream?.isAvailable).length > 0;\n const { gridParticipants, overflowGalleryParticipants } = useOrganizedParticipants({\n remoteParticipants,\n localParticipant,\n dominantSpeakers,\n maxGridParticipants: remoteVideosOn ? maxRemoteVideoStreams : MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY,\n isScreenShareActive: !!screenShareComponent,\n maxOverflowGalleryDominantSpeakers: screenShareComponent\n ? childrenPerPage.current - ((pinnedParticipantUserIds.length + 1) % childrenPerPage.current)\n : childrenPerPage.current,\n pinnedParticipantUserIds,\n layout: 'default',\n spotlightedParticipantUserIds\n });\n\n /**\n * instantiate indexes available to render with indexes available that would be on first page\n *\n * For some components which do not strictly follow the order of the array, we might\n * re-render the initial tiles -> dispose them -> create new tiles, we need to take care of\n * this case when those components are here\n */\n const [indexesToRender, setIndexesToRender] = useState<number[]>([]);\n\n let { gridTiles, overflowGalleryTiles } = renderTiles(\n gridParticipants,\n onRenderRemoteParticipant,\n maxRemoteVideoStreams,\n indexesToRender,\n overflowGalleryParticipants,\n dominantSpeakers\n );\n\n if (localVideoComponent) {\n if (screenShareComponent || spotlightedParticipantUserIds.length > 0) {\n overflowGalleryTiles = [localVideoComponent].concat(overflowGalleryTiles);\n } else {\n gridTiles = [localVideoComponent].concat(gridTiles);\n }\n }\n\n const overflowGallery = useMemo(() => {\n if (overflowGalleryTiles.length === 0) {\n return null;\n }\n return (\n <OverflowGallery\n isNarrow={isNarrow}\n isShort={isShort}\n shouldFloatLocalVideo={false}\n overflowGalleryElements={overflowGalleryTiles}\n horizontalGalleryStyles={styles?.horizontalGallery}\n verticalGalleryStyles={styles?.verticalGallery}\n overflowGalleryPosition={overflowGalleryPosition}\n onFetchTilesToRender={setIndexesToRender}\n onChildrenPerPageChange={(n: number) => {\n childrenPerPage.current = n;\n }}\n parentWidth={parentWidth}\n />\n );\n }, [\n isNarrow,\n isShort,\n overflowGalleryTiles,\n styles?.horizontalGallery,\n overflowGalleryPosition,\n setIndexesToRender,\n styles?.verticalGallery,\n parentWidth\n ]);\n\n return (\n <Stack\n horizontal={overflowGalleryPosition === 'verticalRight'}\n styles={rootLayoutStyle}\n tokens={videoGalleryLayoutGap}\n >\n {props.overflowGalleryPosition === 'horizontalTop' ? overflowGallery : <></>}\n {screenShareComponent ? (\n screenShareComponent\n ) : (\n <GridLayout key=\"grid-layout\" styles={styles?.gridLayout}>\n {gridTiles}\n </GridLayout>\n )}\n {overflowGalleryTrampoline(overflowGallery, props.overflowGalleryPosition)}\n </Stack>\n );\n};\n\nconst overflowGalleryTrampoline = (\n gallery: JSX.Element | null,\n galleryPosition?: 'horizontalBottom' | 'verticalRight' | 'horizontalTop'\n): JSX.Element | null => {\n return galleryPosition !== 'horizontalTop' ? gallery : <></>;\n return gallery;\n};\n"]}
|
package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js
CHANGED
@@ -12,7 +12,7 @@ import { LARGE_FLOATING_MODAL_SIZE_REM, localVideoTileContainerStyle, localVideo
|
|
12
12
|
import { SHORT_VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM, VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM } from './styles/FloatingLocalVideo.styles';
|
13
13
|
import { innerLayoutStyle, layerHostStyle, rootLayoutStyle } from './styles/FloatingLocalVideoLayout.styles';
|
14
14
|
import { videoGalleryLayoutGap } from './styles/Layout.styles';
|
15
|
-
import { MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY, useOrganizedParticipants } from './utils/videoGalleryLayoutUtils';
|
15
|
+
import { MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY, renderTiles, useOrganizedParticipants } from './utils/videoGalleryLayoutUtils';
|
16
16
|
import { OverflowGallery } from './OverflowGallery';
|
17
17
|
/**
|
18
18
|
* FloatingLocalVideoLayout displays remote participants and a screen sharing component in
|
@@ -41,17 +41,6 @@ export const FloatingLocalVideoLayout = (props) => {
|
|
41
41
|
layout: 'floatingLocalVideo',
|
42
42
|
spotlightedParticipantUserIds
|
43
43
|
});
|
44
|
-
let activeVideoStreams = 0;
|
45
|
-
const gridTiles = gridParticipants.map((p) => {
|
46
|
-
var _a, _b;
|
47
|
-
return onRenderRemoteParticipant(p, maxRemoteVideoStreams && maxRemoteVideoStreams >= 0
|
48
|
-
? ((_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable) && activeVideoStreams++ < maxRemoteVideoStreams
|
49
|
-
: (_b = p.videoStream) === null || _b === void 0 ? void 0 : _b.isAvailable);
|
50
|
-
});
|
51
|
-
const shouldFloatLocalVideo = remoteParticipants.length > 0;
|
52
|
-
if (!shouldFloatLocalVideo && localVideoComponent) {
|
53
|
-
gridTiles.push(localVideoComponent);
|
54
|
-
}
|
55
44
|
/**
|
56
45
|
* instantiate indexes available to render with indexes available that would be on first page
|
57
46
|
*
|
@@ -60,15 +49,11 @@ export const FloatingLocalVideoLayout = (props) => {
|
|
60
49
|
* this case when those components are here
|
61
50
|
*/
|
62
51
|
const [indexesToRender, setIndexesToRender] = useState([]);
|
63
|
-
const overflowGalleryTiles =
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
indexesToRender.includes(i) &&
|
69
|
-
activeVideoStreams++ < maxRemoteVideoStreams
|
70
|
-
: (_b = p.videoStream) === null || _b === void 0 ? void 0 : _b.isAvailable);
|
71
|
-
});
|
52
|
+
const { gridTiles, overflowGalleryTiles } = renderTiles(gridParticipants, onRenderRemoteParticipant, maxRemoteVideoStreams, indexesToRender, overflowGalleryParticipants, dominantSpeakers);
|
53
|
+
const shouldFloatLocalVideo = remoteParticipants.length > 0;
|
54
|
+
if (!shouldFloatLocalVideo && localVideoComponent) {
|
55
|
+
gridTiles.push(localVideoComponent);
|
56
|
+
}
|
72
57
|
const layerHostId = useId('layerhost');
|
73
58
|
const localVideoSizeRem = useMemo(() => {
|
74
59
|
if (isNarrow || localVideoTileSize === '9:16') {
|
package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FloatingLocalVideoLayout.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/FloatingLocalVideoLayout.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,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,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,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC5B,wCAAwC,EACxC,uBAAuB,EACvB,6BAA6B,EAC9B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,8CAA8C,EAC9C,wCAAwC,EACzC,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,uCAAuC,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AACpH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAuBpD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,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,IAAC,MAAM,EAAE,eAAe;QAC3B,0BAA0B;QAC3B,oBAAC,SAAS,IAAC,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,cAAc,CAAC,GAAI;QACtE,oBAAC,KAAK,IACJ,UAAU,EAAE,uBAAuB,KAAK,eAAe,EACvD,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,qBAAqB;YAE5B,KAAK,CAAC,uBAAuB,KAAK,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,yCAAK;YAC3E,oBAAoB,CAAC,CAAC,CAAC,CACtB,oBAAoB,CACrB,CAAC,CAAC,CAAC,CACF,oBAAC,UAAU,IAAC,GAAG,EAAC,aAAa,EAAC,MAAM,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,IACrD,SAAS,CACC,CACd;YACA,yBAAyB,CAAC,eAAe,EAAE,KAAK,CAAC,uBAAuB,CAAC,CACpE,CACF,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAChC,OAA2B,EAC3B,eAAwE,EACpD,EAAE;IACtB,OAAO,eAAe,KAAK,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,yCAAK,CAAC;IAC7D,OAAO,OAAO,CAAC;AACjB,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, { useMemo, useRef, useState } from 'react';\nimport { useTheme } from '../../theming';\nimport { GridLayout } from '../GridLayout';\nimport { isNarrowWidth } from '../utils/responsive';\nimport { isShortHeight } from '../utils/responsive';\nimport { FloatingLocalVideo } from './FloatingLocalVideo';\nimport { LayoutProps } from './Layout';\nimport {\n LARGE_FLOATING_MODAL_SIZE_REM,\n localVideoTileContainerStyle,\n localVideoTileWithControlsContainerStyle,\n LOCAL_VIDEO_TILE_ZINDEX,\n SMALL_FLOATING_MODAL_SIZE_REM\n} from './styles/FloatingLocalVideo.styles';\nimport {\n SHORT_VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM,\n VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM\n} from './styles/FloatingLocalVideo.styles';\nimport { innerLayoutStyle, layerHostStyle, rootLayoutStyle } from './styles/FloatingLocalVideoLayout.styles';\nimport { videoGalleryLayoutGap } from './styles/Layout.styles';\nimport { MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY, useOrganizedParticipants } from './utils/videoGalleryLayoutUtils';\nimport { OverflowGallery } from './OverflowGallery';\nimport { LocalVideoTileSize } from '../VideoGallery';\n\n/**\n * Props for {@link FloatingLocalVideoLayout}.\n *\n * @private\n */\nexport interface FloatingLocalVideoLayoutProps extends LayoutProps {\n /**\n * Whether to display the local video camera switcher button\n */\n showCameraSwitcherInLocalPreview?: boolean;\n /**\n * Height of parent element\n */\n parentHeight?: number;\n /**\n * Local video tile mode\n */\n localVideoTileSize?: LocalVideoTileSize;\n}\n\n/**\n * FloatingLocalVideoLayout displays remote participants and a screen sharing component in\n * a grid and overflow gallery while floating the local video\n *\n * @private\n */\nexport const FloatingLocalVideoLayout = (props: FloatingLocalVideoLayoutProps): JSX.Element => {\n const {\n remoteParticipants = [],\n dominantSpeakers,\n localVideoComponent,\n screenShareComponent,\n onRenderRemoteParticipant,\n styles,\n maxRemoteVideoStreams,\n showCameraSwitcherInLocalPreview,\n parentWidth,\n parentHeight,\n overflowGalleryPosition = 'horizontalBottom',\n pinnedParticipantUserIds = [],\n localVideoTileSize,\n spotlightedParticipantUserIds\n } = props;\n\n const theme = useTheme();\n\n const isNarrow = parentWidth ? isNarrowWidth(parentWidth) : false;\n\n const isShort = parentHeight ? isShortHeight(parentHeight) : false;\n\n // This is for tracking the number of children in the first page of overflow gallery.\n // This number will be used for the maxOverflowGalleryDominantSpeakers when organizing the remote participants.\n const childrenPerPage = useRef(4);\n const remoteVideosOn = remoteParticipants.filter((p) => p.videoStream?.isAvailable).length > 0;\n const { gridParticipants, overflowGalleryParticipants } = useOrganizedParticipants({\n remoteParticipants,\n dominantSpeakers,\n maxGridParticipants: remoteVideosOn ? maxRemoteVideoStreams : MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY,\n isScreenShareActive: !!screenShareComponent,\n maxOverflowGalleryDominantSpeakers: screenShareComponent\n ? childrenPerPage.current - (pinnedParticipantUserIds.length % childrenPerPage.current)\n : childrenPerPage.current,\n pinnedParticipantUserIds,\n layout: 'floatingLocalVideo',\n spotlightedParticipantUserIds\n });\n\n let activeVideoStreams = 0;\n\n const gridTiles = 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 const shouldFloatLocalVideo = remoteParticipants.length > 0;\n\n if (!shouldFloatLocalVideo && localVideoComponent) {\n gridTiles.push(localVideoComponent);\n }\n\n /**\n * instantiate indexes available to render with indexes available that would be on first page\n *\n * For some components which do not strictly follow the order of the array, we might\n * re-render the initial tiles -> dispose them -> create new tiles, we need to take care of\n * this case when those components are here\n */\n const [indexesToRender, setIndexesToRender] = useState<number[]>([]);\n\n const overflowGalleryTiles = overflowGalleryParticipants.map((p, i) => {\n return onRenderRemoteParticipant(\n p,\n maxRemoteVideoStreams && maxRemoteVideoStreams >= 0\n ? p.videoStream?.isAvailable &&\n indexesToRender &&\n indexesToRender.includes(i) &&\n activeVideoStreams++ < maxRemoteVideoStreams\n : p.videoStream?.isAvailable\n );\n });\n\n const layerHostId = useId('layerhost');\n\n const localVideoSizeRem = useMemo(() => {\n if (isNarrow || localVideoTileSize === '9:16') {\n return SMALL_FLOATING_MODAL_SIZE_REM;\n }\n if ((overflowGalleryTiles.length > 0 || screenShareComponent) && overflowGalleryPosition === 'verticalRight') {\n return isNarrow\n ? SMALL_FLOATING_MODAL_SIZE_REM\n : isShort\n ? SHORT_VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM\n : VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM;\n }\n if ((overflowGalleryTiles.length > 0 || screenShareComponent) && overflowGalleryPosition === 'horizontalBottom') {\n return localVideoTileSize === '16:9' || !isNarrow ? LARGE_FLOATING_MODAL_SIZE_REM : SMALL_FLOATING_MODAL_SIZE_REM;\n }\n return LARGE_FLOATING_MODAL_SIZE_REM;\n }, [\n overflowGalleryTiles.length,\n isNarrow,\n screenShareComponent,\n isShort,\n overflowGalleryPosition,\n localVideoTileSize\n ]);\n\n const wrappedLocalVideoComponent =\n (localVideoComponent && shouldFloatLocalVideo) || (screenShareComponent && localVideoComponent) ? (\n // When we use showCameraSwitcherInLocalPreview it disables dragging to allow keyboard navigation.\n showCameraSwitcherInLocalPreview ? (\n <Stack\n className={mergeStyles(localVideoTileWithControlsContainerStyle(theme, localVideoSizeRem), {\n boxShadow: theme.effects.elevation8,\n zIndex: LOCAL_VIDEO_TILE_ZINDEX\n })}\n >\n {localVideoComponent}\n </Stack>\n ) : overflowGalleryTiles.length > 0 || screenShareComponent ? (\n <Stack\n className={mergeStyles(\n localVideoTileContainerStyle(theme, localVideoSizeRem, !!screenShareComponent, overflowGalleryPosition)\n )}\n >\n {localVideoComponent}\n </Stack>\n ) : (\n <FloatingLocalVideo\n localVideoComponent={localVideoComponent}\n layerHostId={layerHostId}\n localVideoSizeRem={localVideoSizeRem}\n parentWidth={parentWidth}\n parentHeight={parentHeight}\n />\n )\n ) : undefined;\n\n const overflowGallery = useMemo(() => {\n if (overflowGalleryTiles.length === 0 && !screenShareComponent) {\n return null;\n }\n return (\n <OverflowGallery\n isShort={isShort}\n onFetchTilesToRender={setIndexesToRender}\n isNarrow={isNarrow}\n shouldFloatLocalVideo={!!localVideoComponent}\n overflowGalleryElements={overflowGalleryTiles}\n horizontalGalleryStyles={styles?.horizontalGallery}\n verticalGalleryStyles={styles?.verticalGallery}\n overflowGalleryPosition={overflowGalleryPosition}\n onChildrenPerPageChange={(n: number) => {\n childrenPerPage.current = n;\n }}\n parentWidth={parentWidth}\n />\n );\n }, [\n isNarrow,\n isShort,\n screenShareComponent,\n overflowGalleryTiles,\n styles?.horizontalGallery,\n overflowGalleryPosition,\n setIndexesToRender,\n styles?.verticalGallery,\n parentWidth,\n localVideoComponent\n ]);\n\n return (\n <Stack styles={rootLayoutStyle}>\n {wrappedLocalVideoComponent}\n <LayerHost id={layerHostId} className={mergeStyles(layerHostStyle)} />\n <Stack\n horizontal={overflowGalleryPosition === 'verticalRight'}\n styles={innerLayoutStyle}\n tokens={videoGalleryLayoutGap}\n >\n {props.overflowGalleryPosition === 'horizontalTop' ? overflowGallery : <></>}\n {screenShareComponent ? (\n screenShareComponent\n ) : (\n <GridLayout key=\"grid-layout\" styles={styles?.gridLayout}>\n {gridTiles}\n </GridLayout>\n )}\n {overflowGalleryTrampoline(overflowGallery, props.overflowGalleryPosition)}\n </Stack>\n </Stack>\n );\n};\n\nconst overflowGalleryTrampoline = (\n gallery: JSX.Element | null,\n galleryPosition?: 'horizontalBottom' | 'verticalRight' | 'horizontalTop'\n): JSX.Element | null => {\n return galleryPosition !== 'horizontalTop' ? gallery : <></>;\n return gallery;\n};\n"]}
|
1
|
+
{"version":3,"file":"FloatingLocalVideoLayout.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/FloatingLocalVideoLayout.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,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,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IAEH,OAAO,CACL,oBAAC,KAAK,IAAC,MAAM,EAAE,eAAe;QAC3B,0BAA0B;QAC3B,oBAAC,SAAS,IAAC,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,cAAc,CAAC,GAAI;QACtE,oBAAC,KAAK,IACJ,UAAU,EAAE,uBAAuB,KAAK,eAAe,EACvD,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,qBAAqB;YAE5B,KAAK,CAAC,uBAAuB,KAAK,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,yCAAK;YAC3E,oBAAoB,CAAC,CAAC,CAAC,CACtB,oBAAoB,CACrB,CAAC,CAAC,CAAC,CACF,oBAAC,UAAU,IAAC,GAAG,EAAC,aAAa,EAAC,MAAM,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,IACrD,SAAS,CACC,CACd;YACA,yBAAyB,CAAC,eAAe,EAAE,KAAK,CAAC,uBAAuB,CAAC,CACpE,CACF,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAChC,OAA2B,EAC3B,eAAwE,EACpD,EAAE;IACtB,OAAO,eAAe,KAAK,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,yCAAK,CAAC;IAC7D,OAAO,OAAO,CAAC;AACjB,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, { useMemo, useRef, useState } from 'react';\nimport { useTheme } from '../../theming';\nimport { GridLayout } from '../GridLayout';\nimport { isNarrowWidth } from '../utils/responsive';\nimport { isShortHeight } from '../utils/responsive';\nimport { FloatingLocalVideo } from './FloatingLocalVideo';\nimport { LayoutProps } from './Layout';\nimport {\n LARGE_FLOATING_MODAL_SIZE_REM,\n localVideoTileContainerStyle,\n localVideoTileWithControlsContainerStyle,\n LOCAL_VIDEO_TILE_ZINDEX,\n SMALL_FLOATING_MODAL_SIZE_REM\n} from './styles/FloatingLocalVideo.styles';\nimport {\n SHORT_VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM,\n VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM\n} from './styles/FloatingLocalVideo.styles';\nimport { innerLayoutStyle, layerHostStyle, rootLayoutStyle } from './styles/FloatingLocalVideoLayout.styles';\nimport { videoGalleryLayoutGap } from './styles/Layout.styles';\nimport {\n MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY,\n renderTiles,\n useOrganizedParticipants\n} from './utils/videoGalleryLayoutUtils';\nimport { OverflowGallery } from './OverflowGallery';\nimport { LocalVideoTileSize } from '../VideoGallery';\n\n/**\n * Props for {@link FloatingLocalVideoLayout}.\n *\n * @private\n */\nexport interface FloatingLocalVideoLayoutProps extends LayoutProps {\n /**\n * Whether to display the local video camera switcher button\n */\n showCameraSwitcherInLocalPreview?: boolean;\n /**\n * Height of parent element\n */\n parentHeight?: number;\n /**\n * Local video tile mode\n */\n localVideoTileSize?: LocalVideoTileSize;\n}\n\n/**\n * FloatingLocalVideoLayout displays remote participants and a screen sharing component in\n * a grid and overflow gallery while floating the local video\n *\n * @private\n */\nexport const FloatingLocalVideoLayout = (props: FloatingLocalVideoLayoutProps): JSX.Element => {\n const {\n remoteParticipants = [],\n dominantSpeakers,\n localVideoComponent,\n screenShareComponent,\n onRenderRemoteParticipant,\n styles,\n maxRemoteVideoStreams,\n showCameraSwitcherInLocalPreview,\n parentWidth,\n parentHeight,\n overflowGalleryPosition = 'horizontalBottom',\n pinnedParticipantUserIds = [],\n localVideoTileSize,\n spotlightedParticipantUserIds\n } = props;\n\n const theme = useTheme();\n\n const isNarrow = parentWidth ? isNarrowWidth(parentWidth) : false;\n\n const isShort = parentHeight ? isShortHeight(parentHeight) : false;\n\n // This is for tracking the number of children in the first page of overflow gallery.\n // This number will be used for the maxOverflowGalleryDominantSpeakers when organizing the remote participants.\n const childrenPerPage = useRef(4);\n const remoteVideosOn = remoteParticipants.filter((p) => p.videoStream?.isAvailable).length > 0;\n const { gridParticipants, overflowGalleryParticipants } = useOrganizedParticipants({\n remoteParticipants,\n dominantSpeakers,\n maxGridParticipants: remoteVideosOn ? maxRemoteVideoStreams : MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY,\n isScreenShareActive: !!screenShareComponent,\n maxOverflowGalleryDominantSpeakers: screenShareComponent\n ? childrenPerPage.current - (pinnedParticipantUserIds.length % childrenPerPage.current)\n : childrenPerPage.current,\n pinnedParticipantUserIds,\n layout: 'floatingLocalVideo',\n spotlightedParticipantUserIds\n });\n\n /**\n * instantiate indexes available to render with indexes available that would be on first page\n *\n * For some components which do not strictly follow the order of the array, we might\n * re-render the initial tiles -> dispose them -> create new tiles, we need to take care of\n * this case when those components are here\n */\n const [indexesToRender, setIndexesToRender] = useState<number[]>([]);\n\n const { gridTiles, overflowGalleryTiles } = renderTiles(\n gridParticipants,\n onRenderRemoteParticipant,\n maxRemoteVideoStreams,\n indexesToRender,\n overflowGalleryParticipants,\n dominantSpeakers\n );\n\n const shouldFloatLocalVideo = remoteParticipants.length > 0;\n\n if (!shouldFloatLocalVideo && localVideoComponent) {\n gridTiles.push(localVideoComponent);\n }\n\n const layerHostId = useId('layerhost');\n\n const localVideoSizeRem = useMemo(() => {\n if (isNarrow || localVideoTileSize === '9:16') {\n return SMALL_FLOATING_MODAL_SIZE_REM;\n }\n if ((overflowGalleryTiles.length > 0 || screenShareComponent) && overflowGalleryPosition === 'verticalRight') {\n return isNarrow\n ? SMALL_FLOATING_MODAL_SIZE_REM\n : isShort\n ? SHORT_VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM\n : VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM;\n }\n if ((overflowGalleryTiles.length > 0 || screenShareComponent) && overflowGalleryPosition === 'horizontalBottom') {\n return localVideoTileSize === '16:9' || !isNarrow ? LARGE_FLOATING_MODAL_SIZE_REM : SMALL_FLOATING_MODAL_SIZE_REM;\n }\n return LARGE_FLOATING_MODAL_SIZE_REM;\n }, [\n overflowGalleryTiles.length,\n isNarrow,\n screenShareComponent,\n isShort,\n overflowGalleryPosition,\n localVideoTileSize\n ]);\n\n const wrappedLocalVideoComponent =\n (localVideoComponent && shouldFloatLocalVideo) || (screenShareComponent && localVideoComponent) ? (\n // When we use showCameraSwitcherInLocalPreview it disables dragging to allow keyboard navigation.\n showCameraSwitcherInLocalPreview ? (\n <Stack\n className={mergeStyles(localVideoTileWithControlsContainerStyle(theme, localVideoSizeRem), {\n boxShadow: theme.effects.elevation8,\n zIndex: LOCAL_VIDEO_TILE_ZINDEX\n })}\n >\n {localVideoComponent}\n </Stack>\n ) : overflowGalleryTiles.length > 0 || screenShareComponent ? (\n <Stack\n className={mergeStyles(\n localVideoTileContainerStyle(theme, localVideoSizeRem, !!screenShareComponent, overflowGalleryPosition)\n )}\n >\n {localVideoComponent}\n </Stack>\n ) : (\n <FloatingLocalVideo\n localVideoComponent={localVideoComponent}\n layerHostId={layerHostId}\n localVideoSizeRem={localVideoSizeRem}\n parentWidth={parentWidth}\n parentHeight={parentHeight}\n />\n )\n ) : undefined;\n\n const overflowGallery = useMemo(() => {\n if (overflowGalleryTiles.length === 0 && !screenShareComponent) {\n return null;\n }\n return (\n <OverflowGallery\n isShort={isShort}\n onFetchTilesToRender={setIndexesToRender}\n isNarrow={isNarrow}\n shouldFloatLocalVideo={!!localVideoComponent}\n overflowGalleryElements={overflowGalleryTiles}\n horizontalGalleryStyles={styles?.horizontalGallery}\n verticalGalleryStyles={styles?.verticalGallery}\n overflowGalleryPosition={overflowGalleryPosition}\n onChildrenPerPageChange={(n: number) => {\n childrenPerPage.current = n;\n }}\n parentWidth={parentWidth}\n />\n );\n }, [\n isNarrow,\n isShort,\n screenShareComponent,\n overflowGalleryTiles,\n styles?.horizontalGallery,\n overflowGalleryPosition,\n setIndexesToRender,\n styles?.verticalGallery,\n parentWidth,\n localVideoComponent\n ]);\n\n return (\n <Stack styles={rootLayoutStyle}>\n {wrappedLocalVideoComponent}\n <LayerHost id={layerHostId} className={mergeStyles(layerHostStyle)} />\n <Stack\n horizontal={overflowGalleryPosition === 'verticalRight'}\n styles={innerLayoutStyle}\n tokens={videoGalleryLayoutGap}\n >\n {props.overflowGalleryPosition === 'horizontalTop' ? overflowGallery : <></>}\n {screenShareComponent ? (\n screenShareComponent\n ) : (\n <GridLayout key=\"grid-layout\" styles={styles?.gridLayout}>\n {gridTiles}\n </GridLayout>\n )}\n {overflowGalleryTrampoline(overflowGallery, props.overflowGalleryPosition)}\n </Stack>\n </Stack>\n );\n};\n\nconst overflowGalleryTrampoline = (\n gallery: JSX.Element | null,\n galleryPosition?: 'horizontalBottom' | 'verticalRight' | 'horizontalTop'\n): JSX.Element | null => {\n return galleryPosition !== 'horizontalTop' ? gallery : <></>;\n return gallery;\n};\n"]}
|
@@ -6,7 +6,7 @@ import { isShortHeight } from '../utils/responsive';
|
|
6
6
|
import { OverflowGallery } from './OverflowGallery';
|
7
7
|
import { GridLayout } from '../GridLayout';
|
8
8
|
import { Stack } from '@fluentui/react';
|
9
|
-
import { useOrganizedParticipants } from './utils/videoGalleryLayoutUtils';
|
9
|
+
import { renderTiles, useOrganizedParticipants } from './utils/videoGalleryLayoutUtils';
|
10
10
|
import { rootLayoutStyle } from './styles/DefaultLayout.styles';
|
11
11
|
import { videoGalleryLayoutGap } from './styles/Layout.styles';
|
12
12
|
import { VERTICAL_GALLERY_TILE_SIZE_REM } from './styles/VideoGalleryResponsiveVerticalGallery.styles';
|
@@ -46,13 +46,6 @@ export const LargeGalleryLayout = (props) => {
|
|
46
46
|
/* @conditional-compile-remove(large-gallery) */ layout: 'largeGallery',
|
47
47
|
spotlightedParticipantUserIds
|
48
48
|
});
|
49
|
-
let activeVideoStreams = 0;
|
50
|
-
let gridTiles = gridParticipants.map((p) => {
|
51
|
-
var _a, _b;
|
52
|
-
return onRenderRemoteParticipant(p, maxRemoteVideoStreams && maxRemoteVideoStreams >= 0
|
53
|
-
? ((_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable) && activeVideoStreams++ < maxRemoteVideoStreams
|
54
|
-
: (_b = p.videoStream) === null || _b === void 0 ? void 0 : _b.isAvailable);
|
55
|
-
});
|
56
49
|
/**
|
57
50
|
* instantiate indexes available to render with indexes available that would be on first page
|
58
51
|
*
|
@@ -61,12 +54,7 @@ export const LargeGalleryLayout = (props) => {
|
|
61
54
|
* this case when those components are here
|
62
55
|
*/
|
63
56
|
const [indexesToRender, setIndexesToRender] = useState([]);
|
64
|
-
let overflowGalleryTiles =
|
65
|
-
var _a, _b;
|
66
|
-
return onRenderRemoteParticipant(p, maxRemoteVideoStreams && maxRemoteVideoStreams >= 0
|
67
|
-
? ((_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable) && indexesToRender.includes(i) && activeVideoStreams++ < maxRemoteVideoStreams
|
68
|
-
: (_b = p.videoStream) === null || _b === void 0 ? void 0 : _b.isAvailable);
|
69
|
-
});
|
57
|
+
let { gridTiles, overflowGalleryTiles } = renderTiles(gridParticipants, onRenderRemoteParticipant, maxRemoteVideoStreams, indexesToRender, overflowGalleryParticipants, dominantSpeakers);
|
70
58
|
if (localVideoComponent) {
|
71
59
|
if (screenShareComponent || spotlightedParticipantUserIds.length > 0) {
|
72
60
|
overflowGalleryTiles = [localVideoComponent].concat(overflowGalleryTiles);
|
package/dist/dist-esm/react-components/src/components/VideoGallery/LargeGalleryLayout.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LargeGalleryLayout.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/LargeGalleryLayout.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC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ACpC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useMemo, useRef, useState } from 'react';\nimport { isNarrowWidth } from '../utils/responsive';\nimport { isShortHeight } from '../utils/responsive';\nimport { LayoutProps } from './Layout';\nimport { OverflowGallery } from './OverflowGallery';\nimport { GridLayout } from '../GridLayout';\nimport { Stack } from '@fluentui/react';\nimport { useOrganizedParticipants } from './utils/videoGalleryLayoutUtils';\nimport { rootLayoutStyle } from './styles/DefaultLayout.styles';\nimport { videoGalleryLayoutGap } from './styles/Layout.styles';\nimport { VERTICAL_GALLERY_TILE_SIZE_REM } from './styles/VideoGalleryResponsiveVerticalGallery.styles';\n\n/**\n * Props for {@link LargeGalleryLayout}.\n *\n * @private\n */\nexport type LargeGalleryProps = LayoutProps;\n\nconst DEFAULT_CHILDREN_PER_PAGE = 5;\nconst REM_TO_PIXEL = 16;\nconst LARGE_GALLERY_PARTICIPANT_CAP = 48;\n/**\n * VideoGallery Layout for when user is in a large meeting and wants to see more participants\n *\n * Caps the number of tiles that a participant can see in the grid to 49, Video and Audio.\n *\n * @private\n */\nexport const LargeGalleryLayout = (props: LargeGalleryProps): JSX.Element => {\n const {\n remoteParticipants = [],\n localParticipant,\n dominantSpeakers,\n localVideoComponent,\n screenShareComponent,\n onRenderRemoteParticipant,\n styles,\n maxRemoteVideoStreams,\n parentWidth,\n parentHeight,\n pinnedParticipantUserIds = [],\n overflowGalleryPosition = 'horizontalBottom',\n spotlightedParticipantUserIds = []\n } = props;\n\n const isNarrow = parentWidth ? isNarrowWidth(parentWidth) : false;\n const isShort = parentHeight ? isShortHeight(parentHeight) : false;\n\n const maxStreamsTrampoline = (): number => {\n return parentWidth && parentHeight\n ? calculateMaxTilesInLargeGrid(parentWidth, parentHeight)\n : maxRemoteVideoStreams;\n };\n\n // This is for tracking the number of children in the first page of overflow gallery.\n // This number will be used for the maxOverflowGalleryDominantSpeakers when organizing the remote participants.\n // We need to add the local participant to the pinned participant count so we are placing the speakers correctly.\n const childrenPerPage = useRef(DEFAULT_CHILDREN_PER_PAGE);\n const { gridParticipants, overflowGalleryParticipants } = useOrganizedParticipants({\n remoteParticipants,\n localParticipant,\n dominantSpeakers,\n maxGridParticipants: maxStreamsTrampoline(),\n isScreenShareActive: !!screenShareComponent,\n maxOverflowGalleryDominantSpeakers: screenShareComponent\n ? childrenPerPage.current - ((pinnedParticipantUserIds.length + 1) % childrenPerPage.current)\n : childrenPerPage.current,\n pinnedParticipantUserIds,\n /* @conditional-compile-remove(large-gallery) */ layout: 'largeGallery',\n spotlightedParticipantUserIds\n });\n let activeVideoStreams = 0;\n\n let gridTiles = 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 /**\n * instantiate indexes available to render with indexes available that would be on first page\n *\n * For some components which do not strictly follow the order of the array, we might\n * re-render the initial tiles -> dispose them -> create new tiles, we need to take care of\n * this case when those components are here\n */\n const [indexesToRender, setIndexesToRender] = useState<number[]>([]);\n\n let overflowGalleryTiles = overflowGalleryParticipants.map((p, i) => {\n return onRenderRemoteParticipant(\n p,\n maxRemoteVideoStreams && maxRemoteVideoStreams >= 0\n ? p.videoStream?.isAvailable && indexesToRender.includes(i) && activeVideoStreams++ < maxRemoteVideoStreams\n : p.videoStream?.isAvailable\n );\n });\n\n if (localVideoComponent) {\n if (screenShareComponent || spotlightedParticipantUserIds.length > 0) {\n overflowGalleryTiles = [localVideoComponent].concat(overflowGalleryTiles);\n } else {\n gridTiles = [localVideoComponent].concat(gridTiles);\n }\n }\n\n const overflowGallery = useMemo(() => {\n if (overflowGalleryTiles.length === 0) {\n return null;\n }\n return (\n <OverflowGallery\n isNarrow={isNarrow}\n isShort={isShort}\n shouldFloatLocalVideo={false}\n overflowGalleryElements={overflowGalleryTiles}\n horizontalGalleryStyles={styles?.horizontalGallery}\n verticalGalleryStyles={styles?.verticalGallery}\n overflowGalleryPosition={overflowGalleryPosition}\n onFetchTilesToRender={setIndexesToRender}\n onChildrenPerPageChange={(n: number) => {\n childrenPerPage.current = n;\n }}\n parentWidth={parentWidth}\n />\n );\n }, [\n isNarrow,\n isShort,\n overflowGalleryTiles,\n styles?.horizontalGallery,\n overflowGalleryPosition,\n setIndexesToRender,\n styles?.verticalGallery,\n parentWidth\n ]);\n\n return (\n <Stack\n horizontal={overflowGalleryPosition === 'verticalRight'}\n styles={rootLayoutStyle}\n tokens={videoGalleryLayoutGap}\n >\n {props.overflowGalleryPosition === 'horizontalTop' ? overflowGallery : <></>}\n {screenShareComponent ? (\n screenShareComponent\n ) : (\n <GridLayout key=\"grid-layout\" styles={styles?.gridLayout}>\n {gridTiles}\n </GridLayout>\n )}\n {overflowGalleryTrampoline(overflowGallery, props.overflowGalleryPosition)}\n </Stack>\n );\n};\n\nconst overflowGalleryTrampoline = (\n gallery: JSX.Element | null,\n galleryPosition?: 'horizontalBottom' | 'verticalRight' | 'horizontalTop'\n): JSX.Element | null => {\n return galleryPosition !== 'horizontalTop' ? gallery : <></>;\n return gallery;\n};\n\nconst calculateMaxTilesInLargeGrid = (parentWidth: number, parentHeight: number): number => {\n const xAxisTiles = Math.floor(parentWidth / (VERTICAL_GALLERY_TILE_SIZE_REM.width * REM_TO_PIXEL));\n const yAxisTiles = Math.floor(parentHeight / (VERTICAL_GALLERY_TILE_SIZE_REM.minHeight * REM_TO_PIXEL));\n return xAxisTiles * yAxisTiles < LARGE_GALLERY_PARTICIPANT_CAP\n ? xAxisTiles * yAxisTiles\n : LARGE_GALLERY_PARTICIPANT_CAP;\n};\n"]}
|
1
|
+
{"version":3,"file":"LargeGalleryLayout.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/LargeGalleryLayout.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,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IACrD,SAAS,CACC,CACd;QACA,yBAAyB,CAAC,eAAe,EAAE,KAAK,CAAC,uBAAuB,CAAC,CACpE,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAChC,OAA2B,EAC3B,eAAwE,EACpD,EAAE;IACtB,OAAO,eAAe,KAAK,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,yCAAK,CAAC;IAC7D,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,4BAA4B,GAAG,CAAC,WAAmB,EAAE,YAAoB,EAAU,EAAE;IACzF,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,CAAC,8BAA8B,CAAC,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC;IACnG,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,CAAC,8BAA8B,CAAC,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC;IACxG,OAAO,UAAU,GAAG,UAAU,GAAG,6BAA6B;QAC5D,CAAC,CAAC,UAAU,GAAG,UAAU;QACzB,CAAC,CAAC,6BAA6B,CAAC;AACpC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useMemo, useRef, useState } from 'react';\nimport { isNarrowWidth } from '../utils/responsive';\nimport { isShortHeight } from '../utils/responsive';\nimport { LayoutProps } from './Layout';\nimport { OverflowGallery } from './OverflowGallery';\nimport { GridLayout } from '../GridLayout';\nimport { Stack } from '@fluentui/react';\nimport { renderTiles, useOrganizedParticipants } from './utils/videoGalleryLayoutUtils';\nimport { rootLayoutStyle } from './styles/DefaultLayout.styles';\nimport { videoGalleryLayoutGap } from './styles/Layout.styles';\nimport { VERTICAL_GALLERY_TILE_SIZE_REM } from './styles/VideoGalleryResponsiveVerticalGallery.styles';\n\n/**\n * Props for {@link LargeGalleryLayout}.\n *\n * @private\n */\nexport type LargeGalleryProps = LayoutProps;\n\nconst DEFAULT_CHILDREN_PER_PAGE = 5;\nconst REM_TO_PIXEL = 16;\nconst LARGE_GALLERY_PARTICIPANT_CAP = 48;\n/**\n * VideoGallery Layout for when user is in a large meeting and wants to see more participants\n *\n * Caps the number of tiles that a participant can see in the grid to 49, Video and Audio.\n *\n * @private\n */\nexport const LargeGalleryLayout = (props: LargeGalleryProps): JSX.Element => {\n const {\n remoteParticipants = [],\n localParticipant,\n dominantSpeakers,\n localVideoComponent,\n screenShareComponent,\n onRenderRemoteParticipant,\n styles,\n maxRemoteVideoStreams,\n parentWidth,\n parentHeight,\n pinnedParticipantUserIds = [],\n overflowGalleryPosition = 'horizontalBottom',\n spotlightedParticipantUserIds = []\n } = props;\n\n const isNarrow = parentWidth ? isNarrowWidth(parentWidth) : false;\n const isShort = parentHeight ? isShortHeight(parentHeight) : false;\n\n const maxStreamsTrampoline = (): number => {\n return parentWidth && parentHeight\n ? calculateMaxTilesInLargeGrid(parentWidth, parentHeight)\n : maxRemoteVideoStreams;\n };\n\n // This is for tracking the number of children in the first page of overflow gallery.\n // This number will be used for the maxOverflowGalleryDominantSpeakers when organizing the remote participants.\n // We need to add the local participant to the pinned participant count so we are placing the speakers correctly.\n const childrenPerPage = useRef(DEFAULT_CHILDREN_PER_PAGE);\n const { gridParticipants, overflowGalleryParticipants } = useOrganizedParticipants({\n remoteParticipants,\n localParticipant,\n dominantSpeakers,\n maxGridParticipants: maxStreamsTrampoline(),\n isScreenShareActive: !!screenShareComponent,\n maxOverflowGalleryDominantSpeakers: screenShareComponent\n ? childrenPerPage.current - ((pinnedParticipantUserIds.length + 1) % childrenPerPage.current)\n : childrenPerPage.current,\n pinnedParticipantUserIds,\n /* @conditional-compile-remove(large-gallery) */ layout: 'largeGallery',\n spotlightedParticipantUserIds\n });\n\n /**\n * instantiate indexes available to render with indexes available that would be on first page\n *\n * For some components which do not strictly follow the order of the array, we might\n * re-render the initial tiles -> dispose them -> create new tiles, we need to take care of\n * this case when those components are here\n */\n const [indexesToRender, setIndexesToRender] = useState<number[]>([]);\n\n let { gridTiles, overflowGalleryTiles } = renderTiles(\n gridParticipants,\n onRenderRemoteParticipant,\n maxRemoteVideoStreams,\n indexesToRender,\n overflowGalleryParticipants,\n dominantSpeakers\n );\n\n if (localVideoComponent) {\n if (screenShareComponent || spotlightedParticipantUserIds.length > 0) {\n overflowGalleryTiles = [localVideoComponent].concat(overflowGalleryTiles);\n } else {\n gridTiles = [localVideoComponent].concat(gridTiles);\n }\n }\n\n const overflowGallery = useMemo(() => {\n if (overflowGalleryTiles.length === 0) {\n return null;\n }\n return (\n <OverflowGallery\n isNarrow={isNarrow}\n isShort={isShort}\n shouldFloatLocalVideo={false}\n overflowGalleryElements={overflowGalleryTiles}\n horizontalGalleryStyles={styles?.horizontalGallery}\n verticalGalleryStyles={styles?.verticalGallery}\n overflowGalleryPosition={overflowGalleryPosition}\n onFetchTilesToRender={setIndexesToRender}\n onChildrenPerPageChange={(n: number) => {\n childrenPerPage.current = n;\n }}\n parentWidth={parentWidth}\n />\n );\n }, [\n isNarrow,\n isShort,\n overflowGalleryTiles,\n styles?.horizontalGallery,\n overflowGalleryPosition,\n setIndexesToRender,\n styles?.verticalGallery,\n parentWidth\n ]);\n\n return (\n <Stack\n horizontal={overflowGalleryPosition === 'verticalRight'}\n styles={rootLayoutStyle}\n tokens={videoGalleryLayoutGap}\n >\n {props.overflowGalleryPosition === 'horizontalTop' ? overflowGallery : <></>}\n {screenShareComponent ? (\n screenShareComponent\n ) : (\n <GridLayout key=\"grid-layout\" styles={styles?.gridLayout}>\n {gridTiles}\n </GridLayout>\n )}\n {overflowGalleryTrampoline(overflowGallery, props.overflowGalleryPosition)}\n </Stack>\n );\n};\n\nconst overflowGalleryTrampoline = (\n gallery: JSX.Element | null,\n galleryPosition?: 'horizontalBottom' | 'verticalRight' | 'horizontalTop'\n): JSX.Element | null => {\n return galleryPosition !== 'horizontalTop' ? gallery : <></>;\n return gallery;\n};\n\nconst calculateMaxTilesInLargeGrid = (parentWidth: number, parentHeight: number): number => {\n const xAxisTiles = Math.floor(parentWidth / (VERTICAL_GALLERY_TILE_SIZE_REM.width * REM_TO_PIXEL));\n const yAxisTiles = Math.floor(parentHeight / (VERTICAL_GALLERY_TILE_SIZE_REM.minHeight * REM_TO_PIXEL));\n return xAxisTiles * yAxisTiles < LARGE_GALLERY_PARTICIPANT_CAP\n ? xAxisTiles * yAxisTiles\n : LARGE_GALLERY_PARTICIPANT_CAP;\n};\n"]}
|
@@ -7,7 +7,7 @@ import React, { useMemo, useRef, useState } from 'react';
|
|
7
7
|
import { OverflowGallery } from './OverflowGallery';
|
8
8
|
import { SMALL_FLOATING_MODAL_SIZE_REM, LARGE_FLOATING_MODAL_SIZE_REM, localVideoTileContainerStyle } from './styles/FloatingLocalVideo.styles';
|
9
9
|
import { VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM, SHORT_VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM } from './styles/FloatingLocalVideo.styles';
|
10
|
-
import { useOrganizedParticipants } from './utils/videoGalleryLayoutUtils';
|
10
|
+
import { renderTiles, useOrganizedParticipants } from './utils/videoGalleryLayoutUtils';
|
11
11
|
import { GridLayout } from '../GridLayout';
|
12
12
|
import { rootLayoutStyle } from './styles/FloatingLocalVideoLayout.styles';
|
13
13
|
import { layerHostStyle, innerLayoutStyle } from './styles/FloatingLocalVideoLayout.styles';
|
@@ -37,17 +37,6 @@ export const SpeakerVideoLayout = (props) => {
|
|
37
37
|
pinnedParticipantUserIds,
|
38
38
|
layout: 'speaker'
|
39
39
|
});
|
40
|
-
let activeVideoStreams = 0;
|
41
|
-
const gridTiles = gridParticipants.map((p) => {
|
42
|
-
var _a, _b;
|
43
|
-
return onRenderRemoteParticipant(p, maxRemoteVideoStreams && maxRemoteVideoStreams >= 0
|
44
|
-
? ((_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable) && activeVideoStreams++ < maxRemoteVideoStreams
|
45
|
-
: (_b = p.videoStream) === null || _b === void 0 ? void 0 : _b.isAvailable);
|
46
|
-
});
|
47
|
-
const shouldFloatLocalVideo = remoteParticipants.length > 0;
|
48
|
-
if (!shouldFloatLocalVideo && localVideoComponent) {
|
49
|
-
gridTiles.push(localVideoComponent);
|
50
|
-
}
|
51
40
|
/**
|
52
41
|
* instantiate indexes available to render with indexes available that would be on first page
|
53
42
|
*
|
@@ -56,15 +45,11 @@ export const SpeakerVideoLayout = (props) => {
|
|
56
45
|
* this case when those components are here
|
57
46
|
*/
|
58
47
|
const [indexesToRender, setIndexesToRender] = useState([]);
|
59
|
-
const overflowGalleryTiles =
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
indexesToRender.includes(i) &&
|
65
|
-
activeVideoStreams++ < maxRemoteVideoStreams
|
66
|
-
: (_b = p.videoStream) === null || _b === void 0 ? void 0 : _b.isAvailable);
|
67
|
-
});
|
48
|
+
const { gridTiles, overflowGalleryTiles } = renderTiles(gridParticipants, onRenderRemoteParticipant, maxRemoteVideoStreams, indexesToRender, overflowGalleryParticipants, dominantSpeakers);
|
49
|
+
const shouldFloatLocalVideo = remoteParticipants.length > 0;
|
50
|
+
if (!shouldFloatLocalVideo && localVideoComponent) {
|
51
|
+
gridTiles.push(localVideoComponent);
|
52
|
+
}
|
68
53
|
const layerHostId = useId('layerhost');
|
69
54
|
const localVideoSizeRem = useMemo(() => {
|
70
55
|
if (isNarrow || localVideoTileSize === '9:16') {
|