@azure/communication-react 1.16.0-alpha-202404260012 → 1.16.0-alpha-202404270012
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-BLhY8s2s.js → ChatMessageComponentAsRichTextEditBox-DSlV4PZz.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-BLhY8s2s.js.map → ChatMessageComponentAsRichTextEditBox-DSlV4PZz.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-r7pKdpFV.js → index-aGXLnB_I.js} +45 -11
- package/dist/dist-cjs/communication-react/index-aGXLnB_I.js.map +1 -0
- 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/react-components/src/components/DevicesButton.d.ts +2 -1
- package/dist/dist-esm/react-components/src/components/DevicesButton.js +6 -2
- package/dist/dist-esm/react-components/src/components/DevicesButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.js +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTablePane.d.ts +1 -2
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTablePane.js +4 -2
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTablePane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +3 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/AudioProvider.d.ts +19 -0
- package/dist/dist-esm/react-composites/src/composites/common/AudioProvider.js +25 -0
- package/dist/dist-esm/react-composites/src/composites/common/AudioProvider.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/BaseComposite.js +7 -1
- package/dist/dist-esm/react-composites/src/composites/common/BaseComposite.js.map +1 -1
- package/package.json +1 -1
- package/dist/dist-cjs/communication-react/index-r7pKdpFV.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.16.0-alpha-
|
1
|
+
{"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.16.0-alpha-202404270012';\n"]}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { IContextualMenuItem, IContextualMenuItemStyles, IContextualMenuStyles } from '@fluentui/react';
|
3
|
+
import { VideoStreamOptions } from '../types';
|
3
4
|
import { ControlBarButtonProps, ControlBarButtonStyles } from './ControlBarButton';
|
4
5
|
/**
|
5
6
|
* Styles for the {@link DevicesButton} menu.
|
@@ -141,7 +142,7 @@ export interface DeviceMenuProps {
|
|
141
142
|
selectedMicrophone?: OptionsDevice;
|
142
143
|
selectedSpeaker?: OptionsDevice;
|
143
144
|
selectedCamera?: OptionsDevice;
|
144
|
-
onSelectCamera?: (device: OptionsDevice) => Promise<void>;
|
145
|
+
onSelectCamera?: (device: OptionsDevice, options?: VideoStreamOptions) => Promise<void>;
|
145
146
|
onSelectMicrophone?: (device: OptionsDevice) => Promise<void>;
|
146
147
|
onSelectSpeaker?: (device: OptionsDevice) => Promise<void>;
|
147
148
|
styles?: Partial<DeviceMenuStyles>;
|
@@ -1,12 +1,16 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT License.
|
3
3
|
import { ContextualMenuItemType, merge } from '@fluentui/react';
|
4
|
+
import { _preventDismissOnEvent as preventDismissOnEvent } from "../../../acs-ui-common/src";
|
4
5
|
import React from 'react';
|
5
6
|
import { useLocale } from '../localization';
|
6
7
|
import { ControlBarButton } from './ControlBarButton';
|
7
8
|
import { _HighContrastAwareIcon } from './HighContrastAwareIcon';
|
8
9
|
import { buttonFlyoutItemStyles } from './styles/ControlBar.styles';
|
9
|
-
|
10
|
+
const defaultLocalVideoViewOptions = {
|
11
|
+
scalingMode: 'Crop',
|
12
|
+
isMirrored: true
|
13
|
+
};
|
10
14
|
/**
|
11
15
|
* Generates default {@link IContextualMenuProps} for buttons that
|
12
16
|
* show a drop-down to select devices to use.
|
@@ -61,7 +65,7 @@ export const generateDefaultDeviceMenuProps = (props, strings, primaryActionItem
|
|
61
65
|
isChecked: camera.id === (selectedCamera === null || selectedCamera === void 0 ? void 0 : selectedCamera.id),
|
62
66
|
onClick: () => {
|
63
67
|
if (camera.id !== (selectedCamera === null || selectedCamera === void 0 ? void 0 : selectedCamera.id)) {
|
64
|
-
onSelectCamera(camera);
|
68
|
+
onSelectCamera(camera, defaultLocalVideoViewOptions);
|
65
69
|
}
|
66
70
|
}
|
67
71
|
}))
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DevicesButton.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/DevicesButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,sBAAsB,EAK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ft Corporation.\n// Licensed under the MIT License.\n\nimport {\n ContextualMenuItemType,\n IContextualMenuItem,\n IContextualMenuItemStyles,\n IContextualMenuProps,\n IContextualMenuStyles,\n merge\n} from '@fluentui/react';\nimport React from 'react';\nimport { useLocale } from '../localization';\nimport { ControlBarButton, ControlBarButtonProps, ControlBarButtonStyles } from './ControlBarButton';\nimport { _HighContrastAwareIcon } from './HighContrastAwareIcon';\nimport { buttonFlyoutItemStyles } from './styles/ControlBar.styles';\nimport { _preventDismissOnEvent as preventDismissOnEvent } from '@internal/acs-ui-common';\n\n/**\n * Styles for the {@link DevicesButton} menu.\n *\n * @public\n */\nexport interface DevicesButtonContextualMenuStyles extends IContextualMenuStyles {\n /**\n * Styles for the items inside the {@link DevicesButton} button menu.\n */\n menuItemStyles?: IContextualMenuItemStyles;\n}\n\n/**\n * Styles for the Devices button menu items.\n *\n * @public\n */\nexport interface DevicesButtonStyles extends ControlBarButtonStyles {\n /**\n * Styles for the {@link DevicesButton} menu.\n */\n menuStyles?: Partial<DevicesButtonContextualMenuStyles>;\n}\n\n/**\n * A device, e.g. camera, microphone, or speaker, in the {@link DevicesButton} flyout.\n *\n * @public\n */\nexport interface OptionsDevice {\n /**\n * Device unique identifier\n */\n id: string;\n /**\n * Device name\n */\n name: string;\n}\n\n/**\n * Strings of {@link DevicesButton} that can be overridden.\n *\n * @public\n */\nexport interface DevicesButtonStrings {\n /**\n * Label of button\n */\n label: string;\n /**\n * Button tooltip content.\n */\n tooltipContent?: string;\n /**\n * Title of camera menu\n */\n cameraMenuTitle: string;\n /**\n * Title of microphone menu\n */\n microphoneMenuTitle: string;\n /**\n * Title of speaker menu\n */\n speakerMenuTitle: string;\n /**\n * Tooltip of camera menu\n */\n cameraMenuTooltip: string;\n /**\n * Tooltip of microphone menu\n */\n microphoneMenuTooltip: string;\n /**\n * Tooltip of speaker menu\n */\n speakerMenuTooltip: string;\n}\n\n/**\n * Props for {@link DevicesButton}.\n *\n * @public\n */\nexport interface DevicesButtonProps extends ControlBarButtonProps {\n /**\n * Available microphones for selection\n */\n microphones?: OptionsDevice[];\n /**\n * Available speakers for selection\n */\n speakers?: OptionsDevice[];\n /**\n * Available cameras for selection\n */\n cameras?: OptionsDevice[];\n /**\n * Microphone that is shown as currently selected\n */\n selectedMicrophone?: OptionsDevice;\n /**\n * Speaker that is shown as currently selected\n */\n selectedSpeaker?: OptionsDevice;\n /**\n * Camera that is shown as currently selected\n */\n selectedCamera?: OptionsDevice;\n /**\n * Callback when a camera is selected\n */\n onSelectCamera?: (device: OptionsDevice) => Promise<void>;\n /**\n * Callback when a microphone is selected\n */\n onSelectMicrophone?: (device: OptionsDevice) => Promise<void>;\n /**\n * Speaker when a speaker is selected\n */\n onSelectSpeaker?: (device: OptionsDevice) => Promise<void>;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<DevicesButtonStrings>;\n /**\n * Option to increase the touch targets of the button flyout menu items from 36px to 48px.\n * Recommended for mobile devices.\n */\n styles?: DevicesButtonStyles;\n}\n\n/**\n * Subset props for various buttons that show device selection menus.\n *\n * @internal\n */\nexport interface DeviceMenuProps {\n microphones?: OptionsDevice[];\n speakers?: OptionsDevice[];\n cameras?: OptionsDevice[];\n selectedMicrophone?: OptionsDevice;\n selectedSpeaker?: OptionsDevice;\n selectedCamera?: OptionsDevice;\n onSelectCamera?: (device: OptionsDevice) => Promise<void>;\n onSelectMicrophone?: (device: OptionsDevice) => Promise<void>;\n onSelectSpeaker?: (device: OptionsDevice) => Promise<void>;\n styles?: Partial<DeviceMenuStyles>;\n}\n\n/**\n * Subset of strings for various buttons that show device selection menus.\n *\n * @internal\n */\nexport interface DeviceMenuStrings {\n /**\n * Title for Camera section in the contextual menu\n */\n cameraMenuTitle?: string;\n /**\n * Title for Audio Device section in the contextual menu\n *\n * @remark Used in place of microphoneMenuTitle when speakers can be enumerated\n */\n audioDeviceMenuTitle?: string;\n /**\n * Title for Microphone section in the contextual menu\n *\n * @remark Used when speakers can be enumerated\n */\n microphoneMenuTitle?: string;\n /**\n * Title for Speaker section in the contextual menu\n */\n speakerMenuTitle?: string;\n /**\n * Tooltip label for Camera section in the contextual menu\n */\n cameraMenuTooltip?: string;\n /**\n * Tooltip label for Audio Device section in the contextual menu\n *\n * @remark Used in place of microphoneMenuTooltip when speakers can be enumerated\n */\n audioDeviceMenuTooltip?: string;\n /**\n * Tooltip label for Microphone section in the contextual menu\n *\n * @remark Used when speakers can be enumerated\n */\n microphoneMenuTooltip?: string;\n /**\n * Tooltip label for Speaker section in the contextual menu\n */\n speakerMenuTooltip?: string;\n}\n\n/**\n * Styles for flyouts used by various buttons for device selection flyouts.\n *\n * @internal\n */\nexport interface DeviceMenuStyles extends IContextualMenuStyles {\n menuItemStyles?: IContextualMenuItemStyles;\n}\n\n/**\n * Generates default {@link IContextualMenuProps} for buttons that\n * show a drop-down to select devices to use.\n *\n * @internal\n */\nexport const generateDefaultDeviceMenuProps = (\n props: DeviceMenuProps,\n strings: DeviceMenuStrings,\n primaryActionItem?: IContextualMenuItem,\n isSelectCamAllowed = true,\n isSelectMicAllowed = true\n): { items: IContextualMenuItem[] } | undefined => {\n const {\n microphones,\n speakers,\n cameras,\n selectedMicrophone,\n selectedSpeaker,\n selectedCamera,\n onSelectCamera,\n onSelectMicrophone,\n onSelectSpeaker\n } = props;\n\n const defaultMenuProps: IContextualMenuProps = {\n items: [],\n styles: props.styles,\n calloutProps: {\n styles: {\n root: {\n // Confine the menu to the parents bounds.\n // More info: https://github.com/microsoft/fluentui/issues/18835\n // NB: 95% to keep some space for margin, drop shadow etc around the Callout.\n maxWidth: '95%'\n }\n },\n preventDismissOnEvent\n }\n };\n\n const menuItemStyles = merge(buttonFlyoutItemStyles, props.styles?.menuItemStyles ?? {});\n\n if (cameras && selectedCamera && onSelectCamera && isSelectCamAllowed) {\n defaultMenuProps.items.push({\n key: 'cameras',\n itemType: ContextualMenuItemType.Section,\n sectionProps: {\n title: strings.cameraMenuTitle,\n items: [\n {\n key: 'sectionCamera',\n title: strings.cameraMenuTooltip,\n subMenuProps: {\n calloutProps: {\n preventDismissOnEvent\n },\n items: cameras.map((camera) => ({\n key: camera.id,\n text: camera.name,\n title: camera.name,\n iconProps: {\n iconName: 'ContextMenuCameraIcon',\n styles: { root: { lineHeight: 0 } }\n },\n itemProps: {\n styles: menuItemStyles\n },\n canCheck: true,\n isChecked: camera.id === selectedCamera?.id,\n onClick: () => {\n if (camera.id !== selectedCamera?.id) {\n onSelectCamera(camera);\n }\n }\n }))\n },\n text: selectedCamera.name\n }\n ]\n }\n });\n if (primaryActionItem) {\n defaultMenuProps.items.push(primaryActionItem);\n }\n }\n\n if (microphones && selectedMicrophone && onSelectMicrophone && isSelectMicAllowed) {\n // Set props as Microphone if speakers can be enumerated else set as Audio Device\n const speakersAvailable = speakers && speakers.length > 0;\n const key = speakersAvailable ? 'sectionMicrophone' : 'sectionAudioDevice';\n const title = speakersAvailable ? strings.microphoneMenuTooltip : strings.audioDeviceMenuTooltip;\n\n defaultMenuProps.items.push({\n key: 'microphones',\n itemType: ContextualMenuItemType.Section,\n sectionProps: {\n title: strings.microphoneMenuTitle,\n items: [\n {\n key: key,\n title: title,\n subMenuProps: {\n calloutProps: {\n preventDismissOnEvent\n },\n items: microphones.map((microphone) => ({\n key: microphone.id,\n text: microphone.name,\n title: microphone.name,\n itemProps: {\n styles: menuItemStyles\n },\n iconProps: {\n iconName: 'ContextMenuMicIcon',\n styles: { root: { lineHeight: 0 } }\n },\n canCheck: true,\n isChecked: microphone.id === selectedMicrophone?.id,\n onClick: () => {\n if (microphone.id !== selectedMicrophone?.id) {\n onSelectMicrophone(microphone);\n }\n }\n }))\n },\n text: selectedMicrophone.name\n }\n ]\n }\n });\n }\n\n if (speakers && selectedSpeaker && onSelectSpeaker) {\n defaultMenuProps.items.push({\n key: 'speakers',\n itemType: ContextualMenuItemType.Section,\n sectionProps: {\n title: strings.speakerMenuTitle,\n items: [\n {\n key: 'sectionSpeaker',\n subMenuProps: {\n calloutProps: {\n preventDismissOnEvent\n },\n items: speakers.map((speaker) => ({\n key: speaker.id,\n text: speaker.name,\n title: speaker.name,\n itemProps: {\n styles: menuItemStyles\n },\n iconProps: {\n iconName: 'ContextMenuSpeakerIcon',\n styles: { root: { lineHeight: 0 } }\n },\n canCheck: true,\n isChecked: speaker.id === selectedSpeaker?.id,\n onClick: () => {\n if (speaker.id !== selectedSpeaker?.id) {\n onSelectSpeaker(speaker);\n }\n }\n }))\n },\n text: selectedSpeaker.name\n }\n ]\n }\n });\n }\n if (microphones && selectedMicrophone && onSelectMicrophone && isSelectMicAllowed && primaryActionItem) {\n defaultMenuProps.items.push(primaryActionItem);\n }\n\n if (defaultMenuProps.items.length === 0) {\n // Avoids creating an empty context menu.\n return undefined;\n }\n return defaultMenuProps;\n};\n\n/**\n * A button to open a menu that controls device options.\n *\n * Can be used with {@link ControlBar}.\n *\n * @public\n */\nexport const DevicesButton = (props: DevicesButtonProps): JSX.Element => {\n const { onRenderIcon } = props;\n\n const localeStrings = useLocale().strings.devicesButton;\n const strings = { ...localeStrings, ...props.strings };\n\n const devicesButtonMenu =\n props.menuProps ?? generateDefaultDeviceMenuProps({ ...props, styles: props.styles?.menuStyles }, strings);\n\n const onRenderOptionsIcon = (): JSX.Element => {\n return <_HighContrastAwareIcon disabled={props.disabled} iconName=\"ControlButtonOptions\" />;\n };\n\n return (\n <ControlBarButton\n {...props}\n menuProps={devicesButtonMenu}\n menuIconProps={{ hidden: true }}\n onRenderIcon={onRenderIcon ?? onRenderOptionsIcon}\n strings={strings}\n labelKey={props.labelKey ?? 'devicesButtonLabel'}\n />\n );\n};\n"]}
|
1
|
+
{"version":3,"file":"DevicesButton.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/DevicesButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,sBAAsB,EAKtB,KAAK,EACN,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,sBAAsB,IAAI,qBAAqB,EAAE,mCAAgC;AAC1F,OA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soft Corporation.\n// Licensed under the MIT License.\n\nimport {\n ContextualMenuItemType,\n IContextualMenuItem,\n IContextualMenuItemStyles,\n IContextualMenuProps,\n IContextualMenuStyles,\n merge\n} from '@fluentui/react';\nimport { _preventDismissOnEvent as preventDismissOnEvent } from '@internal/acs-ui-common';\nimport React from 'react';\nimport { useLocale } from '../localization';\nimport { VideoStreamOptions } from '../types';\nimport { ControlBarButton, ControlBarButtonProps, ControlBarButtonStyles } from './ControlBarButton';\nimport { _HighContrastAwareIcon } from './HighContrastAwareIcon';\nimport { buttonFlyoutItemStyles } from './styles/ControlBar.styles';\n\nconst defaultLocalVideoViewOptions = {\n scalingMode: 'Crop',\n isMirrored: true\n} as VideoStreamOptions;\n\n/**\n * Styles for the {@link DevicesButton} menu.\n *\n * @public\n */\nexport interface DevicesButtonContextualMenuStyles extends IContextualMenuStyles {\n /**\n * Styles for the items inside the {@link DevicesButton} button menu.\n */\n menuItemStyles?: IContextualMenuItemStyles;\n}\n\n/**\n * Styles for the Devices button menu items.\n *\n * @public\n */\nexport interface DevicesButtonStyles extends ControlBarButtonStyles {\n /**\n * Styles for the {@link DevicesButton} menu.\n */\n menuStyles?: Partial<DevicesButtonContextualMenuStyles>;\n}\n\n/**\n * A device, e.g. camera, microphone, or speaker, in the {@link DevicesButton} flyout.\n *\n * @public\n */\nexport interface OptionsDevice {\n /**\n * Device unique identifier\n */\n id: string;\n /**\n * Device name\n */\n name: string;\n}\n\n/**\n * Strings of {@link DevicesButton} that can be overridden.\n *\n * @public\n */\nexport interface DevicesButtonStrings {\n /**\n * Label of button\n */\n label: string;\n /**\n * Button tooltip content.\n */\n tooltipContent?: string;\n /**\n * Title of camera menu\n */\n cameraMenuTitle: string;\n /**\n * Title of microphone menu\n */\n microphoneMenuTitle: string;\n /**\n * Title of speaker menu\n */\n speakerMenuTitle: string;\n /**\n * Tooltip of camera menu\n */\n cameraMenuTooltip: string;\n /**\n * Tooltip of microphone menu\n */\n microphoneMenuTooltip: string;\n /**\n * Tooltip of speaker menu\n */\n speakerMenuTooltip: string;\n}\n\n/**\n * Props for {@link DevicesButton}.\n *\n * @public\n */\nexport interface DevicesButtonProps extends ControlBarButtonProps {\n /**\n * Available microphones for selection\n */\n microphones?: OptionsDevice[];\n /**\n * Available speakers for selection\n */\n speakers?: OptionsDevice[];\n /**\n * Available cameras for selection\n */\n cameras?: OptionsDevice[];\n /**\n * Microphone that is shown as currently selected\n */\n selectedMicrophone?: OptionsDevice;\n /**\n * Speaker that is shown as currently selected\n */\n selectedSpeaker?: OptionsDevice;\n /**\n * Camera that is shown as currently selected\n */\n selectedCamera?: OptionsDevice;\n /**\n * Callback when a camera is selected\n */\n onSelectCamera?: (device: OptionsDevice) => Promise<void>;\n /**\n * Callback when a microphone is selected\n */\n onSelectMicrophone?: (device: OptionsDevice) => Promise<void>;\n /**\n * Speaker when a speaker is selected\n */\n onSelectSpeaker?: (device: OptionsDevice) => Promise<void>;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<DevicesButtonStrings>;\n /**\n * Option to increase the touch targets of the button flyout menu items from 36px to 48px.\n * Recommended for mobile devices.\n */\n styles?: DevicesButtonStyles;\n}\n\n/**\n * Subset props for various buttons that show device selection menus.\n *\n * @internal\n */\nexport interface DeviceMenuProps {\n microphones?: OptionsDevice[];\n speakers?: OptionsDevice[];\n cameras?: OptionsDevice[];\n selectedMicrophone?: OptionsDevice;\n selectedSpeaker?: OptionsDevice;\n selectedCamera?: OptionsDevice;\n onSelectCamera?: (device: OptionsDevice, options?: VideoStreamOptions) => Promise<void>;\n onSelectMicrophone?: (device: OptionsDevice) => Promise<void>;\n onSelectSpeaker?: (device: OptionsDevice) => Promise<void>;\n styles?: Partial<DeviceMenuStyles>;\n}\n\n/**\n * Subset of strings for various buttons that show device selection menus.\n *\n * @internal\n */\nexport interface DeviceMenuStrings {\n /**\n * Title for Camera section in the contextual menu\n */\n cameraMenuTitle?: string;\n /**\n * Title for Audio Device section in the contextual menu\n *\n * @remark Used in place of microphoneMenuTitle when speakers can be enumerated\n */\n audioDeviceMenuTitle?: string;\n /**\n * Title for Microphone section in the contextual menu\n *\n * @remark Used when speakers can be enumerated\n */\n microphoneMenuTitle?: string;\n /**\n * Title for Speaker section in the contextual menu\n */\n speakerMenuTitle?: string;\n /**\n * Tooltip label for Camera section in the contextual menu\n */\n cameraMenuTooltip?: string;\n /**\n * Tooltip label for Audio Device section in the contextual menu\n *\n * @remark Used in place of microphoneMenuTooltip when speakers can be enumerated\n */\n audioDeviceMenuTooltip?: string;\n /**\n * Tooltip label for Microphone section in the contextual menu\n *\n * @remark Used when speakers can be enumerated\n */\n microphoneMenuTooltip?: string;\n /**\n * Tooltip label for Speaker section in the contextual menu\n */\n speakerMenuTooltip?: string;\n}\n\n/**\n * Styles for flyouts used by various buttons for device selection flyouts.\n *\n * @internal\n */\nexport interface DeviceMenuStyles extends IContextualMenuStyles {\n menuItemStyles?: IContextualMenuItemStyles;\n}\n\n/**\n * Generates default {@link IContextualMenuProps} for buttons that\n * show a drop-down to select devices to use.\n *\n * @internal\n */\nexport const generateDefaultDeviceMenuProps = (\n props: DeviceMenuProps,\n strings: DeviceMenuStrings,\n primaryActionItem?: IContextualMenuItem,\n isSelectCamAllowed = true,\n isSelectMicAllowed = true\n): { items: IContextualMenuItem[] } | undefined => {\n const {\n microphones,\n speakers,\n cameras,\n selectedMicrophone,\n selectedSpeaker,\n selectedCamera,\n onSelectCamera,\n onSelectMicrophone,\n onSelectSpeaker\n } = props;\n\n const defaultMenuProps: IContextualMenuProps = {\n items: [],\n styles: props.styles,\n calloutProps: {\n styles: {\n root: {\n // Confine the menu to the parents bounds.\n // More info: https://github.com/microsoft/fluentui/issues/18835\n // NB: 95% to keep some space for margin, drop shadow etc around the Callout.\n maxWidth: '95%'\n }\n },\n preventDismissOnEvent\n }\n };\n\n const menuItemStyles = merge(buttonFlyoutItemStyles, props.styles?.menuItemStyles ?? {});\n\n if (cameras && selectedCamera && onSelectCamera && isSelectCamAllowed) {\n defaultMenuProps.items.push({\n key: 'cameras',\n itemType: ContextualMenuItemType.Section,\n sectionProps: {\n title: strings.cameraMenuTitle,\n items: [\n {\n key: 'sectionCamera',\n title: strings.cameraMenuTooltip,\n subMenuProps: {\n calloutProps: {\n preventDismissOnEvent\n },\n items: cameras.map((camera) => ({\n key: camera.id,\n text: camera.name,\n title: camera.name,\n iconProps: {\n iconName: 'ContextMenuCameraIcon',\n styles: { root: { lineHeight: 0 } }\n },\n itemProps: {\n styles: menuItemStyles\n },\n canCheck: true,\n isChecked: camera.id === selectedCamera?.id,\n onClick: () => {\n if (camera.id !== selectedCamera?.id) {\n onSelectCamera(camera, defaultLocalVideoViewOptions);\n }\n }\n }))\n },\n text: selectedCamera.name\n }\n ]\n }\n });\n if (primaryActionItem) {\n defaultMenuProps.items.push(primaryActionItem);\n }\n }\n\n if (microphones && selectedMicrophone && onSelectMicrophone && isSelectMicAllowed) {\n // Set props as Microphone if speakers can be enumerated else set as Audio Device\n const speakersAvailable = speakers && speakers.length > 0;\n const key = speakersAvailable ? 'sectionMicrophone' : 'sectionAudioDevice';\n const title = speakersAvailable ? strings.microphoneMenuTooltip : strings.audioDeviceMenuTooltip;\n\n defaultMenuProps.items.push({\n key: 'microphones',\n itemType: ContextualMenuItemType.Section,\n sectionProps: {\n title: strings.microphoneMenuTitle,\n items: [\n {\n key: key,\n title: title,\n subMenuProps: {\n calloutProps: {\n preventDismissOnEvent\n },\n items: microphones.map((microphone) => ({\n key: microphone.id,\n text: microphone.name,\n title: microphone.name,\n itemProps: {\n styles: menuItemStyles\n },\n iconProps: {\n iconName: 'ContextMenuMicIcon',\n styles: { root: { lineHeight: 0 } }\n },\n canCheck: true,\n isChecked: microphone.id === selectedMicrophone?.id,\n onClick: () => {\n if (microphone.id !== selectedMicrophone?.id) {\n onSelectMicrophone(microphone);\n }\n }\n }))\n },\n text: selectedMicrophone.name\n }\n ]\n }\n });\n }\n\n if (speakers && selectedSpeaker && onSelectSpeaker) {\n defaultMenuProps.items.push({\n key: 'speakers',\n itemType: ContextualMenuItemType.Section,\n sectionProps: {\n title: strings.speakerMenuTitle,\n items: [\n {\n key: 'sectionSpeaker',\n subMenuProps: {\n calloutProps: {\n preventDismissOnEvent\n },\n items: speakers.map((speaker) => ({\n key: speaker.id,\n text: speaker.name,\n title: speaker.name,\n itemProps: {\n styles: menuItemStyles\n },\n iconProps: {\n iconName: 'ContextMenuSpeakerIcon',\n styles: { root: { lineHeight: 0 } }\n },\n canCheck: true,\n isChecked: speaker.id === selectedSpeaker?.id,\n onClick: () => {\n if (speaker.id !== selectedSpeaker?.id) {\n onSelectSpeaker(speaker);\n }\n }\n }))\n },\n text: selectedSpeaker.name\n }\n ]\n }\n });\n }\n if (microphones && selectedMicrophone && onSelectMicrophone && isSelectMicAllowed && primaryActionItem) {\n defaultMenuProps.items.push(primaryActionItem);\n }\n\n if (defaultMenuProps.items.length === 0) {\n // Avoids creating an empty context menu.\n return undefined;\n }\n return defaultMenuProps;\n};\n\n/**\n * A button to open a menu that controls device options.\n *\n * Can be used with {@link ControlBar}.\n *\n * @public\n */\nexport const DevicesButton = (props: DevicesButtonProps): JSX.Element => {\n const { onRenderIcon } = props;\n\n const localeStrings = useLocale().strings.devicesButton;\n const strings = { ...localeStrings, ...props.strings };\n\n const devicesButtonMenu =\n props.menuProps ?? generateDefaultDeviceMenuProps({ ...props, styles: props.styles?.menuStyles }, strings);\n\n const onRenderOptionsIcon = (): JSX.Element => {\n return <_HighContrastAwareIcon disabled={props.disabled} iconName=\"ControlButtonOptions\" />;\n };\n\n return (\n <ControlBarButton\n {...props}\n menuProps={devicesButtonMenu}\n menuIconProps={{ hidden: true }}\n onRenderIcon={onRenderIcon ?? onRenderOptionsIcon}\n strings={strings}\n labelKey={props.labelKey ?? 'devicesButtonLabel'}\n />\n );\n};\n"]}
|
@@ -26,7 +26,7 @@ export const insertTableButton = (theme, maxRowsNumber, maxColumnsNumber) => {
|
|
26
26
|
insertTablePane: `Insert ${ColumnRowReplaceString} table`
|
27
27
|
},
|
28
28
|
itemRender: (item, onClick) => {
|
29
|
-
return (React.createElement(RichTextInsertTablePane, { item: item, onClick: onClick,
|
29
|
+
return (React.createElement(RichTextInsertTablePane, { item: item, onClick: onClick, maxColumnsNumber: maxColumnsNumber, maxRowsNumber: maxRowsNumber }));
|
30
30
|
},
|
31
31
|
commandBarSubMenuProperties: {
|
32
32
|
className: insertTableMenuTablePane
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RichTextInsertTableButton.js","sourceRoot":"","sources":["../../../../../../../../../react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGvE,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACzG,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAGrF,kGAAkG;AAElG;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,KAAY,EACZ,aAAqB,EACrB,gBAAwB,EACF,EAAE;IACxB,OAAO;QACL,GAAG,EAAE,uBAAuB;QAC5B,eAAe,EAAE,cAAc;QAC/B,4CAA4C;QAC5C,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,CAAC,MAAe,EAAE,GAAW,EAAE,EAAE;YACxC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;YACtC,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACzC,CAAC;QACD,YAAY,EAAE;YACZ,KAAK,EAAE;gBACL,6DAA6D;gBAC7D,eAAe,EAAE,UAAU,sBAAsB,QAAQ;aAC1D;YACD,UAAU,EAAE,CACV,IAAyB,EACzB,OAAyG,EACzG,EAAE;gBACF,OAAO,CACL,oBAAC,uBAAuB,IACtB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,
|
1
|
+
{"version":3,"file":"RichTextInsertTableButton.js","sourceRoot":"","sources":["../../../../../../../../../react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGvE,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACzG,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAGrF,kGAAkG;AAElG;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,KAAY,EACZ,aAAqB,EACrB,gBAAwB,EACF,EAAE;IACxB,OAAO;QACL,GAAG,EAAE,uBAAuB;QAC5B,eAAe,EAAE,cAAc;QAC/B,4CAA4C;QAC5C,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,CAAC,MAAe,EAAE,GAAW,EAAE,EAAE;YACxC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;YACtC,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACzC,CAAC;QACD,YAAY,EAAE;YACZ,KAAK,EAAE;gBACL,6DAA6D;gBAC7D,eAAe,EAAE,UAAU,sBAAsB,QAAQ;aAC1D;YACD,UAAU,EAAE,CACV,IAAyB,EACzB,OAAyG,EACzG,EAAE;gBACF,OAAO,CACL,oBAAC,uBAAuB,IACtB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,GAC5B,CACH,CAAC;YACJ,CAAC;YACD,2BAA2B,EAAE;gBAC3B,SAAS,EAAE,wBAAwB;aACpC;SACF;QACD,oBAAoB,EAAE;YACpB,wBAAwB;YACxB,aAAa,EAAE;gBACb,MAAM,EAAE,IAAI;aACb;YACD,YAAY,EAAE,GAAG,EAAE;gBACjB,OAAO,oBAAC,SAAS,OAAG,CAAC;YACvB,CAAC;YACD,YAAY,EAAE,sBAAsB,CAAC,KAAK,CAAC;YAC3C,QAAQ,EAAE,KAAK;SAChB;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,GAAgB,EAAE;IAClC,OAAO;IACL,qGAAqG;IACrG,oBAAC,KAAK;QACJ,oBAAC,IAAI,IAAC,QAAQ,EAAC,+BAA+B,EAAC,SAAS,EAAE,iCAAiC,GAAI;QAC/F,oBAAC,IAAI,IAAC,QAAQ,EAAC,gCAAgC,EAAC,SAAS,EAAE,kCAAkC,GAAI,CAC3F,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { Icon, Stack } from '@fluentui/react';\nimport { insertTable as insertTableAction } from './insertTableAction';\nimport type { RibbonButton } from 'roosterjs-react';\nimport type { IContextualMenuItem, Theme } from '@fluentui/react';\nimport { insertTableMenuTablePane, ribbonTableButtonStyle } from '../../../styles/RichTextEditor.styles';\nimport { RichTextInsertTablePane } from './RichTextInsertTablePane';\nimport { ColumnRowReplaceString, parseKey } from '../../../utils/RichTextTableUtils';\nimport type { IEditor } from 'roosterjs-editor-types-compatible';\n\n// This file uses RoosterJS React package implementation with updates to UI components and styles.\n\n/**\n * \"Insert table\" button for the RoosterJS ribbon\n */\nexport const insertTableButton = (\n theme: Theme,\n maxRowsNumber: number,\n maxColumnsNumber: number\n): RibbonButton<string> => {\n return {\n key: 'buttonNameInsertTable',\n unlocalizedText: 'Insert table',\n // Icon will be set in onRenderIcon callback\n iconName: '',\n onClick: (editor: IEditor, key: string) => {\n const { row, column } = parseKey(key);\n insertTableAction(editor, column, row);\n },\n dropDownMenu: {\n items: {\n // the key of the item is also used as a key for localization\n insertTablePane: `Insert ${ColumnRowReplaceString} table`\n },\n itemRender: (\n item: IContextualMenuItem,\n onClick: (e: React.MouseEvent<Element> | React.KeyboardEvent<Element>, item: IContextualMenuItem) => void\n ) => {\n return (\n <RichTextInsertTablePane\n item={item}\n onClick={onClick}\n maxColumnsNumber={maxColumnsNumber}\n maxRowsNumber={maxRowsNumber}\n />\n );\n },\n commandBarSubMenuProperties: {\n className: insertTableMenuTablePane\n }\n },\n commandBarProperties: {\n // hide the chevron icon\n menuIconProps: {\n hidden: true\n },\n onRenderIcon: () => {\n return <TableIcon />;\n },\n buttonStyles: ribbonTableButtonStyle(theme),\n canCheck: false\n }\n };\n};\n\nconst TableIcon = (): JSX.Element => {\n return (\n // update the visibility of the Table Icon with css classes that are triggered by command bar's state\n <Stack>\n <Icon iconName=\"RichTextInsertTableFilledIcon\" className={'ribbon-table-button-filled-icon'} />\n <Icon iconName=\"RichTextInsertTableRegularIcon\" className={'ribbon-table-button-regular-icon'} />\n </Stack>\n );\n};\n"]}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import type { IContextualMenuItem
|
2
|
+
import type { IContextualMenuItem } from '@fluentui/react';
|
3
3
|
interface RichTextInsertTablePaneProps {
|
4
|
-
theme: Theme;
|
5
4
|
item: IContextualMenuItem;
|
6
5
|
onClick: (e: React.MouseEvent<Element> | React.KeyboardEvent<Element>, item: IContextualMenuItem) => void;
|
7
6
|
maxRowsNumber: number;
|
@@ -4,6 +4,7 @@ import React, { useMemo } from 'react';
|
|
4
4
|
import { FocusZone, FocusZoneDirection, mergeStyles } from '@fluentui/react';
|
5
5
|
import { insertTableMenuCellButtonSelectedStyles, insertTableMenuCellButtonStyles, insertTableMenuFocusZone, insertTableMenuTitleStyles } from '../../../styles/RichTextEditor.styles';
|
6
6
|
import { ColumnRowReplaceString, createKey } from '../../../utils/RichTextTableUtils';
|
7
|
+
import { useTheme } from '../../../../theming';
|
7
8
|
// This file uses RoosterJS React package implementation with updates to UI components and styles.
|
8
9
|
const RowColumnInitialValue = 0;
|
9
10
|
/**
|
@@ -11,9 +12,10 @@ const RowColumnInitialValue = 0;
|
|
11
12
|
* Component for the insert table pane
|
12
13
|
*/
|
13
14
|
export const RichTextInsertTablePane = (props) => {
|
14
|
-
const { item, onClick,
|
15
|
+
const { item, onClick, maxColumnsNumber, maxRowsNumber } = props;
|
15
16
|
const [column, setColumn] = React.useState(RowColumnInitialValue);
|
16
17
|
const [row, setRow] = React.useState(RowColumnInitialValue);
|
18
|
+
const theme = useTheme();
|
17
19
|
const updateSize = React.useCallback((target) => {
|
18
20
|
if (target !== undefined && target.dataset.column !== undefined && target.dataset.row !== undefined) {
|
19
21
|
const column = parseInt(target.dataset.column);
|
@@ -40,7 +42,7 @@ export const RichTextInsertTablePane = (props) => {
|
|
40
42
|
for (let j = 0; j < maxColumnsNumber; j++) {
|
41
43
|
const key = `cell_${i}_${j}`;
|
42
44
|
const isSelected = j <= column && i <= row;
|
43
|
-
items.push(React.createElement("button", { className: mergeStyles(insertTableMenuCellButtonStyles(theme), isSelected ? insertTableMenuCellButtonSelectedStyles(theme) : undefined), onClick: onClickButton, key: key, id: key, "data-column": j, "data-row": i, "data-is-focusable": true, onMouseEnter: onMouseEnter, "aria-label": formatText((_a = item.text) !== null && _a !== void 0 ? _a : '', i, j) }));
|
45
|
+
items.push(React.createElement("button", { className: mergeStyles(insertTableMenuCellButtonStyles(theme), isSelected ? insertTableMenuCellButtonSelectedStyles(theme) : undefined), onClick: onClickButton, key: key, id: key, "data-column": j, "data-row": i, "data-is-focusable": true, onMouseEnter: onMouseEnter, "aria-label": formatText((_a = item.text) !== null && _a !== void 0 ? _a : '', formatRowColumnText(i), formatRowColumnText(j)), "data-testid": key }));
|
44
46
|
}
|
45
47
|
}
|
46
48
|
return items;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RichTextInsertTablePane.js","sourceRoot":"","sources":["../../../../../../../../../react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTablePane.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE7E,OAAO,EACL,uCAAuC,EACvC,+BAA+B,EAC/B,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;
|
1
|
+
{"version":3,"file":"RichTextInsertTablePane.js","sourceRoot":"","sources":["../../../../../../../../../react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTablePane.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE7E,OAAO,EACL,uCAAuC,EACvC,+BAA+B,EAC/B,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,kGAAkG;AAClG,MAAM,qBAAqB,GAAG,CAAC,CA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C,EAAE,CAAC,aAAa,EAAE,gBAAgB,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAElG,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE;;QACxB,OAAO,UAAU,CAAC,MAAA,IAAI,CAAC,IAAI,mCAAI,EAAE,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5F,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;IAE7B,OAAO,CACL;QACE,6BAAK,SAAS,EAAE,0BAA0B,IAAG,IAAI,CAAO;QACxD,oBAAC,SAAS,IACR,sBAAsB,EAAE,QAAQ,qBAAqB,IAAI,qBAAqB,EAAE,EAChF,SAAS,EAAE,kBAAkB,CAAC,aAAa,EAC3C,sBAAsB,EAAE,UAAU,EAClC,SAAS,EAAE,wBAAwB,CAAC,KAAK,CAAC,IAEzC,KAAK,CACI,CACR,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,GAAW,EAAE,MAAc,EAAU,EAAE;IACvE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,sBAAsB,EAAE,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAC/F,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,KAAa,EAAU,EAAE;IACpD,OAAO,KAAK,GAAG,CAAC,CAAC;AACnB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useMemo } from 'react';\nimport { FocusZone, FocusZoneDirection, mergeStyles } from '@fluentui/react';\nimport type { IContextualMenuItem } from '@fluentui/react';\nimport {\n insertTableMenuCellButtonSelectedStyles,\n insertTableMenuCellButtonStyles,\n insertTableMenuFocusZone,\n insertTableMenuTitleStyles\n} from '../../../styles/RichTextEditor.styles';\nimport { ColumnRowReplaceString, createKey } from '../../../utils/RichTextTableUtils';\nimport { useTheme } from '../../../../theming';\n\n// This file uses RoosterJS React package implementation with updates to UI components and styles.\nconst RowColumnInitialValue = 0;\n\ninterface RichTextInsertTablePaneProps {\n item: IContextualMenuItem;\n onClick: (e: React.MouseEvent<Element> | React.KeyboardEvent<Element>, item: IContextualMenuItem) => void;\n maxRowsNumber: number;\n maxColumnsNumber: number;\n}\n\n/**\n * @private\n * Component for the insert table pane\n */\nexport const RichTextInsertTablePane = (props: RichTextInsertTablePaneProps): JSX.Element => {\n const { item, onClick, maxColumnsNumber, maxRowsNumber } = props;\n const [column, setColumn] = React.useState(RowColumnInitialValue);\n const [row, setRow] = React.useState(RowColumnInitialValue);\n const theme = useTheme();\n\n const updateSize = React.useCallback(\n (target?: HTMLElement) => {\n if (target !== undefined && target.dataset.column !== undefined && target.dataset.row !== undefined) {\n const column = parseInt(target.dataset.column);\n const row = parseInt(target.dataset.row);\n\n if (\n column >= RowColumnInitialValue &&\n column < maxColumnsNumber &&\n row >= RowColumnInitialValue &&\n row < maxRowsNumber\n ) {\n setColumn(column);\n setRow(row);\n }\n }\n },\n [maxColumnsNumber, maxRowsNumber]\n );\n\n const onMouseEnter = React.useCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => {\n updateSize(e.target as HTMLElement);\n },\n [updateSize]\n );\n\n const onClickButton = React.useCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick(e, {\n ...item,\n key: createKey(formatRowColumnText(row), formatRowColumnText(column))\n });\n },\n [row, column, onClick, item]\n );\n\n const items = React.useMemo(() => {\n const items: JSX.Element[] = [];\n\n for (let i = 0; i < maxRowsNumber; i++) {\n for (let j = 0; j < maxColumnsNumber; j++) {\n const key = `cell_${i}_${j}`;\n const isSelected = j <= column && i <= row;\n items.push(\n <button\n className={mergeStyles(\n insertTableMenuCellButtonStyles(theme),\n isSelected ? insertTableMenuCellButtonSelectedStyles(theme) : undefined\n )}\n onClick={onClickButton}\n key={key}\n id={key}\n data-column={j}\n data-row={i}\n data-is-focusable={true}\n onMouseEnter={onMouseEnter}\n aria-label={formatText(item.text ?? '', formatRowColumnText(i), formatRowColumnText(j))}\n data-testid={key}\n />\n );\n }\n }\n\n return items;\n }, [maxRowsNumber, maxColumnsNumber, column, row, theme, onClickButton, onMouseEnter, item.text]);\n\n const text = useMemo(() => {\n return formatText(item.text ?? '', formatRowColumnText(row), formatRowColumnText(column));\n }, [column, item.text, row]);\n\n return (\n <div>\n <div className={insertTableMenuTitleStyles}>{text}</div>\n <FocusZone\n defaultTabbableElement={`cell_${RowColumnInitialValue}_${RowColumnInitialValue}`}\n direction={FocusZoneDirection.bidirectional}\n onActiveElementChanged={updateSize}\n className={insertTableMenuFocusZone(theme)}\n >\n {items}\n </FocusZone>\n </div>\n );\n};\n\nconst formatText = (text: string, row: number, column: number): string => {\n return text.replace(`${ColumnRowReplaceString}`, `${column.toString()} x ${row.toString()}`);\n};\n\nconst formatRowColumnText = (value: number): number => {\n return value + 1;\n};\n"]}
|
@@ -38,6 +38,7 @@ import { useTrackedCapabilityChangedNotifications } from './utils/TrackCapabilit
|
|
38
38
|
import { useEndedCallConsoleErrors } from './utils/useConsoleErrors';
|
39
39
|
/* @conditional-compile-remove(end-of-call-survey) */
|
40
40
|
import { SurveyPage } from './pages/SurveyPage';
|
41
|
+
import { useAudio } from '../common/AudioProvider';
|
41
42
|
const isShowing = (overrideSidePane) => {
|
42
43
|
return !!(overrideSidePane === null || overrideSidePane === void 0 ? void 0 : overrideSidePane.isActive);
|
43
44
|
};
|
@@ -96,7 +97,7 @@ const MainScreen = (props) => {
|
|
96
97
|
adapter.off('callEnded', closeSidePane);
|
97
98
|
};
|
98
99
|
}, [adapter]);
|
99
|
-
const compositeAudioContext =
|
100
|
+
const compositeAudioContext = useAudio();
|
100
101
|
const capabilitiesChangedInfoAndRole = useSelector(capabilitiesChangedInfoAndRoleSelector);
|
101
102
|
const capabilitiesChangedNotificationBarProps = useTrackedCapabilityChangedNotifications(capabilitiesChangedInfoAndRole);
|
102
103
|
// Track the last dismissed errors of any error kind to prevent errors from re-appearing on subsequent page navigation
|
@@ -171,7 +172,7 @@ const MainScreen = (props) => {
|
|
171
172
|
pageElement = (React.createElement(TransferPage, { mobileView: props.mobileView, modalLayerHostId: props.modalLayerHostId, options: props.options, updateSidePaneRenderer: setSidePaneRenderer, mobileChatTabHeader: props.mobileChatTabHeader, onFetchAvatarPersonaData: onFetchAvatarPersonaData, latestErrors: latestErrors, onDismissError: onDismissError, capabilitiesChangedNotificationBarProps: capabilitiesChangedNotificationBarProps }));
|
172
173
|
break;
|
173
174
|
case 'call':
|
174
|
-
pageElement = (React.createElement(CallPage, { callInvitationURL: callInvitationUrl, onFetchAvatarPersonaData: onFetchAvatarPersonaData, onFetchParticipantMenuItems: onFetchParticipantMenuItems, mobileView: props.mobileView, modalLayerHostId: props.modalLayerHostId, options: props.options, updateSidePaneRenderer: setSidePaneRenderer, mobileChatTabHeader: props.mobileChatTabHeader, onCloseChatPane: props.onCloseChatPane, latestErrors: latestErrors, onDismissError: onDismissError, galleryLayout: userSetGalleryLayout, onUserSetGalleryLayoutChange: setUserSetGalleryLayout, onSetUserSetOverflowGalleryPosition: setUserSetOverflowGalleryPosition, userSetOverflowGalleryPosition: userSetOverflowGalleryPosition, capabilitiesChangedNotificationBarProps: capabilitiesChangedNotificationBarProps, pinnedParticipants: pinnedParticipants, setPinnedParticipants: setPinnedParticipants, compositeAudioContext: compositeAudioContext
|
175
|
+
pageElement = (React.createElement(CallPage, { callInvitationURL: callInvitationUrl, onFetchAvatarPersonaData: onFetchAvatarPersonaData, onFetchParticipantMenuItems: onFetchParticipantMenuItems, mobileView: props.mobileView, modalLayerHostId: props.modalLayerHostId, options: props.options, updateSidePaneRenderer: setSidePaneRenderer, mobileChatTabHeader: props.mobileChatTabHeader, onCloseChatPane: props.onCloseChatPane, latestErrors: latestErrors, onDismissError: onDismissError, galleryLayout: userSetGalleryLayout, onUserSetGalleryLayoutChange: setUserSetGalleryLayout, onSetUserSetOverflowGalleryPosition: setUserSetOverflowGalleryPosition, userSetOverflowGalleryPosition: userSetOverflowGalleryPosition, capabilitiesChangedNotificationBarProps: capabilitiesChangedNotificationBarProps, pinnedParticipants: pinnedParticipants, setPinnedParticipants: setPinnedParticipants, compositeAudioContext: compositeAudioContext }));
|
175
176
|
break;
|
176
177
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
177
178
|
case 'hold':
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CallComposite.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallComposite/CallComposite.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAGlC,OAAO,EAEL,QAAQ,EAER,QAAQ,EAET,yCAAmC;AAGpC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAsB,MAAM,yBAAyB,CAAC;AAE3E,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;A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AAiB,EACpC,wBAAwB,EAAE,wBAAwB,EAClD,2BAA2B,EAAE,2BAA2B,EACxD,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,KAAK,CAAC,kBAAkB,EAC5C,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EACxC,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAC9C,eAAe,EAAE,KAAK,CAAC,eAAe,GACtC;gBAEA,0GAA0G;gBAC1G,sIAAsI;gBACtI,+HAA+H;gBAC/H,+HAA+H;gBAC/H,iCAAiC;gBACjC,mIAAmI;gBACnI,sIAAsI;gBACtI,0EAA0E;gBAC1E,oBAAC,SAAS,IAAC,EAAE,EAAE,gBAAgB,EAAE,SAAS,EAAE,WAAW,CAAC,mBAAmB,CAAC,GAAI,CAE9D,CACT,CACX,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,OAAmC,EAAyB,EAAE;IACrF,IAAI,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAChC,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,IAAI;SACZ,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACtC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { _isInCall } from '@internal/calling-component-bindings';\nimport {\n ActiveErrorMessage,\n ErrorBar,\n ParticipantMenuItemsCallback,\n useTheme,\n VideoTilesOptions\n} from '@internal/react-components';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { CallSurveyImprovementSuggestions } from '@internal/react-components';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { AvatarPersonaDataCallback } from '../common/AvatarPersona';\nimport { BaseProvider, BaseCompositeProps } from '../common/BaseComposite';\nimport { CallCompositeIcons } from '../common/icons';\nimport { useLocale } from '../localization';\nimport { CommonCallAdapter, StartCallIdentifier } from './adapter/CallAdapter';\nimport { CallAdapterProvider, useAdapter } from './adapter/CallAdapterProvider';\nimport { CallPage } from './pages/CallPage';\nimport { ConfigurationPage } from './pages/ConfigurationPage';\nimport { NoticePage } from './pages/NoticePage';\nimport { useSelector } from './hooks/useSelector';\nimport { getEndedCall, getPage, getTargetCallees } from './selectors/baseSelectors';\nimport { LobbyPage } from './pages/LobbyPage';\nimport { TransferPage } from './pages/TransferPage';\nimport {\n leavingPageStyle,\n mainScreenContainerStyleDesktop,\n mainScreenContainerStyleMobile\n} from './styles/CallComposite.styles';\nimport { CallControlOptions } from './types/CallControlOptions';\n\nimport { LayerHost, mergeStyles } from '@fluentui/react';\nimport { modalLayerHostStyle } from '../common/styles/ModalLocalAndRemotePIP.styles';\nimport { useId } from '@fluentui/react-hooks';\n/* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(PSTN-calls) */\nimport { HoldPage } from './pages/HoldPage';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { UnsupportedBrowserPage } from './pages/UnsupportedBrowser';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { CallSurvey } from '@azure/communication-calling';\nimport { ParticipantRole, PermissionConstraints } from '@azure/communication-calling';\nimport { MobileChatSidePaneTabHeaderProps } from '../common/TabHeader';\nimport { InjectedSidePaneProps, SidePaneProvider, SidePaneRenderer } from './components/SidePane/SidePaneProvider';\nimport {\n filterLatestErrors,\n getEndedCallPageProps,\n trackErrorAsDismissed,\n updateTrackedErrorsWithActiveErrors\n} from './utils';\nimport { TrackedErrors } from './types/ErrorTracking';\nimport { usePropsFor } from './hooks/usePropsFor';\nimport { deviceCountSelector } from './selectors/deviceCountSelector';\nimport { VideoGalleryLayout } from '@internal/react-components';\n\nimport { capabilitiesChangedInfoAndRoleSelector } from './selectors/capabilitiesChangedInfoAndRoleSelector';\n\nimport { useTrackedCapabilityChangedNotifications } from './utils/TrackCapabilityChangedNotifications';\nimport { useEndedCallConsoleErrors } from './utils/useConsoleErrors';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { SurveyPage } from './pages/SurveyPage';\n\n/**\n * Props for {@link CallComposite}.\n *\n * @public\n */\nexport interface CallCompositeProps extends BaseCompositeProps<CallCompositeIcons> {\n /**\n * An adapter provides logic and data to the composite.\n * Composite can also be controlled using the adapter.\n */\n adapter: CommonCallAdapter;\n /**\n * Optimizes the composite form factor for either desktop or mobile.\n * @remarks `mobile` is currently only optimized for Portrait mode on mobile devices and does not support landscape.\n * @defaultValue 'desktop'\n */\n formFactor?: 'desktop' | 'mobile';\n /**\n * URL to invite new participants to the current call. If this is supplied, a button appears in the Participants\n * Button flyout menu.\n */\n callInvitationUrl?: string;\n /**\n * Flags to enable/disable or customize UI elements of the {@link CallComposite}.\n */\n options?: CallCompositeOptions;\n}\n\n/* @conditional-compile-remove(call-readiness) */\n/**\n * Device Checks.\n * Choose whether or not to block starting a call depending on camera and microphone permission options.\n *\n * @beta\n */\nexport interface DeviceCheckOptions {\n /**\n * Camera Permission prompts for your call.\n * 'required' - requires the permission to be allowed before permitting the user join the call.\n * 'optional' - permission can be disallowed and the user is still permitted to join the call.\n * 'doNotPrompt' - permission is not required and the user is not prompted to allow the permission.\n */\n camera: 'required' | 'optional' | 'doNotPrompt';\n /**\n * Microphone permission prompts for your call.\n * 'required' - requires the permission to be allowed before permitting the user join the call.\n * 'optional' - permission can be disallowed and the user is still permitted to join the call.\n * 'doNotPrompt' - permission is not required and the user is not prompted to allow the permission.\n */\n microphone: 'required' | 'optional' | 'doNotPrompt';\n}\n\n/**\n * Menu options for remote video tiles in {@link VideoGallery}.\n *\n * @public\n */\nexport interface RemoteVideoTileMenuOptions {\n /**\n * If set to true, remote video tiles in the VideoGallery will not have menu options\n *\n * @defaultValue false\n */\n isHidden?: boolean;\n}\n\n/**\n * Options for the local video tile in the Call composite.\n *\n * @public\n */\nexport interface LocalVideoTileOptions {\n /**\n * Position of the local video tile. If unset will render the local tile in the floating local position.\n *\n * @defaultValue 'floating'\n * @remarks 'grid' - local video tile will be rendered in the grid view of the videoGallery.\n * 'floating' - local video tile will be rendered in the floating position and will observe overflow gallery\n * local video tile rules and be docked in the bottom corner.\n * This does not affect the Configuration screen or the side pane Picture in Picture in Picture view.\n */\n position?: 'grid' | 'floating';\n}\n/**\n * Optional features of the {@link CallComposite}.\n *\n * @public\n */\nexport type CallCompositeOptions = {\n /**\n * Surface Azure Communication Services backend errors in the UI with {@link @azure/communication-react#ErrorBar}.\n * Hide or show the error bar.\n * @defaultValue true\n */\n errorBar?: boolean;\n /**\n * Hide or Customize the control bar element.\n * Can be customized by providing an object of type {@link @azure/communication-react#CallControlOptions}.\n * @defaultValue true\n */\n callControls?: boolean | CallControlOptions;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Device permissions check options for your call.\n * Here you can choose what device permissions you prompt the user for,\n * as well as what device permissions must be accepted before starting a call.\n */\n deviceChecks?: DeviceCheckOptions;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Callback you may provide to supply users with further steps to troubleshoot why they have been\n * unable to grant your site the required permissions for the call.\n *\n * @example\n * ```ts\n * onPermissionsTroubleshootingClick: () =>\n * window.open('https://contoso.com/permissions-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a 'further troubleshooting' link.\n */\n onPermissionsTroubleshootingClick?: (permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n }) => void;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Callback you may provide to supply users with further steps to troubleshoot why they have been\n * having network issues when connecting to the call.\n *\n * @example\n * ```ts\n * onNetworkingTroubleShootingClick?: () =>\n * window.open('https://contoso.com/network-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a 'network troubleshooting' link.\n */\n onNetworkingTroubleShootingClick?: () => void;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * Callback you may provide to supply users with a provided page to showcase supported browsers by ACS.\n *\n * @example\n * ```ts\n * onBrowserTroubleShootingClick?: () =>\n * window.open('https://contoso.com/browser-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a unsupported browser page.\n */\n onEnvironmentInfoTroubleshootingClick?: () => void;\n /**\n * Remote participant video tile menu options\n */\n remoteVideoTileMenuOptions?: RemoteVideoTileMenuOptions;\n /**\n * Options for controlling the local video tile.\n *\n * @remarks if 'false' the local video tile will not be rendered.\n */\n localVideoTile?: boolean | LocalVideoTileOptions;\n /**\n * Options for controlling video tile.\n */\n videoTilesOptions?: VideoTilesOptions;\n /**\n * Options for controlling the starting layout of the composite's video gallery\n */\n galleryOptions?: {\n /**\n * Layout for the gallery when the call starts\n */\n layout?: VideoGalleryLayout;\n };\n /* @conditional-compile-remove(end-of-call-survey) */\n /**\n * Options for end of call survey\n */\n surveyOptions?: {\n /**\n * Disable call survey at the end of a call.\n * @defaultValue false\n */\n disableSurvey?: boolean;\n /**\n * Optional callback to redirect users to custom screens when survey is done, note that default end call screen will be shown if this callback is not provided\n * This callback can be used to redirect users to different screens depending on survey state, whether it is submitted, skipped or has a problem when submitting the survey\n */\n onSurveyClosed?: (surveyState: 'sent' | 'skipped' | 'error', surveyError?: string) => void;\n /**\n * Optional callback to handle survey data including free form text response\n * Note that free form text response survey option is only going to be enabled when this callback is provided\n * User will need to handle all free form text response on their own\n */\n onSurveySubmitted?: (\n callId: string,\n surveyId: string,\n /**\n * This is the survey results containing star survey data and API tag survey data.\n * This part of the result will always be sent to the calling sdk\n * This callback provides user with the ability to gain access to survey data\n */\n submittedSurvey: CallSurvey,\n /**\n * This is the survey results containing free form text\n * This part of the result will not be handled by composites\n * User will need to collect and handle this information 100% on their own\n * Free form text survey is not going to show in the UI if onSurveySubmitted is not populated\n */\n improvementSuggestions: CallSurveyImprovementSuggestions\n ) => Promise<void>;\n };\n /**\n * Options for setting additional customizations related to personalized branding.\n */\n branding?: {\n /**\n * Logo displayed on the configuration page.\n */\n logo?: {\n /**\n * URL for the logo image.\n *\n * @remarks\n * Recommended size is 80x80 pixels.\n */\n url: string;\n /**\n * Alt text for the logo image.\n */\n alt?: string;\n /**\n * The logo can be displayed as a circle.\n *\n * @defaultValue 'unset'\n */\n shape?: 'unset' | 'circle';\n };\n /**\n * Background image displayed on the configuration page.\n */\n backgroundImage?: {\n /**\n * URL for the background image.\n *\n * @remarks\n * Background image should be larger than 576x567 pixels and smaller than 2048x2048 pixels pixels.\n */\n url: string;\n };\n };\n /* @conditional-compile-remove(spotlight) */\n /**\n * Options for settings related to spotlight.\n */\n spotlight?: {\n /**\n * Flag to hide the menu buttons to start and stop spotlight for remote participants and the local participant.\n * @defaultValue false\n */\n hideSpotlightButtons?: boolean;\n };\n};\n\ntype MainScreenProps = {\n mobileView: boolean;\n modalLayerHostId: string;\n callInvitationUrl?: string;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n options?: CallCompositeOptions;\n overrideSidePane?: InjectedSidePaneProps;\n onSidePaneIdChange?: (sidePaneId: string | undefined) => void;\n mobileChatTabHeader?: MobileChatSidePaneTabHeaderProps;\n onCloseChatPane?: () => void;\n};\n\nconst isShowing = (overrideSidePane?: InjectedSidePaneProps): boolean => {\n return !!overrideSidePane?.isActive;\n};\n\nconst MainScreen = (props: MainScreenProps): JSX.Element => {\n const adapter = useAdapter();\n const { camerasCount, microphonesCount } = useSelector(deviceCountSelector);\n const hasCameras = camerasCount > 0;\n const hasMicrophones = microphonesCount > 0;\n\n useEffect(() => {\n (async () => {\n const constrain = getQueryOptions({\n role: adapter.getState().call?.role\n });\n await adapter.askDevicePermission(constrain);\n adapter.queryCameras();\n adapter.queryMicrophones();\n adapter.querySpeakers();\n })();\n }, [\n adapter,\n // Ensure we re-ask for permissions if the number of devices goes from 0 -> n during a call\n // as we cannot request permissions when there are no devices.\n hasCameras,\n hasMicrophones\n ]);\n\n const { callInvitationUrl, onFetchAvatarPersonaData, onFetchParticipantMenuItems } = props;\n const page = useSelector(getPage);\n const endedCall = useSelector(getEndedCall);\n\n const [sidePaneRenderer, setSidePaneRenderer] = React.useState<SidePaneRenderer | undefined>();\n const [injectedSidePaneProps, setInjectedSidePaneProps] = React.useState<InjectedSidePaneProps>();\n const [userSetGalleryLayout, setUserSetGalleryLayout] = useState<VideoGalleryLayout>(\n props.options?.galleryOptions?.layout ?? 'floatingLocalVideo'\n );\n const [userSetOverflowGalleryPosition, setUserSetOverflowGalleryPosition] = useState<'Responsive' | 'horizontalTop'>(\n 'Responsive'\n );\n\n const overridePropsRef = useRef<InjectedSidePaneProps | undefined>(props.overrideSidePane);\n useEffect(() => {\n setInjectedSidePaneProps(props.overrideSidePane);\n // When the injected side pane is opened, clear the previous side pane active state.\n // this ensures when the injected side pane is \"closed\", the previous side pane is not \"re-opened\".\n if (!isShowing(overridePropsRef.current) && isShowing(props.overrideSidePane)) {\n setSidePaneRenderer(undefined);\n }\n overridePropsRef.current = props.overrideSidePane;\n }, [props.overrideSidePane]);\n\n const onSidePaneIdChange = props.onSidePaneIdChange;\n useEffect(() => {\n onSidePaneIdChange?.(sidePaneRenderer?.id);\n }, [sidePaneRenderer?.id, onSidePaneIdChange]);\n\n // When the call ends ensure the side pane is set to closed to prevent the side pane being open if the call is re-joined.\n useEffect(() => {\n const closeSidePane = (): void => {\n setSidePaneRenderer(undefined);\n };\n adapter.on('callEnded', closeSidePane);\n return () => {\n adapter.off('callEnded', closeSidePane);\n };\n }, [adapter]);\n\n const compositeAudioContext = useRef<AudioContext>(new AudioContext());\n\n const capabilitiesChangedInfoAndRole = useSelector(capabilitiesChangedInfoAndRoleSelector);\n\n const capabilitiesChangedNotificationBarProps =\n useTrackedCapabilityChangedNotifications(capabilitiesChangedInfoAndRole);\n\n // Track the last dismissed errors of any error kind to prevent errors from re-appearing on subsequent page navigation\n // This works by tracking the most recent timestamp of any active error type.\n // And then tracking when that error type was last dismissed.\n const activeErrors = usePropsFor(ErrorBar).activeErrorMessages;\n const [trackedErrors, setTrackedErrors] = useState<TrackedErrors>({} as TrackedErrors);\n useEffect(() => {\n setTrackedErrors((prev) => updateTrackedErrorsWithActiveErrors(prev, activeErrors));\n }, [activeErrors]);\n const onDismissError = useCallback((error: ActiveErrorMessage) => {\n setTrackedErrors((prev) => trackErrorAsDismissed(error.type, prev));\n }, []);\n const latestErrors = useMemo(() => filterLatestErrors(activeErrors, trackedErrors), [activeErrors, trackedErrors]);\n const callees = useSelector(getTargetCallees) as StartCallIdentifier[];\n const locale = useLocale();\n const palette = useTheme().palette;\n /* @conditional-compile-remove(PSTN-calls) */\n const alternateCallerId = adapter.getState().alternateCallerId;\n const leavePageStyle = useMemo(() => leavingPageStyle(palette), [palette]);\n let pageElement: JSX.Element | undefined;\n const [pinnedParticipants, setPinnedParticipants] = useState<string[]>([]);\n switch (page) {\n case 'configuration':\n pageElement = (\n <ConfigurationPage\n mobileView={props.mobileView}\n startCallHandler={(): void => {\n if (callees) {\n adapter.startCall(\n callees,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId\n ? { alternateCallerId: { phoneNumber: alternateCallerId } }\n : {}\n );\n } else {\n adapter.joinCall({\n microphoneOn: 'keep',\n cameraOn: 'keep'\n });\n }\n }}\n updateSidePaneRenderer={setSidePaneRenderer}\n latestErrors={latestErrors}\n onDismissError={onDismissError}\n modalLayerHostId={props.modalLayerHostId}\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks={props.options?.deviceChecks}\n /* @conditional-compile-remove(call-readiness) */\n onPermissionsTroubleshootingClick={props.options?.onPermissionsTroubleshootingClick}\n /* @conditional-compile-remove(call-readiness) */\n onNetworkingTroubleShootingClick={props.options?.onNetworkingTroubleShootingClick}\n capabilitiesChangedNotificationBarProps={capabilitiesChangedNotificationBarProps}\n logo={props.options?.branding?.logo}\n backgroundImage={props.options?.branding?.backgroundImage}\n />\n );\n break;\n case 'accessDeniedTeamsMeeting':\n pageElement = (\n <NoticePage\n iconName=\"NoticePageAccessDeniedTeamsMeeting\"\n title={locale.strings.call.failedToJoinTeamsMeetingReasonAccessDeniedTitle}\n moreDetails={locale.strings.call.failedToJoinTeamsMeetingReasonAccessDeniedMoreDetails}\n dataUiId={'access-denied-teams-meeting-page'}\n />\n );\n break;\n case 'removedFromCall':\n pageElement = (\n <NoticePage\n iconName=\"NoticePageRemovedFromCall\"\n title={locale.strings.call.removedFromCallTitle}\n moreDetails={locale.strings.call.removedFromCallMoreDetails}\n dataUiId={'removed-from-call-page'}\n />\n );\n break;\n case 'joinCallFailedDueToNoNetwork':\n pageElement = (\n <NoticePage\n iconName=\"NoticePageJoinCallFailedDueToNoNetwork\"\n title={locale.strings.call.failedToJoinCallDueToNoNetworkTitle}\n moreDetails={locale.strings.call.failedToJoinCallDueToNoNetworkMoreDetails}\n dataUiId={'join-call-failed-due-to-no-network-page'}\n />\n );\n break;\n case 'leaving':\n pageElement = (\n <NoticePage\n title={locale.strings.call.leavingCallTitle ?? 'Leaving...'}\n dataUiId={'leaving-page'}\n pageStyle={leavePageStyle}\n disableStartCallButton={true}\n />\n );\n break;\n case 'leftCall': {\n const { title, moreDetails, disableStartCallButton, iconName } = getEndedCallPageProps(locale, endedCall);\n /* @conditional-compile-remove(end-of-call-survey) */\n if (!props.options?.surveyOptions?.disableSurvey) {\n pageElement = (\n <SurveyPage\n dataUiId={'left-call-page'}\n surveyOptions={props.options?.surveyOptions}\n iconName={iconName}\n title={title}\n moreDetails={moreDetails}\n disableStartCallButton={disableStartCallButton}\n mobileView={props.mobileView}\n />\n );\n break;\n }\n pageElement = (\n <NoticePage\n iconName={iconName}\n title={title}\n moreDetails={callees ? '' : moreDetails}\n dataUiId={'left-call-page'}\n disableStartCallButton={disableStartCallButton}\n />\n );\n\n break;\n }\n case 'lobby':\n pageElement = (\n <LobbyPage\n mobileView={props.mobileView}\n modalLayerHostId={props.modalLayerHostId}\n options={props.options}\n updateSidePaneRenderer={setSidePaneRenderer}\n mobileChatTabHeader={props.mobileChatTabHeader}\n latestErrors={latestErrors}\n onDismissError={onDismissError}\n capabilitiesChangedNotificationBarProps={capabilitiesChangedNotificationBarProps}\n />\n );\n break;\n case 'transferring':\n pageElement = (\n <TransferPage\n mobileView={props.mobileView}\n modalLayerHostId={props.modalLayerHostId}\n options={props.options}\n updateSidePaneRenderer={setSidePaneRenderer}\n mobileChatTabHeader={props.mobileChatTabHeader}\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n latestErrors={latestErrors}\n onDismissError={onDismissError}\n capabilitiesChangedNotificationBarProps={capabilitiesChangedNotificationBarProps}\n />\n );\n break;\n case 'call':\n pageElement = (\n <CallPage\n callInvitationURL={callInvitationUrl}\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={onFetchParticipantMenuItems}\n mobileView={props.mobileView}\n modalLayerHostId={props.modalLayerHostId}\n options={props.options}\n updateSidePaneRenderer={setSidePaneRenderer}\n mobileChatTabHeader={props.mobileChatTabHeader}\n onCloseChatPane={props.onCloseChatPane}\n latestErrors={latestErrors}\n onDismissError={onDismissError}\n galleryLayout={userSetGalleryLayout}\n onUserSetGalleryLayoutChange={setUserSetGalleryLayout}\n onSetUserSetOverflowGalleryPosition={setUserSetOverflowGalleryPosition}\n userSetOverflowGalleryPosition={userSetOverflowGalleryPosition}\n capabilitiesChangedNotificationBarProps={capabilitiesChangedNotificationBarProps}\n pinnedParticipants={pinnedParticipants}\n setPinnedParticipants={setPinnedParticipants}\n compositeAudioContext={compositeAudioContext.current}\n />\n );\n break;\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n case 'hold':\n pageElement = (\n <>\n {\n <HoldPage\n mobileView={props.mobileView}\n modalLayerHostId={props.modalLayerHostId}\n options={props.options}\n updateSidePaneRenderer={setSidePaneRenderer}\n mobileChatTabHeader={props.mobileChatTabHeader}\n latestErrors={latestErrors}\n onDismissError={onDismissError}\n capabilitiesChangedNotificationBarProps={capabilitiesChangedNotificationBarProps}\n />\n }\n </>\n );\n break;\n }\n\n useEndedCallConsoleErrors(endedCall);\n\n /* @conditional-compile-remove(unsupported-browser) */\n switch (page) {\n case 'unsupportedEnvironment':\n pageElement = (\n <>\n {\n /* @conditional-compile-remove(unsupported-browser) */\n <UnsupportedBrowserPage\n onTroubleshootingClick={props.options?.onEnvironmentInfoTroubleshootingClick}\n environmentInfo={adapter.getState().environmentInfo}\n />\n }\n </>\n );\n break;\n }\n\n if (!pageElement) {\n throw new Error('Invalid call composite page');\n }\n\n return (\n <SidePaneProvider sidePaneRenderer={sidePaneRenderer} overrideSidePane={injectedSidePaneProps}>\n {pageElement}\n </SidePaneProvider>\n );\n};\n\n/**\n * A customizable UI composite for calling experience.\n *\n * @remarks Call composite min width/height are as follow:\n * - mobile: 17.5rem x 21rem (280px x 336px, with default rem at 16px)\n * - desktop: 30rem x 22rem (480px x 352px, with default rem at 16px)\n *\n * @public\n */\nexport const CallComposite = (props: CallCompositeProps): JSX.Element => <CallCompositeInner {...props} />;\n\n/**\n * @private\n */\nexport interface InternalCallCompositeProps {\n overrideSidePane?: InjectedSidePaneProps;\n onSidePaneIdChange?: (sidePaneId: string | undefined) => void;\n onCloseChatPane?: () => void;\n // legacy property to avoid breaking change\n mobileChatTabHeader?: MobileChatSidePaneTabHeaderProps;\n}\n\n/** @private */\nexport const CallCompositeInner = (props: CallCompositeProps & InternalCallCompositeProps): JSX.Element => {\n const {\n adapter,\n callInvitationUrl,\n onFetchAvatarPersonaData,\n onFetchParticipantMenuItems,\n options,\n formFactor = 'desktop'\n } = props;\n\n const mobileView = formFactor === 'mobile';\n\n const modalLayerHostId = useId('modalLayerhost');\n const mainScreenContainerClassName = useMemo(() => {\n return mobileView ? mainScreenContainerStyleMobile : mainScreenContainerStyleDesktop;\n }, [mobileView]);\n\n return (\n <div className={mainScreenContainerClassName}>\n <BaseProvider {...props}>\n <CallAdapterProvider adapter={adapter}>\n <MainScreen\n callInvitationUrl={callInvitationUrl}\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={onFetchParticipantMenuItems}\n mobileView={mobileView}\n modalLayerHostId={modalLayerHostId}\n options={options}\n onSidePaneIdChange={props.onSidePaneIdChange}\n overrideSidePane={props.overrideSidePane}\n mobileChatTabHeader={props.mobileChatTabHeader}\n onCloseChatPane={props.onCloseChatPane}\n />\n {\n // This layer host is for ModalLocalAndRemotePIP in SidePane. This LayerHost cannot be inside the SidePane\n // because when the SidePane is hidden, ie. style property display is 'none', it takes up no space. This causes problems when dragging\n // the Modal because the draggable bounds thinks it has no space and will always return to its initial position after dragging.\n // Additionally, this layer host cannot be in the Call Arrangement as it needs to be rendered before useMinMaxDragPosition() in\n // common/utils useRef is called.\n // Warning: this is fragile and works because the call arrangement page is only rendered after the call has connected and thus this\n // LayerHost will be guaranteed to have rendered (and subsequently mounted in the DOM). This ensures the DOM element will be available\n // before the call to `document.getElementById(modalLayerHostId)` is made.\n <LayerHost id={modalLayerHostId} className={mergeStyles(modalLayerHostStyle)} />\n }\n </CallAdapterProvider>\n </BaseProvider>\n </div>\n );\n};\n\nconst getQueryOptions = (options: { role?: ParticipantRole }): PermissionConstraints => {\n if (options.role === 'Consumer') {\n return {\n video: false,\n audio: true\n };\n }\n return { video: true, audio: true };\n};\n"]}
|
1
|
+
{"version":3,"file":"CallComposite.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallComposite/CallComposite.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAGlC,OAAO,EAEL,QAAQ,EAER,QAAQ,EAET,yCAAmC;AAGpC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAsB,MAAM,yBAAyB,CAAC;AAE3E,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAA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AC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { _isInCall } from '@internal/calling-component-bindings';\nimport {\n ActiveErrorMessage,\n ErrorBar,\n ParticipantMenuItemsCallback,\n useTheme,\n VideoTilesOptions\n} from '@internal/react-components';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { CallSurveyImprovementSuggestions } from '@internal/react-components';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { AvatarPersonaDataCallback } from '../common/AvatarPersona';\nimport { BaseProvider, BaseCompositeProps } from '../common/BaseComposite';\nimport { CallCompositeIcons } from '../common/icons';\nimport { useLocale } from '../localization';\nimport { CommonCallAdapter, StartCallIdentifier } from './adapter/CallAdapter';\nimport { CallAdapterProvider, useAdapter } from './adapter/CallAdapterProvider';\nimport { CallPage } from './pages/CallPage';\nimport { ConfigurationPage } from './pages/ConfigurationPage';\nimport { NoticePage } from './pages/NoticePage';\nimport { useSelector } from './hooks/useSelector';\nimport { getEndedCall, getPage, getTargetCallees } from './selectors/baseSelectors';\nimport { LobbyPage } from './pages/LobbyPage';\nimport { TransferPage } from './pages/TransferPage';\nimport {\n leavingPageStyle,\n mainScreenContainerStyleDesktop,\n mainScreenContainerStyleMobile\n} from './styles/CallComposite.styles';\nimport { CallControlOptions } from './types/CallControlOptions';\n\nimport { LayerHost, mergeStyles } from '@fluentui/react';\nimport { modalLayerHostStyle } from '../common/styles/ModalLocalAndRemotePIP.styles';\nimport { useId } from '@fluentui/react-hooks';\n/* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(PSTN-calls) */\nimport { HoldPage } from './pages/HoldPage';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { UnsupportedBrowserPage } from './pages/UnsupportedBrowser';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { CallSurvey } from '@azure/communication-calling';\nimport { ParticipantRole, PermissionConstraints } from '@azure/communication-calling';\nimport { MobileChatSidePaneTabHeaderProps } from '../common/TabHeader';\nimport { InjectedSidePaneProps, SidePaneProvider, SidePaneRenderer } from './components/SidePane/SidePaneProvider';\nimport {\n filterLatestErrors,\n getEndedCallPageProps,\n trackErrorAsDismissed,\n updateTrackedErrorsWithActiveErrors\n} from './utils';\nimport { TrackedErrors } from './types/ErrorTracking';\nimport { usePropsFor } from './hooks/usePropsFor';\nimport { deviceCountSelector } from './selectors/deviceCountSelector';\nimport { VideoGalleryLayout } from '@internal/react-components';\n\nimport { capabilitiesChangedInfoAndRoleSelector } from './selectors/capabilitiesChangedInfoAndRoleSelector';\n\nimport { useTrackedCapabilityChangedNotifications } from './utils/TrackCapabilityChangedNotifications';\nimport { useEndedCallConsoleErrors } from './utils/useConsoleErrors';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { SurveyPage } from './pages/SurveyPage';\nimport { useAudio } from '../common/AudioProvider';\n\n/**\n * Props for {@link CallComposite}.\n *\n * @public\n */\nexport interface CallCompositeProps extends BaseCompositeProps<CallCompositeIcons> {\n /**\n * An adapter provides logic and data to the composite.\n * Composite can also be controlled using the adapter.\n */\n adapter: CommonCallAdapter;\n /**\n * Optimizes the composite form factor for either desktop or mobile.\n * @remarks `mobile` is currently only optimized for Portrait mode on mobile devices and does not support landscape.\n * @defaultValue 'desktop'\n */\n formFactor?: 'desktop' | 'mobile';\n /**\n * URL to invite new participants to the current call. If this is supplied, a button appears in the Participants\n * Button flyout menu.\n */\n callInvitationUrl?: string;\n /**\n * Flags to enable/disable or customize UI elements of the {@link CallComposite}.\n */\n options?: CallCompositeOptions;\n}\n\n/* @conditional-compile-remove(call-readiness) */\n/**\n * Device Checks.\n * Choose whether or not to block starting a call depending on camera and microphone permission options.\n *\n * @beta\n */\nexport interface DeviceCheckOptions {\n /**\n * Camera Permission prompts for your call.\n * 'required' - requires the permission to be allowed before permitting the user join the call.\n * 'optional' - permission can be disallowed and the user is still permitted to join the call.\n * 'doNotPrompt' - permission is not required and the user is not prompted to allow the permission.\n */\n camera: 'required' | 'optional' | 'doNotPrompt';\n /**\n * Microphone permission prompts for your call.\n * 'required' - requires the permission to be allowed before permitting the user join the call.\n * 'optional' - permission can be disallowed and the user is still permitted to join the call.\n * 'doNotPrompt' - permission is not required and the user is not prompted to allow the permission.\n */\n microphone: 'required' | 'optional' | 'doNotPrompt';\n}\n\n/**\n * Menu options for remote video tiles in {@link VideoGallery}.\n *\n * @public\n */\nexport interface RemoteVideoTileMenuOptions {\n /**\n * If set to true, remote video tiles in the VideoGallery will not have menu options\n *\n * @defaultValue false\n */\n isHidden?: boolean;\n}\n\n/**\n * Options for the local video tile in the Call composite.\n *\n * @public\n */\nexport interface LocalVideoTileOptions {\n /**\n * Position of the local video tile. If unset will render the local tile in the floating local position.\n *\n * @defaultValue 'floating'\n * @remarks 'grid' - local video tile will be rendered in the grid view of the videoGallery.\n * 'floating' - local video tile will be rendered in the floating position and will observe overflow gallery\n * local video tile rules and be docked in the bottom corner.\n * This does not affect the Configuration screen or the side pane Picture in Picture in Picture view.\n */\n position?: 'grid' | 'floating';\n}\n/**\n * Optional features of the {@link CallComposite}.\n *\n * @public\n */\nexport type CallCompositeOptions = {\n /**\n * Surface Azure Communication Services backend errors in the UI with {@link @azure/communication-react#ErrorBar}.\n * Hide or show the error bar.\n * @defaultValue true\n */\n errorBar?: boolean;\n /**\n * Hide or Customize the control bar element.\n * Can be customized by providing an object of type {@link @azure/communication-react#CallControlOptions}.\n * @defaultValue true\n */\n callControls?: boolean | CallControlOptions;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Device permissions check options for your call.\n * Here you can choose what device permissions you prompt the user for,\n * as well as what device permissions must be accepted before starting a call.\n */\n deviceChecks?: DeviceCheckOptions;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Callback you may provide to supply users with further steps to troubleshoot why they have been\n * unable to grant your site the required permissions for the call.\n *\n * @example\n * ```ts\n * onPermissionsTroubleshootingClick: () =>\n * window.open('https://contoso.com/permissions-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a 'further troubleshooting' link.\n */\n onPermissionsTroubleshootingClick?: (permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n }) => void;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Callback you may provide to supply users with further steps to troubleshoot why they have been\n * having network issues when connecting to the call.\n *\n * @example\n * ```ts\n * onNetworkingTroubleShootingClick?: () =>\n * window.open('https://contoso.com/network-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a 'network troubleshooting' link.\n */\n onNetworkingTroubleShootingClick?: () => void;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * Callback you may provide to supply users with a provided page to showcase supported browsers by ACS.\n *\n * @example\n * ```ts\n * onBrowserTroubleShootingClick?: () =>\n * window.open('https://contoso.com/browser-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a unsupported browser page.\n */\n onEnvironmentInfoTroubleshootingClick?: () => void;\n /**\n * Remote participant video tile menu options\n */\n remoteVideoTileMenuOptions?: RemoteVideoTileMenuOptions;\n /**\n * Options for controlling the local video tile.\n *\n * @remarks if 'false' the local video tile will not be rendered.\n */\n localVideoTile?: boolean | LocalVideoTileOptions;\n /**\n * Options for controlling video tile.\n */\n videoTilesOptions?: VideoTilesOptions;\n /**\n * Options for controlling the starting layout of the composite's video gallery\n */\n galleryOptions?: {\n /**\n * Layout for the gallery when the call starts\n */\n layout?: VideoGalleryLayout;\n };\n /* @conditional-compile-remove(end-of-call-survey) */\n /**\n * Options for end of call survey\n */\n surveyOptions?: {\n /**\n * Disable call survey at the end of a call.\n * @defaultValue false\n */\n disableSurvey?: boolean;\n /**\n * Optional callback to redirect users to custom screens when survey is done, note that default end call screen will be shown if this callback is not provided\n * This callback can be used to redirect users to different screens depending on survey state, whether it is submitted, skipped or has a problem when submitting the survey\n */\n onSurveyClosed?: (surveyState: 'sent' | 'skipped' | 'error', surveyError?: string) => void;\n /**\n * Optional callback to handle survey data including free form text response\n * Note that free form text response survey option is only going to be enabled when this callback is provided\n * User will need to handle all free form text response on their own\n */\n onSurveySubmitted?: (\n callId: string,\n surveyId: string,\n /**\n * This is the survey results containing star survey data and API tag survey data.\n * This part of the result will always be sent to the calling sdk\n * This callback provides user with the ability to gain access to survey data\n */\n submittedSurvey: CallSurvey,\n /**\n * This is the survey results containing free form text\n * This part of the result will not be handled by composites\n * User will need to collect and handle this information 100% on their own\n * Free form text survey is not going to show in the UI if onSurveySubmitted is not populated\n */\n improvementSuggestions: CallSurveyImprovementSuggestions\n ) => Promise<void>;\n };\n /**\n * Options for setting additional customizations related to personalized branding.\n */\n branding?: {\n /**\n * Logo displayed on the configuration page.\n */\n logo?: {\n /**\n * URL for the logo image.\n *\n * @remarks\n * Recommended size is 80x80 pixels.\n */\n url: string;\n /**\n * Alt text for the logo image.\n */\n alt?: string;\n /**\n * The logo can be displayed as a circle.\n *\n * @defaultValue 'unset'\n */\n shape?: 'unset' | 'circle';\n };\n /**\n * Background image displayed on the configuration page.\n */\n backgroundImage?: {\n /**\n * URL for the background image.\n *\n * @remarks\n * Background image should be larger than 576x567 pixels and smaller than 2048x2048 pixels pixels.\n */\n url: string;\n };\n };\n /* @conditional-compile-remove(spotlight) */\n /**\n * Options for settings related to spotlight.\n */\n spotlight?: {\n /**\n * Flag to hide the menu buttons to start and stop spotlight for remote participants and the local participant.\n * @defaultValue false\n */\n hideSpotlightButtons?: boolean;\n };\n};\n\ntype MainScreenProps = {\n mobileView: boolean;\n modalLayerHostId: string;\n callInvitationUrl?: string;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n options?: CallCompositeOptions;\n overrideSidePane?: InjectedSidePaneProps;\n onSidePaneIdChange?: (sidePaneId: string | undefined) => void;\n mobileChatTabHeader?: MobileChatSidePaneTabHeaderProps;\n onCloseChatPane?: () => void;\n};\n\nconst isShowing = (overrideSidePane?: InjectedSidePaneProps): boolean => {\n return !!overrideSidePane?.isActive;\n};\n\nconst MainScreen = (props: MainScreenProps): JSX.Element => {\n const adapter = useAdapter();\n const { camerasCount, microphonesCount } = useSelector(deviceCountSelector);\n const hasCameras = camerasCount > 0;\n const hasMicrophones = microphonesCount > 0;\n\n useEffect(() => {\n (async () => {\n const constrain = getQueryOptions({\n role: adapter.getState().call?.role\n });\n await adapter.askDevicePermission(constrain);\n adapter.queryCameras();\n adapter.queryMicrophones();\n adapter.querySpeakers();\n })();\n }, [\n adapter,\n // Ensure we re-ask for permissions if the number of devices goes from 0 -> n during a call\n // as we cannot request permissions when there are no devices.\n hasCameras,\n hasMicrophones\n ]);\n\n const { callInvitationUrl, onFetchAvatarPersonaData, onFetchParticipantMenuItems } = props;\n const page = useSelector(getPage);\n const endedCall = useSelector(getEndedCall);\n\n const [sidePaneRenderer, setSidePaneRenderer] = React.useState<SidePaneRenderer | undefined>();\n const [injectedSidePaneProps, setInjectedSidePaneProps] = React.useState<InjectedSidePaneProps>();\n const [userSetGalleryLayout, setUserSetGalleryLayout] = useState<VideoGalleryLayout>(\n props.options?.galleryOptions?.layout ?? 'floatingLocalVideo'\n );\n const [userSetOverflowGalleryPosition, setUserSetOverflowGalleryPosition] = useState<'Responsive' | 'horizontalTop'>(\n 'Responsive'\n );\n\n const overridePropsRef = useRef<InjectedSidePaneProps | undefined>(props.overrideSidePane);\n useEffect(() => {\n setInjectedSidePaneProps(props.overrideSidePane);\n // When the injected side pane is opened, clear the previous side pane active state.\n // this ensures when the injected side pane is \"closed\", the previous side pane is not \"re-opened\".\n if (!isShowing(overridePropsRef.current) && isShowing(props.overrideSidePane)) {\n setSidePaneRenderer(undefined);\n }\n overridePropsRef.current = props.overrideSidePane;\n }, [props.overrideSidePane]);\n\n const onSidePaneIdChange = props.onSidePaneIdChange;\n useEffect(() => {\n onSidePaneIdChange?.(sidePaneRenderer?.id);\n }, [sidePaneRenderer?.id, onSidePaneIdChange]);\n\n // When the call ends ensure the side pane is set to closed to prevent the side pane being open if the call is re-joined.\n useEffect(() => {\n const closeSidePane = (): void => {\n setSidePaneRenderer(undefined);\n };\n adapter.on('callEnded', closeSidePane);\n return () => {\n adapter.off('callEnded', closeSidePane);\n };\n }, [adapter]);\n\n const compositeAudioContext = useAudio();\n\n const capabilitiesChangedInfoAndRole = useSelector(capabilitiesChangedInfoAndRoleSelector);\n\n const capabilitiesChangedNotificationBarProps =\n useTrackedCapabilityChangedNotifications(capabilitiesChangedInfoAndRole);\n\n // Track the last dismissed errors of any error kind to prevent errors from re-appearing on subsequent page navigation\n // This works by tracking the most recent timestamp of any active error type.\n // And then tracking when that error type was last dismissed.\n const activeErrors = usePropsFor(ErrorBar).activeErrorMessages;\n const [trackedErrors, setTrackedErrors] = useState<TrackedErrors>({} as TrackedErrors);\n useEffect(() => {\n setTrackedErrors((prev) => updateTrackedErrorsWithActiveErrors(prev, activeErrors));\n }, [activeErrors]);\n const onDismissError = useCallback((error: ActiveErrorMessage) => {\n setTrackedErrors((prev) => trackErrorAsDismissed(error.type, prev));\n }, []);\n const latestErrors = useMemo(() => filterLatestErrors(activeErrors, trackedErrors), [activeErrors, trackedErrors]);\n const callees = useSelector(getTargetCallees) as StartCallIdentifier[];\n const locale = useLocale();\n const palette = useTheme().palette;\n /* @conditional-compile-remove(PSTN-calls) */\n const alternateCallerId = adapter.getState().alternateCallerId;\n const leavePageStyle = useMemo(() => leavingPageStyle(palette), [palette]);\n let pageElement: JSX.Element | undefined;\n const [pinnedParticipants, setPinnedParticipants] = useState<string[]>([]);\n switch (page) {\n case 'configuration':\n pageElement = (\n <ConfigurationPage\n mobileView={props.mobileView}\n startCallHandler={(): void => {\n if (callees) {\n adapter.startCall(\n callees,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId\n ? { alternateCallerId: { phoneNumber: alternateCallerId } }\n : {}\n );\n } else {\n adapter.joinCall({\n microphoneOn: 'keep',\n cameraOn: 'keep'\n });\n }\n }}\n updateSidePaneRenderer={setSidePaneRenderer}\n latestErrors={latestErrors}\n onDismissError={onDismissError}\n modalLayerHostId={props.modalLayerHostId}\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks={props.options?.deviceChecks}\n /* @conditional-compile-remove(call-readiness) */\n onPermissionsTroubleshootingClick={props.options?.onPermissionsTroubleshootingClick}\n /* @conditional-compile-remove(call-readiness) */\n onNetworkingTroubleShootingClick={props.options?.onNetworkingTroubleShootingClick}\n capabilitiesChangedNotificationBarProps={capabilitiesChangedNotificationBarProps}\n logo={props.options?.branding?.logo}\n backgroundImage={props.options?.branding?.backgroundImage}\n />\n );\n break;\n case 'accessDeniedTeamsMeeting':\n pageElement = (\n <NoticePage\n iconName=\"NoticePageAccessDeniedTeamsMeeting\"\n title={locale.strings.call.failedToJoinTeamsMeetingReasonAccessDeniedTitle}\n moreDetails={locale.strings.call.failedToJoinTeamsMeetingReasonAccessDeniedMoreDetails}\n dataUiId={'access-denied-teams-meeting-page'}\n />\n );\n break;\n case 'removedFromCall':\n pageElement = (\n <NoticePage\n iconName=\"NoticePageRemovedFromCall\"\n title={locale.strings.call.removedFromCallTitle}\n moreDetails={locale.strings.call.removedFromCallMoreDetails}\n dataUiId={'removed-from-call-page'}\n />\n );\n break;\n case 'joinCallFailedDueToNoNetwork':\n pageElement = (\n <NoticePage\n iconName=\"NoticePageJoinCallFailedDueToNoNetwork\"\n title={locale.strings.call.failedToJoinCallDueToNoNetworkTitle}\n moreDetails={locale.strings.call.failedToJoinCallDueToNoNetworkMoreDetails}\n dataUiId={'join-call-failed-due-to-no-network-page'}\n />\n );\n break;\n case 'leaving':\n pageElement = (\n <NoticePage\n title={locale.strings.call.leavingCallTitle ?? 'Leaving...'}\n dataUiId={'leaving-page'}\n pageStyle={leavePageStyle}\n disableStartCallButton={true}\n />\n );\n break;\n case 'leftCall': {\n const { title, moreDetails, disableStartCallButton, iconName } = getEndedCallPageProps(locale, endedCall);\n /* @conditional-compile-remove(end-of-call-survey) */\n if (!props.options?.surveyOptions?.disableSurvey) {\n pageElement = (\n <SurveyPage\n dataUiId={'left-call-page'}\n surveyOptions={props.options?.surveyOptions}\n iconName={iconName}\n title={title}\n moreDetails={moreDetails}\n disableStartCallButton={disableStartCallButton}\n mobileView={props.mobileView}\n />\n );\n break;\n }\n pageElement = (\n <NoticePage\n iconName={iconName}\n title={title}\n moreDetails={callees ? '' : moreDetails}\n dataUiId={'left-call-page'}\n disableStartCallButton={disableStartCallButton}\n />\n );\n\n break;\n }\n case 'lobby':\n pageElement = (\n <LobbyPage\n mobileView={props.mobileView}\n modalLayerHostId={props.modalLayerHostId}\n options={props.options}\n updateSidePaneRenderer={setSidePaneRenderer}\n mobileChatTabHeader={props.mobileChatTabHeader}\n latestErrors={latestErrors}\n onDismissError={onDismissError}\n capabilitiesChangedNotificationBarProps={capabilitiesChangedNotificationBarProps}\n />\n );\n break;\n case 'transferring':\n pageElement = (\n <TransferPage\n mobileView={props.mobileView}\n modalLayerHostId={props.modalLayerHostId}\n options={props.options}\n updateSidePaneRenderer={setSidePaneRenderer}\n mobileChatTabHeader={props.mobileChatTabHeader}\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n latestErrors={latestErrors}\n onDismissError={onDismissError}\n capabilitiesChangedNotificationBarProps={capabilitiesChangedNotificationBarProps}\n />\n );\n break;\n case 'call':\n pageElement = (\n <CallPage\n callInvitationURL={callInvitationUrl}\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={onFetchParticipantMenuItems}\n mobileView={props.mobileView}\n modalLayerHostId={props.modalLayerHostId}\n options={props.options}\n updateSidePaneRenderer={setSidePaneRenderer}\n mobileChatTabHeader={props.mobileChatTabHeader}\n onCloseChatPane={props.onCloseChatPane}\n latestErrors={latestErrors}\n onDismissError={onDismissError}\n galleryLayout={userSetGalleryLayout}\n onUserSetGalleryLayoutChange={setUserSetGalleryLayout}\n onSetUserSetOverflowGalleryPosition={setUserSetOverflowGalleryPosition}\n userSetOverflowGalleryPosition={userSetOverflowGalleryPosition}\n capabilitiesChangedNotificationBarProps={capabilitiesChangedNotificationBarProps}\n pinnedParticipants={pinnedParticipants}\n setPinnedParticipants={setPinnedParticipants}\n compositeAudioContext={compositeAudioContext}\n />\n );\n break;\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n case 'hold':\n pageElement = (\n <>\n {\n <HoldPage\n mobileView={props.mobileView}\n modalLayerHostId={props.modalLayerHostId}\n options={props.options}\n updateSidePaneRenderer={setSidePaneRenderer}\n mobileChatTabHeader={props.mobileChatTabHeader}\n latestErrors={latestErrors}\n onDismissError={onDismissError}\n capabilitiesChangedNotificationBarProps={capabilitiesChangedNotificationBarProps}\n />\n }\n </>\n );\n break;\n }\n\n useEndedCallConsoleErrors(endedCall);\n\n /* @conditional-compile-remove(unsupported-browser) */\n switch (page) {\n case 'unsupportedEnvironment':\n pageElement = (\n <>\n {\n /* @conditional-compile-remove(unsupported-browser) */\n <UnsupportedBrowserPage\n onTroubleshootingClick={props.options?.onEnvironmentInfoTroubleshootingClick}\n environmentInfo={adapter.getState().environmentInfo}\n />\n }\n </>\n );\n break;\n }\n\n if (!pageElement) {\n throw new Error('Invalid call composite page');\n }\n\n return (\n <SidePaneProvider sidePaneRenderer={sidePaneRenderer} overrideSidePane={injectedSidePaneProps}>\n {pageElement}\n </SidePaneProvider>\n );\n};\n\n/**\n * A customizable UI composite for calling experience.\n *\n * @remarks Call composite min width/height are as follow:\n * - mobile: 17.5rem x 21rem (280px x 336px, with default rem at 16px)\n * - desktop: 30rem x 22rem (480px x 352px, with default rem at 16px)\n *\n * @public\n */\nexport const CallComposite = (props: CallCompositeProps): JSX.Element => <CallCompositeInner {...props} />;\n\n/**\n * @private\n */\nexport interface InternalCallCompositeProps {\n overrideSidePane?: InjectedSidePaneProps;\n onSidePaneIdChange?: (sidePaneId: string | undefined) => void;\n onCloseChatPane?: () => void;\n // legacy property to avoid breaking change\n mobileChatTabHeader?: MobileChatSidePaneTabHeaderProps;\n}\n\n/** @private */\nexport const CallCompositeInner = (props: CallCompositeProps & InternalCallCompositeProps): JSX.Element => {\n const {\n adapter,\n callInvitationUrl,\n onFetchAvatarPersonaData,\n onFetchParticipantMenuItems,\n options,\n formFactor = 'desktop'\n } = props;\n\n const mobileView = formFactor === 'mobile';\n\n const modalLayerHostId = useId('modalLayerhost');\n const mainScreenContainerClassName = useMemo(() => {\n return mobileView ? mainScreenContainerStyleMobile : mainScreenContainerStyleDesktop;\n }, [mobileView]);\n\n return (\n <div className={mainScreenContainerClassName}>\n <BaseProvider {...props}>\n <CallAdapterProvider adapter={adapter}>\n <MainScreen\n callInvitationUrl={callInvitationUrl}\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={onFetchParticipantMenuItems}\n mobileView={mobileView}\n modalLayerHostId={modalLayerHostId}\n options={options}\n onSidePaneIdChange={props.onSidePaneIdChange}\n overrideSidePane={props.overrideSidePane}\n mobileChatTabHeader={props.mobileChatTabHeader}\n onCloseChatPane={props.onCloseChatPane}\n />\n {\n // This layer host is for ModalLocalAndRemotePIP in SidePane. This LayerHost cannot be inside the SidePane\n // because when the SidePane is hidden, ie. style property display is 'none', it takes up no space. This causes problems when dragging\n // the Modal because the draggable bounds thinks it has no space and will always return to its initial position after dragging.\n // Additionally, this layer host cannot be in the Call Arrangement as it needs to be rendered before useMinMaxDragPosition() in\n // common/utils useRef is called.\n // Warning: this is fragile and works because the call arrangement page is only rendered after the call has connected and thus this\n // LayerHost will be guaranteed to have rendered (and subsequently mounted in the DOM). This ensures the DOM element will be available\n // before the call to `document.getElementById(modalLayerHostId)` is made.\n <LayerHost id={modalLayerHostId} className={mergeStyles(modalLayerHostStyle)} />\n }\n </CallAdapterProvider>\n </BaseProvider>\n </div>\n );\n};\n\nconst getQueryOptions = (options: { role?: ParticipantRole }): PermissionConstraints => {\n if (options.role === 'Consumer') {\n return {\n video: false,\n audio: true\n };\n }\n return { video: true, audio: true };\n};\n"]}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
/**
|
3
|
+
* @private
|
4
|
+
*/
|
5
|
+
export interface ACSAudioProviderProps {
|
6
|
+
audioContext: AudioContext;
|
7
|
+
children: JSX.Element;
|
8
|
+
}
|
9
|
+
/**
|
10
|
+
*
|
11
|
+
* @param props
|
12
|
+
* @returns
|
13
|
+
*/
|
14
|
+
export declare const ACSAudioProvider: (props: ACSAudioProviderProps) => JSX.Element;
|
15
|
+
/**
|
16
|
+
* @private
|
17
|
+
*/
|
18
|
+
export declare const useAudio: () => AudioContext;
|
19
|
+
//# sourceMappingURL=AudioProvider.d.ts.map
|
@@ -0,0 +1,25 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT License.
|
3
|
+
import React, { useContext, createContext } from 'react';
|
4
|
+
/**
|
5
|
+
*
|
6
|
+
* @param props
|
7
|
+
* @returns
|
8
|
+
*/
|
9
|
+
export const ACSAudioProvider = (props) => {
|
10
|
+
const { audioContext, children } = props;
|
11
|
+
const alreadyWrapped = useAudio();
|
12
|
+
if (alreadyWrapped) {
|
13
|
+
return React.createElement(React.Fragment, null, children);
|
14
|
+
}
|
15
|
+
return React.createElement(ACSAudioContext.Provider, { value: audioContext }, props.children);
|
16
|
+
};
|
17
|
+
/**
|
18
|
+
* @private
|
19
|
+
*/
|
20
|
+
const ACSAudioContext = createContext(new AudioContext());
|
21
|
+
/**
|
22
|
+
* @private
|
23
|
+
*/
|
24
|
+
export const useAudio = () => useContext(ACSAudioContext);
|
25
|
+
//# sourceMappingURL=AudioProvider.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AudioProvider.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/common/AudioProvider.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAUzD;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAA4B,EAAe,EAAE;IAC5E,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACzC,MAAM,cAAc,GAAG,QAAQ,EAAE,CAAC;IAClC,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,0CAAG,QAAQ,CAAI,CAAC;IACzB,CAAC;IACD,OAAO,oBAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAAG,KAAK,CAAC,QAAQ,CAA4B,CAAC;AACpG,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,eAAe,GAAG,aAAa,CAAe,IAAI,YAAY,EAAE,CAAC,CAAC;AAExE;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAiB,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useContext, createContext } from 'react';\n\n/**\n * @private\n */\nexport interface ACSAudioProviderProps {\n audioContext: AudioContext;\n children: JSX.Element;\n}\n\n/**\n *\n * @param props\n * @returns\n */\nexport const ACSAudioProvider = (props: ACSAudioProviderProps): JSX.Element => {\n const { audioContext, children } = props;\n const alreadyWrapped = useAudio();\n if (alreadyWrapped) {\n return <>{children}</>;\n }\n return <ACSAudioContext.Provider value={audioContext}>{props.children}</ACSAudioContext.Provider>;\n};\n\n/**\n * @private\n */\nconst ACSAudioContext = createContext<AudioContext>(new AudioContext());\n\n/**\n * @private\n */\nexport const useAudio = (): AudioContext => useContext(ACSAudioContext);\n"]}
|
@@ -7,6 +7,7 @@ import { LocalizationProvider } from '../localization';
|
|
7
7
|
import { DEFAULT_COMPOSITE_ICONS } from './icons';
|
8
8
|
import { globalLayerHostStyle } from './styles/GlobalHostLayer.styles';
|
9
9
|
import { useId } from '@fluentui/react-hooks';
|
10
|
+
import { ACSAudioProvider } from './AudioProvider';
|
10
11
|
/**
|
11
12
|
* A base provider {@link React.Context} to wrap components with other required providers
|
12
13
|
* (e.g. icons, FluentThemeProvider, LocalizationProvider).
|
@@ -40,12 +41,17 @@ export const BaseProvider = (props) => {
|
|
40
41
|
* to ensure all icons render correctly.
|
41
42
|
*/
|
42
43
|
registerIcons({ icons: Object.assign(Object.assign({}, iconsToRegister), props.icons) });
|
44
|
+
/**
|
45
|
+
* We need to create one context for the AudioProvider to ensure that we only have one instance of the AudioContext.
|
46
|
+
*/
|
47
|
+
const compositeAudioContext = new AudioContext();
|
43
48
|
// we use Customizer to override default LayerHost injected to <body />
|
44
49
|
// which stop polluting global dom tree and increase compatibility with react-full-screen
|
45
50
|
const CompositeElement = (React.createElement(FluentThemeProvider, { fluentTheme: fluentTheme, rtl: rtl },
|
46
51
|
React.createElement("meta", { name: "viewport", content: "width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" }),
|
47
52
|
React.createElement(Customizer, { scopedSettings: { Layer: { hostId: globalLayerHostId } } },
|
48
|
-
React.createElement(
|
53
|
+
React.createElement(ACSAudioProvider, { audioContext: compositeAudioContext },
|
54
|
+
React.createElement(WithBackgroundColor, null, props.children))),
|
49
55
|
React.createElement(LayerHost, { id: globalLayerHostId, className: mergeStyles(globalLayerHostStyle) })));
|
50
56
|
const localizedElement = locale ? LocalizationProvider({ locale, children: CompositeElement }) : CompositeElement;
|
51
57
|
return React.createElement(BaseContext.Provider, { value: true }, localizedElement);
|